Skip to content
Open
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
601 changes: 0 additions & 601 deletions src/main/java/com/gregtechceu/gtceu/api/gui/GuiTextures.java

This file was deleted.

27 changes: 0 additions & 27 deletions src/main/java/com/gregtechceu/gtceu/api/gui/SteamTexture.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import com.gregtechceu.gtceu.GTCEu;
import com.gregtechceu.gtceu.api.block.MetaMachineBlock;
import com.gregtechceu.gtceu.api.gui.GuiTextures;
import com.gregtechceu.gtceu.api.machine.MultiblockMachineDefinition;
import com.gregtechceu.gtceu.api.machine.multiblock.MultiblockControllerMachine;
import com.gregtechceu.gtceu.api.pattern.BlockPattern;
Expand Down Expand Up @@ -74,8 +73,8 @@ public class PatternPreviewWidget extends WidgetGroup {
private final List<SimplePredicate> predicates;
private int index;
public int layer;
private com.lowdragmc.lowdraglib.gui.widget.SlotWidget[] slotWidgets;
private com.lowdragmc.lowdraglib.gui.widget.SlotWidget[] candidates;
private SlotWidget[] slotWidgets;
private SlotWidget[] candidates;

protected PatternPreviewWidget(MultiblockMachineDefinition controllerDefinition) {
super(0, 0, 160, 160);
Expand Down Expand Up @@ -149,7 +148,6 @@ public void renderBlockOverLay(WorldSceneRenderer renderer) {

scrollableWidgetGroup = new DraggableScrollableWidgetGroup(3, 132, 154, 22)
.setXScrollBarHeight(4)
.setXBarStyle(GuiTextures.SLIDER_BACKGROUND, GuiTextures.BUTTON)
.setScrollable(true)
.setDraggable(true);
scrollableWidgetGroup.setScrollWheelDirection(DraggableScrollableWidgetGroup.ScrollWheelDirection.HORIZONTAL);
Expand Down Expand Up @@ -242,11 +240,11 @@ public void setPage(int index) {
MBPattern pattern = patterns[index];
setupScene(pattern);
if (slotWidgets != null) {
for (com.lowdragmc.lowdraglib.gui.widget.SlotWidget slotWidget : slotWidgets) {
for (SlotWidget slotWidget : slotWidgets) {
scrollableWidgetGroup.removeWidget(slotWidget);
}
}
slotWidgets = new com.lowdragmc.lowdraglib.gui.widget.SlotWidget[Math.min(pattern.parts.size(), 18)];
slotWidgets = new SlotWidget[Math.min(pattern.parts.size(), 18)];

var itemHandler = new CycleItemEntryHandler(
pattern.parts.stream().map(l -> (ItemEntryList) new ItemStackList(l)).toList());
Expand Down Expand Up @@ -290,7 +288,7 @@ private void onPosSelected(BlockPos pos, Direction facing) {
predicates.addAll(predicate.limited);
predicates.removeIf(p -> p == null || p.candidates == null); // why it happens?
if (candidates != null) {
for (com.lowdragmc.lowdraglib.gui.widget.SlotWidget candidate : candidates) {
for (SlotWidget candidate : candidates) {
removeWidget(candidate);
}
}
Expand All @@ -303,13 +301,13 @@ private void onPosSelected(BlockPos pos, Direction facing) {
predicateTips.add(simplePredicate.getToolTips(predicate));
}
}
candidates = new com.lowdragmc.lowdraglib.gui.widget.SlotWidget[candidateStacks.size()];
candidates = new SlotWidget[candidateStacks.size()];
var itemHandler = new CycleItemEntryHandler(
candidateStacks.stream().map(l -> (ItemEntryList) new ItemStackList(l)).toList());
int maxCol = (160 - (((slotWidgets.length - 1) / 9 + 1) * 18) - 35) % 18;
for (int i = 0; i < candidateStacks.size(); i++) {
int finalI = i;
candidates[i] = new com.lowdragmc.lowdraglib.gui.widget.SlotWidget()
candidates[i] = new SlotWidget()
.setIngredientIO(IngredientIO.INPUT)
.setBackgroundTexture(new ColorRectTexture(0x4fffffff))
.setOnAddedTooltips((slot, list) -> list.addAll(predicateTips.get(finalI)));
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@
import com.gregtechceu.gtceu.common.mui.GTGuiTextures;
import com.gregtechceu.gtceu.common.mui.GTMuiWidgets;

import brachy.modularui.drawable.ItemDrawable;
import brachy.modularui.drawable.UITexture;
import brachy.modularui.screen.UISettings;
import brachy.modularui.value.sync.PanelSyncManager;
import brachy.modularui.widget.ParentWidget;
import brachy.modularui.widgets.ButtonWidget;
import brachy.modularui.widgets.layout.Flow;
import lombok.Setter;
import lombok.experimental.Accessors;
Expand Down Expand Up @@ -99,6 +101,14 @@ public MachineUIPanel build(PanelSyncManager syncManager, UISettings settings) {
}
}

for (var cover : machine.getCoverContainer().getCovers()) {
attachLeft.child(new ButtonWidget<>()
.overlay(new ItemDrawable(cover.getAttachItem()))
.onMousePressed((context, button) -> {
return true;
}));
}

return panel;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@

import brachy.modularui.api.drawable.Text;
import brachy.modularui.drawable.UITexture;
import brachy.modularui.drawable.progress.ProgressDrawable;
import brachy.modularui.factory.PosGuiData;
import brachy.modularui.screen.UISettings;
import brachy.modularui.value.sync.DoubleSyncValue;
Expand Down Expand Up @@ -332,10 +333,9 @@ public void buildMainUI(ParentWidget<?> mainWidget, PosGuiData guiData, PanelSyn
.size(14, 54))
.child(new ProgressWidget()
.texture(progressTexture,
GTGuiTextures.PROGRESS_BAR_BOILER_HEAT, 54)
GTGuiTextures.PROGRESS_BAR_BOILER_HEAT, ProgressDrawable.Direction.UP)
.size(14, 54)
.value(tempPercentage)
.direction(ProgressWidget.Direction.UP)
.tooltipAutoUpdate(true)
.tooltipBuilder((r) -> r.addLine(Text
.lang("gtceu.fluid.temperature", getCurrentTemperature())))));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -350,12 +350,13 @@ public Builder setCapabilityContentBuilder(RecipeCapability<?> cap, CapabilityCo

public GTRecipeTypeUILayout build() {
var progressWidgetSupplier = this.progressWidgetSupplier;
if (progressWidgetSupplier == null) progressWidgetSupplier = (l, v, m) -> new ProgressWidget()
.value(v)
.name("progressBar")
.texture(progressBar.get(m), progressBar.progressSize())
.size(progressBar.progressSize())
.direction(progressBar.fillDirection());
if (progressWidgetSupplier == null) {
progressWidgetSupplier = (l, v, m) -> new ProgressWidget()
.value(v)
.name("progressBar")
.texture(progressBar.get(m), progressBar.fillDirection())
.size(progressBar.progressSize());
}

var layout = new GTRecipeTypeUILayout(recipeType, capabilityInfo, recipeUIModifiers, progressWidgetSupplier,
customUIBuilder);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import com.gregtechceu.gtceu.api.mui.SteamTextureSet;

import brachy.modularui.drawable.UITexture;
import brachy.modularui.widgets.ProgressWidget;
import brachy.modularui.drawable.progress.ProgressDrawable;
import lombok.Getter;
import lombok.experimental.Accessors;
import org.jetbrains.annotations.Nullable;
Expand All @@ -13,24 +13,24 @@
public class ProgressBarTextureSet extends SteamTextureSet {

private final int progressSize;
private final ProgressWidget.Direction fillDirection;
private final ProgressDrawable.Direction fillDirection;

public ProgressBarTextureSet(int progressSize, ProgressWidget.Direction fillDirection, UITexture main,
public ProgressBarTextureSet(int progressSize, ProgressDrawable.Direction fillDirection, UITexture main,
@Nullable UITexture bronze, @Nullable UITexture steel) {
super(main, bronze, steel);
this.progressSize = progressSize;
this.fillDirection = fillDirection;
}

public ProgressBarTextureSet(UITexture main, UITexture bronze, UITexture steel) {
this(20, ProgressWidget.Direction.RIGHT, main, bronze, steel);
this(20, ProgressDrawable.Direction.RIGHT, main, bronze, steel);
}

public ProgressBarTextureSet(UITexture main) {
this(20, ProgressWidget.Direction.RIGHT, main);
this(20, ProgressDrawable.Direction.RIGHT, main);
}

public ProgressBarTextureSet(int progressSize, ProgressWidget.Direction fillDirection, UITexture main) {
this(20, fillDirection, main, null, null);
public ProgressBarTextureSet(int progressSize, ProgressDrawable.Direction fillDirection, UITexture main) {
this(progressSize, fillDirection, main, null, null);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
import com.gregtechceu.gtceu.api.item.IGTTool;
import com.gregtechceu.gtceu.api.item.component.IDurabilityBar;
import com.gregtechceu.gtceu.api.item.tool.ToolHelper;
import com.gregtechceu.gtceu.client.util.DrawUtil;
import com.gregtechceu.gtceu.core.mixins.client.GuiGraphicsAccessor;

import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.util.FastColor;
import net.minecraft.world.item.ItemStack;

import brachy.modularui.drawable.GuiDraw;
import it.unimi.dsi.fastutil.ints.IntIntPair;

public final class ToolChargeBarRenderer {
Expand Down Expand Up @@ -38,9 +38,10 @@ public static void render(GuiGraphics graphics, int level, int xPosition, int yP

int x = xPosition + 2;
int y = yPosition + 13 - offset;
graphics.fill(RenderType.gui(), x, y, x + 13, y + (shadow ? 2 : 1), 190, colorShadow);
DrawUtil.fillHorizontalGradient(graphics, RenderType.gui(), x, y, x + level, y + 1, left, right, 190);
// graphics.fill(RenderType.guiOverlay(), x + BAR_W, y, x + BAR_W - level, y - 1, colorBG);

GuiDraw.drawRect(graphics, x, y, 13, shadow ? 2 : 1, colorShadow);
GuiDraw.drawHorizontalGradientRect(graphics, x, y, level, 1, left, right);
((GuiGraphicsAccessor) graphics).callFlushIfUnmanaged();
}

public static void renderBarsTool(GuiGraphics graphics, IGTTool tool, ItemStack stack, int xPosition,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.gregtechceu.gtceu.client.renderer.item.decorator;

import com.gregtechceu.gtceu.api.gui.GuiTextures;
import com.gregtechceu.gtceu.common.mui.GTGuiTextures;

import net.minecraft.client.gui.Font;
import net.minecraft.client.gui.GuiGraphics;
Expand All @@ -9,6 +9,7 @@
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.client.IItemDecorator;

import brachy.modularui.drawable.GuiDraw;
import com.mojang.blaze3d.systems.RenderSystem;

import static com.gregtechceu.gtceu.common.block.LampBlock.isBloomEnabled;
Expand Down Expand Up @@ -42,11 +43,17 @@ public boolean render(GuiGraphics graphics, Font font, ItemStack stack, int xPos

RenderSystem.disableDepthTest();
if (overlayType.noBloom()) {
GuiTextures.LAMP_NO_BLOOM.draw(graphics, 0, 0, xPosition, yPosition, 16, 16);
var texture = GTGuiTextures.LAMP_NO_BLOOM;
GuiDraw.drawTexture(graphics.pose().last().pose(), texture.location, xPosition, yPosition, xPosition + 16,
yPosition + 16, texture.u0, texture.v0,
texture.u1, texture.v1);
}

if (overlayType.noLight()) {
GuiTextures.LAMP_NO_LIGHT.draw(graphics, 0, 0, xPosition, yPosition, 16, 16);
var texture = GTGuiTextures.LAMP_NO_LIGHT;
GuiDraw.drawTexture(graphics.pose().last().pose(), texture.location, xPosition, yPosition, xPosition + 16,
yPosition + 16, texture.u0, texture.v0,
texture.u1, texture.v1);
}
RenderSystem.enableDepthTest();
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
import com.gregtechceu.gtceu.config.ConfigHolder;
import com.gregtechceu.gtceu.utils.GTUtil;

import com.lowdragmc.lowdraglib.gui.util.DrawerHelper;
import com.lowdragmc.lowdraglib.side.fluid.forge.FluidHelperImpl;

import net.minecraft.client.gui.Font;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.world.item.ItemStack;
Expand All @@ -14,6 +11,7 @@
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.capability.IFluidHandlerItem;

import brachy.modularui.drawable.GuiDraw;
import com.mojang.blaze3d.systems.RenderSystem;
import com.mojang.blaze3d.vertex.*;
import lombok.Getter;
Expand Down Expand Up @@ -101,13 +99,13 @@ public boolean render(GuiGraphics guiGraphics, Font font, ItemStack itemStack, i
renderedCount < getMaxRenderCount(); index++) {
FluidStack fluidInTank = fluidHandler.getFluidInTank(index);
if (!fluidInTank.isEmpty()) {
DrawerHelper.drawFluidForGui(
GuiDraw.drawFluidTexture(
guiGraphics,
FluidHelperImpl.toFluidStack(fluidInTank),
fluidInTank,
x + OFFSET[renderedCount][0],
y + OFFSET[renderedCount][1],
8.0F,
8.0F);
8.0F, 0);
renderedCount++;
}
}
Expand Down
Loading
Loading