Changed most GUI stuff to use GuiGraphics instead of PoseStacks.
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
package nl.requios.effortlessbuilding;
|
||||
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import net.minecraft.client.gui.GuiComponent;
|
||||
import net.minecraft.client.gui.GuiGraphics;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
@@ -49,21 +48,14 @@ public enum AllGuiTextures implements ScreenElement {
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Override
|
||||
public void render(PoseStack ms, int x, int y) {
|
||||
public void render(GuiGraphics graphics, int x, int y) {
|
||||
bind();
|
||||
GuiComponent.blit(ms, x, y, 0, startX, startY, width, height, 256, 256);
|
||||
graphics.blit(location, x, y, startX, startY, width, height, width, height);
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public void render(PoseStack ms, int x, int y, GuiComponent component) {
|
||||
public void render(GuiGraphics graphics, int x, int y, Color c) {
|
||||
bind();
|
||||
component.blit(ms, x, y, startX, startY, width, height);
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public void render(PoseStack ms, int x, int y, Color c) {
|
||||
bind();
|
||||
UIRenderHelper.drawColoredTexture(ms, c, x, y, startX, startY, width, height);
|
||||
UIRenderHelper.drawColoredTexture(graphics, c, x, y, startX, startY, width, height);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,8 +3,8 @@ package nl.requios.effortlessbuilding;
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import com.mojang.blaze3d.vertex.VertexConsumer;
|
||||
import net.minecraft.client.gui.GuiGraphics;
|
||||
import org.joml.Matrix4f;
|
||||
import net.minecraft.client.gui.GuiComponent;
|
||||
import net.minecraft.client.renderer.LightTexture;
|
||||
import net.minecraft.client.renderer.MultiBufferSource;
|
||||
import net.minecraft.client.renderer.RenderType;
|
||||
@@ -108,15 +108,9 @@ public class AllIcons implements ScreenElement {
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Override
|
||||
public void render(PoseStack matrixStack, int x, int y) {
|
||||
public void render(GuiGraphics graphics, int x, int y) {
|
||||
bind();
|
||||
GuiComponent.blit(matrixStack, x, y, 0, iconX, iconY, 16, 16, 256, 256);
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public void render(PoseStack matrixStack, int x, int y, GuiComponent component) {
|
||||
bind();
|
||||
component.blit(matrixStack, x, y, iconX, iconY, 16, 16);
|
||||
graphics.blit(ICON_ATLAS, x, y, 0, iconX, iconY, 16, 16, 256, 256);
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
|
||||
@@ -131,7 +131,7 @@ public abstract class AbstractSimiContainerScreen<T extends AbstractContainerMen
|
||||
}
|
||||
|
||||
public void renderPlayerInventory(GuiGraphics graphics, int x, int y) {
|
||||
AllGuiTextures.PLAYER_INVENTORY.render(graphics, x, y);
|
||||
// AllGuiTextures.PLAYER_INVENTORY.render(graphics, x, y);
|
||||
graphics.drawString(font, playerInventoryTitle, x + 8, y + 6, 0x404040, false);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package nl.requios.effortlessbuilding.create.foundation.gui.menu;
|
||||
|
||||
import nl.requios.effortlessbuilding.create.AllPackets;
|
||||
//import nl.requios.effortlessbuilding.create.AllPackets;
|
||||
|
||||
public interface IClearableMenu {
|
||||
|
||||
|
||||
@@ -4,8 +4,8 @@ import java.util.function.Consumer;
|
||||
import java.util.function.Function;
|
||||
|
||||
import nl.requios.effortlessbuilding.create.AllKeys;
|
||||
import nl.requios.effortlessbuilding.create.AllSoundEvents;
|
||||
import nl.requios.effortlessbuilding.create.foundation.blockEntity.behaviour.scrollValue.ScrollValueBehaviour.StepContext;
|
||||
//import nl.requios.effortlessbuilding.create.AllSoundEvents;
|
||||
//import nl.requios.effortlessbuilding.create.foundation.blockEntity.behaviour.scrollValue.ScrollValueBehaviour.StepContext;
|
||||
import nl.requios.effortlessbuilding.create.foundation.utility.Components;
|
||||
import nl.requios.effortlessbuilding.create.foundation.utility.Lang;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package nl.requios.effortlessbuilding.create.foundation.utility;
|
||||
|
||||
import nl.requios.effortlessbuilding.create.foundation.ponder.PonderWorld;
|
||||
import nl.requios.effortlessbuilding.create.foundation.ponder.ui.PonderUI;
|
||||
//import nl.requios.effortlessbuilding.create.foundation.ponder.PonderWorld;
|
||||
//import nl.requios.effortlessbuilding.create.foundation.ponder.ui.PonderUI;
|
||||
import nl.requios.effortlessbuilding.create.foundation.utility.worldWrappers.WrappedClientWorld;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package nl.requios.effortlessbuilding.gui;
|
||||
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import net.minecraft.client.gui.GuiGraphics;
|
||||
import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
@@ -26,24 +26,23 @@ public class DiamondRandomizerBagScreen extends AbstractContainerScreen<DiamondR
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(PoseStack ms, int mouseX, int mouseY, float partialTicks) {
|
||||
renderBackground(ms);
|
||||
super.render(ms, mouseX, mouseY, partialTicks);
|
||||
this.renderTooltip(ms, mouseX, mouseY);
|
||||
public void render(GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) {
|
||||
renderBackground(graphics);
|
||||
super.render(graphics, mouseX, mouseY, partialTicks);
|
||||
this.renderTooltip(graphics, mouseX, mouseY);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void renderLabels(PoseStack ms, int mouseX, int mouseY) {
|
||||
this.font.draw(ms, this.title, 8, 6, 0x404040);
|
||||
this.font.draw(ms, this.playerInventoryTitle, 8, imageHeight - 96 + 2, 0x404040);
|
||||
protected void renderLabels(GuiGraphics graphics, int mouseX, int mouseY) {
|
||||
graphics.drawString(this.font, this.title, 8, 6, 0x404040);
|
||||
graphics.drawString(this.font, this.playerInventoryTitle, 8, imageHeight - 96 + 2, 0x404040);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void renderBg(PoseStack ms, float partialTicks, int mouseX, int mouseY) {
|
||||
protected void renderBg(GuiGraphics graphics, float partialTicks, int mouseX, int mouseY) {
|
||||
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1f);
|
||||
RenderSystem.setShaderTexture(0, guiTextures);
|
||||
int marginHorizontal = (width - imageWidth) / 2;
|
||||
int marginVertical = (height - imageHeight) / 2;
|
||||
blit(ms, marginHorizontal, marginVertical, 0, 0, imageWidth, imageHeight);
|
||||
graphics.blit(guiTextures, marginHorizontal, marginVertical, 0, 0, imageWidth, imageHeight);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package nl.requios.effortlessbuilding.gui;
|
||||
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import net.minecraft.client.gui.GuiGraphics;
|
||||
import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
@@ -26,24 +27,23 @@ public class GoldenRandomizerBagScreen extends AbstractContainerScreen<GoldenRan
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(PoseStack ms, int mouseX, int mouseY, float partialTicks) {
|
||||
renderBackground(ms);
|
||||
super.render(ms, mouseX, mouseY, partialTicks);
|
||||
this.renderTooltip(ms, mouseX, mouseY);
|
||||
public void render(GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) {
|
||||
renderBackground(graphics);
|
||||
super.render(graphics, mouseX, mouseY, partialTicks);
|
||||
this.renderTooltip(graphics, mouseX, mouseY);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void renderLabels(PoseStack ms, int mouseX, int mouseY) {
|
||||
this.font.draw(ms, this.title, 8, 6, 0x404040);
|
||||
this.font.draw(ms, this.playerInventoryTitle, 8, imageHeight - 96 + 2, 0x404040);
|
||||
protected void renderLabels(GuiGraphics graphics, int mouseX, int mouseY) {
|
||||
graphics.drawString(this.font, this.title, 8, 6, 0x404040);
|
||||
graphics.drawString(this.font, this.playerInventoryTitle, 8, imageHeight - 96 + 2, 0x404040);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void renderBg(PoseStack ms, float partialTicks, int mouseX, int mouseY) {
|
||||
protected void renderBg(GuiGraphics graphics, float partialTicks, int mouseX, int mouseY) {
|
||||
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1f);
|
||||
RenderSystem.setShaderTexture(0, guiTextures);
|
||||
int marginHorizontal = (width - imageWidth) / 2;
|
||||
int marginVertical = (height - imageHeight) / 2;
|
||||
blit(ms, marginHorizontal, marginVertical, 0, 0, imageWidth, imageHeight);
|
||||
graphics.blit(guiTextures, marginHorizontal, marginVertical, 0, 0, imageWidth, imageHeight);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package nl.requios.effortlessbuilding.gui;
|
||||
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
import net.minecraft.client.gui.GuiGraphics;
|
||||
import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen;
|
||||
import net.minecraft.world.entity.player.Inventory;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
@@ -26,24 +27,24 @@ public class RandomizerBagScreen extends AbstractContainerScreen<RandomizerBagCo
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(PoseStack ms, int mouseX, int mouseY, float partialTicks) {
|
||||
renderBackground(ms);
|
||||
super.render(ms, mouseX, mouseY, partialTicks);
|
||||
this.renderTooltip(ms, mouseX, mouseY);
|
||||
public void render(GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) {
|
||||
renderBackground(graphics);
|
||||
super.render(graphics, mouseX, mouseY, partialTicks);
|
||||
this.renderTooltip(graphics, mouseX, mouseY);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void renderLabels(PoseStack ms, int mouseX, int mouseY) {
|
||||
this.font.draw(ms, this.title, 8, 6, 0x404040);
|
||||
this.font.draw(ms, this.playerInventoryTitle, 8, imageHeight - 96 + 2, 0x404040);
|
||||
protected void renderLabels(GuiGraphics graphics, int mouseX, int mouseY) {
|
||||
graphics.drawString(this.font, this.title, 8, 6, 0x404040);
|
||||
graphics.drawString(this.font, this.playerInventoryTitle, 8, imageHeight - 96 + 2, 0x404040);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void renderBg(PoseStack ms, float partialTicks, int mouseX, int mouseY) {
|
||||
protected void renderBg(GuiGraphics graphics, float partialTicks, int mouseX, int mouseY) {
|
||||
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1f);
|
||||
RenderSystem.setShaderTexture(0, guiTextures);
|
||||
int marginHorizontal = (width - imageWidth) / 2;
|
||||
int marginVertical = (height - imageHeight) / 2;
|
||||
blit(ms, marginHorizontal, marginVertical, 0, 0, imageWidth, imageHeight);
|
||||
graphics.blit(guiTextures, marginHorizontal, marginVertical, 0, 0, imageWidth, imageHeight);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.mojang.blaze3d.platform.GlStateManager;
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
import net.minecraft.MethodsReturnNonnullByDefault;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiGraphics;
|
||||
import net.minecraft.client.resources.sounds.SimpleSoundInstance;
|
||||
import net.minecraft.client.gui.screens.Screen;
|
||||
import net.minecraft.client.gui.components.Button;
|
||||
@@ -65,7 +66,7 @@ public class PlayerSettingsGui extends Screen {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(PoseStack ms, int mouseX, int mouseY, float partialTicks) {
|
||||
public void render(GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) {
|
||||
this.renderBackground(ms);
|
||||
|
||||
int yy = top;
|
||||
@@ -189,7 +190,7 @@ public class PlayerSettingsGui extends Screen {
|
||||
|
||||
//From AbstractSelectionList, disabled parts
|
||||
@Override
|
||||
public void render(PoseStack ms, int p_render_1_, int p_render_2_, float p_render_3_) {
|
||||
public void render(GuiGraphics graphics, int p_render_1_, int p_render_2_, float p_render_3_) {
|
||||
this.renderBackground(ms);
|
||||
int i = this.getScrollbarPosition();
|
||||
int j = i + 6;
|
||||
|
||||
@@ -2,6 +2,7 @@ package nl.requios.effortlessbuilding.gui.buildmode;
|
||||
|
||||
import com.mojang.blaze3d.vertex.*;
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
import net.minecraft.client.gui.GuiGraphics;
|
||||
import org.joml.Vector4f;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.screens.Screen;
|
||||
@@ -95,7 +96,7 @@ public class RadialMenu extends Screen {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(PoseStack ms, final int mouseX, final int mouseY, final float partialTicks) {
|
||||
public void render(GuiGraphics graphics, final int mouseX, final int mouseY, final float partialTicks) {
|
||||
BuildModeEnum currentBuildMode = EffortlessBuildingClient.BUILD_MODES.getBuildMode();
|
||||
|
||||
ms.pushPose();
|
||||
@@ -288,7 +289,7 @@ public class RadialMenu extends Screen {
|
||||
}
|
||||
}
|
||||
|
||||
private void drawIcons(PoseStack ms, double middleX, double middleY,
|
||||
private void drawIcons(GuiGraphics graphics, double middleX, double middleY,
|
||||
ArrayList<MenuRegion> modes, ArrayList<MenuButton> buttons) {
|
||||
ms.pushPose();
|
||||
RenderSystem.enableTexture();
|
||||
@@ -316,7 +317,7 @@ public class RadialMenu extends Screen {
|
||||
ms.popPose();
|
||||
}
|
||||
|
||||
private void drawTexts(PoseStack ms, BuildModeEnum currentBuildMode, double middleX, double middleY, ArrayList<MenuRegion> modes, ArrayList<MenuButton> buttons, OptionEnum[] options, int mouseX, int mouseY) {
|
||||
private void drawTexts(GuiGraphics graphics, BuildModeEnum currentBuildMode, double middleX, double middleY, ArrayList<MenuRegion> modes, ArrayList<MenuButton> buttons, OptionEnum[] options, int mouseX, int mouseY) {
|
||||
//font.drawStringWithShadow("Actions", (int) (middleX - buttonDistance - 13) - font.getStringWidth("Actions") * 0.5f, (int) middleY - 38, 0xffffffff);
|
||||
|
||||
//Draw option strings
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package nl.requios.effortlessbuilding.gui.buildmodifier;
|
||||
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import net.minecraft.ChatFormatting;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiGraphics;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
@@ -13,7 +13,6 @@ import nl.requios.effortlessbuilding.buildmodifier.BaseModifier;
|
||||
import nl.requios.effortlessbuilding.create.foundation.gui.widget.ScrollInput;
|
||||
import nl.requios.effortlessbuilding.gui.elements.LabeledScrollInput;
|
||||
import nl.requios.effortlessbuilding.utilities.MathHelper;
|
||||
import nl.requios.effortlessbuilding.systems.PowerLevel;
|
||||
|
||||
import java.util.Vector;
|
||||
|
||||
@@ -60,25 +59,25 @@ public class ArrayEntry extends BaseModifierEntry<Array> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(PoseStack ms, int index, int y, int x, int width, int height, int mouseX, int mouseY, boolean p_230432_9_, float partialTicks) {
|
||||
super.render(ms, index, y, x, width, height, mouseX, mouseY, p_230432_9_, partialTicks);
|
||||
public void render(GuiGraphics graphics, int index, int y, int x, int width, int height, int mouseX, int mouseY, boolean p_230432_9_, float partialTicks) {
|
||||
super(graphics, index, y, x, width, height, mouseX, mouseY, p_230432_9_, partialTicks);
|
||||
|
||||
//draw offset inputs
|
||||
for (int i = 0; i < 3; i++) {
|
||||
offsetInputs.get(i).x = left + 49 + 20 * i;
|
||||
offsetInputs.get(i).y = top + 19;
|
||||
offsetInputs.get(i).render(ms, mouseX, mouseY, partialTicks);
|
||||
offsetInputs.get(i).setX(left + 49 + 20 * i);
|
||||
offsetInputs.get(i).setY(top + 19);
|
||||
offsetInputs.get(i).render(graphics, mouseX, mouseY, partialTicks);
|
||||
}
|
||||
|
||||
//draw count input
|
||||
countInput.x = left + 49;
|
||||
countInput.y = top + 41;
|
||||
countInput.render(ms, mouseX, mouseY, partialTicks);
|
||||
countInput.setX(left + 49);
|
||||
countInput.setY(top + 41);
|
||||
countInput.render(graphics, mouseX, mouseY, partialTicks);
|
||||
|
||||
//draw reach label
|
||||
reachLabel.x = right - 8 - getFont().width(reachLabel.text);
|
||||
reachLabel.y = top + 24;
|
||||
reachLabel.render(ms, mouseX, mouseY, partialTicks);
|
||||
reachLabel.setX(right - 8 - getFont().width(reachLabel.text));
|
||||
reachLabel.setY(top + 24);
|
||||
reachLabel.render(graphics, mouseX, mouseY, partialTicks);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,18 +1,11 @@
|
||||
package nl.requios.effortlessbuilding.gui.buildmodifier;
|
||||
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import net.minecraft.client.gui.GuiGraphics;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import nl.requios.effortlessbuilding.AllGuiTextures;
|
||||
import nl.requios.effortlessbuilding.AllIcons;
|
||||
import nl.requios.effortlessbuilding.buildmodifier.BaseModifier;
|
||||
import nl.requios.effortlessbuilding.create.foundation.gui.AbstractSimiScreen;
|
||||
import nl.requios.effortlessbuilding.create.foundation.gui.widget.BoxWidget;
|
||||
import nl.requios.effortlessbuilding.create.foundation.gui.widget.ElementWidget;
|
||||
import nl.requios.effortlessbuilding.create.foundation.gui.widget.IconButton;
|
||||
import nl.requios.effortlessbuilding.create.foundation.gui.widget.Label;
|
||||
import nl.requios.effortlessbuilding.create.foundation.utility.Components;
|
||||
import nl.requios.effortlessbuilding.gui.elements.GuiCollapsibleScrollEntry;
|
||||
import nl.requios.effortlessbuilding.gui.elements.GuiScrollPane;
|
||||
import nl.requios.effortlessbuilding.gui.elements.MiniButton;
|
||||
|
||||
public abstract class BaseModifierEntry<T extends BaseModifier> extends ModifiersScreenList.Entry {
|
||||
@@ -87,41 +80,41 @@ public abstract class BaseModifierEntry<T extends BaseModifier> extends Modifier
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(PoseStack ms, int index, int y, int x, int width, int height, int mouseX, int mouseY, boolean p_230432_9_, float partialTicks) {
|
||||
public void render(GuiGraphics graphics, int index, int y, int x, int width, int height, int mouseX, int mouseY, boolean p_230432_9_, float partialTicks) {
|
||||
|
||||
left = x + width / 2 - BACKGROUND_WIDTH / 2;
|
||||
right = x + width / 2 + BACKGROUND_WIDTH / 2;
|
||||
top = y;
|
||||
bottom = y + BACKGROUND_HEIGHT;
|
||||
|
||||
background.render(ms, left, top, screen);
|
||||
|
||||
enableButton.x = left + 4;
|
||||
enableButton.y = top + 3;
|
||||
enableButton.render(ms, mouseX, mouseY, partialTicks);
|
||||
|
||||
background.render(graphics, left, top);
|
||||
|
||||
enableButton.setX(left + 4);
|
||||
enableButton.setY(top + 3);
|
||||
enableButton.render(graphics, mouseX, mouseY, partialTicks);
|
||||
if (modifier.enabled)
|
||||
AllGuiTextures.CHECKMARK.render(ms, left + 5, top + 3, screen);
|
||||
|
||||
nameLabel.x = left + 18;
|
||||
nameLabel.y = top + 4;
|
||||
nameLabel.render(ms, mouseX, mouseY, partialTicks);
|
||||
AllGuiTextures.CHECKMARK.render(graphics, left + 5, top + 3);
|
||||
|
||||
nameLabel.setX(left + 18);
|
||||
nameLabel.setY(top + 4);
|
||||
nameLabel.render(graphics, mouseX, mouseY, partialTicks);
|
||||
|
||||
moveUpButton.visible = screen.canMoveUp(this);
|
||||
moveDownButton.visible = screen.canMoveDown(this);
|
||||
|
||||
moveUpButton.setX(right - 31);
|
||||
moveUpButton.setY(top + 3);
|
||||
moveUpButton.render(graphics, mouseX, mouseY, partialTicks);
|
||||
|
||||
moveDownButton.setX(right - 22);
|
||||
moveDownButton.setY(top + 3);
|
||||
moveDownButton.render(graphics, mouseX, mouseY, partialTicks);
|
||||
|
||||
removeButton.setX(right - 13);
|
||||
removeButton.setY(top + 3);
|
||||
removeButton.render(graphics, mouseX, mouseY, partialTicks);
|
||||
|
||||
moveUpButton.x = right - 31;
|
||||
moveUpButton.y = top + 3;
|
||||
moveUpButton.render(ms, mouseX, mouseY, partialTicks);
|
||||
|
||||
moveDownButton.x = right - 22;
|
||||
moveDownButton.y = top + 3;
|
||||
moveDownButton.render(ms, mouseX, mouseY, partialTicks);
|
||||
|
||||
removeButton.x = right - 13;
|
||||
removeButton.y = top + 3;
|
||||
removeButton.render(ms, mouseX, mouseY, partialTicks);
|
||||
|
||||
super.render(ms, index, y, x, width, height, mouseX, mouseY, p_230432_9_, partialTicks);
|
||||
// super.render(graphics, index, y, x, width, height, mouseX, mouseY, p_230432_9_, partialTicks);
|
||||
}
|
||||
|
||||
public void onValueChanged() {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package nl.requios.effortlessbuilding.gui.buildmodifier;
|
||||
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiGraphics;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.world.phys.Vec3;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
@@ -16,7 +16,6 @@ import nl.requios.effortlessbuilding.create.foundation.gui.widget.ScrollInput;
|
||||
import nl.requios.effortlessbuilding.create.foundation.utility.Components;
|
||||
import nl.requios.effortlessbuilding.gui.elements.LabeledScrollInput;
|
||||
import nl.requios.effortlessbuilding.utilities.MathHelper;
|
||||
import nl.requios.effortlessbuilding.systems.PowerLevel;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.Vector;
|
||||
@@ -136,49 +135,49 @@ public class MirrorEntry extends BaseModifierEntry<Mirror> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(PoseStack ms, int index, int y, int x, int width, int height, int mouseX, int mouseY, boolean p_230432_9_, float partialTicks) {
|
||||
super.render(ms, index, y, x, width, height, mouseX, mouseY, p_230432_9_, partialTicks);
|
||||
public void render(GuiGraphics graphics, int index, int y, int x, int width, int height, int mouseX, int mouseY, boolean p_230432_9_, float partialTicks) {
|
||||
super.render(graphics, index, y, x, width, height, mouseX, mouseY, p_230432_9_, partialTicks);
|
||||
|
||||
//draw position inputs
|
||||
for (int i = 0; i < 3; i++) {
|
||||
ScrollInput input = positionInputs.get(i);
|
||||
input.x = left + 49 + 38 * i;
|
||||
input.y = top + 19;
|
||||
input.render(ms, mouseX, mouseY, partialTicks);
|
||||
input.setX(left + 49 + 38 * i);
|
||||
input.setY(top + 19);
|
||||
input.render(graphics, mouseX, mouseY, partialTicks);
|
||||
}
|
||||
|
||||
//draw player position button
|
||||
playerPositionButton.x = left + 163;
|
||||
playerPositionButton.y = top + 19;
|
||||
playerPositionButton.render(ms, mouseX, mouseY, partialTicks);
|
||||
playerPositionButton.setX(left + 163);
|
||||
playerPositionButton.setY(top + 19);
|
||||
playerPositionButton.render(graphics, mouseX, mouseY, partialTicks);
|
||||
|
||||
//draw toggle offset button
|
||||
toggleOffsetButton.x = left + 183;
|
||||
toggleOffsetButton.y = top + 19;
|
||||
toggleOffsetButton.render(ms, mouseX, mouseY, partialTicks);
|
||||
toggleOffsetButton.setX(left + 183);
|
||||
toggleOffsetButton.setY(top + 19);
|
||||
toggleOffsetButton.render(graphics, mouseX, mouseY, partialTicks);
|
||||
|
||||
//draw axis buttons
|
||||
for (int i = 0; i < 3; i++) {
|
||||
IconButton button = axisButtons.get(i);
|
||||
button.x = left + 49 + 18 * i;
|
||||
button.y = top + 41;
|
||||
button.render(ms, mouseX, mouseY, partialTicks);
|
||||
button.setX(left + 49 + 18 * i);
|
||||
button.setY(top + 41);
|
||||
button.render(graphics, mouseX, mouseY, partialTicks);
|
||||
}
|
||||
|
||||
//draw radius input
|
||||
radiusInput.x = left + 134;
|
||||
radiusInput.y = top + 41;
|
||||
radiusInput.render(ms, mouseX, mouseY, partialTicks);
|
||||
radiusInput.setX(left + 134);
|
||||
radiusInput.setY(top + 41);
|
||||
radiusInput.render(graphics, mouseX, mouseY, partialTicks);
|
||||
|
||||
//draw show lines button
|
||||
showLinesButton.x = left + 163;
|
||||
showLinesButton.y = top + 41;
|
||||
showLinesButton.render(ms, mouseX, mouseY, partialTicks);
|
||||
|
||||
showLinesButton.setX(left + 163);
|
||||
showLinesButton.setY(top + 41);
|
||||
showLinesButton.render(graphics, mouseX, mouseY, partialTicks);
|
||||
|
||||
//draw show areas button
|
||||
showAreasButton.x = left + 183;
|
||||
showAreasButton.y = top + 41;
|
||||
showAreasButton.render(ms, mouseX, mouseY, partialTicks);
|
||||
showAreasButton.setX(left + 183);
|
||||
showAreasButton.setY(top + 41);
|
||||
showAreasButton.render(graphics, mouseX, mouseY, partialTicks);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package nl.requios.effortlessbuilding.gui.buildmodifier;
|
||||
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiGraphics;
|
||||
import net.minecraft.client.gui.components.Button;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
@@ -152,7 +152,7 @@ public class ModifiersScreen extends AbstractSimiScreen {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void renderWindow(PoseStack ms, int mouseX, int mouseY, float partialTicks) {
|
||||
protected void renderWindow(GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.mojang.blaze3d.systems.RenderSystem;
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.Font;
|
||||
import net.minecraft.client.gui.GuiGraphics;
|
||||
import net.minecraft.client.gui.components.ObjectSelectionList;
|
||||
import net.minecraft.client.gui.components.events.GuiEventListener;
|
||||
import net.minecraft.network.chat.Component;
|
||||
@@ -30,18 +31,18 @@ public class ModifiersScreenList extends ObjectSelectionList<ModifiersScreenList
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(PoseStack ms, int mouseX, int mouseY, float partialTicks) {
|
||||
public void render(GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) {
|
||||
Color c = new Color(0x60_000000);
|
||||
UIRenderHelper.angledGradient(ms, 90, x0 + width / 2, y0, width, 5, c, Color.TRANSPARENT_BLACK);
|
||||
UIRenderHelper.angledGradient(ms, -90, x0 + width / 2, y1, width, 5, c, Color.TRANSPARENT_BLACK);
|
||||
UIRenderHelper.angledGradient(ms, 0, x0, y0 + height / 2, height, 5, c, Color.TRANSPARENT_BLACK);
|
||||
UIRenderHelper.angledGradient(ms, 180, x1, y0 + height / 2, height, 5, c, Color.TRANSPARENT_BLACK);
|
||||
UIRenderHelper.angledGradient(graphics, 90, x0 + width / 2, y0, width, 5, c, Color.TRANSPARENT_BLACK);
|
||||
UIRenderHelper.angledGradient(graphics, -90, x0 + width / 2, y1, width, 5, c, Color.TRANSPARENT_BLACK);
|
||||
UIRenderHelper.angledGradient(graphics, 0, x0, y0 + height / 2, height, 5, c, Color.TRANSPARENT_BLACK);
|
||||
UIRenderHelper.angledGradient(graphics, 180, x1, y0 + height / 2, height, 5, c, Color.TRANSPARENT_BLACK);
|
||||
|
||||
super.render(ms, mouseX, mouseY, partialTicks);
|
||||
super.render(graphics, mouseX, mouseY, partialTicks);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void renderList(PoseStack p_239228_, int p_239229_, int p_239230_, float p_239231_) {
|
||||
protected void renderList(GuiGraphics graphics, int p_239229_, int p_239230_, float p_239231_) {
|
||||
Window window = minecraft.getWindow();
|
||||
double d0 = window.getGuiScale();
|
||||
RenderSystem.enableScissor((int) (this.x0 * d0), (int) (window.getHeight() - (this.y1 * d0)), (int) (this.width * d0), (int) (this.height * d0));
|
||||
@@ -49,11 +50,11 @@ public class ModifiersScreenList extends ObjectSelectionList<ModifiersScreenList
|
||||
RenderSystem.disableScissor();
|
||||
}
|
||||
|
||||
public void renderWindowForeground(PoseStack ms, int mouseX, int mouseY, float partialTicks) {
|
||||
renderListForeground(ms, mouseX, mouseY, partialTicks);
|
||||
public void renderWindowForeground(GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) {
|
||||
renderListForeground(graphics, mouseX, mouseY, partialTicks);
|
||||
}
|
||||
|
||||
protected void renderListForeground(PoseStack pPoseStack, int pMouseX, int pMouseY, float pPartialTick) {
|
||||
protected void renderListForeground(GuiGraphics graphics, int pMouseX, int pMouseY, float pPartialTick) {
|
||||
int i = this.getRowLeft();
|
||||
int j = this.getRowWidth();
|
||||
int k = this.itemHeight - 4;
|
||||
@@ -63,14 +64,14 @@ public class ModifiersScreenList extends ObjectSelectionList<ModifiersScreenList
|
||||
int j1 = this.getRowTop(i1);
|
||||
int k1 = j1 + itemHeight;
|
||||
if (k1 >= this.y0 && j1 <= this.y1) {
|
||||
renderItemForeground(pPoseStack, pMouseX, pMouseY, pPartialTick, i1, i, j1, j, k);
|
||||
renderItemForeground(graphics, pMouseX, pMouseY, pPartialTick, i1, i, j1, j, k);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void renderItemForeground(PoseStack pPoseStack, int pMouseX, int pMouseY, float pPartialTick, int pIndex, int pLeft, int pTop, int pWidth, int pHeight) {
|
||||
protected void renderItemForeground(GuiGraphics graphics, int pMouseX, int pMouseY, float pPartialTick, int pIndex, int pLeft, int pTop, int pWidth, int pHeight) {
|
||||
Entry e = this.getEntry(pIndex);
|
||||
e.renderForeground(pPoseStack, pIndex, pTop, pLeft, pWidth, pHeight, pMouseX, pMouseY, Objects.equals(this.getHovered(), e), pPartialTick);
|
||||
e.renderForeground(graphics, pIndex, pTop, pLeft, pWidth, pHeight, pMouseX, pMouseY, Objects.equals(this.getHovered(), e), pPartialTick);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -146,14 +147,14 @@ public class ModifiersScreenList extends ObjectSelectionList<ModifiersScreenList
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(PoseStack ms, int index, int y, int x, int width, int height, int mouseX, int mouseY, boolean p_230432_9_, float partialTicks) {
|
||||
public void render(GuiGraphics graphics, int index, int y, int x, int width, int height, int mouseX, int mouseY, boolean p_230432_9_, float partialTicks) {
|
||||
|
||||
// UIRenderHelper.streak(ms, 0, x - 10, y + height / 2, height - 6, width, 0xdd_000000);
|
||||
// UIRenderHelper.streak(ms, 180, x + (int) (width * 1.35f) + 10, y + height / 2, height - 6, width / 8 * 7, 0xdd_000000);
|
||||
|
||||
}
|
||||
|
||||
public void renderForeground(PoseStack ms, int index, int y, int x, int width, int height, int mouseX, int mouseY, boolean p_230432_9_, float partialTicks) {
|
||||
public void renderForeground(GuiGraphics graphics, int index, int y, int x, int width, int height, int mouseX, int mouseY, boolean p_230432_9_, float partialTicks) {
|
||||
|
||||
for (var listener : listeners) {
|
||||
if (listener instanceof AbstractSimiWidget simiWidget && simiWidget.isHoveredOrFocused()
|
||||
@@ -163,7 +164,7 @@ public class ModifiersScreenList extends ObjectSelectionList<ModifiersScreenList
|
||||
continue;
|
||||
int ttx = simiWidget.lockedTooltipX == -1 ? mouseX : simiWidget.lockedTooltipX + simiWidget.x;
|
||||
int tty = simiWidget.lockedTooltipY == -1 ? mouseY : simiWidget.lockedTooltipY + simiWidget.y;
|
||||
screen.renderComponentTooltip(ms, tooltip, ttx, tty);
|
||||
screen.renderComponentTooltip(graphics, tooltip, ttx, tty);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package nl.requios.effortlessbuilding.gui.buildmodifier;
|
||||
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiGraphics;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.world.phys.Vec3;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
@@ -142,51 +143,51 @@ public class RadialMirrorEntry extends BaseModifierEntry<RadialMirror> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(PoseStack ms, int index, int y, int x, int width, int height, int mouseX, int mouseY, boolean p_230432_9_, float partialTicks) {
|
||||
super.render(ms, index, y, x, width, height, mouseX, mouseY, p_230432_9_, partialTicks);
|
||||
public void render(GuiGraphics graphics, int index, int y, int x, int width, int height, int mouseX, int mouseY, boolean p_230432_9_, float partialTicks) {
|
||||
super.render(graphics, index, y, x, width, height, mouseX, mouseY, p_230432_9_, partialTicks);
|
||||
|
||||
//draw position inputs
|
||||
for (int i = 0; i < 3; i++) {
|
||||
ScrollInput input = positionInputs.get(i);
|
||||
input.x = left + 49 + 38 * i;
|
||||
input.y = top + 19;
|
||||
input.render(ms, mouseX, mouseY, partialTicks);
|
||||
input.setX(left + 49 + 38 * i);
|
||||
input.setY(top + 19);
|
||||
input.render(graphics, mouseX, mouseY, partialTicks);
|
||||
}
|
||||
|
||||
//draw player position button
|
||||
playerPositionButton.x = left + 163;
|
||||
playerPositionButton.y = top + 19;
|
||||
playerPositionButton.render(ms, mouseX, mouseY, partialTicks);
|
||||
playerPositionButton.setX(left + 163);
|
||||
playerPositionButton.setY(top + 19);
|
||||
playerPositionButton.render(graphics, mouseX, mouseY, partialTicks);
|
||||
|
||||
//draw toggle offset button
|
||||
toggleOffsetButton.x = left + 183;
|
||||
toggleOffsetButton.y = top + 19;
|
||||
toggleOffsetButton.render(ms, mouseX, mouseY, partialTicks);
|
||||
toggleOffsetButton.setX(left + 183);
|
||||
toggleOffsetButton.setY(top + 19);
|
||||
toggleOffsetButton.render(graphics, mouseX, mouseY, partialTicks);
|
||||
|
||||
//draw slices input
|
||||
slicesInput.x = left + 49;
|
||||
slicesInput.y = top + 41;
|
||||
slicesInput.render(ms, mouseX, mouseY, partialTicks);
|
||||
slicesInput.setX(left + 49);
|
||||
slicesInput.setY(top + 41);
|
||||
slicesInput.render(graphics, mouseX, mouseY, partialTicks);
|
||||
|
||||
//draw alternate button
|
||||
alternateButton.x = left + 78;
|
||||
alternateButton.y = top + 41;
|
||||
alternateButton.render(ms, mouseX, mouseY, partialTicks);
|
||||
alternateButton.setX(left + 78);
|
||||
alternateButton.setY(top + 41);
|
||||
alternateButton.render(graphics, mouseX, mouseY, partialTicks);
|
||||
|
||||
//draw radius input
|
||||
radiusInput.x = left + 134;
|
||||
radiusInput.y = top + 41;
|
||||
radiusInput.render(ms, mouseX, mouseY, partialTicks);
|
||||
radiusInput.setX(left + 134);
|
||||
radiusInput.setY(top + 41);
|
||||
radiusInput.render(graphics, mouseX, mouseY, partialTicks);
|
||||
|
||||
//draw show lines button
|
||||
showLinesButton.x = left + 163;
|
||||
showLinesButton.y = top + 41;
|
||||
showLinesButton.render(ms, mouseX, mouseY, partialTicks);
|
||||
showLinesButton.setX(left + 163);
|
||||
showLinesButton.setY(top + 41);
|
||||
showLinesButton.render(graphics, mouseX, mouseY, partialTicks);
|
||||
|
||||
//draw show areas button
|
||||
showAreasButton.x = left + 183;
|
||||
showAreasButton.y = top + 41;
|
||||
showAreasButton.render(ms, mouseX, mouseY, partialTicks);
|
||||
showAreasButton.setX(left + 183);
|
||||
showAreasButton.setY(top + 41);
|
||||
showAreasButton.render(graphics, mouseX, mouseY, partialTicks);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -2,6 +2,7 @@ package nl.requios.effortlessbuilding.gui.elements;
|
||||
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiGraphics;
|
||||
import net.minecraft.client.gui.components.Button;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraftforge.client.gui.ScreenUtils;
|
||||
@@ -26,12 +27,12 @@ public class GuiCheckBoxFixed extends Button {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderButton(PoseStack ms, int mouseX, int mouseY, float partial) {
|
||||
public void renderWidget(GuiGraphics graphics, int mouseX, int mouseY, float partial) {
|
||||
if (this.visible) {
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
this.isHovered = mouseX >= this.x && mouseY >= this.y && mouseX < this.x + this.boxWidth && mouseY < this.y + this.height;
|
||||
ScreenUtils.blitWithBorder(ms, WIDGETS_LOCATION, this.x, this.y, 0, 46, this.boxWidth, this.height, 200, 20, 2, 3, 2, 2, this.getBlitOffset());
|
||||
this.renderBg(ms, mc, mouseX, mouseY);
|
||||
this.isHovered = mouseX >= this.getX() && mouseY >= this.getY() && mouseX < this.getX() + this.boxWidth && mouseY < this.getY() + this.height;
|
||||
graphics.blitWithBorder(WIDGETS_LOCATION, this.getX(), this.getY(), 0, 46, this.boxWidth, this.height, 200, 20, 2, 3, 2, 2);
|
||||
this.renderBg(graphics, mc, mouseX, mouseY);
|
||||
int color = 14737632;
|
||||
|
||||
if (packedFGColor != 0) {
|
||||
@@ -41,9 +42,9 @@ public class GuiCheckBoxFixed extends Button {
|
||||
}
|
||||
|
||||
if (this.isChecked)
|
||||
drawCenteredString(ms, mc.font, "x", this.x + this.boxWidth / 2 + 1, this.y + 1, 14737632);
|
||||
graphics.drawCenteredString(mc.font, "x", this.getX() + this.boxWidth / 2 + 1, this.getY() + 1, 14737632);
|
||||
|
||||
drawString(ms, mc.font, getMessage(), this.x + this.boxWidth + 2, this.y + 2, color);
|
||||
graphics.drawString(mc.font, getMessage(), this.getX() + this.boxWidth + 2, this.getY() + 2, color);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,8 @@ package nl.requios.effortlessbuilding.gui.elements;
|
||||
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiGraphics;
|
||||
import net.minecraft.client.gui.screens.Screen;
|
||||
import net.minecraft.client.gui.components.Button;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
@@ -28,7 +30,7 @@ public class GuiIconButton extends Button {
|
||||
}
|
||||
|
||||
public GuiIconButton(int x, int y, int width, int height, int iconX, int iconY, int iconWidth, int iconHeight, int iconAltX, int iconAltY, ResourceLocation resourceLocation, Button.OnPress onPress) {
|
||||
super(x, y, width, height, Component.empty(), onPress);
|
||||
super(x, y, width, height, Component.empty(), onPress, DEFAULT_NARRATION);
|
||||
this.iconX = iconX;
|
||||
this.iconY = iconY;
|
||||
this.iconWidth = iconWidth;
|
||||
@@ -51,11 +53,11 @@ public class GuiIconButton extends Button {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(PoseStack ms, int mouseX, int mouseY, float partialTicks) {
|
||||
super.render(ms, mouseX, mouseY, partialTicks);
|
||||
public void render(GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) {
|
||||
super.render(graphics, mouseX, mouseY, partialTicks);
|
||||
if (this.visible) {
|
||||
this.isHovered = mouseX >= this.x && mouseY >= this.y && mouseX < this.x + this.width && mouseY < this.y + this.height;
|
||||
RenderSystem.setShaderTexture(0, this.resourceLocation);
|
||||
this.isHovered = mouseX >= this.getX() && mouseY >= this.getY() && mouseX < this.getX() + this.width && mouseY < this.getY() + this.height;
|
||||
|
||||
int currentIconX = this.iconX;
|
||||
int currentIconY = this.iconY;
|
||||
|
||||
@@ -65,15 +67,15 @@ public class GuiIconButton extends Button {
|
||||
}
|
||||
|
||||
//Draws a textured rectangle at the current z-value. Used to be drawTexturedModalRect in Gui.
|
||||
this.blit(ms, this.x, this.y, currentIconX, currentIconY, this.iconWidth, this.iconHeight);
|
||||
graphics.blit(this.resourceLocation, this.getX(), this.getY(), currentIconX, currentIconY, this.iconWidth, this.iconHeight);
|
||||
}
|
||||
}
|
||||
|
||||
public void drawTooltip(PoseStack ms, Screen screen, int mouseX, int mouseY) {
|
||||
boolean flag = mouseX >= x && mouseX < x + width && mouseY >= y && mouseY < y + height;
|
||||
public void drawTooltip(GuiGraphics graphics, Screen screen, int mouseX, int mouseY) {
|
||||
boolean flag = mouseX >= getX() && mouseX < getY() + width && mouseY >= getY() && mouseY < getY() + height;
|
||||
|
||||
if (flag) {
|
||||
screen.renderComponentTooltip(ms, tooltip, mouseX - 10, mouseY + 25);
|
||||
graphics.renderComponentTooltip(Minecraft.getInstance().font, tooltip, mouseX - 10, mouseY + 25);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.mojang.blaze3d.systems.RenderSystem;
|
||||
import net.minecraft.MethodsReturnNonnullByDefault;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.Font;
|
||||
import net.minecraft.client.gui.GuiGraphics;
|
||||
import net.minecraft.client.gui.components.Renderable;
|
||||
import net.minecraft.client.gui.components.events.GuiEventListener;
|
||||
import net.minecraft.client.gui.screens.Screen;
|
||||
@@ -72,7 +73,7 @@ public class GuiScrollPane extends SlotGui {
|
||||
|
||||
//Removed background
|
||||
@Override
|
||||
public void render(PoseStack ms, int mouseXIn, int mouseYIn, float partialTicks) {
|
||||
public void render(GuiGraphics graphics, int mouseXIn, int mouseYIn, float partialTicks) {
|
||||
if (this.visible) {
|
||||
this.mouseX = mouseXIn;
|
||||
this.mouseY = mouseYIn;
|
||||
@@ -91,7 +92,7 @@ public class GuiScrollPane extends SlotGui {
|
||||
}
|
||||
|
||||
//All entries
|
||||
this.renderList(ms, insideLeft, insideTop, mouseXIn, mouseYIn, partialTicks);
|
||||
this.renderList(graphics, insideLeft, insideTop, mouseXIn, mouseYIn, partialTicks);
|
||||
RenderSystem.disableDepthTest();
|
||||
|
||||
//Dirt overlays on top and bottom
|
||||
@@ -100,7 +101,7 @@ public class GuiScrollPane extends SlotGui {
|
||||
|
||||
RenderSystem.enableBlend();
|
||||
RenderSystem.blendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ZERO, GlStateManager.DestFactor.ONE);
|
||||
RenderSystem.disableTexture();
|
||||
// RenderSystem.disableTexture();
|
||||
|
||||
//top
|
||||
// bufferbuilder.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);
|
||||
@@ -149,7 +150,7 @@ public class GuiScrollPane extends SlotGui {
|
||||
}
|
||||
|
||||
//this.renderDecorations(mouseXIn, mouseYIn);
|
||||
RenderSystem.enableTexture();
|
||||
// RenderSystem.enableTexture();
|
||||
RenderSystem.disableBlend();
|
||||
}
|
||||
}
|
||||
@@ -353,7 +354,7 @@ public class GuiScrollPane extends SlotGui {
|
||||
if (this.renderSelection && this.isSelectedItem(i)) {
|
||||
int i1 = this.x0 + this.width / 2 - this.getRowWidth() / 2;
|
||||
int j1 = this.x0 + this.width / 2 + this.getRowWidth() / 2;
|
||||
RenderSystem.disableTexture();
|
||||
// RenderSystem.disableTexture();
|
||||
float f = this.isFocused() ? 1.0F : 0.5F;
|
||||
RenderSystem.setShaderColor(f, f, f, 1.0F);
|
||||
bufferbuilder.begin(VertexFormat.Mode.QUADS, DefaultVertexFormat.POSITION);
|
||||
@@ -369,7 +370,7 @@ public class GuiScrollPane extends SlotGui {
|
||||
bufferbuilder.vertex(j1 - 1, y - 1, 0.0D).endVertex();
|
||||
bufferbuilder.vertex(i1 + 1, y - 1, 0.0D).endVertex();
|
||||
tessellator.end();
|
||||
RenderSystem.enableTexture();
|
||||
// RenderSystem.enableTexture();
|
||||
}
|
||||
|
||||
this.renderItem(ms, i, insideLeft, y, entryHeight2, mouseXIn, mouseYIn, partialTicks);
|
||||
|
||||
@@ -3,6 +3,7 @@ package nl.requios.effortlessbuilding.gui.elements;
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import net.minecraft.ChatFormatting;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiGraphics;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import nl.requios.effortlessbuilding.create.foundation.gui.widget.Label;
|
||||
import nl.requios.effortlessbuilding.create.foundation.gui.widget.ScrollInput;
|
||||
@@ -30,12 +31,12 @@ public class LabeledScrollInput extends ScrollInput {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderButton(@NotNull PoseStack ms, int mouseX, int mouseY, float partialTicks) {
|
||||
super.renderButton(ms, mouseX, mouseY, partialTicks);
|
||||
public void renderButton(GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) {
|
||||
super.renderButton(graphics, mouseX, mouseY, partialTicks);
|
||||
|
||||
label.x = x + width / 2 - Minecraft.getInstance().font.width(label.text) / 2;
|
||||
label.y = y + height / 2 - Minecraft.getInstance().font.lineHeight / 2;
|
||||
label.renderButton(ms, mouseX, mouseY, partialTicks);
|
||||
label.setX(getX() + width / 2 - Minecraft.getInstance().font.width(label.text) / 2);
|
||||
label.setY(getY() + height / 2 - Minecraft.getInstance().font.lineHeight / 2);
|
||||
label.renderWidget(graphics, mouseX, mouseY, partialTicks);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -225,7 +225,7 @@ public abstract class SlotGui extends AbstractContainerEventHandler implements R
|
||||
if (this.renderSelection && this.isSelectedItem(j)) {
|
||||
int i1 = this.x0 + this.width / 2 - this.getRowWidth() / 2;
|
||||
int j1 = this.x0 + this.width / 2 + this.getRowWidth() / 2;
|
||||
RenderSystem.disableTexture();
|
||||
// RenderSystem.disableTexture();
|
||||
float f = this.isFocused() ? 1.0F : 0.5F;
|
||||
RenderSystem.setShaderColor(f, f, f, 1.0F);
|
||||
bufferbuilder.begin(VertexFormat.Mode.QUADS, DefaultVertexFormat.POSITION);
|
||||
@@ -241,7 +241,7 @@ public abstract class SlotGui extends AbstractContainerEventHandler implements R
|
||||
bufferbuilder.vertex(j1 - 1, k - 1, 0.0D).endVertex();
|
||||
bufferbuilder.vertex(i1 + 1, k - 1, 0.0D).endVertex();
|
||||
tessellator.end();
|
||||
RenderSystem.enableTexture();
|
||||
// RenderSystem.enableTexture();
|
||||
}
|
||||
|
||||
this.renderItem(ms, j, p_renderList_1_, k, l, p_renderList_3_, p_renderList_4_, p_renderList_5_);
|
||||
@@ -249,9 +249,9 @@ public abstract class SlotGui extends AbstractContainerEventHandler implements R
|
||||
|
||||
}
|
||||
|
||||
protected boolean isFocused() {
|
||||
return false;
|
||||
}
|
||||
// protected boolean isFocused() {
|
||||
// return false;
|
||||
// }
|
||||
|
||||
protected int getScrollbarPosition() {
|
||||
return this.width / 2 + 124;
|
||||
|
||||
Reference in New Issue
Block a user