[MIRROR] Convert preferences to /tg/ preferences (#9797)

Co-authored-by: ShadowLarkens <shadowlarkens@gmail.com>
Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
CHOMPStation2StaffMirrorBot
2025-01-08 18:08:43 -07:00
committed by GitHub
parent 689b354903
commit 039ee85382
82 changed files with 1753 additions and 1048 deletions

View File

@@ -13,7 +13,7 @@
/datum/preferences/ui_assets(mob/user)
var/list/assets = list(
// get_asset_datum(/datum/asset/spritesheet/preferences),
get_asset_datum(/datum/asset/spritesheet/preferences),
get_asset_datum(/datum/asset/json/preferences),
)
@@ -79,6 +79,34 @@
return TRUE
if("set_color_preference")
var/requested_preference_key = params["preference"]
var/datum/preference/requested_preference = GLOB.preference_entries_by_key[requested_preference_key]
if(isnull(requested_preference))
return FALSE
if(!istype(requested_preference, /datum/preference/color))
return FALSE
var/default_value = read_preference(requested_preference.type)
// Yielding
var/new_color = input(
usr,
"Select new color",
null,
default_value || COLOR_WHITE,
) as color | null
if(!new_color)
return FALSE
if(!update_preference(requested_preference, new_color))
return FALSE
return TRUE
for(var/datum/preference_middleware/preference_middleware as anything in middleware)
var/delegation = preference_middleware.action_delegations[action]
if(!isnull(delegation))