| 242 | } |
| 243 | |
| 244 | void MenuApplication::LoadMenu(const MenuType type, const bool fade, MenuFadeCallback fade_cb) { |
| 245 | this->StopPlayBgm(); |
| 246 | |
| 247 | if(fade) { |
| 248 | this->SetBackgroundFade(); |
| 249 | this->FadeOut(); |
| 250 | |
| 251 | if(fade_cb) { |
| 252 | fade_cb(); |
| 253 | } |
| 254 | } |
| 255 | |
| 256 | this->EnsureLayoutCreated(type); |
| 257 | |
| 258 | switch(type) { |
| 259 | case MenuType::Startup: { |
| 260 | this->startup_menu_lyt->ReloadMenu(); |
| 261 | this->LoadLayout(this->startup_menu_lyt); |
| 262 | break; |
| 263 | } |
| 264 | case MenuType::Main: { |
| 265 | this->main_menu_lyt->Reload(); |
| 266 | this->LoadLayout(this->main_menu_lyt); |
| 267 | break; |
| 268 | } |
| 269 | case MenuType::Settings: { |
| 270 | this->settings_menu_lyt->Rewind(); |
| 271 | this->settings_menu_lyt->Reload(false); |
| 272 | this->LoadLayout(this->settings_menu_lyt); |
| 273 | break; |
| 274 | } |
| 275 | case MenuType::Themes: { |
| 276 | this->themes_menu_lyt->Reload(); |
| 277 | this->LoadLayout(this->themes_menu_lyt); |
| 278 | break; |
| 279 | } |
| 280 | case MenuType::Lockscreen: { |
| 281 | this->LoadLayout(this->lockscreen_menu_lyt); |
| 282 | break; |
| 283 | } |
| 284 | } |
| 285 | |
| 286 | this->loaded_menu = type; |
| 287 | |
| 288 | this->StartPlayBgm(); |
| 289 | |
| 290 | if(fade) { |
| 291 | this->FadeIn(); |
| 292 | } |
| 293 | } |
| 294 | |
| 295 | void MenuApplication::ShowNotification(const std::string &text, const u64 timeout) { |
| 296 | this->EndOverlay(); |
no test coverage detected