diff --git a/forge-gui-mobile/src/forge/Forge.java b/forge-gui-mobile/src/forge/Forge.java index 91bb2f1efd0..a2d81e34efa 100644 --- a/forge-gui-mobile/src/forge/Forge.java +++ b/forge-gui-mobile/src/forge/Forge.java @@ -296,7 +296,7 @@ public class Forge implements ApplicationListener { afterDBloaded = true; //selection - if (isLandscapeMode() && !GuiBase.isAndroid()) + if (isLandscapeMode()) splashScreen.setShowModeSelector(true); else openHomeDefault(); diff --git a/forge-gui-mobile/src/forge/adventure/scene/SettingsScene.java b/forge-gui-mobile/src/forge/adventure/scene/SettingsScene.java index f7ce47f9295..1552b00788b 100644 --- a/forge-gui-mobile/src/forge/adventure/scene/SettingsScene.java +++ b/forge-gui-mobile/src/forge/adventure/scene/SettingsScene.java @@ -18,6 +18,7 @@ import com.badlogic.gdx.utils.Align; import forge.Forge; import forge.adventure.util.Config; import forge.adventure.util.Controls; +import forge.gui.GuiBase; import forge.localinstance.properties.ForgePreferences; import forge.util.Localizer; @@ -171,29 +172,31 @@ public class SettingsScene extends UIScene { addLabel("Plane"); settingGroup.add(plane).align(Align.right); - addSettingField("Fullscreen", Config.instance().getSettingData().fullScreen, new ChangeListener() { - @Override - public void changed(ChangeEvent event, Actor actor) { - Config.instance().getSettingData().fullScreen=((CheckBox) actor).isChecked(); - Config.instance().saveSettings(); - } - }); - addSettingField("Screen width", Config.instance().getSettingData().width, new ChangeListener() { - @Override - public void changed(ChangeEvent event, Actor actor) { - String text=((TextField) actor).getText(); - Config.instance().getSettingData().width=text==null||text.isEmpty()?0:Integer.valueOf(text); - Config.instance().saveSettings(); - } - }); - addSettingField("Screen height", Config.instance().getSettingData().height, new ChangeListener() { - @Override - public void changed(ChangeEvent event, Actor actor) { - String text=((TextField) actor).getText(); - Config.instance().getSettingData().height=text==null||text.isEmpty()?0:Integer.valueOf(text); - Config.instance().saveSettings(); - } - }); + if (!GuiBase.isAndroid()) { + addSettingField("Fullscreen", Config.instance().getSettingData().fullScreen, new ChangeListener() { + @Override + public void changed(ChangeEvent event, Actor actor) { + Config.instance().getSettingData().fullScreen=((CheckBox) actor).isChecked(); + Config.instance().saveSettings(); + } + }); + addSettingField("Screen width", Config.instance().getSettingData().width, new ChangeListener() { + @Override + public void changed(ChangeEvent event, Actor actor) { + String text=((TextField) actor).getText(); + Config.instance().getSettingData().width=text==null||text.isEmpty()?0:Integer.valueOf(text); + Config.instance().saveSettings(); + } + }); + addSettingField("Screen height", Config.instance().getSettingData().height, new ChangeListener() { + @Override + public void changed(ChangeEvent event, Actor actor) { + String text=((TextField) actor).getText(); + Config.instance().getSettingData().height=text==null||text.isEmpty()?0:Integer.valueOf(text); + Config.instance().saveSettings(); + } + }); + } addCheckBox(localizer.getMessage("lblCardName"), ForgePreferences.FPref.UI_OVERLAY_CARD_NAME); addSettingSlider(localizer.getMessage("cbAdjustMusicVolume"), ForgePreferences.FPref.UI_VOL_MUSIC,0,100); addSettingSlider(localizer.getMessage("cbAdjustSoundsVolume"), ForgePreferences.FPref.UI_VOL_SOUNDS, 0,100); @@ -207,8 +210,8 @@ public class SettingsScene extends UIScene { addCheckBox(localizer.getMessage("lblBattlefieldTextureFiltering"), ForgePreferences.FPref.UI_LIBGDX_TEXTURE_FILTERING); addCheckBox(localizer.getMessage("lblAltZoneTabs"), ForgePreferences.FPref.UI_ALT_PLAYERZONETABS); addCheckBox(localizer.getMessage("lblAnimatedCardTapUntap"), ForgePreferences.FPref.UI_ANIMATED_CARD_TAPUNTAP); - addCheckBox(localizer.getMessage("lblBorderMaskOption"), ForgePreferences.FPref.UI_ENABLE_BORDER_MASKING); - if (!Forge.isMobileAdventureMode) { + if (!GuiBase.isAndroid()) { + addCheckBox(localizer.getMessage("lblBorderMaskOption"), ForgePreferences.FPref.UI_ENABLE_BORDER_MASKING); addCheckBox(localizer.getMessage("lblPreloadExtendedArtCards"), ForgePreferences.FPref.UI_ENABLE_PRELOAD_EXTENDED_ART); addCheckBox(localizer.getMessage("lblAutoCacheSize"), ForgePreferences.FPref.UI_AUTO_CACHE_SIZE); addCheckBox(localizer.getMessage("lblDisposeTextures"), ForgePreferences.FPref.UI_ENABLE_DISPOSE_TEXTURES); diff --git a/forge-gui-mobile/src/forge/adventure/stage/WorldBackground.java b/forge-gui-mobile/src/forge/adventure/stage/WorldBackground.java index 4cd6f8fb76b..56985ccfb20 100644 --- a/forge-gui-mobile/src/forge/adventure/stage/WorldBackground.java +++ b/forge-gui-mobile/src/forge/adventure/stage/WorldBackground.java @@ -3,10 +3,10 @@ package forge.adventure.stage; import com.badlogic.gdx.graphics.Pixmap; import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.g2d.Batch; +import com.badlogic.gdx.math.Vector2; import com.badlogic.gdx.scenes.scene2d.Actor; import forge.adventure.world.WorldSave; -import java.awt.*; import java.util.ArrayList; /** @@ -37,36 +37,36 @@ public class WorldBackground extends Actor { if (chunks == null) { initialize(); } - Point pos = translateFromWorldToChunk(playerX, playerY); + Vector2 pos = translateFromWorldToChunk(playerX, playerY); if (currentChunkX != pos.x || currentChunkY != pos.y) { - int xDiff = currentChunkX - pos.x; - int yDiff = currentChunkY - pos.y; - ArrayList points = new ArrayList(); + int xDiff = currentChunkX - (int)pos.x; + int yDiff = currentChunkY - (int)pos.y; + ArrayList points = new ArrayList<>(); for (int x = -1; x < 2; x++) { for (int y = -1; y < 2; y++) { - points.add(new Point(pos.x + x, pos.y + y)); + points.add(new Vector2(pos.x + x, pos.y + y)); } } for (int x = -1; x < 2; x++) { for (int y = -1; y < 2; y++) { - Point point = new Point(currentChunkX + x, currentChunkY + y); + Vector2 point = new Vector2(currentChunkX + x, currentChunkY + y); if (points.contains(point))// old Point is part of new points { points.remove(point); } else { if (point.y < 0 || point.x < 0 || point.y >= chunks[0].length || point.x >= chunks.length) continue; - unLoadChunk(point.x, point.y); + unLoadChunk((int)point.x, (int)point.y); } } } - for (Point point : points) { + for (Vector2 point : points) { if (point.y < 0 || point.x < 0 || point.y >= chunks[0].length || point.x >= chunks.length) continue; - loadChunk(point.x, point.y); + loadChunk((int)point.x, (int)point.y); } - currentChunkX = pos.x; - currentChunkY = pos.y; + currentChunkX = (int)pos.x; + currentChunkY = (int)pos.y; } batch.disableBlending(); for (int x = -1; x < 2; x++) { @@ -75,7 +75,7 @@ public class WorldBackground extends Actor { continue; - batch.draw(getChunkTexture(pos.x + x, pos.y + y), transChunkToWorld(pos.x + x), transChunkToWorld(pos.y + y)); + batch.draw(getChunkTexture((int)pos.x + x, (int)pos.y + y), transChunkToWorld((int)pos.x + x), transChunkToWorld((int)pos.y + y)); } } batch.enableBlending(); @@ -154,10 +154,10 @@ public class WorldBackground extends Actor { for (int x = -1; x < 2; x++) { for (int y = -1; y < 2; y++) { - Point point = new Point(currentChunkX + x, currentChunkY + y); + Vector2 point = new Vector2(currentChunkX + x, currentChunkY + y); if (point.y < 0 || point.x < 0 || point.y >= chunks[0].length || point.x >= chunks.length) continue; - loadChunk(point.x, point.y); + loadChunk((int)point.x, (int)point.y); } } } @@ -171,10 +171,10 @@ public class WorldBackground extends Actor { return xy * tileSize * chunkSize; } - Point translateFromWorldToChunk(float x, float y) { + Vector2 translateFromWorldToChunk(float x, float y) { float worldWidthTiles = x / tileSize; float worldHeightTiles = y / tileSize; - return new Point((int) worldWidthTiles / chunkSize, (int) worldHeightTiles / chunkSize); + return new Vector2((int) worldWidthTiles / chunkSize, (int) worldHeightTiles / chunkSize); } public void setPlayerPos(float x, float y) {