[MIRROR] Admin dynamic rule management [MDB IGNORE] (#24101)

* Admin dynamic rule management (#78720)

## About The Pull Request

![image](https://github.com/tgstation/tgstation/assets/7483112/a538643e-8d84-48b1-9dc0-c29a90d3a46c)
This PR adds a very ugly menu which allows admins to force dynamic
rulesets to be enabled or disabled.
Some admins asked if someone could add this and it seems reasonably
useful.

![image](https://github.com/tgstation/tgstation/assets/7483112/2a88cceb-0cdc-4d92-b688-19cd7daf31ae)

The information you have available becomes slightly more detailed once
the game is actually running, because then we know how many players and
how much threat there is.

![image](https://github.com/tgstation/tgstation/assets/7483112/91fdc7e7-dc3e-4b56-a2db-a33cb241e39b)

I don't know why the weight of every midround is 0 when I run locally.
It's fine.
Unfortunately, the interface I have crafted is hideous. This is because
it's not part of tgui and I am not very good at working with byond UIs
without my beautiful typescript. It functions though.
If anyone has any pointers I'll take 'em.

"Force disabling" a ruleset simply ensures it will never run.
"Force enabling" a ruleset disregards minimum population and minimum
threat rules, but doesn't ensure that the ruleset will run. It might
still be skipped due to low weight, insufficient threat to _buy_ it, or
other disqualifying factors.

## Why It's Good For The Game

It was an admin request so presumably they have some plans for it.
It's a less-intrusive way of theming a round than disabling dynamic and
running all the midround rules yourself.
If they want to temporarily set the game to traitorling I guess they can
do that. Or only heretic/cult.

## Changelog

🆑
admin: Admins can turn off dynamic rulesets (or force them on despite
not meeting the qualification criteria) on a per-round basis.
/🆑

* Admin dynamic rule management

---------

Co-authored-by: Jacquerel <hnevard@gmail.com>
This commit is contained in:
SkyratBot
2023-10-03 22:01:15 -07:00
committed by GitHub
co-authored by Jacquerel
parent 242fb29482
commit 1c78880cd6
8 changed files with 189 additions and 20 deletions
+33
View File
@@ -465,6 +465,39 @@
log_admin("[key_name(usr)] removed [rule] from the forced roundstart rulesets.")
message_admins("[key_name(usr)] removed [rule] from the forced roundstart rulesets.", 1)
else if (href_list["f_dynamic_ruleset_manage"])
if(!check_rights(R_ADMIN))
return
dynamic_ruleset_manager(usr)
else if (href_list["f_dynamic_ruleset_force_all_on"])
if(!check_rights(R_ADMIN))
return
force_all_rulesets(usr, RULESET_FORCE_ENABLED)
else if (href_list["f_dynamic_ruleset_force_all_off"])
if(!check_rights(R_ADMIN))
return
force_all_rulesets(usr, RULESET_FORCE_DISABLED)
else if (href_list["f_dynamic_ruleset_force_all_reset"])
if(!check_rights(R_ADMIN))
return
force_all_rulesets(usr, RULESET_NOT_FORCED)
else if (href_list["f_dynamic_ruleset_force_on"])
if(!check_rights(R_ADMIN))
return
set_dynamic_ruleset_forced(usr, locate(href_list["f_dynamic_ruleset_force_on"]), RULESET_FORCE_ENABLED)
else if (href_list["f_dynamic_ruleset_force_off"])
if(!check_rights(R_ADMIN))
return
set_dynamic_ruleset_forced(usr, locate(href_list["f_dynamic_ruleset_force_off"]), RULESET_FORCE_DISABLED)
else if (href_list["f_dynamic_ruleset_force_reset"])
if(!check_rights(R_ADMIN))
return
set_dynamic_ruleset_forced(usr, locate(href_list["f_dynamic_ruleset_force_reset"]), RULESET_NOT_FORCED)
else if (href_list["f_inspect_ruleset"])
if(!check_rights(R_ADMIN))
return
usr.client.debug_variables(locate(href_list["f_inspect_ruleset"]))
else if (href_list["f_dynamic_options"])
if(!check_rights(R_ADMIN))
return