StrongJoshua / libgdx-inGameConsole

A LibGdx library that allows a developer to add a console (similar to how it is featured in Source games) to their game.
https://www.strongjoshua.net/projects/games/libgdx-ingame-console
Apache License 2.0
131 stars 35 forks source link

Crash with libGDX 1.9.9 #46

Closed mattyoung101 closed 5 years ago

mattyoung101 commented 5 years ago

When using the latest libGDX v1.9.9 and the latest libgdx-inGameConsole v1.0.0b-SNAPSHOT, if you create a GUIConsole with the default empty constructor, the app crashes with the following stacktrace:

Exception in thread "LWJGL Application" com.badlogic.gdx.utils.GdxRuntimeException: java.lang.NoSuchMethodError: com.badlogic.gdx.InputMultiplexer.getProcessors()Lcom/badlogic/gdx/utils/Array;
    at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:133)
Caused by: java.lang.NoSuchMethodError: com.badlogic.gdx.InputMultiplexer.getProcessors()Lcom/badlogic/gdx/utils/Array;
    at com.strongjoshua.console.GUIConsole.hasStage(GUIConsole.java:259)
    at com.strongjoshua.console.GUIConsole.resetInputProcessing(GUIConsole.java:233)
    at com.strongjoshua.console.GUIConsole.<init>(GUIConsole.java:152)
    at com.strongjoshua.console.GUIConsole.<init>(GUIConsole.java:127)
    at com.strongjoshua.console.GUIConsole.<init>(GUIConsole.java:113)
    at com.strongjoshua.console.GUIConsole.<init>(GUIConsole.java:86)
    at com.strongjoshua.console.GUIConsole.<init>(GUIConsole.java:73)

It seems to be due to a breaking change introduced to InputMultiplexer in 1.9.9.

AkashaP commented 5 years ago

I have fixed the issue on my branch https://github.com/Draika/libgdx-inGameConsole/

The problem is that in 1.9.9 the GuiConsole has changed the getProcessors method to return a SnapshotArray instead of a normal Array

mattyoung101 commented 5 years ago

That looks great, thanks for your work! Hopefully @StrongJoshua will merge the PR soon.

rabbitfr commented 5 years ago

Hi, can you merge the PR ?