File tree Expand file tree Collapse file tree 1 file changed +22
-3
lines changed Expand file tree Collapse file tree 1 file changed +22
-3
lines changed Original file line number Diff line number Diff line change @@ -229,13 +229,32 @@ public override void OnStartFinished(StartState state)
229229
230230 public override string GetInfo ( )
231231 {
232+ // Rearrange building string used in VAB PartInfo popup, so that it is
233+ // only defined for tanks that switch resources. This is to drop side
234+ // panels that just list multiple texture changes adding clutter with
235+ // no functionally useful data about the part.
236+
232237 InitializeSubtypes ( ) ;
233- string outStr = $ "<b><color=#7fdfffff>{ SubtypesCount } { switcherDescriptionPlural } </color></b>";
238+ string outStr = " " ; // just to keep it from being undefined and throwing an error.
239+
240+ bool onetime = true ; // For subtype count and desciption
234241 foreach ( var subtype in subtypes )
235242 {
236- outStr += $ " \n <b>- { subtype . title } </b>" ;
243+ bool first = true ; // for subtype title
237244 foreach ( var resource in subtype . tankType )
238- outStr += $ "\n <color=#99ff00ff>- { resource . resourceDefinition . displayName } </color>: { resource . unitsPerVolume * GetTotalVolume ( subtype ) : 0.#} ";
245+ {
246+ if ( onetime )
247+ {
248+ onetime = false ;
249+ outStr = $ "<b><color=#7fdfffff>{ SubtypesCount } { switcherDescriptionPlural } </color></b>";
250+ }
251+ if ( first )
252+ {
253+ first = false ;
254+ outStr += $ "\n <b>- { subtype . title } </b>";
255+ }
256+ outStr += $ "\n <color=#99ff00ff>- { resource . resourceDefinition . displayName } </color>: { resource . unitsPerVolume * GetTotalVolume ( subtype ) : 0.#} ";
257+ }
239258 }
240259 return outStr ;
241260 }
You can’t perform that action at this time.
0 commit comments