CreativeMD / LittleFrames

GNU Lesser General Public License v3.0
12 stars 7 forks source link

Gui Is closed pressing E #55

Closed SrRapero720 closed 1 year ago

SrRapero720 commented 1 year ago

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 https://github.com/CreativeMD/LittleFrames/blob/b8494ecbcd1266d0288c37d9242011885a8e9c60/src/main/java/team/creative/littleframes/client/gui/GuiLittlePictureFrame.java#L33

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;
        }
    }
CreativeMD commented 1 year ago

Talking about 1.18 or newer versions?

SrRapero720 commented 1 year ago

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

SrRapero720 commented 1 year ago

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)

SrRapero720 commented 1 year ago

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

CreativeMD commented 1 year ago

Uploaded a fix for this just now!