From d8a18e8fcb5973c48ba2129725efbb959f94ac71 Mon Sep 17 00:00:00 2001 From: Gallyus <5572280+francinum@users.noreply.github.com> Date: Sun, 13 Aug 2023 18:32:27 -0400 Subject: [PATCH] Reorganizes the top right button cluster (#477) * Reorganizes the top right button cluster Adds Webmap button Adds Codex button map JSONS have a new key * return type annotation --- _maps/metastation.json | 1 + .../configuration/entries/general.dm | 4 ++ code/datums/map_config.dm | 5 ++ code/modules/tgs/core/core.dm | 1 + config/config.txt | 3 + interface/interface.dm | 11 ++++ interface/skin.dmf | 64 +++++++++++++------ 7 files changed, 70 insertions(+), 19 deletions(-) diff --git a/_maps/metastation.json b/_maps/metastation.json index 9bdad81f9897..8fee3af3492e 100644 --- a/_maps/metastation.json +++ b/_maps/metastation.json @@ -3,6 +3,7 @@ "map_name": "MetaStation", "map_path": "map_files/MetaStation", "map_file": "MetaStation.dmm", + "webmap_id": "DaedalusMeta", "shuttles": { "cargo": "cargo_box", "ferry": "ferry_fancy", diff --git a/code/controllers/configuration/entries/general.dm b/code/controllers/configuration/entries/general.dm index 3015ff316c2d..ca5d58a8364b 100644 --- a/code/controllers/configuration/entries/general.dm +++ b/code/controllers/configuration/entries/general.dm @@ -662,3 +662,7 @@ protection = CONFIG_ENTRY_LOCKED /datum/config_entry/flag/show_job_estimation + +/// Unique slug for the webmap +/datum/config_entry/string/webmap_community + default = "DaedalusDock" diff --git a/code/datums/map_config.dm b/code/datums/map_config.dm index 8bbed28514f1..9c1537b1e005 100644 --- a/code/datums/map_config.dm +++ b/code/datums/map_config.dm @@ -17,6 +17,7 @@ var/map_name = "Meta Station" var/map_path = "map_files/MetaStation" var/map_file = "MetaStation.dmm" + var/webmap_id = "DaedalusMeta" var/traits = null var/space_ruin_levels = 7 @@ -133,6 +134,10 @@ log_world("map_file missing from json!") return + webmap_id = json["webmap_id"] + if(!webmap_id) + log_mapping("Map is missing a webmap ID.") + if (islist(json["shuttles"])) var/list/L = json["shuttles"] for(var/key in L) diff --git a/code/modules/tgs/core/core.dm b/code/modules/tgs/core/core.dm index 41a047339452..1dbcb6c3b9b8 100644 --- a/code/modules/tgs/core/core.dm +++ b/code/modules/tgs/core/core.dm @@ -115,6 +115,7 @@ return result /world/TgsTestMerges() + RETURN_TYPE(/list) var/datum/tgs_api/api = TGS_READ_GLOBAL(tgs) if(api) var/result = api.TestMerges() diff --git a/config/config.txt b/config/config.txt index 3713895431f9..8183fe9b43b7 100644 --- a/config/config.txt +++ b/config/config.txt @@ -24,6 +24,9 @@ SERVERSQLNAME daedalusdock ## Station name: The name of the station as it is referred to in-game. If commented out, the game will generate a random name instead. STATIONNAME Daedalus Outpost +## Community slug for AffectedArc's Web Map +#WEBMAP_COMMUNITY DaedalusDock + ## Hub subtitle: A line of text inserted under the server name. Should be no greater than 40 characters. HUB_SUBTITLE Now with custom lighting! diff --git a/interface/interface.dm b/interface/interface.dm index a32bb758a204..d5c511c2e7b5 100644 --- a/interface/interface.dm +++ b/interface/interface.dm @@ -118,3 +118,14 @@ GLOB.hotkeys_tgui = new /datum/hotkeys_help() GLOB.hotkeys_tgui.ui_interact(mob) + +/client/verb/webmap() + set name = "Open Webmap" + set category = "OOC" + if(!SSmapping.initialized) + to_chat_immediate(src, span_warning("Please wait until the server has fully started!")) + if(!SSmapping.config.webmap_id) + to_chat(src, "Map ID Missing from config.") + if(world.TgsTestMerges().len) + alert(src, "Notice: Test Merges are active, this map may not be fully accurate!", "Testmerge Notice", "OK") + src << link("https://affectedarc07.github.io/SS13WebMap/[CONFIG_GET(string/webmap_community)]/[SSmapping.config.webmap_id]") diff --git a/interface/skin.dmf b/interface/skin.dmf index 13cc062f142b..6be51a41d390 100644 --- a/interface/skin.dmf +++ b/interface/skin.dmf @@ -149,6 +149,26 @@ window "infowindow" anchor2 = -1,-1 saved-params = "pos;size;is-minimized;is-maximized" is-pane = true + elem "codex_button" + type = BUTTON + pos = 445,5 + size = 50x20 + anchor1 = 70,0 + anchor2 = 77,0 + background-color = none + saved-params = "is-checked" + text = "Codex" + command = "Codex" + elem "webmap" + type = BUTTON + pos = 545,5 + size = 75x20 + anchor1 = 85,0 + anchor2 = 97,0 + background-color = none + saved-params = "is-checked" + text = "Webmap" + command = "webmap" elem "info" type = CHILD pos = 0,30 @@ -162,54 +182,60 @@ window "infowindow" elem "changelog" type = BUTTON pos = 16,5 - size = 104x20 + size = 79x20 anchor1 = 3,0 - anchor2 = 19,0 + anchor2 = 15,0 + background-color = none saved-params = "is-checked" text = "Changelog" command = "changelog" elem "rules" type = BUTTON - pos = 120,5 - size = 100x20 - anchor1 = 19,0 - anchor2 = 34,0 + pos = 395,5 + size = 50x20 + anchor1 = 62,0 + anchor2 = 70,0 + background-color = none saved-params = "is-checked" text = "Rules" command = "rules" elem "wiki" type = BUTTON - pos = 220,5 - size = 100x20 - anchor1 = 34,0 - anchor2 = 50,0 + pos = 495,5 + size = 50x20 + anchor1 = 77,0 + anchor2 = 85,0 + background-color = none saved-params = "is-checked" text = "Wiki" command = "wiki" elem "forum" type = BUTTON - pos = 320,5 + pos = 295,5 size = 100x20 - anchor1 = 50,0 - anchor2 = 66,0 + anchor1 = 46,0 + anchor2 = 62,0 + background-color = none saved-params = "is-checked" text = "Forum" command = "forum" elem "github" type = BUTTON - pos = 420,5 + pos = 195,5 size = 100x20 - anchor1 = 66,0 - anchor2 = 81,0 + anchor1 = 30,0 + anchor2 = 46,0 + background-color = none saved-params = "is-checked" text = "Github" command = "github" elem "report-issue" type = BUTTON - pos = 520,5 + pos = 95,5 size = 100x20 - anchor1 = 81,0 - anchor2 = 97,0 + anchor1 = 15,0 + anchor2 = 30,0 + background-color = none saved-params = "is-checked" text = "Report Issue" command = "report-issue"