mirror of
https://github.com/correl/mage.git
synced 2025-04-08 17:00:07 -09:00
dev: enabled debug main menu by default in developer builds (example: test render dialog)
This commit is contained in:
parent
5c705a92a3
commit
bc79b5f5d1
4 changed files with 13 additions and 5 deletions
Mage.Client/src/main/java/mage/client
Mage.Common/src/main/java/mage/utils
Mage.Server/src/main/java/mage/server
Mage/src/main/java/mage/util
|
@ -98,7 +98,7 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
|
|||
private static final String PASSWORD_ARG = "-pw";
|
||||
private static final String SERVER_ARG = "-server";
|
||||
private static final String PORT_ARG = "-port";
|
||||
private static final String DEBUG_ARG = "-debug";
|
||||
private static final String DEBUG_ARG = "-debug"; // enable debug button in main menu
|
||||
|
||||
private static final String NOT_CONNECTED_TEXT = "<not connected>";
|
||||
private static final String NOT_CONNECTED_BUTTON = "CONNECT TO SERVER";
|
||||
|
@ -1327,6 +1327,10 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
|
|||
debugMode = true;
|
||||
}
|
||||
}
|
||||
|
||||
// enable debug menu by default for developer build (if you run it from source code)
|
||||
debugMode |= VERSION.isDeveloperBuild();
|
||||
|
||||
if (!liteMode) {
|
||||
final SplashScreen splash = SplashScreen.getSplashScreen();
|
||||
if (splash != null) {
|
||||
|
|
|
@ -87,4 +87,8 @@ public class MageVersion implements Serializable, Comparable<MageVersion> {
|
|||
// all fine
|
||||
return 0;
|
||||
}
|
||||
|
||||
public boolean isDeveloperBuild() {
|
||||
return this.buildTime.contains(JarVersion.JAR_BUILD_TIME_FROM_CLASSES);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -72,7 +72,7 @@ public final class Main {
|
|||
// - cheat commands;
|
||||
// - no deck validation;
|
||||
// - simplified registration and login (no password check);
|
||||
// - debug main menu for GUI and rendering testing;
|
||||
// - debug main menu for GUI and rendering testing (must use -debug arg for client app);
|
||||
private static boolean testMode;
|
||||
|
||||
private static boolean fastDbMode;
|
||||
|
@ -88,12 +88,12 @@ public final class Main {
|
|||
String adminPassword = "";
|
||||
for (String arg : args) {
|
||||
if (arg.startsWith(testModeArg)) {
|
||||
testMode = Boolean.valueOf(arg.replace(testModeArg, ""));
|
||||
testMode = Boolean.parseBoolean(arg.replace(testModeArg, ""));
|
||||
} else if (arg.startsWith(adminPasswordArg)) {
|
||||
adminPassword = arg.replace(adminPasswordArg, "");
|
||||
adminPassword = SystemUtil.sanitize(adminPassword);
|
||||
} else if (arg.startsWith(fastDBModeArg)) {
|
||||
fastDbMode = Boolean.valueOf(arg.replace(fastDBModeArg, ""));
|
||||
fastDbMode = Boolean.parseBoolean(arg.replace(fastDBModeArg, ""));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ import java.util.jar.Manifest;
|
|||
public class JarVersion {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(JarVersion.class);
|
||||
private static final String JAR_BUILD_TIME_FROM_CLASSES = "runtime";
|
||||
public static final String JAR_BUILD_TIME_FROM_CLASSES = "runtime";
|
||||
private static final String JAR_BUILD_TIME_ERROR = "n/a";
|
||||
|
||||
public static String getBuildTime(Class clazz) {
|
||||
|
|
Loading…
Add table
Reference in a new issue