mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-25 21:19:00 +01:00
Adds more features to the ERT manager (#22070)
* BOOM UPGRADED * self-review * remove todo * build tgui * bam * Update code/modules/response_team/ert.dm Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com> --------- Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com> Co-authored-by: S34N <12197162+S34NW@users.noreply.github.com>
This commit is contained in:
co-authored by
Henri215
S34N
parent
2ab351cc91
commit
fa52e8540e
@@ -14,7 +14,7 @@
|
||||
/datum/ui_module/ert_manager/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.admin_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "ERTManager", name, 350, 470, master_ui, state)
|
||||
ui = new(user, src, ui_key, "ERTManager", name, 350, 540, master_ui, state)
|
||||
ui.autoupdate = TRUE
|
||||
ui.open()
|
||||
|
||||
@@ -30,6 +30,8 @@
|
||||
data["security_level_color"] = "red"
|
||||
else
|
||||
data["security_level_color"] = "purple"
|
||||
data["ert_request_answered"] = GLOB.ert_request_answered
|
||||
|
||||
data["ert_type"] = ert_type
|
||||
data["com"] = commander_slots
|
||||
data["sec"] = security_slots
|
||||
@@ -41,13 +43,17 @@
|
||||
data["secborg"] = cyborg_security
|
||||
data["total"] = commander_slots + security_slots + medical_slots + engineering_slots + janitor_slots + paranormal_slots + cyborg_slots
|
||||
data["spawnpoints"] = GLOB.emergencyresponseteamspawn.len
|
||||
|
||||
data["ert_request_messages"] = GLOB.ert_request_messages
|
||||
return data
|
||||
|
||||
/datum/ui_module/ert_manager/ui_act(action, params)
|
||||
/datum/ui_module/ert_manager/ui_act(action, params, datum/tgui/ui)
|
||||
if(..())
|
||||
return
|
||||
. = TRUE
|
||||
switch(action)
|
||||
if("toggle_ert_request_answered")
|
||||
GLOB.ert_request_answered = !GLOB.ert_request_answered
|
||||
if("ert_type")
|
||||
ert_type = params["ert_type"]
|
||||
if(ert_type != "Red")
|
||||
@@ -98,11 +104,24 @@
|
||||
slots_list += "paranormal: [paranormal_slots]"
|
||||
if(cyborg_slots > 0)
|
||||
slots_list += "cyborg: [cyborg_slots]"
|
||||
D.silent = params["silent"]
|
||||
|
||||
var/slot_text = english_list(slots_list)
|
||||
notify_ghosts("An ERT is being dispatched. Type: [ert_type]. Open positions: [slot_text]")
|
||||
message_admins("[key_name_admin(usr)] dispatched a [ert_type] ERT. Slots: [slot_text]", 1)
|
||||
log_admin("[key_name(usr)] dispatched a [ert_type] ERT. Slots: [slot_text]")
|
||||
GLOB.major_announcement.Announce("Attention, [station_name()]. We are attempting to assemble an ERT. Standby.", "ERT Protocol Activated")
|
||||
message_admins("[key_name_admin(usr)] dispatched a [params["silent"] ? "silent " : ""][ert_type] ERT. Slots: [slot_text]", 1)
|
||||
log_admin("[key_name(usr)] dispatched a [params["silent"] ? "silent " : ""][ert_type] ERT. Slots: [slot_text]")
|
||||
if(!params["silent"])
|
||||
GLOB.major_announcement.Announce("Attention, [station_name()]. We are attempting to assemble an ERT. Standby.", "ERT Protocol Activated")
|
||||
trigger_armed_response_team(D, commander_slots, security_slots, medical_slots, engineering_slots, janitor_slots, paranormal_slots, cyborg_slots, cyborg_security)
|
||||
|
||||
if("view_player_panel")
|
||||
ui.user.client.holder.show_player_panel(locate(params["uid"]))
|
||||
|
||||
if("deny_ert")
|
||||
GLOB.ert_request_answered = TRUE
|
||||
var/message = "[station_name()], we are unfortunately unable to send you an Emergency Response Team at this time."
|
||||
if(params["reason"])
|
||||
message += " Your ERT request has been denied for the following reasons:\n\n[params["reason"]]"
|
||||
GLOB.major_announcement.Announce(message, "ERT Unavailable")
|
||||
else
|
||||
return FALSE
|
||||
|
||||
Reference in New Issue
Block a user