Files
Bubberstation/code/modules/client/preferences/middleware/_middleware.dm
Iamgoofball 68e84c432e Skyrat Prefs Menu: Fixing everything to work correctly (#8350)
* Skyrat Prefs Menu: Fixing everything to work correctly

* whoops haha

* Examine menu!

* haha whoops

* Mutant Parts in tgui prefs

* fug

* LIMBS, MARKINGS, LANGUAGES

* EEEE FUCK

* Update tgui_prefs_migration.dm

* Update tgui_prefs_migration.dm

* FUCK

* Proper migration

* Update preferences.dm

* Final fixes for this shit

* Update LoadoutManager.js

* adds cursed shit

* e

* Update preferences.dm

* fixes examine panel

* adds // SKYRAT EDIT to bullshit

* sabshesgawgzxghsv

* wargesthgeargfea

* stegresgdytfrw

* EEE

* Update species_features.tsx

* EEE

* Update cursed_shit.tsx

* fixed taurs

* body size is now a 0.01 step

* Fixes some bugs

* Some required changes.

* Update examine.dm

* actually nekked

* Update code/modules/client/preferences/middleware/jobs.dm

Co-authored-by: GoldenAlpharex <58045821+GoldenAlpharex@users.noreply.github.com>

* Update code/modules/client/preferences/middleware/limbs_and_markings.dm

Co-authored-by: GoldenAlpharex <58045821+GoldenAlpharex@users.noreply.github.com>

* Update code/modules/client/preferences/middleware/limbs_and_markings.dm

Co-authored-by: GoldenAlpharex <58045821+GoldenAlpharex@users.noreply.github.com>

* Update code/modules/client/preferences/middleware/limbs_and_markings.dm

Co-authored-by: GoldenAlpharex <58045821+GoldenAlpharex@users.noreply.github.com>

* Update modular_skyrat/master_files/code/modules/client/preferences/erp_preferences.dm

Co-authored-by: GoldenAlpharex <58045821+GoldenAlpharex@users.noreply.github.com>

* Update modular_skyrat/modules/loadouts/loadout_ui/loadout_manager.dm

Co-authored-by: GoldenAlpharex <58045821+GoldenAlpharex@users.noreply.github.com>

* Update tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/character_preferences/skyrat/species_features.tsx

Co-authored-by: GoldenAlpharex <58045821+GoldenAlpharex@users.noreply.github.com>

* More fixes

* Donator items no show

* EEE

* fixes rapier sheaths

* gender =/= body type

* Loadout fixes

* Skintone

* Update skin_tone.dm

* Slick it up

* Update loadout_manager.dm

* Fixes typing indicator

* SSD indicator fixes

* fixes

* oops

* Fix this.

* Fixing the Occupations Menu

* Fixing NT Rep's alt-titles

* Update tgui/packages/tgui/interfaces/PreferencesMenu/jobs/jobs/janitor.ts

Co-authored-by: death and coding <58394696+thestubborn@users.noreply.github.com>

* Update code/controllers/subsystem/language.dm

Co-authored-by: GoldenAlpharex <58045821+GoldenAlpharex@users.noreply.github.com>

* Update tgui/packages/tgui/interfaces/PreferencesMenu/jobs/jobs/research_director.ts

Co-authored-by: death and coding <58394696+thestubborn@users.noreply.github.com>

Co-authored-by: Gandalf <jzo123@hotmail.com>
Co-authored-by: GoldenAlpharex <58045821+GoldenAlpharex@users.noreply.github.com>
Co-authored-by: GoldenAlpharex <jerego1234@hotmail.com>
Co-authored-by: death and coding <58394696+thestubborn@users.noreply.github.com>
2021-09-29 15:24:30 +01:00

65 lines
2.2 KiB
Plaintext

/// Preference middleware is code that helps to decentralize complicated preference features.
/datum/preference_middleware
/// The preferences datum
var/datum/preferences/preferences
/// The key that will be used for get_constant_data().
/// If null, will use the typepath minus /datum/preference_middleware.
var/key = null
/// Map of ui_act actions -> proc paths to call.
/// Signature is `(list/params, mob/user) -> TRUE/FALSE.
/// Return output is the same as ui_act--TRUE if it should update, FALSE if it should not
var/list/action_delegations = list()
/datum/preference_middleware/New(datum/preferences)
src.preferences = preferences
if (isnull(key))
// + 2 coming from the off-by-one of copytext, and then another from the slash
key = copytext("[type]", length("[parent_type]") + 2)
/datum/preference_middleware/Destroy()
preferences = null
return ..()
/// Append all of these into ui_data
/datum/preference_middleware/proc/get_ui_data(mob/user)
return list()
/// Append all of these into ui_static_data
/datum/preference_middleware/proc/get_ui_static_data(mob/user)
return list()
/// Append all of these into ui_assets
/datum/preference_middleware/proc/get_ui_assets()
return list()
/// Append all of these into /datum/asset/json/preferences.
/datum/preference_middleware/proc/get_constant_data()
return null
/// Merge this into the result of compile_character_preferences.
/datum/preference_middleware/proc/get_character_preferences(mob/user)
return null
/// Called before every update_preference, returns TRUE if this handled it.
/datum/preference_middleware/proc/pre_set_preference(mob/user, preference, value)
return FALSE
/// Called when a character is changed.
/datum/preference_middleware/proc/on_new_character(mob/user)
return
// SKYRAT EDIT
/// Called after every update_preference, returns TRUE if this handled it.
/datum/preference_middleware/proc/post_set_preference(mob/user, preference, value)
return FALSE
/// Called when applying preferences to the mob.
/datum/preference_middleware/proc/apply_to_human(mob/living/carbon/human/target, datum/preferences/preferecnes) //SKYRAT EDIT CHANGE
SHOULD_NOT_SLEEP(TRUE)
SHOULD_CALL_PARENT(FALSE)
return
//SKYRAT EDIT END