From 94400c4d382965a8ff2676430a0392b579f6d11d Mon Sep 17 00:00:00 2001 From: CitadelStationBot Date: Sat, 26 Aug 2017 11:08:12 -0500 Subject: [PATCH] Allows disabling shuttle purchases per map. --- _maps/boxstation.json | 3 ++- _maps/cerestation.json | 3 ++- _maps/deltastation.json | 3 ++- _maps/metastation.json | 1 + _maps/omegastation.json | 3 ++- _maps/pubbystation.json | 3 ++- _maps/runtimestation.json | 3 ++- code/datums/map_config.dm | 14 ++++++++------ code/game/machinery/computer/communications.dm | 3 ++- 9 files changed, 23 insertions(+), 13 deletions(-) diff --git a/_maps/boxstation.json b/_maps/boxstation.json index 9cd407ef93..d07f9f3493 100644 --- a/_maps/boxstation.json +++ b/_maps/boxstation.json @@ -3,5 +3,6 @@ "map_path": "map_files/BoxStation", "map_file": "BoxStation.dmm", "minetype": "lavaland", - "transition_config": "default" + "transition_config": "default", + "allow_custom_shuttles": "yes" } diff --git a/_maps/cerestation.json b/_maps/cerestation.json index e4c6b52f89..625fe282a9 100644 --- a/_maps/cerestation.json +++ b/_maps/cerestation.json @@ -3,5 +3,6 @@ "map_path": "map_files/Cerestation", "map_file": "cerestation.dmm", "minetype": "lavaland", - "transition_config": "default" + "transition_config": "default", + "allow_custom_shuttles": "yes" } \ No newline at end of file diff --git a/_maps/deltastation.json b/_maps/deltastation.json index 5558cbb1ed..43126821da 100644 --- a/_maps/deltastation.json +++ b/_maps/deltastation.json @@ -3,5 +3,6 @@ "map_path": "map_files/Deltastation", "map_file": "DeltaStation2.dmm", "minetype": "lavaland", - "transition_config": "default" + "transition_config": "default", + "allow_custom_shuttles": "yes" } diff --git a/_maps/metastation.json b/_maps/metastation.json index 4b1b63499f..27ec0cb1db 100644 --- a/_maps/metastation.json +++ b/_maps/metastation.json @@ -4,4 +4,5 @@ "map_file": "MetaStation.dmm", "minetype": "lavaland", "transition_config": "default" + "allow_custom_shuttles": "yes" } \ No newline at end of file diff --git a/_maps/omegastation.json b/_maps/omegastation.json index 53fbc24def..808b9bc7eb 100644 --- a/_maps/omegastation.json +++ b/_maps/omegastation.json @@ -3,5 +3,6 @@ "map_path": "map_files/OmegaStation", "map_file": "OmegaStation.dmm", "minetype": "lavaland", - "transition_config": "default" + "transition_config": "default", + "allow_custom_shuttles": "yes" } \ No newline at end of file diff --git a/_maps/pubbystation.json b/_maps/pubbystation.json index 88a2702148..8781588624 100644 --- a/_maps/pubbystation.json +++ b/_maps/pubbystation.json @@ -3,5 +3,6 @@ "map_path": "map_files/PubbyStation", "map_file": "PubbyStation.dmm", "minetype": "lavaland", - "transition_config": "default" + "transition_config": "default", + "allow_custom_shuttles": "yes" } \ No newline at end of file diff --git a/_maps/runtimestation.json b/_maps/runtimestation.json index 664f6c98e0..a979e09f79 100644 --- a/_maps/runtimestation.json +++ b/_maps/runtimestation.json @@ -3,5 +3,6 @@ "map_path": "map_files/debug", "map_file": "runtimestation.dmm", "minetype": "lavaland", - "transition_config": "default" + "transition_config": "default", + "allow_custom_shuttles": "no" } diff --git a/code/datums/map_config.dm b/code/datums/map_config.dm index 5238c65465..4c0a5fb11e 100644 --- a/code/datums/map_config.dm +++ b/code/datums/map_config.dm @@ -27,7 +27,7 @@ var/config_max_users = 0 var/config_min_users = 0 var/voteweight = 1 - + var/allow_custom_shuttles = "yes" /datum/map_config/New(filename = "data/next_map.json", default_to_box, delete_after) if(default_to_box) return @@ -44,12 +44,12 @@ if(!json) log_world("Could not open map_config: [filename]") return - + json = file2text(json) if(!json) log_world("map_config is not text: [filename]") return - + json = json_decode(json) if(!json) log_world("map_config is not json: [filename]") @@ -58,7 +58,7 @@ if(!ValidateJSON(json)) log_world("map_config failed to validate for above reason: [filename]") return - + config_filename = filename map_name = json["map_name"] @@ -66,6 +66,7 @@ map_file = json["map_file"] minetype = json["minetype"] + allow_custom_shuttles = json["allow_custom_shuttles"] var/list/jtcl = json["transition_config"] @@ -74,7 +75,7 @@ for(var/I in jtcl) transition_config[TransitionStringToEnum(I)] = TransitionStringToEnum(jtcl[I]) - + defaulted = FALSE #define CHECK_EXISTS(X) if(!istext(json[X])) { log_world(X + "missing from json!"); return; } @@ -84,6 +85,7 @@ CHECK_EXISTS("map_file") CHECK_EXISTS("minetype") CHECK_EXISTS("transition_config") + CHECK_EXISTS("allow_custom_shuttles") var/path = GetFullMapPath(json["map_path"], json["map_file"]) if(!fexists(path)) @@ -92,7 +94,7 @@ if(json["transition_config"] != "default") if(!islist(json["transition_config"])) - log_world("transition_config is not a list!") + log_world("transition_config is not a list!") return var/list/jtcl = json["transition_config"] diff --git a/code/game/machinery/computer/communications.dm b/code/game/machinery/computer/communications.dm index 997ed52b70..bf67e05f11 100755 --- a/code/game/machinery/computer/communications.dm +++ b/code/game/machinery/computer/communications.dm @@ -456,7 +456,8 @@ dat += "
\[ Make a Captain's Announcement \]" if(config.cross_allowed) dat += "
\[ Send a message to an allied station \]" - dat += "
\[ Purchase Shuttle \]" + if(SSmapping.config.allow_custom_shuttles == "yes") + dat += "
\[ Purchase Shuttle \]" dat += "
\[ Change Alert Level \]" dat += "
\[ Emergency Maintenance Access \]" dat += "
\[ Request Nuclear Authentication Codes \]"