bubble notif when fullscreen is not supported + changed bubble colors

This commit is contained in:
yugecin 2017-01-18 11:59:30 +01:00
parent 57b29d7e91
commit 605dcec605
4 changed files with 10 additions and 7 deletions

View File

@ -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);
}

View File

@ -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() {

View File

@ -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;

View File

@ -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;
}