mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 11:48:02 +00:00
Merge branch 'master' of git.cardforge.org:core-developers/forge into agetian-master
This commit is contained in:
@@ -50,6 +50,8 @@ public class Forge implements ApplicationListener {
|
|||||||
private static final Stack<FScreen> screens = new Stack<FScreen>();
|
private static final Stack<FScreen> screens = new Stack<FScreen>();
|
||||||
private static boolean textureFiltering = false;
|
private static boolean textureFiltering = false;
|
||||||
private static boolean destroyThis = false;
|
private static boolean destroyThis = false;
|
||||||
|
public static String extrawide = "default";
|
||||||
|
public static float heigtModifier = 0.0f;
|
||||||
|
|
||||||
public static ApplicationListener getApp(Clipboard clipboard0, IDeviceAdapter deviceAdapter0, String assetDir0) {
|
public static ApplicationListener getApp(Clipboard clipboard0, IDeviceAdapter deviceAdapter0, String assetDir0) {
|
||||||
if (GuiBase.getInterface() == null) {
|
if (GuiBase.getInterface() == null) {
|
||||||
@@ -134,6 +136,9 @@ public class Forge implements ApplicationListener {
|
|||||||
NewGameMenu.getPreferredScreen().open();
|
NewGameMenu.getPreferredScreen().open();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//adjust height modifier
|
||||||
|
adjustHeightModifier(getScreenWidth(), getScreenHeight());
|
||||||
|
|
||||||
//update landscape mode preference if it doesn't match what the app loaded as
|
//update landscape mode preference if it doesn't match what the app loaded as
|
||||||
if (FModel.getPreferences().getPrefBoolean(FPref.UI_LANDSCAPE_MODE) != isLandscapeMode) {
|
if (FModel.getPreferences().getPrefBoolean(FPref.UI_LANDSCAPE_MODE) != isLandscapeMode) {
|
||||||
FModel.getPreferences().setPref(FPref.UI_LANDSCAPE_MODE, isLandscapeMode);
|
FModel.getPreferences().setPref(FPref.UI_LANDSCAPE_MODE, isLandscapeMode);
|
||||||
@@ -162,6 +167,29 @@ public class Forge implements ApplicationListener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void setHeightModifier(float height) {
|
||||||
|
heigtModifier = height;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static float getHeightModifier() {
|
||||||
|
return heigtModifier;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void adjustHeightModifier(float DisplayW, float DisplayH) {
|
||||||
|
if(isLandscapeMode())
|
||||||
|
{//TODO: Fullscreen support for Display without screen controls
|
||||||
|
float aspectratio = DisplayW / DisplayH;
|
||||||
|
if(aspectratio > 1.82f) {/* extra wide */
|
||||||
|
setHeightModifier(200.0f);
|
||||||
|
extrawide = "extrawide";
|
||||||
|
}
|
||||||
|
else if(aspectratio > 1.7f) {/* wide */
|
||||||
|
setHeightModifier(100.0f);
|
||||||
|
extrawide = "wide";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static void showMenu() {
|
public static void showMenu() {
|
||||||
if (currentScreen == null) { return; }
|
if (currentScreen == null) { return; }
|
||||||
endKeyInput(); //end key input before menu shown
|
endKeyInput(); //end key input before menu shown
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -9,6 +9,7 @@ import com.google.common.base.Predicate;
|
|||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
import com.google.common.collect.Iterables;
|
import com.google.common.collect.Iterables;
|
||||||
|
|
||||||
|
import forge.Forge;
|
||||||
import forge.Graphics;
|
import forge.Graphics;
|
||||||
import forge.assets.FImage;
|
import forge.assets.FImage;
|
||||||
import forge.assets.FSkinColor;
|
import forge.assets.FSkinColor;
|
||||||
@@ -151,6 +152,7 @@ public class ConquestPlaneSelector extends FDisplayObject {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void draw(Graphics g) {
|
public void draw(Graphics g) {
|
||||||
|
float hmod = Forge.getHeightModifier();
|
||||||
float w = getWidth();
|
float w = getWidth();
|
||||||
float h = getHeight();
|
float h = getHeight();
|
||||||
|
|
||||||
@@ -164,7 +166,7 @@ public class ConquestPlaneSelector extends FDisplayObject {
|
|||||||
FImage monitor = FSkinImage.PLANE_MONITOR;
|
FImage monitor = FSkinImage.PLANE_MONITOR;
|
||||||
float monitorLeft = FOptionPane.PADDING / 2;
|
float monitorLeft = FOptionPane.PADDING / 2;
|
||||||
float monitorWidth = w - 2 * monitorLeft;
|
float monitorWidth = w - 2 * monitorLeft;
|
||||||
float monitorHeight = monitorWidth * monitor.getHeight() / monitor.getWidth();
|
float monitorHeight = (monitorWidth * monitor.getHeight() / monitor.getWidth()) - hmod;
|
||||||
float monitorLeftOffset = monitorWidth * MONITOR_LEFT_MULTIPLIER;
|
float monitorLeftOffset = monitorWidth * MONITOR_LEFT_MULTIPLIER;
|
||||||
float monitorTopOffset = monitorHeight * MONITOR_TOP_MULTIPLIER;
|
float monitorTopOffset = monitorHeight * MONITOR_TOP_MULTIPLIER;
|
||||||
float monitorBottomOffset = monitorHeight * MONITOR_BOTTOM_MULTIPLIER;
|
float monitorBottomOffset = monitorHeight * MONITOR_BOTTOM_MULTIPLIER;
|
||||||
|
|||||||
@@ -46,9 +46,9 @@ public class ConquestPlaneswalkScreen extends FScreen {
|
|||||||
@Override
|
@Override
|
||||||
protected void doLayout(float startY, float width, float height) {
|
protected void doLayout(float startY, float width, float height) {
|
||||||
planeSelector.setBounds(0, startY, width, height - startY);
|
planeSelector.setBounds(0, startY, width, height - startY);
|
||||||
|
float btnMod = Forge.extrawide.equals("extrawide") ? 1.5f : 2.5f;
|
||||||
float buttonWidth = width * 0.6f;
|
float buttonWidth = width * 0.6f;
|
||||||
float buttonHeight = btnPlaneswalk.getFont().getCapHeight() * 2.5f;
|
float buttonHeight = btnPlaneswalk.getFont().getCapHeight() * btnMod;
|
||||||
btnPlaneswalk.setBounds((width - buttonWidth) / 2, height - buttonHeight - PADDING, buttonWidth, buttonHeight);
|
btnPlaneswalk.setBounds((width - buttonWidth) / 2, height - buttonHeight - PADDING, buttonWidth, buttonHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 343 KiB After Width: | Height: | Size: 325 KiB |
Reference in New Issue
Block a user