diff options
author | Matej Dipčár <492666@mail.muni.cz> | 2022-09-21 17:59:05 +0200 |
---|---|---|
committer | Matej Dipčár <492666@mail.muni.cz> | 2022-09-23 02:15:51 +0200 |
commit | b93edb188a4521ca1b15fc398952d68fc26ce0e7 (patch) | |
tree | 07888a288c1a010a47c2e6bce87ff159a9d685a3 /src/main/java/gregtech/common/covers/redstone | |
parent | 2a42a1f018b0aa5a02bee5dc96b281ef38ea6a70 (diff) | |
download | GT5-Unofficial-b93edb188a4521ca1b15fc398952d68fc26ce0e7.tar.gz GT5-Unofficial-b93edb188a4521ca1b15fc398952d68fc26ce0e7.tar.bz2 GT5-Unofficial-b93edb188a4521ca1b15fc398952d68fc26ce0e7.zip |
Make GUI more settled and configurable
Diffstat (limited to 'src/main/java/gregtech/common/covers/redstone')
3 files changed, 36 insertions, 28 deletions
diff --git a/src/main/java/gregtech/common/covers/redstone/GT_Cover_AdvancedRedstoneReceiverBase.java b/src/main/java/gregtech/common/covers/redstone/GT_Cover_AdvancedRedstoneReceiverBase.java index 07309a7495..a0aee5d908 100644 --- a/src/main/java/gregtech/common/covers/redstone/GT_Cover_AdvancedRedstoneReceiverBase.java +++ b/src/main/java/gregtech/common/covers/redstone/GT_Cover_AdvancedRedstoneReceiverBase.java @@ -127,19 +127,9 @@ public abstract class GT_Cover_AdvancedRedstoneReceiverBase extends GT_Cover_Adv public void drawExtras(int mouseX, int mouseY, float parTicks) { super.drawExtras(mouseX, mouseY, parTicks); this.getFontRenderer().drawString( - GT_Utility.trans("246", "Frequency"), - startX + spaceX * 5, - 4 + startY, - textColor); - this.getFontRenderer().drawString( - GT_Utility.trans("601", "Use Private Frequency"), - startX + spaceX * 5, - startY + spaceY * 1 + 4, - textColor); - this.getFontRenderer().drawString( GT_Utility.trans("601", "Gate Mode"), startX + spaceX * 5, - startY + spaceY * 2 + 4, + 4 + startY + spaceY * 2, textColor); } diff --git a/src/main/java/gregtech/common/covers/redstone/GT_Cover_AdvancedRedstoneTransmitterBase.java b/src/main/java/gregtech/common/covers/redstone/GT_Cover_AdvancedRedstoneTransmitterBase.java index cdf80444dc..e5880373c0 100644 --- a/src/main/java/gregtech/common/covers/redstone/GT_Cover_AdvancedRedstoneTransmitterBase.java +++ b/src/main/java/gregtech/common/covers/redstone/GT_Cover_AdvancedRedstoneTransmitterBase.java @@ -114,28 +114,22 @@ public abstract class GT_Cover_AdvancedRedstoneTransmitterBase<T extends GT_Cove private final String INVERTED = GT_Utility.trans("INVERTED", "Inverted"); private final String NORMAL = GT_Utility.trans("NORMAL", "Normal"); + public TransmitterGUI(byte aSide, int aCoverID, X aCoverVariable, ICoverable aTileEntity, int frequencyRow, int buttonRow) { + super(aSide, aCoverID, aCoverVariable, aTileEntity, frequencyRow, buttonRow); + invertButton = new GT_GuiIconCheckButton(this, 1, startX + spaceX * 9, startY + spaceY * buttonRow, GT_GuiIcon.REDSTONE_ON, GT_GuiIcon.REDSTONE_OFF, INVERTED, NORMAL); + } + public TransmitterGUI(byte aSide, int aCoverID, X aCoverVariable, ICoverable aTileEntity) { - super(aSide, aCoverID, aCoverVariable, aTileEntity); - invertButton = new GT_GuiIconCheckButton(this, 1, startX + spaceX * 8, startY + spaceY * 1, GT_GuiIcon.REDSTONE_ON, GT_GuiIcon.REDSTONE_OFF, INVERTED, NORMAL); + this(aSide, aCoverID, aCoverVariable, aTileEntity, 0, 1); } @Override public void drawExtras(int mouseX, int mouseY, float parTicks) { super.drawExtras(mouseX, mouseY, parTicks); this.getFontRenderer().drawString( - GT_Utility.trans("246", "Frequency"), - startX + spaceX * 5, - 4 + startY, - textColor); - this.getFontRenderer().drawString( - GT_Utility.trans("601", "Use Private Frequency"), - startX + spaceX, - startY + spaceY * 1 + 4, - textColor); - this.getFontRenderer().drawString( coverVariable.invert ? INVERTED : NORMAL, - startX + spaceX * 9, - startY + spaceY * 1 + 4, + startX + spaceX * 10, + 4 + startY + spaceY * buttonRow, textColor); } diff --git a/src/main/java/gregtech/common/covers/redstone/GT_Cover_AdvancedWirelessRedstoneBase.java b/src/main/java/gregtech/common/covers/redstone/GT_Cover_AdvancedWirelessRedstoneBase.java index 7dffe8ea3a..c0bae10b8e 100644 --- a/src/main/java/gregtech/common/covers/redstone/GT_Cover_AdvancedWirelessRedstoneBase.java +++ b/src/main/java/gregtech/common/covers/redstone/GT_Cover_AdvancedWirelessRedstoneBase.java @@ -204,19 +204,43 @@ public abstract class GT_Cover_AdvancedWirelessRedstoneBase<T extends GT_Cover_A protected static final int spaceX = 18; protected static final int spaceY = 18; + protected final int frequencyRow; + protected final int buttonRow; + protected final int textColor = this.getTextColorOrDefault("text", 0xFF555555); private static final String guiTexturePath = "gregtech:textures/gui/GuiCoverLong.png"; - public WirelessGUI(byte aSide, int aCoverID, X aCoverVariable, ICoverable aTileEntity) { + public WirelessGUI(byte aSide, int aCoverID, X aCoverVariable, ICoverable aTileEntity, int frequencyRow, int buttonRow) { super(aTileEntity, 250, 107, GT_Utility.intToStack(aCoverID)); this.mGUIbackgroundLocation = new ResourceLocation(guiTexturePath); this.side = aSide; this.coverID = aCoverID; this.coverVariable = aCoverVariable; + this.frequencyRow = frequencyRow; + this.buttonRow = buttonRow; + + frequencyBox = new GT_GuiShortTextBox(this, 0, 1 + startX, 2 + startY + spaceY * frequencyRow, spaceX * 5 - 4, 12); + privateButton = new GT_GuiIconCheckButton(this, 0, startX, startY + spaceY * buttonRow, GT_GuiIcon.CHECKMARK, null); + } - frequencyBox = new GT_GuiShortTextBox(this, 0, startX, startY + 2, spaceX * 5 - 3, 12); - privateButton = new GT_GuiIconCheckButton(this, 0, startX, startY + spaceY * 1, GT_GuiIcon.CHECKMARK, null); + public WirelessGUI(byte aSide, int aCoverID, X aCoverVariable, ICoverable aTileEntity) { + this(aSide, aCoverID, aCoverVariable, aTileEntity, 0, 1); + } + + @Override + public void drawExtras(int mouseX, int mouseY, float parTicks) { + super.drawExtras(mouseX, mouseY, parTicks); + this.getFontRenderer().drawString( + GT_Utility.trans("246", "Frequency"), + startX + spaceX * 5, + 4 + startY + spaceY * frequencyRow, + textColor); + this.getFontRenderer().drawString( + GT_Utility.trans("601", "Use Private Frequency"), + startX + spaceX, + 4 + startY + spaceY * buttonRow, + textColor); } @Override |