Asterix Gaming Guild Logo GeneralXXLXXL 2XXL 3XXXLOlympic GamesXXL EditorToolsOff-TopicXXL RomasteredXXL 2 RemasteredOther GamesModsCaesar's ChallengeUnfair XXLPatchesFan ArtPersonal ArtSpeedrunningMediaRandomizerBETA RomeHSKALPresence AdrienPresence SPQRSupport Bot Helpdesk

#editor

deathhound246
i was also being extra stupid i had the variable predefined outside a check if the json has the class. inside the true block i was just creating a new variable :Obelul:
deathhound246
it is very nearly working now though
adrientd
If you want you can use fmt::println instead of printf, it's very simple and you don't have to use c_str() anymore Just need to #include
adrientd
Now you can use .get() to get the string without the quotes
deathhound246
🎉
deathhound246
idk why but these like 5 lines to make this work feel so "hacky" :Obelul:
adrientd
or you can use classinfo.value("name", "?") which would give a default value "?" if ever the name property does not exist
deathhound246
tbh i feel like that would just be shadowing potential other mistakes we already predefine it to "?" if the class isn't in the json. defaulting it if there is json, but field is missing is probably shadowing the issue that it is missing to begin with :Obelul:
deathhound246
quick copy paste and its on globals now too
adrientd
Yeah, not only the class might not exist, but it could also exist without the name property (even though that means someone forgot to put it)
deathhound246
that would be an issue in itself though. surely there'd be somewhere else to need to get the name from the encyclopedia
deathhound246
mind if i pr these changes to your repo?
adrientd
Hmmm, I guess you could
adrientd
I might still have to think if there may be other alternatives to get the string names, but I guess the Json files should be good
adrientd
I don't think there's much reason to put in another different file as the Json already contains class names for several ones and it would be stupid to duplicate them
deathhound246
Tbf it is a static way to get the classnames. Handy enough for future parts of hex ui where the classes cant be registered
adrientd
I was especially thinking of how the old editor reads the class names from a simple text file, maybe we could read from files like these (and they are already complete for XXL1/2/OG)
adrientd
But also the Encyclopedia JSON are supposed to be the ultimate source of information, so may be good to store everything there :Obelul:
deathhound246
I have a list of most classnames + matching catid and clids for Alice too
deathhound246
Well, classes that editor can see there are objects creating from that direct class of (no parent classes etc)