tonihele / OpenKeeper

Dungeon Keeper II remake
GNU General Public License v3.0
428 stars 41 forks source link

Cannot apply graphics settings on first start #435

Closed ForNeVeR closed 1 year ago

ForNeVeR commented 1 year ago
  1. Remove ~/.OpenKeeper to reset the game settings.
  2. Open the graphics settings screen. Note that the Anisotropic filtering setting's value is absent (not the default that should be chosen): image
  3. Change anything else (such as Resolution), press the save button.

An exception will be thrown, the settings screen will stay:

WARNING: Exception in callMethod(public void toniarts.openkeeper.game.state.MainMenuScreenController.applyGraphicsSettings()) for [toniarts.openkeeper.game.state.MainMenuScreenController@46157483]
java.lang.reflect.InvocationTargetException
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:568)
    at de.lessvoid.nifty.NiftyMethodInvoker.callMethod(NiftyMethodInvoker.java:157)
    at de.lessvoid.nifty.NiftyMethodInvoker.performInvoke(NiftyMethodInvoker.java:115)
    at de.lessvoid.nifty.Nifty$DelayedMethodInvoke.perform(Nifty.java:1489)
    at de.lessvoid.nifty.Nifty.invokeMethods(Nifty.java:1465)
    at de.lessvoid.nifty.Nifty.handleDynamicElements(Nifty.java:436)
    at de.lessvoid.nifty.Nifty.access$1600(Nifty.java:84)
    at de.lessvoid.nifty.Nifty$NiftyInputConsumerImpl.processEvent(Nifty.java:1733)
    at de.lessvoid.nifty.Nifty$NiftyInputConsumerImpl.processMouseEvent(Nifty.java:1671)
    at com.jme3.niftygui.InputSystemJme.handleMouseEvent(InputSystemJme.java:128)
    at com.jme3.niftygui.InputSystemJme.onMouseButtonEventQueued(InputSystemJme.java:236)
    at com.jme3.niftygui.InputSystemJme.forwardEvents(InputSystemJme.java:307)
    at de.lessvoid.nifty.Nifty.update(Nifty.java:365)
    at com.jme3.niftygui.InputSystemJme.endInput(InputSystemJme.java:117)
    at com.jme3.input.InputManager.processQueue(InputManager.java:859)
    at com.jme3.input.InputManager.update(InputManager.java:923)
    at com.jme3.app.LegacyApplication.update(LegacyApplication.java:785)
    at com.jme3.app.SimpleApplication.update(SimpleApplication.java:248)
    at com.jme3.system.lwjgl.LwjglWindow.runLoop(LwjglWindow.java:622)
    at com.jme3.system.lwjgl.LwjglWindow.run(LwjglWindow.java:711)
    at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.lang.NullPointerException: Cannot invoke "Object.getClass()" because "value" is null
    at toniarts.openkeeper.game.data.Settings.setSetting(Settings.java:400)
    at toniarts.openkeeper.game.data.Settings.setSetting(Settings.java:396)
    at toniarts.openkeeper.game.state.MainMenuScreenController.applyGraphicsSettings(MainMenuScreenController.java:285)
    ... 24 more

Reproduced on commit e0d29ff (see #434 on the reason I have to use that commit).