mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-12 10:42:37 +00:00
## About The Pull Request Fixes #82440 This PR just creates a new macro, `LOWER_TEXT()` (yes the irony is not lost on me) to wrap around all calls of `lowertext()` and ensure that whatever we input into that proc will be stringified using the `"[]"` (or `tostring()` for the nerds) operator. very simple. I also added a linter to enforce this (and prevent all forms of regression) because I think that machines should do the menial work and we shouldn't expect maintainers to remember this, let me know if you disagree. if there is a time when it should be opted out for some reason, the linter does respect it if you wrap your input with the `UNLINT()` function.
31 lines
935 B
Plaintext
31 lines
935 B
Plaintext
/datum/config_entry/keyed_list/external_rsc_urls
|
|
key_mode = KEY_MODE_TEXT
|
|
value_mode = VALUE_MODE_FLAG
|
|
|
|
/datum/config_entry/flag/asset_simple_preload
|
|
|
|
/datum/config_entry/string/asset_transport
|
|
/datum/config_entry/string/asset_transport/ValidateAndSet(str_val)
|
|
return (LOWER_TEXT(str_val) in list("simple", "webroot")) && ..(LOWER_TEXT(str_val))
|
|
|
|
/datum/config_entry/string/asset_cdn_webroot
|
|
protection = CONFIG_ENTRY_LOCKED
|
|
|
|
/datum/config_entry/string/asset_cdn_webroot/ValidateAndSet(str_var)
|
|
if (!str_var || trim(str_var) == "")
|
|
return FALSE
|
|
if (str_var && str_var[length(str_var)] != "/")
|
|
str_var += "/"
|
|
return ..(str_var)
|
|
|
|
/datum/config_entry/string/asset_cdn_url
|
|
protection = CONFIG_ENTRY_LOCKED
|
|
default = null
|
|
|
|
/datum/config_entry/string/asset_cdn_url/ValidateAndSet(str_var)
|
|
if (!str_var || trim(str_var) == "")
|
|
return FALSE
|
|
if (str_var && str_var[length(str_var)] != "/")
|
|
str_var += "/"
|
|
return ..(str_var)
|