Separated interface configuration.

This commit is contained in:
MobiusDevelopment
2021-05-02 23:30:32 +00:00
parent 0a86b20c17
commit 8d263dc0b4
165 changed files with 991 additions and 1164 deletions

View File

@@ -0,0 +1,15 @@
# ---------------------------------------------------------------------------
# Interface Settings
# ---------------------------------------------------------------------------
# Enable L2jMobius GUI when OS supports it.
# Provides access to admin commands without the need to be online.
# Warning! Do not disable if you use Gameserver.exe
# because server will run in the background!
# Default: True
EnableGUI = True
# Dark theme.
# Use a dark version of the Nimbus theme.
# Default: True
DarkTheme = True

View File

@@ -32,21 +32,4 @@ MaximumOnlineUsers=2000
AutoCreateAccounts=true
# Enable unknown packet logging.
LogUnknownPackets=false
# ---------------------------------------------------------------------------
# Look and feel
# ---------------------------------------------------------------------------
# Enable L2jMobius GUI when OS supports it.
# Provides access to admin commands without the need to be online.
# Warning! Do not disable if you use Gameserver.exe
# because server will run in the background!
# Default: True
EnableGUI = True
# Dark theme.
# Use a dark version of the Nimbus theme.
# Default: True
DarkTheme = True
LogUnknownPackets=false

View File

@@ -36,12 +36,16 @@ public class Config
// --------------------------------------------------
// Config File Definitions
// --------------------------------------------------
public static final String SERVER_CONFIG_FILE = "config/server.ini";
private static final String RATES_CONFIG_FILE = "config/rates.ini";
private static final String KARMA_CONFIG_FILE = "config/karma.ini";
private static final String THREADPOOL_CONFIG_FILE = "config/threadpool.ini";
public static final String INTERFACE_CONFIG_FILE = "./config/Interface.ini";
public static final String SERVER_CONFIG_FILE = "./config/server.ini";
private static final String RATES_CONFIG_FILE = "./config/rates.ini";
private static final String KARMA_CONFIG_FILE = "./config/karma.ini";
private static final String THREADPOOL_CONFIG_FILE = "./config/threadpool.ini";
private static final String NPC_CONFIG_FILE = "./config/npc.ini";
// Interface
public static boolean ENABLE_GUI;
public static boolean DARK_THEME;
// Game
public static int SERVER_PORT;
public static String SERVER_HOST_NAME;
@@ -54,9 +58,6 @@ public class Config
public static boolean AUTO_CREATE_ACCOUNTS;
// Other
public static boolean LOG_UNKNOWN_PACKETS;
// GUI
public static boolean ENABLE_GUI;
public static boolean DARK_THEME;
// Rates
public static float RATE_XP;
public static float RATE_SP;

View File

@@ -46,11 +46,11 @@ public class Server
Config.load();
// GUI
final PropertiesParser serverSettings = new PropertiesParser(Config.SERVER_CONFIG_FILE);
Config.ENABLE_GUI = serverSettings.getBoolean("EnableGUI", true);
final PropertiesParser interfaceSettings = new PropertiesParser(Config.INTERFACE_CONFIG_FILE);
Config.ENABLE_GUI = interfaceSettings.getBoolean("EnableGUI", true);
if (Config.ENABLE_GUI && !GraphicsEnvironment.isHeadless())
{
Config.DARK_THEME = serverSettings.getBoolean("DarkTheme", true);
Config.DARK_THEME = interfaceSettings.getBoolean("DarkTheme", true);
System.out.println("Server: Running in GUI mode.");
new Gui();
}