raeleus / skin-composer

Create skins for LibGDX scene2d.ui with a graphical interface.
MIT License
429 stars 35 forks source link

Crash when replacing an existing Drawable; error message doesn't identify which class/style is broken #72

Closed v79 closed 4 years ago

v79 commented 4 years ago

When I try to replace an existing Drawable with a new version (a simple PNG icon), SkinComposer crashes with the following error:

java.lang.RuntimeException: Actor: Table
|  TextButton
|  |  Label: OK
|  TextButton
|  |  Label: Cancel
    at com.badlogic.gdx.scenes.scene2d.Actor.notify(Actor.java:202)
    at com.badlogic.gdx.scenes.scene2d.Actor.fire(Actor.java:158)
    at com.badlogic.gdx.scenes.scene2d.ui.Button.setChecked(Button.java:131)
    at com.badlogic.gdx.scenes.scene2d.ui.Button$1.clicked(Button.java:94)
    at com.badlogic.gdx.scenes.scene2d.utils.ClickListener.touchUp(ClickListener.java:88)
    at com.badlogic.gdx.scenes.scene2d.InputListener.handle(InputListener.java:59)
    at com.badlogic.gdx.scenes.scene2d.Stage.touchUp(Stage.java:351)
    at com.badlogic.gdx.InputEventQueue.drain(InputEventQueue.java:86)
    at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Input.update(Lwjgl3Input.java:205)
    at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Window.update(Lwjgl3Window.java:390)
    at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.loop(Lwjgl3Application.java:137)
    at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.<init>(Lwjgl3Application.java:111)
    at com.ray3k.skincomposer.desktop.DesktopLauncher.main(DesktopLauncher.java:32)
Caused by: java.lang.IllegalArgumentException: Missing LabelStyle font.
    at com.badlogic.gdx.scenes.scene2d.ui.Label.setStyle(Label.java:80)
    at com.badlogic.gdx.scenes.scene2d.ui.Label.<init>(Label.java:74)
    at com.badlogic.gdx.scenes.scene2d.ui.ImageTextButton.<init>(ImageTextButton.java:57)
    at com.ray3k.skincomposer.RootTable.refreshPreview(RootTable.java:2094)
    at com.ray3k.skincomposer.dialog.DialogDrawables.removeDuplicateDrawables(DialogDrawables.java:1881)
    at com.ray3k.skincomposer.dialog.DialogDrawables$45.result(DialogDrawables.java:2026)
    at com.badlogic.gdx.scenes.scene2d.ui.Dialog$2.changed(Dialog.java:92)
    at com.badlogic.gdx.scenes.scene2d.utils.ChangeListener.handle(ChangeListener.java:28)
    at com.badlogic.gdx.scenes.scene2d.Actor.notify(Actor.java:188)
    ... 12 more

While it's quite possible that I have something missing in my skin which is my fault, I don't know what. I do not have a Label with StyleOK or Cancel. I've checked that all my Label and TextBox classes do have the mandatory font specified.

SkinComposer 34; Windows 10.

v79 commented 4 years ago

Further information: the crash only seems to happen if the replacement PNG has different dimensions from the original. This is not a 9-patch.

raeleus commented 4 years ago

Very interesting! OK and Cancel are my buttons. The real problem is it's missing stle font. Nevertheless, I'm dramatically changing the way textures and nine patches are loaded. So this problem will go away and be replaced with a host of other problems. Yae! I'll try to reproduce before the next release is out. Thanks.

raeleus commented 4 years ago

I'm having trouble reproducing this one. Any chance you can send me some files that are related to the problem?

raeleus commented 4 years ago

Oh wait, I think I have it. You probably changed the file name or erased one of your fonts files. Please make sure everything is where it's supposed to be. I'll make a better error message for this.