From 7d939571a37747aba9acc5706dad9b82e78826ec Mon Sep 17 00:00:00 2001 From: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com> Date: Tue, 21 Sep 2021 16:02:06 +0100 Subject: [PATCH] Adds a webmap button --- code/game/verbs/webmap.dm | 12 ++++++++++++ code/modules/client/client_procs.dm | 2 ++ code/modules/mapping/base_map_datum.dm | 2 ++ code/modules/mapping/cyberiad.dm | 1 + code/modules/mapping/delta.dm | 1 + code/modules/mapping/metastation.dm | 1 + interface/skin.dmf | 25 +++++++++++++++++-------- paradise.dme | 1 + 8 files changed, 37 insertions(+), 8 deletions(-) create mode 100644 code/game/verbs/webmap.dm diff --git a/code/game/verbs/webmap.dm b/code/game/verbs/webmap.dm new file mode 100644 index 00000000000..714b501e808 --- /dev/null +++ b/code/game/verbs/webmap.dm @@ -0,0 +1,12 @@ +/client/verb/webmap() + set name = "webmap" + set hidden = TRUE + + if(!SSmapping.map_datum.webmap_url) + to_chat(usr, "The current map has no defined webmap. Please file an issue report.") + return + + if(alert(usr, "Do you want to open this map's Webmap in your browser?", "Webmap", "Yes", "No") != "Yes") + return + + usr << link(SSmapping.map_datum.webmap_url) diff --git a/code/modules/client/client_procs.dm b/code/modules/client/client_procs.dm index c841c759229..49ac4b3919f 100644 --- a/code/modules/client/client_procs.dm +++ b/code/modules/client/client_procs.dm @@ -821,6 +821,7 @@ winset(src, "rpane.forumb", "background-color=#40628a;text-color=#FFFFFF") winset(src, "rpane.rulesb", "background-color=#40628a;text-color=#FFFFFF") winset(src, "rpane.githubb", "background-color=#40628a;text-color=#FFFFFF") + winset(src, "rpane.webmap", "background-color=#40628a;text-color=#FFFFFF") /* Mainwindow */ winset(src, "mainwindow.saybutton", "background-color=#40628a;text-color=#FFFFFF") winset(src, "mainwindow.mebutton", "background-color=#40628a;text-color=#FFFFFF") @@ -853,6 +854,7 @@ winset(src, "rpane.forumb", "background-color=none;text-color=#000000") winset(src, "rpane.rulesb", "background-color=none;text-color=#000000") winset(src, "rpane.githubb", "background-color=none;text-color=#000000") + winset(src, "rpane.webmap", "background-color=none;text-color=#000000") /* Mainwindow */ winset(src, "mainwindow.saybutton", "background-color=none;text-color=#000000") winset(src, "mainwindow.mebutton", "background-color=none;text-color=#000000") diff --git a/code/modules/mapping/base_map_datum.dm b/code/modules/mapping/base_map_datum.dm index 6a5c7260f3a..a1962d8bba1 100644 --- a/code/modules/mapping/base_map_datum.dm +++ b/code/modules/mapping/base_map_datum.dm @@ -12,3 +12,5 @@ var/technical_name /// Path to the map file var/map_path + /// URL to the maps webmap + var/webmap_url diff --git a/code/modules/mapping/cyberiad.dm b/code/modules/mapping/cyberiad.dm index 29c27d59c73..46850a42682 100644 --- a/code/modules/mapping/cyberiad.dm +++ b/code/modules/mapping/cyberiad.dm @@ -2,3 +2,4 @@ fluff_name = "NSS Cyberiad" technical_name = "Cyberiad" map_path = "_maps/map_files/cyberiad/cyberiad.dmm" + webmap_url = "https://affectedarc07.github.io/SS13WebMap/Paradise/Cyberiad/" diff --git a/code/modules/mapping/delta.dm b/code/modules/mapping/delta.dm index 6b8bbce94cd..3eceefb2012 100644 --- a/code/modules/mapping/delta.dm +++ b/code/modules/mapping/delta.dm @@ -2,3 +2,4 @@ fluff_name = "NSS Kerberos" technical_name = "Delta" map_path = "_maps/map_files/Delta/delta.dmm" + webmap_url = "https://affectedarc07.github.io/SS13WebMap/Paradise/Delta/" diff --git a/code/modules/mapping/metastation.dm b/code/modules/mapping/metastation.dm index 654aad46ac8..461d02cfc44 100644 --- a/code/modules/mapping/metastation.dm +++ b/code/modules/mapping/metastation.dm @@ -2,3 +2,4 @@ fluff_name = "NSS Cerebron" technical_name = "MetaStation" map_path = "_maps/map_files/MetaStation/MetaStation.dmm" + webmap_url = "https://affectedarc07.github.io/SS13WebMap/Paradise/MetaStation/" diff --git a/interface/skin.dmf b/interface/skin.dmf index 5ef2a56e492..e4850ea368a 100644 --- a/interface/skin.dmf +++ b/interface/skin.dmf @@ -287,6 +287,15 @@ window "rpane" is-checked = true group = "rpanemode" button-type = pushbox + elem "webmap" + type = BUTTON + pos = 358,7 + size = 50x16 + anchor1 = none + anchor2 = none + saved-params = "is-checked" + text = "Map" + command = "webmap" elem "infob" type = BUTTON pos = 64,7 @@ -301,8 +310,8 @@ window "rpane" button-type = pushbox elem "wikib" type = BUTTON - pos = 155,7 - size = 60x16 + pos = 150,7 + size = 50x16 anchor1 = none anchor2 = none saved-params = "is-checked" @@ -310,8 +319,8 @@ window "rpane" command = "wiki" elem "forumb" type = BUTTON - pos = 220,7 - size = 60x16 + pos = 202,7 + size = 50x16 anchor1 = none anchor2 = none saved-params = "is-checked" @@ -319,8 +328,8 @@ window "rpane" command = "forum" elem "rulesb" type = BUTTON - pos = 285,7 - size = 60x16 + pos = 254,7 + size = 50x16 anchor1 = none anchor2 = none saved-params = "is-checked" @@ -328,8 +337,8 @@ window "rpane" command = "rules" elem "githubb" type = BUTTON - pos = 350,7 - size = 60x16 + pos = 306,7 + size = 50x16 anchor1 = none anchor2 = none saved-params = "is-checked" diff --git a/paradise.dme b/paradise.dme index bf7b57fb723..a009d5838e9 100644 --- a/paradise.dme +++ b/paradise.dme @@ -1162,6 +1162,7 @@ #include "code\game\verbs\ooc.dm" #include "code\game\verbs\randomtip.dm" #include "code\game\verbs\suicide.dm" +#include "code\game\verbs\webmap.dm" #include "code\game\verbs\who.dm" #include "code\modules\admin\admin.dm" #include "code\modules\admin\admin_investigate.dm"