mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2024-12-14 12:10:30 +00:00
Fix mouse_up not being fired on Fabric
This commit is contained in:
parent
7f34aff6bb
commit
77f62dac94
@ -105,6 +105,16 @@ public abstract class AbstractComputerScreen<T extends AbstractComputerMenu> ext
|
||||
return super.keyPressed(key, scancode, modifiers);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean mouseReleased(double x, double y, int button) {
|
||||
// Reimplement ContainerEventHandler.mouseReleased, as it's not called in vanilla (it is in Forge, but that
|
||||
// shouldn't matter).
|
||||
setDragging(false);
|
||||
var child = getChildAt(x, y);
|
||||
if (child.isPresent() && child.get().mouseReleased(x, y, button)) return true;
|
||||
|
||||
return super.mouseReleased(x, y, button);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(PoseStack stack, int mouseX, int mouseY, float partialTicks) {
|
||||
|
@ -184,7 +184,7 @@ public class TerminalWidget extends AbstractWidget {
|
||||
lastMouseX = charX;
|
||||
lastMouseY = charY;
|
||||
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -203,7 +203,7 @@ public class TerminalWidget extends AbstractWidget {
|
||||
lastMouseY = charY;
|
||||
}
|
||||
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user