diff --git a/src/main/java/com/troblecodings/signals/enums/EnumGuiMode.java b/src/main/java/com/troblecodings/signals/enums/EnumGuiMode.java index 7ab9630be..b4aba3925 100644 --- a/src/main/java/com/troblecodings/signals/enums/EnumGuiMode.java +++ b/src/main/java/com/troblecodings/signals/enums/EnumGuiMode.java @@ -15,35 +15,38 @@ public enum EnumGuiMode { 0, 0.5f, 0.5f, 1 }), END(new float[] { 0.9f, 0.2f, 0.9f, 0.8f - }, PathwayModeType.END), PLATFORM((state) -> new UILines(new float[] { + }, PathwayModeType.END, 0), PLATFORM((state) -> new UILines(new float[] { 0, 0.15f, 1, 0.15f - }, 3).setColor(SignalBoxUtil.FREE_COLOR), PathwayModeType.NONE), BUE(new float[] { + }, 3).setColor(SignalBoxUtil.FREE_COLOR), PathwayModeType.NONE, 0), BUE(new float[] { 0.3f, 0, 0.3f, 1, 0.7f, 0, 0.7f, 1 - }), HP(0, true, PathwayModeType.START_END), VP(1, true, PathwayModeType.NONE), - RS(2, true, PathwayModeType.START_END), RA10(3, PathwayModeType.END), - SH2(4, PathwayModeType.NONE), - IN_CONNECTION((_u) -> new UITexture(UISignalBoxTile.INCOMING_ICON), PathwayModeType.START), - OUT_CONNECTION((_u) -> new UITexture(UISignalBoxTile.OUTGOING_ICON), PathwayModeType.END), - ARROW((_u) -> new UITexture(UISignalBoxTile.ARROW_ICON), PathwayModeType.END), - NE1((_u) -> new UITexture(UISignalBoxTile.NE1_ICON), PathwayModeType.START_END), - NE5((_u) -> new UITexture(UISignalBoxTile.NE5_ICON), PathwayModeType.START_END), - ZS3((_u) -> new UITexture(UISignalBoxTile.ZS3_ICON), PathwayModeType.NONE), + }), HP(0, true, PathwayModeType.START_END, 2), VP(1, true, PathwayModeType.NONE, 1), + RS(2, true, PathwayModeType.START_END, 1), RA10(3, PathwayModeType.END, 1), + SH2(4, PathwayModeType.NONE, 1), + IN_CONNECTION((_u) -> new UITexture(UISignalBoxTile.INCOMING_ICON), PathwayModeType.START, 1), + OUT_CONNECTION((_u) -> new UITexture(UISignalBoxTile.OUTGOING_ICON), PathwayModeType.END, 1), + ARROW((_u) -> new UITexture(UISignalBoxTile.ARROW_ICON), PathwayModeType.END, 1), + NE1((_u) -> new UITexture(UISignalBoxTile.NE1_ICON), PathwayModeType.START_END, 1), + NE5((_u) -> new UITexture(UISignalBoxTile.NE5_ICON), PathwayModeType.START_END, 1), + ZS3((_u) -> new UITexture(UISignalBoxTile.ZS3_ICON), PathwayModeType.NONE, 1), TRAIN_NUMBER((_u) -> new UILines(new float[] { 0, 0.5f, 2, 0.5f - }, 6).setColor(GuiSignalBox.TRAIN_NUMBER_BACKGROUND_COLOR), PathwayModeType.NONE); + }, 6).setColor(GuiSignalBox.TRAIN_NUMBER_BACKGROUND_COLOR), PathwayModeType.NONE, 2); /** * Naming */ public final OSSupplier consumer; + public final int translation; private final PathwayModeType type; - private EnumGuiMode(final int id, final PathwayModeType type) { - this((_u) -> new UITexture(UISignalBoxTile.ICON, id * 0.2, 0, id * 0.2 + 0.2, 0.5), type); + private EnumGuiMode(final int id, final PathwayModeType type, final int translation) { + this((_u) -> new UITexture(UISignalBoxTile.ICON, id * 0.2, 0, id * 0.2 + 0.2, 0.5), type, + translation); } - private EnumGuiMode(final int id, final boolean unused, final PathwayModeType type) { + private EnumGuiMode(final int id, final boolean unused, final PathwayModeType type, + final int translation) { this((state) -> { switch (state) { case GREEN: { @@ -76,20 +79,22 @@ private EnumGuiMode(final int id, final boolean unused, final PathwayModeType ty default: return new UITexture(UISignalBoxTile.SIGNALS); } - }, type); + }, type, translation); } private EnumGuiMode(final float[] array) { - this(array, PathwayModeType.NONE); + this(array, PathwayModeType.NONE, 0); } - private EnumGuiMode(final float[] array, final PathwayModeType type) { - this((_u) -> new UILines(array, 2).setColor(SignalBoxUtil.FREE_COLOR), type); + private EnumGuiMode(final float[] array, final PathwayModeType type, final int translation) { + this((_u) -> new UILines(array, 2).setColor(SignalBoxUtil.FREE_COLOR), type, translation); } - private EnumGuiMode(final OSSupplier consumer, final PathwayModeType type) { + private EnumGuiMode(final OSSupplier consumer, final PathwayModeType type, + final int translation) { this.consumer = consumer; this.type = type; + this.translation = translation; } public PathwayModeType getModeType() { diff --git a/src/main/java/com/troblecodings/signals/guis/UISignalBoxTile.java b/src/main/java/com/troblecodings/signals/guis/UISignalBoxTile.java index 102220c5f..04ef97c3b 100644 --- a/src/main/java/com/troblecodings/signals/guis/UISignalBoxTile.java +++ b/src/main/java/com/troblecodings/signals/guis/UISignalBoxTile.java @@ -90,7 +90,7 @@ private void localAdd(final ModeSet modeSet) { rotation.setRotateZ(modeSet.rotation.ordinal() * ((float) 90)); entity.add(rotation); } - entity.add(new UIIndependentTranslate(0, 0, 1)); + entity.add(new UIIndependentTranslate(0, 0, modeSet.mode.translation + 1)); SignalState state = greenSignals.getOrDefault(modeSet, SignalState.RED); if (modeSet.mode.equals(EnumGuiMode.RS)) {