mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 18:28:00 +00:00
Fix weird font issue on progress bar
Prevent Forge not being able to reopen if its already running
This commit is contained in:
@@ -35,6 +35,6 @@ public class Main extends AndroidApplication {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
initialize(new Forge(getClipboard(), assetsDir), true);
|
initialize(Forge.getApp(getClipboard(), assetsDir), true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,6 @@ import forge.util.Utils;
|
|||||||
|
|
||||||
public class Main {
|
public class Main {
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
new LwjglApplication(new Forge(new LwjglClipboard(), "../forge-gui/"), "Forge", (int)Utils.BASE_WIDTH, (int)Utils.BASE_HEIGHT, true);
|
new LwjglApplication(Forge.getApp(new LwjglClipboard(), "../forge-gui/"), "Forge", (int)Utils.BASE_WIDTH, (int)Utils.BASE_HEIGHT, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ import forge.util.Utils;
|
|||||||
public class Forge implements ApplicationListener {
|
public class Forge implements ApplicationListener {
|
||||||
public static final String CURRENT_VERSION = "1.5.19.005";
|
public static final String CURRENT_VERSION = "1.5.19.005";
|
||||||
|
|
||||||
|
private static final ApplicationListener app = new Forge();
|
||||||
private static Clipboard clipboard;
|
private static Clipboard clipboard;
|
||||||
private static int screenWidth;
|
private static int screenWidth;
|
||||||
private static int screenHeight;
|
private static int screenHeight;
|
||||||
@@ -59,12 +60,15 @@ public class Forge implements ApplicationListener {
|
|||||||
private static KeyInputAdapter keyInputAdapter;
|
private static KeyInputAdapter keyInputAdapter;
|
||||||
private static final Stack<FScreen> screens = new Stack<FScreen>();
|
private static final Stack<FScreen> screens = new Stack<FScreen>();
|
||||||
|
|
||||||
public Forge(Clipboard clipboard0, String assetDir0) {
|
public static ApplicationListener getApp(Clipboard clipboard0, String assetDir0) {
|
||||||
if (GuiBase.getInterface() != null) {
|
if (GuiBase.getInterface() == null) {
|
||||||
throw new RuntimeException("Cannot initialize Forge more than once");
|
clipboard = clipboard0;
|
||||||
|
GuiBase.setInterface(new GuiMobile(assetDir0));
|
||||||
}
|
}
|
||||||
clipboard = clipboard0;
|
return app;
|
||||||
GuiBase.setInterface(new GuiMobile(assetDir0));
|
}
|
||||||
|
|
||||||
|
private Forge() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -151,7 +151,7 @@ public class FProgressBar extends FDisplayObject implements IProgressBar {
|
|||||||
else {
|
else {
|
||||||
g.fillRect(BACK_COLOR, 0, 0, w, h);
|
g.fillRect(BACK_COLOR, 0, 0, w, h);
|
||||||
|
|
||||||
float selWidth = w * (float)value / (float)maximum;
|
float selWidth = Math.round(w * (float)value / (float)maximum);
|
||||||
if (selWidth > 0) {
|
if (selWidth > 0) {
|
||||||
g.fillRect(SEL_BACK_COLOR, 0, 0, selWidth, h);
|
g.fillRect(SEL_BACK_COLOR, 0, 0, selWidth, h);
|
||||||
selTextRegions.add(Pair.of(0f, selWidth));
|
selTextRegions.add(Pair.of(0f, selWidth));
|
||||||
|
|||||||
Reference in New Issue
Block a user