diff --git a/code/modules/cm_marines/overwatch.dm b/code/modules/cm_marines/overwatch.dm
index 3afb632f5223..2a7f10b2d2aa 100644
--- a/code/modules/cm_marines/overwatch.dm
+++ b/code/modules/cm_marines/overwatch.dm
@@ -32,9 +32,6 @@
var/list/saved_coordinates = list()
- //DELETE THIS
- var/tgui = TRUE
-
var/list/camera_holders = list()
var/list/multicam_marines = list()
@@ -144,9 +141,7 @@
to_chat(user, SPAN_WARNING("You don't have the training to use [src]."))
return
- if(tgui)
- tgui_interact(user)
- return
+ tgui_interact(user)
user.set_interaction(src)
var/dat = "
"
@@ -396,6 +391,8 @@
data["ob_cooldown"] = COOLDOWN_TIMELEFT(almayer_orbital_cannon, ob_firing_cooldown)
data["ob_loaded"] = almayer_orbital_cannon.chambered_tray
+ data["operator"] = operator.name
+
return data
/obj/structure/machinery/computer/overwatch/ui_state(mob/user)
@@ -501,7 +498,7 @@
if("replace_lead")
if(!params["ref"])
return
- change_lead_tgui(params["ref"])
+ change_lead(params["ref"])
if("insubordination")
mark_insubordination()
@@ -600,6 +597,21 @@
return
multicam_marines -= marine
update_multicams()
+ if("change_operator")
+ if(operator != user)
+ if(operator && ishighersilicon(operator))
+ visible_message("[icon2html(src, viewers(src))] [SPAN_BOLDNOTICE("AI override in progress. Access denied.")]")
+ return
+ if(!current_squad || current_squad.assume_overwatch(user))
+ operator = user
+ if(ishighersilicon(user))
+ to_chat(user, "[icon2html(src, usr)] [SPAN_BOLDNOTICE("Overwatch system AI override protocol successful.")]")
+ current_squad?.send_squad_message("Attention. [operator.name] has engaged overwatch system control override.", displayed_icon = src)
+ else
+ var/mob/living/carbon/human/H = operator
+ var/obj/item/card/id/ID = H.get_idcard()
+ visible_message("[icon2html(src, viewers(src))] [SPAN_BOLDNOTICE("Basic overwatch systems initialized. Welcome, [ID ? "[ID.rank] ":""][operator.name]. Please select a squad.")]")
+ current_squad?.send_squad_message("Attention. Your Overwatch officer is now [ID ? "[ID.rank] ":""][operator.name].", displayed_icon = src)
/obj/structure/machinery/computer/overwatch/proc/update_multicams()
var/index = 1
@@ -609,7 +621,7 @@
index++
-/obj/structure/machinery/computer/overwatch/proc/change_lead_tgui(sl_ref)
+/obj/structure/machinery/computer/overwatch/proc/change_lead(sl_ref)
if(!usr)
return
var/mob/user = usr
@@ -675,546 +687,12 @@
selected_sl.update_inv_wear_suit()
-/obj/structure/machinery/computer/overwatch/proc/get_base_menu_text()
- var/dat = ""
-
- if(!current_squad) //No squad has been set yet. Pick one.
- dat += "Current Squad: ----------
"
- return dat;
-
- dat += "Current Squad: [current_squad.name] Squad "
- dat += "Message Squad
"
- dat += "Toggle Tactical Map"
- dat += "
"
- if(current_squad.squad_leader)
- dat += "Squad Leader: [current_squad.squad_leader.name] "
- dat += "MSG "
- dat += "CHANGE SQUAD LEADER
"
- else
- dat += "Squad Leader: NONE ASSIGN SQUAD LEADER
"
-
- dat += "Primary Objective: "
- if(current_squad.primary_objective)
- dat += "Check Set
"
- else
- dat += "NONE! Set
"
- dat += "Secondary Objective: "
- if(current_squad.secondary_objective)
- dat += "Check Set
"
- else
- dat += "NONE! Set
"
- dat += "
"
- dat += "Report a marine for insubordination
"
- dat += "Transfer a marine to another squad
"
-
- dat += "Supply Drop Control
"
- dat += "Orbital Bombardment Control
"
- dat += "Squad Monitor
"
- dat += "
"
- dat += "Refresh"
-
- return dat
-
-/obj/structure/machinery/computer/overwatch/proc/get_info_screen_text()
- var/dat = ""
-
- dat += {"
-
- "}
-
- if(!current_squad)
- dat += "No Squad selected!
"
- else
- var/leader_text = ""
- var/leader_count = 0
- var/tl_text = ""
- var/tl_count = 0
- var/spec_text = ""
- var/spec_count = 0
- var/medic_text = ""
- var/medic_count = 0
- var/engi_text = ""
- var/engi_count = 0
- var/smart_text = ""
- var/smart_count = 0
- var/marine_text = ""
- var/marine_count = 0
- var/misc_text = ""
- var/living_count = 0
-
- var/conscious_text = ""
- var/unconscious_text = ""
- var/dead_text = ""
-
- var/SL_z //z level of the Squad Leader
- if(current_squad.squad_leader)
- var/turf/SL_turf = get_turf(current_squad.squad_leader)
- SL_z = SL_turf.z
-
-
- for(var/X in current_squad.marines_list)
- if(!X)
- continue //just to be safe
- var/mob_name = "unknown"
- var/mob_state = ""
- var/role = "unknown"
- var/act_sl = ""
- var/fteam = ""
- var/dist = "???"
- var/area_name = "???"
- var/mob/living/carbon/human/H
-
- var/is_filtered = FALSE
- if(X && ("\ref[X]" in marine_filter))
- is_filtered = TRUE
-
- if(ishuman(X))
- H = X
- mob_name = H.real_name
- var/area/A = get_area(H)
- var/turf/M_turf = get_turf(H)
- if(!M_turf)
- continue
- if(A)
- area_name = sanitize_area(A.name)
-
- switch(z_hidden)
- if(HIDE_ALMAYER)
- if(is_mainship_level(M_turf.z))
- continue
- if(HIDE_GROUND)
- if(is_ground_level(M_turf.z))
- continue
-
- if(H.job)
- role = H.job
- else if(istype(H.wear_id, /obj/item/card/id)) //decapitated marine is mindless,
- var/obj/item/card/id/ID = H.wear_id //we use their ID to get their role.
- if(ID.rank) role = ID.rank
-
- if(current_squad.squad_leader)
- if(H == current_squad.squad_leader)
- dist = "N/A"
- if(current_squad.name == SQUAD_SOF)
- if(H.job == JOB_MARINE_RAIDER_CMD)
- act_sl = " (direct command)"
- else if(H.job != JOB_MARINE_RAIDER_SL)
- act_sl = " (acting TL)"
- else if(H.job != JOB_SQUAD_LEADER)
- act_sl = " (acting SL)"
- else if(M_turf && (M_turf.z == SL_z))
- dist = "[get_dist(H, current_squad.squad_leader)] ([dir2text_short(get_dir(current_squad.squad_leader, H))])"
-
- if(is_filtered && marine_filter_enabled)
- continue
-
- switch(H.stat)
- if(CONSCIOUS)
- mob_state = "Conscious"
- living_count++
- conscious_text += "[mob_name] | [role][act_sl] | [mob_state] | [area_name] | [dist] | [is_filtered ? "Show" : "Hide"] |
"
-
- if(UNCONSCIOUS)
- mob_state = "Unconscious"
- living_count++
- unconscious_text += "[mob_name] | [role][act_sl] | [mob_state] | [area_name] | [dist] | [is_filtered ? "Show" : "Hide"] |
"
-
- if(DEAD)
- if(dead_hidden)
- continue
- mob_state = SET_CLASS("DEAD", INTERFACE_RED)
- dead_text += "[mob_name] | [role][act_sl] | [mob_state] | [area_name] | [dist] | [is_filtered ? "Show" : "Hide"] |
"
-
- if(!istype(H.head, /obj/item/clothing/head/helmet/marine))
- mob_state += SET_CLASS(" (NO HELMET)", INTERFACE_ORANGE)
-
- if(!H.key || !H.client)
- if(H.stat != DEAD)
- mob_state += " (SSD)"
-
-
- if(H.assigned_fireteam)
- fteam = " [H.assigned_fireteam]"
-
- else //listed marine was deleted or gibbed, all we have is their name
- if(dead_hidden)
- continue
- if(z_hidden) //gibbed marines are neither on the colony nor on the almayer
- continue
- for(var/datum/data/record/t in GLOB.data_core.general)
- if(t.fields["name"] == X)
- role = t.fields["real_rank"]
- break
- mob_state = SET_CLASS("DEAD", INTERFACE_RED)
- mob_name = X
-
- dead_text += "[mob_name] | [role][act_sl] | [mob_state] | [area_name] | [dist] | [is_filtered ? "Show" : "Hide"] |
"
-
-
- var/marine_infos = "[mob_name] | [role][act_sl][fteam] | [mob_state] | [area_name] | [dist] | [is_filtered ? "Show" : "Hide"] |
"
- switch(role)
- if(JOB_SQUAD_LEADER)
- leader_text += marine_infos
- leader_count++
- if(JOB_SQUAD_TEAM_LEADER)
- tl_text += marine_infos
- tl_count++
- if(JOB_SQUAD_SPECIALIST)
- spec_text += marine_infos
- spec_count++
- if(JOB_SQUAD_MEDIC)
- medic_text += marine_infos
- medic_count++
- if(JOB_SQUAD_ENGI)
- engi_text += marine_infos
- engi_count++
- if(JOB_SQUAD_SMARTGUN)
- smart_text += marine_infos
- smart_count++
- if(JOB_SQUAD_MARINE)
- marine_text += marine_infos
- marine_count++
- else
- misc_text += marine_infos
-
- dat += "[leader_count ? "Squad Leader Deployed" : SET_CLASS("No Squad Leader Deployed!", INTERFACE_RED)]
"
- dat += "Fireteam Leaders: [tl_count ? "[tl_count]" : SET_CLASS("No Fireteam Leaders Deployed!", INTERFACE_RED)]
"
- dat += "[spec_count ? "Squad Specialist Deployed" : SET_CLASS("No Specialist Deployed!", INTERFACE_RED)]
"
- dat += "[smart_count ? "Squad Smartgunner Deployed" : SET_CLASS("No Smartgunner Deployed!", INTERFACE_RED)]
"
- dat += "Squad Hospital Corpsmen: [medic_count] Deployed | Squad Combat Technicians: [engi_count] Deployed
"
- dat += "Squad Riflemen: [marine_count] Deployed
"
- dat += "Total: [current_squad.marines_list.len] Deployed
"
- dat += "Marines alive: [living_count]
"
- dat += "Search: "
- dat += ""
- dat += "Name | Role | State | Location | SL Distance | Filter |
"
- if(!living_marines_sorting)
- dat += leader_text + tl_text + spec_text + medic_text + engi_text + smart_text + marine_text + misc_text
- else
- dat += conscious_text + unconscious_text + dead_text
- dat += "
"
- dat += "
"
- dat += "Refresh
"
- dat += "Change Sorting Method
"
- dat += "[dead_hidden ? "Show Dead Marines" : "Hide Dead Marines" ]
"
- dat += "[marine_filter_enabled ? "Disable Marine Filter" : "Enable Marine Filter"]
"
- dat += "Change Locations Ignored
"
- dat += "
Back