reworks game preferences (characters v2 staging) (#6310)

Co-authored-by: silicons <no@you.cat>
Co-authored-by: LordME <58342752+TheLordME@users.noreply.github.com>
This commit is contained in:
silicons
2024-04-08 12:44:30 +02:00
committed by GitHub
co-authored by silicons LordME
parent 9f1b911556
commit 39bc14bb4a
427 changed files with 3981 additions and 2842 deletions
+24 -9
View File
@@ -198,9 +198,21 @@
// resolve persistent data
persistent = resolve_client_data(ckey, key)
//* Resolve database data
player = new(key)
player = resolve_player_data(ckey, key)
player.log_connect()
// todo: move preferences up here but above persistent
//* Resolve preferences
preferences = SSpreferences.resolve_game_preferences(key, ckey)
preferences.active = src
preferences.on_reconnect()
//? WARNING: SHITCODE ALERT ?//
// We allow a client/New sleep because preferences is currently required for
// everything else to work
// todo: maybe don't do this?
if(!UNLINT(preferences.block_on_initialized(5 SECONDS)))
security_kick("A fatal error occurred while attempting to load: preferences not initialized. Please notify a coder.")
stack_trace("we just kicked a client due to prefs not loading; something is horribly wrong!")
return
//? END ?//
//* Setup user interface
// todo: move top level menu here, for now it has to be under prefs.
@@ -328,11 +340,12 @@
pre_init_viewport()
mob.reload_rendering()
if(prefs.lastchangelog != GLOB.changelog_hash) //bolds the changelog button on the interface so we know there are updates.
to_chat(src, "<span class='info'>You have unread updates in the changelog.</span>")
winset(src, "infowindow.changelog", "background-color=#eaeaea;font-style=bold")
if(config_legacy.aggressive_changelog)
changelog_async()
// todo: this is dead because changelog is dead but we should fix it tbvqh
// if(prefs.lastchangelog != GLOB.changelog_hash) //bolds the changelog button on the interface so we know there are updates.
// to_chat(src, "<span class='info'>You have unread updates in the changelog.</span>")
// winset(src, "infowindow.changelog", "background-color=#eaeaea;font-style=bold")
// if(config_legacy.aggressive_changelog)
// changelog_async()
// ensure asset cache is there
INVOKE_ASYNC(src, PROC_REF(warn_if_no_asset_cache_browser))
@@ -383,9 +396,11 @@
// log
log_access("Logout: [key_name(src)]")
// unreference storage datums
prefs = null
persistent = null
player = null
if(preferences)
preferences.active = null
preferences = null
//* unsorted
GLOB.ahelp_tickets.ClientLogout(src)
@@ -512,7 +527,7 @@
if(ab) //Citadel edit, things with stuff.
return
if (prefs.hotkeys)
if (preferences.is_hotkeys_mode())
// If hotkey mode is enabled, then clicking the map will automatically
// unfocus the text bar. This removes the red color from the text bar
// so that the visual focus indicator matches reality.