From be966a5ea951df09ff6d95da67b19eae69be17d5 Mon Sep 17 00:00:00 2001 From: minecraft7771 Date: Sun, 7 Aug 2022 10:09:55 +0200 Subject: Changed tooltip to fit the new behavior --- src/main/resources/assets/tectech/lang/en_US.lang | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/main/resources/assets') diff --git a/src/main/resources/assets/tectech/lang/en_US.lang b/src/main/resources/assets/tectech/lang/en_US.lang index 15c174691f..6393b2eeed 100644 --- a/src/main/resources/assets/tectech/lang/en_US.lang +++ b/src/main/resources/assets/tectech/lang/en_US.lang @@ -690,8 +690,8 @@ gt.blockmachines.multimachine.em.collider.Structure.AdditionalCollider=Needs ano gt.blockmachines.multimachine.em.infuser.name=Energy Infuser gt.blockmachines.multimachine.em.infuser.hint=1 - Classic Hatches or High Power Casing gt.blockmachines.multimachine.em.infuser.desc.0=Controller block of the Energy Infuser -gt.blockmachines.multimachine.em.infuser.desc.1=Can be used to charge items in the controller GUI -gt.blockmachines.multimachine.em.infuser.desc.2=Has a loss of 3.125% +gt.blockmachines.multimachine.em.infuser.desc.1=Can be used to charge items (lossless) +gt.blockmachines.multimachine.em.infuser.desc.2=Can be fed with UU-Matter to repair items gt.blockmachines.multimachine.em.infuser.Structure.HighPowerCasing=Layer 1 and 5 gt.blockmachines.multimachine.em.infuser.Structure.MolecularCoil=Layer 2 and 4 gt.blockmachines.multimachine.em.infuser.Structure.MolecularCasing=Layer 3 (hollow) -- cgit From b9be2d6e0aea3a188fb76083a219d9315c7d11b8 Mon Sep 17 00:00:00 2001 From: miozune Date: Wed, 24 Aug 2022 18:41:36 +0900 Subject: Purge OpV --- .../dreamcraft/NoDreamCraftMachineLoader.java | 49 ++++------------------ .../technus/tectech/thing/CustomItemList.java | 11 ++--- .../tectech/thing/casing/GT_Block_CasingsNH.java | 6 +-- .../tectech/thing/metaTileEntity/Textures.java | 19 ++------- src/main/resources/assets/tectech/lang/en_US.lang | 18 +++----- src/main/resources/assets/tectech/lang/zh_CN.lang | 18 +++----- 6 files changed, 26 insertions(+), 95 deletions(-) (limited to 'src/main/resources/assets') diff --git a/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/NoDreamCraftMachineLoader.java b/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/NoDreamCraftMachineLoader.java index b08480fe8a..e444e08fb1 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/NoDreamCraftMachineLoader.java +++ b/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/NoDreamCraftMachineLoader.java @@ -96,13 +96,9 @@ public class NoDreamCraftMachineLoader implements Runnable { 12012, "wettransformer.tier.12", "Mega Ultimate Power Transformer", 12) .getStackForm(1L)); // UXV -> UMV (Use Soft Mallet to invert) - CustomItemList.WetTransformer_OPV_UXV.set(new GT_MetaTileEntity_WetTransformer( + CustomItemList.WetTransformer_MAXV_UXV.set(new GT_MetaTileEntity_WetTransformer( 12013, "wettransformer.tier.13", "Extended Mega Ultimate Power Transformer", 13) - .getStackForm(1L)); // OPV -> UXV (Use Soft Mallet to invert) - - CustomItemList.WetTransformer_MAXV_OPV.set(new GT_MetaTileEntity_WetTransformer( - 12014, "wettransformer.tier.14", "Overpowered Power Transformer", 14) - .getStackForm(1L)); // MAX -> OPV (Use Soft Mallet to invert) + .getStackForm(1L)); // MAX -> UXV (Use Soft Mallet to invert) try { MetaTileEntity temp; @@ -143,18 +139,11 @@ public class NoDreamCraftMachineLoader implements Runnable { } CustomItemList.Hull_UXV.set(temp.getStackForm(1L)); - temp = new GT_MetaTileEntity_BasicHull(11234, "hull.tier.14", "OPV Machine Hull", 14, imagination); + temp = new GT_MetaTileEntity_BasicHull(11234, "hull.tier.14", "MAX Machine Hull", 14, imagination); TT_Utility.setTier(14, temp); if (GT_Values.GT.isClientSide()) { field.set(temp, method.invoke(temp, iTexture)); } - CustomItemList.Hull_OPV.set(temp.getStackForm(1L)); - - temp = new GT_MetaTileEntity_BasicHull(11235, "hull.tier.15", "MAX Machine Hull", 15, imagination); - TT_Utility.setTier(15, temp); - if (GT_Values.GT.isClientSide()) { - field.set(temp, method.invoke(temp, iTexture)); - } CustomItemList.Hull_MAXV.set(temp.getStackForm(1L)); temp = new GT_MetaTileEntity_TT_Transformer( @@ -201,23 +190,12 @@ public class NoDreamCraftMachineLoader implements Runnable { 11224, "tt.transformer.tier.13", "Extended Mega Ultimate Transformer", - 13); // OPV -> UXV (Use Soft Mallet to invert) + 13); // MAX -> UXV (Use Soft Mallet to invert) TT_Utility.setTier(13, temp); if (GT_Values.GT.isClientSide()) { field.set(temp, method.invoke(temp, iTexture)); } - CustomItemList.Transformer_OPV_UXV.set(temp.getStackForm(1L)); - - temp = new GT_MetaTileEntity_TT_Transformer( - 11225, - "tt.transformer.tier.14", - "Overpowered Transformer", - 14); // MAX -> OPV (Use Soft Mallet to invert) - TT_Utility.setTier(14, temp); - if (GT_Values.GT.isClientSide()) { - field.set(temp, method.invoke(temp, iTexture)); - } - CustomItemList.Transformer_MAXV_OPV.set(temp.getStackForm(1L)); + CustomItemList.Transformer_MAXV_UXV.set(temp.getStackForm(1L)); if (Loader.isModLoaded(Reference.GTPLUSPLUS)) { Class clazz = Class.forName( @@ -278,26 +256,13 @@ public class NoDreamCraftMachineLoader implements Runnable { "transformer.ha.tier.13", "Extended Mega Ultimate Hi-Amp Transformer", 13, - // OPV -> UXV (Use Soft Mallet to invert) + // MAXV -> UXV (Use Soft Mallet to invert) translateToLocal("gt.blockmachines.transformer.ha.tier.13.desc")); TT_Utility.setTier(13, temp); if (GT_Values.GT.isClientSide()) { field.set(temp, method.invoke(temp, iTexture)); } - CustomItemList.Transformer_HA_OPV_UXV.set(temp.getStackForm(1)); - - temp = constructor.newInstance( - 11914, - "transformer.ha.tier.14", - "Overpowered Hi-Amp Transformer", - 14, - // MAX -> OPV (Use Soft Mallet to invert) - translateToLocal("gt.blockmachines.transformer.ha.tier.14.desc")); - TT_Utility.setTier(14, temp); - if (GT_Values.GT.isClientSide()) { - field.set(temp, method.invoke(temp, iTexture)); - } - CustomItemList.Transformer_HA_MAXV_OPV.set(temp.getStackForm(1)); + CustomItemList.Transformer_HA_MAXV_UXV.set(temp.getStackForm(1)); } } catch (Exception e) { e.printStackTrace(); diff --git a/src/main/java/com/github/technus/tectech/thing/CustomItemList.java b/src/main/java/com/github/technus/tectech/thing/CustomItemList.java index 6f00ed021f..01310a8a6f 100644 --- a/src/main/java/com/github/technus/tectech/thing/CustomItemList.java +++ b/src/main/java/com/github/technus/tectech/thing/CustomItemList.java @@ -15,20 +15,17 @@ public enum CustomItemList implements IItemContainer { Casing_UIV, Casing_UMV, Casing_UXV, - Casing_OPV, Casing_MAXV, Hull_UEV, Hull_UIV, Hull_UMV, Hull_UXV, - Hull_OPV, Hull_MAXV, Transformer_UEV_UHV, Transformer_UIV_UEV, Transformer_UMV_UIV, Transformer_UXV_UMV, - Transformer_OPV_UXV, - Transformer_MAXV_OPV, + Transformer_MAXV_UXV, WetTransformer_LV_ULV, WetTransformer_MV_LV, WetTransformer_HV_MV, @@ -42,15 +39,13 @@ public enum CustomItemList implements IItemContainer { WetTransformer_UIV_UEV, WetTransformer_UMV_UIV, WetTransformer_UXV_UMV, - WetTransformer_OPV_UXV, - WetTransformer_MAXV_OPV, + WetTransformer_MAXV_UXV, Transformer_HA_UEV_UHV, Transformer_HA_UIV_UEV, Transformer_HA_UMV_UIV, Transformer_HA_UXV_UMV, - Transformer_HA_OPV_UXV, - Transformer_HA_MAXV_OPV, + Transformer_HA_MAXV_UXV, hatch_CreativeMaintenance, hatch_CreativeData, diff --git a/src/main/java/com/github/technus/tectech/thing/casing/GT_Block_CasingsNH.java b/src/main/java/com/github/technus/tectech/thing/casing/GT_Block_CasingsNH.java index 61e4847eb8..f4888b5125 100644 --- a/src/main/java/com/github/technus/tectech/thing/casing/GT_Block_CasingsNH.java +++ b/src/main/java/com/github/technus/tectech/thing/casing/GT_Block_CasingsNH.java @@ -32,15 +32,13 @@ public class GT_Block_CasingsNH extends GT_Block_Casings_Abstract { GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".11.name", "UIV Machine Casing"); // adding GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".12.name", "UMV Machine Casing"); // adding GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".13.name", "UXV Machine Casing"); // adding - GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".14.name", "OPV Machine Casing"); // adding - GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".15.name", "MAX Machine Casing"); // adding + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".14.name", "MAX Machine Casing"); // adding CustomItemList.Casing_UEV.set(new ItemStack(this, 1, 10)); CustomItemList.Casing_UIV.set(new ItemStack(this, 1, 11)); CustomItemList.Casing_UMV.set(new ItemStack(this, 1, 12)); CustomItemList.Casing_UXV.set(new ItemStack(this, 1, 13)); - CustomItemList.Casing_OPV.set(new ItemStack(this, 1, 14)); - CustomItemList.Casing_MAXV.set(new ItemStack(this, 1, 15)); + CustomItemList.Casing_MAXV.set(new ItemStack(this, 1, 14)); } @Override diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/Textures.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/Textures.java index 08a14fecc2..37cfe64acd 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/Textures.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/Textures.java @@ -18,19 +18,16 @@ public class Textures { private static final IIconContainer MACHINE_UIV_SIDE = new CustomIcon("iconsets/MACHINE_UIV_SIDE"); private static final IIconContainer MACHINE_UMV_SIDE = new CustomIcon("iconsets/MACHINE_UMV_SIDE"); private static final IIconContainer MACHINE_UXV_SIDE = new CustomIcon("iconsets/MACHINE_UXV_SIDE"); - private static final IIconContainer MACHINE_OPV_SIDE = new CustomIcon("iconsets/MACHINE_OPV_SIDE"); private static final IIconContainer MACHINE_MAXV_SIDE = new CustomIcon("iconsets/MACHINE_MAXV_SIDE"); private static final IIconContainer MACHINE_UEV_TOP = new CustomIcon("iconsets/MACHINE_UEV_TOP"); private static final IIconContainer MACHINE_UIV_TOP = new CustomIcon("iconsets/MACHINE_UIV_TOP"); private static final IIconContainer MACHINE_UMV_TOP = new CustomIcon("iconsets/MACHINE_UMV_TOP"); private static final IIconContainer MACHINE_UXV_TOP = new CustomIcon("iconsets/MACHINE_UXV_TOP"); - private static final IIconContainer MACHINE_OPV_TOP = new CustomIcon("iconsets/MACHINE_OPV_TOP"); private static final IIconContainer MACHINE_MAXV_TOP = new CustomIcon("iconsets/MACHINE_MAXV_TOP"); private static final IIconContainer MACHINE_UEV_BOTTOM = new CustomIcon("iconsets/MACHINE_UEV_BOTTOM"); private static final IIconContainer MACHINE_UIV_BOTTOM = new CustomIcon("iconsets/MACHINE_UIV_BOTTOM"); private static final IIconContainer MACHINE_UMV_BOTTOM = new CustomIcon("iconsets/MACHINE_UMV_BOTTOM"); private static final IIconContainer MACHINE_UXV_BOTTOM = new CustomIcon("iconsets/MACHINE_UXV_BOTTOM"); - private static final IIconContainer MACHINE_OPV_BOTTOM = new CustomIcon("iconsets/MACHINE_OPV_BOTTOM"); private static final IIconContainer MACHINE_MAXV_BOTTOM = new CustomIcon("iconsets/MACHINE_MAXV_BOTTOM"); private static final IIconContainer TESLA_TRANSCEIVER_TOP = new CustomIcon("iconsets/TESLA_TRANSCEIVER_TOP"); @@ -41,21 +38,21 @@ public class Textures { MACHINE_8V_SIDE, MACHINE_LV_SIDE, MACHINE_MV_SIDE, MACHINE_HV_SIDE, MACHINE_EV_SIDE, MACHINE_IV_SIDE, MACHINE_LuV_SIDE, MACHINE_ZPM_SIDE, MACHINE_UV_SIDE, MACHINE_MAX_SIDE, MACHINE_UEV_SIDE, MACHINE_UIV_SIDE, - MACHINE_UMV_SIDE, MACHINE_UXV_SIDE, MACHINE_OPV_SIDE, MACHINE_MAXV_SIDE, + MACHINE_UMV_SIDE, MACHINE_UXV_SIDE, MACHINE_MAXV_SIDE, }, MACHINECASINGS_TOP_TT = new IIconContainer[] { MACHINE_8V_TOP, MACHINE_LV_TOP, MACHINE_MV_TOP, MACHINE_HV_TOP, MACHINE_EV_TOP, MACHINE_IV_TOP, MACHINE_LuV_TOP, MACHINE_ZPM_TOP, MACHINE_UV_TOP, MACHINE_MAX_TOP, MACHINE_UEV_TOP, MACHINE_UIV_TOP, - MACHINE_UMV_TOP, MACHINE_UXV_TOP, MACHINE_OPV_TOP, MACHINE_MAXV_TOP, + MACHINE_UMV_TOP, MACHINE_UXV_TOP, MACHINE_MAXV_TOP, }, MACHINECASINGS_BOTTOM_TT = new IIconContainer[] { MACHINE_8V_BOTTOM, MACHINE_LV_BOTTOM, MACHINE_MV_BOTTOM, MACHINE_HV_BOTTOM, MACHINE_EV_BOTTOM, MACHINE_IV_BOTTOM, MACHINE_LuV_BOTTOM, MACHINE_ZPM_BOTTOM, MACHINE_UV_BOTTOM, MACHINE_MAX_BOTTOM, MACHINE_UEV_BOTTOM, MACHINE_UIV_BOTTOM, - MACHINE_UMV_BOTTOM, MACHINE_UXV_BOTTOM, MACHINE_OPV_BOTTOM, MACHINE_MAXV_BOTTOM, + MACHINE_UMV_BOTTOM, MACHINE_UXV_BOTTOM, MACHINE_MAXV_BOTTOM, }; public static ITexture[] OVERLAYS_ENERGY_IN_TT = @@ -75,7 +72,6 @@ public class Textures { new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[] {100, 100, 245, 0}), new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[] {80, 80, 245, 0}), new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[] {60, 60, 245, 0}), - new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[] {40, 40, 245, 0}), }, OVERLAYS_ENERGY_OUT_TT = new ITexture[] { @@ -94,7 +90,6 @@ public class Textures { new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[] {100, 100, 245, 0}), new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[] {80, 80, 245, 0}), new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[] {60, 60, 245, 0}), - new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[] {40, 40, 245, 0}), }, OVERLAYS_ENERGY_IN_MULTI_TT = new ITexture[] { @@ -113,7 +108,6 @@ public class Textures { new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[] {100, 100, 245, 0}), new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[] {80, 80, 245, 0}), new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[] {60, 60, 245, 0}), - new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[] {40, 40, 245, 0}), }, OVERLAYS_ENERGY_OUT_MULTI_TT = new ITexture[] { @@ -132,7 +126,6 @@ public class Textures { new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[] {100, 100, 245, 0}), new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[] {80, 80, 245, 0}), new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[] {60, 60, 245, 0}), - new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[] {40, 40, 245, 0}), }, OVERLAYS_ENERGY_IN_POWER_TT = new ITexture[] { @@ -151,7 +144,6 @@ public class Textures { new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[] {100, 100, 245, 0}), new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[] {80, 80, 245, 0}), new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[] {60, 60, 245, 0}), - new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[] {40, 40, 245, 0}), }, OVERLAYS_ENERGY_OUT_POWER_TT = new ITexture[] { @@ -170,7 +162,6 @@ public class Textures { new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[] {100, 100, 245, 0}), new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[] {80, 80, 245, 0}), new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[] {60, 60, 245, 0}), - new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[] {40, 40, 245, 0}), }, OVERLAYS_ENERGY_IN_LASER_TT = new ITexture[] { @@ -189,7 +180,6 @@ public class Textures { new GT_RenderedTexture(OVERLAY_ENERGY_IN_LASER, new short[] {100, 100, 245, 0}), new GT_RenderedTexture(OVERLAY_ENERGY_IN_LASER, new short[] {80, 80, 245, 0}), new GT_RenderedTexture(OVERLAY_ENERGY_IN_LASER, new short[] {60, 60, 245, 0}), - new GT_RenderedTexture(OVERLAY_ENERGY_IN_LASER, new short[] {40, 40, 245, 0}), }, OVERLAYS_ENERGY_OUT_LASER_TT = new ITexture[] { @@ -208,10 +198,9 @@ public class Textures { new GT_RenderedTexture(OVERLAY_ENERGY_OUT_LASER, new short[] {100, 100, 245, 0}), new GT_RenderedTexture(OVERLAY_ENERGY_OUT_LASER, new short[] {80, 80, 245, 0}), new GT_RenderedTexture(OVERLAY_ENERGY_OUT_LASER, new short[] {60, 60, 245, 0}), - new GT_RenderedTexture(OVERLAY_ENERGY_OUT_LASER, new short[] {40, 40, 245, 0}), }; - public static ITexture[][] MACHINE_CASINGS_TT = new ITexture[16][17]; + public static ITexture[][] MACHINE_CASINGS_TT = new ITexture[15][17]; public static ITexture TESLA_TRANSCEIVER_TOP_BA = new GT_RenderedTexture(TESLA_TRANSCEIVER_TOP); diff --git a/src/main/resources/assets/tectech/lang/en_US.lang b/src/main/resources/assets/tectech/lang/en_US.lang index 6393b2eeed..ab27b89dd6 100644 --- a/src/main/resources/assets/tectech/lang/en_US.lang +++ b/src/main/resources/assets/tectech/lang/en_US.lang @@ -111,8 +111,7 @@ gt.blockmachines.hull.tier.10.name=UEV Machine Hull gt.blockmachines.hull.tier.11.name=UIV Machine Hull gt.blockmachines.hull.tier.12.name=UMV Machine Hull gt.blockmachines.hull.tier.13.name=UXV Machine Hull -gt.blockmachines.hull.tier.14.name=OPV Machine Hull -gt.blockmachines.hull.tier.15.name=MAX Machine Hull +gt.blockmachines.hull.tier.14.name=MAX Machine Hull #Transformers gt.blockmachines.wetransformer.tier.00.name=Ultra Low Voltage Power Transformer @@ -142,9 +141,7 @@ gt.blockmachines.wetransformer.tier.11.desc=UMV -> UIV (Use Soft Mallet to inver gt.blockmachines.wetransformer.tier.12.name=Mega Ultimate Power Transformer gt.blockmachines.wetransformer.tier.12.desc=UXV -> UMV (Use Soft Mallet to invert) gt.blockmachines.wetransformer.tier.13.name=Extended Mega Ultimate Power Transformer -gt.blockmachines.wetransformer.tier.13.desc=OPV -> UXV (Use Soft Mallet to invert) -gt.blockmachines.wetransformer.tier.14.name=Overpowered Power Transformer -gt.blockmachines.wetransformer.tier.14.desc=MAX -> OPV (Use Soft Mallet to invert) +gt.blockmachines.wetransformer.tier.13.desc=MAX -> UXV (Use Soft Mallet to invert) gt.blockmachines.tt.transformer.tier.09.name=Highly Ultimate Transformer gt.blockmachines.tt.transformer.tier.09.desc=UEV -> UHV (Use Soft Mallet to invert) @@ -155,9 +152,7 @@ gt.blockmachines.tt.transformer.tier.11.desc=UMV -> UIV (Use Soft Mallet to inve gt.blockmachines.tt.transformer.tier.12.name=Mega Ultimate Transformer gt.blockmachines.tt.transformer.tier.12.desc=UXV -> UMV (Use Soft Mallet to invert) gt.blockmachines.tt.transformer.tier.13.name=Extended Mega Ultimate Transformer -gt.blockmachines.tt.transformer.tier.13.desc=OPV -> UXV (Use Soft Mallet to invert) -gt.blockmachines.tt.transformer.tier.14.name=Overpowered Transformer -gt.blockmachines.tt.transformer.tier.14.desc=MAX -> OPV (Use Soft Mallet to invert) +gt.blockmachines.tt.transformer.tier.13.desc=MAX -> UXV (Use Soft Mallet to invert) gt.blockmachines.transformer.ha.tier.09.name=Highly Ultimate Hi-Amp Transformer gt.blockmachines.transformer.ha.tier.09.desc=UEV -> UHV (Use Soft Mallet to invert @@ -168,9 +163,7 @@ gt.blockmachines.transformer.ha.tier.11.desc=UMV -> UIV (Use Soft Mallet to inve gt.blockmachines.transformer.ha.tier.12.name=Mega Ultimate Hi-Amp Transformer gt.blockmachines.transformer.ha.tier.12.desc=UXV -> UMV (Use Soft Mallet to invert) gt.blockmachines.transformer.ha.tier.13.name=Extended Mega Ultimate Hi-Amp Transformer -gt.blockmachines.transformer.ha.tier.13.desc=OPV -> UXV (Use Soft Mallet to invert) -gt.blockmachines.transformer.ha.tier.14.name=Overpowered Hi-Amp Transformer -gt.blockmachines.transformer.ha.tier.14.desc=MAX -> OPV (Use Soft Mallet to invert) +gt.blockmachines.transformer.ha.tier.13.desc=MAX -> UXV (Use Soft Mallet to invert) #Hatches tt.base.emhatch.desc.0=Max stacks amount: @@ -450,8 +443,7 @@ gt.blockcasingsNH.10.name=UEV Machine Casing gt.blockcasingsNH.11.name=UIV Machine Casing gt.blockcasingsNH.12.name=UMV Machine Casing gt.blockcasingsNH.13.name=UXV Machine Casing -gt.blockcasingsNH.14.name=OPV Machine Casing -gt.blockcasingsNH.15.name=MAX Machine Casing +gt.blockcasingsNH.14.name=MAX Machine Casing gt.blockhintTT.desc.0=Helps while building gt.blockhintTT.0.name=Hint 1 dot diff --git a/src/main/resources/assets/tectech/lang/zh_CN.lang b/src/main/resources/assets/tectech/lang/zh_CN.lang index 83cc8f72e9..870998d56a 100644 --- a/src/main/resources/assets/tectech/lang/zh_CN.lang +++ b/src/main/resources/assets/tectech/lang/zh_CN.lang @@ -111,8 +111,7 @@ gt.blockmachines.hull.tier.10.name=UEV机器外壳 gt.blockmachines.hull.tier.11.name=UIV机器外壳 gt.blockmachines.hull.tier.12.name=UMV机器外壳 gt.blockmachines.hull.tier.13.name=UXV机器外壳 -gt.blockmachines.hull.tier.14.name=OPV机器外壳 -gt.blockmachines.hull.tier.15.name=MAX机器外壳 +gt.blockmachines.hull.tier.14.name=MAX机器外壳 #Transformers gt.blockmachines.wetransformer.tier.00.name=ULV高能变压器 @@ -142,9 +141,7 @@ gt.blockmachines.wetransformer.tier.11.desc=UMV -> UIV (用软锤右击以反转 gt.blockmachines.wetransformer.tier.12.name=UMV高能变压器 gt.blockmachines.wetransformer.tier.12.desc=UXV -> UMV (用软锤右击以反转) gt.blockmachines.wetransformer.tier.13.name=UXV高能变压器 -gt.blockmachines.wetransformer.tier.13.desc=OPV -> UXV (用软锤右击以反转) -gt.blockmachines.wetransformer.tier.14.name=OpV高能变压器 -gt.blockmachines.wetransformer.tier.14.desc=MAX -> OPV (用软锤右击以反转) +gt.blockmachines.wetransformer.tier.13.desc=MAX -> UXV (用软锤右击以反转) gt.blockmachines.tt.transformer.tier.09.name=UHV变压器 gt.blockmachines.tt.transformer.tier.09.desc=UEV -> UHV (用软锤右击以反转) @@ -155,9 +152,7 @@ gt.blockmachines.tt.transformer.tier.11.desc=UMV -> UIV (用软锤右击以反 gt.blockmachines.tt.transformer.tier.12.name=UMV变压器 gt.blockmachines.tt.transformer.tier.12.desc=UXV -> UMV (用软锤右击以反转) gt.blockmachines.tt.transformer.tier.13.name=UXV变压器 -gt.blockmachines.tt.transformer.tier.13.desc=OPV -> UXV (用软锤右击以反转) -gt.blockmachines.tt.transformer.tier.14.name=OpV变压器 -gt.blockmachines.tt.transformer.tier.14.desc=MAX -> OPV (用软锤右击以反转) +gt.blockmachines.tt.transformer.tier.13.desc=MAX -> UXV (用软锤右击以反转) gt.blockmachines.transformer.ha.tier.09.name=UHV高电流变压器 gt.blockmachines.transformer.ha.tier.09.desc=UEV -> UHV (用软锤右击以反转 @@ -168,9 +163,7 @@ gt.blockmachines.transformer.ha.tier.11.desc=UMV -> UIV (用软锤右击以反 gt.blockmachines.transformer.ha.tier.12.name=UMV高电流变压器 gt.blockmachines.transformer.ha.tier.12.desc=UXV -> UMV (用软锤右击以反转) gt.blockmachines.transformer.ha.tier.13.name=UXV高电流变压器 -gt.blockmachines.transformer.ha.tier.13.desc=OPV -> UXV (用软锤右击以反转) -gt.blockmachines.transformer.ha.tier.14.name=OpV高电流变压器 -gt.blockmachines.transformer.ha.tier.14.desc=MAX -> OPV (用软锤右击以反转) +gt.blockmachines.transformer.ha.tier.13.desc=MAX -> UXV (用软锤右击以反转) #Hatches tt.base.emhatch.desc.0=最大元物质组数: @@ -450,8 +443,7 @@ gt.blockcasingsNH.10.name=UEV机械方块 gt.blockcasingsNH.11.name=UIV机械方块 gt.blockcasingsNH.12.name=UMV机械方块 gt.blockcasingsNH.13.name=UXV机械方块 -gt.blockcasingsNH.14.name=OPV机械方块 -gt.blockcasingsNH.15.name=MAX机械方块 +gt.blockcasingsNH.14.name=MAX机械方块 gt.blockhintTT.desc.0=构造时的帮助 gt.blockhintTT.0.name=提示方块:1号 -- cgit From 3d8d5a733d90dffb504d7b08688bb02df9cc299a Mon Sep 17 00:00:00 2001 From: "[Kiwi233]" <42833050+Kiwi233@users.noreply.github.com> Date: Sat, 24 Sep 2022 23:07:19 +0800 Subject: Update zh_CN.lang --- src/main/resources/assets/tectech/lang/zh_CN.lang | 149 +++++++++++++++------- 1 file changed, 102 insertions(+), 47 deletions(-) (limited to 'src/main/resources/assets') diff --git a/src/main/resources/assets/tectech/lang/zh_CN.lang b/src/main/resources/assets/tectech/lang/zh_CN.lang index 870998d56a..dd32b7a6ec 100644 --- a/src/main/resources/assets/tectech/lang/zh_CN.lang +++ b/src/main/resources/assets/tectech/lang/zh_CN.lang @@ -78,7 +78,7 @@ item.tm.itemTeslaComponent.1.name=超导特斯拉绕组 item.tm.itemTeslaComponent.desc=特斯拉需要这些! item.tm.teslaCover.0.name=特斯拉线圈帽 -item.tm.teslaCover.1.name=加强特斯拉线圈帽 +item.tm.teslaCover.1.name=豪华特斯拉线圈帽 item.tm.teslaCover.desc.0=特斯拉使能机器! item.tm.teslaCover.desc.1=特斯拉使能机器! (但非常吵!!) item.tm.teslaCover.desc.2=把这个破碎的东西浸入某种辛辣的水中! @@ -539,16 +539,20 @@ gt.blockcasingsBA0.8.desc.1=谁不想要32k的环氧树脂? #Multiblocks gt.blockmachines.multimachine.em.transformer.name=有源变压器 gt.blockmachines.multimachine.em.transformer.hint=1 - 能源仓、动力仓或超能机械方块 -gt.blockmachines.multimachine.em.transformer.desc.0=变电站 +gt.blockmachines.multimachine.em.transformer.desc.0=有源变压器的控制器方块 gt.blockmachines.multimachine.em.transformer.desc.1=任意电压间的相互转换! gt.blockmachines.multimachine.em.transformer.desc.2=只有0.004%的能量损失, HAYO! +gt.blockmachines.multimachine.em.transformer.desc.3=运行时被破坏会发生爆炸 gt.blockmachines.multimachine.tm.microwave.name=微波发生仪 gt.blockmachines.multimachine.tm.microwave.hint.0=1 - 基础仓室或洁净不锈钢机械方块 gt.blockmachines.multimachine.tm.microwave.hint.1=也像个漏斗,所以给它个输出总线吧 -gt.blockmachines.multimachine.tm.microwave.desc.0=高频烤炉 -gt.blockmachines.multimachine.tm.microwave.desc.1=从生物到食物,只在转瞬之间! -gt.blockmachines.multimachine.tm.microwave.desc.2=我说用核弹...我的意思是把晚餐放进微波炉! +gt.blockmachines.multimachine.tm.microwave.desc.0=微波发生仪的控制器方块 +gt.blockmachines.multimachine.tm.microwave.desc.1=机器启动时开启一个计时器 +gt.blockmachines.multimachine.tm.microwave.desc.2=计时器运行时, 机器中的一切都会受到伤害 +gt.blockmachines.multimachine.tm.microwave.desc.3=机器也会自动收集内部掉落物 +gt.blockmachines.multimachine.tm.microwave.desc.4=可通过参数仪进行配置 +gt.blockmachines.multimachine.tm.microwave.desc.5=(别塞只凋灵进去) gt.blockmachines.multimachine.tm.microwave.cfgi.0=功率设置 gt.blockmachines.multimachine.tm.microwave.cfgi.1=时间设置 gt.blockmachines.multimachine.tm.microwave.cfgo.0=时间 @@ -557,9 +561,11 @@ gt.blockmachines.multimachine.tm.microwave.cfgo.1=剩余时间 gt.blockmachines.multimachine.tm.teslaCoil.name=特斯拉电塔 gt.blockmachines.multimachine.tm.teslaCoil.hint.0=1 - 基础仓室, 电容仓或特斯拉基座机械方块 gt.blockmachines.multimachine.tm.teslaCoil.hint.1=2 - 钛框架 -gt.blockmachines.multimachine.tm.teslaCoil.desc.0=无线电源塔 -gt.blockmachines.multimachine.tm.teslaCoil.desc.1=讨厌的线缆不见啦! -gt.blockmachines.multimachine.tm.teslaCoil.desc.2=可能会影响生存几率 +gt.blockmachines.multimachine.tm.teslaCoil.desc.0=特斯拉电塔的控制器方块 +gt.blockmachines.multimachine.tm.teslaCoil.desc.1=用于向特斯拉线圈帽和特斯拉收发器传输电力 +gt.blockmachines.multimachine.tm.teslaCoil.desc.2=可加入氦/氮/氡等离子体增大范围 +gt.blockmachines.multimachine.tm.teslaCoil.desc.3=传输电压取决于使用的特斯拉电容等级 +gt.blockmachines.multimachine.tm.teslaCoil.desc.4=需要至少与特斯拉电容相同等级的初级特斯拉绕组 gt.blockmachines.multimachine.tm.teslaCoil.cfgi.0=迟滞低设置 gt.blockmachines.multimachine.tm.teslaCoil.cfgi.1=迟滞高设置 gt.blockmachines.multimachine.tm.teslaCoil.cfgi.2=特斯拉电塔传输半径设置 @@ -582,8 +588,10 @@ gt.blockmachines.multimachine.tm.teslaCoil.cfgo.8=扫描时间显示 gt.blockmachines.multimachine.em.switch.name=QoS网络交换机 gt.blockmachines.multimachine.em.switch.hint=1 - 基础仓室、光学接口或电子计算机机械方块 -gt.blockmachines.multimachine.em.switch.desc.0=用户控制的计算力路由 -gt.blockmachines.multimachine.em.switch.desc.1=服务质量是必须的 +gt.blockmachines.multimachine.em.switch.desc.0=QoS网络交换机的控制器方块 +gt.blockmachines.multimachine.em.switch.desc.1=用于路由和分发算力 +gt.blockmachines.multimachine.em.switch.desc.2=需要通过参数仪进行配置 + gt.blockmachines.multimachine.em.computer.name=量子计算机 gt.blockmachines.multimachine.em.computer.hint.0=1 - 基础仓室、光学接口或电子计算机机械方块 @@ -593,62 +601,67 @@ gt.blockmachines.multimachine.em.computer.cfgi.0=超频比 gt.blockmachines.multimachine.em.computer.cfgi.1=过压比 gt.blockmachines.multimachine.em.computer.cfgo.0=当前最大热量 gt.blockmachines.multimachine.em.computer.cfgo.1=生成算力 +gt.blockmachines.multimachine.em.computer.desc.0=量子计算机的控制器方块 +gt.blockmachines.multimachine.em.computer.desc.1=用于生成算力(以及热量) gt.blockmachines.multimachine.em.databank.name=数据库 gt.blockmachines.multimachine.em.databank.hint.0=1 - 基础仓室或超能机械方块 gt.blockmachines.multimachine.em.databank.hint.1=2 - 数据访问仓、数据库主接口或电子计算机械方块 -gt.blockmachines.multimachine.em.databank.desc.0=远程装配数据传递 -gt.blockmachines.multimachine.em.databank.desc.1=直接应用于前部 +gt.blockmachines.multimachine.em.databank.desc.0=数据库的控制器方块 +gt.blockmachines.multimachine.em.databank.desc.1=为装配线提供更多闪存 +gt.blockmachines.multimachine.em.databank.desc.2=还可使多条装配线访问同一闪存 gt.blockmachines.multimachine.em.junction.name=物质流枢纽 gt.blockmachines.multimachine.em.junction.hint.0=1 - 基础仓室或超能机械方块 gt.blockmachines.multimachine.em.junction.hint.1=2 - 元物质输入/出仓或分子机械方块 -gt.blockmachines.multimachine.em.junction.desc.0=中转物质流 -gt.blockmachines.multimachine.em.junction.desc.1=沿轴运动! +gt.blockmachines.multimachine.em.junction.desc.0=物质流枢纽的控制器方块 +gt.blockmachines.multimachine.em.junction.desc.1=用于路由和分配元物质 +gt.blockmachines.multimachine.em.junction.desc.2=需要通过参数仪进行配置 gt.blockmachines.multimachine.em.mattertoem.name=物质量子化仪 gt.blockmachines.multimachine.em.mattertoem.hint.0=1 - 基础仓室或超能机械方块 gt.blockmachines.multimachine.em.mattertoem.hint.1=2 - 元物质输出仓 gt.blockmachines.multimachine.em.mattertoem.hint.2=3 - 元物质溢流仓或分子机械方块 -gt.blockmachines.multimachine.em.mattertoem.desc.0=方便地将常规物品转换为量子形态 -gt.blockmachines.multimachine.em.mattertoem.desc.1=使得它们更...不方便 +gt.blockmachines.multimachine.em.mattertoem.desc.0=物质量子化仪的控制器方块 +gt.blockmachines.multimachine.em.mattertoem.desc.1=将物品转化为它们的元素形态 gt.blockmachines.multimachine.em.emtomatter.name=物质反量子化仪 gt.blockmachines.multimachine.em.emtomatter.hint.0=1 - 基础仓室或超能机械方块 gt.blockmachines.multimachine.em.emtomatter.hint.1=2 - 元物质输入仓 gt.blockmachines.multimachine.em.emtomatter.hint.2=3 - 元物质溢流仓或分子机械方块 -gt.blockmachines.multimachine.em.emtomatter.desc.0=将量子转化回 -gt.blockmachines.multimachine.em.emtomatter.desc.1=它们的常规形态...但为什么要这么做? +gt.blockmachines.multimachine.em.emtomatter.desc.0=物质反量子化仪的控制器方块 +gt.blockmachines.multimachine.em.emtomatter.desc.1=将元物质还原为常规物品形态 gt.blockmachines.multimachine.em.emtoessentia.name=源质反量子化仪 gt.blockmachines.multimachine.em.emtoessentia.hint.0=1 - 基础仓室或超能机械方块 gt.blockmachines.multimachine.em.emtoessentia.hint.1=2 - 元物质输入仓 gt.blockmachines.multimachine.em.emtoessentia.hint.2=3 - 元物质溢流仓或分子机械方块 gt.blockmachines.multimachine.em.emtoessentia.hint.3=通用 - 某种源质的储存方块 -gt.blockmachines.multimachine.em.emtoessentia.desc.0=将量子转化回 -gt.blockmachines.multimachine.em.emtoessentia.desc.1=它们的常规形态...但为什么要这么做? +gt.blockmachines.multimachine.em.emtoessentia.desc.0=源质反量子化仪的控制器方块 +gt.blockmachines.multimachine.em.emtoessentia.desc.1=将元物质还原为源质形态 gt.blockmachines.multimachine.em.essentiatoem.name=源质量子化仪 gt.blockmachines.multimachine.em.essentiatoem.hint.0=1 - 基础仓室或超能机械方块 gt.blockmachines.multimachine.em.essentiatoem.hint.1=2 - 元物质输出仓 gt.blockmachines.multimachine.em.essentiatoem.hint.2=3 - 元物质溢流仓或分子机械方块 gt.blockmachines.multimachine.em.essentiatoem.hint.3=通用 - 某种源质的储存方块 -gt.blockmachines.multimachine.em.essentiatoem.desc.0=方便地将常规物品转换为量子形态 -gt.blockmachines.multimachine.em.essentiatoem.desc.1=使得它们更...不方便 +gt.blockmachines.multimachine.em.essentiatoem.desc.0=源质量子化仪的控制器方块 +gt.blockmachines.multimachine.em.essentiatoem.desc.1=将源质转化为它们的元素形态 gt.blockmachines.multimachine.em.scanner.name=元物质扫描仪 gt.blockmachines.multimachine.em.scanner.hint.0=1 - 基础仓室或超能机械方块 gt.blockmachines.multimachine.em.scanner.hint.1=2 - 元物质输入仓或分子机械方块 gt.blockmachines.multimachine.em.scanner.hint.2=3 - 元物质输出仓或分子机械方块 gt.blockmachines.multimachine.em.scanner.hint.3=4 - 元物质溢流仓或分子机械方块 -gt.blockmachines.multimachine.em.scanner.desc.0=它是如何存在的? -gt.blockmachines.multimachine.em.scanner.desc.1=我!不!知!道!(至少暂时是这样) +gt.blockmachines.multimachine.em.scanner.desc.0=元物质扫描仪的控制器方块 gt.blockmachines.multimachine.em.research.name=研究站 gt.blockmachines.multimachine.em.research.hint.0=1 - 基础仓室、光学接口或电子计算机械方块 gt.blockmachines.multimachine.em.research.hint.1=2 - 物品固定容器 -gt.blockmachines.multimachine.em.research.desc.0=哲学家们甚至... -gt.blockmachines.multimachine.em.research.desc.1=从来不曾梦见它! +gt.blockmachines.multimachine.em.research.desc.0=研究站的控制器方块 +gt.blockmachines.multimachine.em.research.desc.1=用于扫描物品, 生成装配线配方闪存 +gt.blockmachines.multimachine.em.research.desc.2=需要为其提供算力 +gt.blockmachines.multimachine.em.research.desc.3=在完成闪存写入之前不会消耗物品 gt.blockmachines.multimachine.em.collider.name=物质对撞机 gt.blockmachines.multimachine.em.collider.hint.0=1 - 基础仓室或超能机械方块 @@ -656,62 +669,64 @@ gt.blockmachines.multimachine.em.collider.hint.1=2 - 元物质输入仓或分子 gt.blockmachines.multimachine.em.collider.hint.2=3 - 元物质输出仓或分子机械方块 gt.blockmachines.multimachine.em.collider.hint.3=4 - 元物质溢流仓或分子机械方块 gt.blockmachines.multimachine.em.collider.hint.4=通用 - 另一个控制器面向相反的方向 -gt.blockmachines.multimachine.em.collider.desc.0=以极高的速度使物质相碰撞 -gt.blockmachines.multimachine.em.collider.desc.1=比光*还快!!! +gt.blockmachines.multimachine.em.collider.desc.0=物质对撞机的控制器方块 +gt.blockmachines.multimachine.em.collider.desc.1=需要一台镜像机器方可正常工作 +gt.blockmachines.multimachine.em.collider.desc.2=一台设为 '聚变模式', 另一台设为 '对撞模式' +gt.blockmachines.multimachine.em.collider.desc.3=将两种元物质聚变, 产生另一种元物质(以及能量) gt.blockmachines.multimachine.em.collider.mode.0=模式:聚变 gt.blockmachines.multimachine.em.collider.mode.1=模式:对撞 gt.blockmachines.multimachine.em.collider.mode.2=模式:未定义 gt.blockmachines.multimachine.em.collider.mode.3=从属于其他控制器 +gt.blockmachines.multimachine.em.collider.Structure.AdditionalCollider=需要与之镜像的另一台物质对撞机 gt.blockmachines.multimachine.em.infuser.name=能量注入仪 gt.blockmachines.multimachine.em.infuser.hint=1 - 基础仓室或超能机械方块 -gt.blockmachines.multimachine.em.infuser.desc.0=急速的能量转移! -gt.blockmachines.multimachine.em.infuser.desc.1=瞬间满电! -gt.blockmachines.multimachine.em.infuser.desc.2=但坏掉的时候不会工作! -gt.blockmachines.multimachine.em.infuser.desc.3=以及你需要考虑一下损耗... +gt.blockmachines.multimachine.em.infuser.desc.0=能量注入仪的控制器方块 +gt.blockmachines.multimachine.em.infuser.desc.1=可用于为物品充电(无损) +gt.blockmachines.multimachine.em.infuser.desc.2=提供UU物质可修复物品 +gt.blockmachines.multimachine.em.infuser.Structure.HighPowerCasing=第1、5层 +gt.blockmachines.multimachine.em.infuser.Structure.MolecularCoil=第2、4层 +gt.blockmachines.multimachine.em.infuser.Structure.MolecularCasing=第3层(中空) + gt.blockmachines.multimachine.em.processing.name=量子加工机 gt.blockmachines.multimachine.em.processing.hint.0=1 - 基础仓室或超能机械方块 gt.blockmachines.multimachine.em.processing.hint.1=2 - 元物质输入/出仓或分子机械方块 -gt.blockmachines.multimachine.em.processing.desc.0=从你最启用它开始... -gt.blockmachines.multimachine.em.processing.desc.1=为你处理量子物质 +gt.blockmachines.multimachine.em.processing.desc.0=量子加工机的控制器方块 gt.blockmachines.multimachine.em.crafter.name=物质组装机 gt.blockmachines.multimachine.em.crafter.hint.0=1 - 基础仓室或超能机械方块 gt.blockmachines.multimachine.em.crafter.hint.1=2 - 元物质输入/出仓或分子机械方块 -gt.blockmachines.multimachine.em.crafter.desc.0=以最精确的方法制造物品。 -gt.blockmachines.multimachine.em.crafter.desc.1=(跨过普朗克尺度的过程) +gt.blockmachines.multimachine.em.crafter.desc.0=物质组装机的控制器方块 gt.blockmachines.multimachine.em.stabilizer.name=元物质稳定器 gt.blockmachines.multimachine.em.stabilizer.hint.0=1 - 基础仓室或超能机械方块 gt.blockmachines.multimachine.em.stabilizer.hint.1=2 - 元物质输入/出仓或分子机械方块 -gt.blockmachines.multimachine.em.stabilizer.desc.0=扭曲时间以稳定物质 -gt.blockmachines.multimachine.em.stabilizer.desc.1=Wibbly wobbly timey wimey stuff.(欣赏原文吧,表示给跪了,大意是时空摇摆不定) +gt.blockmachines.multimachine.em.stabilizer.desc.0=元物质稳定器的控制器方块 gt.blockmachines.multimachine.em.wormhole.name=虫洞 gt.blockmachines.multimachine.em.wormhole.hint.0=1 - 基础仓室或超能机械方块 gt.blockmachines.multimachine.em.wormhole.hint.1=2 - 元物质输入/出仓或分子机械方块 -gt.blockmachines.multimachine.em.wormhole.desc.0=它并没有充满虫子。 -gt.blockmachines.multimachine.em.wormhole.desc.1=它充满了反虫子!!! +gt.blockmachines.multimachine.em.wormhole.desc.0=虫洞的控制器方块 -gt.blockmachines.multimachine.em.decay.name=衰变发生器 +gt.blockmachines.multimachine.em.decay.name=衰变发电机 gt.blockmachines.multimachine.em.decay.hint.0=1 - 基础仓室或超能机械方块 gt.blockmachines.multimachine.em.decay.hint.1=2 - 元物质输入/出仓或分子机械方块 -gt.blockmachines.multimachine.em.decay.desc.0=它的周期太长了吗? -gt.blockmachines.multimachine.em.decay.desc.1=那么就用它的半衰期(3)代替! +gt.blockmachines.multimachine.em.decay.desc.0=衰变发电机的控制器方块 +gt.blockmachines.multimachine.em.decay.desc.1=通过元物质衰变产生能量 + gt.blockmachines.multimachine.em.decay.conf=分流器 gt.blockmachines.multimachine.em.annihilation.name=湮灭发电机 gt.blockmachines.multimachine.em.annihilation.hint.0=1 - 基础仓室或超能机械方块 gt.blockmachines.multimachine.em.annihilation.hint.1=2 - 元物质输入/出仓或分子机械方块 -gt.blockmachines.multimachine.em.annihilation.desc.0=物质和反物质并不是那么喜欢对方。 -gt.blockmachines.multimachine.em.annihilation.desc.1=质能转换! +gt.blockmachines.multimachine.em.annihilation.desc.0=湮灭发电机的控制器方块 gt.blockmachines.multimachine.em.blackholegenerator.name=黑洞发生器 gt.blockmachines.multimachine.em.blackholegenerator.hint.0=1 - 基础仓室或超能机械方块 gt.blockmachines.multimachine.em.blackholegenerator.hint.1=2 - 元物质输入/出仓或分子机械方块 -gt.blockmachines.multimachine.em.blackholegenerator.desc.0=基于奇点的能量获取 -gt.blockmachines.multimachine.em.blackholegenerator.desc.1=极端不稳定!!! +gt.blockmachines.multimachine.em.blackholegenerator.desc.0=黑洞发生器的控制器方块 +gt.blockmachines.multimachine.em.blackholegenerator.desc.1=使用一颗黑洞产生能量 #Pipes gt.blockmachines.pipe.elementalmatter.name=量子隧道 @@ -792,6 +807,46 @@ gt.blockmachines.debug.tt.writer.desc.2=ABC轴沿机器正面确定 tt.keyword.ID=ID #Example: 32EU at 1A tt.keyword.at= +# Structure is too complex +tt.keyword.Structure.StructureTooComplex=结构太复杂了! +# Any X +tt.keyword.Structure.AnyComputerCasing=任意电子计算机械方块 +tt.keyword.Structure.AnyHighPowerCasing=任意超能机械方块 +tt.keyword.Structure.AnyHighPowerCasing1D=任意提示方块:1号的超能机械方块 +tt.keyword.Structure.AnyHighPowerCasing2D=任意提示方块:2号的超能机械方块 +tt.keyword.Structure.AnyHighPowerCasingFront=任意正面超能机械方块 +tt.keyword.Structure.AnyTeslaBaseCasingOuter=任意外侧特斯拉基座机械方块 +tt.keyword.Structure.AnyComputerCasingFirstOrLastSlice=任意最前或最后一片电子计算机械方块 +tt.keyword.Structure.AnyComputerCasingBackMain=任意主体背面电子计算机械方块 +tt.keyword.Structure.AnyAdvComputerCasingExceptOuter=除外部的任意进阶电子计算机械方块 +tt.keyword.Structure.AnyMolecularCasing=任意分子机械方块 +tt.keyword.Structure.AnyMolecularCasing2D=任意提示方块:2号分子机械方块 +tt.keyword.Structure.AnyMolecularCasing3D=任意提示方块:3号分子机械方块 +tt.keyword.Structure.AnyMolecularCasing4D=任意提示方块:4号分子机械方块 +tt.keyword.Structure.AnyOuterMolecularCasing3rd=任意第3片外侧分子机械方块 +tt.keyword.Structure.AnyOuterMolecularCasing4th=任意第4片外侧分子机械方块 +tt.keyword.Structure.AnyOuterMolecularCasing3rd4th=任意第3/4片外侧分子机械方块 +tt.keyword.Structure.AnyOuterCasingOnBottom=任意底层外侧机械方块 +# Optional +tt.keyword.Structure.Optional=(可选) +# Placement specification +tt.keyword.Structure.FrontCenter=正面中央 +tt.keyword.Structure.BackCenter=背面中央 +tt.keyword.Structure.SideCenter=侧面中央 +tt.keyword.Structure.FrontCenter3rd=正面第三层中央 +tt.keyword.Structure.CenterPillar=正面立柱中央 +tt.keyword.Structure.Center=中央 +# Additional structure components +tt.keyword.Structure.DataAccessHatch=数据访问仓 +tt.keyword.Structure.ElementalOutput=元物质输出仓 +tt.keyword.Structure.Elemental=元物质仓 +tt.keyword.Structure.ElementalOverflow=元物质溢流仓 +tt.keyword.Structure.ElementalInput=元物质输入仓 +tt.keyword.Structure.EssentiaStorage=源质存储装置 +tt.keyword.Structure.DataConnector=光学接口 +tt.keyword.Structure.SuperconductingCoilBlock=超导线圈方块 +tt.keyword.Structure.StainlessSteelCasing=不锈钢机械方块 + tt.keyphrase.Hint_Details=提示细节 -- 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 'src/main/resources/assets') 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 9b25e475dfab1a7a5e10d0fc1476b8894a9bd8d3 Mon Sep 17 00:00:00 2001 From: miozune Date: Wed, 16 Nov 2022 21:31:08 +0900 Subject: Deprecate Data Reader --- .../tectech/loader/recipe/BaseRecipeLoader.java | 20 -- .../tectech/loader/thing/MachineLoader.java | 2 - .../single/GT_MetaTileEntity_DataReader.java | 233 +--------------- .../single/gui/GT_Container_DataReader.java | 97 ------- .../single/gui/GT_GUIContainer_DataReader.java | 294 --------------------- .../textures/gui/basicmachines/dataReader.png | Bin 2543 -> 0 bytes 6 files changed, 6 insertions(+), 640 deletions(-) delete mode 100644 src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_Container_DataReader.java delete mode 100644 src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_GUIContainer_DataReader.java delete mode 100644 src/main/resources/assets/gregtech/textures/gui/basicmachines/dataReader.png (limited to 'src/main/resources/assets') diff --git a/src/main/java/com/github/technus/tectech/loader/recipe/BaseRecipeLoader.java b/src/main/java/com/github/technus/tectech/loader/recipe/BaseRecipeLoader.java index bdd2dc1136..a2d3edfa5e 100644 --- a/src/main/java/com/github/technus/tectech/loader/recipe/BaseRecipeLoader.java +++ b/src/main/java/com/github/technus/tectech/loader/recipe/BaseRecipeLoader.java @@ -120,26 +120,6 @@ public class BaseRecipeLoader { OrePrefixes.gem.get(Materials.EnderPearl) }); - // Data reader - GT_ModHandler.addCraftingRecipe( - CustomItemList.Machine_DataReader.get(1), - GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] { - "BdB", - "GES", - "PwP", - 'B', - OrePrefixes.screw.get(Materials.Iridium), - 'P', - OrePrefixes.plate.get(Materials.Iridium), - 'G', - ItemList.Cover_Screen, - 'S', - OrePrefixes.circuit.get(Materials.Elite), - 'E', - ItemList.Hull_IV - }); - // Data Bank RA.addAssemblylineRecipe( ItemList.Hatch_DataAccess_EV.get(1), diff --git a/src/main/java/com/github/technus/tectech/loader/thing/MachineLoader.java b/src/main/java/com/github/technus/tectech/loader/thing/MachineLoader.java index 53a16d2648..436c806da2 100644 --- a/src/main/java/com/github/technus/tectech/loader/thing/MachineLoader.java +++ b/src/main/java/com/github/technus/tectech/loader/thing/MachineLoader.java @@ -1042,8 +1042,6 @@ public class MachineLoader implements Runnable { GT_MetaTileEntity_Hatch_Rack.run(); - GT_MetaTileEntity_DataReader.run(); - GT_MetaTileEntity_Hatch_Capacitor.run(); if (!Loader.isModLoaded(Reference.DREAMCRAFT)) { diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DataReader.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DataReader.java index 90f1d17dec..03a98d53bf 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DataReader.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DataReader.java @@ -1,43 +1,26 @@ package com.github.technus.tectech.thing.metaTileEntity.single; -import static com.github.technus.tectech.Reference.MODID; -import static com.github.technus.tectech.recipe.TT_recipeAdder.nullItem; import static com.github.technus.tectech.thing.metaTileEntity.Textures.MACHINE_CASINGS_TT; import static com.github.technus.tectech.util.CommonValues.V; -import static net.minecraft.util.StatCollector.translateToLocal; -import com.github.technus.tectech.thing.metaTileEntity.single.gui.GT_Container_DataReader; -import com.github.technus.tectech.thing.metaTileEntity.single.gui.GT_GUIContainer_DataReader; -import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.util.TT_Utility; -import cpw.mods.fml.common.FMLCommonHandler; 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.GT_Slot_Holo; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine; import gregtech.api.objects.GT_RenderedTexture; -import gregtech.api.util.GT_Utility; import java.util.*; -import net.minecraft.client.gui.FontRenderer; 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.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.fluids.FluidStack; /** * Created by Tec on 23.03.2017. */ public class GT_MetaTileEntity_DataReader extends GT_MetaTileEntity_BasicMachine { - private static final HashMap> RENDER_REGISTRY = new HashMap<>(); public static GT_RenderedTexture READER_ONLINE, READER_OFFLINE; public GT_MetaTileEntity_DataReader(int aID, String aName, String aNameRegional, int aTier) { @@ -95,22 +78,13 @@ public class GT_MetaTileEntity_DataReader extends GT_MetaTileEntity_BasicMachine return null; } + @Override + public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { + return false; + } + @Override public int checkRecipe() { - if (getOutputAt(0) != null) { - return DID_NOT_FIND_RECIPE; - } - ItemStack input = getInputAt(0); - for (IDataRender render : getRenders(new TT_Utility.ItemStack_NoNBT(input))) { - if (render.canRender(input, mTier)) { - mOutputItems[0] = input.copy(); - input.stackSize -= 1; - calculateOverclockedNess(render.getReadingEUt(), render.getReadingTime()); - if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) - return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; - return FOUND_AND_SUCCESSFULLY_USED_RECIPE; - } - } return DID_NOT_FIND_RECIPE; } @@ -120,23 +94,6 @@ public class GT_MetaTileEntity_DataReader extends GT_MetaTileEntity_BasicMachine aBaseMetaTileEntity.setActive(getOutputAt(0) != null || mMaxProgresstime > 0); } - @Override - public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_Container_DataReader(aPlayerInventory, aBaseMetaTileEntity); - } - - @Override - public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_DataReader( - aPlayerInventory, - aBaseMetaTileEntity, - getLocalName(), - mGUIName, - GT_Utility.isStringValid(mNEIName) - ? mNEIName - : getRecipeList() != null ? getRecipeList().mUnlocalizedName : ""); - } - @Override public boolean isSimpleMachine() { return false; @@ -149,14 +106,7 @@ public class GT_MetaTileEntity_DataReader extends GT_MetaTileEntity_BasicMachine @Override public String[] getDescription() { - return new String[] { - CommonValues.TEC_MARK_GENERAL, - translateToLocal("gt.blockmachines.machine.tt.datareader.desc.0"), // Reads Data Sticks and Orbs - EnumChatFormatting.BLUE - + translateToLocal("gt.blockmachines.machine.tt.datareader.desc.1"), // Power it up and - EnumChatFormatting.BLUE - + translateToLocal("gt.blockmachines.machine.tt.datareader.desc.2") // Put the data storage in - }; + return new String[] {EnumChatFormatting.DARK_RED + "Deprecated"}; } @Override @@ -193,175 +143,4 @@ public class GT_MetaTileEntity_DataReader extends GT_MetaTileEntity_BasicMachine public long getMinimumStoredEU() { return maxEUInput() * 4L; } - - public static void addDataRender(TT_Utility.ItemStack_NoNBT stack, IDataRender render) { - ArrayList renders = RENDER_REGISTRY.computeIfAbsent(stack, k -> new ArrayList<>()); - if (FMLCommonHandler.instance().getEffectiveSide().isClient()) { - render.loadResources(); - } - renders.add(render); - } - - public static List getRenders(TT_Utility.ItemStack_NoNBT stack) { - ArrayList iDataRenders = RENDER_REGISTRY.get(stack); - return iDataRenders == null ? Collections.emptyList() : iDataRenders; - } - - public interface IDataRender { - @SideOnly(Side.CLIENT) - void loadResources(); - - @SideOnly(Side.CLIENT) - void initRender(ItemStack itemStack); - - @SideOnly(Side.CLIENT) - void renderTooltips(ItemStack itemStack, int mouseX, int mouseY, GT_GUIContainer_DataReader gui); - - @SideOnly(Side.CLIENT) - void renderForeground( - ItemStack itemStack, int mouseX, int mouseY, GT_GUIContainer_DataReader gui, FontRenderer font); - - @SideOnly(Side.CLIENT) - void renderBackgroundOverlay( - ItemStack itemStack, int mouseX, int mouseY, int X, int Y, GT_GUIContainer_DataReader gui); - - boolean canRender(ItemStack itemStack, byte tier); - - int getReadingEUt(); - - int getReadingTime(); - } - - public static void run() { - addDataRender(new TT_Utility.ItemStack_NoNBT(ItemList.Tool_DataStick.get(1)), new IDataRender() { - @SideOnly(Side.CLIENT) - private ResourceLocation bg; - - @SideOnly(Side.CLIENT) - private HashMap slots; - - private HashMap slots2; - - @Override - @SideOnly(Side.CLIENT) - public void loadResources() { - bg = new ResourceLocation(MODID + ":textures/gui/assLineRender.png"); - } - - @Override - public void initRender(ItemStack itemStack) { - slots = new HashMap<>(); - slots2 = new HashMap<>(); - - slots.put( - new GT_Slot_Holo(null, 0, 143, 55, false, false, 1), - ItemList.Tool_DataStick.getWithName(1, "Research data")); - ItemStack output = ItemStack.loadItemStackFromNBT(itemStack.stackTagCompound.getCompoundTag("output")); - if (output != null) { - slots.put(new GT_Slot_Holo(null, 0, 143, 19, false, false, 64), output); - } - - for (int i = 0; i < 16; i++) { - ArrayList array = new ArrayList<>(); - ItemStack input = ItemStack.loadItemStackFromNBT( - itemStack.stackTagCompound.getCompoundTag(Integer.toString(i))); - if (input != null) { - array.add(input); - } - for (int k = 0; k < itemStack.stackTagCompound.getInteger("a" + i); k++) { - input = ItemStack.loadItemStackFromNBT( - itemStack.stackTagCompound.getCompoundTag("a" + i + ":" + k)); - if (input != null) { - array.add(input); - } - } - if (array.size() > 0) { - slots2.put( - new GT_Slot_Holo(null, 0, 17 + (i & 0x3) * 18, 19 + (i >> 2) * 18, false, false, 64), - array.toArray(nullItem)); - } - } - for (int i = 0; i < 4; i++) { - FluidStack fs = - FluidStack.loadFluidStackFromNBT(itemStack.stackTagCompound.getCompoundTag("f" + i)); - if (fs != null) { - slots.put( - new GT_Slot_Holo(null, 0, 107, 19 + i * 18, false, false, 1), - GT_Utility.getFluidDisplayStack(fs, true)); - } - } - } - - @Override - public void renderTooltips(ItemStack itemStack, int mouseX, int mouseY, GT_GUIContainer_DataReader gui) { - for (Map.Entry entry : slots.entrySet()) { - gui.renderTooltipSimple(mouseX, mouseY, entry.getKey(), entry.getValue()); - } - int time = (int) (System.currentTimeMillis() / 2000); - for (Map.Entry entry : slots2.entrySet()) { - gui.renderTooltipSimple( - mouseX, mouseY, entry.getKey(), entry.getValue()[time % entry.getValue().length]); - } - } - - @Override - @SideOnly(Side.CLIENT) - public void renderForeground( - ItemStack itemStack, int mouseX, int mouseY, GT_GUIContainer_DataReader gui, FontRenderer font) { - int time = itemStack.stackTagCompound.getInteger("time"); - int EUt = itemStack.stackTagCompound.getInteger("eu"); - font.drawString(translateToLocal("tt.keyphrase.Ass_line_recipe"), 7, 8, 0x80a0ff); - font.drawString( - GT_Utility.trans("152", "Total: ") + GT_Utility.formatNumbers((long) time * EUt) + " EU", - 7, - 93, - 0x80a0ff); - font.drawString( - GT_Utility.trans("153", "Usage: ") + GT_Utility.formatNumbers(EUt) + " EU/t", 7, 103, 0x80a0ff); - font.drawString( - GT_Utility.trans("154", "Voltage: ") + GT_Utility.formatNumbers(EUt) + " EU", 7, 113, 0x80a0ff); - font.drawString(GT_Utility.trans("155", "Amperage: ") + 1, 7, 123, 0x80a0ff); - font.drawString( - GT_Utility.trans("158", "Time: ") - + GT_Utility.formatNumbers(0.05d * time) - + GT_Utility.trans("161", " secs"), - 7, - 133, - 0x80a0ff); - - for (Map.Entry entry : slots.entrySet()) { - gui.renderItemSimple(entry.getKey(), entry.getValue()); - } - time = (int) (System.currentTimeMillis() / 2000); - for (Map.Entry entry : slots2.entrySet()) { - gui.renderItemSimple(entry.getKey(), entry.getValue()[time % entry.getValue().length]); - } - } - - @Override - @SideOnly(Side.CLIENT) - public void renderBackgroundOverlay( - ItemStack itemStack, int mouseX, int mouseY, int X, int Y, GT_GUIContainer_DataReader gui) { - // 176/83 - gui.mc.getTextureManager().bindTexture(bg); - gui.drawTexturedModalRect(X, Y, 0, 0, 176, 151); - } - - @Override - public boolean canRender(ItemStack itemStack, byte tier) { - NBTTagCompound nbtTagCompound = itemStack.stackTagCompound; - return nbtTagCompound != null && nbtTagCompound.hasKey("output"); - } - - @Override - public int getReadingEUt() { - return (int) V[4]; - } - - @Override - public int getReadingTime() { - return 128; - } - }); - } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_Container_DataReader.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_Container_DataReader.java deleted file mode 100644 index 57eda3f1d5..0000000000 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_Container_DataReader.java +++ /dev/null @@ -1,97 +0,0 @@ -package com.github.technus.tectech.thing.metaTileEntity.single.gui; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.gui.GT_Container_BasicTank; -import gregtech.api.gui.GT_Slot_Output; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.ICrafting; -import net.minecraft.inventory.Slot; - -public class GT_Container_DataReader extends GT_Container_BasicTank { - public boolean mStuttering = false; - - public GT_Container_DataReader(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { - super(aInventoryPlayer, aTileEntity); - } - - @Override - public void addSlots(InventoryPlayer aInventoryPlayer) { - // this.addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 0, 8, 63, false, true, 1)); - // this.addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 0, 26, 63, false, true, 1)); - // this.addSlotToContainer(new GT_Slot_Render(this.mTileEntity, 2, 107, 63)); - - int tStartIndex = ((GT_MetaTileEntity_BasicMachine) this.mTileEntity.getMetaTileEntity()).getInputSlot(); - this.addSlotToContainer(new Slot(this.mTileEntity, tStartIndex, 53, 153)); - - tStartIndex = ((GT_MetaTileEntity_BasicMachine) this.mTileEntity.getMetaTileEntity()).getOutputSlot(); - this.addSlotToContainer(new GT_Slot_Output(this.mTileEntity, tStartIndex, 107, 153)); - - this.addSlotToContainer(new Slot(this.mTileEntity, 1, 17, 153)); - // this.addSlotToContainer(new Slot(this.mTileEntity, 3, 125, 63)); - // this.addSlotToContainer(new GT_Slot_Render(this.mTileEntity, tStartIndex, 53, 63)); - } - - @Override - protected void bindPlayerInventory(InventoryPlayer aInventoryPlayer) { - int i; - for (i = 0; i < 3; ++i) { - for (int j = 0; j < 9; ++j) { - this.addSlotToContainer(new Slot(aInventoryPlayer, j + i * 9 + 9, 8 + j * 18, 174 + i * 18)); - } - } - - for (i = 0; i < 9; ++i) { - this.addSlotToContainer(new Slot(aInventoryPlayer, i, 8 + i * 18, 232)); - } - } - - @Override - public void detectAndSendChanges() { - super.detectAndSendChanges(); - if (!this.mTileEntity.isClientSide() && this.mTileEntity.getMetaTileEntity() != null) { - this.mStuttering = ((GT_MetaTileEntity_BasicMachine) this.mTileEntity.getMetaTileEntity()).mStuttering; - - for (Object crafter : this.crafters) { - ICrafting var1 = (ICrafting) crafter; - var1.sendProgressBarUpdate(this, 102, this.mStuttering ? 1 : 0); - } - } - } - - @Override - public void addCraftingToCrafters(ICrafting par1ICrafting) { - super.addCraftingToCrafters(par1ICrafting); - } - - @Override - @SideOnly(Side.CLIENT) - public void updateProgressBar(int par1, int par2) { - super.updateProgressBar(par1, par2); - if (par1 == 102) { - this.mStuttering = par2 != 0; - } - } - - @Override - public int getSlotStartIndex() { - return 0; - } - - @Override - public int getShiftClickStartIndex() { - return 0; - } - - @Override - public int getSlotCount() { - return 3; - } - - @Override - public int getShiftClickSlotCount() { - return 1; - } -} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_GUIContainer_DataReader.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_GUIContainer_DataReader.java deleted file mode 100644 index d6f150d87e..0000000000 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_GUIContainer_DataReader.java +++ /dev/null @@ -1,294 +0,0 @@ -package com.github.technus.tectech.thing.metaTileEntity.single.gui; - -import com.github.technus.tectech.thing.metaTileEntity.single.GT_MetaTileEntity_DataReader; -import com.github.technus.tectech.util.TT_Utility; -import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; -import gregtech.api.gui.GT_Slot_Holo; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.util.GT_Utility; -import java.util.List; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL12; - -public class GT_GUIContainer_DataReader extends GT_GUIContainerMetaTile_Machine { - public final String mName; - public final String mNEI; - public final byte mProgressBarDirection; - public final byte mProgressBarAmount; - private ItemStack stack = null; - - public GT_GUIContainer_DataReader( - InventoryPlayer aInventoryPlayer, - IGregTechTileEntity aTileEntity, - String aName, - String aTextureFile, - String aNEI) { - this(aInventoryPlayer, aTileEntity, aName, aTextureFile, aNEI, (byte) 0, (byte) 1); - } - - public GT_GUIContainer_DataReader( - InventoryPlayer aInventoryPlayer, - IGregTechTileEntity aTileEntity, - String aName, - String aTextureFile, - String aNEI, - byte aProgressBarDirection, - byte aProgressBarAmount) { - super( - new GT_Container_DataReader(aInventoryPlayer, aTileEntity), - "gregtech:textures/gui/basicmachines/" + aTextureFile); - this.mProgressBarDirection = aProgressBarDirection; - this.mProgressBarAmount = (byte) Math.max(1, aProgressBarAmount); - this.mName = aName; - this.mNEI = aNEI; - ySize = 256; - } - - @Override - public void drawScreen(int mouseX, int mouseY, float par3) { - super.drawScreen(mouseX, mouseY, par3); - if (mContainer != null) { - if (mContainer.mTileEntity != null - && mContainer.mTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_DataReader) { - GT_MetaTileEntity_DataReader reader = - (GT_MetaTileEntity_DataReader) mContainer.mTileEntity.getMetaTileEntity(); - renderDataTooltips(mouseX, mouseY, reader.mTier); - } - } - } - - protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) { - if (mContainer != null) { - if (mContainer.mTileEntity != null - && mContainer.mTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_DataReader) { - GT_MetaTileEntity_DataReader reader = - (GT_MetaTileEntity_DataReader) mContainer.mTileEntity.getMetaTileEntity(); - if (renderDataFG(mouseX, mouseY, reader.mTier)) { - return; - } - } - } - fontRendererObj.drawString(mName, 7, 8, 0xfafaff); - } - - protected void drawGuiContainerBackgroundLayer(float par1, int mouseX, int mouseY) { - super.drawGuiContainerBackgroundLayer(par1, mouseX, mouseY); - int x = (this.width - this.xSize) / 2; - int y = (this.height - this.ySize) / 2; - this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize); - if (this.mContainer != null) { - if (((GT_Container_DataReader) this.mContainer).mStuttering) { - this.drawTexturedModalRect(x + 127, y + 152, 176, 54, 18, 18); - } - - if (this.mContainer.mMaxProgressTime > 0) { - int tSize = this.mProgressBarDirection < 2 ? 20 : 18; - int tProgress = Math.max( - 1, - Math.min( - tSize * this.mProgressBarAmount, - (this.mContainer.mProgressTime > 0 ? 1 : 0) - + this.mContainer.mProgressTime - * tSize - * this.mProgressBarAmount - / this.mContainer.mMaxProgressTime)) - % (tSize + 1); - switch (this.mProgressBarDirection) { - case 0: - this.drawTexturedModalRect(x + 78, y + 152, 176, 0, tProgress, 18); - break; - case 1: - this.drawTexturedModalRect(x + 78 + 20 - tProgress, y + 152, 196 - tProgress, 0, tProgress, 18); - break; - case 2: - this.drawTexturedModalRect(x + 78, y + 152, 176, 0, 20, tProgress); - break; - case 3: - this.drawTexturedModalRect( - x + 78, y + 152 + 18 - tProgress, 176, 18 - tProgress, 20, tProgress); - break; - case 4: - tProgress = 20 - tProgress; - this.drawTexturedModalRect(x + 78, y + 152, 176, 0, tProgress, 18); - break; - case 5: - tProgress = 20 - tProgress; - this.drawTexturedModalRect(x + 78 + 20 - tProgress, y + 152, 196 - tProgress, 0, tProgress, 18); - break; - case 6: - tProgress = 18 - tProgress; - this.drawTexturedModalRect(x + 78, y + 152, 176, 0, 20, tProgress); - break; - case 7: - tProgress = 18 - tProgress; - this.drawTexturedModalRect( - x + 78, y + 152 + 18 - tProgress, 176, 18 - tProgress, 20, tProgress); - } - } - } - if (mContainer != null) { - if (mContainer.mTileEntity != null - && mContainer.mTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_DataReader) { - GT_MetaTileEntity_DataReader reader = - (GT_MetaTileEntity_DataReader) mContainer.mTileEntity.getMetaTileEntity(); - renderDataBG(reader.getStackInSlot(reader.getOutputSlot()), mouseX, mouseY, x, y, reader.mTier); - } - } - } - - private void renderDataBG(ItemStack thing, int mouseX, int mouseY, int x, int y, byte mTier) { - if (thing != null) { - for (GT_MetaTileEntity_DataReader.IDataRender render : - GT_MetaTileEntity_DataReader.getRenders(new TT_Utility.ItemStack_NoNBT(thing))) { - if (render.canRender(thing, mTier)) { - if (!GT_Utility.areStacksEqual(stack, thing, false)) { - render.initRender(thing); - } - render.renderBackgroundOverlay(thing, mouseX, mouseY, x, y, this); - break; - } - } - } - stack = thing; - } - - private boolean renderDataFG(int mouseX, int mouseY, byte mTier) { - if (stack == null) { - return false; - } - for (GT_MetaTileEntity_DataReader.IDataRender render : - GT_MetaTileEntity_DataReader.getRenders(new TT_Utility.ItemStack_NoNBT(stack))) { - if (render.canRender(stack, mTier)) { - render.renderForeground(stack, mouseX, mouseY, this, fontRendererObj); - return true; - } - } - return false; - } - - private boolean renderDataTooltips(int mouseX, int mouseY, byte mTier) { - if (stack == null) { - return false; - } - for (GT_MetaTileEntity_DataReader.IDataRender render : - GT_MetaTileEntity_DataReader.getRenders(new TT_Utility.ItemStack_NoNBT(stack))) { - if (render.canRender(stack, mTier)) { - render.renderTooltips(stack, mouseX, mouseY, this); - return true; - } - } - return false; - } - - public void renderItemSimple(GT_Slot_Holo slot, ItemStack itemStack) { - int x = slot.xDisplayPosition; - int y = slot.yDisplayPosition; - this.zLevel = 100.0F; - itemRender.zLevel = 100.0F; - - if (itemStack == null) { - IIcon iicon = slot.getBackgroundIconIndex(); - - if (iicon != null) { - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glEnable(GL11.GL_BLEND); // Forge: Blending needs to be enabled for this. - this.mc.getTextureManager().bindTexture(TextureMap.locationItemsTexture); - this.drawTexturedModelRectFromIcon(x, y, iicon, 16, 16); - GL11.glDisable(GL11.GL_BLEND); // Forge: And clean that up - GL11.glEnable(GL11.GL_LIGHTING); - } - } - GL11.glEnable(GL11.GL_DEPTH_TEST); - itemRender.renderItemAndEffectIntoGUI(this.fontRendererObj, this.mc.getTextureManager(), itemStack, x, y); - itemRender.renderItemOverlayIntoGUI(this.fontRendererObj, this.mc.getTextureManager(), itemStack, x, y); - - itemRender.zLevel = 0.0F; - this.zLevel = 0.0F; - } - - public void renderTooltipSimple(int mouseX, int mouseY, GT_Slot_Holo slot, ItemStack itemStack) { - int x = slot.xDisplayPosition + (width - xSize) / 2; - int y = slot.yDisplayPosition + (height - ySize) / 2; - if (mouseX >= x && mouseY >= y && mouseX <= x + 16 && mouseY <= y + 16) { - List strings = itemStack.getTooltip(Minecraft.getMinecraft().thePlayer, false); - if (strings.size() > 0) { - strings.set(0, itemStack.getRarity().rarityColor + (String) strings.get(0)); - } - hoveringText(strings, mouseX, mouseY, fontRendererObj); - } - } - - private void hoveringText(List strings, int x, int y, FontRenderer font) { - if (!strings.isEmpty()) { - GL11.glDisable(GL12.GL_RESCALE_NORMAL); - // RenderHelper.disableStandardItemLighting(); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glDisable(GL11.GL_DEPTH_TEST); - int k = 0; - - for (Object aP_146283_1_ : strings) { - String s = (String) aP_146283_1_; - int l = font.getStringWidth(s); - - if (l > k) { - k = l; - } - } - - int x2 = x + 12; - int y2 = y - 12; - int i1 = 8; - - if (strings.size() > 1) { - i1 += 2 + (strings.size() - 1) * 10; - } - - if (x2 + k > this.width) { - x2 -= 28 + k; - } - - if (y2 + i1 + 6 > this.height) { - y2 = this.height - i1 - 6; - } - - // this.zLevel = 300.0F; - // itemRender.zLevel = 300.0F; - int j1 = 0xf0001040; // bg - this.drawGradientRect(x2 - 3, y2 - 4, x2 + k + 3, y2 - 3, j1, j1); - this.drawGradientRect(x2 - 3, y2 + i1 + 3, x2 + k + 3, y2 + i1 + 4, j1, j1); - this.drawGradientRect(x2 - 3, y2 - 3, x2 + k + 3, y2 + i1 + 3, j1, j1); - this.drawGradientRect(x2 - 4, y2 - 3, x2 - 3, y2 + i1 + 3, j1, j1); - this.drawGradientRect(x2 + k + 3, y2 - 3, x2 + k + 4, y2 + i1 + 3, j1, j1); - int k1 = 0x500040ff; // border bright - int l1 = (k1 & 0xfefefe) >> 1 | k1 & 0xff000000; // border dark??? - this.drawGradientRect(x2 - 3, y2 - 3 + 1, x2 - 3 + 1, y2 + i1 + 3 - 1, k1, l1); - this.drawGradientRect(x2 + k + 2, y2 - 3 + 1, x2 + k + 3, y2 + i1 + 3 - 1, k1, l1); - this.drawGradientRect(x2 - 3, y2 - 3, x2 + k + 3, y2 - 3 + 1, k1, k1); - this.drawGradientRect(x2 - 3, y2 + i1 + 2, x2 + k + 3, y2 + i1 + 3, l1, l1); - - for (int i2 = 0; i2 < strings.size(); ++i2) { - String s1 = (String) strings.get(i2); - font.drawStringWithShadow(s1, x2, y2, -1); - - if (i2 == 0) { - y2 += 2; - } - - y2 += 10; - } - - // this.zLevel = 0.0F; - // itemRender.zLevel = 0.0F; - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glEnable(GL11.GL_DEPTH_TEST); - // RenderHelper.enableStandardItemLighting(); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - } - } -} diff --git a/src/main/resources/assets/gregtech/textures/gui/basicmachines/dataReader.png b/src/main/resources/assets/gregtech/textures/gui/basicmachines/dataReader.png deleted file mode 100644 index 57a9b85ce9..0000000000 Binary files a/src/main/resources/assets/gregtech/textures/gui/basicmachines/dataReader.png and /dev/null 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 'src/main/resources/assets') 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 'src/main/resources/assets') 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 'src/main/resources/assets') 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 9cbf0f09838a901e73882f3ba7e8cecbc679143d Mon Sep 17 00:00:00 2001 From: miozune Date: Fri, 9 Dec 2022 21:41:50 +0900 Subject: Add no-inventory GUI for multiblock --- .../tectech/thing/gui/TecTechUITextures.java | 2 + .../base/GT_MetaTileEntity_MultiblockBase_EM.java | 129 +++++++++++---------- .../gui/background/screen_blue_no_inventory.png | Bin 0 -> 1418 bytes 3 files changed, 72 insertions(+), 59 deletions(-) create mode 100644 src/main/resources/assets/tectech/textures/gui/background/screen_blue_no_inventory.png (limited to 'src/main/resources/assets') 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 14ef35b317..781bee68c4 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,6 +13,8 @@ public class TecTechUITextures { 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 BACKGROUND_SCREEN_BLUE_NO_INVENTORY = + UITexture.fullImage(MODID, "gui/background/screen_blue_no_inventory"); public static final UITexture BUTTON_STANDARD_16x16 = UITexture.fullImage(MODID, "gui/button/standard_16x16"); public static final UITexture BUTTON_STANDARD_LIGHT_16x16 = 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 69f1515d4a..73e20d8c0f 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 @@ -2934,18 +2934,27 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt @Override public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { - builder.widget(new DrawableWidget() - .setDrawable(TecTechUITextures.BACKGROUND_SCREEN_BLUE) - .setPos(4, 4) - .setSize(190, 91)); + if (doesBindPlayerInventory()) { + builder.widget(new DrawableWidget() + .setDrawable(TecTechUITextures.BACKGROUND_SCREEN_BLUE) + .setPos(4, 4) + .setSize(190, 91)); + } else { + builder.widget(new DrawableWidget() + .setDrawable(TecTechUITextures.BACKGROUND_SCREEN_BLUE_NO_INVENTORY) + .setPos(4, 4) + .setSize(190, 171)); + } 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)); + if (doesBindPlayerInventory()) { + 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); @@ -2980,7 +2989,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt } return ret.toArray(new IDrawable[0]); }) - .setPos(174, 116) + .setPos(174, doesBindPlayerInventory() ? 116 : 140) .setSize(16, 16); if (isPowerPassButtonEnabled()) { powerPassButton.addTooltip("Power Pass").setTooltipShowUpDelay(TOOLTIP_DELAY); @@ -3010,7 +3019,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt } return ret.toArray(new IDrawable[0]); }) - .setPos(174, 132) + .setPos(174, doesBindPlayerInventory() ? 132 : 156) .setSize(16, 16); if (isSafeVoidButtonEnabled()) { safeVoidButton.addTooltip("Safe Void").setTooltipShowUpDelay(TOOLTIP_DELAY); @@ -3043,7 +3052,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt } return ret.toArray(new IDrawable[0]); }) - .setPos(174, 148) + .setPos(174, doesBindPlayerInventory() ? 148 : 172) .setSize(16, 16); if (isAllowedToWorkButtonEnabled()) { powerSwitchButton.addTooltip("Power Switch").setTooltipShowUpDelay(TOOLTIP_DELAY); @@ -3063,7 +3072,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt LEDCounter = (byte) ((1 + LEDCounter) % 6); } }.setDrawable(TecTechUITextures.PICTURE_PARAMETER_BLANK) - .setPos(5, 96) + .setPos(5, doesBindPlayerInventory() ? 96 : 176) .setSize(166, 12)); for (int hatch = 0; hatch < 10; hatch++) { for (int param = 0; param < 2; param++) { @@ -3072,51 +3081,53 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt } } - 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; + if (doesBindPlayerInventory()) { 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)); + .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)); } - 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) { @@ -3224,7 +3235,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt return getFullLedDescriptionOut(hatch, param); } }) - .setPos(12 + posIndex * 8, 97 + (input ? 0 : 1) * 6) + .setPos(12 + posIndex * 8, (doesBindPlayerInventory() ? 97 : 177) + (input ? 0 : 1) * 6) .setSize(6, 4)); if (input) { builder.widget(new FakeSyncWidget.ByteSyncer( diff --git a/src/main/resources/assets/tectech/textures/gui/background/screen_blue_no_inventory.png b/src/main/resources/assets/tectech/textures/gui/background/screen_blue_no_inventory.png new file mode 100644 index 0000000000..f1afff2b70 Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/background/screen_blue_no_inventory.png differ -- cgit