mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-01-27 17:41:50 +00:00
## 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.  ## 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. /🆑
29 lines
854 B
Plaintext
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
|