Skip to content

Commit

Permalink
Reworks IC radio comms, gets it ready for comms by location groups
Browse files Browse the repository at this point in the history
  • Loading branch information
silencer-pl committed Aug 14, 2024
1 parent 4a7ea68 commit df6bb82
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 21 deletions.
1 change: 1 addition & 0 deletions code/_onclick/hud/fullscreen.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
/mob
var/list/fullscreens = list()
var/list/sp_uis = list()
var/list/narration_settings = list("Name" = null, "Location" = null, "Position" = null, "Target" = null)

/mob/proc/overlay_fullscreen(category, type, severity)
var/atom/movable/screen/fullscreen/screen = fullscreens[category]
Expand Down
2 changes: 1 addition & 1 deletion code/datums/emergency_calls/emergency_call.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
var/ert_dispatched = FALSE

/datum/game_mode/proc/ares_online()
to_chat(world, "<span class='big'><span class='radio'><span class='name'>Mission Control<b>[icon2html('icons/obj/items/radio.dmi', usr, "beacon")] \u005BOV-PST \u0028TC-MC\u0029\u005D </b></span><span class='message'>, says \"[GLOB.mission_control_hello]\"</span></span></span>", type = MESSAGE_TYPE_RADIO)
to_chat(world, "<span class='big'><span class='radio'><span class='name'>Mission Control<b>[icon2html('icons/obj/items/radio.dmi', world, "beacon")] \u005BOV-PST \u0028TC-MC\u0029\u005D </b></span><span class='message'>, says \"[GLOB.mission_control_hello]\"</span></span></span>", type = MESSAGE_TYPE_RADIO)

