Fixing android bugs and more
This commit is contained in:
1 parent
5b21ba615e
commit
fc93eb6680
55 files changed
+1192
-141
No files matched your search
+39
-3
@@ -160,9 +160,18 @@ namespace FRG {
|
||||
|
||||
void MenuManager::loadUiRoots(const std::string& zipFile) {
|
||||
hudRoot = loadLocalizedUi("resources/w/ui/hud_step0.json", zipFile);
|
||||
|
||||
#ifdef __ANDROID__
|
||||
hudStep1Root = loadLocalizedUi("resources/w/ui/hud_step1android.json", zipFile);
|
||||
#else
|
||||
hudStep1Root = loadLocalizedUi("resources/w/ui/hud_step1.json", zipFile);
|
||||
#endif
|
||||
hudStep2Root = loadLocalizedUi("resources/w/ui/hud_step2.json", zipFile);
|
||||
#ifdef __ANDROID__
|
||||
hudStep3Root = loadLocalizedUi("resources/w/ui/hud_step3android.json", zipFile);
|
||||
#else
|
||||
hudStep3Root = loadLocalizedUi("resources/w/ui/hud_step3.json", zipFile);
|
||||
#endif
|
||||
hudStep4Root = loadLocalizedUi("resources/w/ui/hud_step4.json", zipFile);
|
||||
hudStep5aRoot = loadLocalizedUi("resources/w/ui/hud_step5a.json", zipFile);
|
||||
hudStep5bRoot = loadLocalizedUi("resources/w/ui/hud_step5b.json", zipFile);
|
||||
@@ -216,9 +225,17 @@ namespace FRG {
|
||||
questJournalRoot = loadLocalizedUi("resources/w/ui/screen_journal.json", zipFile);
|
||||
portraitQuestJournalListRoot = loadLocalizedUi("resources/w/ui/portrait_screen_journal.json", zipFile);
|
||||
portraitQuestJournalItemRoot = loadLocalizedUi("resources/w/ui/portrait_screen_journal_item.json", zipFile);
|
||||
mainMenuRoot = loadLocalizedUi("resources/w/ui/screen_main_menu.json", zipFile);
|
||||
|
||||
#ifdef __ANDROID__
|
||||
mainMenuRoot = loadLocalizedUi("resources/w/ui/screen_main_menu_android.json", zipFile);
|
||||
aboutScreenRoot = loadLocalizedUi("resources/w/ui/screen_about_android.json", zipFile);
|
||||
#else
|
||||
|
||||
mainMenuRoot = loadLocalizedUi("resources/w/ui/screen_main_menu.json", zipFile);
|
||||
aboutScreenRoot = loadLocalizedUi("resources/w/ui/screen_about.json", zipFile);
|
||||
creditsScreenRoot = loadLocalizedUi("resources/w/ui/screen_credits.json", zipFile);
|
||||
#endif
|
||||
creditsScreenRoot = loadLocalizedUi("resources/w/ui/screen_credits.json", zipFile);
|
||||
portraitCreditsScreenRoot = loadLocalizedUi("resources/w/ui/screen_credits_portrait.json", zipFile);
|
||||
settingsScreenRoot = loadLocalizedUi("resources/w/ui/screen_settings.json", zipFile);
|
||||
settingsGraphicsScreenRoot = loadLocalizedUi("resources/w/ui/screen_settings_graphics.json", zipFile);
|
||||
languageScreenRoot = loadLocalizedUi("resources/w/ui/screen_language.json", zipFile);
|
||||
@@ -488,8 +505,17 @@ namespace FRG {
|
||||
}
|
||||
|
||||
void MenuManager::showCreditsScreen() {
|
||||
uiManager.pushMenuFromSavedRoot(creditsScreenRoot);
|
||||
isPlayerInCreditsMenu = true;
|
||||
if (isPortraitMode())
|
||||
{
|
||||
uiManager.pushMenuFromSavedRoot(portraitCreditsScreenRoot);
|
||||
}
|
||||
else
|
||||
{
|
||||
uiManager.pushMenuFromSavedRoot(creditsScreenRoot);
|
||||
}
|
||||
uiManager.setButtonCallback("creditsBackButton", [this](const std::string&) {
|
||||
isPlayerInCreditsMenu = false;
|
||||
uiManager.popMenu();
|
||||
uiManager.updateAllLayouts();
|
||||
audioPlayer_.playSoundAsync("audio/751089__smallconfusion__mechanical-plastic-click-11.ogg");
|
||||
@@ -642,6 +668,9 @@ namespace FRG {
|
||||
refreshFullscreenToggle();
|
||||
refreshShadowToggle();
|
||||
|
||||
#ifdef __ANDROID__
|
||||
uiManager.setNodeVisible("fullScreenToggleButton", false);
|
||||
#else
|
||||
uiManager.setTextButtonCallback("fullScreenToggleButton", [this, refreshFullscreenToggle](const std::string&) {
|
||||
Environment::setFullscreen(!Environment::isFullscreen);
|
||||
refreshFullscreenToggle();
|
||||
@@ -649,6 +678,7 @@ namespace FRG {
|
||||
uiManager.updateAllLayouts();
|
||||
topUiManager.updateAllLayouts();
|
||||
});
|
||||
#endif
|
||||
|
||||
uiManager.setTextButtonCallback("shadowToggleButton", [this, refreshShadowToggle](const std::string&) {
|
||||
bool newValue = !this->shadowsEnabled;
|
||||
@@ -2327,6 +2357,12 @@ namespace FRG {
|
||||
}
|
||||
|
||||
void MenuManager::onOrientationChanged() {
|
||||
if (isPlayerInCreditsMenu) {
|
||||
uiManager.popMenu();
|
||||
showCreditsScreen();
|
||||
uiManager.updateAllLayouts();
|
||||
return;
|
||||
}
|
||||
if (uiState_ == GameUiState::Inventory) {
|
||||
const int savedIndex = inventorySelectedIndex_;
|
||||
const bool wasOnItemDetail = (inventoryMenuStackDepth_ == 2);
|
||||
|
||||
Reference in new issue
Block a user