Merge pull request #2505 from Citadel-Station-13/upstream-merge-30169
[MIRROR] Allows disabling shuttle purchases per map.
This commit is contained in:
@@ -3,5 +3,6 @@
|
|||||||
"map_path": "map_files/BoxStation",
|
"map_path": "map_files/BoxStation",
|
||||||
"map_file": "BoxStation.dmm",
|
"map_file": "BoxStation.dmm",
|
||||||
"minetype": "lavaland",
|
"minetype": "lavaland",
|
||||||
"transition_config": "default"
|
"transition_config": "default",
|
||||||
|
"allow_custom_shuttles": "yes"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,5 +3,6 @@
|
|||||||
"map_path": "map_files/Cerestation",
|
"map_path": "map_files/Cerestation",
|
||||||
"map_file": "cerestation.dmm",
|
"map_file": "cerestation.dmm",
|
||||||
"minetype": "lavaland",
|
"minetype": "lavaland",
|
||||||
"transition_config": "default"
|
"transition_config": "default",
|
||||||
|
"allow_custom_shuttles": "yes"
|
||||||
}
|
}
|
||||||
@@ -3,5 +3,6 @@
|
|||||||
"map_path": "map_files/Deltastation",
|
"map_path": "map_files/Deltastation",
|
||||||
"map_file": "DeltaStation2.dmm",
|
"map_file": "DeltaStation2.dmm",
|
||||||
"minetype": "lavaland",
|
"minetype": "lavaland",
|
||||||
"transition_config": "default"
|
"transition_config": "default",
|
||||||
|
"allow_custom_shuttles": "yes"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,4 +4,5 @@
|
|||||||
"map_file": "MetaStation.dmm",
|
"map_file": "MetaStation.dmm",
|
||||||
"minetype": "lavaland",
|
"minetype": "lavaland",
|
||||||
"transition_config": "default"
|
"transition_config": "default"
|
||||||
|
"allow_custom_shuttles": "yes"
|
||||||
}
|
}
|
||||||
@@ -3,5 +3,6 @@
|
|||||||
"map_path": "map_files/OmegaStation",
|
"map_path": "map_files/OmegaStation",
|
||||||
"map_file": "OmegaStation.dmm",
|
"map_file": "OmegaStation.dmm",
|
||||||
"minetype": "lavaland",
|
"minetype": "lavaland",
|
||||||
"transition_config": "default"
|
"transition_config": "default",
|
||||||
|
"allow_custom_shuttles": "yes"
|
||||||
}
|
}
|
||||||
@@ -3,5 +3,6 @@
|
|||||||
"map_path": "map_files/PubbyStation",
|
"map_path": "map_files/PubbyStation",
|
||||||
"map_file": "PubbyStation.dmm",
|
"map_file": "PubbyStation.dmm",
|
||||||
"minetype": "lavaland",
|
"minetype": "lavaland",
|
||||||
"transition_config": "default"
|
"transition_config": "default",
|
||||||
|
"allow_custom_shuttles": "yes"
|
||||||
}
|
}
|
||||||
@@ -3,5 +3,6 @@
|
|||||||
"map_path": "map_files/debug",
|
"map_path": "map_files/debug",
|
||||||
"map_file": "runtimestation.dmm",
|
"map_file": "runtimestation.dmm",
|
||||||
"minetype": "lavaland",
|
"minetype": "lavaland",
|
||||||
"transition_config": "default"
|
"transition_config": "default",
|
||||||
|
"allow_custom_shuttles": "no"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
var/config_max_users = 0
|
var/config_max_users = 0
|
||||||
var/config_min_users = 0
|
var/config_min_users = 0
|
||||||
var/voteweight = 1
|
var/voteweight = 1
|
||||||
|
var/allow_custom_shuttles = "yes"
|
||||||
/datum/map_config/New(filename = "data/next_map.json", default_to_box, delete_after)
|
/datum/map_config/New(filename = "data/next_map.json", default_to_box, delete_after)
|
||||||
if(default_to_box)
|
if(default_to_box)
|
||||||
return
|
return
|
||||||
@@ -44,12 +44,12 @@
|
|||||||
if(!json)
|
if(!json)
|
||||||
log_world("Could not open map_config: [filename]")
|
log_world("Could not open map_config: [filename]")
|
||||||
return
|
return
|
||||||
|
|
||||||
json = file2text(json)
|
json = file2text(json)
|
||||||
if(!json)
|
if(!json)
|
||||||
log_world("map_config is not text: [filename]")
|
log_world("map_config is not text: [filename]")
|
||||||
return
|
return
|
||||||
|
|
||||||
json = json_decode(json)
|
json = json_decode(json)
|
||||||
if(!json)
|
if(!json)
|
||||||
log_world("map_config is not json: [filename]")
|
log_world("map_config is not json: [filename]")
|
||||||
@@ -58,7 +58,7 @@
|
|||||||
if(!ValidateJSON(json))
|
if(!ValidateJSON(json))
|
||||||
log_world("map_config failed to validate for above reason: [filename]")
|
log_world("map_config failed to validate for above reason: [filename]")
|
||||||
return
|
return
|
||||||
|
|
||||||
config_filename = filename
|
config_filename = filename
|
||||||
|
|
||||||
map_name = json["map_name"]
|
map_name = json["map_name"]
|
||||||
@@ -66,6 +66,7 @@
|
|||||||
map_file = json["map_file"]
|
map_file = json["map_file"]
|
||||||
|
|
||||||
minetype = json["minetype"]
|
minetype = json["minetype"]
|
||||||
|
allow_custom_shuttles = json["allow_custom_shuttles"]
|
||||||
|
|
||||||
var/list/jtcl = json["transition_config"]
|
var/list/jtcl = json["transition_config"]
|
||||||
|
|
||||||
@@ -74,7 +75,7 @@
|
|||||||
|
|
||||||
for(var/I in jtcl)
|
for(var/I in jtcl)
|
||||||
transition_config[TransitionStringToEnum(I)] = TransitionStringToEnum(jtcl[I])
|
transition_config[TransitionStringToEnum(I)] = TransitionStringToEnum(jtcl[I])
|
||||||
|
|
||||||
defaulted = FALSE
|
defaulted = FALSE
|
||||||
|
|
||||||
#define CHECK_EXISTS(X) if(!istext(json[X])) { log_world(X + "missing from json!"); return; }
|
#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("map_file")
|
||||||
CHECK_EXISTS("minetype")
|
CHECK_EXISTS("minetype")
|
||||||
CHECK_EXISTS("transition_config")
|
CHECK_EXISTS("transition_config")
|
||||||
|
CHECK_EXISTS("allow_custom_shuttles")
|
||||||
|
|
||||||
var/path = GetFullMapPath(json["map_path"], json["map_file"])
|
var/path = GetFullMapPath(json["map_path"], json["map_file"])
|
||||||
if(!fexists(path))
|
if(!fexists(path))
|
||||||
@@ -92,7 +94,7 @@
|
|||||||
|
|
||||||
if(json["transition_config"] != "default")
|
if(json["transition_config"] != "default")
|
||||||
if(!islist(json["transition_config"]))
|
if(!islist(json["transition_config"]))
|
||||||
log_world("transition_config is not a list!")
|
log_world("transition_config is not a list!")
|
||||||
return
|
return
|
||||||
|
|
||||||
var/list/jtcl = json["transition_config"]
|
var/list/jtcl = json["transition_config"]
|
||||||
|
|||||||
@@ -456,7 +456,8 @@
|
|||||||
dat += "<BR>\[ <A HREF='?src=\ref[src];operation=announce'>Make a Captain's Announcement</A> \]"
|
dat += "<BR>\[ <A HREF='?src=\ref[src];operation=announce'>Make a Captain's Announcement</A> \]"
|
||||||
if(config.cross_allowed)
|
if(config.cross_allowed)
|
||||||
dat += "<BR>\[ <A HREF='?src=\ref[src];operation=crossserver'>Send a message to an allied station</A> \]"
|
dat += "<BR>\[ <A HREF='?src=\ref[src];operation=crossserver'>Send a message to an allied station</A> \]"
|
||||||
dat += "<BR>\[ <A HREF='?src=\ref[src];operation=purchase_menu'>Purchase Shuttle</A> \]"
|
if(SSmapping.config.allow_custom_shuttles == "yes")
|
||||||
|
dat += "<BR>\[ <A HREF='?src=\ref[src];operation=purchase_menu'>Purchase Shuttle</A> \]"
|
||||||
dat += "<BR>\[ <A HREF='?src=\ref[src];operation=changeseclevel'>Change Alert Level</A> \]"
|
dat += "<BR>\[ <A HREF='?src=\ref[src];operation=changeseclevel'>Change Alert Level</A> \]"
|
||||||
dat += "<BR>\[ <A HREF='?src=\ref[src];operation=emergencyaccess'>Emergency Maintenance Access</A> \]"
|
dat += "<BR>\[ <A HREF='?src=\ref[src];operation=emergencyaccess'>Emergency Maintenance Access</A> \]"
|
||||||
dat += "<BR>\[ <A HREF='?src=\ref[src];operation=nukerequest'>Request Nuclear Authentication Codes</A> \]"
|
dat += "<BR>\[ <A HREF='?src=\ref[src];operation=nukerequest'>Request Nuclear Authentication Codes</A> \]"
|
||||||
|
|||||||
Reference in New Issue
Block a user