diff --git a/Plan/src/main/java/com/djrapitops/plan/data/store/containers/NetworkContainer.java b/Plan/src/main/java/com/djrapitops/plan/data/store/containers/NetworkContainer.java index 010f08315..26a7379df 100644 --- a/Plan/src/main/java/com/djrapitops/plan/data/store/containers/NetworkContainer.java +++ b/Plan/src/main/java/com/djrapitops/plan/data/store/containers/NetworkContainer.java @@ -40,6 +40,7 @@ public class NetworkContainer extends DataContainer { // TODO private PlanConfig config; + private Theme theme; private Database database; private Graphs graphs; @@ -97,9 +98,9 @@ public class NetworkContainer extends DataContainer { bungeeContainer.getValue(ServerKeys.NAME).orElse("Plan") ); putSupplier(NetworkKeys.PLAYERS_ONLINE, ServerInfo.getServerProperties_Old()::getOnlinePlayers); - putRawData(NetworkKeys.WORLD_MAP_LOW_COLOR, Theme.getValue_Old(ThemeVal.WORLD_MAP_LOW)); - putRawData(NetworkKeys.WORLD_MAP_HIGH_COLOR, Theme.getValue_Old(ThemeVal.WORLD_MAP_HIGH)); - putRawData(NetworkKeys.PLAYERS_GRAPH_COLOR, Theme.getValue_Old(ThemeVal.GRAPH_PLAYERS_ONLINE)); + putRawData(NetworkKeys.WORLD_MAP_LOW_COLOR, theme.getValue(ThemeVal.WORLD_MAP_LOW)); + putRawData(NetworkKeys.WORLD_MAP_HIGH_COLOR, theme.getValue(ThemeVal.WORLD_MAP_HIGH)); + putRawData(NetworkKeys.PLAYERS_GRAPH_COLOR, theme.getValue(ThemeVal.GRAPH_PLAYERS_ONLINE)); } private void addPlayerInformation() { diff --git a/Plan/src/main/java/com/djrapitops/plan/system/settings/theme/Theme.java b/Plan/src/main/java/com/djrapitops/plan/system/settings/theme/Theme.java index 26ee1a81e..0efef34d1 100644 --- a/Plan/src/main/java/com/djrapitops/plan/system/settings/theme/Theme.java +++ b/Plan/src/main/java/com/djrapitops/plan/system/settings/theme/Theme.java @@ -42,15 +42,6 @@ public class Theme implements SubSystem { return themeSystem; } - @Deprecated - public static String getValue_Old(ThemeVal variable) { - try { - return getInstance().getThemeValue(variable); - } catch (NullPointerException | IllegalStateException e) { - return variable.getDefaultValue(); - } - } - public String getValue(ThemeVal variable) { try { return getThemeValue(variable); @@ -78,7 +69,7 @@ public class Theme implements SubSystem { } - public String getColor(ThemeVal variable) { + private String getColor(ThemeVal variable) { String path = variable.getThemePath(); try { String value = config.getString(path); diff --git a/Plan/src/main/java/com/djrapitops/plan/utilities/html/graphs/calendar/PlayerCalendar.java b/Plan/src/main/java/com/djrapitops/plan/utilities/html/graphs/calendar/PlayerCalendar.java index 4893173a9..8aa144546 100644 --- a/Plan/src/main/java/com/djrapitops/plan/utilities/html/graphs/calendar/PlayerCalendar.java +++ b/Plan/src/main/java/com/djrapitops/plan/utilities/html/graphs/calendar/PlayerCalendar.java @@ -73,7 +73,7 @@ public class PlayerCalendar { series.append(",{title: 'Playtime: ").append(timeAmountFormatter.apply(playtime)) .append("',start:'").append(day) - .append("',color: '").append(Theme.getValue_Old(ThemeVal.GREEN)).append("'") + .append("',color: '").append(theme.getValue(ThemeVal.GREEN)).append("'") .append("}"); series.append(",{title: 'Sessions: ").append(sessionCount) diff --git a/Plan/src/main/java/com/djrapitops/plan/utilities/html/pages/InspectPage.java b/Plan/src/main/java/com/djrapitops/plan/utilities/html/pages/InspectPage.java index 7790c1fcc..b1e9dcb37 100644 --- a/Plan/src/main/java/com/djrapitops/plan/utilities/html/pages/InspectPage.java +++ b/Plan/src/main/java/com/djrapitops/plan/utilities/html/pages/InspectPage.java @@ -47,6 +47,7 @@ public class InspectPage implements Page { private final Map serverNames; private final PlanConfig config; + private final Theme theme; private final Graphs graphs; private final HtmlTables tables; private final ServerInfo serverInfo; @@ -60,6 +61,7 @@ public class InspectPage implements Page { InspectPage( PlayerContainer player, Map serverNames, PlanConfig config, + Theme theme, Graphs graphs, HtmlTables tables, Formatters formatters, @@ -69,6 +71,7 @@ public class InspectPage implements Page { this.player = player; this.serverNames = serverNames; this.config = config; + this.theme = theme; this.graphs = graphs; this.tables = tables; this.serverInfo = serverInfo; @@ -131,9 +134,9 @@ public class InspectPage implements Page { Map worldTimesPerServer = perServerMutator.worldTimesPerServer(); replacer.put("serverPieSeries", graphs.pie().serverPreferencePie(serverNames, worldTimesPerServer).toHighChartsSeries()); - replacer.put("worldPieColors", Theme.getValue_Old(ThemeVal.GRAPH_WORLD_PIE)); - replacer.put("gmPieColors", Theme.getValue_Old(ThemeVal.GRAPH_GM_PIE)); - replacer.put("serverPieColors", Theme.getValue_Old(ThemeVal.GRAPH_SERVER_PREF_PIE)); + replacer.put("worldPieColors", theme.getValue(ThemeVal.GRAPH_WORLD_PIE)); + replacer.put("gmPieColors", theme.getValue(ThemeVal.GRAPH_GM_PIE)); + replacer.put("serverPieColors", theme.getValue(ThemeVal.GRAPH_SERVER_PREF_PIE)); String favoriteServer = serverNames.getOrDefault(perServerMutator.favoriteServer(), "Unknown"); replacer.put("favoriteServer", favoriteServer); diff --git a/Plan/src/main/java/com/djrapitops/plan/utilities/html/pages/PageFactory.java b/Plan/src/main/java/com/djrapitops/plan/utilities/html/pages/PageFactory.java index d3ec854be..f558b5838 100644 --- a/Plan/src/main/java/com/djrapitops/plan/utilities/html/pages/PageFactory.java +++ b/Plan/src/main/java/com/djrapitops/plan/utilities/html/pages/PageFactory.java @@ -90,7 +90,7 @@ public class PageFactory { Map serverNames = database.get().fetch().getServerNames(); return new InspectPage( player, serverNames, - config.get(), graphs.get(), tables.get(), formatters.get(), serverInfo.get(), timings.get() + config.get(), theme, graphs.get(), tables.get(), formatters.get(), serverInfo.get(), timings.get() ); }