Files
Bubberstation/code/modules/admin/verbs/policy_panel.dm
MrMelbert b4e4db72d1 Adds a very simple admin verb to view everything in the policy json (#89541)
## About The Pull Request

Adds `Policy Panel` admin verb. It opens up a very plain, very simple
tgui that shows you a dropdown of all `policy.json` entries, allowing
you to refer to them if necessary.

There's also a search bar.


![image](https://github.com/user-attachments/assets/11e5c4b1-815b-488d-8566-943145c2d64c)

## Why It's Good For The Game

Half request, half something I thought would be useful.

While admins could VV into config and find the `policy.json`, they
generally appreciate something more user-facing.

## Changelog

🆑 Melbert
admin: Adds the Policy Panel verb, which shows you all the policy the
server has set.
/🆑
2025-02-21 17:05:54 -07:00

29 lines
854 B
Plaintext

ADMIN_VERB(policy_panel, R_ADMIN, "Policy Panel", "View all policy the server has set.", ADMIN_CATEGORY_MAIN)
if(!length(global.config?.policy))
tgui_alert(usr, "Policy hasn't loaded yet (or the server has none set).", "Policy Panel", list("OK"))
return
var/datum/policy_panel/tgui = new
tgui.ui_interact(user.mob)
BLACKBOX_LOG_ADMIN_VERB("Policy Panel")
// Very simple panel that reports all the policy the server has set.
/datum/policy_panel
/datum/policy_panel/ui_interact(mob/user, datum/tgui/ui)
ui = SStgui.try_update_ui(user, src, ui)
if(!ui)
ui = new(user, src, "Policypanel")
ui.open()
/datum/policy_panel/ui_state(mob/user)
return ADMIN_STATE(R_ADMIN)
/datum/policy_panel/ui_close(mob/user)
qdel(src)
/datum/policy_panel/ui_static_data(mob/user)
var/list/data = list()
data["policy"] = global.config.policy
return data