From 8b8b743814ed8e10a2b6602a5e9710395c5c509f Mon Sep 17 00:00:00 2001 From: miozune Date: Fri, 11 Nov 2022 19:57:29 +0900 Subject: BuckConverter, DebugPollutor, DebugPowerGenerator, DebugStructureWriter --- dependencies.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'dependencies.gradle') diff --git a/dependencies.gradle b/dependencies.gradle index 5aa0a4bbd4..5a7751c24f 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -2,7 +2,7 @@ dependencies { shadowImplementation('com.github.GTNewHorizons:AVRcore:master-SNAPSHOT') - compile('com.github.GTNewHorizons:GT5-Unofficial:5.09.41.91-pre:dev') + compile('com.github.GTNewHorizons:GT5-Unofficial:5.09.41.112-pre:dev') compile('com.github.GTNewHorizons:Yamcl:0.5.84:dev') compile('com.github.GTNewHorizons:NotEnoughItems:2.3.7-GTNH:dev') compile('com.github.GTNewHorizons:CodeChickenLib:1.1.5.5:dev') -- cgit From d2839652313f4db1f1f3b2322baefe2330c475de Mon Sep 17 00:00:00 2001 From: miozune Date: Wed, 16 Nov 2022 17:55:43 +0900 Subject: Object Holder & Rack --- dependencies.gradle | 2 +- .../tectech/thing/gui/TecTechUITextures.java | 23 +++++ .../hatch/GT_MetaTileEntity_Hatch_Holder.java | 79 +++++++++++---- .../hatch/GT_MetaTileEntity_Hatch_Rack.java | 96 ++++++++++++++---- .../hatch/gui/GT_Container_Holder.java | 80 --------------- .../hatch/gui/GT_Container_Rack.java | 112 --------------------- .../hatch/gui/GT_GUIContainer_Holder.java | 35 ------- .../hatch/gui/GT_GUIContainer_Rack.java | 38 ------- .../single/GT_MetaTileEntity_BuckConverter.java | 16 ++- .../single/GT_MetaTileEntity_DebugPollutor.java | 16 ++- .../GT_MetaTileEntity_DebugPowerGenerator.java | 15 ++- .../GT_MetaTileEntity_DebugStructureWriter.java | 16 ++- .../assets/gregtech/textures/gui/holder.png | Bin 262950 -> 0 bytes .../assets/gregtech/textures/gui/rack.png | Bin 262950 -> 0 bytes .../tectech/textures/gui/button/standard_16x16.png | Bin 0 -> 109 bytes .../textures/gui/overlay_button/heat_off.png | Bin 0 -> 565 bytes .../textures/gui/overlay_button/heat_on.png | Bin 0 -> 880 bytes .../gui/overlay_button/power_switch_off.png | Bin 0 -> 182 bytes .../gui/overlay_button/power_switch_on.png | Bin 0 -> 396 bytes .../tectech/textures/gui/overlay_slot/rack.png | Bin 0 -> 151 bytes .../tectech/textures/gui/picture/heat_sink.png | Bin 0 -> 560 bytes .../tectech/textures/gui/picture/rack_large.png | Bin 0 -> 166 bytes .../tectech/textures/gui/picture/tectech_logo.png | Bin 0 -> 279 bytes 23 files changed, 190 insertions(+), 338 deletions(-) create mode 100644 src/main/java/com/github/technus/tectech/thing/gui/TecTechUITextures.java delete mode 100644 src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_Holder.java delete mode 100644 src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_Rack.java delete mode 100644 src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Holder.java delete mode 100644 src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Rack.java delete mode 100644 src/main/resources/assets/gregtech/textures/gui/holder.png delete mode 100644 src/main/resources/assets/gregtech/textures/gui/rack.png create mode 100644 src/main/resources/assets/tectech/textures/gui/button/standard_16x16.png create mode 100644 src/main/resources/assets/tectech/textures/gui/overlay_button/heat_off.png create mode 100644 src/main/resources/assets/tectech/textures/gui/overlay_button/heat_on.png create mode 100644 src/main/resources/assets/tectech/textures/gui/overlay_button/power_switch_off.png create mode 100644 src/main/resources/assets/tectech/textures/gui/overlay_button/power_switch_on.png create mode 100644 src/main/resources/assets/tectech/textures/gui/overlay_slot/rack.png create mode 100644 src/main/resources/assets/tectech/textures/gui/picture/heat_sink.png create mode 100644 src/main/resources/assets/tectech/textures/gui/picture/rack_large.png create mode 100644 src/main/resources/assets/tectech/textures/gui/picture/tectech_logo.png (limited to 'dependencies.gradle') diff --git a/dependencies.gradle b/dependencies.gradle index 5a7751c24f..b85d8e2c78 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -2,7 +2,7 @@ dependencies { shadowImplementation('com.github.GTNewHorizons:AVRcore:master-SNAPSHOT') - compile('com.github.GTNewHorizons:GT5-Unofficial:5.09.41.112-pre:dev') + compile('com.github.GTNewHorizons:GT5-Unofficial:5.09.41.123-pre:dev') compile('com.github.GTNewHorizons:Yamcl:0.5.84:dev') compile('com.github.GTNewHorizons:NotEnoughItems:2.3.7-GTNH:dev') compile('com.github.GTNewHorizons:CodeChickenLib:1.1.5.5:dev') diff --git a/src/main/java/com/github/technus/tectech/thing/gui/TecTechUITextures.java b/src/main/java/com/github/technus/tectech/thing/gui/TecTechUITextures.java new file mode 100644 index 0000000000..5f195bae64 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/thing/gui/TecTechUITextures.java @@ -0,0 +1,23 @@ +package com.github.technus.tectech.thing.gui; + +import static com.github.technus.tectech.Reference.MODID; + +import com.gtnewhorizons.modularui.api.drawable.UITexture; + +public class TecTechUITextures { + + public static final UITexture BUTTON_STANDARD_16x16 = UITexture.fullImage(MODID, "gui/button/standard_16x16"); + + public static final UITexture OVERLAY_BUTTON_POWER_SWITCH_OFF = + UITexture.fullImage(MODID, "gui/overlay_button/power_switch_off"); + public static final UITexture OVERLAY_BUTTON_POWER_SWITCH_ON = + UITexture.fullImage(MODID, "gui/overlay_button/power_switch_on"); + public static final UITexture OVERLAY_BUTTON_HEAT_OFF = UITexture.fullImage(MODID, "gui/overlay_button/heat_off"); + public static final UITexture OVERLAY_BUTTON_HEAT_ON = UITexture.fullImage(MODID, "gui/overlay_button/heat_on"); + + public static final UITexture OVERLAY_SLOT_RACK = UITexture.fullImage(MODID, "gui/overlay_slot/rack"); + + public static final UITexture PICTURE_TECTECH_LOGO = UITexture.fullImage(MODID, "gui/picture/tectech_logo"); + public static final UITexture PICTURE_RACK_LARGE = UITexture.fullImage(MODID, "gui/picture/rack_large"); + public static final UITexture PICTURE_HEAT_SINK = UITexture.fullImage(MODID, "gui/picture/heat_sink"); +} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Holder.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Holder.java index de173f2a16..9381f432f3 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Holder.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Holder.java @@ -2,28 +2,34 @@ package com.github.technus.tectech.thing.metaTileEntity.hatch; import static net.minecraft.util.StatCollector.translateToLocal; -import com.github.technus.tectech.thing.metaTileEntity.hatch.gui.GT_Container_Holder; -import com.github.technus.tectech.thing.metaTileEntity.hatch.gui.GT_GUIContainer_Holder; +import com.github.technus.tectech.thing.gui.TecTechUITextures; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.util.TT_Utility; +import com.gtnewhorizons.modularui.api.screen.ModularWindow; +import com.gtnewhorizons.modularui.api.screen.UIBuildContext; +import com.gtnewhorizons.modularui.common.internal.wrapper.BaseSlot; +import com.gtnewhorizons.modularui.common.widget.DrawableWidget; +import com.gtnewhorizons.modularui.common.widget.FakeSyncWidget; +import com.gtnewhorizons.modularui.common.widget.SlotWidget; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.Textures; +import gregtech.api.gui.modularui.GT_UIInfos; import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.modularui.IAddGregtechLogo; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; import gregtech.api.objects.GT_RenderedTexture; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; /** * Created by Tec on 03.04.2017. */ -public class GT_MetaTileEntity_Hatch_Holder extends GT_MetaTileEntity_Hatch { +public class GT_MetaTileEntity_Hatch_Holder extends GT_MetaTileEntity_Hatch implements IAddGregtechLogo { private static Textures.BlockIcons.CustomIcon EM_H; private static Textures.BlockIcons.CustomIcon EM_H_ACTIVE; @@ -89,19 +95,6 @@ public class GT_MetaTileEntity_Hatch_Holder extends GT_MetaTileEntity_Hatch { return aSide == aBaseMetaTileEntity.getFrontFacing(); } - @Override - public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_Container_Holder(aPlayerInventory, aBaseMetaTileEntity); - } - - @Override - public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_Holder( - aPlayerInventory, - aBaseMetaTileEntity, - translateToLocal("gt.blockmachines.hatch.holder.tier.09.name")); // Object Holder - } - @Override public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { if (aBaseMetaTileEntity.isClientSide()) { @@ -112,7 +105,7 @@ public class GT_MetaTileEntity_Hatch_Holder extends GT_MetaTileEntity_Hatch { // else if(heat>0) // aPlayer.addChatComponentMessage(new ChatComponentText("It is still warm...")); // else - aBaseMetaTileEntity.openGUI(aPlayer); + GT_UIInfos.openGTTileEntityUI(aBaseMetaTileEntity, aPlayer); return true; } @@ -130,4 +123,54 @@ public class GT_MetaTileEntity_Hatch_Holder extends GT_MetaTileEntity_Hatch { + translateToLocal("gt.blockmachines.hatch.holder.desc.1") // Advanced Holding Mechanism! }; } + + @Override + public boolean useModularUI() { + return true; + } + + @Override + public void addGregTechLogo(ModularWindow.Builder builder) { + builder.widget(new DrawableWidget() + .setDrawable(TecTechUITextures.PICTURE_TECTECH_LOGO) + .setSize(18, 18) + .setPos(151, 63)); + } + + @Override + public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { + builder.widget(new DrawableWidget() + .setDrawable(TecTechUITextures.PICTURE_HEAT_SINK) + .setPos(46, 17) + .setSize(84, 60)) + .widget(new DrawableWidget() + .setDrawable(TecTechUITextures.PICTURE_RACK_LARGE) + .setPos(68, 27) + .setSize(40, 40)) + .widget(new SlotWidget(new BaseSlot(inventoryHandler, 0) { + @Override + public int getSlotStackLimit() { + return 1; + } + + @Override + public boolean isEnabled() { + return !getBaseMetaTileEntity().isActive(); + } + }) + .setPos(79, 38)) + .widget(new DrawableWidget() + .setDrawable(TecTechUITextures.BUTTON_STANDARD_16x16) + .setPos(152, 24) + .setSize(16, 16)) + .widget(new DrawableWidget() + .setDrawable(() -> getBaseMetaTileEntity().isActive() + ? TecTechUITextures.OVERLAY_BUTTON_POWER_SWITCH_ON + : TecTechUITextures.OVERLAY_BUTTON_POWER_SWITCH_OFF) + .setPos(152, 24) + .setSize(16, 16)) + .widget(new FakeSyncWidget.BooleanSyncer( + () -> getBaseMetaTileEntity().isActive(), + val -> getBaseMetaTileEntity().setActive(val))); + } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Rack.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Rack.java index 5e3986ec41..cede4a33b1 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Rack.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Rack.java @@ -8,16 +8,25 @@ import static net.minecraft.util.StatCollector.translateToLocalFormatted; import com.github.technus.tectech.Reference; import com.github.technus.tectech.TecTech; -import com.github.technus.tectech.thing.metaTileEntity.hatch.gui.GT_Container_Rack; -import com.github.technus.tectech.thing.metaTileEntity.hatch.gui.GT_GUIContainer_Rack; +import com.github.technus.tectech.thing.gui.TecTechUITextures; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.util.TT_Utility; +import com.gtnewhorizons.modularui.api.math.Pos2d; +import com.gtnewhorizons.modularui.api.screen.ModularWindow; +import com.gtnewhorizons.modularui.api.screen.UIBuildContext; +import com.gtnewhorizons.modularui.common.internal.wrapper.BaseSlot; +import com.gtnewhorizons.modularui.common.widget.DrawableWidget; +import com.gtnewhorizons.modularui.common.widget.FakeSyncWidget; +import com.gtnewhorizons.modularui.common.widget.SlotWidget; import cpw.mods.fml.common.Loader; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.ItemList; import gregtech.api.enums.Textures; +import gregtech.api.gui.modularui.GT_UIInfos; import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.modularui.IAddGregtechLogo; +import gregtech.api.interfaces.modularui.IAddUIWidgets; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; @@ -27,7 +36,6 @@ import java.util.Map; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; @@ -36,7 +44,7 @@ import org.apache.commons.lang3.reflect.FieldUtils; /** * Created by Tec on 03.04.2017. */ -public class GT_MetaTileEntity_Hatch_Rack extends GT_MetaTileEntity_Hatch { +public class GT_MetaTileEntity_Hatch_Rack extends GT_MetaTileEntity_Hatch implements IAddGregtechLogo, IAddUIWidgets { private static Textures.BlockIcons.CustomIcon EM_R; private static Textures.BlockIcons.CustomIcon EM_R_ACTIVE; public int heat = 0; @@ -129,19 +137,6 @@ public class GT_MetaTileEntity_Hatch_Rack extends GT_MetaTileEntity_Hatch { return aSide == aBaseMetaTileEntity.getFrontFacing(); } - @Override - public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_Container_Rack(aPlayerInventory, aBaseMetaTileEntity); - } - - @Override - public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_Rack( - aPlayerInventory, - aBaseMetaTileEntity, - translateToLocal("gt.blockmachines.hatch.rack.tier.08.name")); // Computer Rack - } - @Override public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { if (aBaseMetaTileEntity.isClientSide()) { @@ -158,7 +153,7 @@ public class GT_MetaTileEntity_Hatch_Rack extends GT_MetaTileEntity_Hatch { // else if(heat>0) // aPlayer.addChatComponentMessage(new ChatComponentText("It is still warm...")); // else - aBaseMetaTileEntity.openGUI(aPlayer); + GT_UIInfos.openGTTileEntityUI(aBaseMetaTileEntity, aPlayer); return true; } @@ -294,6 +289,71 @@ public class GT_MetaTileEntity_Hatch_Rack extends GT_MetaTileEntity_Hatch { // Heat==1-10? --> 1 } + @Override + public boolean useModularUI() { + return true; + } + + @Override + public void addGregTechLogo(ModularWindow.Builder builder) { + builder.widget(new DrawableWidget() + .setDrawable(TecTechUITextures.PICTURE_TECTECH_LOGO) + .setSize(18, 18) + .setPos(151, 63)); + } + + @Override + public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { + builder.widget(new DrawableWidget() + .setDrawable(TecTechUITextures.PICTURE_HEAT_SINK) + .setPos(46, 17) + .setSize(84, 60)); + + Pos2d[] positions = new Pos2d[] { + new Pos2d(68, 27), new Pos2d(90, 27), new Pos2d(68, 49), new Pos2d(90, 49), + }; + for (int i = 0; i < positions.length; i++) { + builder.widget(new SlotWidget(new BaseSlot(inventoryHandler, i) { + @Override + public int getSlotStackLimit() { + return 1; + } + + @Override + public boolean isEnabled() { + return !getBaseMetaTileEntity().isActive() && heat <= 0; + } + }) + .setBackground(getGUITextureSet().getItemSlot(), TecTechUITextures.OVERLAY_SLOT_RACK) + .setPos(positions[i])); + + builder.widget(new DrawableWidget() + .setDrawable(TecTechUITextures.BUTTON_STANDARD_16x16) + .setPos(152, 24) + .setSize(16, 16)) + .widget(new DrawableWidget() + .setDrawable(() -> getBaseMetaTileEntity().isActive() + ? TecTechUITextures.OVERLAY_BUTTON_POWER_SWITCH_ON + : TecTechUITextures.OVERLAY_BUTTON_POWER_SWITCH_OFF) + .setPos(152, 24) + .setSize(16, 16)) + .widget(new FakeSyncWidget.BooleanSyncer( + () -> getBaseMetaTileEntity().isActive(), + val -> getBaseMetaTileEntity().setActive(val))); + builder.widget(new DrawableWidget() + .setDrawable(TecTechUITextures.BUTTON_STANDARD_16x16) + .setPos(152, 41) + .setSize(16, 16)) + .widget(new DrawableWidget() + .setDrawable(() -> heat > 0 + ? TecTechUITextures.OVERLAY_BUTTON_HEAT_ON + : TecTechUITextures.OVERLAY_BUTTON_HEAT_OFF) + .setPos(152, 41) + .setSize(16, 16)) + .widget(new FakeSyncWidget.IntegerSyncer(() -> heat, val -> heat = val)); + } + } + public static void run() { // 20k heat cap max! new RackComponent(ItemList.Circuit_Primitive.get(1), 1, 4, 0, 500, true); // Primitive Circuit new RackComponent(ItemList.Circuit_Basic.get(1), 4, 8, 0, 1000, true); // Basic Circuit diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_Holder.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_Holder.java deleted file mode 100644 index e8377ba7bb..0000000000 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_Holder.java +++ /dev/null @@ -1,80 +0,0 @@ -package com.github.technus.tectech.thing.metaTileEntity.hatch.gui; - -import gregtech.api.gui.GT_ContainerMetaTile_Machine; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; - -/** - * Created by Tec on 09.04.2017. - */ -public class GT_Container_Holder extends GT_ContainerMetaTile_Machine { - public GT_Container_Holder(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { - super(aInventoryPlayer, aTileEntity); - } - - @Override - public void addSlots(InventoryPlayer aInventoryPlayer) { - addSlotToContainer(new Slot(mTileEntity, 0, 80, 39)); - } - - @Override - public int getSlotCount() { - return 1; - } - - @Override - public int getShiftClickSlotCount() { - return 1; - } - - @Override - public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) { - if (mActive != 0) { - return null; - } - return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); - } - - @Override - public ItemStack transferStackInSlot(EntityPlayer aPlayer, int aSlotIndex) { - if (mActive != 0) { - return null; - } - return super.transferStackInSlot(aPlayer, aSlotIndex); - } - - @Override - public boolean canDragIntoSlot(Slot par1Slot) { - if (mActive != 0) { - return false; - } - return super.canDragIntoSlot(par1Slot); - } - - @Override - public void putStacksInSlots(ItemStack[] par1ArrayOfItemStack) { - if (mActive != 0) { - return; - } - super.putStacksInSlots(par1ArrayOfItemStack); - } - - @Override - protected boolean mergeItemStack(ItemStack aStack, int aStartIndex, int aSlotCount, boolean par4) { - if (mActive != 0) { - return false; - } - return super.mergeItemStack(aStack, aStartIndex, aSlotCount, par4); - } - - @Override - public void putStackInSlot(int par1, ItemStack par2ItemStack) { - if (mActive != 0) { - return; - } - super.putStackInSlot(par1, par2ItemStack); - } -} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_Rack.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_Rack.java deleted file mode 100644 index 16b38e254f..0000000000 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_Rack.java +++ /dev/null @@ -1,112 +0,0 @@ -package com.github.technus.tectech.thing.metaTileEntity.hatch.gui; - -import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_Rack; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.gui.GT_ContainerMetaTile_Machine; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.ICrafting; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; - -/** - * Created by Tec on 09.04.2017. - */ -public class GT_Container_Rack extends GT_ContainerMetaTile_Machine { - public boolean heat = false; - - public GT_Container_Rack(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { - super(aInventoryPlayer, aTileEntity); - } - - @Override - public void addSlots(InventoryPlayer aInventoryPlayer) { - addSlotToContainer(new Slot(mTileEntity, 0, 69, 28)); - addSlotToContainer(new Slot(mTileEntity, 1, 91, 28)); - addSlotToContainer(new Slot(mTileEntity, 2, 69, 50)); - addSlotToContainer(new Slot(mTileEntity, 3, 91, 50)); - } - - @Override - public int getSlotCount() { - return 4; - } - - @Override - public int getShiftClickSlotCount() { - return 4; - } - - @Override - public void detectAndSendChanges() { - super.detectAndSendChanges(); - if (mTileEntity.isClientSide() || mTileEntity.getMetaTileEntity() == null) { - return; - } - heat = ((GT_MetaTileEntity_Hatch_Rack) mTileEntity.getMetaTileEntity()).heat > 0; - - for (Object crafter : crafters) { - ICrafting var1 = (ICrafting) crafter; - var1.sendProgressBarUpdate(this, 100, heat ? 1 : 0); - } - } - - @Override - @SideOnly(Side.CLIENT) - public void updateProgressBar(int par1, int par2) { - super.updateProgressBar(par1, par2); - if (par1 == 100) { - heat = par2 != 0; - } - } - - @Override - public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) { - if (heat || mActive != 0) { - return null; - } - return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); - } - - @Override - public ItemStack transferStackInSlot(EntityPlayer aPlayer, int aSlotIndex) { - if (heat || mActive != 0) { - return null; - } - return super.transferStackInSlot(aPlayer, aSlotIndex); - } - - @Override - public boolean canDragIntoSlot(Slot par1Slot) { - if (heat || mActive != 0) { - return false; - } - return super.canDragIntoSlot(par1Slot); - } - - @Override - public void putStacksInSlots(ItemStack[] par1ArrayOfItemStack) { - if (heat || mActive != 0) { - return; - } - super.putStacksInSlots(par1ArrayOfItemStack); - } - - @Override - protected boolean mergeItemStack(ItemStack aStack, int aStartIndex, int aSlotCount, boolean par4) { - if (heat || mActive != 0) { - return false; - } - return super.mergeItemStack(aStack, aStartIndex, aSlotCount, par4); - } - - @Override - public void putStackInSlot(int par1, ItemStack par2ItemStack) { - if (heat || mActive != 0) { - return; - } - super.putStackInSlot(par1, par2ItemStack); - } -} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Holder.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Holder.java deleted file mode 100644 index 7019a6128e..0000000000 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Holder.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.github.technus.tectech.thing.metaTileEntity.hatch.gui; - -import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import net.minecraft.entity.player.InventoryPlayer; - -/** - * Created by Tec on 09.04.2017. - */ -public class GT_GUIContainer_Holder extends GT_GUIContainerMetaTile_Machine { - private final String mName; - - public GT_GUIContainer_Holder(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName) { - super(new GT_Container_Holder(aInventoryPlayer, aTileEntity), "gregtech:textures/gui/holder.png"); - mName = aName; - } - - @Override - protected void drawGuiContainerForegroundLayer(int par1, int par2) { - fontRendererObj.drawString(mName, 8, 4, 4210752); - } - - @Override - protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { - super.drawGuiContainerBackgroundLayer(par1, par2, par3); - int x = (width - xSize) / 2; - int y = (height - ySize) / 2; - drawTexturedModalRect(x, y, 0, 0, xSize, ySize); - if (mContainer != null) { - if (((GT_Container_Holder) mContainer).mActive == 1) { - drawTexturedModalRect(x + 151, y + 23, 183, 23, 18, 18); - } - } - } -} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Rack.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Rack.java deleted file mode 100644 index 396a690a8f..0000000000 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Rack.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.github.technus.tectech.thing.metaTileEntity.hatch.gui; - -import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import net.minecraft.entity.player.InventoryPlayer; - -/** - * Created by Tec on 09.04.2017. - */ -public class GT_GUIContainer_Rack extends GT_GUIContainerMetaTile_Machine { - private final String mName; - - public GT_GUIContainer_Rack(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName) { - super(new GT_Container_Rack(aInventoryPlayer, aTileEntity), "gregtech:textures/gui/rack.png"); - mName = aName; - } - - @Override - protected void drawGuiContainerForegroundLayer(int par1, int par2) { - fontRendererObj.drawString(mName, 8, 4, 4210752); - } - - @Override - protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { - super.drawGuiContainerBackgroundLayer(par1, par2, par3); - int x = (width - xSize) / 2; - int y = (height - ySize) / 2; - drawTexturedModalRect(x, y, 0, 0, xSize, ySize); - if (mContainer != null) { - if (((GT_Container_Rack) mContainer).mActive == 1) { - drawTexturedModalRect(x + 151, y + 23, 183, 23, 18, 18); - } - if (((GT_Container_Rack) mContainer).heat) { - drawTexturedModalRect(x + 151, y + 41, 183, 41, 18, 18); - } - } - } -} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_BuckConverter.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_BuckConverter.java index e03edcd77c..63c5e142e0 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_BuckConverter.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_BuckConverter.java @@ -18,6 +18,8 @@ import gregtech.api.enums.Textures; import gregtech.api.gui.modularui.GT_UIInfos; import gregtech.api.gui.modularui.GT_UITextures; import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.modularui.IAddGregtechLogo; +import gregtech.api.interfaces.modularui.IAddUIWidgets; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock; @@ -30,7 +32,8 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; -public class GT_MetaTileEntity_BuckConverter extends GT_MetaTileEntity_TieredMachineBlock { +public class GT_MetaTileEntity_BuckConverter extends GT_MetaTileEntity_TieredMachineBlock + implements IAddUIWidgets, IAddGregtechLogo { private static GT_RenderedTexture BUCK, BUCK_ACTIVE; public int EUT = 0, AMP = 0; @@ -209,20 +212,15 @@ public class GT_MetaTileEntity_BuckConverter extends GT_MetaTileEntity_TieredMac } @Override - protected void addGregTechLogo(ModularWindow.Builder builder) { + public void addGregTechLogo(ModularWindow.Builder builder) { builder.widget(new DrawableWidget() - .setDrawable(getGregTechLogo()) + .setDrawable(GT_UITextures.PICTURE_GT_LOGO_17x17_TRANSPARENT_GRAY) .setSize(17, 17) .setPos(113, 56)); } @Override - protected IDrawable getGregTechLogo() { - return GT_UITextures.PICTURE_GT_LOGO_17x17_TRANSPARENT_GRAY; - } - - @Override - protected void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { + public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { builder.widget(new DrawableWidget() .setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK) .setSize(90, 72) diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugPollutor.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugPollutor.java index 3af07f7590..6a48095d55 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugPollutor.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugPollutor.java @@ -19,6 +19,8 @@ import gregtech.api.enums.Textures; import gregtech.api.gui.modularui.GT_UIInfos; import gregtech.api.gui.modularui.GT_UITextures; import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.modularui.IAddGregtechLogo; +import gregtech.api.interfaces.modularui.IAddUIWidgets; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock; @@ -34,7 +36,8 @@ import net.minecraft.util.EnumChatFormatting; /** * Created by Tec on 23.03.2017. */ -public class GT_MetaTileEntity_DebugPollutor extends GT_MetaTileEntity_TieredMachineBlock { +public class GT_MetaTileEntity_DebugPollutor extends GT_MetaTileEntity_TieredMachineBlock + implements IAddUIWidgets, IAddGregtechLogo { private static GT_RenderedTexture POLLUTOR; public int pollution = 0; public float anomaly = 0; @@ -171,20 +174,15 @@ public class GT_MetaTileEntity_DebugPollutor extends GT_MetaTileEntity_TieredMac } @Override - protected void addGregTechLogo(ModularWindow.Builder builder) { + public void addGregTechLogo(ModularWindow.Builder builder) { builder.widget(new DrawableWidget() - .setDrawable(getGregTechLogo()) + .setDrawable(GT_UITextures.PICTURE_GT_LOGO_17x17_TRANSPARENT_GRAY) .setSize(17, 17) .setPos(113, 56)); } @Override - protected IDrawable getGregTechLogo() { - return GT_UITextures.PICTURE_GT_LOGO_17x17_TRANSPARENT_GRAY; - } - - @Override - protected void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { + public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { builder.widget(new DrawableWidget() .setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK) .setSize(90, 72) diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugPowerGenerator.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugPowerGenerator.java index cf21617ca8..dc5398a254 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugPowerGenerator.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugPowerGenerator.java @@ -23,6 +23,8 @@ import gregtech.api.gui.modularui.GT_UIInfos; import gregtech.api.gui.modularui.GT_UITextures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.modularui.IAddGregtechLogo; +import gregtech.api.interfaces.modularui.IAddUIWidgets; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock; @@ -40,7 +42,7 @@ import net.minecraft.util.StatCollector; * Created by Tec on 23.03.2017. */ public class GT_MetaTileEntity_DebugPowerGenerator extends GT_MetaTileEntity_TieredMachineBlock - implements IConnectsToEnergyTunnel { + implements IConnectsToEnergyTunnel, IAddUIWidgets, IAddGregtechLogo { private static GT_RenderedTexture GENNY; private boolean LASER = false; public int EUT = 0, AMP = 0; @@ -299,20 +301,15 @@ public class GT_MetaTileEntity_DebugPowerGenerator extends GT_MetaTileEntity_Tie } @Override - protected void addGregTechLogo(ModularWindow.Builder builder) { + public void addGregTechLogo(ModularWindow.Builder builder) { builder.widget(new DrawableWidget() - .setDrawable(getGregTechLogo()) + .setDrawable(GT_UITextures.PICTURE_GT_LOGO_17x17_TRANSPARENT_GRAY) .setSize(17, 17) .setPos(113, 56)); } @Override - protected IDrawable getGregTechLogo() { - return GT_UITextures.PICTURE_GT_LOGO_17x17_TRANSPARENT_GRAY; - } - - @Override - protected void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { + public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { builder.widget(new DrawableWidget() .setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK) .setSize(90, 72) diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugStructureWriter.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugStructureWriter.java index a536e39b12..f7b4db02fd 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugStructureWriter.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugStructureWriter.java @@ -20,6 +20,8 @@ import gregtech.api.enums.Textures; import gregtech.api.gui.modularui.GT_UIInfos; import gregtech.api.gui.modularui.GT_UITextures; import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.modularui.IAddGregtechLogo; +import gregtech.api.interfaces.modularui.IAddUIWidgets; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock; @@ -35,7 +37,8 @@ import net.minecraftforge.common.util.ForgeDirection; /** * Created by Tec on 23.03.2017. */ -public class GT_MetaTileEntity_DebugStructureWriter extends GT_MetaTileEntity_TieredMachineBlock { +public class GT_MetaTileEntity_DebugStructureWriter extends GT_MetaTileEntity_TieredMachineBlock + implements IAddUIWidgets, IAddGregtechLogo { private static GT_RenderedTexture MARK; public short[] numbers = new short[6]; public boolean size = false; @@ -226,20 +229,15 @@ public class GT_MetaTileEntity_DebugStructureWriter extends GT_MetaTileEntity_Ti } @Override - protected void addGregTechLogo(ModularWindow.Builder builder) { + public void addGregTechLogo(ModularWindow.Builder builder) { builder.widget(new DrawableWidget() - .setDrawable(getGregTechLogo()) + .setDrawable(GT_UITextures.PICTURE_GT_LOGO_17x17_TRANSPARENT_GRAY) .setSize(17, 17) .setPos(113, 56)); } @Override - protected IDrawable getGregTechLogo() { - return GT_UITextures.PICTURE_GT_LOGO_17x17_TRANSPARENT_GRAY; - } - - @Override - protected void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { + public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { builder.widget(new DrawableWidget() .setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK) .setSize(90, 72) diff --git a/src/main/resources/assets/gregtech/textures/gui/holder.png b/src/main/resources/assets/gregtech/textures/gui/holder.png deleted file mode 100644 index 421a4aee38..0000000000 Binary files a/src/main/resources/assets/gregtech/textures/gui/holder.png and /dev/null differ diff --git a/src/main/resources/assets/gregtech/textures/gui/rack.png b/src/main/resources/assets/gregtech/textures/gui/rack.png deleted file mode 100644 index e6ce2d6efd..0000000000 Binary files a/src/main/resources/assets/gregtech/textures/gui/rack.png and /dev/null differ diff --git a/src/main/resources/assets/tectech/textures/gui/button/standard_16x16.png b/src/main/resources/assets/tectech/textures/gui/button/standard_16x16.png new file mode 100644 index 0000000000..4071b19033 Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/button/standard_16x16.png differ diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/heat_off.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/heat_off.png new file mode 100644 index 0000000000..d4307a802c Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/overlay_button/heat_off.png differ diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/heat_on.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/heat_on.png new file mode 100644 index 0000000000..45f6bdf8ce Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/overlay_button/heat_on.png differ diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/power_switch_off.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/power_switch_off.png new file mode 100644 index 0000000000..be40408929 Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/overlay_button/power_switch_off.png differ diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/power_switch_on.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/power_switch_on.png new file mode 100644 index 0000000000..1a033c8aec Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/overlay_button/power_switch_on.png differ diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_slot/rack.png b/src/main/resources/assets/tectech/textures/gui/overlay_slot/rack.png new file mode 100644 index 0000000000..8abaf83263 Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/overlay_slot/rack.png differ diff --git a/src/main/resources/assets/tectech/textures/gui/picture/heat_sink.png b/src/main/resources/assets/tectech/textures/gui/picture/heat_sink.png new file mode 100644 index 0000000000..238409ace8 Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/picture/heat_sink.png differ diff --git a/src/main/resources/assets/tectech/textures/gui/picture/rack_large.png b/src/main/resources/assets/tectech/textures/gui/picture/rack_large.png new file mode 100644 index 0000000000..b57e9267aa Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/picture/rack_large.png differ diff --git a/src/main/resources/assets/tectech/textures/gui/picture/tectech_logo.png b/src/main/resources/assets/tectech/textures/gui/picture/tectech_logo.png new file mode 100644 index 0000000000..704d04c26d Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/picture/tectech_logo.png differ -- cgit From 5ee7bcd69067c8a457ba16191ce97f113e48f9d6 Mon Sep 17 00:00:00 2001 From: miozune Date: Fri, 18 Nov 2022 00:07:38 +0900 Subject: Uncertainty Resolvers --- dependencies.gradle | 10 +- repositories.gradle | 1 + .../tectech/thing/gui/TecTechUITextures.java | 26 ++++ .../hatch/GT_MetaTileEntity_Hatch_Uncertainty.java | 173 ++++++++++++++++++--- .../hatch/gui/GT_Container_Uncertainty.java | 127 --------------- .../hatch/gui/GT_GUIContainer_Uncertainty.java | 82 ---------- .../hatch/gui/GT_GUIContainer_UncertaintyAdv.java | 86 ---------- .../assets/gregtech/textures/gui/Uncertainty.png | Bin 262972 -> 0 bytes .../textures/gui/background/screen_blue.png | Bin 0 -> 246 bytes .../textures/gui/overlay_button/uncertainty/0.png | Bin 0 -> 174 bytes .../textures/gui/overlay_button/uncertainty/1.png | Bin 0 -> 176 bytes .../textures/gui/overlay_button/uncertainty/10.png | Bin 0 -> 172 bytes .../textures/gui/overlay_button/uncertainty/11.png | Bin 0 -> 172 bytes .../textures/gui/overlay_button/uncertainty/12.png | Bin 0 -> 176 bytes .../textures/gui/overlay_button/uncertainty/13.png | Bin 0 -> 172 bytes .../textures/gui/overlay_button/uncertainty/14.png | Bin 0 -> 174 bytes .../textures/gui/overlay_button/uncertainty/15.png | Bin 0 -> 172 bytes .../textures/gui/overlay_button/uncertainty/2.png | Bin 0 -> 172 bytes .../textures/gui/overlay_button/uncertainty/3.png | Bin 0 -> 171 bytes .../textures/gui/overlay_button/uncertainty/4.png | Bin 0 -> 179 bytes .../textures/gui/overlay_button/uncertainty/5.png | Bin 0 -> 173 bytes .../textures/gui/overlay_button/uncertainty/6.png | Bin 0 -> 172 bytes .../textures/gui/overlay_button/uncertainty/7.png | Bin 0 -> 172 bytes .../textures/gui/overlay_button/uncertainty/8.png | Bin 0 -> 177 bytes .../textures/gui/overlay_button/uncertainty/9.png | Bin 0 -> 172 bytes .../textures/gui/picture/tectech_logo_dark.png | Bin 0 -> 291 bytes .../textures/gui/picture/uncertainty/indicator.png | Bin 0 -> 120 bytes .../textures/gui/picture/uncertainty/invalid_0.png | Bin 0 -> 136 bytes .../textures/gui/picture/uncertainty/invalid_1.png | Bin 0 -> 124 bytes .../textures/gui/picture/uncertainty/invalid_2.png | Bin 0 -> 134 bytes .../textures/gui/picture/uncertainty/invalid_3.png | Bin 0 -> 129 bytes .../textures/gui/picture/uncertainty/invalid_4.png | Bin 0 -> 119 bytes .../textures/gui/picture/uncertainty/invalid_5.png | Bin 0 -> 129 bytes .../textures/gui/picture/uncertainty/invalid_6.png | Bin 0 -> 132 bytes .../textures/gui/picture/uncertainty/invalid_7.png | Bin 0 -> 124 bytes .../textures/gui/picture/uncertainty/invalid_8.png | Bin 0 -> 126 bytes .../textures/gui/picture/uncertainty/monitor.png | Bin 0 -> 351 bytes .../textures/gui/picture/uncertainty/selected.png | Bin 0 -> 154 bytes .../textures/gui/picture/uncertainty/valid_0.png | Bin 0 -> 136 bytes .../textures/gui/picture/uncertainty/valid_1.png | Bin 0 -> 124 bytes .../textures/gui/picture/uncertainty/valid_2.png | Bin 0 -> 134 bytes .../textures/gui/picture/uncertainty/valid_3.png | Bin 0 -> 129 bytes .../textures/gui/picture/uncertainty/valid_4.png | Bin 0 -> 119 bytes .../textures/gui/picture/uncertainty/valid_5.png | Bin 0 -> 129 bytes .../textures/gui/picture/uncertainty/valid_6.png | Bin 0 -> 132 bytes .../textures/gui/picture/uncertainty/valid_7.png | Bin 0 -> 124 bytes .../textures/gui/picture/uncertainty/valid_8.png | Bin 0 -> 126 bytes 47 files changed, 190 insertions(+), 315 deletions(-) delete mode 100644 src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_Uncertainty.java delete mode 100644 src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Uncertainty.java delete mode 100644 src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_UncertaintyAdv.java delete mode 100644 src/main/resources/assets/gregtech/textures/gui/Uncertainty.png create mode 100644 src/main/resources/assets/tectech/textures/gui/background/screen_blue.png create mode 100644 src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/0.png create mode 100644 src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/1.png create mode 100644 src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/10.png create mode 100644 src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/11.png create mode 100644 src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/12.png create mode 100644 src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/13.png create mode 100644 src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/14.png create mode 100644 src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/15.png create mode 100644 src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/2.png create mode 100644 src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/3.png create mode 100644 src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/4.png create mode 100644 src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/5.png create mode 100644 src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/6.png create mode 100644 src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/7.png create mode 100644 src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/8.png create mode 100644 src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/9.png create mode 100644 src/main/resources/assets/tectech/textures/gui/picture/tectech_logo_dark.png create mode 100644 src/main/resources/assets/tectech/textures/gui/picture/uncertainty/indicator.png create mode 100644 src/main/resources/assets/tectech/textures/gui/picture/uncertainty/invalid_0.png create mode 100644 src/main/resources/assets/tectech/textures/gui/picture/uncertainty/invalid_1.png create mode 100644 src/main/resources/assets/tectech/textures/gui/picture/uncertainty/invalid_2.png create mode 100644 src/main/resources/assets/tectech/textures/gui/picture/uncertainty/invalid_3.png create mode 100644 src/main/resources/assets/tectech/textures/gui/picture/uncertainty/invalid_4.png create mode 100644 src/main/resources/assets/tectech/textures/gui/picture/uncertainty/invalid_5.png create mode 100644 src/main/resources/assets/tectech/textures/gui/picture/uncertainty/invalid_6.png create mode 100644 src/main/resources/assets/tectech/textures/gui/picture/uncertainty/invalid_7.png create mode 100644 src/main/resources/assets/tectech/textures/gui/picture/uncertainty/invalid_8.png create mode 100644 src/main/resources/assets/tectech/textures/gui/picture/uncertainty/monitor.png create mode 100644 src/main/resources/assets/tectech/textures/gui/picture/uncertainty/selected.png create mode 100644 src/main/resources/assets/tectech/textures/gui/picture/uncertainty/valid_0.png create mode 100644 src/main/resources/assets/tectech/textures/gui/picture/uncertainty/valid_1.png create mode 100644 src/main/resources/assets/tectech/textures/gui/picture/uncertainty/valid_2.png create mode 100644 src/main/resources/assets/tectech/textures/gui/picture/uncertainty/valid_3.png create mode 100644 src/main/resources/assets/tectech/textures/gui/picture/uncertainty/valid_4.png create mode 100644 src/main/resources/assets/tectech/textures/gui/picture/uncertainty/valid_5.png create mode 100644 src/main/resources/assets/tectech/textures/gui/picture/uncertainty/valid_6.png create mode 100644 src/main/resources/assets/tectech/textures/gui/picture/uncertainty/valid_7.png create mode 100644 src/main/resources/assets/tectech/textures/gui/picture/uncertainty/valid_8.png (limited to 'dependencies.gradle') diff --git a/dependencies.gradle b/dependencies.gradle index b85d8e2c78..983d1205ce 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -2,7 +2,7 @@ dependencies { shadowImplementation('com.github.GTNewHorizons:AVRcore:master-SNAPSHOT') - compile('com.github.GTNewHorizons:GT5-Unofficial:5.09.41.123-pre:dev') + compile('com.github.GTNewHorizons:GT5-Unofficial:5.09.41.128-pre:dev') compile('com.github.GTNewHorizons:Yamcl:0.5.84:dev') compile('com.github.GTNewHorizons:NotEnoughItems:2.3.7-GTNH:dev') compile('com.github.GTNewHorizons:CodeChickenLib:1.1.5.5:dev') @@ -18,4 +18,12 @@ dependencies { compileOnly('curse.maven:cofh-lib-220333:2388748') {transitive=false} compileOnly('curse.maven:computercraft-67504:2269339') {transitive=false} compileOnly('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev') {transitive=false} + + // // for local + // compile('com.github.GTNewHorizons:GT5-Unofficial:5.09.41.123-pre:dev') {transitive=false} + // compile("com.github.GTNewHorizons:ModularUI:SNAPSHOT:dev") + // compile("com.github.GTNewHorizons:waila:1.5.21:dev") + // compile("com.github.GTNewHorizons:Chisel:2.10.15-GTNH:dev") { + // transitive = false + // } } diff --git a/repositories.gradle b/repositories.gradle index 887a6ff8c8..053aa123b5 100644 --- a/repositories.gradle +++ b/repositories.gradle @@ -1,6 +1,7 @@ // Add any additional repositories for your dependencies here repositories { + mavenLocal() maven { name 'GTNH Maven' url 'http://jenkins.usrv.eu:8081/nexus/content/groups/public/' diff --git a/src/main/java/com/github/technus/tectech/thing/gui/TecTechUITextures.java b/src/main/java/com/github/technus/tectech/thing/gui/TecTechUITextures.java index 5f195bae64..26c484f4b1 100644 --- a/src/main/java/com/github/technus/tectech/thing/gui/TecTechUITextures.java +++ b/src/main/java/com/github/technus/tectech/thing/gui/TecTechUITextures.java @@ -2,10 +2,16 @@ package com.github.technus.tectech.thing.gui; import static com.github.technus.tectech.Reference.MODID; +import com.gtnewhorizons.modularui.api.drawable.AdaptableUITexture; import com.gtnewhorizons.modularui.api.drawable.UITexture; +import java.util.stream.Collectors; +import java.util.stream.IntStream; public class TecTechUITextures { + public static final AdaptableUITexture BACKGROUND_SCREEN_BLUE = + AdaptableUITexture.of(MODID, "gui/background/screen_blue", 90, 72, 2); + public static final UITexture BUTTON_STANDARD_16x16 = UITexture.fullImage(MODID, "gui/button/standard_16x16"); public static final UITexture OVERLAY_BUTTON_POWER_SWITCH_OFF = @@ -14,10 +20,30 @@ public class TecTechUITextures { UITexture.fullImage(MODID, "gui/overlay_button/power_switch_on"); public static final UITexture OVERLAY_BUTTON_HEAT_OFF = UITexture.fullImage(MODID, "gui/overlay_button/heat_off"); public static final UITexture OVERLAY_BUTTON_HEAT_ON = UITexture.fullImage(MODID, "gui/overlay_button/heat_on"); + public static final UITexture[] OVERLAY_BUTTON_UNCERTAINTY = IntStream.range(0, 16) + .mapToObj(i -> UITexture.fullImage(MODID, "gui/overlay_button/uncertainty/" + i)) + .collect(Collectors.toList()) + .toArray(new UITexture[] {}); public static final UITexture OVERLAY_SLOT_RACK = UITexture.fullImage(MODID, "gui/overlay_slot/rack"); public static final UITexture PICTURE_TECTECH_LOGO = UITexture.fullImage(MODID, "gui/picture/tectech_logo"); + public static final UITexture PICTURE_TECTECH_LOGO_DARK = + UITexture.fullImage(MODID, "gui/picture/tectech_logo_dark"); public static final UITexture PICTURE_RACK_LARGE = UITexture.fullImage(MODID, "gui/picture/rack_large"); public static final UITexture PICTURE_HEAT_SINK = UITexture.fullImage(MODID, "gui/picture/heat_sink"); + public static final UITexture PICTURE_UNCERTAINTY_MONITOR = + UITexture.fullImage(MODID, "gui/picture/uncertainty/monitor"); + public static final UITexture PICTURE_UNCERTAINTY_INDICATOR = + UITexture.fullImage(MODID, "gui/picture/uncertainty/indicator"); + public static final UITexture PICTURE_UNCERTAINTY_SELECTED = + UITexture.fullImage(MODID, "gui/picture/uncertainty/selected"); + public static final UITexture[] PICTURE_UNCERTAINTY_VALID = IntStream.range(0, 9) + .mapToObj(i -> UITexture.fullImage(MODID, "gui/picture/uncertainty/valid_" + i)) + .collect(Collectors.toList()) + .toArray(new UITexture[] {}); + public static final UITexture[] PICTURE_UNCERTAINTY_INVALID = IntStream.range(0, 9) + .mapToObj(i -> UITexture.fullImage(MODID, "gui/picture/uncertainty/invalid_" + i)) + .collect(Collectors.toList()) + .toArray(new UITexture[] {}); } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Uncertainty.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Uncertainty.java index 5c34243742..8dd056155c 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Uncertainty.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Uncertainty.java @@ -2,25 +2,36 @@ package com.github.technus.tectech.thing.metaTileEntity.hatch; import static net.minecraft.util.StatCollector.translateToLocal; import static net.minecraft.util.StatCollector.translateToLocalFormatted; +import static org.lwjgl.opengl.GL11.*; import com.github.technus.tectech.TecTech; -import com.github.technus.tectech.thing.metaTileEntity.hatch.gui.GT_Container_Uncertainty; -import com.github.technus.tectech.thing.metaTileEntity.hatch.gui.GT_GUIContainer_Uncertainty; -import com.github.technus.tectech.thing.metaTileEntity.hatch.gui.GT_GUIContainer_UncertaintyAdv; +import com.github.technus.tectech.thing.gui.TecTechUITextures; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.util.TT_Utility; +import com.gtnewhorizons.modularui.api.GlStateManager; +import com.gtnewhorizons.modularui.api.drawable.UITexture; +import com.gtnewhorizons.modularui.api.math.Pos2d; +import com.gtnewhorizons.modularui.api.screen.ModularWindow; +import com.gtnewhorizons.modularui.api.screen.UIBuildContext; +import com.gtnewhorizons.modularui.common.widget.ButtonWidget; +import com.gtnewhorizons.modularui.common.widget.DrawableWidget; +import com.gtnewhorizons.modularui.common.widget.FakeSyncWidget; +import com.gtnewhorizons.modularui.common.widget.TextWidget; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.Textures; +import gregtech.api.gui.modularui.GT_UIInfos; +import gregtech.api.gui.modularui.GT_UITextures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.modularui.IAddGregtechLogo; +import gregtech.api.interfaces.modularui.IAddUIWidgets; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; import gregtech.api.objects.GT_RenderedTexture; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; @@ -30,7 +41,8 @@ import org.apache.commons.lang3.reflect.FieldUtils; /** * Created by danie_000 on 15.12.2016. */ -public class GT_MetaTileEntity_Hatch_Uncertainty extends GT_MetaTileEntity_Hatch { +public class GT_MetaTileEntity_Hatch_Uncertainty extends GT_MetaTileEntity_Hatch + implements IAddGregtechLogo, IAddUIWidgets { private static Textures.BlockIcons.CustomIcon ScreenON; private static Textures.BlockIcons.CustomIcon ScreenOFF; public short[] matrix = @@ -58,19 +70,6 @@ public class GT_MetaTileEntity_Hatch_Uncertainty extends GT_MetaTileEntity_Hatch ScreenON = new Textures.BlockIcons.CustomIcon("iconsets/UC_ACTIVE"); } - @Override - public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_Container_Uncertainty(aPlayerInventory, aBaseMetaTileEntity); - } - - @Override - public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - if (mTier > 7) { - return new GT_GUIContainer_UncertaintyAdv(aPlayerInventory, aBaseMetaTileEntity); - } - return new GT_GUIContainer_Uncertainty(aPlayerInventory, aBaseMetaTileEntity); - } - @Override public ITexture[] getTexturesActive(ITexture aBaseTexture) { return new ITexture[] {aBaseTexture, new GT_RenderedTexture(ScreenON)}; @@ -188,7 +187,7 @@ public class GT_MetaTileEntity_Hatch_Uncertainty extends GT_MetaTileEntity_Hatch } catch (Exception e) { clientLocale = "en_US"; } - aBaseMetaTileEntity.openGUI(aPlayer); + GT_UIInfos.openGTTileEntityUI(aBaseMetaTileEntity, aPlayer); return true; } @@ -333,4 +332,140 @@ public class GT_MetaTileEntity_Hatch_Uncertainty extends GT_MetaTileEntity_Hatch // GT_Utility.sendChatToPlayer(aPlayer, "Equation mode: "+mode); // } // } + + @Override + public boolean useModularUI() { + return true; + } + + @Override + public void addGregTechLogo(ModularWindow.Builder builder) { + builder.widget(new DrawableWidget() + .setDrawable(TecTechUITextures.PICTURE_TECTECH_LOGO_DARK) + .setSize(18, 18) + .setPos(112, 55)); + } + + @Override + public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { + final boolean isAdvanced = mTier > 7; + + builder.widget(new DrawableWidget() + .setDrawable(TecTechUITextures.BACKGROUND_SCREEN_BLUE) + .setPos(43, 4) + .setSize(90, 72)) + .widget(new DrawableWidget() + .setDrawable(TecTechUITextures.PICTURE_UNCERTAINTY_MONITOR) + .setPos(46, 27) + .setSize(46, 46)); + + int[] xPositions = new int[] {7, 25, 133, 151}; + for (int i = 0; i < 4; i++) { + for (int j = 0; j < 4; j++) { + final int index = i * 4 + j; + builder.widget(new ButtonWidget() + .setOnClick((clickData, widget) -> { + TecTech.proxy.playSound(getBaseMetaTileEntity(), "fx_click"); + if (selection == -1) { + selection = (byte) index; + } else { + short temp = matrix[selection]; + matrix[selection] = matrix[index]; + matrix[index] = temp; + selection = -1; + } + compute(); + }) + .setPlayClickSound(false) + .setBackground( + GT_UITextures.BUTTON_STANDARD, + TecTechUITextures.OVERLAY_BUTTON_UNCERTAINTY[index]) + .setPos(xPositions[i], 4 + j * 18) + .setSize(18, 18)) + .widget(new FakeSyncWidget.ShortSyncer(() -> matrix[index], val -> matrix[index] = val)); + } + } + builder.widget(new FakeSyncWidget.ByteSyncer(() -> selection, val -> selection = val)) + .widget(new FakeSyncWidget.ByteSyncer(() -> mode, val -> mode = val)) + .widget(new FakeSyncWidget.ByteSyncer(() -> status, val -> status = val)); + + builder.widget(TextWidget.dynamicString(() -> "Status: " + (status == 0 ? "OK" : "NG")) + .setSynced(false) + .setDefaultColor(COLOR_TEXT_WHITE.get()) + .setPos(46, 7)); + + for (int i = 0; i < 9; i++) { + final int index = i; + builder.widget(new DrawableWidget() + .setDrawable(() -> { + UITexture valid = TecTechUITextures.PICTURE_UNCERTAINTY_VALID[index]; + UITexture invalid = TecTechUITextures.PICTURE_UNCERTAINTY_INVALID[index]; + switch (mode) { + case 1: // ooo oxo ooo + if (index == 4) return status == 0 ? valid : invalid; + break; + case 2: // ooo xox ooo + if (index == 3) return (status & 1) == 0 ? valid : invalid; + if (index == 5) return (status & 2) == 0 ? valid : invalid; + break; + case 3: // oxo xox oxo + if (index == 1) return (status & 1) == 0 ? valid : invalid; + if (index == 3) return (status & 2) == 0 ? valid : invalid; + if (index == 5) return (status & 4) == 0 ? valid : invalid; + if (index == 7) return (status & 8) == 0 ? valid : invalid; + break; + case 4: // xox ooo xox + if (index == 0) return (status & 1) == 0 ? valid : invalid; + if (index == 2) return (status & 2) == 0 ? valid : invalid; + if (index == 6) return (status & 4) == 0 ? valid : invalid; + if (index == 8) return (status & 8) == 0 ? valid : invalid; + break; + case 5: // xox oxo xox + if (index == 0) return (status & 1) == 0 ? valid : invalid; + if (index == 2) return (status & 2) == 0 ? valid : invalid; + if (index == 4) return (status & 4) == 0 ? valid : invalid; + if (index == 6) return (status & 8) == 0 ? valid : invalid; + if (index == 8) return (status & 16) == 0 ? valid : invalid; + break; + } + return null; + }) + .setPos(55 + (index % 3) * 12, 36 + (index / 3) * 12) + .setSize(4, 4)); + } + + for (int i = 0; i < 16; i++) { + final int index = i; + builder.widget( + new DrawableWidget() { + @Override + public void draw(float partialTicks) { + if (isAdvanced) { + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glColor4f(1f, 1f, 1f, (float) matrix[index] / 1000f); + + // super.draw but without disabling blend + GlStateManager.pushMatrix(); + getDrawable().draw(Pos2d.ZERO, getSize(), partialTicks); + GlStateManager.popMatrix(); + + glDisable(GL_BLEND); + glColor4f(1f, 1f, 1f, 1f); + } else { + if (TecTech.RANDOM.nextInt(1000) < matrix[index]) { + super.draw(partialTicks); + } + } + } + }.setDrawable(TecTechUITextures.PICTURE_UNCERTAINTY_INDICATOR) + .setPos(47 + (i / 4) * 12, 28 + (i % 4) * 12) + .setSize(8, 8)) + .widget(new DrawableWidget() + .setDrawable( + () -> selection == index ? TecTechUITextures.PICTURE_UNCERTAINTY_SELECTED : null) + .setPos(46 + (i / 4) * 12, 27 + (i % 4) * 12) + .setSize(10, 10)); + } + } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_Uncertainty.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_Uncertainty.java deleted file mode 100644 index 88dab21c37..0000000000 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_Uncertainty.java +++ /dev/null @@ -1,127 +0,0 @@ -package com.github.technus.tectech.thing.metaTileEntity.hatch.gui; - -import com.github.technus.tectech.TecTech; -import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_Uncertainty; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.gui.GT_ContainerMetaTile_Machine; -import gregtech.api.gui.GT_Slot_Holo; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.ICrafting; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; - -public class GT_Container_Uncertainty extends GT_ContainerMetaTile_Machine { - public short[] matrix = - new short[] {500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500}; - public byte selection = -1, mode = 0, status = -128; - - public GT_Container_Uncertainty(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { - super(aInventoryPlayer, aTileEntity); - } - - @Override - public void addSlots(InventoryPlayer aInventoryPlayer) { - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 8, 5, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 8, 23, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 8, 41, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 8, 59, false, false, 1)); - - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 26, 5, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 26, 23, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 26, 41, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 26, 59, false, false, 1)); - - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 134, 5, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 134, 23, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 134, 41, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 134, 59, false, false, 1)); - - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 152, 5, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 152, 23, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 152, 41, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 152, 59, false, false, 1)); - } - - @Override - public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) { - if (aSlotIndex < 0) { - return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); - } - Slot tSlot = (Slot) inventorySlots.get(aSlotIndex); - if (tSlot != null && mTileEntity.getMetaTileEntity() != null) { - GT_MetaTileEntity_Hatch_Uncertainty catH = - (GT_MetaTileEntity_Hatch_Uncertainty) mTileEntity.getMetaTileEntity(); - if (aSlotIndex < 16 && catH.matrix != null) { - IGregTechTileEntity base = catH.getBaseMetaTileEntity(); - TecTech.proxy.playSound(base, "fx_click"); - if (catH.selection == -1) { - catH.selection = (byte) aSlotIndex; - } else { - short temp = catH.matrix[catH.selection]; - catH.matrix[catH.selection] = catH.matrix[aSlotIndex]; - catH.matrix[aSlotIndex] = temp; - catH.selection = -1; - } - } - } - return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); - } - - @Override - public void detectAndSendChanges() { - super.detectAndSendChanges(); - if (mTileEntity.isClientSide() || mTileEntity.getMetaTileEntity() == null) { - return; - } - - ((GT_MetaTileEntity_Hatch_Uncertainty) mTileEntity.getMetaTileEntity()).compute(); - - if (matrix != null) { - for (int i = 0; i < 16; i++) { - matrix[i] = ((GT_MetaTileEntity_Hatch_Uncertainty) mTileEntity.getMetaTileEntity()).matrix[i]; - } - } - - selection = ((GT_MetaTileEntity_Hatch_Uncertainty) mTileEntity.getMetaTileEntity()).selection; - mode = ((GT_MetaTileEntity_Hatch_Uncertainty) mTileEntity.getMetaTileEntity()).mode; - status = ((GT_MetaTileEntity_Hatch_Uncertainty) mTileEntity.getMetaTileEntity()).status; - - for (Object crafter : crafters) { - ICrafting var1 = (ICrafting) crafter; - var1.sendProgressBarUpdate(this, 100, selection); - var1.sendProgressBarUpdate(this, 101, mode); - var1.sendProgressBarUpdate(this, 102, status); - - if (matrix != null) { - for (int i = 0; i < 16; i++) { - var1.sendProgressBarUpdate(this, 103 + i, matrix[i]); - } - } - } - } - - @Override - @SideOnly(Side.CLIENT) - public void updateProgressBar(int par1, int par2) { - super.updateProgressBar(par1, par2); - switch (par1) { - case 100: - selection = (byte) par2; - break; - case 101: - mode = (byte) par2; - break; - case 102: - status = (byte) par2; - break; - default: - if (matrix != null && par1 >= 103 && par1 < 119) { - matrix[par1 - 103] = (short) par2; - break; - } - } - } -} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Uncertainty.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Uncertainty.java deleted file mode 100644 index 5ef1ac9bc5..0000000000 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Uncertainty.java +++ /dev/null @@ -1,82 +0,0 @@ -package com.github.technus.tectech.thing.metaTileEntity.hatch.gui; - -import static gregtech.api.enums.GT_Values.RES_PATH_GUI; - -import com.github.technus.tectech.TecTech; -import com.github.technus.tectech.font.TecTechFontRender; -import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import net.minecraft.entity.player.InventoryPlayer; -import org.lwjgl.opengl.GL11; - -public class GT_GUIContainer_Uncertainty extends GT_GUIContainerMetaTile_Machine { - public GT_GUIContainer_Uncertainty(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { - super(new GT_Container_Uncertainty(aInventoryPlayer, aTileEntity), RES_PATH_GUI + "Uncertainty.png"); - } - - @Override - protected void drawGuiContainerForegroundLayer(int par1, int par2) { - TecTechFontRender.INSTANCE.drawSplitString("Schr\u00F6dinger", 46, 7, 167, 0xffffff); - if (mContainer != null && ((GT_Container_Uncertainty) mContainer).status == 0) { - TecTechFontRender.INSTANCE.drawSplitString("Status: OK", 46, 16, 167, 0xffffff); - } else { - TecTechFontRender.INSTANCE.drawSplitString("Status: NG", 46, 16, 167, 0xffffff); - } - } - - @Override - protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { - super.drawGuiContainerBackgroundLayer(par1, par2, par3); - int x = (width - xSize) / 2; - int y = (height - ySize) / 2; - drawTexturedModalRect(x, y, 0, 0, xSize, ySize); - if (mContainer != null && ((GT_Container_Uncertainty) mContainer).matrix != null) { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - short bU = 0, rU = 70, fU = 192, V = 210, Vs = 216; - x += 52; - y += 33; - int state = ((GT_Container_Uncertainty) mContainer).status; - switch (((GT_Container_Uncertainty) mContainer).mode) { - case 1: // ooo oxo ooo - drawTexturedModalRect(x + 12, y + 12, rU + (state == 0 ? 76 : 12), Vs + 12, 10, 10); - break; - case 2: // ooo xox ooo - drawTexturedModalRect(x, y + 12, rU + ((state & 1) == 0 ? 64 : 0), Vs + 12, 10, 10); - drawTexturedModalRect(x + 24, y + 12, rU + ((state & 2) == 0 ? 88 : 24), Vs + 12, 10, 10); - break; - case 3: // oxo xox oxo - drawTexturedModalRect(x + 12, y, rU + ((state & 1) == 0 ? 76 : 12), Vs, 10, 10); - drawTexturedModalRect(x, y + 12, rU + ((state & 2) == 0 ? 64 : 0), Vs + 12, 10, 10); - drawTexturedModalRect(x + 24, y + 12, rU + ((state & 4) == 0 ? 88 : 24), Vs + 12, 10, 10); - drawTexturedModalRect(x + 12, y + 24, rU + ((state & 8) == 0 ? 76 : 12), Vs + 24, 10, 10); - break; - case 4: // xox ooo xox - drawTexturedModalRect(x, y, rU + ((state & 1) == 0 ? 64 : 0), Vs, 10, 10); - drawTexturedModalRect(x + 24, y, rU + ((state & 2) == 0 ? 88 : 24), Vs, 10, 10); - drawTexturedModalRect(x, y + 24, rU + ((state & 4) == 0 ? 64 : 0), Vs + 24, 10, 10); - drawTexturedModalRect(x + 24, y + 24, rU + ((state & 8) == 0 ? 88 : 24), Vs + 24, 10, 10); - break; - case 5: // xox oxo xox - drawTexturedModalRect(x, y, rU + ((state & 1) == 0 ? 64 : 0), Vs, 10, 10); - drawTexturedModalRect(x + 24, y, rU + ((state & 2) == 0 ? 88 : 24), Vs, 10, 10); - drawTexturedModalRect(x + 12, y + 12, rU + ((state & 4) == 0 ? 76 : 12), Vs + 12, 10, 10); - drawTexturedModalRect(x, y + 24, rU + ((state & 8) == 0 ? 64 : 0), Vs + 24, 10, 10); - drawTexturedModalRect(x + 24, y + 24, rU + ((state & 16) == 0 ? 88 : 24), Vs + 24, 10, 10); - break; - } - x -= 6; - y -= 6; - for (int i = 0; i < 16; i++) { - if (TecTech.RANDOM.nextInt(1000) < ((GT_Container_Uncertainty) mContainer).matrix[i]) { - drawTexturedModalRect( - x + 12 * (i / 4), y + 12 * (i % 4), fU + 12 * (i / 4), V + 12 * (i % 4), 10, 10); - } - } - if (((GT_Container_Uncertainty) mContainer).selection > -1) { - int sel = ((GT_Container_Uncertainty) mContainer).selection; - drawTexturedModalRect( - x + 12 * (sel / 4), y + 12 * (sel % 4), bU + 12 * (sel / 4), V + 12 * (sel % 4), 10, 10); - } - } - } -} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_UncertaintyAdv.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_UncertaintyAdv.java deleted file mode 100644 index 1e9bccfe88..0000000000 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_UncertaintyAdv.java +++ /dev/null @@ -1,86 +0,0 @@ -package com.github.technus.tectech.thing.metaTileEntity.hatch.gui; - -import static gregtech.api.enums.GT_Values.RES_PATH_GUI; -import static org.lwjgl.opengl.GL11.*; - -import com.github.technus.tectech.font.TecTechFontRender; -import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import net.minecraft.entity.player.InventoryPlayer; - -public class GT_GUIContainer_UncertaintyAdv extends GT_GUIContainerMetaTile_Machine { - protected static final short sX = 52, sY = 33, bU = 0, rU = 70, fU = 192, V = 210, Vs = 216; - - public GT_GUIContainer_UncertaintyAdv(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { - super(new GT_Container_Uncertainty(aInventoryPlayer, aTileEntity), RES_PATH_GUI + "Uncertainty.png"); - } - - @Override - protected void drawGuiContainerForegroundLayer(int par1, int par2) { - TecTechFontRender.INSTANCE.drawSplitString("Schr\u00F6dinger X", 46, 7, 167, 0xffffff); - if (mContainer != null && ((GT_Container_Uncertainty) mContainer).status == 0) { - TecTechFontRender.INSTANCE.drawSplitString("Status: OK", 46, 16, 167, 0xffffff); - } else { - TecTechFontRender.INSTANCE.drawSplitString("Status: NG", 46, 16, 167, 0xffffff); - } - } - - @Override - protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { - super.drawGuiContainerBackgroundLayer(par1, par2, par3); - int x = (width - xSize) / 2; - int y = (height - ySize) / 2; - drawTexturedModalRect(x, y, 0, 0, xSize, ySize); - if (mContainer != null && ((GT_Container_Uncertainty) mContainer).matrix != null) { - glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - x += sX; - y += sY; - int state = ((GT_Container_Uncertainty) mContainer).status; - switch (((GT_Container_Uncertainty) mContainer).mode) { - case 1: // ooo oxo ooo - drawTexturedModalRect(x + 12, y + 12, rU + (state == 0 ? 76 : 12), Vs + 12, 10, 10); - break; - case 2: // ooo xox ooo - drawTexturedModalRect(x, y + 12, rU + ((state & 1) == 0 ? 64 : 0), Vs + 12, 10, 10); - drawTexturedModalRect(x + 24, y + 12, rU + ((state & 2) == 0 ? 88 : 24), Vs + 12, 10, 10); - break; - case 3: // oxo xox oxo - drawTexturedModalRect(x + 12, y, rU + ((state & 1) == 0 ? 76 : 12), Vs, 10, 10); - drawTexturedModalRect(x, y + 12, rU + ((state & 2) == 0 ? 64 : 0), Vs + 12, 10, 10); - drawTexturedModalRect(x + 24, y + 12, rU + ((state & 4) == 0 ? 88 : 24), Vs + 12, 10, 10); - drawTexturedModalRect(x + 12, y + 24, rU + ((state & 8) == 0 ? 76 : 12), Vs + 24, 10, 10); - break; - case 4: // xox ooo xox - drawTexturedModalRect(x, y, rU + ((state & 1) == 0 ? 64 : 0), Vs, 10, 10); - drawTexturedModalRect(x + 24, y, rU + ((state & 2) == 0 ? 88 : 24), Vs, 10, 10); - drawTexturedModalRect(x, y + 24, rU + ((state & 4) == 0 ? 64 : 0), Vs + 24, 10, 10); - drawTexturedModalRect(x + 24, y + 24, rU + ((state & 8) == 0 ? 88 : 24), Vs + 24, 10, 10); - break; - case 5: // xox ooo xox - drawTexturedModalRect(x, y, rU + ((state & 1) == 0 ? 64 : 0), Vs, 10, 10); - drawTexturedModalRect(x + 24, y, rU + ((state & 2) == 0 ? 88 : 24), Vs, 10, 10); - drawTexturedModalRect(x + 12, y + 12, rU + ((state & 4) == 0 ? 76 : 12), Vs + 12, 10, 10); - drawTexturedModalRect(x, y + 24, rU + ((state & 8) == 0 ? 64 : 0), Vs + 24, 10, 10); - drawTexturedModalRect(x + 24, y + 24, rU + ((state & 16) == 0 ? 88 : 24), Vs + 24, 10, 10); - break; - } - x -= 6; - y -= 6; - - glEnable(GL_BLEND); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - for (int i = 0; i < 16; i++) { - glColor4f(1f, 1f, 1f, (float) ((GT_Container_Uncertainty) mContainer).matrix[i] / 1000f); - drawTexturedModalRect(x + 12 * (i / 4), y + 12 * (i % 4), fU + 12 * (i / 4), V + 12 * (i % 4), 10, 10); - } - glDisable(GL_BLEND); - - glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - if (((GT_Container_Uncertainty) mContainer).selection > -1) { - int sel = ((GT_Container_Uncertainty) mContainer).selection; - drawTexturedModalRect( - x + 12 * (sel / 4), y + 12 * (sel % 4), bU + 12 * (sel / 4), V + 12 * (sel % 4), 10, 10); - } - } - } -} diff --git a/src/main/resources/assets/gregtech/textures/gui/Uncertainty.png b/src/main/resources/assets/gregtech/textures/gui/Uncertainty.png deleted file mode 100644 index 8afdd68ccc..0000000000 Binary files a/src/main/resources/assets/gregtech/textures/gui/Uncertainty.png and /dev/null differ diff --git a/src/main/resources/assets/tectech/textures/gui/background/screen_blue.png b/src/main/resources/assets/tectech/textures/gui/background/screen_blue.png new file mode 100644 index 0000000000..3f70db25e7 Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/background/screen_blue.png differ diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/0.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/0.png new file mode 100644 index 0000000000..4beeaf609c Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/0.png differ diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/1.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/1.png new file mode 100644 index 0000000000..125ff851f0 Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/1.png differ diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/10.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/10.png new file mode 100644 index 0000000000..6e28c85673 Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/10.png differ diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/11.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/11.png new file mode 100644 index 0000000000..498246457d Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/11.png differ diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/12.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/12.png new file mode 100644 index 0000000000..f8c25b8625 Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/12.png differ diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/13.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/13.png new file mode 100644 index 0000000000..f900fba9a2 Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/13.png differ diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/14.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/14.png new file mode 100644 index 0000000000..a0ca048fa7 Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/14.png differ diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/15.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/15.png new file mode 100644 index 0000000000..5f88156010 Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/15.png differ diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/2.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/2.png new file mode 100644 index 0000000000..cfe3bc8922 Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/2.png differ diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/3.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/3.png new file mode 100644 index 0000000000..cc04de0089 Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/3.png differ diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/4.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/4.png new file mode 100644 index 0000000000..84d45df4c2 Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/4.png differ diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/5.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/5.png new file mode 100644 index 0000000000..45f1196611 Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/5.png differ diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/6.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/6.png new file mode 100644 index 0000000000..685991502e Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/6.png differ diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/7.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/7.png new file mode 100644 index 0000000000..8e9c590652 Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/7.png differ diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/8.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/8.png new file mode 100644 index 0000000000..3fae38f805 Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/8.png differ diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/9.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/9.png new file mode 100644 index 0000000000..477400df07 Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/9.png differ diff --git a/src/main/resources/assets/tectech/textures/gui/picture/tectech_logo_dark.png b/src/main/resources/assets/tectech/textures/gui/picture/tectech_logo_dark.png new file mode 100644 index 0000000000..bf12f0ccdb Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/picture/tectech_logo_dark.png differ diff --git a/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/indicator.png b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/indicator.png new file mode 100644 index 0000000000..fc56d4663d Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/indicator.png differ diff --git a/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/invalid_0.png b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/invalid_0.png new file mode 100644 index 0000000000..a5b0d20b38 Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/invalid_0.png differ diff --git a/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/invalid_1.png b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/invalid_1.png new file mode 100644 index 0000000000..39ec7d8ef0 Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/invalid_1.png differ diff --git a/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/invalid_2.png b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/invalid_2.png new file mode 100644 index 0000000000..b6a26cd8b1 Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/invalid_2.png differ diff --git a/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/invalid_3.png b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/invalid_3.png new file mode 100644 index 0000000000..4bc12814a4 Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/invalid_3.png differ diff --git a/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/invalid_4.png b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/invalid_4.png new file mode 100644 index 0000000000..c4e0f07e22 Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/invalid_4.png differ diff --git a/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/invalid_5.png b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/invalid_5.png new file mode 100644 index 0000000000..1dce4d241d Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/invalid_5.png differ diff --git a/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/invalid_6.png b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/invalid_6.png new file mode 100644 index 0000000000..17c55cb05d Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/invalid_6.png differ diff --git a/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/invalid_7.png b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/invalid_7.png new file mode 100644 index 0000000000..0d25fffa61 Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/invalid_7.png differ diff --git a/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/invalid_8.png b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/invalid_8.png new file mode 100644 index 0000000000..f7c4d01ff6 Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/invalid_8.png differ diff --git a/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/monitor.png b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/monitor.png new file mode 100644 index 0000000000..2510a1a99c Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/monitor.png differ diff --git a/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/selected.png b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/selected.png new file mode 100644 index 0000000000..3837244126 Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/selected.png differ diff --git a/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/valid_0.png b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/valid_0.png new file mode 100644 index 0000000000..aa0d038e86 Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/valid_0.png differ diff --git a/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/valid_1.png b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/valid_1.png new file mode 100644 index 0000000000..66ef4ee2af Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/valid_1.png differ diff --git a/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/valid_2.png b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/valid_2.png new file mode 100644 index 0000000000..bffac90814 Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/valid_2.png differ diff --git a/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/valid_3.png b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/valid_3.png new file mode 100644 index 0000000000..1c66b00bc1 Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/valid_3.png differ diff --git a/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/valid_4.png b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/valid_4.png new file mode 100644 index 0000000000..17a5f107d4 Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/valid_4.png differ diff --git a/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/valid_5.png b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/valid_5.png new file mode 100644 index 0000000000..68617d1f96 Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/valid_5.png differ diff --git a/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/valid_6.png b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/valid_6.png new file mode 100644 index 0000000000..0ea0bddaed Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/valid_6.png differ diff --git a/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/valid_7.png b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/valid_7.png new file mode 100644 index 0000000000..1801437459 Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/valid_7.png differ diff --git a/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/valid_8.png b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/valid_8.png new file mode 100644 index 0000000000..89181e29e9 Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/valid_8.png differ -- cgit From 654bdd5096b30d2bc50816aeaf96145a0d0caa74 Mon Sep 17 00:00:00 2001 From: miozune Date: Fri, 18 Nov 2022 22:39:28 +0900 Subject: Multiblock --- dependencies.gradle | 2 +- .../tectech/thing/gui/TecTechUITextures.java | 48 ++- .../hatch/GT_MetaTileEntity_Hatch_Holder.java | 4 +- .../hatch/GT_MetaTileEntity_Hatch_Rack.java | 6 +- .../multi/GT_MetaTileEntity_EM_dataBank.java | 35 +- .../multi/GT_MetaTileEntity_EM_infuser.java | 29 +- .../multi/GT_MetaTileEntity_EM_transformer.java | 29 +- .../multi/GT_MetaTileEntity_TM_microwave.java | 33 +- .../multi/base/GT_Container_MultiMachineEM.java | 1 + .../multi/base/GT_GUIContainer_MultiMachineEM.java | 1 + .../base/GT_MetaTileEntity_MultiblockBase_EM.java | 392 +++++++++++++++++++-- .../tectech/textures/gui/button/standard_16x16.png | Bin 109 -> 107 bytes .../textures/gui/button/standard_light_16x16.png | Bin 0 -> 109 bytes .../gui/overlay_button/power_pass_disabled.png | Bin 0 -> 144 bytes .../textures/gui/overlay_button/power_pass_off.png | Bin 0 -> 272 bytes .../textures/gui/overlay_button/power_pass_on.png | Bin 0 -> 234 bytes .../gui/overlay_button/power_switch_disabled.png | Bin 0 -> 182 bytes .../gui/overlay_button/power_switch_off.png | Bin 182 -> 331 bytes .../gui/overlay_button/safe_void_disabled.png | Bin 0 -> 158 bytes .../textures/gui/overlay_button/safe_void_off.png | Bin 0 -> 373 bytes .../textures/gui/overlay_button/safe_void_on.png | Bin 0 -> 393 bytes .../tectech/textures/gui/overlay_slot/mesh.png | Bin 0 -> 137 bytes .../textures/gui/picture/heat_sink_small.png | Bin 0 -> 106 bytes .../textures/gui/picture/parameter_blank.png | Bin 0 -> 332 bytes .../textures/gui/picture/parameter_blue.png | Bin 0 -> 234 bytes .../textures/gui/picture/parameter_cyan.png | Bin 0 -> 184 bytes .../textures/gui/picture/parameter_gray.png | Bin 0 -> 79 bytes .../textures/gui/picture/parameter_green.png | Bin 0 -> 250 bytes .../textures/gui/picture/parameter_orange.png | Bin 0 -> 235 bytes .../tectech/textures/gui/picture/parameter_red.png | Bin 0 -> 219 bytes .../picture/uncertainty/monitor_multimachine.png | Bin 0 -> 185 bytes 31 files changed, 476 insertions(+), 104 deletions(-) create mode 100644 src/main/resources/assets/tectech/textures/gui/button/standard_light_16x16.png create mode 100644 src/main/resources/assets/tectech/textures/gui/overlay_button/power_pass_disabled.png create mode 100644 src/main/resources/assets/tectech/textures/gui/overlay_button/power_pass_off.png create mode 100644 src/main/resources/assets/tectech/textures/gui/overlay_button/power_pass_on.png create mode 100644 src/main/resources/assets/tectech/textures/gui/overlay_button/power_switch_disabled.png create mode 100644 src/main/resources/assets/tectech/textures/gui/overlay_button/safe_void_disabled.png create mode 100644 src/main/resources/assets/tectech/textures/gui/overlay_button/safe_void_off.png create mode 100644 src/main/resources/assets/tectech/textures/gui/overlay_button/safe_void_on.png create mode 100644 src/main/resources/assets/tectech/textures/gui/overlay_slot/mesh.png create mode 100644 src/main/resources/assets/tectech/textures/gui/picture/heat_sink_small.png create mode 100644 src/main/resources/assets/tectech/textures/gui/picture/parameter_blank.png create mode 100644 src/main/resources/assets/tectech/textures/gui/picture/parameter_blue.png create mode 100644 src/main/resources/assets/tectech/textures/gui/picture/parameter_cyan.png create mode 100644 src/main/resources/assets/tectech/textures/gui/picture/parameter_gray.png create mode 100644 src/main/resources/assets/tectech/textures/gui/picture/parameter_green.png create mode 100644 src/main/resources/assets/tectech/textures/gui/picture/parameter_orange.png create mode 100644 src/main/resources/assets/tectech/textures/gui/picture/parameter_red.png create mode 100644 src/main/resources/assets/tectech/textures/gui/picture/uncertainty/monitor_multimachine.png (limited to 'dependencies.gradle') diff --git a/dependencies.gradle b/dependencies.gradle index 983d1205ce..0180eebb0b 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -2,7 +2,7 @@ dependencies { shadowImplementation('com.github.GTNewHorizons:AVRcore:master-SNAPSHOT') - compile('com.github.GTNewHorizons:GT5-Unofficial:5.09.41.128-pre:dev') + compile('com.github.GTNewHorizons:GT5-Unofficial:5.09.41.135-pre:dev') compile('com.github.GTNewHorizons:Yamcl:0.5.84:dev') compile('com.github.GTNewHorizons:NotEnoughItems:2.3.7-GTNH:dev') compile('com.github.GTNewHorizons:CodeChickenLib:1.1.5.5:dev') diff --git a/src/main/java/com/github/technus/tectech/thing/gui/TecTechUITextures.java b/src/main/java/com/github/technus/tectech/thing/gui/TecTechUITextures.java index 26c484f4b1..b09984e388 100644 --- a/src/main/java/com/github/technus/tectech/thing/gui/TecTechUITextures.java +++ b/src/main/java/com/github/technus/tectech/thing/gui/TecTechUITextures.java @@ -13,7 +13,11 @@ public class TecTechUITextures { AdaptableUITexture.of(MODID, "gui/background/screen_blue", 90, 72, 2); public static final UITexture BUTTON_STANDARD_16x16 = UITexture.fullImage(MODID, "gui/button/standard_16x16"); + public static final UITexture BUTTON_STANDARD_LIGHT_16x16 = + UITexture.fullImage(MODID, "gui/button/standard_light_16x16"); + public static final UITexture OVERLAY_BUTTON_POWER_SWITCH_DISABLED = + UITexture.fullImage(MODID, "gui/overlay_button/power_switch_disabled"); public static final UITexture OVERLAY_BUTTON_POWER_SWITCH_OFF = UITexture.fullImage(MODID, "gui/overlay_button/power_switch_off"); public static final UITexture OVERLAY_BUTTON_POWER_SWITCH_ON = @@ -23,9 +27,22 @@ public class TecTechUITextures { public static final UITexture[] OVERLAY_BUTTON_UNCERTAINTY = IntStream.range(0, 16) .mapToObj(i -> UITexture.fullImage(MODID, "gui/overlay_button/uncertainty/" + i)) .collect(Collectors.toList()) - .toArray(new UITexture[] {}); + .toArray(new UITexture[0]); + public static final UITexture OVERLAY_BUTTON_SAFE_VOID_DISABLED = + UITexture.fullImage(MODID, "gui/overlay_button/safe_void_disabled"); + public static final UITexture OVERLAY_BUTTON_SAFE_VOID_OFF = + UITexture.fullImage(MODID, "gui/overlay_button/safe_void_off"); + public static final UITexture OVERLAY_BUTTON_SAFE_VOID_ON = + UITexture.fullImage(MODID, "gui/overlay_button/safe_void_on"); + public static final UITexture OVERLAY_BUTTON_POWER_PASS_DISABLED = + UITexture.fullImage(MODID, "gui/overlay_button/power_pass_disabled"); + public static final UITexture OVERLAY_BUTTON_POWER_PASS_OFF = + UITexture.fullImage(MODID, "gui/overlay_button/power_pass_off"); + public static final UITexture OVERLAY_BUTTON_POWER_PASS_ON = + UITexture.fullImage(MODID, "gui/overlay_button/power_pass_on"); public static final UITexture OVERLAY_SLOT_RACK = UITexture.fullImage(MODID, "gui/overlay_slot/rack"); + public static final UITexture OVERLAY_SLOT_MESH = UITexture.fullImage(MODID, "gui/overlay_slot/mesh"); public static final UITexture PICTURE_TECTECH_LOGO = UITexture.fullImage(MODID, "gui/picture/tectech_logo"); public static final UITexture PICTURE_TECTECH_LOGO_DARK = @@ -41,9 +58,34 @@ public class TecTechUITextures { public static final UITexture[] PICTURE_UNCERTAINTY_VALID = IntStream.range(0, 9) .mapToObj(i -> UITexture.fullImage(MODID, "gui/picture/uncertainty/valid_" + i)) .collect(Collectors.toList()) - .toArray(new UITexture[] {}); + .toArray(new UITexture[0]); public static final UITexture[] PICTURE_UNCERTAINTY_INVALID = IntStream.range(0, 9) .mapToObj(i -> UITexture.fullImage(MODID, "gui/picture/uncertainty/invalid_" + i)) .collect(Collectors.toList()) - .toArray(new UITexture[] {}); + .toArray(new UITexture[0]); + public static final UITexture PICTURE_HEAT_SINK_SMALL = UITexture.fullImage(MODID, "gui/picture/heat_sink_small"); + public static final UITexture PICTURE_PARAMETER_BLANK = UITexture.fullImage(MODID, "gui/picture/parameter_blank"); + public static final UITexture[] PICTURE_PARAMETER_BLUE = IntStream.range(0, 20) + .mapToObj(i -> UITexture.partly(MODID, "gui/picture/parameter_blue", 158, 4, i * 8, 0, i * 8 + 6, 4)) + .collect(Collectors.toList()) + .toArray(new UITexture[0]); + public static final UITexture[] PICTURE_PARAMETER_CYAN = IntStream.range(0, 20) + .mapToObj(i -> UITexture.partly(MODID, "gui/picture/parameter_cyan", 158, 4, i * 8, 0, i * 8 + 6, 4)) + .collect(Collectors.toList()) + .toArray(new UITexture[0]); + public static final UITexture[] PICTURE_PARAMETER_GREEN = IntStream.range(0, 20) + .mapToObj(i -> UITexture.partly(MODID, "gui/picture/parameter_green", 158, 4, i * 8, 0, i * 8 + 6, 4)) + .collect(Collectors.toList()) + .toArray(new UITexture[0]); + public static final UITexture[] PICTURE_PARAMETER_ORANGE = IntStream.range(0, 20) + .mapToObj(i -> UITexture.partly(MODID, "gui/picture/parameter_orange", 158, 4, i * 8, 0, i * 8 + 6, 4)) + .collect(Collectors.toList()) + .toArray(new UITexture[0]); + public static final UITexture[] PICTURE_PARAMETER_RED = IntStream.range(0, 20) + .mapToObj(i -> UITexture.partly(MODID, "gui/picture/parameter_red", 158, 4, i * 8, 0, i * 8 + 6, 4)) + .collect(Collectors.toList()) + .toArray(new UITexture[0]); + public static final UITexture PICTURE_PARAMETER_GRAY = UITexture.fullImage(MODID, "gui/picture/parameter_gray"); + public static final UITexture PICTURE_UNCERTAINTY_MONITOR_MULTIMACHINE = + UITexture.fullImage(MODID, "gui/picture/uncertainty/monitor_multimachine"); } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Holder.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Holder.java index 9381f432f3..af6197be39 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Holder.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Holder.java @@ -160,13 +160,13 @@ public class GT_MetaTileEntity_Hatch_Holder extends GT_MetaTileEntity_Hatch impl }) .setPos(79, 38)) .widget(new DrawableWidget() - .setDrawable(TecTechUITextures.BUTTON_STANDARD_16x16) + .setDrawable(TecTechUITextures.BUTTON_STANDARD_LIGHT_16x16) .setPos(152, 24) .setSize(16, 16)) .widget(new DrawableWidget() .setDrawable(() -> getBaseMetaTileEntity().isActive() ? TecTechUITextures.OVERLAY_BUTTON_POWER_SWITCH_ON - : TecTechUITextures.OVERLAY_BUTTON_POWER_SWITCH_OFF) + : TecTechUITextures.OVERLAY_BUTTON_POWER_SWITCH_DISABLED) .setPos(152, 24) .setSize(16, 16)) .widget(new FakeSyncWidget.BooleanSyncer( diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Rack.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Rack.java index cede4a33b1..b99e030559 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Rack.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Rack.java @@ -328,20 +328,20 @@ public class GT_MetaTileEntity_Hatch_Rack extends GT_MetaTileEntity_Hatch implem .setPos(positions[i])); builder.widget(new DrawableWidget() - .setDrawable(TecTechUITextures.BUTTON_STANDARD_16x16) + .setDrawable(TecTechUITextures.BUTTON_STANDARD_LIGHT_16x16) .setPos(152, 24) .setSize(16, 16)) .widget(new DrawableWidget() .setDrawable(() -> getBaseMetaTileEntity().isActive() ? TecTechUITextures.OVERLAY_BUTTON_POWER_SWITCH_ON - : TecTechUITextures.OVERLAY_BUTTON_POWER_SWITCH_OFF) + : TecTechUITextures.OVERLAY_BUTTON_POWER_SWITCH_DISABLED) .setPos(152, 24) .setSize(16, 16)) .widget(new FakeSyncWidget.BooleanSyncer( () -> getBaseMetaTileEntity().isActive(), val -> getBaseMetaTileEntity().setActive(val))); builder.widget(new DrawableWidget() - .setDrawable(TecTechUITextures.BUTTON_STANDARD_16x16) + .setDrawable(TecTechUITextures.BUTTON_STANDARD_LIGHT_16x16) .setPos(152, 41) .setSize(16, 16)) .widget(new DrawableWidget() diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dataBank.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dataBank.java index 01eab07bd5..c663fea79b 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dataBank.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dataBank.java @@ -14,8 +14,6 @@ import com.github.technus.tectech.Reference; import com.github.technus.tectech.mechanics.dataTransport.InventoryDataPacket; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_InputDataItems; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_OutputDataItems; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_Container_MultiMachineEM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_GUIContainer_MultiMachineEM; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture; import com.github.technus.tectech.util.CommonValues; @@ -38,7 +36,6 @@ import java.util.Arrays; import java.util.Collections; import java.util.List; import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; @@ -175,23 +172,6 @@ public class GT_MetaTileEntity_EM_dataBank extends GT_MetaTileEntity_MultiblockB } } - @Override - public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_Container_MultiMachineEM(aPlayerInventory, aBaseMetaTileEntity, true, false, true); - } - - @Override - public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_MultiMachineEM( - aPlayerInventory, - aBaseMetaTileEntity, - getLocalName(), - "EMDisplay.png", - true, - false, - true); // todo texture - } - @Override public ITexture[] getTexture( IGregTechTileEntity aBaseMetaTileEntity, @@ -301,4 +281,19 @@ public class GT_MetaTileEntity_EM_dataBank extends GT_MetaTileEntity_MultiblockB return GT_MetaTileEntity_EM_dataBank::addDataBankHatchToMachineList; } } + + @Override + public boolean isPowerPassButtonEnabled() { + return true; + } + + @Override + public boolean isSafeVoidButtonEnabled() { + return false; + } + + @Override + public boolean isAllowedToWorkButtonEnabled() { + return true; + } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java index d7159ab682..de338c53e8 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java @@ -12,8 +12,6 @@ import static net.minecraft.util.StatCollector.translateToLocal; import cofh.api.energy.IEnergyContainerItem; import com.github.technus.tectech.Reference; import com.github.technus.tectech.TecTech; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_Container_MultiMachineEM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_GUIContainer_MultiMachineEM; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; import com.github.technus.tectech.util.CommonValues; import com.gtnewhorizon.structurelib.alignment.constructable.IConstructable; @@ -27,7 +25,6 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import ic2.api.item.ElectricItem; import ic2.api.item.IElectricItem; -import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; @@ -277,17 +274,6 @@ public class GT_MetaTileEntity_EM_infuser extends GT_MetaTileEntity_MultiblockBa return tt; } - @Override - public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_Container_MultiMachineEM(aPlayerInventory, aBaseMetaTileEntity, true, false, true); - } - - @Override - public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_MultiMachineEM( - aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "EMDisplay.png", true, false, true); - } - public static final ResourceLocation activitySound = new ResourceLocation(Reference.MODID + ":fx_whooum"); @Override @@ -310,4 +296,19 @@ public class GT_MetaTileEntity_EM_infuser extends GT_MetaTileEntity_MultiblockBa public String[] getStructureDescription(ItemStack stackSize) { return description; } + + @Override + public boolean isPowerPassButtonEnabled() { + return true; + } + + @Override + public boolean isSafeVoidButtonEnabled() { + return false; + } + + @Override + public boolean isAllowedToWorkButtonEnabled() { + return true; + } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_transformer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_transformer.java index 613dbe0e21..faf94436ce 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_transformer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_transformer.java @@ -13,8 +13,6 @@ import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; import static net.minecraft.util.StatCollector.translateToLocal; import com.github.technus.tectech.Reference; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_Container_MultiMachineEM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_GUIContainer_MultiMachineEM; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture; import com.github.technus.tectech.util.CommonValues; @@ -29,7 +27,6 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.ResourceLocation; @@ -153,17 +150,6 @@ public class GT_MetaTileEntity_EM_transformer extends GT_MetaTileEntity_Multiblo return tt; } - @Override - public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_Container_MultiMachineEM(aPlayerInventory, aBaseMetaTileEntity, true, false, false); - } - - @Override - public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_MultiMachineEM( - aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "EMDisplay.png", true, false, false); - } - @Override public ITexture[] getTexture( IGregTechTileEntity aBaseMetaTileEntity, @@ -224,4 +210,19 @@ public class GT_MetaTileEntity_EM_transformer extends GT_MetaTileEntity_Multiblo public String[] getStructureDescription(ItemStack stackSize) { return description; } + + @Override + public boolean isPowerPassButtonEnabled() { + return true; + } + + @Override + public boolean isSafeVoidButtonEnabled() { + return false; + } + + @Override + public boolean isAllowedToWorkButtonEnabled() { + return false; + } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_microwave.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_microwave.java index 4406977759..112405ff05 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_microwave.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_microwave.java @@ -29,7 +29,6 @@ import java.util.HashSet; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.EnumChatFormatting; @@ -239,23 +238,6 @@ public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_Multiblock return tt; } - @Override - public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_Container_MultiMachineEM(aPlayerInventory, aBaseMetaTileEntity, true, false, true); - } - - @Override - public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_MultiMachineEM( - aPlayerInventory, - aBaseMetaTileEntity, - getLocalName(), - "EMDisplay.png", - true, - false, - true); // todo texture - } - @Override public ITexture[] getTexture( IGregTechTileEntity aBaseMetaTileEntity, @@ -326,4 +308,19 @@ public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_Multiblock public String[] getStructureDescription(ItemStack stackSize) { return description; } + + @Override + public boolean isPowerPassButtonEnabled() { + return true; + } + + @Override + public boolean isSafeVoidButtonEnabled() { + return false; + } + + @Override + public boolean isAllowedToWorkButtonEnabled() { + return true; + } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_Container_MultiMachineEM.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_Container_MultiMachineEM.java index a26003dd74..66d7acf2c2 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_Container_MultiMachineEM.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_Container_MultiMachineEM.java @@ -11,6 +11,7 @@ import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; +@Deprecated public class GT_Container_MultiMachineEM extends GT_ContainerMetaTile_Machine { public LedStatus[] eParamsInStatus = LedStatus.makeArray(20, LedStatus.STATUS_UNDEFINED); public LedStatus[] eParamsOutStatus = LedStatus.makeArray(20, LedStatus.STATUS_UNDEFINED); diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_GUIContainer_MultiMachineEM.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_GUIContainer_MultiMachineEM.java index 0c20d76dae..cca5eee361 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_GUIContainer_MultiMachineEM.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_GUIContainer_MultiMachineEM.java @@ -15,6 +15,7 @@ import org.lwjgl.opengl.GL12; /** * Created by Tec on 21.02.2017. */ +@Deprecated public class GT_GUIContainer_MultiMachineEM extends GT_GUIContainerMetaTile_Machine { protected final String mName; protected static byte counter = 0; diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java index bc5cece66c..17ca3ae2d9 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java @@ -7,6 +7,7 @@ import static com.github.technus.tectech.util.CommonValues.*; import static com.github.technus.tectech.util.DoubleCount.div; import static com.github.technus.tectech.util.TT_Utility.getTier; import static gregtech.api.enums.GT_HatchElement.*; +import static gregtech.api.metatileentity.BaseTileEntity.TOOLTIP_DELAY; import static java.lang.Math.min; import com.github.technus.tectech.Reference; @@ -15,6 +16,7 @@ import com.github.technus.tectech.mechanics.elementalMatter.core.EMException; import com.github.technus.tectech.mechanics.elementalMatter.core.maps.EMInstanceStackMap; import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.EMDefinitionStack; import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.EMInstanceStack; +import com.github.technus.tectech.thing.gui.TecTechUITextures; import com.github.technus.tectech.thing.metaTileEntity.hatch.*; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture; import com.github.technus.tectech.util.TT_Utility; @@ -29,6 +31,17 @@ import com.gtnewhorizon.structurelib.structure.IItemSource; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.IStructureElement; import com.gtnewhorizon.structurelib.util.Vec3Impl; +import com.gtnewhorizons.modularui.api.drawable.IDrawable; +import com.gtnewhorizons.modularui.api.drawable.UITexture; +import com.gtnewhorizons.modularui.api.math.Pos2d; +import com.gtnewhorizons.modularui.api.screen.ModularWindow; +import com.gtnewhorizons.modularui.api.screen.UIBuildContext; +import com.gtnewhorizons.modularui.api.widget.Widget; +import com.gtnewhorizons.modularui.common.widget.ButtonWidget; +import com.gtnewhorizons.modularui.common.widget.DrawableWidget; +import com.gtnewhorizons.modularui.common.widget.DynamicPositionedColumn; +import com.gtnewhorizons.modularui.common.widget.FakeSyncWidget; +import com.gtnewhorizons.modularui.common.widget.SlotWidget; import cpw.mods.fml.common.network.NetworkRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -36,6 +49,7 @@ import gregtech.api.enums.Textures; import gregtech.api.interfaces.IHatchElement; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.modularui.IBindPlayerInventoryUI; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.BaseTileEntity; import gregtech.api.metatileentity.MetaTileEntity; @@ -51,19 +65,19 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.ResourceLocation; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; +import org.lwjgl.opengl.GL11; /** * Created by danie_000 on 27.10.2016. */ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEntity_TooltipMultiBlockBase - implements IAlignment { + implements IAlignment, IBindPlayerInventoryUI { // region Client side variables (static - one per class) // Front icon holders - static so it is default one for my blocks @@ -516,33 +530,6 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt // region GUI/SOUND/RENDER - /** - * Server side container - * - * @param aID - * @param aPlayerInventory - * @param aBaseMetaTileEntity - * @return - */ - @Override - public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_Container_MultiMachineEM(aPlayerInventory, aBaseMetaTileEntity); - } - - /** - * Client side gui - * - * @param aID - * @param aPlayerInventory - * @param aBaseMetaTileEntity - * @return - */ - @Override - public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_MultiMachineEM( - aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "EMDisplay.png"); - } - /** * add more textures * @@ -2904,4 +2891,351 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt } return false; } + + // region ModularUI + + @Override + public int getGUIWidth() { + return 198; + } + + @Override + public int getGUIHeight() { + return 192; + } + + @Override + public void bindPlayerInventoryUI(ModularWindow.Builder builder, UIBuildContext buildContext) { + builder.bindPlayerInventory( + buildContext.getPlayer(), new Pos2d(7, 109), getGUITextureSet().getItemSlot()); + } + + public boolean isPowerPassButtonEnabled() { + return true; + } + + public boolean isSafeVoidButtonEnabled() { + return true; + } + + public boolean isAllowedToWorkButtonEnabled() { + return true; + } + + @Override + public void addGregTechLogo(ModularWindow.Builder builder) { + builder.widget(new DrawableWidget() + .setDrawable(TecTechUITextures.PICTURE_TECTECH_LOGO_DARK) + .setSize(18, 18) + .setPos(173, 74)); + } + + private static byte LEDCounter = 0; + + @Override + public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { + builder.widget(new DrawableWidget() + .setDrawable(TecTechUITextures.BACKGROUND_SCREEN_BLUE) + .setPos(4, 4) + .setSize(190, 91)); + final SlotWidget inventorySlot = new SlotWidget(inventoryHandler, 1); + builder.widget(inventorySlot + .setBackground(getGUITextureSet().getItemSlot(), TecTechUITextures.OVERLAY_SLOT_MESH) + .setPos(173, 167)) + .widget(new DrawableWidget() + .setDrawable(TecTechUITextures.PICTURE_HEAT_SINK_SMALL) + .setPos(173, 185) + .setSize(18, 6)); + + final DynamicPositionedColumn screenElements = new DynamicPositionedColumn(); + drawTexts(screenElements, inventorySlot); + builder.widget(screenElements.setPos(7, 8)); + + Widget powerPassButton = new ButtonWidget() + .setOnClick((clickData, widget) -> { + if (isPowerPassButtonEnabled() || ePowerPassCover) { + TecTech.proxy.playSound(getBaseMetaTileEntity(), "fx_click"); + ePowerPass = !ePowerPass; + if (!isAllowedToWorkButtonEnabled()) { // TRANSFORMER HACK + if (ePowerPass) { + getBaseMetaTileEntity().enableWorking(); + } else { + getBaseMetaTileEntity().disableWorking(); + } + } + } + }) + .setPlayClickSound(false) + .setBackground(() -> { + List ret = new ArrayList<>(); + ret.add(TecTechUITextures.BUTTON_STANDARD_16x16); + if (!isPowerPassButtonEnabled() && !ePowerPassCover) { + ret.add(TecTechUITextures.OVERLAY_BUTTON_POWER_PASS_DISABLED); + } else { + if (ePowerPass) { + ret.add(TecTechUITextures.OVERLAY_BUTTON_POWER_PASS_ON); + } else { + ret.add(TecTechUITextures.OVERLAY_BUTTON_POWER_PASS_OFF); + } + } + return ret.toArray(new IDrawable[0]); + }) + .setPos(174, 116) + .setSize(16, 16); + if (isPowerPassButtonEnabled()) { + powerPassButton.addTooltip("Power Pass").setTooltipShowUpDelay(TOOLTIP_DELAY); + } + builder.widget(powerPassButton) + .widget(new FakeSyncWidget.BooleanSyncer(() -> ePowerPass, val -> ePowerPass = val)) + .widget(new FakeSyncWidget.BooleanSyncer(() -> ePowerPassCover, val -> ePowerPassCover = val)); + Widget safeVoidButton = new ButtonWidget() + .setOnClick((clickData, widget) -> { + if (isSafeVoidButtonEnabled()) { + TecTech.proxy.playSound(getBaseMetaTileEntity(), "fx_click"); + eSafeVoid = !eSafeVoid; + } + }) + .setPlayClickSound(false) + .setBackground(() -> { + List ret = new ArrayList<>(); + ret.add(TecTechUITextures.BUTTON_STANDARD_16x16); + if (!isSafeVoidButtonEnabled()) { + ret.add(TecTechUITextures.OVERLAY_BUTTON_SAFE_VOID_DISABLED); + } else { + if (eSafeVoid) { + ret.add(TecTechUITextures.OVERLAY_BUTTON_SAFE_VOID_ON); + } else { + ret.add(TecTechUITextures.OVERLAY_BUTTON_SAFE_VOID_OFF); + } + } + return ret.toArray(new IDrawable[0]); + }) + .setPos(174, 132) + .setSize(16, 16); + if (isSafeVoidButtonEnabled()) { + safeVoidButton.addTooltip("Safe Void").setTooltipShowUpDelay(TOOLTIP_DELAY); + } + builder.widget(safeVoidButton) + .widget(new FakeSyncWidget.BooleanSyncer(() -> eSafeVoid, val -> eSafeVoid = val)); + Widget powerSwitchButton = new ButtonWidget() + .setOnClick((clickData, widget) -> { + if (isAllowedToWorkButtonEnabled()) { + TecTech.proxy.playSound(getBaseMetaTileEntity(), "fx_click"); + if (getBaseMetaTileEntity().isAllowedToWork()) { + getBaseMetaTileEntity().disableWorking(); + } else { + getBaseMetaTileEntity().enableWorking(); + } + } + }) + .setPlayClickSound(false) + .setBackground(() -> { + List ret = new ArrayList<>(); + ret.add(TecTechUITextures.BUTTON_STANDARD_16x16); + if (!isAllowedToWorkButtonEnabled()) { + ret.add(TecTechUITextures.OVERLAY_BUTTON_POWER_SWITCH_DISABLED); + } else { + if (getBaseMetaTileEntity().isAllowedToWork()) { + ret.add(TecTechUITextures.OVERLAY_BUTTON_POWER_SWITCH_ON); + } else { + ret.add(TecTechUITextures.OVERLAY_BUTTON_POWER_SWITCH_OFF); + } + } + return ret.toArray(new IDrawable[0]); + }) + .setPos(174, 148) + .setSize(16, 16); + if (isAllowedToWorkButtonEnabled()) { + powerSwitchButton.addTooltip("Power Switch").setTooltipShowUpDelay(TOOLTIP_DELAY); + } + builder.widget(powerSwitchButton) + .widget(new FakeSyncWidget.BooleanSyncer( + () -> getBaseMetaTileEntity().isAllowedToWork(), val -> { + if (val) getBaseMetaTileEntity().enableWorking(); + else getBaseMetaTileEntity().disableWorking(); + })); + + builder.widget( + new DrawableWidget() { + @Override + public void draw(float partialTicks) { + super.draw(partialTicks); + LEDCounter = (byte) ((1 + LEDCounter) % 6); + } + }.setDrawable(TecTechUITextures.PICTURE_PARAMETER_BLANK) + .setPos(5, 96) + .setSize(166, 12)); + for (int hatch = 0; hatch < 10; hatch++) { + for (int param = 0; param < 2; param++) { + addParameterLED(builder, hatch, param, true); + addParameterLED(builder, hatch, param, false); + } + } + + builder.widget(new DrawableWidget() + .setDrawable(TecTechUITextures.PICTURE_UNCERTAINTY_MONITOR_MULTIMACHINE) + .setPos(173, 96) + .setSize(18, 18)); + for (int i = 0; i < 9; i++) { + final int index = i; + builder.widget(new DrawableWidget() + .setDrawable(() -> { + UITexture valid = TecTechUITextures.PICTURE_UNCERTAINTY_VALID[index]; + UITexture invalid = TecTechUITextures.PICTURE_UNCERTAINTY_INVALID[index]; + switch (eCertainMode) { + case 1: // ooo oxo ooo + if (index == 4) return eCertainStatus == 0 ? valid : invalid; + break; + case 2: // ooo xox ooo + if (index == 3) return (eCertainStatus & 1) == 0 ? valid : invalid; + if (index == 5) return (eCertainStatus & 2) == 0 ? valid : invalid; + break; + case 3: // oxo xox oxo + if (index == 1) return (eCertainStatus & 1) == 0 ? valid : invalid; + if (index == 3) return (eCertainStatus & 2) == 0 ? valid : invalid; + if (index == 5) return (eCertainStatus & 4) == 0 ? valid : invalid; + if (index == 7) return (eCertainStatus & 8) == 0 ? valid : invalid; + break; + case 4: // xox ooo xox + if (index == 0) return (eCertainStatus & 1) == 0 ? valid : invalid; + if (index == 2) return (eCertainStatus & 2) == 0 ? valid : invalid; + if (index == 6) return (eCertainStatus & 4) == 0 ? valid : invalid; + if (index == 8) return (eCertainStatus & 8) == 0 ? valid : invalid; + break; + case 5: // xox oxo xox + if (index == 0) return (eCertainStatus & 1) == 0 ? valid : invalid; + if (index == 2) return (eCertainStatus & 2) == 0 ? valid : invalid; + if (index == 4) return (eCertainStatus & 4) == 0 ? valid : invalid; + if (index == 6) return (eCertainStatus & 8) == 0 ? valid : invalid; + if (index == 8) return (eCertainStatus & 16) == 0 ? valid : invalid; + break; + } + return null; + }) + .setPos(174 + (index % 3) * 6, 97 + (index / 3) * 6) + .setSize(4, 4)); + } + builder.widget(new FakeSyncWidget.ByteSyncer(() -> eCertainMode, val -> eCertainMode = val)) + .widget(new FakeSyncWidget.ByteSyncer(() -> eCertainStatus, val -> eCertainStatus = val)); + } + + private void addParameterLED(ModularWindow.Builder builder, int hatch, int param, boolean input) { + final int parameterIndex = hatch + param * 10; + final int posIndex = hatch * 2 + param; + builder.widget( + new DrawableWidget() { + @Override + public void draw(float partialTicks) { + IDrawable texture = null; + final LedStatus status = input + ? parametrization.eParamsInStatus[parameterIndex] + : parametrization.eParamsOutStatus[parameterIndex]; + switch (status) { + case STATUS_WTF: { + int c = LEDCounter; + if (c > 4) { + c = TecTech.RANDOM.nextInt(5); + } + switch (c) { + case 0: + texture = TecTechUITextures.PICTURE_PARAMETER_BLUE[posIndex]; + break; + case 1: + texture = TecTechUITextures.PICTURE_PARAMETER_CYAN[posIndex]; + break; + case 2: + texture = TecTechUITextures.PICTURE_PARAMETER_GREEN[posIndex]; + break; + case 3: + texture = TecTechUITextures.PICTURE_PARAMETER_ORANGE[posIndex]; + break; + case 4: + texture = TecTechUITextures.PICTURE_PARAMETER_RED[posIndex]; + break; + } + break; + } + case STATUS_WRONG: // fallthrough + if (LEDCounter < 2) { + texture = TecTechUITextures.PICTURE_PARAMETER_BLUE[posIndex]; + break; + } else if (LEDCounter < 4) { + texture = TecTechUITextures.PICTURE_PARAMETER_RED[posIndex]; + break; + } + case STATUS_OK: // ok + texture = TecTechUITextures.PICTURE_PARAMETER_GREEN[posIndex]; + break; + case STATUS_TOO_LOW: // too low blink + if (LEDCounter < 3) { + texture = TecTechUITextures.PICTURE_PARAMETER_BLUE[posIndex]; + break; + } + case STATUS_LOW: // too low + texture = TecTechUITextures.PICTURE_PARAMETER_CYAN[posIndex]; + break; + case STATUS_TOO_HIGH: // too high blink + if (LEDCounter < 3) { + texture = TecTechUITextures.PICTURE_PARAMETER_RED[posIndex]; + break; + } + case STATUS_HIGH: // too high + texture = TecTechUITextures.PICTURE_PARAMETER_ORANGE[posIndex]; + break; + case STATUS_NEUTRAL: + if (LEDCounter < 3) { + GL11.glColor4f(.85f, .9f, .95f, .5F); + } else { + GL11.glColor4f(.8f, .9f, 1f, .5F); + } + texture = TecTechUITextures.PICTURE_PARAMETER_GRAY; + break; + case STATUS_UNDEFINED: + if (LEDCounter < 3) { + GL11.glColor4f(.5f, .1f, .15f, .5F); + } else { + GL11.glColor4f(0f, .1f, .2f, .5F); + } + texture = TecTechUITextures.PICTURE_PARAMETER_GRAY; + break; + case STATUS_UNUSED: + default: + // if (GregTech_API.sColoredGUI && this.mContainer.mTileEntity != null) { + // int tColor = this.mContainer.mTileEntity.getColorization() & 15; + // if (tColor < ItemDye.field_150922_c.length) { + // tColor = ItemDye.field_150922_c[tColor]; + // GL11.glColor4f((float)(tColor >> 16 & 255) / 255.0F, (float)(tColor >> 8 & + // 255) / 255.0F, + // (float)(tColor & 255) / 255.0F, 1F); + // } + // } + // drawTexturedModalRect(x + su * i, y + sv * j, 212, 96, su+2, sv+2); + // GL11.glColor4f(1f, 1f, 1f, 1f); + // break; + } + setDrawable(texture); + super.draw(partialTicks); + GL11.glColor4f(1f, 1f, 1f, 1f); + } + }.dynamicTooltip(() -> { + if (input) { + return getFullLedDescriptionIn(hatch, param); + } else { + return getFullLedDescriptionOut(hatch, param); + } + }) + .setPos(12 + posIndex * 8, 97 + (input ? 0 : 1) * 6) + .setSize(6, 4)); + if (input) { + builder.widget(new FakeSyncWidget.ByteSyncer( + () -> parametrization.eParamsInStatus[parameterIndex].getOrdinalByte(), + val -> parametrization.eParamsInStatus[parameterIndex] = LedStatus.getStatus(val))); + } else { + builder.widget(new FakeSyncWidget.ByteSyncer( + () -> parametrization.eParamsOutStatus[parameterIndex].getOrdinalByte(), + val -> parametrization.eParamsOutStatus[parameterIndex] = LedStatus.getStatus(val))); + } + } + + // endregion } diff --git a/src/main/resources/assets/tectech/textures/gui/button/standard_16x16.png b/src/main/resources/assets/tectech/textures/gui/button/standard_16x16.png index 4071b19033..c2d191d9ce 100644 Binary files a/src/main/resources/assets/tectech/textures/gui/button/standard_16x16.png and b/src/main/resources/assets/tectech/textures/gui/button/standard_16x16.png differ diff --git a/src/main/resources/assets/tectech/textures/gui/button/standard_light_16x16.png b/src/main/resources/assets/tectech/textures/gui/button/standard_light_16x16.png new file mode 100644 index 0000000000..4071b19033 Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/button/standard_light_16x16.png differ diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/power_pass_disabled.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/power_pass_disabled.png new file mode 100644 index 0000000000..8edbc8ae1a Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/overlay_button/power_pass_disabled.png differ diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/power_pass_off.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/power_pass_off.png new file mode 100644 index 0000000000..9887dfefd9 Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/overlay_button/power_pass_off.png differ diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/power_pass_on.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/power_pass_on.png new file mode 100644 index 0000000000..6021472296 Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/overlay_button/power_pass_on.png differ diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/power_switch_disabled.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/power_switch_disabled.png new file mode 100644 index 0000000000..be40408929 Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/overlay_button/power_switch_disabled.png differ diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/power_switch_off.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/power_switch_off.png index be40408929..366fb5c8d7 100644 Binary files a/src/main/resources/assets/tectech/textures/gui/overlay_button/power_switch_off.png and b/src/main/resources/assets/tectech/textures/gui/overlay_button/power_switch_off.png differ diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/safe_void_disabled.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/safe_void_disabled.png new file mode 100644 index 0000000000..bc2b89a234 Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/overlay_button/safe_void_disabled.png differ diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/safe_void_off.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/safe_void_off.png new file mode 100644 index 0000000000..0d06a43a68 Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/overlay_button/safe_void_off.png differ diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/safe_void_on.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/safe_void_on.png new file mode 100644 index 0000000000..c5907fa3fd Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/overlay_button/safe_void_on.png differ diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_slot/mesh.png b/src/main/resources/assets/tectech/textures/gui/overlay_slot/mesh.png new file mode 100644 index 0000000000..a782e3dd7a Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/overlay_slot/mesh.png differ diff --git a/src/main/resources/assets/tectech/textures/gui/picture/heat_sink_small.png b/src/main/resources/assets/tectech/textures/gui/picture/heat_sink_small.png new file mode 100644 index 0000000000..28ac50bdc0 Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/picture/heat_sink_small.png differ diff --git a/src/main/resources/assets/tectech/textures/gui/picture/parameter_blank.png b/src/main/resources/assets/tectech/textures/gui/picture/parameter_blank.png new file mode 100644 index 0000000000..bcd4f367d9 Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/picture/parameter_blank.png differ diff --git a/src/main/resources/assets/tectech/textures/gui/picture/parameter_blue.png b/src/main/resources/assets/tectech/textures/gui/picture/parameter_blue.png new file mode 100644 index 0000000000..3bb337dcf9 Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/picture/parameter_blue.png differ diff --git a/src/main/resources/assets/tectech/textures/gui/picture/parameter_cyan.png b/src/main/resources/assets/tectech/textures/gui/picture/parameter_cyan.png new file mode 100644 index 0000000000..1595bfde06 Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/picture/parameter_cyan.png differ diff --git a/src/main/resources/assets/tectech/textures/gui/picture/parameter_gray.png b/src/main/resources/assets/tectech/textures/gui/picture/parameter_gray.png new file mode 100644 index 0000000000..685bcd0c4a Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/picture/parameter_gray.png differ diff --git a/src/main/resources/assets/tectech/textures/gui/picture/parameter_green.png b/src/main/resources/assets/tectech/textures/gui/picture/parameter_green.png new file mode 100644 index 0000000000..4464db4ef9 Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/picture/parameter_green.png differ diff --git a/src/main/resources/assets/tectech/textures/gui/picture/parameter_orange.png b/src/main/resources/assets/tectech/textures/gui/picture/parameter_orange.png new file mode 100644 index 0000000000..8838c9b61b Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/picture/parameter_orange.png differ diff --git a/src/main/resources/assets/tectech/textures/gui/picture/parameter_red.png b/src/main/resources/assets/tectech/textures/gui/picture/parameter_red.png new file mode 100644 index 0000000000..d934b38063 Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/picture/parameter_red.png differ diff --git a/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/monitor_multimachine.png b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/monitor_multimachine.png new file mode 100644 index 0000000000..b5d1afe3b8 Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/monitor_multimachine.png differ -- cgit From d6dabe7cca31dc2cba2eddce60f2746b0fb5b008 Mon Sep 17 00:00:00 2001 From: miozune Date: Sat, 19 Nov 2022 21:10:15 +0900 Subject: Parametrizers --- dependencies.gradle | 2 +- .../technus/tectech/loader/NetworkDispatcher.java | 6 - .../tectech/thing/gui/TecTechUITextures.java | 18 + .../hatch/GT_MetaTileEntity_Hatch_Param.java | 433 +++++++++++++++++++-- .../hatch/GT_MetaTileEntity_Hatch_ParamText.java | 159 +++++++- .../hatch/TextParametersMessage.java | 154 -------- .../hatch/gui/GT_Container_Param.java | 191 --------- .../hatch/gui/GT_Container_ParamAdv.java | 283 -------------- .../hatch/gui/GT_Container_ParamText.java | 156 -------- .../hatch/gui/GT_GUIContainer_Param.java | 77 ---- .../hatch/gui/GT_GUIContainer_ParamAdv.java | 85 ---- .../hatch/gui/GT_GUIContainer_ParamText.java | 207 ---------- .../assets/gregtech/textures/gui/Parametrizer.png | Bin 262972 -> 0 bytes .../gregtech/textures/gui/ParametrizerAdv.png | Bin 262972 -> 0 bytes .../gregtech/textures/gui/ParametrizerText.png | Bin 1476 -> 0 bytes .../textures/gui/multimachines/EMDisplay.png | Bin 5044 -> 0 bytes .../background/screen_blue_parametrizer_txt.png | Bin 0 -> 489 bytes .../textures/gui/overlay_button/parametrizer_0.png | Bin 0 -> 185 bytes .../textures/gui/overlay_button/parametrizer_1.png | Bin 0 -> 190 bytes .../textures/gui/overlay_button/parametrizer_c.png | Bin 0 -> 217 bytes .../gui/overlay_button/parametrizer_id.png | Bin 0 -> 200 bytes .../gui/overlay_button/parametrizer_if.png | Bin 0 -> 228 bytes .../textures/gui/overlay_button/parametrizer_s.png | Bin 0 -> 221 bytes .../textures/gui/overlay_button/parametrizer_t.png | Bin 0 -> 181 bytes .../textures/gui/overlay_button/parametrizer_x.png | Bin 0 -> 196 bytes 25 files changed, 569 insertions(+), 1202 deletions(-) delete mode 100644 src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/TextParametersMessage.java delete mode 100644 src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_Param.java delete mode 100644 src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_ParamAdv.java delete mode 100644 src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_ParamText.java delete mode 100644 src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Param.java delete mode 100644 src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_ParamAdv.java delete mode 100644 src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_ParamText.java delete mode 100644 src/main/resources/assets/gregtech/textures/gui/Parametrizer.png delete mode 100644 src/main/resources/assets/gregtech/textures/gui/ParametrizerAdv.png delete mode 100644 src/main/resources/assets/gregtech/textures/gui/ParametrizerText.png delete mode 100644 src/main/resources/assets/gregtech/textures/gui/multimachines/EMDisplay.png create mode 100644 src/main/resources/assets/tectech/textures/gui/background/screen_blue_parametrizer_txt.png create mode 100644 src/main/resources/assets/tectech/textures/gui/overlay_button/parametrizer_0.png create mode 100644 src/main/resources/assets/tectech/textures/gui/overlay_button/parametrizer_1.png create mode 100644 src/main/resources/assets/tectech/textures/gui/overlay_button/parametrizer_c.png create mode 100644 src/main/resources/assets/tectech/textures/gui/overlay_button/parametrizer_id.png create mode 100644 src/main/resources/assets/tectech/textures/gui/overlay_button/parametrizer_if.png create mode 100644 src/main/resources/assets/tectech/textures/gui/overlay_button/parametrizer_s.png create mode 100644 src/main/resources/assets/tectech/textures/gui/overlay_button/parametrizer_t.png create mode 100644 src/main/resources/assets/tectech/textures/gui/overlay_button/parametrizer_x.png (limited to 'dependencies.gradle') diff --git a/dependencies.gradle b/dependencies.gradle index 0180eebb0b..b5ed7188f0 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -2,7 +2,7 @@ dependencies { shadowImplementation('com.github.GTNewHorizons:AVRcore:master-SNAPSHOT') - compile('com.github.GTNewHorizons:GT5-Unofficial:5.09.41.135-pre:dev') + compile('com.github.GTNewHorizons:GT5-Unofficial:5.09.41.137-pre:dev') compile('com.github.GTNewHorizons:Yamcl:0.5.84:dev') compile('com.github.GTNewHorizons:NotEnoughItems:2.3.7-GTNH:dev') compile('com.github.GTNewHorizons:CodeChickenLib:1.1.5.5:dev') diff --git a/src/main/java/com/github/technus/tectech/loader/NetworkDispatcher.java b/src/main/java/com/github/technus/tectech/loader/NetworkDispatcher.java index 4b57c09ab8..738d7bfc45 100644 --- a/src/main/java/com/github/technus/tectech/loader/NetworkDispatcher.java +++ b/src/main/java/com/github/technus/tectech/loader/NetworkDispatcher.java @@ -7,7 +7,6 @@ import com.github.technus.tectech.mechanics.data.PlayerDataMessage; import com.github.technus.tectech.mechanics.enderStorage.EnderLinkCoverMessage; import com.github.technus.tectech.mechanics.pipe.PipeActivityMessage; import com.github.technus.tectech.mechanics.spark.RendererMessage; -import com.github.technus.tectech.thing.metaTileEntity.hatch.TextParametersMessage; public class NetworkDispatcher extends eu.usrv.yamcore.network.PacketDispatcher { public static NetworkDispatcher INSTANCE; @@ -35,10 +34,5 @@ public class NetworkDispatcher extends eu.usrv.yamcore.network.PacketDispatcher registerMessage( EnderLinkCoverMessage.ServerUpdateHandler.class, EnderLinkCoverMessage.EnderLinkCoverUpdate.class); registerMessage(EnderLinkCoverMessage.ClientHandler.class, EnderLinkCoverMessage.EnderLinkCoverData.class); - - registerMessage(TextParametersMessage.ServerHandler.class, TextParametersMessage.ParametersTextQuery.class); - registerMessage( - TextParametersMessage.ServerUpdateHandler.class, TextParametersMessage.ParametersTextUpdate.class); - registerMessage(TextParametersMessage.ClientHandler.class, TextParametersMessage.ParametersTextData.class); } } diff --git a/src/main/java/com/github/technus/tectech/thing/gui/TecTechUITextures.java b/src/main/java/com/github/technus/tectech/thing/gui/TecTechUITextures.java index b09984e388..14ef35b317 100644 --- a/src/main/java/com/github/technus/tectech/thing/gui/TecTechUITextures.java +++ b/src/main/java/com/github/technus/tectech/thing/gui/TecTechUITextures.java @@ -11,6 +11,8 @@ public class TecTechUITextures { public static final AdaptableUITexture BACKGROUND_SCREEN_BLUE = AdaptableUITexture.of(MODID, "gui/background/screen_blue", 90, 72, 2); + public static final UITexture BACKGROUND_SCREEN_BLUE_PARAMETRIZER_TXT = + UITexture.fullImage(MODID, "gui/background/screen_blue_parametrizer_txt"); public static final UITexture BUTTON_STANDARD_16x16 = UITexture.fullImage(MODID, "gui/button/standard_16x16"); public static final UITexture BUTTON_STANDARD_LIGHT_16x16 = @@ -40,6 +42,22 @@ public class TecTechUITextures { UITexture.fullImage(MODID, "gui/overlay_button/power_pass_off"); public static final UITexture OVERLAY_BUTTON_POWER_PASS_ON = UITexture.fullImage(MODID, "gui/overlay_button/power_pass_on"); + public static final UITexture OVERLAY_BUTTON_PARAMETRIZER_ID = + UITexture.fullImage(MODID, "gui/overlay_button/parametrizer_id"); + public static final UITexture OVERLAY_BUTTON_PARAMETRIZER_0 = + UITexture.fullImage(MODID, "gui/overlay_button/parametrizer_0"); + public static final UITexture OVERLAY_BUTTON_PARAMETRIZER_1 = + UITexture.fullImage(MODID, "gui/overlay_button/parametrizer_1"); + public static final UITexture OVERLAY_BUTTON_PARAMETRIZER_X = + UITexture.fullImage(MODID, "gui/overlay_button/parametrizer_x"); + public static final UITexture OVERLAY_BUTTON_PARAMETRIZER_S = + UITexture.fullImage(MODID, "gui/overlay_button/parametrizer_s"); + public static final UITexture OVERLAY_BUTTON_PARAMETRIZER_T = + UITexture.fullImage(MODID, "gui/overlay_button/parametrizer_t"); + public static final UITexture OVERLAY_BUTTON_PARAMETRIZER_C = + UITexture.fullImage(MODID, "gui/overlay_button/parametrizer_c"); + public static final UITexture OVERLAY_BUTTON_PARAMETRIZER_IF = + UITexture.fullImage(MODID, "gui/overlay_button/parametrizer_if"); public static final UITexture OVERLAY_SLOT_RACK = UITexture.fullImage(MODID, "gui/overlay_slot/rack"); public static final UITexture OVERLAY_SLOT_MESH = UITexture.fullImage(MODID, "gui/overlay_slot/mesh"); diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Param.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Param.java index ed6e00dccf..7a59e39c6d 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Param.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Param.java @@ -3,24 +3,35 @@ package com.github.technus.tectech.thing.metaTileEntity.hatch; import static net.minecraft.util.StatCollector.translateToLocal; import static net.minecraft.util.StatCollector.translateToLocalFormatted; -import com.github.technus.tectech.thing.metaTileEntity.hatch.gui.GT_Container_Param; -import com.github.technus.tectech.thing.metaTileEntity.hatch.gui.GT_Container_ParamAdv; -import com.github.technus.tectech.thing.metaTileEntity.hatch.gui.GT_GUIContainer_Param; -import com.github.technus.tectech.thing.metaTileEntity.hatch.gui.GT_GUIContainer_ParamAdv; +import com.github.technus.tectech.TecTech; +import com.github.technus.tectech.thing.gui.TecTechUITextures; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.util.TT_Utility; +import com.gtnewhorizons.modularui.api.drawable.IDrawable; +import com.gtnewhorizons.modularui.api.math.Alignment; +import com.gtnewhorizons.modularui.api.screen.ModularWindow; +import com.gtnewhorizons.modularui.api.screen.UIBuildContext; +import com.gtnewhorizons.modularui.common.widget.ButtonWidget; +import com.gtnewhorizons.modularui.common.widget.DrawableWidget; +import com.gtnewhorizons.modularui.common.widget.FakeSyncWidget; +import com.gtnewhorizons.modularui.common.widget.TextWidget; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.Textures; +import gregtech.api.gui.modularui.GT_UIInfos; +import gregtech.api.gui.modularui.GT_UITextures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.modularui.IAddGregtechLogo; +import gregtech.api.interfaces.modularui.IAddUIWidgets; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; import gregtech.api.objects.GT_RenderedTexture; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.atomic.AtomicInteger; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; @@ -30,7 +41,7 @@ import org.apache.commons.lang3.reflect.FieldUtils; /** * Created by danie_000 on 15.12.2016. */ -public class GT_MetaTileEntity_Hatch_Param extends GT_MetaTileEntity_Hatch { +public class GT_MetaTileEntity_Hatch_Param extends GT_MetaTileEntity_Hatch implements IAddGregtechLogo, IAddUIWidgets { public int pointer = 0; public int param = -1; public double value0D = 0; @@ -59,22 +70,6 @@ public class GT_MetaTileEntity_Hatch_Param extends GT_MetaTileEntity_Hatch { ScreenON = new Textures.BlockIcons.CustomIcon("iconsets/PARAM_ACTIVE"); } - @Override - public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - if (mTier > 5) { // TODO update mTier to 4 after recipe check - return new GT_Container_ParamAdv(aPlayerInventory, aBaseMetaTileEntity); - } - return new GT_Container_Param(aPlayerInventory, aBaseMetaTileEntity); - } - - @Override - public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - if (mTier > 5) { // TODO update mTier to 4 after recipe check - return new GT_GUIContainer_ParamAdv(aPlayerInventory, aBaseMetaTileEntity); - } - return new GT_GUIContainer_Param(aPlayerInventory, aBaseMetaTileEntity); - } - @Override public ITexture[] getTexturesActive(ITexture aBaseTexture) { return new ITexture[] {aBaseTexture, new GT_RenderedTexture(ScreenON)}; @@ -214,7 +209,7 @@ public class GT_MetaTileEntity_Hatch_Param extends GT_MetaTileEntity_Hatch { } catch (Exception e) { clientLocale = "en_US"; } - aBaseMetaTileEntity.openGUI(aPlayer); + GT_UIInfos.openGTTileEntityUI(aBaseMetaTileEntity, aPlayer); return true; } @@ -227,4 +222,396 @@ public class GT_MetaTileEntity_Hatch_Param extends GT_MetaTileEntity_Hatch { + translateToLocal("gt.blockmachines.hatch.param.desc.1") + "\u00b2" // E=mine*craft }; } + + @Override + public boolean useModularUI() { + return true; + } + + @Override + public void addGregTechLogo(ModularWindow.Builder builder) { + builder.widget(new DrawableWidget() + .setDrawable(TecTechUITextures.PICTURE_TECTECH_LOGO_DARK) + .setSize(18, 18) + .setPos(112, 55)); + } + + @Override + public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { + final boolean isAdvanced = mTier > 5; + builder.widget(new DrawableWidget() + .setDrawable(TecTechUITextures.BACKGROUND_SCREEN_BLUE) + .setPos(43, 4) + .setSize(90, 72)); + + addChangeParamButton( + builder, + (shift, columnPointer, secondRow) -> param -= shift ? 16 : 4, + 7, + 4, + GT_UITextures.OVERLAY_BUTTON_MINUS_LARGE, + TecTechUITextures.OVERLAY_BUTTON_PARAMETRIZER_ID); + addChangeParamButton( + builder, + (shift, columnPointer, secondRow) -> { + if (isAdvanced) { + if (secondRow.get()) { + secondRow.set(false); + } else { + columnPointer.addAndGet(shift ? -16 : -4); + } + } else { + value0D -= shift ? 4096 : 256; + } + }, + 7, + 22, + GT_UITextures.OVERLAY_BUTTON_MINUS_LARGE, + TecTechUITextures.OVERLAY_BUTTON_PARAMETRIZER_0); + addChangeParamButton( + builder, + (shift, columnPointer, secondRow) -> { + if (isAdvanced) { + if (secondRow.get()) { + columnPointer.addAndGet(shift ? -16 : -4); + } else { + secondRow.set(true); + } + } else { + value1D -= shift ? 4096 : 256; + } + }, + 7, + 40, + GT_UITextures.OVERLAY_BUTTON_MINUS_LARGE, + TecTechUITextures.OVERLAY_BUTTON_PARAMETRIZER_1); + addChangeParamButton( + builder, + (shift, columnPointer, secondRow) -> { + if (isAdvanced) { + if (shift) { + if (secondRow.get()) { + value1D = Double.longBitsToDouble(0xFFFF_FFFF_FFFF_FFFFL); + } else { + value0D = Double.longBitsToDouble(0xFFFF_FFFF_FFFF_FFFFL); + } + } else { + if (secondRow.get()) { + long temp = Double.doubleToLongBits(value1D); + temp |= 1L << (long) columnPointer.get(); + value1D = Double.longBitsToDouble(temp); + } else { + long temp = Double.doubleToLongBits(value0D); + temp |= 1L << (long) columnPointer.get(); + value0D = Double.longBitsToDouble(temp); + } + } + } else { + value0D /= shift ? 4096 : 256; + value1D /= shift ? 4096 : 256; + } + }, + 7, + 58, + isAdvanced ? TecTechUITextures.OVERLAY_BUTTON_PARAMETRIZER_S : GT_UITextures.OVERLAY_BUTTON_MINUS_LARGE, + isAdvanced ? null : TecTechUITextures.OVERLAY_BUTTON_PARAMETRIZER_ID); + + addChangeParamButton( + builder, + (shift, columnPointer, secondRow) -> param -= shift ? 2 : 1, + 25, + 4, + GT_UITextures.OVERLAY_BUTTON_MINUS_SMALL, + TecTechUITextures.OVERLAY_BUTTON_PARAMETRIZER_ID); + addChangeParamButton( + builder, + (shift, columnPointer, secondRow) -> { + if (isAdvanced) { + if (secondRow.get()) { + secondRow.set(false); + } else { + columnPointer.addAndGet(shift ? -2 : -1); + } + } else { + value0D -= shift ? 16 : 1; + } + }, + 25, + 22, + GT_UITextures.OVERLAY_BUTTON_MINUS_SMALL, + TecTechUITextures.OVERLAY_BUTTON_PARAMETRIZER_0); + addChangeParamButton( + builder, + (shift, columnPointer, secondRow) -> { + if (isAdvanced) { + if (secondRow.get()) { + columnPointer.addAndGet(shift ? -2 : -1); + } else { + secondRow.set(true); + } + } else { + value1D -= shift ? 16 : 1; + } + }, + 25, + 40, + GT_UITextures.OVERLAY_BUTTON_MINUS_SMALL, + TecTechUITextures.OVERLAY_BUTTON_PARAMETRIZER_1); + addChangeParamButton( + builder, + (shift, columnPointer, secondRow) -> { + if (isAdvanced) { + if (shift) { + if (secondRow.get()) { + value1D = Double.longBitsToDouble(0); + } else { + value0D = Double.longBitsToDouble(0); + } + } else { + if (secondRow.get()) { + long temp = Double.doubleToLongBits(value1D); + temp &= ~(1L << (long) columnPointer.get()); + value1D = Double.longBitsToDouble(temp); + } else { + long temp = Double.doubleToLongBits(value0D); + temp &= ~(1L << (long) columnPointer.get()); + value0D = Double.longBitsToDouble(temp); + } + } + } else { + value0D /= shift ? 16 : 2; + value1D /= shift ? 16 : 2; + } + }, + 25, + 58, + isAdvanced ? TecTechUITextures.OVERLAY_BUTTON_PARAMETRIZER_C : GT_UITextures.OVERLAY_BUTTON_MINUS_SMALL, + isAdvanced ? null : TecTechUITextures.OVERLAY_BUTTON_PARAMETRIZER_X); + + addChangeParamButton( + builder, + (shift, columnPointer, secondRow) -> param += shift ? 2 : 1, + 133, + 4, + GT_UITextures.OVERLAY_BUTTON_PLUS_SMALL, + TecTechUITextures.OVERLAY_BUTTON_PARAMETRIZER_ID); + addChangeParamButton( + builder, + (shift, columnPointer, secondRow) -> { + if (isAdvanced) { + if (secondRow.get()) { + secondRow.set(false); + } else { + columnPointer.addAndGet(shift ? 2 : 1); + } + } else { + value0D += shift ? 16 : 1; + } + }, + 133, + 22, + GT_UITextures.OVERLAY_BUTTON_PLUS_SMALL, + TecTechUITextures.OVERLAY_BUTTON_PARAMETRIZER_0); + addChangeParamButton( + builder, + (shift, columnPointer, secondRow) -> { + if (isAdvanced) { + if (secondRow.get()) { + columnPointer.addAndGet(shift ? 2 : 1); + } else { + secondRow.set(true); + } + } else { + value1D += shift ? 16 : 1; + } + }, + 133, + 40, + GT_UITextures.OVERLAY_BUTTON_PLUS_SMALL, + TecTechUITextures.OVERLAY_BUTTON_PARAMETRIZER_1); + addChangeParamButton( + builder, + (shift, columnPointer, secondRow) -> { + if (isAdvanced) { + if (shift) { + if (secondRow.get()) { + value1D = Double.longBitsToDouble(~Double.doubleToLongBits(value1D)); + } else { + value0D = Double.longBitsToDouble(~Double.doubleToLongBits(value1D)); + } + } else { + if (secondRow.get()) { + long temp = Double.doubleToLongBits(value1D); + temp ^= 1L << (long) columnPointer.get(); + value1D = Double.longBitsToDouble(temp); + } else { + long temp = Double.doubleToLongBits(value0D); + temp ^= 1L << (long) columnPointer.get(); + value0D = Double.longBitsToDouble(temp); + } + } + } else { + value0D *= shift ? 16 : 2; + value1D *= shift ? 16 : 2; + } + }, + 133, + 58, + isAdvanced ? TecTechUITextures.OVERLAY_BUTTON_PARAMETRIZER_T : GT_UITextures.OVERLAY_BUTTON_PLUS_SMALL, + isAdvanced ? null : TecTechUITextures.OVERLAY_BUTTON_PARAMETRIZER_ID); + + addChangeParamButton( + builder, + (shift, columnPointer, secondRow) -> param += shift ? 16 : 4, + 151, + 4, + GT_UITextures.OVERLAY_BUTTON_PLUS_LARGE, + TecTechUITextures.OVERLAY_BUTTON_PARAMETRIZER_ID); + addChangeParamButton( + builder, + (shift, columnPointer, secondRow) -> { + if (isAdvanced) { + if (secondRow.get()) { + secondRow.set(false); + } else { + columnPointer.addAndGet(shift ? 16 : 4); + } + } else { + value0D += shift ? 4096 : 256; + } + }, + 151, + 22, + GT_UITextures.OVERLAY_BUTTON_PLUS_LARGE, + TecTechUITextures.OVERLAY_BUTTON_PARAMETRIZER_0); + addChangeParamButton( + builder, + (shift, columnPointer, secondRow) -> { + if (isAdvanced) { + if (secondRow.get()) { + columnPointer.addAndGet(shift ? 16 : 4); + } else { + secondRow.set(true); + } + } else { + value1D += shift ? 4096 : 256; + } + }, + 151, + 40, + GT_UITextures.OVERLAY_BUTTON_PLUS_LARGE, + TecTechUITextures.OVERLAY_BUTTON_PARAMETRIZER_1); + addChangeParamButton( + builder, + (shift, columnPointer, secondRow) -> { + if (isAdvanced) { + value0D = input0D; + value1D = input1D; + } else { + value0D *= shift ? 4096 : 256; + value1D *= shift ? 4096 : 256; + } + }, + 151, + 58, + isAdvanced ? TecTechUITextures.OVERLAY_BUTTON_PARAMETRIZER_IF : GT_UITextures.OVERLAY_BUTTON_PLUS_LARGE, + isAdvanced ? null : TecTechUITextures.OVERLAY_BUTTON_PARAMETRIZER_ID); + + builder.widget(new FakeSyncWidget.IntegerSyncer(() -> pointer, val -> pointer = val)) + .widget(new FakeSyncWidget.IntegerSyncer(() -> param, val -> param = val)) + .widget(new FakeSyncWidget.DoubleSyncer(() -> value0D, val -> value0D = val)) + .widget(new FakeSyncWidget.DoubleSyncer(() -> value1D, val -> value1D = val)) + .widget(new FakeSyncWidget.DoubleSyncer(() -> input0D, val -> input0D = val)) + .widget(new FakeSyncWidget.DoubleSyncer(() -> input1D, val -> input1D = val)); + + final String CIRCLED_0 = "\u24EA"; + final String CIRCLED_1 = "\u2460"; + final String ARROW_DOWN = "\u2b07"; + final String ARROW_UP = "\u2b06"; + builder.widget(TextWidget.dynamicString(() -> (isAdvanced ? "Parameters X: " : "Parameters: ") + param) + .setSynced(false) + .setDefaultColor(COLOR_TEXT_WHITE.get()) + .setPos(46, 7)) + .widget(TextWidget.dynamicString(() -> CIRCLED_0 + ARROW_DOWN + TT_Utility.formatNumberExp(input0D)) + .setSynced(false) + .setDefaultColor(0x22ddff) + .setPos(46, 16)) + .widget(TextWidget.dynamicString(() -> CIRCLED_1 + ARROW_DOWN + TT_Utility.formatNumberExp(input1D)) + .setSynced(false) + .setDefaultColor(0x00ffff) + .setPos(46, 24)) + .widget(TextWidget.dynamicString(() -> CIRCLED_0 + ARROW_UP + TT_Utility.formatNumberExp(value0D)) + .setSynced(false) + .setDefaultColor(0x00bbff) + .setPos(46, 33)) + .widget(TextWidget.dynamicString(() -> CIRCLED_1 + ARROW_UP + TT_Utility.formatNumberExp(value1D)) + .setSynced(false) + .setDefaultColor(0x0077ff) + .setPos(46, 41)) + .widget(TextWidget.dynamicString(() -> CIRCLED_0 + + ARROW_UP + + TT_Utility.longBitsToShortString(Double.doubleToLongBits(value0D))) + .setSynced(false) + .setDefaultColor(0x00bbff) + .setScale(.5f) + .setTextAlignment(Alignment.CenterLeft) + .setPos(46, 50)) + .widget(TextWidget.dynamicString(() -> CIRCLED_1 + + ARROW_UP + + TT_Utility.longBitsToShortString(Double.doubleToLongBits(value1D))) + .setSynced(false) + .setDefaultColor(0x0077ff) + .setScale(.5f) + .setTextAlignment(Alignment.CenterLeft) + .setPos(46, 58)); + if (isAdvanced) { + builder.widget(TextWidget.dynamicString(() -> + "Pointer " + Integer.toHexString(pointer | 0x10000).substring(1)) + .setSynced(false) + .setDefaultColor(0x0033ff) + .setPos(46, 66)); + } + } + + private void addChangeParamButton( + ModularWindow.Builder builder, + OnClick onClick, + int xPos, + int yPos, + IDrawable overlay1, + IDrawable overlay2) { + final boolean isAdvanced = mTier > 5; + builder.widget(new ButtonWidget() + .setOnClick((clickData, widget) -> { + AtomicInteger columnPointer = new AtomicInteger(pointer & 0xff); + AtomicBoolean secondRow = new AtomicBoolean((pointer & 0x0100) != 0); + onClick.accept(clickData.shift, columnPointer, secondRow); + TecTech.proxy.playSound(getBaseMetaTileEntity(), "fx_click"); + if (isAdvanced) { + if (columnPointer.get() >= 64) { + columnPointer.set(63); + } else if (columnPointer.get() < 0) { + columnPointer.set(0); + } + pointer = secondRow.get() ? columnPointer.get() + 0x100 : columnPointer.get(); + } + if (param > 9) { + param = 9; + } else if (param < -1) { + param = -1; + } + }) + .setPlayClickSound(false) + .setBackground( + overlay2 != null + ? new IDrawable[] {GT_UITextures.BUTTON_STANDARD, overlay1, overlay2} + : new IDrawable[] {GT_UITextures.BUTTON_STANDARD, overlay1}) + .setSize(18, 18) + .setPos(xPos, yPos)); + } + + @FunctionalInterface + private interface OnClick { + void accept(boolean shift, AtomicInteger columnPointer, AtomicBoolean secondRow); + } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_ParamText.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_ParamText.java index e241793e0e..810c04d861 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_ParamText.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_ParamText.java @@ -3,16 +3,27 @@ package com.github.technus.tectech.thing.metaTileEntity.hatch; import static net.minecraft.util.StatCollector.translateToLocal; import static net.minecraft.util.StatCollector.translateToLocalFormatted; -import com.github.technus.tectech.loader.NetworkDispatcher; -import com.github.technus.tectech.thing.metaTileEntity.hatch.gui.GT_Container_ParamText; -import com.github.technus.tectech.thing.metaTileEntity.hatch.gui.GT_GUIContainer_ParamText; +import com.github.technus.tectech.TecTech; +import com.github.technus.tectech.thing.gui.TecTechUITextures; import com.github.technus.tectech.util.CommonValues; +import com.github.technus.tectech.util.TT_Utility; +import com.gtnewhorizons.modularui.api.drawable.IDrawable; +import com.gtnewhorizons.modularui.api.math.Alignment; +import com.gtnewhorizons.modularui.api.math.Color; +import com.gtnewhorizons.modularui.api.screen.ModularWindow; +import com.gtnewhorizons.modularui.api.screen.UIBuildContext; +import com.gtnewhorizons.modularui.common.widget.ButtonWidget; +import com.gtnewhorizons.modularui.common.widget.DrawableWidget; +import com.gtnewhorizons.modularui.common.widget.FakeSyncWidget; +import com.gtnewhorizons.modularui.common.widget.TextWidget; +import com.gtnewhorizons.modularui.common.widget.textfield.TextFieldWidget; +import gregtech.api.gui.modularui.GT_UIInfos; +import gregtech.api.gui.modularui.GT_UITextures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; @@ -36,20 +47,6 @@ public class GT_MetaTileEntity_Hatch_ParamText extends GT_MetaTileEntity_Hatch_P super(aName, aTier, aDescription, aTextures); } - @Override - public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - if (aPlayerInventory.player instanceof EntityPlayerMP) { - NetworkDispatcher.INSTANCE.sendTo( - new TextParametersMessage.ParametersTextData(this), (EntityPlayerMP) aPlayerInventory.player); - } - return new GT_Container_ParamText(aPlayerInventory, aBaseMetaTileEntity); - } - - @Override - public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_ParamText(aPlayerInventory, aBaseMetaTileEntity); - } - // @Override // public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { // if (aBaseMetaTileEntity.isClientSide() && (aTick % 20L == 0L)) { @@ -157,7 +154,7 @@ public class GT_MetaTileEntity_Hatch_ParamText extends GT_MetaTileEntity_Hatch_P } catch (Exception e) { clientLocale = "en_US"; } - aBaseMetaTileEntity.openGUI(aPlayer); + GT_UIInfos.openGTTileEntityUI(aBaseMetaTileEntity, aPlayer); return true; } @@ -170,4 +167,128 @@ public class GT_MetaTileEntity_Hatch_ParamText extends GT_MetaTileEntity_Hatch_P + translateToLocal("gt.blockmachines.hatch.param.desc.1") + "\u00b2" // E=mine*craft }; } + + @Override + public void addGregTechLogo(ModularWindow.Builder builder) { + builder.widget(new DrawableWidget() + .setDrawable(TecTechUITextures.PICTURE_TECTECH_LOGO_DARK) + .setSize(18, 18) + .setPos(148, 55)); + } + + @Override + public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { + builder.widget(new DrawableWidget() + .setDrawable(TecTechUITextures.BACKGROUND_SCREEN_BLUE_PARAMETRIZER_TXT) + .setPos(7, 4) + .setSize(162, 72)); + + addChangeNumberButton(builder, -16, -4, 7, GT_UITextures.OVERLAY_BUTTON_MINUS_LARGE); + addChangeNumberButton(builder, -2, -1, 25, GT_UITextures.OVERLAY_BUTTON_MINUS_SMALL); + addChangeNumberButton(builder, 2, 1, 133, GT_UITextures.OVERLAY_BUTTON_PLUS_SMALL); + addChangeNumberButton(builder, 16, 4, 151, GT_UITextures.OVERLAY_BUTTON_PLUS_LARGE); + + builder.widget(new FakeSyncWidget.IntegerSyncer(() -> param, val -> param = val)) + .widget(new FakeSyncWidget.DoubleSyncer(() -> value0D, val -> value0D = val)) + .widget(new FakeSyncWidget.DoubleSyncer(() -> value1D, val -> value1D = val)) + .widget(new FakeSyncWidget.DoubleSyncer(() -> input0D, val -> input0D = val)) + .widget(new FakeSyncWidget.DoubleSyncer(() -> input1D, val -> input1D = val)); + // .widget(new FakeSyncWidget.StringSyncer(() -> value0s, val -> value0s = val)) + // .widget(new FakeSyncWidget.StringSyncer(() -> value1s, val -> value1s = val)); + + final String CIRCLED_0 = "\u24EA"; + final String CIRCLED_1 = "\u2460"; + final String ARROW_DOWN = "\u2b07"; + final String ARROW_UP = "\u2b06"; + builder.widget(TextWidget.dynamicString(() -> "Parameters: " + param) + .setSynced(false) + .setDefaultColor(COLOR_TEXT_WHITE.get()) + .setPos(46, 7)) + .widget(new TextWidget(CIRCLED_0 + ARROW_UP) + .setDefaultColor(0x00bbff) + .setPos(10, 29)) + .widget(new TextWidget(CIRCLED_1 + ARROW_UP) + .setDefaultColor(0x0077ff) + .setPos(10, 44)) + .widget(TextWidget.dynamicString(() -> CIRCLED_0 + ARROW_DOWN + TT_Utility.formatNumberExp(input0D)) + .setSynced(false) + .setDefaultColor(0x22ddff) + .setPos(10, 56)) + .widget(TextWidget.dynamicString(() -> CIRCLED_1 + ARROW_DOWN + TT_Utility.formatNumberExp(input1D)) + .setSynced(false) + .setDefaultColor(0x00ffff) + .setPos(10, 65)); + + addTextField(builder, true); + addTextField(builder, false); + } + + private void addChangeNumberButton( + ModularWindow.Builder builder, int changeNumberShift, int changeNumber, int xPos, IDrawable overlay) { + builder.widget(new ButtonWidget() + .setOnClick((clickData, widget) -> { + param += clickData.shift ? changeNumberShift : changeNumber; + TecTech.proxy.playSound(getBaseMetaTileEntity(), "fx_click"); + if (param > 9) { + param = 9; + } else if (param < -1) { + param = -1; + } + }) + .setPlayClickSound(false) + .setBackground(GT_UITextures.BUTTON_STANDARD, overlay, TecTechUITextures.OVERLAY_BUTTON_PARAMETRIZER_ID) + .setSize(18, 18) + .setPos(xPos, 4)); + } + + private void addTextField(ModularWindow.Builder builder, boolean isIndex0) { + TextFieldWidget widget = new TextFieldWidget(); + builder.widget(widget.setGetter(() -> isIndex0 ? value0s : value1s) + .setSetter(str -> { + double val; + try { + val = parse(str); + } catch (Exception e) { + // This shouldn't happen as long as validator works + str = ""; + val = 0; + } + if (isIndex0) { + value0s = str; + value0D = val; + } else { + value1s = str; + value1D = val; + } + }) + .setValidator(str -> { + try { + parse(str); + return str; + } catch (Exception e) { + return widget.getLastText().size() > 0 + ? widget.getLastText().get(0) + : ""; + } + }) + .setTextColor(Color.WHITE.dark(1)) + .setTextAlignment(Alignment.CenterLeft) + .setBackground(GT_UITextures.BACKGROUND_TEXT_FIELD.withOffset(-1, -1, 2, 2)) + .setPos(26, isIndex0 ? 26 : 41) + .setSize(138, 12)); + } + + private double parse(String str) { + double val; + if (str.contains("b")) { + String[] split = str.split("b"); + val = TT_Utility.bitStringToInt(split[0].replaceAll("[^-]", "") + split[1].replaceAll("_", "")); + } else if (str.contains("x")) { + String[] split = str.split("x"); + val = TT_Utility.hexStringToInt(split[0].replaceAll("[^-]", "") + split[1].replaceAll("_", "")); + } else { + val = TT_Utility.stringToDouble(str); + } + return val; + } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/TextParametersMessage.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/TextParametersMessage.java deleted file mode 100644 index 8058c14cf4..0000000000 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/TextParametersMessage.java +++ /dev/null @@ -1,154 +0,0 @@ -package com.github.technus.tectech.thing.metaTileEntity.hatch; - -import com.github.technus.tectech.thing.metaTileEntity.hatch.gui.GT_GUIContainer_ParamText; -import com.github.technus.tectech.util.TT_Utility; -import cpw.mods.fml.common.network.ByteBufUtils; -import cpw.mods.fml.common.network.simpleimpl.IMessage; -import cpw.mods.fml.common.network.simpleimpl.MessageContext; -import eu.usrv.yamcore.network.client.AbstractClientMessageHandler; -import eu.usrv.yamcore.network.server.AbstractServerMessageHandler; -import gregtech.api.interfaces.metatileentity.IMetaTileEntity; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import io.netty.buffer.ByteBuf; -import net.minecraft.client.Minecraft; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import net.minecraftforge.common.DimensionManager; - -public class TextParametersMessage implements IMessage { - int mPosX; - int mPosY; - int mPosZ; - int mPosD; - String mVal0 = ""; - String mVal1 = ""; - - public TextParametersMessage() {} - - @Override - public void fromBytes(ByteBuf pBuffer) { - NBTTagCompound tTag = ByteBufUtils.readTag(pBuffer); - mPosX = tTag.getInteger("posx"); - mPosY = tTag.getInteger("posy"); - mPosZ = tTag.getInteger("posz"); - mPosD = tTag.getInteger("posd"); - mVal0 = tTag.getString("value0s"); - mVal1 = tTag.getString("value1s"); - } - - @Override - public void toBytes(ByteBuf pBuffer) { - NBTTagCompound tFXTag = new NBTTagCompound(); - tFXTag.setInteger("posx", mPosX); - tFXTag.setInteger("posy", mPosY); - tFXTag.setInteger("posz", mPosZ); - tFXTag.setInteger("posd", mPosD); - tFXTag.setString("value0s", mVal0); - tFXTag.setString("value1s", mVal1); - ByteBufUtils.writeTag(pBuffer, tFXTag); - } - - public static class ParametersTextQuery extends TextParametersMessage { - public ParametersTextQuery() {} - - public ParametersTextQuery(GT_MetaTileEntity_Hatch_ParamText metaTile) { - IGregTechTileEntity base = metaTile.getBaseMetaTileEntity(); - mPosX = base.getXCoord(); - mPosY = base.getYCoord(); - mPosZ = base.getZCoord(); - mPosD = base.getWorld().provider.dimensionId; - } - } - - public static class ParametersTextData extends TextParametersMessage { - public ParametersTextData() {} - - public ParametersTextData(GT_MetaTileEntity_Hatch_ParamText metaTile) { - IGregTechTileEntity base = metaTile.getBaseMetaTileEntity(); - mPosX = base.getXCoord(); - mPosY = base.getYCoord(); - mPosZ = base.getZCoord(); - mPosD = base.getWorld().provider.dimensionId; - mVal0 = metaTile.value0s; - mVal1 = metaTile.value1s; - } - } - - public static class ParametersTextUpdate extends TextParametersMessage { - public ParametersTextUpdate() {} - - public ParametersTextUpdate(GT_MetaTileEntity_Hatch_ParamText metaTile) { - IGregTechTileEntity base = metaTile.getBaseMetaTileEntity(); - mPosX = base.getXCoord(); - mPosY = base.getYCoord(); - mPosZ = base.getZCoord(); - mPosD = base.getWorld().provider.dimensionId; - mVal0 = metaTile.value0s; - mVal1 = metaTile.value1s; - } - } - - public static class ClientHandler extends AbstractClientMessageHandler { - @Override - public IMessage handleClientMessage(EntityPlayer pPlayer, ParametersTextData pMessage, MessageContext pCtx) { - if (pPlayer.worldObj.provider.dimensionId == pMessage.mPosD) { - TileEntity te = pPlayer.worldObj.getTileEntity(pMessage.mPosX, pMessage.mPosY, pMessage.mPosZ); - if (te instanceof IGregTechTileEntity) { - IMetaTileEntity meta = ((IGregTechTileEntity) te).getMetaTileEntity(); - if (meta instanceof GT_MetaTileEntity_Hatch_ParamText) { - ((GT_MetaTileEntity_Hatch_ParamText) meta).value0s = pMessage.mVal0; - ((GT_MetaTileEntity_Hatch_ParamText) meta).value1s = pMessage.mVal1; - if (Minecraft.getMinecraft().currentScreen instanceof GT_GUIContainer_ParamText) { - GT_GUIContainer_ParamText gui = - ((GT_GUIContainer_ParamText) Minecraft.getMinecraft().currentScreen); - if (gui.mContainer == meta) { - gui.setTextIn0(pMessage.mVal0); - gui.setTextIn1(pMessage.mVal1); - } - } - } - } - } - return null; - } - } - - public static class ServerHandler extends AbstractServerMessageHandler { - @Override - public IMessage handleServerMessage(EntityPlayer pPlayer, ParametersTextQuery pMessage, MessageContext pCtx) { - World world = DimensionManager.getWorld(pMessage.mPosD); - if (world != null) { - TileEntity te = world.getTileEntity(pMessage.mPosX, pMessage.mPosY, pMessage.mPosZ); - if (te instanceof IGregTechTileEntity) { - IMetaTileEntity meta = ((IGregTechTileEntity) te).getMetaTileEntity(); - if (meta instanceof GT_MetaTileEntity_Hatch_ParamText) { - return new ParametersTextData((GT_MetaTileEntity_Hatch_ParamText) meta); - } - } - } - return null; - } - } - - public static class ServerUpdateHandler extends AbstractServerMessageHandler { - @Override - public IMessage handleServerMessage(EntityPlayer pPlayer, ParametersTextUpdate pMessage, MessageContext pCtx) { - World world = DimensionManager.getWorld(pMessage.mPosD); - if (world != null) { - TileEntity te = world.getTileEntity(pMessage.mPosX, pMessage.mPosY, pMessage.mPosZ); - if (te instanceof IGregTechTileEntity) { - IMetaTileEntity meta = ((IGregTechTileEntity) te).getMetaTileEntity(); - if (meta instanceof GT_MetaTileEntity_Hatch_ParamText) { - ((GT_MetaTileEntity_Hatch_ParamText) meta).value0s = pMessage.mVal0; - ((GT_MetaTileEntity_Hatch_ParamText) meta).value1s = pMessage.mVal1; - ((GT_MetaTileEntity_Hatch_ParamText) meta).value0D = TT_Utility.getValue(pMessage.mVal0); - ((GT_MetaTileEntity_Hatch_ParamText) meta).value1D = TT_Utility.getValue(pMessage.mVal1); - } - } - } - return null; - } - } -} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_Param.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_Param.java deleted file mode 100644 index f5e0ffd45d..0000000000 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_Param.java +++ /dev/null @@ -1,191 +0,0 @@ -package com.github.technus.tectech.thing.metaTileEntity.hatch.gui; - -import com.github.technus.tectech.TecTech; -import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_Param; -import com.github.technus.tectech.util.TT_Utility; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.gui.GT_ContainerMetaTile_Machine; -import gregtech.api.gui.GT_Slot_Holo; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.ICrafting; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; - -public class GT_Container_Param extends GT_ContainerMetaTile_Machine { - public int param = 0; - public double value0d = 0; - public double value1d = 0; - public double input0d = 0; - public double input1d = 0; - public long value0l = 0; - public long value1l = 0; - public long input0l = 0; - public long input1l = 0; - - public GT_Container_Param(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { - super(aInventoryPlayer, aTileEntity); - } - - @Override - public void addSlots(InventoryPlayer aInventoryPlayer) { - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 8, 5, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 8, 23, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 8, 41, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 8, 59, false, false, 1)); - - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 26, 5, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 26, 23, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 26, 41, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 26, 59, false, false, 1)); - - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 152, 5, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 152, 23, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 152, 41, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 152, 59, false, false, 1)); - - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 134, 5, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 134, 23, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 134, 41, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 134, 59, false, false, 1)); - } - - @Override - public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) { - if (aSlotIndex < 0) { - return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); - } - Slot tSlot = (Slot) inventorySlots.get(aSlotIndex); - boolean doStuff = true; - if (tSlot != null && mTileEntity.getMetaTileEntity() != null) { - GT_MetaTileEntity_Hatch_Param paramH = (GT_MetaTileEntity_Hatch_Param) mTileEntity.getMetaTileEntity(); - switch (aSlotIndex) { - case 0: - paramH.param -= aShifthold == 1 ? 16 : 4; - break; - case 1: - paramH.value0D -= aShifthold == 1 ? 4096 : 256; - break; - case 2: - paramH.value1D -= aShifthold == 1 ? 4096 : 256; - break; - case 3: - paramH.value0D /= aShifthold == 1 ? 4096 : 256; - paramH.value1D /= aShifthold == 1 ? 4096 : 256; - break; - case 4: - paramH.param -= aShifthold == 1 ? 2 : 1; - break; - case 5: - paramH.value0D -= aShifthold == 1 ? 16 : 1; - break; - case 6: - paramH.value1D -= aShifthold == 1 ? 16 : 1; - break; - case 7: - paramH.value0D /= aShifthold == 1 ? 16 : 2; - paramH.value1D /= aShifthold == 1 ? 16 : 2; - break; - case 8: - paramH.param += aShifthold == 1 ? 16 : 4; - break; - case 9: - paramH.value0D += aShifthold == 1 ? 4096 : 256; - break; - case 10: - paramH.value1D += aShifthold == 1 ? 4096 : 256; - break; - case 11: - paramH.value0D *= aShifthold == 1 ? 4096 : 256; - paramH.value1D *= aShifthold == 1 ? 4096 : 256; - break; - case 12: - paramH.param += aShifthold == 1 ? 2 : 1; - break; - case 13: - paramH.value0D += aShifthold == 1 ? 16 : 1; - break; - case 14: - paramH.value1D += aShifthold == 1 ? 16 : 1; - break; - case 15: - paramH.value0D *= aShifthold == 1 ? 16 : 2; - paramH.value1D *= aShifthold == 1 ? 16 : 2; - break; - default: - doStuff = false; - } - if (doStuff) { - IGregTechTileEntity base = paramH.getBaseMetaTileEntity(); - TecTech.proxy.playSound(base, "fx_click"); - if (paramH.param > 9) { - paramH.param = 9; - } else if (paramH.param < -1) { - paramH.param = -1; - } - } - } - return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); - } - - @Override - public void detectAndSendChanges() { - super.detectAndSendChanges(); - if (mTileEntity.isClientSide() || mTileEntity.getMetaTileEntity() == null) { - return; - } - param = ((GT_MetaTileEntity_Hatch_Param) mTileEntity.getMetaTileEntity()).param; - value0d = ((GT_MetaTileEntity_Hatch_Param) mTileEntity.getMetaTileEntity()).value0D; - value1d = ((GT_MetaTileEntity_Hatch_Param) mTileEntity.getMetaTileEntity()).value1D; - input0d = ((GT_MetaTileEntity_Hatch_Param) mTileEntity.getMetaTileEntity()).input0D; - input1d = ((GT_MetaTileEntity_Hatch_Param) mTileEntity.getMetaTileEntity()).input1D; - - for (Object crafter : crafters) { - ICrafting var1 = (ICrafting) crafter; - TT_Utility.sendInteger(param, this, var1, 100); - TT_Utility.sendDouble(value0d, this, var1, 102); - TT_Utility.sendDouble(value1d, this, var1, 106); - TT_Utility.sendDouble(input0d, this, var1, 110); - TT_Utility.sendDouble(input1d, this, var1, 114); - } - } - - @Override - @SideOnly(Side.CLIENT) - public void updateProgressBar(int par1, int par2) { - super.updateProgressBar(par1, par2); - switch (par1) { - case 100: - case 101: - param = TT_Utility.receiveInteger(param, 100, par1, par2); - return; - case 102: - case 103: - case 104: - case 105: - value0d = Double.longBitsToDouble(value0l = TT_Utility.receiveLong(value0l, 102, par1, par2)); - return; - case 106: - case 107: - case 108: - case 109: - value1d = Double.longBitsToDouble(value1l = TT_Utility.receiveLong(value1l, 106, par1, par2)); - return; - case 110: - case 111: - case 112: - case 113: - input0d = Double.longBitsToDouble(input0l = TT_Utility.receiveLong(input0l, 110, par1, par2)); - return; - case 114: - case 115: - case 116: - case 117: - input1d = Double.longBitsToDouble(input1l = TT_Utility.receiveLong(input1l, 114, par1, par2)); - return; - default: - } - } -} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_ParamAdv.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_ParamAdv.java deleted file mode 100644 index 26faae689f..0000000000 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_ParamAdv.java +++ /dev/null @@ -1,283 +0,0 @@ -package com.github.technus.tectech.thing.metaTileEntity.hatch.gui; - -import com.github.technus.tectech.TecTech; -import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_Param; -import com.github.technus.tectech.util.TT_Utility; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.gui.GT_ContainerMetaTile_Machine; -import gregtech.api.gui.GT_Slot_Holo; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.ICrafting; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; - -public class GT_Container_ParamAdv extends GT_ContainerMetaTile_Machine { - public int pointer = 0; - public int param = 0; - public double value1d = 0; - public double value0d = 0; - public double input0d = 0; - public double input1d = 0; - public long value0l = 0; - public long value1l = 0; - public long input0l = 0; - public long input1l = 0; - - public GT_Container_ParamAdv(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { - super(aInventoryPlayer, aTileEntity); - } - - @Override - public void addSlots(InventoryPlayer aInventoryPlayer) { - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 8, 5, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 8, 23, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 8, 41, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 8, 59, false, false, 1)); - - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 26, 5, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 26, 23, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 26, 41, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 26, 59, false, false, 1)); - - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 152, 5, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 152, 23, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 152, 41, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 152, 59, false, false, 1)); - - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 134, 5, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 134, 23, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 134, 41, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 134, 59, false, false, 1)); - } - - @Override - public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) { - if (aSlotIndex < 0) { - return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); - } - Slot tSlot = (Slot) inventorySlots.get(aSlotIndex); - if (tSlot != null && mTileEntity.getMetaTileEntity() != null) { - boolean doStuff = true; - GT_MetaTileEntity_Hatch_Param paramH = (GT_MetaTileEntity_Hatch_Param) mTileEntity.getMetaTileEntity(); - int columnPointer = paramH.pointer & 0xff; - boolean secondRow = (paramH.pointer & 0x0100) != 0; - switch (aSlotIndex) { - case 0: - paramH.param -= aShifthold == 1 ? 16 : 4; - break; - case 1: - if (secondRow) { - secondRow = false; - } else { - columnPointer -= aShifthold == 1 ? 16 : 4; - } - break; - case 2: - if (secondRow) { - columnPointer -= aShifthold == 1 ? 16 : 4; - } else { - secondRow = true; - } - break; - case 3: - if (aShifthold == 1) { - if (secondRow) { - paramH.value1D = Double.longBitsToDouble(0xFFFF_FFFF_FFFF_FFFFL); - } else { - paramH.value0D = Double.longBitsToDouble(0xFFFF_FFFF_FFFF_FFFFL); - } - } else { - if (secondRow) { - long temp = Double.doubleToLongBits(paramH.value1D); - temp |= 1L << (long) columnPointer; - paramH.value1D = Double.longBitsToDouble(temp); - } else { - long temp = Double.doubleToLongBits(paramH.value0D); - temp |= 1L << (long) columnPointer; - paramH.value0D = Double.longBitsToDouble(temp); - } - } - break; - case 4: - paramH.param -= aShifthold == 1 ? 2 : 1; - break; - case 5: - if (secondRow) { - secondRow = false; - } else { - columnPointer -= aShifthold == 1 ? 2 : 1; - } - break; - case 6: - if (secondRow) { - columnPointer -= aShifthold == 1 ? 2 : 1; - } else { - secondRow = true; - } - break; - case 7: - if (aShifthold == 1) { - if (secondRow) { - paramH.value1D = Double.longBitsToDouble(0); - } else { - paramH.value0D = Double.longBitsToDouble(0); - } - } else { - if (secondRow) { - long temp = Double.doubleToLongBits(paramH.value1D); - temp &= ~(1L << (long) columnPointer); - paramH.value1D = Double.longBitsToDouble(temp); - } else { - long temp = Double.doubleToLongBits(paramH.value0D); - temp &= ~(1L << (long) columnPointer); - paramH.value0D = Double.longBitsToDouble(temp); - } - } - break; - case 8: - paramH.param += aShifthold == 1 ? 16 : 4; - break; - case 9: - if (secondRow) { - secondRow = false; - } else { - columnPointer += aShifthold == 1 ? 16 : 4; - } - break; - case 10: - if (secondRow) { - columnPointer += aShifthold == 1 ? 16 : 4; - } else { - secondRow = true; - } - break; - case 11: - paramH.value0D = paramH.input0D; - paramH.value1D = paramH.input1D; - break; - case 12: - paramH.param += aShifthold == 1 ? 2 : 1; - break; - case 13: - if (secondRow) { - secondRow = false; - } else { - columnPointer += aShifthold == 1 ? 2 : 1; - } - break; - case 14: - if (secondRow) { - columnPointer += aShifthold == 1 ? 2 : 1; - } else { - secondRow = true; - } - break; - case 15: - if (aShifthold == 1) { - if (secondRow) { - paramH.value1D = Double.longBitsToDouble(~Double.doubleToLongBits(paramH.value1D)); - } else { - paramH.value0D = Double.longBitsToDouble(~Double.doubleToLongBits(paramH.value1D)); - } - } else { - if (secondRow) { - long temp = Double.doubleToLongBits(paramH.value1D); - temp ^= 1L << (long) columnPointer; - paramH.value1D = Double.longBitsToDouble(temp); - } else { - long temp = Double.doubleToLongBits(paramH.value0D); - temp ^= 1L << (long) columnPointer; - paramH.value0D = Double.longBitsToDouble(temp); - } - } - break; - default: - doStuff = false; - } - if (doStuff) { - IGregTechTileEntity base = paramH.getBaseMetaTileEntity(); - TecTech.proxy.playSound(base, "fx_click"); - if (columnPointer >= 64) { - columnPointer = 63; - } else if (columnPointer < 0) { - columnPointer = 0; - } - paramH.pointer = secondRow ? columnPointer + 0x100 : columnPointer; - if (paramH.param > 9) { - paramH.param = 9; - } else if (paramH.param < -1) { - paramH.param = -1; - } - } - } - return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); - } - - @Override - public void detectAndSendChanges() { - super.detectAndSendChanges(); - if (mTileEntity.isClientSide() || mTileEntity.getMetaTileEntity() == null) { - return; - } - param = ((GT_MetaTileEntity_Hatch_Param) mTileEntity.getMetaTileEntity()).param; - value0d = ((GT_MetaTileEntity_Hatch_Param) mTileEntity.getMetaTileEntity()).value0D; - value1d = ((GT_MetaTileEntity_Hatch_Param) mTileEntity.getMetaTileEntity()).value1D; - input0d = ((GT_MetaTileEntity_Hatch_Param) mTileEntity.getMetaTileEntity()).input0D; - input1d = ((GT_MetaTileEntity_Hatch_Param) mTileEntity.getMetaTileEntity()).input1D; - pointer = ((GT_MetaTileEntity_Hatch_Param) mTileEntity.getMetaTileEntity()).pointer; - - for (Object crafter : crafters) { - ICrafting var1 = (ICrafting) crafter; - TT_Utility.sendInteger(param, this, var1, 100); - TT_Utility.sendDouble(value0d, this, var1, 102); - TT_Utility.sendDouble(value1d, this, var1, 106); - TT_Utility.sendDouble(input0d, this, var1, 110); - TT_Utility.sendDouble(input1d, this, var1, 114); - TT_Utility.sendInteger(pointer, this, var1, 118); - } - } - - @Override - @SideOnly(Side.CLIENT) - public void updateProgressBar(int par1, int par2) { - super.updateProgressBar(par1, par2); - switch (par1) { - case 100: - case 101: - param = TT_Utility.receiveInteger(param, 100, par1, par2); - return; - case 102: - case 103: - case 104: - case 105: - value0d = Double.longBitsToDouble(value0l = TT_Utility.receiveLong(value0l, 102, par1, par2)); - return; - case 106: - case 107: - case 108: - case 109: - value1d = Double.longBitsToDouble(value1l = TT_Utility.receiveLong(value1l, 106, par1, par2)); - return; - case 110: - case 111: - case 112: - case 113: - input0d = Double.longBitsToDouble(input0l = TT_Utility.receiveLong(input0l, 110, par1, par2)); - return; - case 114: - case 115: - case 116: - case 117: - input1d = Double.longBitsToDouble(input1l = TT_Utility.receiveLong(input1l, 114, par1, par2)); - return; - case 118: - case 119: - pointer = TT_Utility.receiveInteger(pointer, 118, par1, par2); - return; - default: - } - } -} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_ParamText.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_ParamText.java deleted file mode 100644 index f46e69184b..0000000000 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_ParamText.java +++ /dev/null @@ -1,156 +0,0 @@ -package com.github.technus.tectech.thing.metaTileEntity.hatch.gui; - -import com.github.technus.tectech.TecTech; -import com.github.technus.tectech.loader.NetworkDispatcher; -import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_ParamText; -import com.github.technus.tectech.thing.metaTileEntity.hatch.TextParametersMessage; -import com.github.technus.tectech.util.TT_Utility; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.gui.GT_ContainerMetaTile_Machine; -import gregtech.api.gui.GT_Slot_Holo; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import java.util.Objects; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.ICrafting; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; - -public class GT_Container_ParamText extends GT_ContainerMetaTile_Machine { - public int param = 0; - public double value0d = 0; - public double value1d = 0; - public double input0d = 0; - public double input1d = 0; - public long value0l = 0; - public long value1l = 0; - public long input0l = 0; - public long input1l = 0; - public String value0s = ""; - public String value1s = ""; - - public GT_Container_ParamText(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { - super(aInventoryPlayer, aTileEntity); - } - - @Override - public void addSlots(InventoryPlayer aInventoryPlayer) { - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 8, 5, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 26, 5, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 152, 5, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 134, 5, false, false, 1)); - } - - @Override - public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) { - if (aSlotIndex < 0) { - return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); - } - Slot tSlot = (Slot) inventorySlots.get(aSlotIndex); - if (tSlot != null && mTileEntity.getMetaTileEntity() != null) { - boolean doStuff = true; - GT_MetaTileEntity_Hatch_ParamText paramH = - (GT_MetaTileEntity_Hatch_ParamText) mTileEntity.getMetaTileEntity(); - switch (aSlotIndex) { - case 0: - paramH.param -= aShifthold == 1 ? 16 : 4; - break; - case 1: - paramH.param -= aShifthold == 1 ? 2 : 1; - break; - case 2: - paramH.param += aShifthold == 1 ? 16 : 4; - break; - case 3: - paramH.param += aShifthold == 1 ? 2 : 1; - break; - default: - doStuff = false; - } - if (doStuff) { - IGregTechTileEntity base = paramH.getBaseMetaTileEntity(); - TecTech.proxy.playSound(base, "fx_click"); - if (paramH.param > 9) { - paramH.param = 9; - } else if (paramH.param < -1) { - paramH.param = -1; - } - } - } - return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); - } - - @Override - public void detectAndSendChanges() { - super.detectAndSendChanges(); - if (mTileEntity.isClientSide() || mTileEntity.getMetaTileEntity() == null) { - return; - } - param = ((GT_MetaTileEntity_Hatch_ParamText) mTileEntity.getMetaTileEntity()).param; - value0d = ((GT_MetaTileEntity_Hatch_ParamText) mTileEntity.getMetaTileEntity()).value0D; - value1d = ((GT_MetaTileEntity_Hatch_ParamText) mTileEntity.getMetaTileEntity()).value1D; - input0d = ((GT_MetaTileEntity_Hatch_ParamText) mTileEntity.getMetaTileEntity()).input0D; - input1d = ((GT_MetaTileEntity_Hatch_ParamText) mTileEntity.getMetaTileEntity()).input1D; - for (Object crafter : crafters) { - ICrafting var1 = (ICrafting) crafter; - TT_Utility.sendInteger(param, this, var1, 100); - TT_Utility.sendDouble(value0d, this, var1, 102); - TT_Utility.sendDouble(value1d, this, var1, 106); - TT_Utility.sendDouble(input0d, this, var1, 110); - TT_Utility.sendDouble(input1d, this, var1, 114); - } - if (!Objects.equals(value0s, ((GT_MetaTileEntity_Hatch_ParamText) mTileEntity.getMetaTileEntity()).value0s) - || !Objects.equals( - value0s, ((GT_MetaTileEntity_Hatch_ParamText) mTileEntity.getMetaTileEntity()).value0s)) { - value0s = ((GT_MetaTileEntity_Hatch_ParamText) mTileEntity.getMetaTileEntity()).value0s; - value1s = ((GT_MetaTileEntity_Hatch_ParamText) mTileEntity.getMetaTileEntity()).value1s; - for (Object object : crafters) { - if (object instanceof EntityPlayerMP) { - NetworkDispatcher.INSTANCE.sendTo( - new TextParametersMessage.ParametersTextData( - ((GT_MetaTileEntity_Hatch_ParamText) mTileEntity.getMetaTileEntity())), - (EntityPlayerMP) object); - } - } - } - } - - @Override - @SideOnly(Side.CLIENT) - public void updateProgressBar(int par1, int par2) { - super.updateProgressBar(par1, par2); - switch (par1) { - case 100: - case 101: - param = TT_Utility.receiveInteger(param, 100, par1, par2); - return; - case 102: - case 103: - case 104: - case 105: - value0d = Double.longBitsToDouble(value0l = TT_Utility.receiveLong(value0l, 102, par1, par2)); - return; - case 106: - case 107: - case 108: - case 109: - value1d = Double.longBitsToDouble(value1l = TT_Utility.receiveLong(value1l, 106, par1, par2)); - return; - case 110: - case 111: - case 112: - case 113: - input0d = Double.longBitsToDouble(input0l = TT_Utility.receiveLong(input0l, 110, par1, par2)); - return; - case 114: - case 115: - case 116: - case 117: - input1d = Double.longBitsToDouble(input1l = TT_Utility.receiveLong(input1l, 114, par1, par2)); - return; - default: - } - } -} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Param.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Param.java deleted file mode 100644 index d5d3d64b37..0000000000 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Param.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.github.technus.tectech.thing.metaTileEntity.hatch.gui; - -import static gregtech.api.enums.GT_Values.RES_PATH_GUI; - -import com.github.technus.tectech.font.TecTechFontRender; -import com.github.technus.tectech.util.TT_Utility; -import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import net.minecraft.entity.player.InventoryPlayer; -import org.lwjgl.opengl.GL11; - -public class GT_GUIContainer_Param extends GT_GUIContainerMetaTile_Machine { - public GT_GUIContainer_Param(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { - super(new GT_Container_Param(aInventoryPlayer, aTileEntity), RES_PATH_GUI + "Parametrizer.png"); - } - - @Override - protected void drawGuiContainerForegroundLayer(int par1, int par2) { - if (mContainer != null) { - TecTechFontRender.INSTANCE.drawSplitString( - "Parameters: " + ((GT_Container_Param) mContainer).param, 46, 7, 167, 0xffffff); - TecTechFontRender.INSTANCE.drawSplitString( - "\u24EA\u2b07" + TT_Utility.formatNumberExp(((GT_Container_Param) mContainer).input0d), - 46, - 16, - 167, - 0x22ddff); - TecTechFontRender.INSTANCE.drawSplitString( - "\u2460\u2b07" + TT_Utility.formatNumberExp(((GT_Container_Param) mContainer).input1d), - 46, - 24, - 167, - 0x00ffff); - TecTechFontRender.INSTANCE.drawSplitString( - "\u24EA\u2b06" + TT_Utility.formatNumberExp(((GT_Container_Param) mContainer).value0d), - 46, - 33, - 167, - 0x00bbff); - TecTechFontRender.INSTANCE.drawSplitString( - "\u2460\u2b06" + TT_Utility.formatNumberExp(((GT_Container_Param) mContainer).value1d), - 46, - 41, - 167, - 0x0077ff); - GL11.glPushMatrix(); - GL11.glScalef(.5f, .5f, .5f); - TecTechFontRender.INSTANCE.drawSplitString( - "\u24EA\u2b06" - + TT_Utility.longBitsToShortString( - Double.doubleToLongBits(((GT_Container_Param) mContainer).value0d)), - 92, - 100, - 334, - 0x00bbff); - TecTechFontRender.INSTANCE.drawSplitString( - "\u2460\u2b06" - + TT_Utility.longBitsToShortString( - Double.doubleToLongBits(((GT_Container_Param) mContainer).value1d)), - 92, - 116, - 334, - 0x0077ff); - GL11.glPopMatrix(); - } else { - TecTechFontRender.INSTANCE.drawSplitString("Parameters", 46, 7, 167, 0xffffff); - } - } - - @Override - protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { - super.drawGuiContainerBackgroundLayer(par1, par2, par3); - int x = (width - xSize) / 2; - int y = (height - ySize) / 2; - drawTexturedModalRect(x, y, 0, 0, xSize, ySize); - } -} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_ParamAdv.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_ParamAdv.java deleted file mode 100644 index 512a70d0a5..0000000000 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_ParamAdv.java +++ /dev/null @@ -1,85 +0,0 @@ -package com.github.technus.tectech.thing.metaTileEntity.hatch.gui; - -import static gregtech.api.enums.GT_Values.RES_PATH_GUI; - -import com.github.technus.tectech.font.TecTechFontRender; -import com.github.technus.tectech.util.TT_Utility; -import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import net.minecraft.entity.player.InventoryPlayer; -import org.lwjgl.opengl.GL11; - -public class GT_GUIContainer_ParamAdv extends GT_GUIContainerMetaTile_Machine { - public GT_GUIContainer_ParamAdv(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { - super(new GT_Container_ParamAdv(aInventoryPlayer, aTileEntity), RES_PATH_GUI + "ParametrizerAdv.png"); - } - - @Override - protected void drawGuiContainerForegroundLayer(int par1, int par2) { - if (mContainer != null) { - TecTechFontRender.INSTANCE.drawSplitString( - "Parameters X: " + ((GT_Container_ParamAdv) mContainer).param, 46, 7, 167, 0xffffff); - TecTechFontRender.INSTANCE.drawSplitString( - "\u24EA\u2b07" + TT_Utility.formatNumberExp((((GT_Container_ParamAdv) mContainer).input0d)), - 46, - 16, - 167, - 0x22ddff); - TecTechFontRender.INSTANCE.drawSplitString( - "\u2460\u2b07" + TT_Utility.formatNumberExp((((GT_Container_ParamAdv) mContainer).input1d)), - 46, - 24, - 167, - 0x00ffff); - TecTechFontRender.INSTANCE.drawSplitString( - "\u24EA\u2b06" + TT_Utility.formatNumberExp((((GT_Container_ParamAdv) mContainer).value0d)), - 46, - 33, - 167, - 0x00bbff); - TecTechFontRender.INSTANCE.drawSplitString( - "\u2460\u2b06" + TT_Utility.formatNumberExp((((GT_Container_ParamAdv) mContainer).value1d)), - 46, - 41, - 167, - 0x0077ff); - GL11.glPushMatrix(); - GL11.glScalef(.5f, .5f, .5f); - TecTechFontRender.INSTANCE.drawSplitString( - "\u24EA\u2b06" - + TT_Utility.longBitsToShortString( - Double.doubleToLongBits(((GT_Container_ParamAdv) mContainer).value0d)), - 92, - 100, - 334, - 0x00bbff); - TecTechFontRender.INSTANCE.drawSplitString( - "\u2460\u2b06" - + TT_Utility.longBitsToShortString( - Double.doubleToLongBits(((GT_Container_ParamAdv) mContainer).value1d)), - 92, - 116, - 334, - 0x0077ff); - GL11.glPopMatrix(); - TecTechFontRender.INSTANCE.drawSplitString( - "Pointer " - + Integer.toHexString(((GT_Container_ParamAdv) mContainer).pointer | 0x10000) - .substring(1), - 46, - 66, - 167, - 0x0033ff); - } else { - TecTechFontRender.INSTANCE.drawSplitString("Parameters X", 46, 7, 167, 0xffffff); - } - } - - @Override - protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { - super.drawGuiContainerBackgroundLayer(par1, par2, par3); - int x = (width - xSize) / 2; - int y = (height - ySize) / 2; - drawTexturedModalRect(x, y, 0, 0, xSize, ySize); - } -} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_ParamText.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_ParamText.java deleted file mode 100644 index bff21e5f98..0000000000 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_ParamText.java +++ /dev/null @@ -1,207 +0,0 @@ -package com.github.technus.tectech.thing.metaTileEntity.hatch.gui; - -import static gregtech.api.enums.GT_Values.RES_PATH_GUI; - -import com.github.technus.tectech.font.TecTechFontRender; -import com.github.technus.tectech.loader.NetworkDispatcher; -import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_ParamText; -import com.github.technus.tectech.thing.metaTileEntity.hatch.TextParametersMessage; -import com.github.technus.tectech.util.TT_Utility; -import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import java.util.Objects; -import net.minecraft.client.gui.GuiTextField; -import net.minecraft.entity.player.InventoryPlayer; - -public class GT_GUIContainer_ParamText extends GT_GUIContainerMetaTile_Machine { - private GuiTextField value0tb; - private GuiTextField value1tb; - - public GT_GUIContainer_ParamText(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { - super(new GT_Container_ParamText(aInventoryPlayer, aTileEntity), RES_PATH_GUI + "ParametrizerText.png"); - } - - @Override - public void initGui() { - super.initGui(); - value0tb = new GuiTextField( - TecTechFontRender.INSTANCE, - (this.width - 176) / 2 + 12 + 14, - (this.height - 166) / 2 + 26, - 156 - 18, - 12); - value0tb.setMaxStringLength(80); - value1tb = new GuiTextField( - TecTechFontRender.INSTANCE, - (this.width - 176) / 2 + 12 + 14, - (this.height - 166) / 2 + 41, - 156 - 18, - 12); - value1tb.setMaxStringLength(80); - updateValues(); - } - - @Override - public void onGuiClosed() { - super.onGuiClosed(); - value0tb.setFocused(false); - value1tb.setFocused(false); - updateValues(); - } - - @Override - protected void keyTyped(char p_73869_1_, int p_73869_2_) { - value0tb.textboxKeyTyped(p_73869_1_, p_73869_2_); - value1tb.textboxKeyTyped(p_73869_1_, p_73869_2_); - if ((p_73869_2_ != 1 && p_73869_2_ != this.mc.gameSettings.keyBindInventory.getKeyCode()) - || (!value0tb.isFocused() && !value1tb.isFocused())) { - super.keyTyped(p_73869_1_, p_73869_2_); - } - updateValues(); - } - - @Override - public void updateScreen() { - super.updateScreen(); - value0tb.updateCursorCounter(); - value1tb.updateCursorCounter(); - } - - @Override - public void drawScreen(int par1, int par2, float par3) { - super.drawScreen(par1, par2, par3); - value0tb.drawTextBox(); - value1tb.drawTextBox(); - } - - @Override - protected void mouseClicked(int p_73864_1_, int p_73864_2_, int p_73864_3_) { - super.mouseClicked(p_73864_1_, p_73864_2_, p_73864_3_); - value0tb.mouseClicked(p_73864_1_, p_73864_2_, p_73864_3_); - value1tb.mouseClicked(p_73864_1_, p_73864_2_, p_73864_3_); - updateValues(); - } - - @Override - protected void drawGuiContainerForegroundLayer(int par1, int par2) { - if (mContainer != null) { - TecTechFontRender.INSTANCE.drawSplitString( - "Parameters tXt: " + ((GT_Container_ParamText) mContainer).param, 46, 7, 167, 0xffffff); - TecTechFontRender.INSTANCE.drawSplitString("\u24EA\u2b06", 10, 29, 16, 0x00bbff); - TecTechFontRender.INSTANCE.drawSplitString("\u2460\u2b06", 10, 44, 16, 0x0077ff); - TecTechFontRender.INSTANCE.drawSplitString( - "\u24EA\u2b07" + TT_Utility.formatNumberExp((((GT_Container_ParamText) mContainer).input0d)), - 10, - 56, - 167, - 0x22ddff); - TecTechFontRender.INSTANCE.drawSplitString( - "\u2460\u2b07" + TT_Utility.formatNumberExp((((GT_Container_ParamText) mContainer).input1d)), - 10, - 65, - 167, - 0x00ffff); - } else { - TecTechFontRender.INSTANCE.drawSplitString("Parameters tXt", 46, 7, 167, 0xffffff); - } - } - - @Override - protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { - super.drawGuiContainerBackgroundLayer(par1, par2, par3); - int x = (width - xSize) / 2; - int y = (height - ySize) / 2; - drawTexturedModalRect(x, y, 0, 0, xSize, ySize); - } - - private void updateValues() { - updateIn0(); - updateIn1(); - } - - private void updateIn0() { - if (!value0tb.isFocused()) { - String str = value0tb.getText().toLowerCase(); - double val; - try { - if (str.contains("b")) { - String[] split = str.split("b"); - val = TT_Utility.bitStringToInt(split[0].replaceAll("[^-]", "") + split[1].replaceAll("_", "")); - } else if (str.contains("x")) { - String[] split = str.split("x"); - val = TT_Utility.hexStringToInt(split[0].replaceAll("[^-]", "") + split[1].replaceAll("_", "")); - } else { - val = TT_Utility.stringToDouble(str); - } - if (!Objects.equals( - ((GT_MetaTileEntity_Hatch_ParamText) - ((GT_Container_ParamText) mContainer).mTileEntity.getMetaTileEntity()) - .value0s, - value0tb.getText())) { - ((GT_Container_ParamText) mContainer).value0s = value0tb.getText(); - ((GT_Container_ParamText) mContainer).value0d = val; - ((GT_MetaTileEntity_Hatch_ParamText) - ((GT_Container_ParamText) mContainer).mTileEntity.getMetaTileEntity()) - .value0s = - value0tb.getText(); - - NetworkDispatcher.INSTANCE.sendToServer( - new TextParametersMessage.ParametersTextUpdate((GT_MetaTileEntity_Hatch_ParamText) - ((GT_Container_ParamText) mContainer).mTileEntity.getMetaTileEntity())); - } - } catch (Exception e) { - value0tb.setText(((GT_MetaTileEntity_Hatch_ParamText) - ((GT_Container_ParamText) mContainer).mTileEntity.getMetaTileEntity()) - .value0s); - } - } - } - - private void updateIn1() { - if (!value1tb.isFocused()) { - String str = value1tb.getText().toLowerCase(); - double val; - try { - if (str.contains("b")) { - String[] split = str.split("b"); - val = TT_Utility.bitStringToInt(split[0].replaceAll("[^-]", "") + split[1].replaceAll("_", "")); - } else if (str.contains("x")) { - String[] split = str.split("x"); - val = TT_Utility.hexStringToInt(split[0].replaceAll("[^-]", "") + split[1].replaceAll("_", "")); - } else { - val = TT_Utility.stringToDouble(str); - } - if (!Objects.equals( - ((GT_MetaTileEntity_Hatch_ParamText) - ((GT_Container_ParamText) mContainer).mTileEntity.getMetaTileEntity()) - .value1s, - value1tb.getText())) { - ((GT_Container_ParamText) mContainer).value1s = value1tb.getText(); - ((GT_Container_ParamText) mContainer).value1d = val; - ((GT_MetaTileEntity_Hatch_ParamText) - ((GT_Container_ParamText) mContainer).mTileEntity.getMetaTileEntity()) - .value1s = - value1tb.getText(); - - NetworkDispatcher.INSTANCE.sendToServer( - new TextParametersMessage.ParametersTextUpdate((GT_MetaTileEntity_Hatch_ParamText) - ((GT_Container_ParamText) mContainer).mTileEntity.getMetaTileEntity())); - } - } catch (Exception e) { - value1tb.setText(((GT_MetaTileEntity_Hatch_ParamText) - ((GT_Container_ParamText) mContainer).mTileEntity.getMetaTileEntity()) - .value1s); - } - } - } - - public void setTextIn0(String in0) { - ((GT_Container_ParamText) mContainer).value0s = in0; - this.value0tb.setText(in0); - } - - public void setTextIn1(String in1) { - ((GT_Container_ParamText) mContainer).value1s = in1; - this.value1tb.setText(in1); - } -} diff --git a/src/main/resources/assets/gregtech/textures/gui/Parametrizer.png b/src/main/resources/assets/gregtech/textures/gui/Parametrizer.png deleted file mode 100644 index b754d2cfa5..0000000000 Binary files a/src/main/resources/assets/gregtech/textures/gui/Parametrizer.png and /dev/null differ diff --git a/src/main/resources/assets/gregtech/textures/gui/ParametrizerAdv.png b/src/main/resources/assets/gregtech/textures/gui/ParametrizerAdv.png deleted file mode 100644 index 3366ab1c14..0000000000 Binary files a/src/main/resources/assets/gregtech/textures/gui/ParametrizerAdv.png and /dev/null differ diff --git a/src/main/resources/assets/gregtech/textures/gui/ParametrizerText.png b/src/main/resources/assets/gregtech/textures/gui/ParametrizerText.png deleted file mode 100644 index da78ca5b21..0000000000 Binary files a/src/main/resources/assets/gregtech/textures/gui/ParametrizerText.png and /dev/null differ diff --git a/src/main/resources/assets/gregtech/textures/gui/multimachines/EMDisplay.png b/src/main/resources/assets/gregtech/textures/gui/multimachines/EMDisplay.png deleted file mode 100644 index e67f96e34e..0000000000 Binary files a/src/main/resources/assets/gregtech/textures/gui/multimachines/EMDisplay.png and /dev/null differ diff --git a/src/main/resources/assets/tectech/textures/gui/background/screen_blue_parametrizer_txt.png b/src/main/resources/assets/tectech/textures/gui/background/screen_blue_parametrizer_txt.png new file mode 100644 index 0000000000..d35be3f276 Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/background/screen_blue_parametrizer_txt.png differ diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/parametrizer_0.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/parametrizer_0.png new file mode 100644 index 0000000000..585859a7b2 Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/overlay_button/parametrizer_0.png differ diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/parametrizer_1.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/parametrizer_1.png new file mode 100644 index 0000000000..8d55a58ff5 Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/overlay_button/parametrizer_1.png differ diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/parametrizer_c.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/parametrizer_c.png new file mode 100644 index 0000000000..d57bbee6e6 Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/overlay_button/parametrizer_c.png differ diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/parametrizer_id.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/parametrizer_id.png new file mode 100644 index 0000000000..a7c940c97b Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/overlay_button/parametrizer_id.png differ diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/parametrizer_if.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/parametrizer_if.png new file mode 100644 index 0000000000..442c9161b7 Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/overlay_button/parametrizer_if.png differ diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/parametrizer_s.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/parametrizer_s.png new file mode 100644 index 0000000000..a47abc5829 Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/overlay_button/parametrizer_s.png differ diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/parametrizer_t.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/parametrizer_t.png new file mode 100644 index 0000000000..300c06cbf5 Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/overlay_button/parametrizer_t.png differ diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/parametrizer_x.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/parametrizer_x.png new file mode 100644 index 0000000000..ab7dcec9bb Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/overlay_button/parametrizer_x.png differ -- cgit From 00953932ea46d7ed251baa1152e9ebadda4f8231 Mon Sep 17 00:00:00 2001 From: miozune Date: Sat, 19 Nov 2022 21:22:05 +0900 Subject: cleanup --- dependencies.gradle | 8 --- repositories.gradle | 1 - .../tectech/nei/TT_NEI_ResearchHandler.java | 61 ---------------------- .../technus/tectech/nei/TT_NEI_ScannerHandler.java | 61 ---------------------- .../GT_MetaTileEntity_Hatch_InputDataItems.java | 12 ----- .../GT_MetaTileEntity_Hatch_OutputDataItems.java | 23 -------- .../single/GT_MetaTileEntity_TeslaCoil.java | 3 +- 7 files changed, 2 insertions(+), 167 deletions(-) (limited to 'dependencies.gradle') diff --git a/dependencies.gradle b/dependencies.gradle index b5ed7188f0..e5061e87d6 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -18,12 +18,4 @@ dependencies { compileOnly('curse.maven:cofh-lib-220333:2388748') {transitive=false} compileOnly('curse.maven:computercraft-67504:2269339') {transitive=false} compileOnly('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev') {transitive=false} - - // // for local - // compile('com.github.GTNewHorizons:GT5-Unofficial:5.09.41.123-pre:dev') {transitive=false} - // compile("com.github.GTNewHorizons:ModularUI:SNAPSHOT:dev") - // compile("com.github.GTNewHorizons:waila:1.5.21:dev") - // compile("com.github.GTNewHorizons:Chisel:2.10.15-GTNH:dev") { - // transitive = false - // } } diff --git a/repositories.gradle b/repositories.gradle index 053aa123b5..887a6ff8c8 100644 --- a/repositories.gradle +++ b/repositories.gradle @@ -1,7 +1,6 @@ // Add any additional repositories for your dependencies here repositories { - mavenLocal() maven { name 'GTNH Maven' url 'http://jenkins.usrv.eu:8081/nexus/content/groups/public/' diff --git a/src/main/java/com/github/technus/tectech/nei/TT_NEI_ResearchHandler.java b/src/main/java/com/github/technus/tectech/nei/TT_NEI_ResearchHandler.java index b6d01cb01a..572b3b2c47 100644 --- a/src/main/java/com/github/technus/tectech/nei/TT_NEI_ResearchHandler.java +++ b/src/main/java/com/github/technus/tectech/nei/TT_NEI_ResearchHandler.java @@ -6,8 +6,6 @@ import static gregtech.api.enums.ItemList.Display_Fluid; import codechicken.lib.gui.GuiDraw; import codechicken.nei.ItemList; import codechicken.nei.PositionedStack; -import codechicken.nei.guihook.IContainerInputHandler; -import codechicken.nei.guihook.IContainerTooltipHandler; import codechicken.nei.recipe.*; import com.github.technus.tectech.Reference; import com.github.technus.tectech.TecTech; @@ -25,7 +23,6 @@ import java.util.Collections; import java.util.Iterator; import java.util.List; import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidContainerRegistry; @@ -260,64 +257,6 @@ public class TT_NEI_ResearchHandler extends TemplateRecipeHandler { } } - @Deprecated // Unnecessary copy of a class base GT5U uses to manage NEI transfer rects - public static class GT_RectHandler implements IContainerInputHandler, IContainerTooltipHandler { - @Override - public boolean mouseClicked(GuiContainer gui, int mousex, int mousey, int button) { - return false; - } - - @Override - public boolean lastKeyTyped(GuiContainer gui, char keyChar, int keyCode) { - return false; - } - - public boolean canHandle(GuiContainer gui) { - return false; - } - - @Override - public List handleTooltip(GuiContainer gui, int mousex, int mousey, List currenttip) { - return currenttip; - } - - @Override - public List handleItemDisplayName(GuiContainer gui, ItemStack itemstack, List currenttip) { - return currenttip; - } - - @Override - public List handleItemTooltip( - GuiContainer gui, ItemStack itemstack, int mousex, int mousey, List currenttip) { - return currenttip; - } - - @Override - public boolean keyTyped(GuiContainer gui, char keyChar, int keyCode) { - return false; - } - - @Override - public void onKeyTyped(GuiContainer gui, char keyChar, int keyID) {} - - @Override - public void onMouseClicked(GuiContainer gui, int mousex, int mousey, int button) {} - - @Override - public void onMouseUp(GuiContainer gui, int mousex, int mousey, int button) {} - - @Override - public boolean mouseScrolled(GuiContainer gui, int mousex, int mousey, int scrolled) { - return false; - } - - @Override - public void onMouseScrolled(GuiContainer gui, int mousex, int mousey, int scrolled) {} - - @Override - public void onMouseDragged(GuiContainer gui, int mousex, int mousey, int button, long heldTime) {} - } - public static class FixedPositionedStack extends PositionedStack { public final int mChance; public boolean permutated = false; diff --git a/src/main/java/com/github/technus/tectech/nei/TT_NEI_ScannerHandler.java b/src/main/java/com/github/technus/tectech/nei/TT_NEI_ScannerHandler.java index 12e6f0d823..15887f0e35 100644 --- a/src/main/java/com/github/technus/tectech/nei/TT_NEI_ScannerHandler.java +++ b/src/main/java/com/github/technus/tectech/nei/TT_NEI_ScannerHandler.java @@ -6,8 +6,6 @@ import static gregtech.api.enums.ItemList.Display_Fluid; import codechicken.lib.gui.GuiDraw; import codechicken.nei.ItemList; import codechicken.nei.PositionedStack; -import codechicken.nei.guihook.IContainerInputHandler; -import codechicken.nei.guihook.IContainerTooltipHandler; import codechicken.nei.recipe.*; import com.github.technus.tectech.Reference; import com.github.technus.tectech.TecTech; @@ -25,7 +23,6 @@ import java.util.Collections; import java.util.Iterator; import java.util.List; import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidContainerRegistry; @@ -259,64 +256,6 @@ public class TT_NEI_ScannerHandler extends TemplateRecipeHandler { } } - @Deprecated // Unnecessary copy of a class base GT5U uses to manage NEI transfer rects - public static class GT_RectHandler implements IContainerInputHandler, IContainerTooltipHandler { - @Override - public boolean mouseClicked(GuiContainer gui, int mousex, int mousey, int button) { - return false; - } - - @Override - public boolean lastKeyTyped(GuiContainer gui, char keyChar, int keyCode) { - return false; - } - - public boolean canHandle(GuiContainer gui) { - return false; - } - - @Override - public List handleTooltip(GuiContainer gui, int mousex, int mousey, List currenttip) { - return currenttip; - } - - @Override - public List handleItemDisplayName(GuiContainer gui, ItemStack itemstack, List currenttip) { - return currenttip; - } - - @Override - public List handleItemTooltip( - GuiContainer gui, ItemStack itemstack, int mousex, int mousey, List currenttip) { - return currenttip; - } - - @Override - public boolean keyTyped(GuiContainer gui, char keyChar, int keyCode) { - return false; - } - - @Override - public void onKeyTyped(GuiContainer gui, char keyChar, int keyID) {} - - @Override - public void onMouseClicked(GuiContainer gui, int mousex, int mousey, int button) {} - - @Override - public void onMouseUp(GuiContainer gui, int mousex, int mousey, int button) {} - - @Override - public boolean mouseScrolled(GuiContainer gui, int mousex, int mousey, int scrolled) { - return false; - } - - @Override - public void onMouseScrolled(GuiContainer gui, int mousex, int mousey, int scrolled) {} - - @Override - public void onMouseDragged(GuiContainer gui, int mousex, int mousey, int button, long heldTime) {} - } - public static class FixedPositionedStack extends PositionedStack { public final int mChance; public boolean permutated = false; diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_InputDataItems.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_InputDataItems.java index c61d9d157e..ce0215f2c9 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_InputDataItems.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_InputDataItems.java @@ -20,7 +20,6 @@ import gregtech.api.objects.GT_RenderedTexture; import java.util.ArrayList; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; @@ -90,20 +89,9 @@ public class GT_MetaTileEntity_Hatch_InputDataItems extends GT_MetaTileEntity_Ha } catch (Exception e) { clientLocale = "en_US"; } - aBaseMetaTileEntity.openGUI(aPlayer); return true; } - @Override - public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return null; - } - - @Override - public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return null; - } - @Override public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { return false; diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OutputDataItems.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OutputDataItems.java index 197006510d..323973acbb 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OutputDataItems.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OutputDataItems.java @@ -12,8 +12,6 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.util.GT_Utility; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; @@ -45,27 +43,6 @@ public class GT_MetaTileEntity_Hatch_OutputDataItems return new GT_MetaTileEntity_Hatch_OutputDataItems(this.mName, this.mTier, this.mDescription, this.mTextures); } - @Override - public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { - if (aBaseMetaTileEntity.isClientSide()) { - return true; - } else { - super.onRightclick(aBaseMetaTileEntity, aPlayer); - aBaseMetaTileEntity.openGUI(aPlayer); - return true; - } - } - - @Override - public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return null; - } - - @Override - public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return null; - } - @Override public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { return false; diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_TeslaCoil.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_TeslaCoil.java index a6abe44064..899ebc603c 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_TeslaCoil.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_TeslaCoil.java @@ -19,6 +19,7 @@ import com.google.common.collect.Multimap; import com.google.common.collect.MultimapBuilder; import com.gtnewhorizon.structurelib.util.Vec3Impl; import eu.usrv.yamcore.auxiliary.PlayerChatHelper; +import gregtech.api.gui.modularui.GT_UIInfos; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; @@ -284,7 +285,7 @@ public class GT_MetaTileEntity_TeslaCoil extends GT_MetaTileEntity_BasicBatteryB } catch (Exception e) { clientLocale = "en_US"; } - aBaseMetaTileEntity.openGUI(aPlayer); + GT_UIInfos.openGTTileEntityUI(aBaseMetaTileEntity, aPlayer); } return true; } -- cgit From 7004d21b057f602c4d371cbeee7220b8ab83e11c Mon Sep 17 00:00:00 2001 From: miozune Date: Sun, 20 Nov 2022 18:39:31 +0900 Subject: Update GT --- dependencies.gradle | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'dependencies.gradle') diff --git a/dependencies.gradle b/dependencies.gradle index e5061e87d6..707cc66d51 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -2,7 +2,8 @@ dependencies { shadowImplementation('com.github.GTNewHorizons:AVRcore:master-SNAPSHOT') - compile('com.github.GTNewHorizons:GT5-Unofficial:5.09.41.137-pre:dev') + compile('com.github.GTNewHorizons:GT5-Unofficial:5.09.41.138-pre:dev') {transitive=false} + compile("com.github.GTNewHorizons:ModularUI:1.0.16:dev") compile('com.github.GTNewHorizons:Yamcl:0.5.84:dev') compile('com.github.GTNewHorizons:NotEnoughItems:2.3.7-GTNH:dev') compile('com.github.GTNewHorizons:CodeChickenLib:1.1.5.5:dev') -- cgit From 8b44e6b09a6a66c22f5f1b73cf2e5c3714a5b697 Mon Sep 17 00:00:00 2001 From: miozune Date: Sun, 20 Nov 2022 18:46:38 +0900 Subject: :feelsdumbman: --- dependencies.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'dependencies.gradle') diff --git a/dependencies.gradle b/dependencies.gradle index 707cc66d51..059c1f5b4a 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -2,8 +2,8 @@ dependencies { shadowImplementation('com.github.GTNewHorizons:AVRcore:master-SNAPSHOT') - compile('com.github.GTNewHorizons:GT5-Unofficial:5.09.41.138-pre:dev') {transitive=false} - compile("com.github.GTNewHorizons:ModularUI:1.0.16:dev") + compile('com.github.GTNewHorizons:GT5-Unofficial:5.09.41.138-pre:dev') + compile("com.github.GTNewHorizons:ModularUI:1.0.16:dev") {transitive=false} compile('com.github.GTNewHorizons:Yamcl:0.5.84:dev') compile('com.github.GTNewHorizons:NotEnoughItems:2.3.7-GTNH:dev') compile('com.github.GTNewHorizons:CodeChickenLib:1.1.5.5:dev') -- cgit From 3259a923050ddaaf55471db4eb4ba8654ce88a20 Mon Sep 17 00:00:00 2001 From: miozune Date: Sat, 26 Nov 2022 01:50:50 +0900 Subject: Update GT --- dependencies.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'dependencies.gradle') diff --git a/dependencies.gradle b/dependencies.gradle index 059c1f5b4a..ed0e79560b 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -2,7 +2,7 @@ dependencies { shadowImplementation('com.github.GTNewHorizons:AVRcore:master-SNAPSHOT') - compile('com.github.GTNewHorizons:GT5-Unofficial:5.09.41.138-pre:dev') + compile('com.github.GTNewHorizons:GT5-Unofficial:5.09.41.145:dev') compile("com.github.GTNewHorizons:ModularUI:1.0.16:dev") {transitive=false} compile('com.github.GTNewHorizons:Yamcl:0.5.84:dev') compile('com.github.GTNewHorizons:NotEnoughItems:2.3.7-GTNH:dev') -- cgit