From e6a99ca9ac64eeff3016e44f4be761c6c0ab3ae8 Mon Sep 17 00:00:00 2001 From: Patrick Babb <72764527+patrickbabb@users.noreply.github.com> Date: Sun, 4 May 2025 23:17:40 -0500 Subject: [PATCH 1/4] Update build.xml Reverted the core file download link to the previous path format to allow Android to download from the correct URL. --- projects/mtg/build.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/mtg/build.xml b/projects/mtg/build.xml index 0895430fd..af9bc4c42 100644 --- a/projects/mtg/build.xml +++ b/projects/mtg/build.xml @@ -88,8 +88,8 @@ Mod by: Vitty85 #define WAGIC_CORE_VERSION_STRING "core_" VERSION_STRINGIFY(WAGIC_RESOURCE_VERSION) #define WAGIC_RESOURCE_NAME "Wagic-core-" VERSION_STRINGIFY(WAGIC_RESOURCE_VERSION) ".zip" #define WAGIC_RELEASE_NAME "wagic-v" WAGIC_VERSION_STRING -#define WAGIC_RESOURCE_URL "https://github.com/WagicProject/wagic/releases" WAGIC_RELEASE_NAME "/" WAGIC_RESOURCE_NAME - +#define WAGIC_RESOURCE_URL "https://github.com/WagicProject/wagic/releases/download/" WAGIC_RELEASE_NAME "/" WAGIC_RESOURCE_NAME + #endif From ccd421598eaf441a2799f33dc05e418bb17e9588 Mon Sep 17 00:00:00 2001 From: Patrick Babb <72764527+patrickbabb@users.noreply.github.com> Date: Sun, 4 May 2025 23:53:45 -0500 Subject: [PATCH 2/4] Update SDLActivity.java Enabled immersive mode on Android devices during onCreate in the lifecycle. --- .../src/org/libsdl/app/SDLActivity.java | 59 +++++++++++++------ 1 file changed, 42 insertions(+), 17 deletions(-) diff --git a/projects/mtg/Android/src/org/libsdl/app/SDLActivity.java b/projects/mtg/Android/src/org/libsdl/app/SDLActivity.java index 593ee1c35..18d088324 100644 --- a/projects/mtg/Android/src/org/libsdl/app/SDLActivity.java +++ b/projects/mtg/Android/src/org/libsdl/app/SDLActivity.java @@ -1115,24 +1115,49 @@ public class SDLActivity extends Activity implements OnKeyListener { } // Setup - @Override - protected void onCreate(Bundle savedInstanceState) { - //Log.d(TAG, "onCreate()"); - super.onCreate(savedInstanceState); + private void enterImmersiveMode() { + final View decorView = getWindow().getDecorView(); + decorView.setSystemUiVisibility( + View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY + | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION + | View.SYSTEM_UI_FLAG_FULLSCREEN + | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION + | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN + | View.SYSTEM_UI_FLAG_LAYOUT_STABLE + ); + } + + @Override + public void onWindowFocusChanged(boolean hasFocus) { + super.onWindowFocusChanged(hasFocus); + if (hasFocus) { + enterImmersiveMode(); + } + } - StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll() - .build(); - StrictMode.setThreadPolicy(policy); - setContentView(R.layout.main); - getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); - // So we can call stuff from static callbacks - mSingleton = this; - mContext = this.getApplicationContext(); - RES_FILENAME = getResourceName(); - StorageOptions.determineStorageOptions(mContext); - checkStorageLocationPreference(); - prepareOptionMenu(null); - } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build(); + StrictMode.setThreadPolicy(policy); + + setContentView(R.layout.main); + + // Enable immersive mode + enterImmersiveMode(); + + getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); + + // So we can call stuff from static callbacks + mSingleton = this; + mContext = this.getApplicationContext(); + RES_FILENAME = getResourceName(); + StorageOptions.determineStorageOptions(mContext); + checkStorageLocationPreference(); + prepareOptionMenu(null); +} public void forceResDownload(final File oldRes) { AlertDialog.Builder resChooser = new AlertDialog.Builder(this); From c19410b4fba6d0ab11010e963a00964f3add2bec Mon Sep 17 00:00:00 2001 From: Patrick Babb <72764527+patrickbabb@users.noreply.github.com> Date: Mon, 5 May 2025 00:10:53 -0500 Subject: [PATCH 3/4] Update SDLActivity.java Added a null check to fix the deck downloader menu option. --- .../src/org/libsdl/app/SDLActivity.java | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/projects/mtg/Android/src/org/libsdl/app/SDLActivity.java b/projects/mtg/Android/src/org/libsdl/app/SDLActivity.java index 18d088324..cbf3f2627 100644 --- a/projects/mtg/Android/src/org/libsdl/app/SDLActivity.java +++ b/projects/mtg/Android/src/org/libsdl/app/SDLActivity.java @@ -307,16 +307,18 @@ public class SDLActivity extends Activity implements OnKeyListener { importDeck.setTitle("Choose Deck to Import:"); File root = new File(System.getenv("EXTERNAL_STORAGE") + "/Download"); - File[] files = root.listFiles(); + File[] files = root.listFiles(); - for (File f : files) { - if (!myresult.contains(f.toString()) && - (f.toString().contains(".txt") || - f.toString().contains(".dck") || - f.toString().contains(".dec"))) { - myresult.add(f.toString()); - } - } + if (files != null) { + for (File f : files) { + if (!myresult.contains(f.toString()) && + (f.toString().contains(".txt") || + f.toString().contains(".dck") || + f.toString().contains(".dec"))) { + myresult.add(f.toString()); + } + } + } //get first item? if (!myresult.isEmpty()) { From 17f0f59f38f4f002add072253a6e991127742e51 Mon Sep 17 00:00:00 2001 From: Patrick Babb <72764527+patrickbabb@users.noreply.github.com> Date: Mon, 5 May 2025 23:09:10 -0500 Subject: [PATCH 4/4] Update GameStateAwards.cpp Added a "Back to Main Menu" button to the Trophy Room for touch devices. --- projects/mtg/src/GameStateAwards.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/projects/mtg/src/GameStateAwards.cpp b/projects/mtg/src/GameStateAwards.cpp index 19b07993b..dbd3f0d0f 100644 --- a/projects/mtg/src/GameStateAwards.cpp +++ b/projects/mtg/src/GameStateAwards.cpp @@ -97,6 +97,12 @@ void GameStateAwards::Start() wgh = NEW WGuiHeader(""); listview->Add(wgh); + + #if !defined(PSP) + WGuiItem* backLabel = NEW WGuiItem("Back to Main Menu"); + WGuiButton* backBtn = NEW WGuiButton(backLabel, EXIT_AWARDS_MENU, GameStateAwardsConst::kBackToMainMenuID, this); + listview->Add(backBtn); + #endif int locked = 0;