/datum/game_mode/proc/request_ert(user, ares = FALSE)
if(!user)
Expand Down
5 changes: 3 additions & 2 deletions code/modules/admin/admin_verbs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ GLOBAL_LIST_INIT(admin_verbs_major_event, list(
/client/proc/admin_blurb,
/client/proc/prepare_admin_song_blurb,
/client/proc/cmd_admin_pythia_say,
/client/proc/cmd_admin_mission_control_say,
/client/proc/cmd_start_sequence,
/client/proc/cmd_answer_civnet,
/client/proc/cmd_set_cargo,
Expand All @@ -175,7 +174,9 @@ GLOBAL_LIST_INIT(admin_verbs_major_event, list(
/client/proc/cmd_load_turfs,
/client/proc/cmd_load_dorms,
/client/proc/cmd_show_resources,
/client/proc/mission_control_panel,
/datum/admins/proc/mission_control_panel,
/datum/admins/proc/set_narration_preset,
/datum/admins/proc/speak_to_comms,
))

GLOBAL_LIST_INIT(admin_verbs_spawn, list(
Expand Down
49 changes: 45 additions & 4 deletions code/modules/admin/mission_control/mission_control.dm
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
/client/proc/mission_control_panel()
/datum/admins/proc/mission_control_panel()
set name = "Mission Control Panel"
set category = "DM.Control"
if(admin_holder)
admin_holder.MissionControl(window = "Main")

if(!check_rights(R_ADMIN)) return
MissionControl(window = "Main")
return

/client/verb/fixspuis()
set name = "Force Close Sector Patrol Interfaces"
set category = "OOC.Fix"

if (usr.sp_uis.len != 0)
while(usr.sp_uis.len != 0)
var/ui_to_close = jointext(usr.sp_uis,null,1,2)
Expand All @@ -23,7 +25,7 @@
var/obj/structure/shiptoship_master/sts_master
for(var/obj/structure/shiptoship_master/sts_master_to_link in world)
sts_master = sts_master_to_link
if(!check_rights(0)) return
if(!check_rights(R_ADMIN)) return
if(window == null) return
if(window == "Main")
if(GLOB.savefile_initiated == 0)
Expand Down Expand Up @@ -106,6 +108,7 @@
</div>
</div>
"}
if("Comms")
if("ShipToShip")
if(!sts_master)
to_chat(usr, SPAN_WARNING("Error: No STS Master found in world. Most likely a mapping error."))
Expand Down Expand Up @@ -406,7 +409,45 @@
sts_master.log_round_history(event = "comms_ping_system", log_source = comms_source_custom, log_target = comms_text)
return

/datum/admins/proc/set_narration_preset()
set name = "Comms Set Preset"
set category = "DM.Narration"

var/list/comms_presets = list("Mission Control","Cassandra","Alysia","Boulette","Custom")
switch(tgui_input_list(usr,"Select a Comms Preset","PRESET",comms_presets,timeout = 0))
if(null)
return
if("Mission Control")
usr.narration_settings["Name"] = "Mission Control"
usr.narration_settings["Location"] = "OV-PST"
usr.narration_settings["Position"] = "TC-MC"
if("Cassandra")
usr.narration_settings["Name"] = "CDR. Cassandra Reed-Wilo"
usr.narration_settings["Location"] = "OV-PST"
usr.narration_settings["Position"] = "PST-CSO"
if("Alysia")
usr.narration_settings["Name"] = "CDR. Alysia Reed-Wilo"
usr.narration_settings["Location"] = "OV-PST"
usr.narration_settings["Position"] = "PST-CE"
if("Boulette")
usr.narration_settings["Name"] = "RDML. Thomas Boulette"
usr.narration_settings["Location"] = "OV-PST"
usr.narration_settings["Position"] = "PST-CO"
if("Custom")
usr.narration_settings["Name"] = tgui_input_text(usr, "Enter the name, complete with a rank prefix.", "NAME entry", usr.narration_settings["Name"], timeout = 0)
usr.narration_settings["Location"] = tgui_input_text(usr, "Enter assignment or location, when in doubt, OV-PST works.", "LOCATION entry", usr.narration_settings["Location"], timeout = 0)
usr.narration_settings["Position"] = tgui_input_text(usr, "Enter held position like CE, CO, RFN or whatnot. Prefaced with some specialty acronym also can work.", "POSITION entry", usr.narration_settings["Position"], timeout = 0)
return

/datum/admins/proc/speak_to_comms()
set name = "Comms Speak"
set category = "DM.Narration"

if(usr.narration_settings["Name"] == null || usr.narration_settings["Location"] == null || usr.narration_settings["Position"] == null) set_narration_preset()
var/text_to_comm = tgui_input_text(usr, "Enter what to say as [usr.narration_settings["Name"]],[usr.narration_settings["Location"]],[usr.narration_settings["Position"]] or cancel to exit.")
while(text_to_comm != null)
to_chat(world, "<span class='big'><span class='radio'><span class='name'>[usr.narration_settings["Name"]]<b>[icon2html('icons/obj/items/radio.dmi', usr, "beacon")] \u005B[usr.narration_settings["Location"]] \u0028[usr.narration_settings["Position"]]\u0029\u005D </b></span><span class='message'>, says \"[text_to_comm]\"</span></span></span>", type = MESSAGE_TYPE_RADIO)
text_to_comm = tgui_input_text(usr, "Enter what to say as [usr.narration_settings["Name"]],[usr.narration_settings["Location"]],[usr.narration_settings["Position"]] or cancel to exit.")

/datum/admins/proc/save_general_save(save = null)
if(!check_rights(R_ADMIN)) return
Expand Down
13 changes: 0 additions & 13 deletions code/modules/admin/verbs/sectorpatrol.dm
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,6 @@
T.pythiasay(pythia_say)
return

/client/proc/cmd_admin_mission_control_say() // Checks for a Pythia reciever and talks as it and any of its voices.
set name = "Mission Control Comms"
set category = "Admin.SectorPatrol"

if (!admin_holder || !(admin_holder.rights & R_MOD))
to_chat(src, "Only administrators may use this command.")
return

var/mission_control_say = tgui_input_text(src, "What to say as Mission Control into the general Radio Channel", "MC Say Text", max_length = MAX_BOOK_MESSAGE_LEN, multiline = TRUE, encode = FALSE, timeout = 0)
if(!mission_control_say) return
to_chat(world, "<span class='big'><span class='radio'><span class='name'>Mission Control<b>[icon2html('icons/obj/items/radio.dmi', usr, "beacon")] \u005BOV-PST \u0028TC-MC\u0029\u005D </b></span><span class='message'>, says \"[mission_control_say]\"</span></span></span>", type = MESSAGE_TYPE_RADIO)
return

/client/proc/cmd_start_sequence()
set name = "Start Sequence"
set category = "Admin.SectorPatrol"
Expand Down
2 changes: 1 addition & 1 deletion code/modules/gear_presets/uacm.dm
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
assignment = JOB_UACM_CASSANDRA
rank = JOB_UACM_CASSANDRA
paygrade = "NO5"
role_comm_title = "PST-CSP"
role_comm_title = "PST-CSO"
skills = /datum/skills/general
languages = ALL_HUMAN_LANGUAGES
flags = EQUIPMENT_PRESET_EXTRA
Expand Down

0 comments on commit df6bb82

Please sign in to comment.