Skip to content

Commit

Permalink
commits crimes against tgui
Browse files Browse the repository at this point in the history
  • Loading branch information
dwasint committed Oct 6, 2023
1 parent 2393299 commit 6eb4c1a
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/obj/item/trench_ladder_kit
name = "sea ladder"
desc = "A deployable sea ladder that will allow you to descend to and ascend from the trench."
desc = "A deployable sea ladder that will allow you to descend to and ascend from the trench. Needs to be placed over a catwalk covered trench hole."

icon = 'goon/icons/obj/fluid.dmi'
icon_state = "ladder_off"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ SUBSYSTEM_DEF(hotspots)
. = TRUE
else
listed_hotspot.can_drift = FALSE
generate_finalized_map()

///we handle movement and recentering here
listed_hotspot.drift_direction = angle2dir(arctan(hotspot_center.x - stomped.x, hotspot_center.y - stomped.y))
Expand Down
26 changes: 16 additions & 10 deletions monkestation/code/modules/ocean_content/hotspot/trench_map.dm
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,6 @@
</body>
</html>
"}

/datum/controller/subsystem/hotspots/proc/show_map(client/shower)
if (!shower)
return
if (!finished_map || !map)
return
shower << browse_rsc(map, "trenchmap.png")
shower << browse(finished_map, "window=trench_map;size=560x610;title=Trench Map")

/obj/item/sea_map
name = "Trench Map"
icon = 'icons/obj/contractor_tablet.dmi'
Expand All @@ -125,4 +116,19 @@
. = ..()
if(!user.client)
return
SShotspots.show_map(user.client)

if (!SShotspots.finished_map || !SShotspots.map)
return
ui_interact(user)

/obj/item/sea_map/ui_interact(mob/user, datum/tgui/ui)
ui = SStgui.try_update_ui(user, src, ui)
if(!ui)
ui = new(user, src, "TrenchMap", name)
ui.open()


/obj/item/sea_map/ui_data()
var/list/data = list()
data["map"] = SShotspots.finished_map
return data
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,11 @@
for(var/datum/hotspot/listed_hotspot as anything in SShotspots.retrieve_hotspot_list(source_turf))
if(BOUNDS_DIST(src, listed_hotspot.center.return_turf()) > 2)///giving a 1 tile leeway on stomps
continue
say("Hotspot Pinned")
if(!listed_hotspot.can_drift)
say("Hotspot Pinned!")
else
say("Hotspot Released!")

playsound(src, 'goon/sounds/impact_sounds/Metal_Hit_Lowfi_1.ogg', 50, 1)

for(var/mob/any_mob in viewers(src))
Expand Down
16 changes: 16 additions & 0 deletions tgui/packages/tgui/interfaces/TrenchMap.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { Window } from '../layouts';
import { useBackend } from '../backend';
import { Box } from '../components';

export const TrenchMap = (props, context) => {
const { act, data } = useBackend(context);
const { map } = data;
const textHtml = {
__html: map,
};
return (
<Window width={560} height={610}>
<Box dangerouslySetInnerHTML={textHtml} />
</Window>
);
};

0 comments on commit 6eb4c1a

Please sign in to comment.