Skip to content

Commit

Permalink
Restore tactical map button to overwatch consoles (only drawing capab…
Browse files Browse the repository at this point in the history
…ilities if marine faction)
  • Loading branch information
Drulikar committed Oct 16, 2023
1 parent 5eba2d3 commit 079ec46
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
18 changes: 18 additions & 0 deletions code/modules/cm_marines/overwatch.dm
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
var/marine_filter_enabled = TRUE
var/faction = FACTION_MARINE

var/datum/tacmap/tacmap
var/minimap_type = MINIMAP_FLAG_USCM


///List of saved coordinates, format of ["x", "y", "comment"]
var/list/saved_coordinates = list()
Expand All @@ -37,8 +40,13 @@
/obj/structure/machinery/computer/overwatch/Initialize()
. = ..()

if (faction == FACTION_MARINE)
tacmap = new /datum/tacmap/drawing(src, minimap_type)
else
tacmap = new(src, minimap_type) // Non-drawing version

/obj/structure/machinery/computer/overwatch/Destroy()
QDEL_NULL(tacmap)
return ..()

/obj/structure/machinery/computer/overwatch/attackby(obj/I as obj, mob/user as mob) //Can't break or disassemble.
Expand Down Expand Up @@ -83,12 +91,20 @@

/obj/structure/machinery/computer/overwatch/ui_static_data(mob/user)
var/list/data = list()
data["mapRef"] = tacmap.map_holder.map_ref
return data

/obj/structure/machinery/computer/overwatch/tgui_interact(mob/user, datum/tgui/ui)

if(!tacmap.map_holder)
var/level = SSmapping.levels_by_trait(tacmap.targeted_ztrait)
if(!level[1])
return
tacmap.map_holder = SSminimaps.fetch_tacmap_datum(level[1], tacmap.allowed_flags)

ui = SStgui.try_update_ui(user, src, ui)
if(!ui)
user.client.register_map_obj(tacmap.map_holder.map)
ui = new(user, src, "OverwatchConsole", "Overwatch Console")
ui.open()

Expand Down Expand Up @@ -433,6 +449,8 @@
else
z_hidden = HIDE_NONE
to_chat(user, "[icon2html(src, usr)] [SPAN_NOTICE("No location is ignored anymore.")]")
if("tacmap_unpin")
tacmap.tgui_interact(user)
if("dropbomb")
if(!params["x"] || !params["y"])
return
Expand Down
3 changes: 3 additions & 0 deletions tgui/packages/tgui/interfaces/OverwatchConsole.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ const SquadPanel = (props, context) => {
onClick={() => setCategory('ob')}>
Orbital Bombardment
</Tabs.Tab>
<Tabs.Tab icon="map" onClick={() => act('tacmap_unpin')}>
Tactical Map
</Tabs.Tab>
</Tabs>
{category === 'monitor' && <SquadMonitor />}
{category === 'supply' && data.can_launch_crates && <SupplyDrop />}
Expand Down

0 comments on commit 079ec46

Please sign in to comment.