LittlePictureFrames

LittlePictureFrames

751k Downloads

Gui Is closed pressing E

SrRapero720 opened this issue ยท 5 comments

commented

Typing or fixing a URL char with E as key closes the gui like inventory gui.
So if I want to write: gyazo.com/my-pro-pictur... Whoops, Gui was closed.

To fix this just overwrite onKeyPressed on gui

public class GuiLittlePictureFrame extends GuiLayer {

Adding:

    @Override
    public boolean keyPressed(int keyCode, int scanCode, int modifiers) {
        if (keyCode == 256) {
            if (this.closeLayerUsingEscape()) {
                this.closeTopLayer();
            }
            return true;
        // Using "super.keyPressed()" also handles E, but with this is handled pressing E before CC handles it
        } else if (keyCode == this.getSettings().keyInventory.getKey().getValue()) {
            return true;
        } else if (super.keyPressed(keyCode, scanCode, modifiers)) {
            return true;
        } else {
            return false;
        }
    }
commented

Talking about 1.18 or newer versions?

commented

is affected 1.18 and 1.19
i didn't test on 1.20

commented

my bad, i have installed an old version of CreativeCore on 1.19.2
updating it solves it on 1.19.2 (new versions aren't afected)

commented

Uploaded a fix for this just now!

commented

About that bug, can you Backport that CC fix to 1.18.2?