Skip to content

Commit

Permalink
Add controller skip to SC intro (closes #2003)
Browse files Browse the repository at this point in the history
  • Loading branch information
LordMonoxide committed Feb 1, 2025
1 parent 00c1af2 commit 96f4737
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/main/java/legend/core/GameEngine.java
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ private GameEngine() { }
private static Window.Events.Resize onResize;
private static Window.Events.Key onKeyPress;
private static Window.Events.Click onMouseRelease;
private static Window.Events.OnPressedThisFrame onPressedThisFrame;
private static Runnable onShutdown;

private static final ShaderType<EyeShaderOptions> EYE_SHADER = new ShaderType<>(
Expand Down Expand Up @@ -203,7 +204,7 @@ public static void start() throws IOException {
UPDATE = null;
UPDATER.check(release -> {
synchronized(UPDATER_LOCK) {
UPDATE_CHECK_FINISHED = true;
// UPDATE_CHECK_FINISHED = true;
UPDATE = release;
}
});
Expand Down Expand Up @@ -443,6 +444,11 @@ private static void transitionToGame() {
onMouseRelease = null;
}

if(onPressedThisFrame != null) {
RENDERER.events().removePressedThisFrame(onPressedThisFrame);
onPressedThisFrame = null;
}

if(onShutdown != null) {
RENDERER.events().removeShutdown(onShutdown);
onShutdown = null;
Expand Down Expand Up @@ -513,6 +519,7 @@ private static void loadGfx() {

onKeyPress = RENDERER.events().onKeyPress((window, key, scancode, mods) -> skip());
onMouseRelease = RENDERER.events().onMouseRelease((window, x, y, button, mods) -> skip());
onPressedThisFrame = RENDERER.events().onPressedThisFrame((window, inputAction) -> skip());
onShutdown = RENDERER.events().onShutdown(Unpacker::stop);
}

Expand Down

0 comments on commit 96f4737

Please sign in to comment.