From 336ae657fc9ac9da61c630eba8e321d34a016d81 Mon Sep 17 00:00:00 2001 From: Drulikar Date: Thu, 22 Feb 2024 15:34:52 -0800 Subject: [PATCH] Refactor to_lower_keys to a different key_mode --- code/controllers/configuration/config_entry.dm | 6 +++--- code/controllers/configuration/entries/general.dm | 6 ++---- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/code/controllers/configuration/config_entry.dm b/code/controllers/configuration/config_entry.dm index 2cc5107fdbc8..d71bf1d747c9 100644 --- a/code/controllers/configuration/config_entry.dm +++ b/code/controllers/configuration/config_entry.dm @@ -4,6 +4,7 @@ #define KEY_MODE_TEXT 0 #define KEY_MODE_TYPE 1 +#define KEY_MODE_TEXT_UNALTERED 2 /datum/config_entry var/name //read-only, this is determined by the last portion of the derived entry type @@ -137,7 +138,6 @@ var/key_mode var/value_mode var/splitter = " " - var/to_lower_keys = TRUE /datum/config_entry/keyed_list/New() . = ..() @@ -155,7 +155,7 @@ if(key_pos || value_mode == VALUE_MODE_FLAG) key_name = copytext(str_val, 1, key_pos) - if(to_lower_keys) + if(key_mode != KEY_MODE_TEXT_UNALTERED) key_name = lowertext(key_name) if(key_pos) key_value = copytext(str_val, key_pos + length(str_val[key_pos])) @@ -164,7 +164,7 @@ var/continue_check_value var/continue_check_key switch(key_mode) - if(KEY_MODE_TEXT) + if(KEY_MODE_TEXT, KEY_MODE_TEXT_UNALTERED) new_key = key_name continue_check_key = new_key if(KEY_MODE_TYPE) diff --git a/code/controllers/configuration/entries/general.dm b/code/controllers/configuration/entries/general.dm index 1a374f7180f3..e2572e5e2d61 100644 --- a/code/controllers/configuration/entries/general.dm +++ b/code/controllers/configuration/entries/general.dm @@ -633,12 +633,10 @@ This maintains a list of ip addresses that are able to bypass topic filtering. /// Relay Ping Browser configuration /datum/config_entry/keyed_list/connection_relay_ping splitter = "|" - key_mode = KEY_MODE_TEXT + key_mode = KEY_MODE_TEXT_UNALTERED value_mode = VALUE_MODE_TEXT - to_lower_keys = FALSE /datum/config_entry/keyed_list/connection_relay_con splitter = "|" - key_mode = KEY_MODE_TEXT + key_mode = KEY_MODE_TEXT_UNALTERED value_mode = VALUE_MODE_TEXT - to_lower_keys = FALSE