diff --git a/code/_onclick/hud/new_player.dm b/code/_onclick/hud/new_player.dm index 04342f4267c..438a71619ca 100644 --- a/code/_onclick/hud/new_player.dm +++ b/code/_onclick/hud/new_player.dm @@ -201,8 +201,20 @@ name = "View Character Setup" screen_loc = "TOP:-70,CENTER:-54" icon = 'icons/hud/lobby/character_setup.dmi' - icon_state = "character_setup" + icon_state = "character_setup_disabled" base_icon_state = "character_setup" + enabled = FALSE + +/atom/movable/screen/lobby/button/character_setup/Initialize(mapload, datum/hud/hud_owner) + . = ..() + // We need IconForge and the assets to be ready before allowing the menu to open + if(SSearly_assets.initialized == INITIALIZATION_INNEW_REGULAR || SSatoms.initialized == INITIALIZATION_INNEW_REGULAR) + flick("[base_icon_state]_enabled", src) + set_button_status(TRUE) + else + set_button_status(FALSE) + RegisterSignal(SSearly_assets, COMSIG_SUBSYSTEM_POST_INITIALIZE, PROC_REF(enable_character_setup)) + RegisterSignal(SSatoms, COMSIG_SUBSYSTEM_POST_INITIALIZE, PROC_REF(enable_character_setup)) /atom/movable/screen/lobby/button/character_setup/Click(location, control, params) . = ..() @@ -214,6 +226,13 @@ preferences.update_static_data(usr) preferences.ui_interact(usr) +/atom/movable/screen/lobby/button/character_setup/proc/enable_character_setup() + SIGNAL_HANDLER + flick("[base_icon_state]_enabled", src) + set_button_status(TRUE) + UnregisterSignal(SSearly_assets, COMSIG_SUBSYSTEM_POST_INITIALIZE) + UnregisterSignal(SSatoms, COMSIG_SUBSYSTEM_POST_INITIALIZE) + ///Button that appears before the game has started /atom/movable/screen/lobby/button/ready name = "Toggle Readiness" @@ -373,9 +392,20 @@ /atom/movable/screen/lobby/button/bottom/settings name = "View Game Preferences" - icon_state = "settings" + icon_state = "settings_disabled" base_icon_state = "settings" screen_loc = "TOP:-122,CENTER:+29" + enabled = FALSE + +/atom/movable/screen/lobby/button/bottom/settings/Initialize(mapload, datum/hud/hud_owner) + . = ..() + // We need IconForge and the assets to be ready before allowing the menu to open + if(SSearly_assets.initialized == INITIALIZATION_INNEW_REGULAR || SSatoms.initialized == INITIALIZATION_INNEW_REGULAR) + set_button_status(TRUE) + else + set_button_status(FALSE) + RegisterSignal(SSearly_assets, COMSIG_SUBSYSTEM_POST_INITIALIZE, PROC_REF(enable_settings)) + RegisterSignal(SSatoms, COMSIG_SUBSYSTEM_POST_INITIALIZE, PROC_REF(enable_settings)) /atom/movable/screen/lobby/button/bottom/settings/Click(location, control, params) . = ..() @@ -387,6 +417,12 @@ preferences.update_static_data(usr) preferences.ui_interact(usr) +/atom/movable/screen/lobby/button/bottom/settings/proc/enable_settings() + SIGNAL_HANDLER + set_button_status(TRUE) + UnregisterSignal(SSearly_assets, COMSIG_SUBSYSTEM_POST_INITIALIZE) + UnregisterSignal(SSatoms, COMSIG_SUBSYSTEM_POST_INITIALIZE) + /atom/movable/screen/lobby/button/bottom/changelog_button name = "View Changelog" icon_state = "changelog" diff --git a/code/controllers/subsystem.dm b/code/controllers/subsystem.dm index 0dbe2af2f8b..02f45a54150 100644 --- a/code/controllers/subsystem.dm +++ b/code/controllers/subsystem.dm @@ -40,7 +40,7 @@ /// Which stage does this subsystem init at. Earlier stages can fire while later stages init. var/init_stage = INITSTAGE_MAIN - /// This var is set to TRUE after the subsystem has been initialized. + /// This var is set to `INITIALIZATION_INNEW_REGULAR` after the subsystem has been initialized. var/initialized = FALSE /// Set to 0 to prevent fire() calls, mostly for admin use or subsystems that may be resumed later diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index 173a06b677d..135dd8a0297 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -143,6 +143,10 @@ GLOBAL_LIST_EMPTY(preferences_datums) // I'm making the assumption that ui close will be called whenever a user logs out, or loses a window // If this isn't the case, kill me and restore the code, thanks + // We need IconForge and the assets to be ready before allowing the menu to open + if(SSearly_assets.initialized != INITIALIZATION_INNEW_REGULAR) + return + ui = SStgui.try_update_ui(user, src, ui) if(!ui) character_preview_view = create_character_preview_view(user) diff --git a/icons/hud/lobby/character_setup.dmi b/icons/hud/lobby/character_setup.dmi index d3b94fb43e9..a5f15dcd146 100644 Binary files a/icons/hud/lobby/character_setup.dmi and b/icons/hud/lobby/character_setup.dmi differ