Merge branch 'port/1.20' into 1.20-alternative
This commit is contained in:
@@ -14,6 +14,7 @@ import net.minecraftforge.api.distmarker.Dist;
|
|||||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||||
import nl.requios.effortlessbuilding.create.foundation.gui.widget.AbstractSimiWidget;
|
import nl.requios.effortlessbuilding.create.foundation.gui.widget.AbstractSimiWidget;
|
||||||
import nl.requios.effortlessbuilding.create.foundation.utility.Components;
|
import nl.requios.effortlessbuilding.create.foundation.utility.Components;
|
||||||
|
import nl.requios.effortlessbuilding.gui.buildmodifier.ModifiersScreenList;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -156,6 +157,11 @@ public abstract class AbstractSimiScreen extends Screen {
|
|||||||
int tty = simiWidget.lockedTooltipY == -1 ? mouseY : simiWidget.lockedTooltipY + simiWidget.getY();
|
int tty = simiWidget.lockedTooltipY == -1 ? mouseY : simiWidget.lockedTooltipY + simiWidget.getY();
|
||||||
graphics.renderComponentTooltip(font, tooltip, ttx, tty);
|
graphics.renderComponentTooltip(font, tooltip, ttx, tty);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Added
|
||||||
|
if (widget instanceof ModifiersScreenList list) {
|
||||||
|
list.renderWindowForeground(graphics, mouseX, mouseY, partialTicks);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -118,6 +118,8 @@ public class ScrollInput extends AbstractSimiWidget {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean mouseScrolled(double mouseX, double mouseY, double delta) {
|
public boolean mouseScrolled(double mouseX, double mouseY, double delta) {
|
||||||
|
if (!this.visible || !this.isHovered) return false; //Added
|
||||||
|
|
||||||
if (inverted)
|
if (inverted)
|
||||||
delta *= -1;
|
delta *= -1;
|
||||||
|
|
||||||
@@ -147,7 +149,8 @@ public class ScrollInput extends AbstractSimiWidget {
|
|||||||
onChanged();
|
onChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
return priorState != state;
|
// return priorState != state;
|
||||||
|
return true; //Changed
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void clampState() {
|
protected void clampState() {
|
||||||
|
|||||||
@@ -31,8 +31,8 @@ public class LabeledScrollInput extends ScrollInput {
|
|||||||
|
|
||||||
//TODO: Check if this works
|
//TODO: Check if this works
|
||||||
@Override
|
@Override
|
||||||
public void render(@NotNull GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTicks) {
|
public void doRender(@NotNull GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTicks) {
|
||||||
super.render(guiGraphics, mouseX, mouseY, partialTicks);
|
super.doRender(guiGraphics, mouseX, mouseY, partialTicks);
|
||||||
|
|
||||||
label.setX(getX() + width / 2 - Minecraft.getInstance().font.width(label.text) / 2);
|
label.setX(getX() + width / 2 - Minecraft.getInstance().font.width(label.text) / 2);
|
||||||
label.setY(getY() + height / 2 - Minecraft.getInstance().font.lineHeight / 2);
|
label.setY(getY() + height / 2 - Minecraft.getInstance().font.lineHeight / 2);
|
||||||
|
|||||||
Reference in New Issue
Block a user