diff --git a/src/itdelatrisu/opsu/Options.java b/src/itdelatrisu/opsu/Options.java index 2c033336..d810feba 100644 --- a/src/itdelatrisu/opsu/Options.java +++ b/src/itdelatrisu/opsu/Options.java @@ -1372,7 +1372,7 @@ public class Options { try { container.setDisplayMode(width, height, isFullscreen()); } catch (Exception e) { - container.eventBus.post(new BubbleNotificationEvent("Failed to change resolution", BubbleNotificationEvent.COMMONCOLOR_RED)); + container.eventBus.post(new BubbleNotificationEvent("Failed to change resolution", BubbleNotificationEvent.COLOR_RED)); Log.error("Failed to set display mode.", e); } diff --git a/src/yugecin/opsudance/core/DisplayContainer.java b/src/yugecin/opsudance/core/DisplayContainer.java index 4eee9338..c90aa334 100644 --- a/src/yugecin/opsudance/core/DisplayContainer.java +++ b/src/yugecin/opsudance/core/DisplayContainer.java @@ -43,6 +43,7 @@ import yugecin.opsudance.core.state.specialstates.BarNotificationState; import yugecin.opsudance.core.state.specialstates.BubbleNotificationState; import yugecin.opsudance.core.state.specialstates.FpsRenderState; import yugecin.opsudance.core.state.transitions.*; +import yugecin.opsudance.events.BubbleNotificationEvent; import yugecin.opsudance.events.ResolutionChangedEvent; import yugecin.opsudance.utils.GLHelper; @@ -206,8 +207,6 @@ public class DisplayContainer implements ErrorDumpable, KeyListener, MouseListen Display.create(); GLHelper.setIcons(new String[] { "icon16.png", "icon32.png" }); initGL(); - sout("GL ready"); - eventBus.post(new ResolutionChangedEvent(this.width, this.height)); glVersion = GL11.glGetString(GL11.GL_VERSION); glVendor = GL11.glGetString(GL11.GL_VENDOR); } @@ -233,6 +232,7 @@ public class DisplayContainer implements ErrorDumpable, KeyListener, MouseListen if (fullscreen) { fullscreen = false; Log.warn("could not find fullscreen displaymode for " + width + "x" + height); + eventBus.post(new BubbleNotificationEvent("Fullscreen mode is not supported for " + width + "x" + height, BubbleNotificationEvent.COLOR_ORANGE)); } } @@ -244,8 +244,6 @@ public class DisplayContainer implements ErrorDumpable, KeyListener, MouseListen if (Display.isCreated()) { initGL(); - - eventBus.post(new ResolutionChangedEvent(this.width, this.height)); } if (displayMode.getBitsPerPixel() == 16) { @@ -265,8 +263,12 @@ public class DisplayContainer implements ErrorDumpable, KeyListener, MouseListen input.addKeyListener(this); input.addMouseListener(this); + sout("GL ready"); + GameImage.init(width, height); Fonts.init(); + + eventBus.post(new ResolutionChangedEvent(this.width, this.height)); } private int getDelta() { diff --git a/src/yugecin/opsudance/events/BubbleNotificationEvent.java b/src/yugecin/opsudance/events/BubbleNotificationEvent.java index caf5b736..a4abdd51 100644 --- a/src/yugecin/opsudance/events/BubbleNotificationEvent.java +++ b/src/yugecin/opsudance/events/BubbleNotificationEvent.java @@ -21,10 +21,11 @@ import org.newdawn.slick.Color; public class BubbleNotificationEvent { - public static final Color COMMONCOLOR_RED = new Color(138, 72, 51); 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 COLOR_RED = new Color(178, 62, 41); + public static final Color COLOR_ORANGE = new Color(138, 72, 51); public final String message; public final Color borderColor; diff --git a/src/yugecin/opsudance/states/EmptyRedState.java b/src/yugecin/opsudance/states/EmptyRedState.java index fcf52029..a4102ff3 100644 --- a/src/yugecin/opsudance/states/EmptyRedState.java +++ b/src/yugecin/opsudance/states/EmptyRedState.java @@ -74,7 +74,7 @@ public class EmptyRedState implements OpsuState { @Override public boolean keyPressed(int key, char c) { - displayContainer.eventBus.post(new BubbleNotificationEvent("this is a bubble notification... bubbly bubbly bubbly linewraaaaaaaaaap", BubbleNotificationEvent.COMMONCOLOR_RED)); + displayContainer.eventBus.post(new BubbleNotificationEvent("this is a bubble notification... bubbly bubbly bubbly linewraaaaaaaaaap", BubbleNotificationEvent.COLOR_RED)); return false; }