Configuration Controller (#7857)

This commit is contained in:
Selis
2024-04-05 07:44:20 +02:00
committed by GitHub
parent c542e3bac0
commit e1a987c25c
235 changed files with 3294 additions and 989 deletions
+3 -3
View File
@@ -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