@@ -36,6 +36,11 @@ module.exports = class extends Generator {
3636 name : "steamPath" ,
3737 message : "Where is steam installed?" ,
3838 default : "C:\\Program Files (x86)\\Steam\\steamapps"
39+ } ,
40+ {
41+ type : "input" ,
42+ name : "description" ,
43+ message : "Provide a description of your mod"
3944 }
4045 ] ) ;
4146
@@ -76,28 +81,42 @@ module.exports = class extends Generator {
7681 this . modIdCamel = toCamelCase ( this . answers . modIdPascal ) ;
7782
7883 if ( this . customizations . createChar ) {
79- this . characterName = await this . prompt ( {
80- type : "input" ,
81- name : "charName" ,
82- message : "What is the name of the character (in PascalCase)?" ,
83- default : "TheTodo"
84- } ) ;
84+ this . character = await this . prompt ( [
85+ {
86+ type : "input" ,
87+ name : "charName" ,
88+ message : "What is the name of the character (in PascalCase)?" ,
89+ default : "TheTodo"
90+ } ,
91+ {
92+ type : "input" ,
93+ name : "charColor" ,
94+ message : "What is the color for this character?" ,
95+ default : "GREY"
96+ }
97+ ] ) ;
8598 } else {
86- this . characterName = { charName : "TheTodo" } ;
99+ this . character = { charName : "TheTodo" , charColor : "GREY " } ;
87100 }
88101
89102 // Change TheTodo to THE_TODO for use in Enums
90- this . characterName . charNameEnum = this . characterName . charName
103+ this . character . charNameEnum = this . character . charName
91104 . split ( / (? = [ A - Z ] ) / )
92105 . join ( "_" )
93106 . toUpperCase ( ) ;
94107 // Change TheTodo to The Todo and the Todo for charstrings
95- this . characterName . charStringsCapital = this . characterName . charName
108+ this . character . charStringsCapital = this . character . charName
96109 . replace ( / ( [ A - Z ] ) / g, " $1" )
97110 . trim ( ) ;
98- this . characterName . charStringsFirstLower =
99- this . characterName . charStringsCapital . slice ( 0 , 1 ) . toLowerCase ( ) +
100- this . characterName . charStringsCapital . slice ( 1 ) ;
111+ this . character . charStringsFirstLower =
112+ this . character . charStringsCapital . slice ( 0 , 1 ) . toLowerCase ( ) +
113+ this . character . charStringsCapital . slice ( 1 ) ;
114+ // Change color Enum
115+ this . character . charColor = (
116+ this . character . charName . toLowerCase ( ) . replace ( "the" , "" ) +
117+ "_" +
118+ this . character . charColor
119+ ) . toUpperCase ( ) ;
101120 }
102121
103122 writing ( ) {
@@ -115,8 +134,9 @@ module.exports = class extends Generator {
115134 createRelics : this . customizations . createRelics ,
116135 createPowers : this . customizations . createPowers ,
117136 createChar : this . customizations . createChar ,
118- charName : this . characterName . charName ,
119- charNameEnum : this . characterName . charNameEnum
137+ charName : this . character . charName ,
138+ charNameEnum : this . character . charNameEnum ,
139+ charColor : this . character . charColor
120140 }
121141 ) ;
122142
@@ -125,15 +145,16 @@ module.exports = class extends Generator {
125145 this . fs . copyTpl (
126146 this . templatePath ( `src/main/java/theTodo/TheTodo.java` ) ,
127147 this . destinationPath (
128- `src/main/java/${ this . modIdCamel } /${ this . characterName . charName } .java`
148+ `src/main/java/${ this . modIdCamel } /${ this . character . charName } .java`
129149 ) ,
130150 {
131151 modIdPascal : this . answers . modIdPascal ,
132152 modIdCamel : this . modIdCamel ,
133153 createCards : this . customizations . createCards ,
134154 createRelics : this . customizations . createRelics ,
135- charName : this . characterName . charName ,
136- charNameEnum : this . characterName . charNameEnum
155+ charName : this . character . charName ,
156+ charNameEnum : this . character . charNameEnum ,
157+ charColor : this . character . charColor
137158 }
138159 ) ;
139160 }
@@ -149,7 +170,8 @@ module.exports = class extends Generator {
149170 modIdSpaces : this . answers . modIdPascal
150171 . replace ( / ( [ A - Z ] ) / g, " $1" )
151172 . slice ( 1 ) ,
152- steamPath : this . answers . steamPath
173+ steamPath : this . answers . steamPath ,
174+ description : this . answers . description
153175 }
154176 ) ;
155177
@@ -196,7 +218,8 @@ module.exports = class extends Generator {
196218 modIdPascal : this . answers . modIdPascal ,
197219 modIdCamel : this . modIdCamel ,
198220 createChar : this . customizations . createChar ,
199- charName : this . characterName . charName
221+ charName : this . character . charName ,
222+ charColor : this . character . charColor
200223 } ,
201224 null ,
202225 { globOptions : { dot : true } }
@@ -227,7 +250,8 @@ module.exports = class extends Generator {
227250 modIdPascal : this . answers . modIdPascal ,
228251 modIdCamel : this . modIdCamel ,
229252 createChar : this . customizations . createChar ,
230- charName : this . characterName . charName
253+ charName : this . character . charName ,
254+ charColor : this . character . charColor
231255 } ,
232256 null ,
233257 { globOptions : { dot : true } }
@@ -257,9 +281,9 @@ module.exports = class extends Generator {
257281 {
258282 modIdPascal : this . answers . modIdPascal ,
259283 modIdCamel : this . modIdCamel ,
260- charName : this . characterName . charName ,
261- charStringsCapital : this . characterName . charStringsCapital ,
262- charStringsFirstLower : this . characterName . charStringsFirstLower
284+ charName : this . character . charName ,
285+ charStringsCapital : this . character . charStringsCapital ,
286+ charStringsFirstLower : this . character . charStringsFirstLower
263287 } ,
264288 null ,
265289 { globOptions : { dot : true } }
0 commit comments