mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-12 03:02:54 +00:00
Configuration Controller (#7857)
This commit is contained in:
@@ -1,6 +0,0 @@
|
||||
//Splits the text of a file at seperator and returns them in a list.
|
||||
//returns an empty list if the file doesn't exist
|
||||
/world/proc/file2list(filename, seperator="\n", trim = TRUE)
|
||||
if (trim)
|
||||
return splittext(trim(file2text(filename)),seperator)
|
||||
return splittext(file2text(filename),seperator)
|
||||
8
modular_chomp/code/modules/admin/verbs/debug.dm
Normal file
8
modular_chomp/code/modules/admin/verbs/debug.dm
Normal file
@@ -0,0 +1,8 @@
|
||||
/client/proc/reload_configuration()
|
||||
set category = "Debug"
|
||||
set name = "Reload Configuration"
|
||||
set desc = "Force config reload to world default"
|
||||
if(!check_rights(R_DEBUG))
|
||||
return
|
||||
if(tgui_alert(usr, "Are you absolutely sure you want to reload the configuration from the default path on the disk, wiping any in-round modifications?", "Really reset?", list("No", "Yes")) == "Yes")
|
||||
config.admin_reload()
|
||||
@@ -55,7 +55,7 @@
|
||||
blood color
|
||||
*/
|
||||
if (copy_name)
|
||||
if(config.humans_need_surnames)
|
||||
if(CONFIG_GET(flag/humans_need_surnames)) // CHOMPEdit
|
||||
var/firstspace = findtext(real_name, " ")
|
||||
var/name_length = length(real_name)
|
||||
if(!firstspace) //we need a surname
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
// Handle footstep sounds
|
||||
/mob/living/silicon/robot/handle_vorefootstep(var/m_intent, var/turf/T)
|
||||
|
||||
if(!config.vorefootstep_volume || !T.vorefootstep_sounds || !T.vorefootstep_sounds.len || !vore_footstep_volume)
|
||||
if(!CONFIG_GET(number/vorefootstep_volume) || !T.vorefootstep_sounds || !T.vorefootstep_sounds.len || !vore_footstep_volume)
|
||||
return
|
||||
// Future Upgrades - Robot specific support
|
||||
var/list/vorefootstep_sounds = T.vorefootstep_sounds["human"]
|
||||
@@ -18,9 +18,9 @@
|
||||
return
|
||||
var/S = pick(vorefootstep_sounds)
|
||||
if(!S) return
|
||||
var/volume = config.vorefootstep_volume * (vore_footstep_volume/100)
|
||||
var/volume = CONFIG_GET(number/vorefootstep_volume) * (vore_footstep_volume/100)
|
||||
|
||||
volume = config.vorefootstep_volume * (vore_footstep_volume/100)
|
||||
volume = CONFIG_GET(number/vorefootstep_volume) * (vore_footstep_volume/100)
|
||||
|
||||
if(buckled || lying || throwing)
|
||||
return // people flying, lying down or sitting do not slosh
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/proc/get_role_request_channel()
|
||||
var/channel_tag
|
||||
if(config.role_request_channel_tag)
|
||||
channel_tag = config.role_request_channel_tag
|
||||
if(CONFIG_GET(string/role_request_channel_tag))
|
||||
channel_tag = CONFIG_GET(string/role_request_channel_tag)
|
||||
|
||||
var/datum/tgs_api/v5/api = TGS_READ_GLOBAL(tgs)
|
||||
if(istype(api) && channel_tag)
|
||||
@@ -19,8 +19,8 @@
|
||||
|
||||
/proc/get_fax_channel()
|
||||
var/channel_tag
|
||||
if(config.fax_channel_tag)
|
||||
channel_tag = config.fax_channel_tag
|
||||
if(CONFIG_GET(string/fax_channel_tag))
|
||||
channel_tag = CONFIG_GET(string/fax_channel_tag)
|
||||
|
||||
var/datum/tgs_api/v5/api = TGS_READ_GLOBAL(tgs)
|
||||
if(istype(api) && channel_tag)
|
||||
@@ -39,48 +39,48 @@
|
||||
/proc/get_discord_role_id_from_department(var/department)
|
||||
switch(department)
|
||||
if("Command")
|
||||
if(config.role_request_id_command)
|
||||
return config.role_request_id_command
|
||||
if(CONFIG_GET(string/role_request_id_command)) // CHOMPEdit
|
||||
return CONFIG_GET(string/role_request_id_command)
|
||||
|
||||
if("Security")
|
||||
if(config.role_request_id_security)
|
||||
return config.role_request_id_security
|
||||
if(CONFIG_GET(string/role_request_id_security))
|
||||
return CONFIG_GET(string/role_request_id_security)
|
||||
|
||||
if("Engineering")
|
||||
if(config.role_request_id_engineering)
|
||||
return config.role_request_id_engineering
|
||||
if(CONFIG_GET(string/role_request_id_engineering))
|
||||
return CONFIG_GET(string/role_request_id_engineering)
|
||||
|
||||
if("Medical")
|
||||
if(config.role_request_id_medical)
|
||||
return config.role_request_id_medical
|
||||
if(CONFIG_GET(string/role_request_id_medical))
|
||||
return CONFIG_GET(string/role_request_id_medical)
|
||||
|
||||
if("Research")
|
||||
if(config.role_request_id_research)
|
||||
return config.role_request_id_research
|
||||
if(CONFIG_GET(string/role_request_id_research))
|
||||
return CONFIG_GET(string/role_request_id_research)
|
||||
|
||||
if("Supply")
|
||||
if(config.role_request_id_supply)
|
||||
return config.role_request_id_supply
|
||||
if(CONFIG_GET(string/role_request_id_supply))
|
||||
return CONFIG_GET(string/role_request_id_supply)
|
||||
|
||||
if("Service")
|
||||
if(config.role_request_id_service)
|
||||
return config.role_request_id_service
|
||||
if(CONFIG_GET(string/role_request_id_service))
|
||||
return CONFIG_GET(string/role_request_id_service)
|
||||
|
||||
if("Expedition")
|
||||
if(config.role_request_id_expedition)
|
||||
return config.role_request_id_expedition
|
||||
if(CONFIG_GET(string/role_request_id_expedition))
|
||||
return CONFIG_GET(string/role_request_id_expedition)
|
||||
|
||||
if("Silicon")
|
||||
if(config.role_request_id_silicon)
|
||||
return config.role_request_id_silicon
|
||||
if(CONFIG_GET(string/role_request_id_silicon))
|
||||
return CONFIG_GET(string/role_request_id_silicon)
|
||||
|
||||
return FALSE
|
||||
|
||||
|
||||
/obj/machinery/photocopier/faxmachine/message_chat_admins(var/mob/sender, var/faxname, var/obj/item/sent, var/faxid, font_colour="#006100")
|
||||
var/faxmsg
|
||||
if(faxid && fexists("[config.fax_export_dir]/fax_[faxid].html"))
|
||||
faxmsg = return_file_text("[config.fax_export_dir]/fax_[faxid].html")
|
||||
if(faxid && fexists("[CONFIG_GET(string/fax_export_dir)]/fax_[faxid].html"))
|
||||
faxmsg = return_file_text("[CONFIG_GET(string/fax_export_dir)]/fax_[faxid].html")
|
||||
|
||||
if(faxmsg)
|
||||
fax_discord_message("A fax; '[faxname]' was sent.\nSender: [sender.name]\nFax name: [sent.name]\nFax ID: **[faxid]**\nFax: ```[strip_html_properly(faxmsg)]```")
|
||||
|
||||
@@ -133,7 +133,7 @@
|
||||
//// VOREstation Additions Below
|
||||
|
||||
/datum/ticket/proc/send2adminchat()
|
||||
if(!config.chat_webhook_url)
|
||||
if(!CONFIG_GET(string/chat_webhook_url)) // CHOMPEdit
|
||||
return
|
||||
|
||||
var/list/adm = get_admin_counts()
|
||||
@@ -142,12 +142,12 @@
|
||||
|
||||
spawn(0) //Unreliable world.Exports()
|
||||
var/query_string = "type=adminhelp"
|
||||
query_string += "&key=[url_encode(config.chat_webhook_key)]"
|
||||
query_string += "&key=[url_encode(CONFIG_GET(string/chat_webhook_key))]" // CHOMPEdit
|
||||
query_string += "&from=[url_encode(key_name(initiator))]"
|
||||
query_string += "&msg=[url_encode(html_decode(name))]"
|
||||
query_string += "&admin_number=[allmins.len]"
|
||||
query_string += "&admin_number_afk=[afkmins.len]"
|
||||
world.Export("[config.chat_webhook_url]?[query_string]")
|
||||
world.Export("[CONFIG_GET(string/chat_webhook_url)]?[query_string]") // CHOMPEdit
|
||||
|
||||
/client/verb/adminspice()
|
||||
set category = "Admin"
|
||||
|
||||
@@ -11,16 +11,16 @@ Reason: Replaced with "Tickets System". Main logic has been moved to: modular_ch
|
||||
// CHOMPEdit Begin
|
||||
/proc/get_ahelp_channel()
|
||||
var/datum/tgs_api/v5/api = TGS_READ_GLOBAL(tgs)
|
||||
if(istype(api) && config.ahelp_channel_tag)
|
||||
if(istype(api) && CONFIG_GET(string/ahelp_channel_tag))
|
||||
for(var/datum/tgs_chat_channel/channel in api.chat_channels)
|
||||
if(channel.custom_tag == config.ahelp_channel_tag)
|
||||
if(channel.custom_tag == CONFIG_GET(string/ahelp_channel_tag))
|
||||
return list(channel)
|
||||
return 0
|
||||
|
||||
/proc/ahelp_discord_message(var/message)
|
||||
if(!message)
|
||||
return
|
||||
if(config.discord_ahelps_disabled)
|
||||
if(CONFIG_GET(flag/discord_ahelps_disabled))
|
||||
return
|
||||
var/datum/tgs_chat_channel/ahelp_channel = get_ahelp_channel()
|
||||
if(ahelp_channel)
|
||||
@@ -316,7 +316,7 @@ GLOBAL_DATUM_INIT(tickets, /datum/tickets, new)
|
||||
|
||||
/datum/ticket/proc/AddInteraction(formatted_message)
|
||||
var/curinteraction = "[gameTimestamp()]: [formatted_message]"
|
||||
if(config.discord_ahelps_all) //CHOMPEdit
|
||||
if(CONFIG_GET(flag/discord_ahelps_all)) //CHOMPEdit
|
||||
ahelp_discord_message("ADMINHELP: TICKETID:[id] [strip_html_properly(curinteraction)]") //CHOMPEdit
|
||||
_interactions += curinteraction
|
||||
|
||||
|
||||
Reference in New Issue
Block a user