Files
Bubberstation/code/controllers/configuration/configuration.dm
SkyratBot cacc49db8b [MIRROR] Datumizes out jobconfig.toml (extensibility edition) [MDB IGNORE] (#22243)
* Datumizes out jobconfig.toml (extensibility edition) (#76102)

## About The Pull Request

Hey there,

#75992 (fc54fd6a60) made me realize just
how wacky the job config system is to people trying to add more new
stuff to it, so I finally got the motivation to fix it up.

The gist is that it does all of the same stuff on the front-end as you
would expect, but instead of having to modify core generation code to
create/recreate the files, it instead uses a robust series of getters
and setters. It's much better to use these getters and setters because
we can apply needed game logic (like ensuring that the age that the
server operator puts in is actually sane, and not completely out of
bounds (if you want to permanently price people out of a position, just
set it to 0)). The getters are also nifty too, because they let me atone
for an early mistake I made with how assistants are meant to work with
"unlimited" nonsense.

All a new coder who wants to add stuff to the config needs to do now is
create the define, create the datum, add the procs for the datums, and
that's it! They don't have to do any of the wacky stuff or account for
weird stuff or do any weird copypasta, it's all handled by the system.
One datum is all you need, quite neat.

This also fixes some issues in #75992 that probably weren't discovered
in testing, but the only good way to fix it was a retune+refactor, which
is included in this PR.
## Why It's Good For The Game

Much more extensible, ensuring this system actually works as fully
intended, etc.

I fixed up the documentation (they didn't regenerate the job config
after they updated the code-side documentation) and some weird spacing
stuff that I missed in my review of that aforementioned PR. Everything
should work as expected, it's been tested quite a bit. It's also in its
own folder now, which is neat because we can share the local defines and
split all this stuff out of the already-quite-large SSjob file.
## Changelog
🆑
server: job_config.toml should now comply with reload-configuration
verb, meaning you can hot-reload the configuration from disk and have it
apply ingame automatically.
config: The documentation for setting Minimum Character Age on a per-Job
basis has been altered to be more explicit.
fix: The Minimum Character Age configuration entry is now sanitized to
ensure that it's within the codebase-defined ages, since there's no
(legitimate) way to get a character outside of those ages anyways.
Invalid values will log to the config log.
/🆑

---------

Co-authored-by: Jacquerel <hnevard@ gmail.com>

* Datumizes out jobconfig.toml (extensibility edition)

---------

Co-authored-by: san7890 <the@san7890.com>
Co-authored-by: Jacquerel <hnevard@ gmail.com>
Co-authored-by: lessthanthree <83487515+lessthnthree@users.noreply.github.com>
2023-07-11 23:13:41 -04:00

18 KiB