mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-19 03:55:11 +01:00
Converts ForceEvent.js to typescript and overhauls the UI to be good (#71750)
## About The Pull Request  ## Why It's Good For The Game The old UI annoyed me enough to improve it ## Changelog 🆑 refactor: Refactored and overhauled the ForceEvent UI /🆑
This commit is contained in:
@@ -29,19 +29,46 @@
|
||||
return GLOB.fun_state
|
||||
|
||||
/datum/force_event/ui_static_data(mob/user)
|
||||
var/static/list/category_to_icons
|
||||
if(!category_to_icons)
|
||||
category_to_icons = list(
|
||||
EVENT_CATEGORY_AI = "robot",
|
||||
EVENT_CATEGORY_ANOMALIES = "cloud-bolt",
|
||||
EVENT_CATEGORY_BUREAUCRATIC = "print",
|
||||
EVENT_CATEGORY_ENGINEERING = "wrench",
|
||||
EVENT_CATEGORY_ENTITIES = "ghost",
|
||||
EVENT_CATEGORY_FRIENDLY = "face-smile",
|
||||
EVENT_CATEGORY_HEALTH = "brain",
|
||||
EVENT_CATEGORY_HOLIDAY = "calendar",
|
||||
EVENT_CATEGORY_INVASION = "user-group",
|
||||
EVENT_CATEGORY_JANITORIAL = "bath",
|
||||
EVENT_CATEGORY_SPACE = "meteor",
|
||||
EVENT_CATEGORY_WIZARD = "hat-wizard",
|
||||
)
|
||||
var/list/data = list()
|
||||
data["categories"] = list()
|
||||
for(var/datum/round_event_control/event_control in SSevents.control)
|
||||
if(!data["categories"][event_control.category])
|
||||
data["categories"][event_control.category] = list(
|
||||
|
||||
var/list/categories_seen = list()
|
||||
var/list/categories = list()
|
||||
|
||||
var/list/events = list()
|
||||
|
||||
for(var/datum/round_event_control/event_control as anything in SSevents.control)
|
||||
//add category
|
||||
if(!categories_seen[event_control.category])
|
||||
categories_seen[event_control.category] = TRUE
|
||||
UNTYPED_LIST_ADD(categories, list(
|
||||
"name" = event_control.category,
|
||||
"events" = list()
|
||||
)
|
||||
data["categories"][event_control.category]["events"] += list(list(
|
||||
"icon" = category_to_icons[event_control.category],
|
||||
))
|
||||
//add event, with one value matching up the category
|
||||
UNTYPED_LIST_ADD(events, list(
|
||||
"name" = event_control.name,
|
||||
"description" = event_control.description,
|
||||
"type" = event_control.type
|
||||
"type" = event_control.type,
|
||||
"category" = event_control.category,
|
||||
))
|
||||
data["categories"] = categories
|
||||
data["events"] = events
|
||||
return data
|
||||
|
||||
/datum/force_event/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state)
|
||||
|
||||
Reference in New Issue
Block a user