Merge pull request #982 from deathbeam/fix-clientui-init

Fix ClientUI settings loading
This commit is contained in:
Adam
2018-03-15 21:12:14 -04:00
committed by GitHub
3 changed files with 17 additions and 4 deletions

View File

@@ -150,9 +150,6 @@ public class RuneLite
// Initialize Discord service // Initialize Discord service
discordService.init(); discordService.init();
// Load user configuration
configManager.load();
// Register event listeners // Register event listeners
eventBus.register(clientUI); eventBus.register(clientUI);
eventBus.register(overlayRenderer); eventBus.register(overlayRenderer);
@@ -160,6 +157,9 @@ public class RuneLite
eventBus.register(chatMessageManager); eventBus.register(chatMessageManager);
eventBus.register(pluginManager); eventBus.register(pluginManager);
// Load user configuration
configManager.load();
// Tell the plugin manager if client is outdated or not // Tell the plugin manager if client is outdated or not
pluginManager.setOutdated(isOutdated); pluginManager.setOutdated(isOutdated);

View File

@@ -173,6 +173,19 @@ public class ConfigManager
try (FileInputStream in = new FileInputStream(propertiesFile)) try (FileInputStream in = new FileInputStream(propertiesFile))
{ {
properties.load(in); properties.load(in);
properties.forEach((groupAndKey, value) ->
{
final String[] split = ((String)groupAndKey).split("\\.");
final String groupName = split[0];
final String key = split[1];
ConfigChanged configChanged = new ConfigChanged();
configChanged.setGroup(groupName);
configChanged.setKey(key);
configChanged.setOldValue(null);
configChanged.setNewValue((String) value);
eventBus.post(configChanged);
});
} }
catch (FileNotFoundException ex) catch (FileNotFoundException ex)
{ {

View File

@@ -152,7 +152,7 @@ public class ClientUI
if (event.getKey().equals("lockWindowSize")) if (event.getKey().equals("lockWindowSize"))
{ {
SwingUtilities.invokeLater(() -> frame.setResizable(!config.lockWindowSize())); frame.setResizable(!config.lockWindowSize());
} }
if (!event.getKey().equals("gameSize")) if (!event.getKey().equals("gameSize"))