Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.cyclops.cyclopscore.client.gui.component;

import com.mojang.blaze3d.platform.InputConstants;
import net.minecraft.client.gui.GuiGraphicsExtractor;
import net.minecraft.client.gui.components.AbstractWidget;
import net.minecraft.client.gui.narration.NarrationElementOutput;
Expand Down Expand Up @@ -91,7 +92,7 @@ public boolean mouseScrolled(double mouseX, double mouseY, double scrollX, doubl

@Override
public boolean mouseDragged(MouseButtonEvent mouse, double offsetX, double offsetY) {
boolean flag = mouse.button() == 0 || mouse.button() == 1;
boolean flag = mouse.button() == InputConstants.MOUSE_BUTTON_LEFT || mouse.button() == InputConstants.MOUSE_BUTTON_RIGHT;
int xMax = getX() + 14;
int yMax = getY() + height;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.cyclops.cyclopscore.client.gui.component.input;

import com.mojang.blaze3d.platform.InputConstants;
import net.minecraft.client.gui.Font;
import net.minecraft.client.gui.GuiGraphicsExtractor;
import net.minecraft.client.gui.components.EditBox;
Expand Down Expand Up @@ -63,7 +64,7 @@ public void extractWidgetRenderState(GuiGraphicsExtractor guiGraphics, int mouse

@Override
public boolean mouseClicked(MouseButtonEvent event, boolean isDoubleClick) {
if (event.button() == 1 && event.x() >= this.getX() && event.x() < this.getX() + this.width
if (event.button() == InputConstants.MOUSE_BUTTON_RIGHT && event.x() >= this.getX() && event.x() < this.getX() + this.width
&& event.y() >= this.getY() && event.y() < this.getY() + this.height) {
// Select everything
this.setFocused(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public void extractBackground(GuiGraphicsExtractor guiGraphics, int mouseX, int

@Override
public boolean mouseDragged(MouseButtonEvent event, double mouseX, double mouseY) {
if (this.getFocused() != null && this.isDragging() && event.button() == 0
if (this.getFocused() != null && this.isDragging() && event.button() == InputConstants.MOUSE_BUTTON_LEFT
&& this.getFocused().mouseDragged(event, mouseX, mouseY)) {
return true;
}
Expand Down
Loading