From 0a5eda1fc8a88f46e6344662bdf48f5091cec3d5 Mon Sep 17 00:00:00 2001 From: Rsl1122 Date: Fri, 1 Dec 2017 17:43:22 +0200 Subject: [PATCH] Fixed a bug with the theme --- .../com/djrapitops/plan/settings/theme/Theme.java | 13 ++++++++----- .../djrapitops/plan/settings/theme/ThemeVal.java | 2 +- Plan/src/main/resources/themes/theme.yml | 2 +- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Plan/src/main/java/com/djrapitops/plan/settings/theme/Theme.java b/Plan/src/main/java/com/djrapitops/plan/settings/theme/Theme.java index 8acfe0085..d3201cd61 100644 --- a/Plan/src/main/java/com/djrapitops/plan/settings/theme/Theme.java +++ b/Plan/src/main/java/com/djrapitops/plan/settings/theme/Theme.java @@ -73,12 +73,15 @@ public class Theme { if (Verify.equalsOne(value, defaultValue)) { continue; } - if (!value.contains("url")) { - replaced = replaced.replace(defaultValue, value); - } else { + if (value.contains("url")) { String[] colorAndUrl = value.split(" "); - replaced = replaced.replace("background: " + defaultValue, "background: " + colorAndUrl[1]); - replaced = replaced.replace(defaultValue, colorAndUrl[0]); + if (colorAndUrl.length >= 2) { + replaced = replaced.replace("background: " + defaultValue, "background: " + colorAndUrl[1]); + replaced = replaced.replace(defaultValue, colorAndUrl[0]); + return replaced; + } + } else { + replaced = replaced.replace(defaultValue, value); } } return replaced; diff --git a/Plan/src/main/java/com/djrapitops/plan/settings/theme/ThemeVal.java b/Plan/src/main/java/com/djrapitops/plan/settings/theme/ThemeVal.java index e2a98fb02..72e1c21a1 100644 --- a/Plan/src/main/java/com/djrapitops/plan/settings/theme/ThemeVal.java +++ b/Plan/src/main/java/com/djrapitops/plan/settings/theme/ThemeVal.java @@ -28,7 +28,7 @@ public enum ThemeVal { GREEN("Colors.green", "#4CAF50"), LIGHT_GREEN("Colors.light-green", "#8BC34A"), LIME("Colors.lime", "#CDDC39"), - YELLOW("Colors.yellow", "#FFEB3B"), + YELLOW("Colors.yellow", "#ffe821"), AMBER("Colors.amber", "#FFC107"), ORANGE("Colors.orange", "#FF9800"), DEEP_ORANGE("Colors.deep-orange", "#FF5722"), diff --git a/Plan/src/main/resources/themes/theme.yml b/Plan/src/main/resources/themes/theme.yml index d81e1e1df..98f650df2 100644 --- a/Plan/src/main/resources/themes/theme.yml +++ b/Plan/src/main/resources/themes/theme.yml @@ -22,7 +22,7 @@ Colors: green: "#4CAF50" light-green: "#8BC34A" lime: "#CDDC39" - yellow: "#FFEB3B" + yellow: "#ffe821" amber: "#FFC107" orange: "#FF9800" deep-orange: "#FF5722"