Skip to content

Commit

Permalink
LoadCommand remove unloading test for reload later
Browse files Browse the repository at this point in the history
  • Loading branch information
uoil committed May 17, 2023
1 parent e132ed7 commit 811a56f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ public void exec(String input) {
}
if (entry.getKey().equalsIgnoreCase("Search")) {
this.loadConfigForClass(SearchConfig.class, entry.getValue().getAsJsonObject());

}
Seppuku.INSTANCE.getModuleManager().getModuleList().forEach(module -> {
if (entry.getKey().equalsIgnoreCase("Module" + module.getDisplayName())) {
Expand All @@ -78,8 +77,8 @@ public void exec(String input) {
});
});

Seppuku.INSTANCE.unloadSimple();
Seppuku.INSTANCE.init();
// Seppuku.INSTANCE.getConfigManager().saveAll();
// Seppuku.INSTANCE.reload();

Seppuku.INSTANCE.logChat("\247c" + "Loaded config from server");
}
Expand All @@ -94,17 +93,17 @@ private void loadConfigForClass(Class configClass, JsonObject jsonObject) {
private void loadModuleConfigForClass(Class configClass, JsonObject jsonObject, String displayName) {
Seppuku.INSTANCE.getConfigManager().getConfigurableList().stream().filter(configurable -> configurable.getClass().equals(ModuleConfig.class)).forEach(configurable -> {
final ModuleConfig moduleConfig = (ModuleConfig) configurable;
if (moduleConfig.getModule().getDisplayName().equals(displayName)) {
configurable.onLoad(jsonObject);
if (moduleConfig.getModule().getDisplayName().equalsIgnoreCase(displayName)) {
moduleConfig.onLoad(jsonObject);
}
});
}

private void loadHudConfigForClass(Class configClass, JsonObject jsonObject, String name) {
Seppuku.INSTANCE.getConfigManager().getConfigurableList().stream().filter(configurable -> configurable.getClass().equals(HudConfig.class)).forEach(configurable -> {
final HudConfig hudConfig = (HudConfig) configurable;
if (hudConfig.getHudComponent().getName().equals(name)) {
configurable.onLoad(jsonObject);
if (hudConfig.getHudComponent().getName().equalsIgnoreCase(name)) {
hudConfig.onLoad(jsonObject);
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public void init() {
this.configurableList.add(new ModuleConfig(this.moduleConfigDir, module));
});

Seppuku.INSTANCE.getHudManager().getComponentList().stream().forEach(hudComponent -> {
Seppuku.INSTANCE.getHudManager().getComponentList().forEach(hudComponent -> {
this.configurableList.add(new HudConfig(this.hudComponentConfigDir, hudComponent));
});

Expand Down

0 comments on commit 811a56f

Please sign in to comment.