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
@@ -19,7 +19,7 @@ GENERAL_PROTECT_DATUM(/datum/managed_browser/feedback_form)
var/feedback_hide_author = FALSE
/datum/managed_browser/feedback_form/New(client/new_client)
feedback_topic = config.sqlite_feedback_topics[1]
feedback_topic = CONFIG_GET(str_list/sqlite_feedback_topics)[1] // CHOMPEdit
..(new_client)
/datum/managed_browser/feedback_form/Destroy()
@@ -29,7 +29,7 @@ GENERAL_PROTECT_DATUM(/datum/managed_browser/feedback_form)
// Privacy option is allowed if both the config allows it, and the pepper file exists and isn't blank.
/datum/managed_browser/feedback_form/proc/can_be_private()
return config.sqlite_feedback_privacy && SSsqlite.get_feedback_pepper()
return CONFIG_GET(flag/sqlite_feedback_privacy) && SSsqlite.get_feedback_pepper() // CHOMPEdit
/datum/managed_browser/feedback_form/display()
if(!my_client)
@@ -70,10 +70,11 @@ GENERAL_PROTECT_DATUM(/datum/managed_browser/feedback_form)
dat += my_client.ckey
dat += "<br>"
if(config.sqlite_feedback_topics.len > 1)
var/list/sqlite_feedback_topics = CONFIG_GET(str_list/sqlite_feedback_topics) // CHOMPEdit
if(sqlite_feedback_topics.len > 1) // CHOMPEdit
dat += "Topic: [href(src, list("feedback_choose_topic" = 1), feedback_topic)]<br>"
else
dat += "Topic: [config.sqlite_feedback_topics[1]]<br>"
dat += "Topic: [sqlite_feedback_topics[1]]<br>" // CHOMPEdit
dat += "<br>"
if(feedback_body)
@@ -84,8 +85,8 @@ GENERAL_PROTECT_DATUM(/datum/managed_browser/feedback_form)
dat += href(src, list("feedback_edit_body" = 1), "Edit")
dat += "<hr>"
if(config.sqlite_feedback_cooldown)
dat += "<i>Please note that you will have to wait [config.sqlite_feedback_cooldown] day\s before \
if(CONFIG_GET(number/sqlite_feedback_cooldown)) // CHOMPEdit
dat += "<i>Please note that you will have to wait [CONFIG_GET(number/sqlite_feedback_cooldown)] day\s before \
being able to write more feedback after submitting.</i><br>"
dat += href(src, list("feedback_submit" = 1), "Submit")
@@ -112,7 +113,7 @@ GENERAL_PROTECT_DATUM(/datum/managed_browser/feedback_form)
return
if(href_list["feedback_choose_topic"])
feedback_topic = tgui_input_list(my_client, "Choose the topic you want to submit your feedback under.", "Feedback Topic", config.sqlite_feedback_topics)
feedback_topic = tgui_input_list(my_client, "Choose the topic you want to submit your feedback under.", "Feedback Topic", CONFIG_GET(str_list/sqlite_feedback_topics)) // CHOMPEdit
display()
return
@@ -143,7 +143,7 @@
if(href_list["filter_topic"])
var/topic_to_search = tgui_input_text(my_client, "Write desired topic here. Partial topics are allowed. \
\nThe current topics in the config are [english_list(config.sqlite_feedback_topics)].", "Filter by Topic", null)
\nThe current topics in the config are [english_list(CONFIG_GET(str_list/sqlite_feedback_topics))].", "Filter by Topic", null) // CHOMPEdit
if(topic_to_search)
last_query = feedback_filter(SQLITE_FEEDBACK_COLUMN_TOPIC, topic_to_search)
@@ -159,4 +159,4 @@
last_query = feedback_filter(SQLITE_FEEDBACK_COLUMN_DATETIME, datetime_to_search)
// Refresh.
display()
display()