Dynamic Cosmetics Editor for Custom Models#6429
Dynamic Cosmetics Editor for Custom Models#6429Jameriquiah wants to merge 10 commits intoHarbourMasters:developfrom
Conversation
|
That is so much cleaner than what i had to do on my old pr |
|
I have tested the feature with my custom model, and can confirm that both this build and the feature successfully work on Linux. |
|
would it be preferable to keep the custom entries where i have it now in the Link & Items tab or should i give it its own tab? |
|
Does the test mod on the 2ship PR work here as well, at least for showing the controls? |
no, itll prolly crash soh tbh, i made a test mod for this one but forgot to upload it, one sec lol |
|
saladcolortest.zip |
|
ok and bam, separate file now |
| } | ||
|
|
||
| static std::string GetCustomCosmeticCvar(const CustomCosmeticEntry& entry) { | ||
| return entry.colorCvar.substr(0, entry.colorCvar.size() - std::string(".Value").size()); |
There was a problem hiding this comment.
You're just trying to add ".Value" to the end of the cvar, right?
There was a problem hiding this comment.
Ohhh, wait, you have .Value on there already, and this is removing that. I swear this could be handled better if you used the COSMETIC_OPTION macro and the CosmeticOption struct instead of what you have here. What do you need that wouldn't be handled on that struct?
There was a problem hiding this comment.
yea probably, its a little awkward. its for the base color value, so it knows what to revert to if u reset the color
There was a problem hiding this comment.
alright i think that should be a little better
Malkierian
left a comment
There was a problem hiding this comment.
I think this is good enough for a first-iteration. Since everything is in its own file anyway, it won't affect anything else, and iteration and streamlining of code can come later.
|
sounds good! anything u need or want me to change just let me know and i can get on it :3 |
|
My end goal was for you to replace usage of your |
|
You don't have to use the table that the macro is used for in the Cosmetics Editor code, just the macro in your own storage structure. It should be possible to use it with a dynamic storage container. |
|
oh that was actually one of the few duped things that i dont think can be changed, i mean maybe? its entirely possible i just lack intelligence. i just couldnt figure out another way to do it that would also allow the colors to save between play sessions instead of just resetting to default everytime the game is restarted |
|
I think you were just too focused on the fact that the macro was used within a table initialization. The macro just returns a CosmeticEntry object that gets automatically added to the array at the index of its row count, that's all. |
|
ahh, makes sense |
|
alright im back home now, do u wanna just get this in as is? or is it cool if i make a few small changes? |
|
What kind of small changes? |
|
i can always pr them later if needed, but 1 i wanted to grayscale rgba textures when their color is changed so ugly color multiplication doesnt happen on textures with baked in color, and 2 allow entries that share a name with a vanilla static one to use it instead (not super high priority tbh) |
|
neither of these are super important tho so im totally fine holding off tbh |
|
I'd rather get this in first, then. |
|
alright thats fine :3 |
port of HarbourMasters/2ship2harkinian#1617
same concept as over there, modders can set cosmetic entries and customize the name to whatever they want by adding a small tag into the primitive color line in the material xml
<SetPrimColor M="0" L="0" R="255" G="255" B="255" A="255" CosmeticEntry="Entry Name"/>big difference here is i also added category support bc ships cosmetics editor is much bigger than 2ships, i can prolly add that over there too tho ig
so u would do
<SetPrimColor M="0" L="0" R="255" G="255" B="255" A="255" CosmeticCategory="Category Name" CosmeticEntry="Entry Name"/>u can set cosmetic entries for anything in the game that u want to replace, so its not just limited to the player.
i will also add a way to automate this into fast64 soon to manual editing xml's wont be necessary
Build Artifacts