fix: version label not set correctly when using --devmode command line param.
parent
7dbecd61e2
commit
fc58e63931
|
@ -66,7 +66,7 @@ public final class ScreenController {
|
|||
private static MagicFrame mainFrame;
|
||||
static {
|
||||
if (!GraphicsEnvironment.isHeadless()) {
|
||||
mainFrame = new MagicFrame(MagicSystem.SOFTWARE_TITLE);
|
||||
mainFrame = new MagicFrame(MagicSystem.getVersionTitle());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ import magic.utility.MagicSystem;
|
|||
class VersionLabel extends JLabel {
|
||||
|
||||
VersionLabel() {
|
||||
super(MagicSystem.SOFTWARE_TITLE);
|
||||
super(MagicSystem.getVersionTitle());
|
||||
setFont(FontsAndBorders.FONT0);
|
||||
setForeground(Color.WHITE);
|
||||
}
|
||||
|
|
|
@ -26,11 +26,8 @@ final public class MagicSystem {
|
|||
private MagicSystem() {}
|
||||
|
||||
public static final String VERSION = "1.85";
|
||||
|
||||
public static final String SOFTWARE_TITLE;
|
||||
static {
|
||||
SOFTWARE_TITLE = "Magarena " + VERSION + (isDevMode() ? " [DEV MODE]" : "");
|
||||
System.setProperty("http.agent", SOFTWARE_TITLE);
|
||||
System.setProperty("http.agent", "Magarena " + VERSION);
|
||||
}
|
||||
|
||||
public static final boolean IS_WINDOWS_OS = System.getProperty("os.name").toLowerCase(Locale.ENGLISH).startsWith("windows");
|
||||
|
@ -80,6 +77,10 @@ final public class MagicSystem {
|
|||
}
|
||||
};
|
||||
|
||||
public static String getVersionTitle() {
|
||||
return "Magarena " + VERSION + (isDevMode() ? " [DEV MODE]" : "");
|
||||
}
|
||||
|
||||
public static void setIsTestGame(boolean b) {
|
||||
System.setProperty("testGame", b ? "Y" : "");
|
||||
}
|
||||
|
@ -92,7 +93,7 @@ final public class MagicSystem {
|
|||
public static boolean isDevMode() {
|
||||
return Boolean.getBoolean("devMode") || Boolean.getBoolean("debug");
|
||||
}
|
||||
|
||||
|
||||
public static void setIsDevMode(boolean b) {
|
||||
System.setProperty("devMode", String.valueOf(b));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue