Skip to content

Commit

Permalink
Reorganizes the top right button cluster (#477)
Browse files Browse the repository at this point in the history
* Reorganizes the top right button cluster
Adds Webmap button
Adds Codex button
map JSONS have a new key

* return type annotation
  • Loading branch information
francinum authored Aug 13, 2023
1 parent ea35bac commit d8a18e8
Show file tree
Hide file tree
Showing 7 changed files with 70 additions and 19 deletions.
1 change: 1 addition & 0 deletions _maps/metastation.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 4 additions & 0 deletions code/controllers/configuration/entries/general.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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"
5 changes: 5 additions & 0 deletions code/datums/map_config.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions code/modules/tgs/core/core.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
3 changes: 3 additions & 0 deletions config/config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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!

Expand Down
11 changes: 11 additions & 0 deletions interface/interface.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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]")
64 changes: 45 additions & 19 deletions interface/skin.dmf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
Expand Down

0 comments on commit d8a18e8

Please sign in to comment.