Merge branch 'master' of https://github.com/tgstation/tgstation into upstream-sync

This commit is contained in:
xPokee
2025-10-03 07:05:54 -04:00
517 changed files with 24339 additions and 21253 deletions
+1
View File
@@ -580,6 +580,7 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
set_fullscreen(logging_in = TRUE)
view_size.resetFormat()
view_size.setZoomMode()
view_size.apply()
Master.UpdateTickRate()
SEND_GLOBAL_SIGNAL(COMSIG_GLOB_CLIENT_CONNECT, src)
fully_created = TRUE
+1 -1
View File
@@ -562,7 +562,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
return TRUE
/datum/preferences/proc/GetQuirkBalance()
var/bal = 0
var/bal = CONFIG_GET(number/default_quirk_points)
for(var/V in all_quirks)
var/datum/quirk/T = SSquirks.quirks[V]
bal -= initial(T.value)
@@ -0,0 +1,66 @@
/datum/preference_middleware/personality
action_delegations = list(
"handle_personality" = PROC_REF(handle_personality),
"clear_personalities" = PROC_REF(clear_personalities),
)
/datum/preference_middleware/personality/proc/handle_personality(list/params, mob/user)
var/datum/personality/personality_type = text2path(params["personality_type"])
if(!ispath(personality_type, /datum/personality))
return FALSE
var/personality_key = initial(personality_type.savefile_key)
var/list/personalities = preferences.read_preference(/datum/preference/personality)
if(personality_key in personalities)
LAZYREMOVE(personalities, personality_key)
else
if(LAZYLEN(personalities) >= CONFIG_GET(number/max_personalities))
return TRUE
if(SSpersonalities.is_incompatible(personalities, personality_type))
return TRUE
LAZYADD(personalities, personality_key)
preferences.update_preference(GLOB.preference_entries[/datum/preference/personality], personalities)
return TRUE
/datum/preference_middleware/personality/proc/clear_personalities(list/params, mob/user)
preferences.update_preference(GLOB.preference_entries[/datum/preference/personality], null)
return TRUE
/datum/preference_middleware/personality/get_constant_data()
var/list/data = list()
data["personalities"] = list()
for(var/datum/personality/personality_type as anything in SSpersonalities.personalities_by_type)
var/datum/personality/personality = SSpersonalities.personalities_by_type[personality_type]
data["personalities"] += list(list(
"description" = personality.desc,
"pos_gameplay_description" = personality.pos_gameplay_desc,
"neg_gameplay_description" = personality.neg_gameplay_desc,
"neut_gameplay_description" = personality.neut_gameplay_desc,
"name" = personality.name,
"path" = personality_type,
"groups" = personality.groups,
))
data["personality_incompatibilities"] = SSpersonalities.incompatibilities_by_group
return data
/datum/preference_middleware/personality/get_ui_static_data(mob/user)
var/list/data = list()
var/max = CONFIG_GET(number/max_personalities)
data["max_personalities"] = max >= length(SSpersonalities.personalities_by_type) ? -1 : max
data["mood_enabled"] = !CONFIG_GET(flag/disable_human_mood)
return data
/datum/preference_middleware/personality/get_ui_data(mob/user)
var/list/data = list()
data["selected_personalities"] = list()
for(var/personality_key in preferences.read_preference(/datum/preference/personality))
var/datum/personality/personality = SSpersonalities.personalities_by_key[personality_key]
data["selected_personalities"] += personality.type
return data
@@ -49,6 +49,7 @@
var/list/data = list()
data["selected_quirks"] = get_selected_quirks()
data["default_quirk_balance"] = CONFIG_GET(number/default_quirk_points)
data["species_disallowed_quirks"] = get_species_compatibility()
return data
@@ -0,0 +1,16 @@
/**
* Replace a quirk with a personality
*
* If this is accompanied with removal of a quirk,
* you don't need to worry about handling that here -
* quirk sanitization happens AFTER migration
*/
/datum/preferences/proc/migrate_quirk_to_personality(quirk_to_migrate, datum/personality/new_typepath)
ASSERT(istext(quirk_to_migrate) && ispath(new_typepath, /datum/personality))
if(!(quirk_to_migrate in all_quirks))
return
var/list/personalities = read_preference(/datum/preference/personality)
if(LAZYLEN(personalities) >= CONFIG_GET(number/max_personalities))
return
LAZYADD(personalities, initial(new_typepath.savefile_key))
write_preference(GLOB.preference_entries[/datum/preference/personality], personalities)
+28 -2
View File
@@ -13,7 +13,7 @@
/// You do not need to raise this if you are adding new values that have sane defaults.
/// Only raise this value when changing the meaning/format/name/layout of an existing value
/// where you would want the updater procs below to run
#define SAVEFILE_VERSION_MAX 49
#define SAVEFILE_VERSION_MAX 50
#define IS_DATA_OBSOLETE(version) (version == SAVE_DATA_OBSOLETE)
#define SHOULD_UPDATE_DATA(version) (version >= SAVE_DATA_NO_ERROR && version < SAVEFILE_VERSION_MAX)
@@ -138,6 +138,31 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
quirk_to_migrate = "Cyborg Pre-screened dogtag",
new_typepath = /obj/item/clothing/accessory/dogtag/borg_ready,
)
if(current_version < 50)
migrate_quirk_to_personality(
quirk_to_migrate = "Extrovert",
new_typepath = /datum/personality/extrovert,
)
migrate_quirk_to_personality(
quirk_to_migrate = "Introvert",
new_typepath = /datum/personality/introvert,
)
migrate_quirk_to_personality(
quirk_to_migrate = "Bad Touch",
new_typepath = /datum/personality/aloof,
)
migrate_quirk_to_personality(
quirk_to_migrate = "Apathetic",
new_typepath = /datum/personality/apathetic,
)
migrate_quirk_to_personality(
quirk_to_migrate = "Snob",
new_typepath = /datum/personality/snob,
)
migrate_quirk_to_personality(
quirk_to_migrate = "Spiritual",
new_typepath = /datum/personality/spiritual,
)
/// checks through keybindings for outdated unbound keys and updates them
/datum/preferences/proc/check_keybindings()
@@ -243,7 +268,6 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
update_preferences(data_validity_integer, savefile)
check_keybindings() // this apparently fails every time and overwrites any unloaded prefs with the default values, so don't load anything after this line or it won't actually save
key_bindings_by_key = get_key_bindings_by_key(key_bindings)
//Sanitize
lastchangelog = sanitize_text(lastchangelog, initial(lastchangelog))
@@ -253,6 +277,8 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
key_bindings = sanitize_keybindings(key_bindings)
favorite_outfits = SANITIZE_LIST(favorite_outfits)
key_bindings_by_key = get_key_bindings_by_key(key_bindings)
if(SHOULD_UPDATE_DATA(data_validity_integer)) //save the updated version
var/old_default_slot = default_slot
var/old_max_save_slots = max_save_slots
+1 -2
View File
@@ -424,10 +424,9 @@ ADMIN_VERB(reset_ooc_color, R_FUN, "Reset Player OOC Color", "Returns player OOC
/client/proc/attempt_auto_fit_viewport()
if (!prefs?.read_preference(/datum/preference/toggle/auto_fit_viewport))
return
// No need to attempt to fit the viewport on non-initialized clients as they'll auto-fit viewport right before finishing init
if(fully_created)
INVOKE_ASYNC(src, VERB_REF(fit_viewport))
else //Delayed to avoid wingets from Login calls.
addtimer(CALLBACK(src, VERB_REF(fit_viewport), 1 SECONDS))
/client/verb/policy()
set name = "Show Policy"