2021-06-21 11:13:11 +00:00
|
|
|
package the.bytecode.club.bytecodeviewer;
|
|
|
|
|
2021-07-24 02:17:20 +00:00
|
|
|
import the.bytecode.club.bytecodeviewer.bootloader.BootState;
|
2021-06-26 01:13:46 +00:00
|
|
|
import the.bytecode.club.bytecodeviewer.gui.theme.LAFTheme;
|
|
|
|
import the.bytecode.club.bytecodeviewer.gui.theme.RSTATheme;
|
2021-06-29 09:41:08 +00:00
|
|
|
import the.bytecode.club.bytecodeviewer.translation.Language;
|
2021-06-26 01:13:46 +00:00
|
|
|
|
2021-06-21 11:13:11 +00:00
|
|
|
import java.io.File;
|
|
|
|
|
|
|
|
/**
|
2021-06-26 01:13:46 +00:00
|
|
|
* A collection of variables that can be configured through the settings menu or some form of UI/plugin
|
|
|
|
*
|
2021-06-21 11:13:11 +00:00
|
|
|
* @author Konloch
|
|
|
|
* @since 6/21/2021
|
|
|
|
*/
|
2021-07-24 02:17:20 +00:00
|
|
|
|
2021-06-21 11:13:11 +00:00
|
|
|
public class Configuration
|
|
|
|
{
|
2021-07-11 12:33:18 +00:00
|
|
|
public static String python2 = "";
|
2021-07-19 18:28:47 +00:00
|
|
|
public static boolean python2Extra = false;
|
2021-06-21 11:13:11 +00:00
|
|
|
public static String python3 = "";
|
2021-07-19 18:28:47 +00:00
|
|
|
public static boolean python3Extra = false;
|
2021-06-21 11:13:11 +00:00
|
|
|
public static String rt = "";
|
|
|
|
public static String library = "";
|
2021-07-19 19:23:25 +00:00
|
|
|
public static String java = Constants.JAVA_BINARY.exists() ? Constants.JAVA_BINARY.getAbsolutePath() :
|
|
|
|
Constants.JAVA_BINARY_NIX.exists() ? Constants.JAVA_BINARY_NIX.getAbsolutePath() : "";
|
2021-06-21 11:13:11 +00:00
|
|
|
public static String javac = "";
|
2021-07-11 16:41:33 +00:00
|
|
|
public static String javaTools = "";
|
2021-06-21 11:13:11 +00:00
|
|
|
public static File krakatauTempDir;
|
|
|
|
public static File krakatauTempJar;
|
2021-07-21 15:20:38 +00:00
|
|
|
|
2021-06-21 11:13:11 +00:00
|
|
|
public static boolean displayParentInTab = false; //also change in the main GUI
|
2021-06-26 01:13:46 +00:00
|
|
|
public static boolean simplifiedTabNames = false;
|
2021-07-21 15:20:38 +00:00
|
|
|
|
|
|
|
//if true it will show a settings dialog on click instead of more menu items
|
|
|
|
public static boolean useNewSettingsDialog = true; //TODO add to GUI
|
|
|
|
|
2021-07-23 22:12:53 +00:00
|
|
|
//if true it will put force error UIs and console UIs to be added as a tab
|
|
|
|
public static boolean pluginConsoleAsNewTab = true; //TODO add to GUI
|
|
|
|
//if true it will put force error UIs and console UIs to be added as a tab
|
|
|
|
public static boolean errorLogsAsNewTab = true; //TODO add to GUI
|
|
|
|
//if true the plugin writer will open inside of a tab
|
|
|
|
public static boolean pluginWriterAsNewTab = true; //TODO add to GUI
|
|
|
|
|
2021-07-11 08:44:37 +00:00
|
|
|
public static boolean forceResourceUpdateFromClassNode = false; //TODO add to GUI
|
2021-07-16 21:49:32 +00:00
|
|
|
public static boolean showDarkLAFComponentIcons = false;
|
2021-06-21 11:13:11 +00:00
|
|
|
public static boolean currentlyDumping = false;
|
|
|
|
public static boolean needsReDump = true;
|
|
|
|
public static boolean warnForEditing = false;
|
|
|
|
public static boolean runningObfuscation = false;
|
|
|
|
public static final long start = System.currentTimeMillis();
|
2021-07-18 19:53:30 +00:00
|
|
|
public static String lastOpenDirectory = ".";
|
|
|
|
public static String lastSaveDirectory = ".";
|
|
|
|
public static String lastPluginDirectory = ".";
|
2021-06-21 11:13:11 +00:00
|
|
|
public static boolean pingback = false;
|
|
|
|
public static boolean deleteForeignLibraries = true;
|
|
|
|
public static boolean canExit = false;
|
2021-06-29 18:24:47 +00:00
|
|
|
public static int silenceExceptionGUI = 0;
|
|
|
|
public static int pauseExceptionGUI = 0;
|
2021-06-21 11:13:11 +00:00
|
|
|
|
2021-07-10 13:46:25 +00:00
|
|
|
public static final int maxRecentFiles = 25; //eventually may be a setting
|
2021-06-21 11:32:07 +00:00
|
|
|
public static boolean verifyCorruptedStateOnBoot = false; //eventually may be a setting
|
|
|
|
|
2021-07-11 08:44:37 +00:00
|
|
|
public static BootState bootState = BootState.START_UP;
|
2021-06-29 09:41:08 +00:00
|
|
|
public static Language language = Language.ENGLISH;
|
2021-06-29 00:05:18 +00:00
|
|
|
public static LAFTheme lafTheme = LAFTheme.SYSTEM; //lightmode by default since it uses the system theme
|
2021-06-26 01:13:46 +00:00
|
|
|
public static RSTATheme rstaTheme = lafTheme.getRSTATheme();
|
2021-07-11 08:44:37 +00:00
|
|
|
public static long lastHotKeyExecuted = 0;
|
2021-07-01 21:54:10 +00:00
|
|
|
|
2021-07-19 14:11:14 +00:00
|
|
|
public static void setLastOpenDirectory(File file)
|
|
|
|
{
|
|
|
|
lastOpenDirectory = file.getAbsolutePath();
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void setLastSaveDirectory(File file)
|
|
|
|
{
|
|
|
|
lastSaveDirectory = file.getAbsolutePath();
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void setLastPluginDirectory(File file)
|
|
|
|
{
|
|
|
|
lastPluginDirectory = file.getAbsolutePath();
|
|
|
|
}
|
|
|
|
|
2021-07-18 19:53:30 +00:00
|
|
|
public static File getLastOpenDirectory()
|
2021-07-01 21:54:10 +00:00
|
|
|
{
|
2021-07-18 19:53:30 +00:00
|
|
|
File lastDir = new File(lastOpenDirectory);
|
2021-07-19 14:36:40 +00:00
|
|
|
if(lastDir.getParentFile() != null && lastDir.getParentFile().exists())
|
2021-07-18 19:53:30 +00:00
|
|
|
return lastDir;
|
|
|
|
|
|
|
|
return new File(".");
|
|
|
|
}
|
|
|
|
|
|
|
|
public static File getLastSaveDirectory()
|
|
|
|
{
|
|
|
|
File lastDir = new File(lastSaveDirectory);
|
2021-07-19 14:36:40 +00:00
|
|
|
if(lastDir.getParentFile() != null && lastDir.getParentFile().exists())
|
2021-07-18 19:53:30 +00:00
|
|
|
return lastDir;
|
|
|
|
|
|
|
|
return new File(".");
|
|
|
|
}
|
|
|
|
|
|
|
|
public static File getLastPluginDirectory()
|
|
|
|
{
|
|
|
|
File lastDir = new File(lastPluginDirectory);
|
2021-07-19 14:11:14 +00:00
|
|
|
|
2021-07-19 14:36:40 +00:00
|
|
|
if(lastDir.getParentFile() != null && lastDir.getParentFile().exists())
|
2021-07-01 21:54:10 +00:00
|
|
|
return lastDir;
|
|
|
|
|
|
|
|
return new File(".");
|
|
|
|
}
|
2021-07-11 08:44:37 +00:00
|
|
|
|
2021-06-26 01:13:46 +00:00
|
|
|
}
|