* Tackles various problems with keyed_list config entries, fixing broken roundstart races and more! (#62359)
While helping RaveRadbury debug some issues with enabling Halloween species early via the brute force method of enabling them in the config rather than the gentleman's solution of testmerging a PR that changes the Halloween date, we discovered something dreadful.
Cloth golems cannot be enabled! Infact, any species with a space in the ID cannot be enabled.
It uses the splitter despite VALUE_MODE_FLAG being set. So a key entry like ROUNDSTART_RACES cloth golem would get parsed as cloth = golem, then entered into the config as cloth = TRUE
NEW AND IMPROVED PART HERE
I've re-written how keyed_list config entries are parsed, splitting it into a number of procs to do some discrete block of logic.
Based on feedback from MSO, he expected that VALUE_MODE_FLAG keyed_list entries could have elements overridden. However, this functionality was not present in the code.
I have implemented it. We now support 3 methods of setting VALUE_MODE_FLAGS.
Implicitly enable the config entry: CONFIG_ENTRY config_key_goes_here
Explicitly enable the config entry: CONFIG_ENTRY config_key_goes_here 1
Explicitly disable the config entry: CONFIG_ENTRY config_key_goes_here 0
There have been functionality changes too. Previously, everything before the first splitter was the key and everything after was the value. However, in ambiguous config entries (Such as ROUNDSTART_RACES cloth golem 0) it would be unclear if the intent was (cloth, golem 0) or (cloth golem, 0) or indeed if the intent was (cloth golem 0, 1).
As a result, there is now the following paradigm in place: Everything after the LAST splitter is the value, everything before is the key and a log_config warning is now given explaining the problem and showing how it was resolved.
[2021-10-27 19:48:12.840] WARNING: Multiple splitter characters (" ") found. Using "cloth golem" as config key and "1" as config value.
This warning will trigger if multiple splitters are present for any keyed_list config entry, and will trigger on implicit VALUE_MODE_FLAGS entries that have splitters. The example above is it triggering on ROUNDSTART_RACES cloth golem - It has detected that there is potential ambiguity between (cloth, golem) or (cloth golem, 1), has picked a sensible option for the data type and has warned about it.
The intent is that no config entry should be ambiguous. It should be clear what is key and what is value when dealing with keyed_list config entries.
There's probably more work to do on other config entries to bring them up to this standard, but this is the thing I'm hitting in this PR.
Similarly, I have improved the validation aspect of keyed_list config entries with additional logging in general.
[2021-10-27 19:47:53.135] ERROR: Invalid KEY_MODE_TYPE typepath. Is not a valid typepath: /mob/living/carbon/monkey
I have added a unit test to make sure species IDs do not contain splitters from the two keyed_list subtypes relating to species.
I have added sanity checking to the race config subtypes since we have a big dick global list of all races sorted by ID, so a race not existing will fail validation and output a meaningful config log entry.
I have removed /datum/config_entry/keyed_list/probability from the code as it is unused with the removal of all game modes except Dynamic.
The config change necessitated the renaming of all golem species IDs. Doing so and renaming the clothgolem.ts file to match has fixed the broken cloth golem page too.
* Tackles various problems with keyed_list config entries, fixing broken roundstart races and more!
Co-authored-by: Timberpoes <silent_insomnia_pp@hotmail.co.uk>
Added a lowercase variable to string, string lists and keyed list configs.
Currently lowercase is only TRUE for keyed lists because they have been working like that since 2018. It might be changed to be FALSE by default but it'll take a while looking at the parsed logs for the config entries.
Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
* Add $reset directive to config processor for setting a config entry to default value
* Update game_options.dm
Co-authored-by: Bobbahbrown <bobbahbrown@gmail.com>
Co-authored-by: Gandalf <jzo123@hotmail.com>
* Fix erroneous logging of config errors for str_list configuration type (#54676)
Fixed issue brought up by @ Cyberboss wherein the new ``str_list`` config type doesn't properly return true after setting the values and as a result has an erroneous error pop up in the config error log.
* Fix erroneous logging of config errors for str_list configuration type
Co-authored-by: Bobbahbrown <bobbahbrown@gmail.com>
* Unicode support Part 2 -- copytext()
This is the transition of all copytext() calls to be unicode aware and also some nearby calls in the same functions. Most things are just replacing copytext() with copytext_char() as a terrible character limiter but a few others were slightly more involved.
I replaced a ton of
````
var/something = sanitize(input())
something = copytext(something, 1, MAX_MESSAGE_LEN)
````
with a single stripped_input() call. stripped_input() already calls html_encode(), trim(), and some other sanitization so there shouldn't be any major issues there.
This is still VERY rough btw; DNA is a mess, the status displays are complete ass, there's a copytext() in code\datums\shuttles.dm that I'm not sure what to do with, and I didn't touch anything in the tools folder. I haven't tested this much at all yet, I only got it to compile earlier this morning. There's also likely to be weird bugs until I get around to fixing length(), findtext(), and the rest of the string procs.
* Makes the code functional
* Assume color hex strings are always # followed by ascii.
Properly encodes and decodes the stuff in mob_helpers.dm which fixes some issues there.
* Removes ninjaspeak since it's unused
In preparation of pixel movement, I want to refactor our slowdown system to something more modular, and something that doesn't require /quite/ as many proccalls/calculations a tick. The way this works is intended to only have things recalculate when it's necessary, rather than calling it every move.
However, I've left movement_delay() in, as without completely redoing a lot of code it's not /quite/ ready at this point to tear it out completely, but I'm hoping everything can be transitioned over to this system later.
This works around some vv-fu you can use to pass in a config_entry to a proc that reads the value var of some other datum. Byond is stupid enough to actually read it, so it must be uniquely named.
* Consolidates datum var location
* Move ui_screen to /datum/tgui
* Move focusers to datum.dm. Move fingerprintslast to /atom
* Remove focusers list, makes mobs check if their focus is QDELETED in Life()
* Consolidate use_tag and var_edited into datum_flags
* Revert garbage comment
* Thought I already removed this
* Remove the var_edited preservation
* Removes focus QDELETED handling
* Revert "all this wrapping and it's not even christmas (#33035)"
This reverts commit faaf151580.
* Revert "fuck me for forgetting to graph this one"
This reverts commit 45d7acea2f.
* Revert "defines math"
This reverts commit 2817a1737b.
* Configuration datum refactor
* More WIP
* New easier on the eyes format
* More WIP
* Finished config.txt
* Fucktons more WIP
* The end of conversion draws near...
* Add all this shit
* Done converting entries finally
* Hunting down compile errors
* More WIP
* MORE CONVERSIONS
* More WIP
* More WIP
* Oh shit only 90 errors this time!
* IT COMPILES!!!
* Fixes world start runtimes