Skip to content

Commit

Permalink
Dynamically change the direction of the arrow in "Manual IO Mode" to …
Browse files Browse the repository at this point in the history
…reflect the direction of the "IO Mode" (GregTechCEu#2491)
  • Loading branch information
Zorbatron authored Jun 22, 2024
1 parent 2811c8e commit 5af02a3
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/main/java/gregtech/api/mui/GTGuiTextures.java
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,9 @@ public static class IDs {
public static final UITexture OREDICT_WAITING = fullImage("textures/gui/widget/ore_filter/waiting.png");
public static final UITexture OREDICT_WARN = fullImage("textures/gui/widget/ore_filter/warn.png");

public static final UITexture[] MANUAL_IO_OVERLAY = slice("textures/gui/overlay/manual_io_overlay.png",
public static final UITexture[] MANUAL_IO_OVERLAY_IN = slice("textures/gui/overlay/manual_io_overlay_in.png",
18, 18 * 3, 18, 18, true);
public static final UITexture[] MANUAL_IO_OVERLAY_OUT = slice("textures/gui/overlay/manual_io_overlay_out.png",
18, 18 * 3, 18, 18, true);
public static final UITexture[] CONVEYOR_MODE_OVERLAY = slice("textures/gui/overlay/conveyor_mode_overlay.png",
18, 18 * 2, 18, 18, true);
Expand Down
11 changes: 10 additions & 1 deletion src/main/java/gregtech/common/covers/CoverConveyor.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@
import codechicken.lib.render.pipeline.IVertexOperation;
import codechicken.lib.vec.Cuboid6;
import codechicken.lib.vec.Matrix4;
import com.cleanroommc.modularui.api.drawable.IDrawable;
import com.cleanroommc.modularui.api.widget.Interactable;
import com.cleanroommc.modularui.drawable.DynamicDrawable;
import com.cleanroommc.modularui.factory.SidedPosGuiData;
import com.cleanroommc.modularui.screen.ModularPanel;
import com.cleanroommc.modularui.utils.Color;
Expand Down Expand Up @@ -571,7 +573,14 @@ protected ParentWidget<Column> createUI(ModularPanel mainPanel, GuiSyncManager g
column.child(new EnumRowBuilder<>(ManualImportExportMode.class)
.value(manualIOmode)
.lang("cover.generic.manual_io")
.overlay(GTGuiTextures.MANUAL_IO_OVERLAY)
.overlay(new IDrawable[] {
new DynamicDrawable(() -> conveyorMode.getValue().isImport() ?
GTGuiTextures.MANUAL_IO_OVERLAY_OUT[0] : GTGuiTextures.MANUAL_IO_OVERLAY_IN[0]),
new DynamicDrawable(() -> conveyorMode.getValue().isImport() ?
GTGuiTextures.MANUAL_IO_OVERLAY_OUT[1] : GTGuiTextures.MANUAL_IO_OVERLAY_IN[1]),
new DynamicDrawable(() -> conveyorMode.getValue().isImport() ?
GTGuiTextures.MANUAL_IO_OVERLAY_OUT[2] : GTGuiTextures.MANUAL_IO_OVERLAY_IN[2])
})
.build());

if (createConveyorModeRow())
Expand Down
11 changes: 10 additions & 1 deletion src/main/java/gregtech/common/covers/CoverPump.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@
import codechicken.lib.render.pipeline.IVertexOperation;
import codechicken.lib.vec.Cuboid6;
import codechicken.lib.vec.Matrix4;
import com.cleanroommc.modularui.api.drawable.IDrawable;
import com.cleanroommc.modularui.api.widget.Interactable;
import com.cleanroommc.modularui.drawable.DynamicDrawable;
import com.cleanroommc.modularui.factory.SidedPosGuiData;
import com.cleanroommc.modularui.screen.ModularPanel;
import com.cleanroommc.modularui.utils.Color;
Expand Down Expand Up @@ -257,7 +259,14 @@ protected ParentWidget<?> createUI(ModularPanel mainPanel, GuiSyncManager syncMa
column.child(new EnumRowBuilder<>(ManualImportExportMode.class)
.value(manualIOmode)
.lang("cover.generic.manual_io")
.overlay(GTGuiTextures.MANUAL_IO_OVERLAY)
.overlay(new IDrawable[] {
new DynamicDrawable(() -> pumpMode.getValue().isImport() ?
GTGuiTextures.MANUAL_IO_OVERLAY_OUT[0] : GTGuiTextures.MANUAL_IO_OVERLAY_IN[0]),
new DynamicDrawable(() -> pumpMode.getValue().isImport() ?
GTGuiTextures.MANUAL_IO_OVERLAY_OUT[1] : GTGuiTextures.MANUAL_IO_OVERLAY_IN[1]),
new DynamicDrawable(() -> pumpMode.getValue().isImport() ?
GTGuiTextures.MANUAL_IO_OVERLAY_OUT[2] : GTGuiTextures.MANUAL_IO_OVERLAY_IN[2])
})
.build());

if (createPumpModeRow())
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 5af02a3

Please sign in to comment.