Coloring GUI, default colors
Jimbodiah opened this issue ยท 17 comments
Is there a way to patch a new set of default colors into parts? i.e. pink/green instead of white/black (JK, but you get the idea).
Example of a patch to adjust all of the MFT-A/B tank model default colors:
@SSTU_MODEL[MFT-A-0-5|MFT-A-1-0|MFT-A-1-5|MFT-A-2-0|MFT-A-2-5|MFT-A-3-0|MFT-A-3-5|MFT-A-4-0|MFT-A-4-5|MFT-A-5-0|MFT-A-5-5|MFT-A-6-0|MFT-A-6-5|MFT-A-7-0|MFT-A-7-5|MFT-A-8-0|MFT-B-0-5|MFT-B-1-0|MFT-B-1-5|MFT-B-2-0|MFT-B-2-5|MFT-B-3-0|MFT-B-3-5|MFT-B-4-0|MFT-B-4-5|MFT-B-5-0|MFT-B-5-5|MFT-B-6-0|MFT-B-6-5|MFT-B-7-0|MFT-B-7-5|MFT-B-8-0]:FOR[SSTU]
{
@TEXTURESET[*]
{
@COLORS[*]
{
@mainColor = silver
@secondColor = silver
@detailColor = steel
}
}
}
Note that the color names must match the names of the existing preset colors (or of custom preset colors added through patches). If the color is not found by name it will either crash or default to 'white'.
Alternatively, patching the models to use a new 'default' texture set (replace 'newSetNameHere' with the name of your custom texture set).
@SSTU_MODEL[MFT-A-0-5|MFT-A-1-0|MFT-A-1-5|MFT-A-2-0|MFT-A-2-5|MFT-A-3-0|MFT-A-3-5|MFT-A-4-0|MFT-A-4-5|MFT-A-5-0|MFT-A-5-5|MFT-A-6-0|MFT-A-6-5|MFT-A-7-0|MFT-A-7-5|MFT-A-8-0|MFT-B-0-5|MFT-B-1-0|MFT-B-1-5|MFT-B-2-0|MFT-B-2-5|MFT-B-3-0|MFT-B-3-5|MFT-B-4-0|MFT-B-4-5|MFT-B-5-0|MFT-B-5-5|MFT-B-6-0|MFT-B-6-5|MFT-B-7-0|MFT-B-7-5|MFT-B-8-0]:FOR[SSTU]
{
@defaultTextureSet = newSetNameHere
}
Yes.
Are you looking to patch a specific model, or a specific part (MFT-A-3 (model), or MFT-A (part) (examples).
The texture sets (and default colors) are defined on a per-model basis. So the easiest way is to adjust the 'default colors' for the specific models in question.
The parts use these 'default colors' whenever the texture sets are switched, or models are switched. Additionally, the parts use the 'default texture set' for the model shown in the editor icon list.
The steps needed for each method are slightly different, but if you know which models/parts you are wanting to adjust, I'm sure I can help you get it figured out.
Basically any part. I tend to use Silver Metallic and some custom colors for all my ships now, it would save a lot of time to have these colors assigned as a default.
MFT-A, ISDC, SRB and engine mounts are the most used parts.
Hmm... that is a lot of different parts/models to patch :) (and still could be done either way).
If you look in GameData/SSTU/Data/TextureSets there are a bunch of texture set definition files for all of the models used by the various parts. These all contain the information that specifies the texture set textures and colors for all of the models used by SSTU. Inside those files you should see the basic config structure used by the texture set definitions.
One of the easiest ways to do this might be to create a new texture set (or two) that use your new default colors, and then simply patch that set as the new 'default set' for the models you are interested in adjusting. These could be done by cloning an existing texture set and replacing the default colors, quite possibly some very short patches for that method.
An alternate method would be to replace the existing 'default colors' used by the existing texture sets. Hopefully you'll see what would be needed after you look at the texture set config files.
And a final third method is to patch the custom-colors directly onto the parts so that any newly created parts start with those colors. This method is... untested... but should work in theory; basically you would be pre-specifying the persistent data that the modules normally write out to the save-file. Only it is in floating-point color notation, so there would be some math needed to convert from hex/byte colors to float colors (as well as the syntax must be exact).
No matter what way you do it though, adjusting the colors/textures for that many models is going to be a great deal of work.
No worries, just trying to get the issue tracker cleaned up a bit. Was leaving the 'question' flagged ones open for a bit longer (until I can make up proper documentation on things preferably).
trying to see how I can get all the colors changed in a patch somehow. You put some serious work into this feature, just seeing the wall of text added everywhere to add custom colors.
Which colors are you trying to change --
Presets - these are the named colors that are selectable in the recoloring GUI. They can be renamed, added/removed, or have colors adjusted.
Defaults - These are the colors that a texture set uses for its default colors when that set is selected. As it is specified as one of the 'preset colors', your only options here are to change it to a different preset color.
Only the colors.
@SSTU_MODEL[SRB-?-|Nozzle-SRB-|SSTU-SC-GEN-PDC|SSTU-SC-GEN-PPC]:NEEDS[SSTU]:AFTER[SSTU]
{
@Textureset[]
{
@Colors[]
{
@maincolor = silver
@secondColor = stockBlack
@detailColor = gold
}
}
}
For a software versioning tool, github sure sucks at presenting code in messages
LOL, what's the difference? just started playing with it all.
Ah, wait, the presets I did already, those have the RGB codes right? I have those already but just tired of changing every part.
Yeah, presets list the color code, and define the selections available for a specific part.
Sadly, from there, the only thing left is adding them to every part+adapter texture-set, which is quite a bit of work.
I guess I should ask what you are trying to accomplish as the end goal? Knowing that I might know of an easier way to get it done.
Edit: Just read your updated post with the patch snippet -- will think on it a bit to see if I can think of an easier way to edit the texture sets. It is a -ton- of texture sets though, so easy might be a relative term.
I think the easiest way to go about this would be to make a single 'blanket' patch that patched all MODEL_DATA texture sets, and then a secondary set of patches to 'fix' anything that you wanted to be unique.
Will work up examples shortly..
Oh, and for pasting code, there is a trick to make it show up with proper formatting. On a blank line, put four tilde characters (````), hit enter, paste your code, and then on blank line below your code put four more tilde characters (````).
Remove the parenthesis from below....
(````)
if(a>2)
goto 3;
(````)
And you get:
if(a>2)
goto 3;
I can't really think of any 'easy' way to do it except for the blanket patch. It is kind of a big club though, and wouldn't be as precise as other methods.
//first pass, blanket patch all texture sets to use custom colors
@SSTU_MODEL[*]
{
//this could also be made 'set specific' to be a bit more explicit on what sets to change, e.g. don't change cloth sets
//@TEXTURESET[MFT-Stripes1-Stringers|MFT-Stripes2-Stringers|....lots more here.....]
@TEXTURESET[*]
{
@COLORS[*]
{
@mainColor = silver
@secondColor = stockBlack
@detailColor = gold
}
}
}
//second pass, re-adjust any specific models or texture sets that you want
@SSTU_MODEL[specificModelsToFix]
{
@TEXTURESET[specificTextureSetToFix]
{
@COLORS[*]
{
@mainColor = white
@secondColor = black
@detailColor = steel
}
}
}
Would it be helpful if there were an in-game method to apply a user-selected/configurable color-scheme to parts?
Something like configure it once through a GUI to select the color pattern, and then a single key press or part-menu button to apply the stored pattern to all sections of the part. This would help facilitate building themed rockets/stages, as you wouldn't need to open the recoloring GUI for each part and section.