From 42bc11ef75d0f7b14777e634c73350a2ea9a8887 Mon Sep 17 00:00:00 2001 From: yugecin Date: Fri, 26 May 2017 21:44:23 +0200 Subject: [PATCH] move bubble notification colors to Colors file --- src/itdelatrisu/opsu/GameImage.java | 9 ++++----- src/itdelatrisu/opsu/audio/MusicController.java | 3 ++- src/itdelatrisu/opsu/audio/SoundController.java | 7 +++---- src/itdelatrisu/opsu/beatmap/BeatmapParser.java | 3 ++- src/itdelatrisu/opsu/beatmap/BeatmapSetList.java | 6 +++--- .../opsu/beatmap/BeatmapWatchService.java | 4 ++-- src/itdelatrisu/opsu/beatmap/OszUnpacker.java | 3 ++- src/itdelatrisu/opsu/downloads/Download.java | 3 ++- src/itdelatrisu/opsu/downloads/DownloadNode.java | 2 +- src/itdelatrisu/opsu/replay/Replay.java | 3 ++- src/itdelatrisu/opsu/replay/ReplayImporter.java | 8 ++++---- src/itdelatrisu/opsu/skins/SkinLoader.java | 4 ++-- src/itdelatrisu/opsu/states/Game.java | 10 ++++------ src/itdelatrisu/opsu/states/MainMenu.java | 6 ++---- src/itdelatrisu/opsu/ui/Colors.java | 5 +++++ src/yugecin/opsudance/core/DisplayContainer.java | 12 +++++------- src/yugecin/opsudance/events/BubNotifListener.java | 6 ------ src/yugecin/opsudance/options/Configuration.java | 8 ++++---- src/yugecin/opsudance/options/NumericOption.java | 3 ++- src/yugecin/opsudance/options/OptionsService.java | 5 +++-- 20 files changed, 54 insertions(+), 56 deletions(-) diff --git a/src/itdelatrisu/opsu/GameImage.java b/src/itdelatrisu/opsu/GameImage.java index e13a1630..c54c9df0 100644 --- a/src/itdelatrisu/opsu/GameImage.java +++ b/src/itdelatrisu/opsu/GameImage.java @@ -18,6 +18,7 @@ package itdelatrisu.opsu; +import itdelatrisu.opsu.ui.Colors; import itdelatrisu.opsu.ui.Fonts; import java.io.File; @@ -732,7 +733,7 @@ public enum GameImage { String err = String.format("Could not find default image '%s'.", filename); Log.warn(err); - BubNotifListener.EVENT.make().onBubNotif(err, BubNotifListener.COMMONCOLOR_RED); + BubNotifListener.EVENT.make().onBubNotif(err, Colors.BUB_RED); } /** @@ -796,8 +797,7 @@ public enum GameImage { list.add(img); } catch (SlickException e) { BubNotifListener.EVENT.make().onBubNotif( - String.format("Failed to set image '%s'.", name), - BubNotifListener.COMMONCOLOR_RED); + String.format("Failed to set image '%s'.", name), Colors.BUB_RED); break; } } @@ -825,8 +825,7 @@ public enum GameImage { return img; } catch (SlickException e) { BubNotifListener.EVENT.make().onBubNotif( - String.format("Failed to set image '%s'.", filename), - BubNotifListener.COMMONCOLOR_RED); + String.format("Failed to set image '%s'.", filename), Colors.BUB_RED); } } return null; diff --git a/src/itdelatrisu/opsu/audio/MusicController.java b/src/itdelatrisu/opsu/audio/MusicController.java index ea9527c8..ce914633 100644 --- a/src/itdelatrisu/opsu/audio/MusicController.java +++ b/src/itdelatrisu/opsu/audio/MusicController.java @@ -33,6 +33,7 @@ import javax.sound.sampled.AudioFileFormat; import javax.sound.sampled.AudioSystem; import javax.sound.sampled.UnsupportedAudioFileException; +import itdelatrisu.opsu.ui.Colors; import org.lwjgl.BufferUtils; import org.lwjgl.openal.AL; import org.lwjgl.openal.AL10; @@ -158,7 +159,7 @@ public class MusicController { } catch (Exception e) { String err = String.format("Could not play track '%s'.", file.getName()); Log.error(err, e); - BubNotifListener.EVENT.make().onBubNotif(err, BubNotifListener.COMMONCOLOR_RED); + BubNotifListener.EVENT.make().onBubNotif(err, Colors.BUB_RED); } } diff --git a/src/itdelatrisu/opsu/audio/SoundController.java b/src/itdelatrisu/opsu/audio/SoundController.java index 32fb1df9..1d53db36 100644 --- a/src/itdelatrisu/opsu/audio/SoundController.java +++ b/src/itdelatrisu/opsu/audio/SoundController.java @@ -36,6 +36,7 @@ import javax.sound.sampled.DataLine; import javax.sound.sampled.LineListener; import javax.sound.sampled.LineUnavailableException; +import itdelatrisu.opsu.ui.Colors; import org.newdawn.slick.SlickException; import org.newdawn.slick.util.ResourceLoader; import yugecin.opsudance.core.errorhandling.ErrorHandler; @@ -220,8 +221,7 @@ public class SoundController { for (SoundEffect s : SoundEffect.values()) { if ((currentFileName = getSoundFileName(s.getFileName())) == null) { BubNotifListener.EVENT.make().onBubNotif( - "Could not find sound file " + s.getFileName(), - BubNotifListener.COLOR_ORANGE); + "Could not find sound file " + s.getFileName(), Colors.BUB_ORANGE); continue; } MultiClip newClip = loadClip(currentFileName, currentFileName.endsWith(".mp3")); @@ -241,8 +241,7 @@ public class SoundController { String filename = String.format("%s-%s", ss.getName(), s.getFileName()); if ((currentFileName = getSoundFileName(filename)) == null) { BubNotifListener.EVENT.make().onBubNotif( - "Could not find hit sound file " + filename, - BubNotifListener.COLOR_ORANGE); + "Could not find hit sound file " + filename, Colors.BUB_ORANGE); continue; } MultiClip newClip = loadClip(currentFileName, false); diff --git a/src/itdelatrisu/opsu/beatmap/BeatmapParser.java b/src/itdelatrisu/opsu/beatmap/BeatmapParser.java index 6c312b72..8fbf16fc 100644 --- a/src/itdelatrisu/opsu/beatmap/BeatmapParser.java +++ b/src/itdelatrisu/opsu/beatmap/BeatmapParser.java @@ -31,6 +31,7 @@ import java.util.LinkedList; import java.util.List; import java.util.Map; +import itdelatrisu.opsu.ui.Colors; import org.newdawn.slick.Color; import org.newdawn.slick.util.Log; import yugecin.opsudance.core.Nullable; @@ -888,7 +889,7 @@ public class BeatmapParser { private static void logAndShowErrorNotification(Exception e, String message, Object... formatArgs) { message = String.format(message, formatArgs); Log.error(message, e); - BubNotifListener.EVENT.make().onBubNotif(message, BubNotifListener.COMMONCOLOR_RED); + BubNotifListener.EVENT.make().onBubNotif(message, Colors.BUB_RED); } } \ No newline at end of file diff --git a/src/itdelatrisu/opsu/beatmap/BeatmapSetList.java b/src/itdelatrisu/opsu/beatmap/BeatmapSetList.java index 72566362..1cb1d72c 100644 --- a/src/itdelatrisu/opsu/beatmap/BeatmapSetList.java +++ b/src/itdelatrisu/opsu/beatmap/BeatmapSetList.java @@ -21,6 +21,7 @@ package itdelatrisu.opsu.beatmap; import itdelatrisu.opsu.Utils; import itdelatrisu.opsu.audio.MusicController; import itdelatrisu.opsu.db.BeatmapDB; +import itdelatrisu.opsu.ui.Colors; import yugecin.opsudance.events.BubNotifListener; import java.io.File; @@ -214,8 +215,7 @@ public class BeatmapSetList { try { Utils.deleteToTrash(dir); } catch (IOException e) { - BubNotifListener.EVENT.make().onBubNotif("Could not delete song group", - BubNotifListener.COLOR_ORANGE); + BubNotifListener.EVENT.make().onBubNotif("Could not delete song group", Colors.BUB_ORANGE); } if (ws != null) ws.resume(); @@ -271,7 +271,7 @@ public class BeatmapSetList { try { Utils.deleteToTrash(file); } catch (IOException e) { - BubNotifListener.EVENT.make().onBubNotif("Could not delete song", BubNotifListener.COLOR_ORANGE); + BubNotifListener.EVENT.make().onBubNotif("Could not delete song", Colors.BUB_ORANGE); } if (ws != null) ws.resume(); diff --git a/src/itdelatrisu/opsu/beatmap/BeatmapWatchService.java b/src/itdelatrisu/opsu/beatmap/BeatmapWatchService.java index 47e5a9a1..b49acd37 100644 --- a/src/itdelatrisu/opsu/beatmap/BeatmapWatchService.java +++ b/src/itdelatrisu/opsu/beatmap/BeatmapWatchService.java @@ -38,6 +38,7 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; +import itdelatrisu.opsu.ui.Colors; import org.newdawn.slick.util.Log; import yugecin.opsudance.events.BarNotifListener; import yugecin.opsudance.events.BubNotifListener; @@ -100,8 +101,7 @@ public class BeatmapWatchService { ws.register(config.beatmapDir.toPath()); } catch (IOException e) { Log.error("Could not create watch service", e); - BubNotifListener.EVENT.make().onBubNotif("Could not create watch service", - BubNotifListener.COMMONCOLOR_RED); + BubNotifListener.EVENT.make().onBubNotif("Could not create watch service", Colors.BUB_RED); return; } diff --git a/src/itdelatrisu/opsu/beatmap/OszUnpacker.java b/src/itdelatrisu/opsu/beatmap/OszUnpacker.java index 56568cf1..05e7182a 100644 --- a/src/itdelatrisu/opsu/beatmap/OszUnpacker.java +++ b/src/itdelatrisu/opsu/beatmap/OszUnpacker.java @@ -23,6 +23,7 @@ import java.io.FilenameFilter; import java.util.ArrayList; import java.util.List; +import itdelatrisu.opsu.ui.Colors; import net.lingala.zip4j.core.ZipFile; import net.lingala.zip4j.exception.ZipException; import org.newdawn.slick.util.Log; @@ -96,7 +97,7 @@ public class OszUnpacker { } catch (ZipException e) { String err = String.format("Failed to unzip file %s to dest %s.", file.getAbsolutePath(), dest.getAbsolutePath()); Log.error(err, e); - BubNotifListener.EVENT.make().onBubNotif(err, BubNotifListener.COMMONCOLOR_RED); + BubNotifListener.EVENT.make().onBubNotif(err, Colors.BUB_RED); } } diff --git a/src/itdelatrisu/opsu/downloads/Download.java b/src/itdelatrisu/opsu/downloads/Download.java index 2b3443e8..a6a7b585 100644 --- a/src/itdelatrisu/opsu/downloads/Download.java +++ b/src/itdelatrisu/opsu/downloads/Download.java @@ -33,6 +33,7 @@ import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.StandardCopyOption; +import itdelatrisu.opsu.ui.Colors; import org.newdawn.slick.util.Log; import yugecin.opsudance.core.errorhandling.ErrorHandler; import yugecin.opsudance.events.BubNotifListener; @@ -218,7 +219,7 @@ public class Download { else if (redirectCount > MAX_REDIRECTS) error = String.format("Download for URL '%s' is attempting too many redirects (over %d).", base.toString(), MAX_REDIRECTS); if (error != null) { - BubNotifListener.EVENT.make().onBubNotif(error, BubNotifListener.COLOR_ORANGE); + BubNotifListener.EVENT.make().onBubNotif(error, Colors.BUB_ORANGE); throw new IOException(); } diff --git a/src/itdelatrisu/opsu/downloads/DownloadNode.java b/src/itdelatrisu/opsu/downloads/DownloadNode.java index d0a86714..e5625306 100644 --- a/src/itdelatrisu/opsu/downloads/DownloadNode.java +++ b/src/itdelatrisu/opsu/downloads/DownloadNode.java @@ -411,7 +411,7 @@ public class DownloadNode { if (download == null) { BubNotifListener.EVENT.make().onBubNotif( "Trying to draw download information for button without Download object", - BubNotifListener.COLOR_ORANGE); + Colors.BUB_ORANGE); return; } diff --git a/src/itdelatrisu/opsu/replay/Replay.java b/src/itdelatrisu/opsu/replay/Replay.java index dd5dfcdb..23a1c8eb 100644 --- a/src/itdelatrisu/opsu/replay/Replay.java +++ b/src/itdelatrisu/opsu/replay/Replay.java @@ -39,6 +39,7 @@ import java.util.ArrayList; import java.util.Date; import java.util.List; +import itdelatrisu.opsu.ui.Colors; import org.apache.commons.compress.compressors.lzma.LZMACompressorInputStream; import org.newdawn.slick.util.Log; @@ -274,7 +275,7 @@ public class Replay { public void save() { // create replay directory if (!config.replayDir.isDirectory() && !config.replayDir.mkdir()) { - BubNotifListener.EVENT.make().onBubNotif("Failed to create replay directory", BubNotifListener.COMMONCOLOR_RED); + BubNotifListener.EVENT.make().onBubNotif("Failed to create replay directory", Colors.BUB_RED); return; } diff --git a/src/itdelatrisu/opsu/replay/ReplayImporter.java b/src/itdelatrisu/opsu/replay/ReplayImporter.java index f426eca7..84b0a44e 100644 --- a/src/itdelatrisu/opsu/replay/ReplayImporter.java +++ b/src/itdelatrisu/opsu/replay/ReplayImporter.java @@ -28,6 +28,7 @@ import java.io.IOException; import java.nio.file.Files; import java.nio.file.StandardCopyOption; +import itdelatrisu.opsu.ui.Colors; import org.newdawn.slick.util.Log; import yugecin.opsudance.events.BubNotifListener; @@ -68,7 +69,7 @@ public class ReplayImporter { if (!config.replayDir.isDirectory() && !config.replayDir.mkdir()) { String err = String.format("Failed to create replay directory '%s'.", config.replayDir.getAbsolutePath()); Log.error(err); - BubNotifListener.EVENT.make().onBubNotif(err, BubNotifListener.COMMONCOLOR_RED); + BubNotifListener.EVENT.make().onBubNotif(err, Colors.BUB_RED); return; } @@ -82,8 +83,7 @@ public class ReplayImporter { moveToFailedDirectory(file); String err = String.format("Failed to import replay '%s'. The replay file could not be parsed.", file.getName()); Log.error(err, e); - BubNotifListener.EVENT.make().onBubNotif(err, - BubNotifListener.COMMONCOLOR_RED); + BubNotifListener.EVENT.make().onBubNotif(err, Colors.BUB_RED); continue; } Beatmap beatmap = BeatmapSetList.get().getBeatmapFromHash(r.beatmapHash); @@ -102,7 +102,7 @@ public class ReplayImporter { moveToFailedDirectory(file); String err = String.format("Failed to import replay '%s'. The associated beatmap could not be found.", file.getName()); Log.error(err); - BubNotifListener.EVENT.make().onBubNotif(err, BubNotifListener.COMMONCOLOR_RED); + BubNotifListener.EVENT.make().onBubNotif(err, Colors.BUB_RED); } } diff --git a/src/itdelatrisu/opsu/skins/SkinLoader.java b/src/itdelatrisu/opsu/skins/SkinLoader.java index 12922911..799a2da2 100644 --- a/src/itdelatrisu/opsu/skins/SkinLoader.java +++ b/src/itdelatrisu/opsu/skins/SkinLoader.java @@ -29,6 +29,7 @@ import java.io.InputStreamReader; import java.util.ArrayList; import java.util.LinkedList; +import itdelatrisu.opsu.ui.Colors; import org.newdawn.slick.Color; import org.newdawn.slick.util.Log; import yugecin.opsudance.events.BubNotifListener; @@ -292,8 +293,7 @@ public class SkinLoader { } catch (IOException e) { String err = String.format("Failed to read file '%s'.", skinFile.getAbsolutePath()); Log.error(err, e); - BubNotifListener.EVENT.make().onBubNotif(err, - BubNotifListener.COMMONCOLOR_RED); + BubNotifListener.EVENT.make().onBubNotif(err, Colors.BUB_RED); } return skin; diff --git a/src/itdelatrisu/opsu/states/Game.java b/src/itdelatrisu/opsu/states/Game.java index e342d5b5..9a16527a 100644 --- a/src/itdelatrisu/opsu/states/Game.java +++ b/src/itdelatrisu/opsu/states/Game.java @@ -336,7 +336,7 @@ public class Game extends ComplexOpsuState { Log.error("could not create offscreen graphics", e); BubNotifListener.EVENT.make().onBubNotif( "Exception while creating offscreen graphics. See logfile for details.", - BubNotifListener.COMMONCOLOR_RED); + Colors.BUB_RED); } // initialize music position bar location @@ -1453,8 +1453,7 @@ public class Game extends ComplexOpsuState { } if (beatmap == null || beatmap.objects == null) { - BubNotifListener.EVENT.make().onBubNotif("Game was running without a beatmap", - BubNotifListener.COMMONCOLOR_RED); + BubNotifListener.EVENT.make().onBubNotif("Game was running without a beatmap", Colors.BUB_RED); displayContainer.switchStateInstantly(songMenuState); } @@ -1561,8 +1560,7 @@ public class Game extends ComplexOpsuState { } catch (Exception e) { String message = String.format("Failed to create %s at index %d:\n%s", hitObject.getTypeName(), i, hitObject.toString()); Log.error(message, e); - BubNotifListener.EVENT.make().onBubNotif(message, - BubNotifListener.COMMONCOLOR_RED); + BubNotifListener.EVENT.make().onBubNotif(message, Colors.BUB_RED); gameObjects[i] = new DummyObject(hitObject); } } @@ -2149,7 +2147,7 @@ public class Game extends ComplexOpsuState { } else { if (replay.frames == null) { BubNotifListener.EVENT.make().onBubNotif("Attempting to set a replay with no frames.", - BubNotifListener.COLOR_ORANGE); + Colors.BUB_ORANGE); return; } this.isReplay = true; diff --git a/src/itdelatrisu/opsu/states/MainMenu.java b/src/itdelatrisu/opsu/states/MainMenu.java index 782dde56..d2930ec8 100644 --- a/src/itdelatrisu/opsu/states/MainMenu.java +++ b/src/itdelatrisu/opsu/states/MainMenu.java @@ -570,8 +570,7 @@ public class MainMenu extends BaseOpsuState { "The repository web page could not be opened."); } catch (IOException e) { Log.error("could not browse to repo", e); - BubNotifListener.EVENT.make().onBubNotif("Could not browse to repo", - BubNotifListener.COLOR_ORANGE); + BubNotifListener.EVENT.make().onBubNotif("Could not browse to repo", Colors.BUB_ORANGE); } return true; } @@ -584,8 +583,7 @@ public class MainMenu extends BaseOpsuState { "The repository web page could not be opened."); } catch (IOException e) { Log.error("could not browse to repo", e); - BubNotifListener.EVENT.make().onBubNotif("Could not browse to repo", - BubNotifListener.COLOR_ORANGE); + BubNotifListener.EVENT.make().onBubNotif("Could not browse to repo", Colors.BUB_ORANGE); } return true; } diff --git a/src/itdelatrisu/opsu/ui/Colors.java b/src/itdelatrisu/opsu/ui/Colors.java index 3b133d9c..cd17f0fd 100644 --- a/src/itdelatrisu/opsu/ui/Colors.java +++ b/src/itdelatrisu/opsu/ui/Colors.java @@ -49,6 +49,11 @@ public class Colors { BLACK_BG_NORMAL = new Color(0, 0, 0, 0.25f), BLACK_BG_HOVER = new Color(0, 0, 0, 0.5f), BLACK_BG_FOCUS = new Color(0, 0, 0, 0.75f), + BUB_GREEN = new Color(98, 131, 59), + BUB_WHITE = new Color(220, 220, 220), + BUB_PURPLE = new Color(94, 46, 149), + BUB_RED = new Color(141, 49, 16), + BUB_ORANGE = new Color(138, 72, 51), GHOST_LOGO = new Color(1.0f, 1.0f, 1.0f, 0.25f); // This class should not be instantiated. diff --git a/src/yugecin/opsudance/core/DisplayContainer.java b/src/yugecin/opsudance/core/DisplayContainer.java index 2f249822..ce3a4816 100644 --- a/src/yugecin/opsudance/core/DisplayContainer.java +++ b/src/yugecin/opsudance/core/DisplayContainer.java @@ -26,6 +26,7 @@ import itdelatrisu.opsu.downloads.DownloadNode; import itdelatrisu.opsu.downloads.Updater; import itdelatrisu.opsu.render.CurveRenderState; import itdelatrisu.opsu.replay.PlaybackSpeed; +import itdelatrisu.opsu.ui.Colors; import itdelatrisu.opsu.ui.Cursor; import itdelatrisu.opsu.ui.Fonts; import itdelatrisu.opsu.ui.UI; @@ -340,15 +341,13 @@ public class DisplayContainer implements ErrorDumpable, KeyListener, MouseListen return true; } if (DownloadList.get().hasActiveDownloads()) { - BubNotifListener.EVENT.make().onBubNotif(DownloadList.EXIT_CONFIRMATION, - BubNotifListener.COMMONCOLOR_RED); + BubNotifListener.EVENT.make().onBubNotif(DownloadList.EXIT_CONFIRMATION, Colors.BUB_RED); exitRequested = false; exitconfirmation = System.currentTimeMillis(); return false; } if (updater.getStatus() == Updater.Status.UPDATE_DOWNLOADING) { - BubNotifListener.EVENT.make().onBubNotif(Updater.EXIT_CONFIRMATION, - BubNotifListener.COMMONCOLOR_PURPLE); + BubNotifListener.EVENT.make().onBubNotif(Updater.EXIT_CONFIRMATION, Colors.BUB_PURPLE); exitRequested = false; exitconfirmation = System.currentTimeMillis(); return false; @@ -387,8 +386,7 @@ public class DisplayContainer implements ErrorDumpable, KeyListener, MouseListen try { setDisplayMode(width, height, OPTION_FULLSCREEN.state); } catch (Exception e) { - BubNotifListener.EVENT.make().onBubNotif("Failed to change resolution", - BubNotifListener.COMMONCOLOR_RED); + BubNotifListener.EVENT.make().onBubNotif("Failed to change resolution", Colors.BUB_RED); Log.error("Failed to set display mode.", e); } } @@ -410,7 +408,7 @@ public class DisplayContainer implements ErrorDumpable, KeyListener, MouseListen fullscreen = false; String msg = String.format("Fullscreen mode is not supported for %sx%s", width, height); Log.warn(msg); - BubNotifListener.EVENT.make().onBubNotif(msg, BubNotifListener.COLOR_ORANGE); + BubNotifListener.EVENT.make().onBubNotif(msg, Colors.BUB_ORANGE); } } diff --git a/src/yugecin/opsudance/events/BubNotifListener.java b/src/yugecin/opsudance/events/BubNotifListener.java index cf752bc4..2990d676 100644 --- a/src/yugecin/opsudance/events/BubNotifListener.java +++ b/src/yugecin/opsudance/events/BubNotifListener.java @@ -25,12 +25,6 @@ public interface BubNotifListener { Event EVENT = new Event<>(BubNotifListener.class); - public static final Color COMMONCOLOR_GREEN = new Color(98, 131, 59); - public static final Color COMMONCOLOR_WHITE = new Color(220, 220, 220); - public static final Color COMMONCOLOR_PURPLE = new Color(94, 46, 149); - public static final Color COMMONCOLOR_RED = new Color(141, 49, 16); - public static final Color COLOR_ORANGE = new Color(138, 72, 51); - void onBubNotif(String message, Color borderColor); } diff --git a/src/yugecin/opsudance/options/Configuration.java b/src/yugecin/opsudance/options/Configuration.java index dd742ff9..78c29dbe 100644 --- a/src/yugecin/opsudance/options/Configuration.java +++ b/src/yugecin/opsudance/options/Configuration.java @@ -24,6 +24,7 @@ import itdelatrisu.opsu.audio.SoundController; import itdelatrisu.opsu.audio.SoundEffect; import itdelatrisu.opsu.beatmap.Beatmap; import itdelatrisu.opsu.beatmap.TimingPoint; +import itdelatrisu.opsu.ui.Colors; import org.lwjgl.BufferUtils; import org.lwjgl.opengl.Display; import org.lwjgl.opengl.GL11; @@ -153,7 +154,7 @@ public class Configuration { } if (!defaultDir.isDirectory() && !defaultDir.mkdir()) { String msg = String.format("Failed to create %s directory at '%s'.", kind, defaultDir.getAbsolutePath()); - BubNotifListener.EVENT.make().onBubNotif(msg, BubNotifListener.COMMONCOLOR_RED); + BubNotifListener.EVENT.make().onBubNotif(msg, Colors.BUB_RED); } return defaultDir; } @@ -214,8 +215,7 @@ public class Configuration { if (!screenshotDir.isDirectory() && !screenshotDir.mkdir()) { BubNotifListener.EVENT.make().onBubNotif( String.format( "Failed to create screenshot directory at '%s'.", - screenshotDir.getAbsolutePath()), - BubNotifListener.COMMONCOLOR_RED); + screenshotDir.getAbsolutePath()), Colors.BUB_RED); return; } @@ -250,7 +250,7 @@ public class Configuration { } ImageIO.write(image, OPTION_SCREENSHOT_FORMAT.getValueString().toLowerCase(), file); BubNotifListener.EVENT.make().onBubNotif("Created " + fileName, - BubNotifListener.COMMONCOLOR_PURPLE); + Colors.BUB_PURPLE); } catch (Exception e) { ErrorHandler.error("Failed to take a screenshot.", e).show(); } diff --git a/src/yugecin/opsudance/options/NumericOption.java b/src/yugecin/opsudance/options/NumericOption.java index 07e1a6dd..84a83dc2 100644 --- a/src/yugecin/opsudance/options/NumericOption.java +++ b/src/yugecin/opsudance/options/NumericOption.java @@ -18,6 +18,7 @@ package yugecin.opsudance.options; import itdelatrisu.opsu.Utils; +import itdelatrisu.opsu.ui.Colors; import yugecin.opsudance.events.BubNotifListener; public class NumericOption extends Option { @@ -53,7 +54,7 @@ public class NumericOption extends Option { val = Utils.clamp(Integer.parseInt(s), min, max); } catch (Exception ignored) { BubNotifListener.EVENT.make().onBubNotif("Failed to parse " + configurationName + " option", - BubNotifListener.COMMONCOLOR_RED); + Colors.BUB_RED); } } diff --git a/src/yugecin/opsudance/options/OptionsService.java b/src/yugecin/opsudance/options/OptionsService.java index 200a15ea..b4fe3ee9 100644 --- a/src/yugecin/opsudance/options/OptionsService.java +++ b/src/yugecin/opsudance/options/OptionsService.java @@ -17,6 +17,7 @@ */ package yugecin.opsudance.options; +import itdelatrisu.opsu.ui.Colors; import org.newdawn.slick.util.Log; import yugecin.opsudance.events.BubNotifListener; @@ -79,7 +80,7 @@ public class OptionsService { } catch (IOException e) { String err = String.format("Failed to read option file '%s'.", config.OPTIONS_FILE.getAbsolutePath()); Log.error(err, e); - BubNotifListener.EVENT.make().onBubNotif(err, BubNotifListener.COMMONCOLOR_RED); + BubNotifListener.EVENT.make().onBubNotif(err, Colors.BUB_RED); } config.loadDirectories(); } @@ -108,7 +109,7 @@ public class OptionsService { } catch (IOException e) { String err = String.format("Failed to write to file '%s'.", config.OPTIONS_FILE.getAbsolutePath()); Log.error(err, e); - BubNotifListener.EVENT.make().onBubNotif(err, BubNotifListener.COMMONCOLOR_RED); + BubNotifListener.EVENT.make().onBubNotif(err, Colors.BUB_RED); } }