MCPcopy Create free account
hub / github.com/XorTroll/uLaunch / OnLoad

Method OnLoad

projects/uMenu/source/ul/menu/ui/ui_MenuApplication.cpp:89–214  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

87 }
88
89 void MenuApplication::OnLoad() {
90 UL_LOG_INFO("MenuApplication::OnLoad start...");
91 const auto time = std::chrono::system_clock::now();
92
93 #define _LOG_SOFAR(kind) UL_LOG_INFO("MenuApplication::OnLoad -> " kind ", so far took %lld ms", std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now() - time).count());
94
95 this->launch_failed = false;
96 this->pending_gc_mount_rc = ResultSuccess;
97 this->needs_app_records_reload = false;
98 this->needs_app_entries_reload = false;
99 memset(this->chosen_hb, 0, sizeof(this->chosen_hb));
100 this->verify_finished_app_id = 0;
101 this->verify_rc = ResultSuccess;
102 this->verify_detail_rc = ResultSuccess;
103 this->active_theme_load_rc = ResultSuccess;
104 this->active_theme_outdated = false;
105
106 this->startup_menu_lyt = nullptr;
107 this->main_menu_lyt = nullptr;
108 this->themes_menu_lyt = nullptr;
109 this->settings_menu_lyt = nullptr;
110 this->lockscreen_menu_lyt = nullptr;
111
112 // TODO: customize
113 this->SetFadeAlphaIncrementStepCount(FastFadeAlphaIncrementSteps);
114
115 InitializeResources();
116
117 _LOG_SOFAR("done initializing resources");
118
119 InitializeScreenCaptures(this->start_mode);
120
121 _LOG_SOFAR("done screen capture buffers");
122
123 // BGM
124
125 bool global_bgm_loop;
126 if(TryGetBgmValue("bgm_loop", global_bgm_loop)) {
127 g_GlobalSettings.main_menu_bgm.bgm_loop = global_bgm_loop;
128 g_GlobalSettings.startup_menu_bgm.bgm_loop = global_bgm_loop;
129 g_GlobalSettings.themes_menu_bgm.bgm_loop = global_bgm_loop;
130 g_GlobalSettings.settings_menu_bgm.bgm_loop = global_bgm_loop;
131 g_GlobalSettings.lockscreen_menu_bgm.bgm_loop = global_bgm_loop;
132 }
133
134 u32 global_bgm_fade_in_ms;
135 if(TryGetBgmValue("bgm_fade_in_ms", global_bgm_fade_in_ms)) {
136 g_GlobalSettings.main_menu_bgm.bgm_fade_in_ms = global_bgm_fade_in_ms;
137 g_GlobalSettings.startup_menu_bgm.bgm_fade_in_ms = global_bgm_fade_in_ms;
138 g_GlobalSettings.themes_menu_bgm.bgm_fade_in_ms = global_bgm_fade_in_ms;
139 g_GlobalSettings.settings_menu_bgm.bgm_fade_in_ms = global_bgm_fade_in_ms;
140 g_GlobalSettings.lockscreen_menu_bgm.bgm_fade_in_ms = global_bgm_fade_in_ms;
141 }
142
143 u32 global_bgm_fade_out_ms;
144 if(TryGetBgmValue("bgm_fade_out_ms", global_bgm_fade_out_ms)) {
145 g_GlobalSettings.main_menu_bgm.bgm_fade_out_ms = global_bgm_fade_out_ms;
146 g_GlobalSettings.startup_menu_bgm.bgm_fade_out_ms = global_bgm_fade_out_ms;

Callers

nothing calls this directly

Calls 7

LoadMenuMethod · 0.95
StartPlayBgmMethod · 0.95
InitializeResourcesFunction · 0.85
InitializeScreenCapturesFunction · 0.85
TryGetBgmValueFunction · 0.85
NotifyMessageContextMethod · 0.80

Tested by

no test coverage detected