- Added a new option to mobile Forge which might help deal with the texture issues after locking/unlocking the screen (suggested by kevlahnota).

This commit is contained in:
Agetian
2017-08-26 15:13:46 +00:00
parent 5bdb205168
commit f9ede752f2
4 changed files with 29 additions and 6 deletions

View File

@@ -1,8 +1,5 @@
package forge.app; package forge.app;
import java.io.File;
import java.util.concurrent.Callable;
import android.app.AlarmManager; import android.app.AlarmManager;
import android.app.PendingIntent; import android.app.PendingIntent;
import android.content.ClipData; import android.content.ClipData;
@@ -17,18 +14,22 @@ import android.net.NetworkInfo;
import android.net.Uri; import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import android.os.Environment; import android.os.Environment;
import android.os.PowerManager;
import android.view.WindowManager; import android.view.WindowManager;
import android.webkit.MimeTypeMap; import android.webkit.MimeTypeMap;
import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.backends.android.AndroidApplication; import com.badlogic.gdx.backends.android.AndroidApplication;
import forge.FThreads; import forge.FThreads;
import forge.Forge; import forge.Forge;
import forge.interfaces.IDeviceAdapter; import forge.interfaces.IDeviceAdapter;
import forge.model.FModel;
import forge.properties.ForgePreferences;
import forge.util.FileUtil; import forge.util.FileUtil;
import forge.util.ThreadUtil; import forge.util.ThreadUtil;
import java.io.File;
import java.util.concurrent.Callable;
public class Main extends AndroidApplication { public class Main extends AndroidApplication {
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
@@ -80,6 +81,21 @@ public class Main extends AndroidApplication {
}*/ }*/
@Override
protected void onPause()
{
if (FModel.getPreferences().getPrefBoolean(ForgePreferences.FPref.UI_ANDROID_MINIMIZE_ON_SCRLOCK)) {
super.onPause();
// If the screen is off then the device has been locked
PowerManager powerManager = (PowerManager) getSystemService(POWER_SERVICE);
boolean isScreenOn = powerManager.isScreenOn();
if (!isScreenOn) {
this.moveTaskToBack(true);
// Minimize the app to the background...
}
}
}
//special clipboard that words on Android //special clipboard that words on Android
private class AndroidClipboard implements com.badlogic.gdx.utils.Clipboard { private class AndroidClipboard implements com.badlogic.gdx.utils.Clipboard {
private final ClipboardManager cm = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE); private final ClipboardManager cm = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE);

View File

@@ -75,7 +75,10 @@ public class SettingsPage extends TabPage<SettingsScreen> {
} }
} }
}, 0); }, 0);
lstSettings.addItem(new BooleanSetting(FPref.UI_ANDROID_MINIMIZE_ON_SCRLOCK,
"Minimize on Screen Lock",
"Minimize Forge when screen is locked (enable if you experience graphic glitches after locking your screen)."),
0);
//Gameplay Options //Gameplay Options
lstSettings.addItem(new CustomSelectSetting(FPref.UI_CURRENT_AI_PROFILE, lstSettings.addItem(new CustomSelectSetting(FPref.UI_CURRENT_AI_PROFILE,
"AI Personality", "AI Personality",

View File

@@ -4,6 +4,9 @@ A simple "create a puzzle" mode has been added, which presents you with a clean
- Targeting Overlay - - Targeting Overlay -
The planeswalker attacker targeting arrows now use a distinct color from the blocker arrows, to make them easier to distinguish during a complex combat scenario. The default theme uses orange targeting arrows for this purpose, but they can be redefined in custom themes by editing sprite_icons.png (please consult the updated default file for details). The planeswalker attacker targeting arrows now use a distinct color from the blocker arrows, to make them easier to distinguish during a complex combat scenario. The default theme uses orange targeting arrows for this purpose, but they can be redefined in custom themes by editing sprite_icons.png (please consult the updated default file for details).
- Mobile Forge: Minimize on Screen Lock (option) -
A new option is available in Mobile Forge, which sends the game to background ("minimizes" it) when the screen is locked. This might help in case you are experiencing graphic issues (missing card pictures, black squares instead of font letters, etc.) after locking the screen for some time. This option is opt-in for now, and is thus off by default. This option and the fix were suggested by kevlahnota.
- Mobile Forge: Texture Filtering - - Mobile Forge: Texture Filtering -
Texture filtering is now enabled by default for new Mobile Forge installations on Android. After extensive testing this mode has shown no noticeable performance downgrade on modern Android devices while offering a significantly higher quality of card rendering on the battlefield. Older installations will not be affected by this and you will still need to enable the feature manually if desired (in Forge preferences). If you are on a significantly older or low-end device and you are experiencing inadequately low game performance, please try disabling this option in case it is enabled on your installation. Texture filtering is now enabled by default for new Mobile Forge installations on Android. After extensive testing this mode has shown no noticeable performance downgrade on modern Android devices while offering a significantly higher quality of card rendering on the battlefield. Older installations will not be affected by this and you will still need to enable the feature manually if desired (in Forge preferences). If you are on a significantly older or low-end device and you are experiencing inadequately low game performance, please try disabling this option in case it is enabled on your installation.

View File

@@ -93,6 +93,7 @@ public class ForgePreferences extends PreferencesStore<ForgePreferences.FPref> {
UI_SHOW_STORM_COUNT_IN_PROMPT ("false"), UI_SHOW_STORM_COUNT_IN_PROMPT ("false"),
UI_CARD_COUNTER_DISPLAY_TYPE(ForgeConstants.CounterDisplayType.TEXT.getName()), UI_CARD_COUNTER_DISPLAY_TYPE(ForgeConstants.CounterDisplayType.TEXT.getName()),
UI_CARD_COUNTER_DISPLAY_LOCATION(ForgeConstants.CounterDisplayLocation.TOP.getName()), UI_CARD_COUNTER_DISPLAY_LOCATION(ForgeConstants.CounterDisplayLocation.TOP.getName()),
UI_ANDROID_MINIMIZE_ON_SCRLOCK("false"),
UI_FOR_TOUCHSCREN("false"), UI_FOR_TOUCHSCREN("false"),