From 51e20f8cb3a06ca7afbf3dfddfb8140900ab6370 Mon Sep 17 00:00:00 2001 From: miozune Date: Thu, 29 Dec 2022 23:39:51 +0900 Subject: Expose button adder methods on multiblock GUI --- .../base/GT_MetaTileEntity_MultiblockBase_EM.java | 179 +++++++++++---------- 1 file changed, 97 insertions(+), 82 deletions(-) (limited to 'src/main/java') 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 d4990878ee..b9da45c5d9 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 @@ -2933,7 +2933,89 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt drawTexts(screenElements, inventorySlot); builder.widget(screenElements.setPos(7, 8)); - Widget powerPassButton = new ButtonWidget() + Widget powerPassButton = createPowerPassButton(); + builder.widget(powerPassButton) + .widget(new FakeSyncWidget.BooleanSyncer(() -> ePowerPass, val -> ePowerPass = val)) + .widget(new FakeSyncWidget.BooleanSyncer(() -> ePowerPassCover, val -> ePowerPassCover = val)); + Widget safeVoidButton = createSafeVoidButton(); + builder.widget(safeVoidButton) + .widget(new FakeSyncWidget.BooleanSyncer(() -> eSafeVoid, val -> eSafeVoid = val)); + Widget powerSwitchButton = createPowerSwitchButton(); + 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, doesBindPlayerInventory() ? 96 : 176) + .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); + } + } + + if (doesBindPlayerInventory()) { + 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)); + } + } + + protected ButtonWidget createPowerPassButton() { + Widget button = new ButtonWidget() .setOnClick((clickData, widget) -> { if (isPowerPassButtonEnabled() || ePowerPassCover) { TecTech.proxy.playSound(getBaseMetaTileEntity(), "fx_click"); @@ -2965,12 +3047,13 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt .setPos(174, doesBindPlayerInventory() ? 116 : 140) .setSize(16, 16); if (isPowerPassButtonEnabled()) { - powerPassButton.addTooltip("Power Pass").setTooltipShowUpDelay(TOOLTIP_DELAY); + button.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() + return (ButtonWidget) button; + } + + protected ButtonWidget createSafeVoidButton() { + Widget button = new ButtonWidget() .setOnClick((clickData, widget) -> { if (isSafeVoidButtonEnabled()) { TecTech.proxy.playSound(getBaseMetaTileEntity(), "fx_click"); @@ -2995,11 +3078,13 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt .setPos(174, doesBindPlayerInventory() ? 132 : 156) .setSize(16, 16); if (isSafeVoidButtonEnabled()) { - safeVoidButton.addTooltip("Safe Void").setTooltipShowUpDelay(TOOLTIP_DELAY); + button.addTooltip("Safe Void").setTooltipShowUpDelay(TOOLTIP_DELAY); } - builder.widget(safeVoidButton) - .widget(new FakeSyncWidget.BooleanSyncer(() -> eSafeVoid, val -> eSafeVoid = val)); - Widget powerSwitchButton = new ButtonWidget() + return (ButtonWidget) button; + } + + protected ButtonWidget createPowerSwitchButton() { + Widget button = new ButtonWidget() .setOnClick((clickData, widget) -> { if (isAllowedToWorkButtonEnabled()) { TecTech.proxy.playSound(getBaseMetaTileEntity(), "fx_click"); @@ -3028,79 +3113,9 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt .setPos(174, doesBindPlayerInventory() ? 148 : 172) .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, doesBindPlayerInventory() ? 96 : 176) - .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); - } - } - - if (doesBindPlayerInventory()) { - 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)); + button.addTooltip("Power Switch").setTooltipShowUpDelay(TOOLTIP_DELAY); } + return (ButtonWidget) button; } private void addParameterLED(ModularWindow.Builder builder, int hatch, int param, boolean input) { -- cgit From 753886d280d4bf171a759f419fbd5eb3a4f741f5 Mon Sep 17 00:00:00 2001 From: minecraft7771 Date: Sun, 1 Jan 2023 17:51:25 +0100 Subject: Added pop up to manipulate input parameters --- .../base/GT_MetaTileEntity_MultiblockBase_EM.java | 53 ++++++++++++++++++---- 1 file changed, 45 insertions(+), 8 deletions(-) (limited to 'src/main/java') 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 b9da45c5d9..86b577fe43 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 @@ -34,19 +34,19 @@ 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.Alignment; +import com.gtnewhorizons.modularui.api.math.Color; 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 com.gtnewhorizons.modularui.common.widget.*; +import com.gtnewhorizons.modularui.common.widget.textfield.TextFieldWidget; import cpw.mods.fml.common.network.NetworkRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.Textures; +import gregtech.api.gui.modularui.GT_UITextures; import gregtech.api.interfaces.IHatchElement; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -86,6 +86,9 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt protected static Textures.BlockIcons.CustomIcon ScreenOFF; protected static Textures.BlockIcons.CustomIcon ScreenON; + /** Base ID for the LED window popup. LED 1 I0 will have ID 100, LED 1 I1 101... */ + protected static int LED_WINDOW_BASE_ID = 100; + // Sound resource - same as with screen but override getActivitySound public static final ResourceLocation activitySound = new ResourceLocation(Reference.MODID + ":fx_lo_freq"); @@ -2960,6 +2963,9 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt .setSize(166, 12)); for (int hatch = 0; hatch < 10; hatch++) { for (int param = 0; param < 2; param++) { + int ledID = hatch + param * 10; + buildContext.addSyncedWindow( + LED_WINDOW_BASE_ID + ledID, (player) -> createLEDConfigurationWindow(ledID)); addParameterLED(builder, hatch, param, true); addParameterLED(builder, hatch, param, false); } @@ -3118,10 +3124,36 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt return (ButtonWidget) button; } + private ModularWindow createLEDConfigurationWindow(int ledID) { + return ModularWindow.builder(100, 40) + .setBackground(TecTechUITextures.BACKGROUND_SCREEN_BLUE) + .widget(ButtonWidget.closeWindowButton(true).setPos(85, 3)) + .widget(new TextFieldWidget() + .setTextColor(Color.LIGHT_BLUE.normal) + .setNumbersDouble((val) -> val) + .setGetter(() -> Double.toString(parametrization.iParamsIn[ledID])) + .setSetter(val -> { + try { + parametrization.iParamsIn[ledID] = Double.parseDouble(val); + } catch (Exception e) { + e.printStackTrace(); + } + }) + .setTextAlignment(Alignment.CenterLeft) + .setBackground(GT_UITextures.BACKGROUND_TEXT_FIELD) + .setPos(5, 20) + .setSize(90, 15)) + .widget(new TextWidget((ledID % 10) + ":" + (ledID / 10) + ":I") + .setDefaultColor(Color.WHITE.normal) + .setTextAlignment(Alignment.Center) + .setPos(5, 5)) + .build(); + } + private void addParameterLED(ModularWindow.Builder builder, int hatch, int param, boolean input) { final int parameterIndex = hatch + param * 10; final int posIndex = hatch * 2 + param; - DrawableWidget ledWidget = new DrawableWidget() { + ButtonWidget ledWidget = new ButtonWidget() { @Override public void draw(float partialTicks) { IDrawable texture = null; @@ -3201,11 +3233,16 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt // no-op break; } - setDrawable(texture); + setBackground(texture); super.draw(partialTicks); GL11.glColor4f(1f, 1f, 1f, 1f); } - }; + }.setOnClick((clickData, widget) -> { + if (!widget.isClient() + && input + && parametrization.eParamsInStatus[parameterIndex] != LedStatus.STATUS_UNUSED) + widget.getContext().openSyncedWindow(LED_WINDOW_BASE_ID + parameterIndex); + }); builder.widget(ledWidget .dynamicTooltip(() -> { if (input) { -- cgit From 5de65dcfdfa6afb27c7e659799240fe82c13f52f Mon Sep 17 00:00:00 2001 From: minecraft7771 Date: Sun, 1 Jan 2023 18:41:34 +0100 Subject: Spawn popup next to main GUI --- .../metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/main/java') 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 86b577fe43..7e8bb045e6 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 @@ -3127,6 +3127,9 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt private ModularWindow createLEDConfigurationWindow(int ledID) { return ModularWindow.builder(100, 40) .setBackground(TecTechUITextures.BACKGROUND_SCREEN_BLUE) + .setPos((screenSize, mainWindow) -> new Pos2d( + (screenSize.width / 2 - mainWindow.getSize().width / 2) - 110, + (screenSize.height / 2 - mainWindow.getSize().height / 2))) .widget(ButtonWidget.closeWindowButton(true).setPos(85, 3)) .widget(new TextFieldWidget() .setTextColor(Color.LIGHT_BLUE.normal) -- cgit From 89e0788689c2716109c37979002df10eaf4cfee6 Mon Sep 17 00:00:00 2001 From: miozune Date: Tue, 3 Jan 2023 20:41:51 +0900 Subject: Add deprecation tooltip to Parametrizers --- dependencies.gradle | 4 ++-- repositories.gradle | 1 + .../thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Param.java | 6 ++---- .../metaTileEntity/hatch/GT_MetaTileEntity_Hatch_ParamText.java | 6 ++---- .../multi/base/GT_MetaTileEntity_MultiblockBase_EM.java | 1 + 5 files changed, 8 insertions(+), 10 deletions(-) (limited to 'src/main/java') diff --git a/dependencies.gradle b/dependencies.gradle index ce8f825c62..7bfba2df1c 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -2,8 +2,8 @@ dependencies { shadowImplementation('com.github.GTNewHorizons:AVRcore:1.0.1') - compile('com.github.GTNewHorizons:GT5-Unofficial:5.09.41.145:dev') - compile("com.github.GTNewHorizons:ModularUI:1.0.16:dev") {transitive=false} + compile('com.github.GTNewHorizons:GT5-Unofficial:5.09.41.196:dev') + compile('com.github.GTNewHorizons:ModularUI:1.0.38: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/repositories.gradle b/repositories.gradle index 9d72b53b8e..bb2c605d5c 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/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Param.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Param.java index 7a59e39c6d..bf315e1dfe 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 @@ -1,6 +1,5 @@ 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.TecTech; @@ -217,9 +216,8 @@ public class GT_MetaTileEntity_Hatch_Param extends GT_MetaTileEntity_Hatch imple public String[] getDescription() { return new String[] { CommonValues.TEC_MARK_GENERAL, - translateToLocal("gt.blockmachines.hatch.param.desc.0"), // For parametrization of Multiblocks - EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD - + translateToLocal("gt.blockmachines.hatch.param.desc.1") + "\u00b2" // E=mine*craft + EnumChatFormatting.DARK_RED + "Deprecated; Now you can set parameter by clicking LED on multiblock GUI.", + EnumChatFormatting.DARK_RED + "If it doesn't work, try removing Parametrizer from multiblock structure.", }; } 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 810c04d861..9b795a0a08 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 @@ -1,6 +1,5 @@ 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.TecTech; @@ -162,9 +161,8 @@ public class GT_MetaTileEntity_Hatch_ParamText extends GT_MetaTileEntity_Hatch_P public String[] getDescription() { return new String[] { CommonValues.TEC_MARK_GENERAL, - translateToLocal("gt.blockmachines.hatch.param.desc.0"), // For parametrization of Multiblocks - EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD - + translateToLocal("gt.blockmachines.hatch.param.desc.1") + "\u00b2" // E=mine*craft + EnumChatFormatting.DARK_RED + "Deprecated; Now you can set parameter by clicking LED on multiblock GUI.", + EnumChatFormatting.DARK_RED + "If it doesn't work, try removing Parametrizer from multiblock structure.", }; } 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 7e8bb045e6..8146414ac8 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 @@ -3143,6 +3143,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt } }) .setTextAlignment(Alignment.CenterLeft) + .setFocusOnGuiOpen(true) .setBackground(GT_UITextures.BACKGROUND_TEXT_FIELD) .setPos(5, 20) .setSize(90, 15)) -- cgit From 2cdfbeb599253ff306b3655a999ba6afcc116a43 Mon Sep 17 00:00:00 2001 From: adam riondy Date: Wed, 4 Jan 2023 03:11:57 +0100 Subject: add craft for uxv energy hatch and dynamo --- .../dreamcraft/DreamCraftRecipeLoader.java | 75 +++++++++++++++++++++- 1 file changed, 73 insertions(+), 2 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java b/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java index a42fddbfd6..d0650163c6 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java +++ b/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java @@ -3383,6 +3383,73 @@ public class DreamCraftRecipeLoader { 1000, 128_000_000); + // UXV Dynamo/energy hatch + TT_recipeAdder.addResearchableAssemblylineRecipe( + getItemContainer("Hatch_Energy_UMV").get(1L), + 384000, + 256, + 800000, + 32, + new Object[] { + getItemContainer("Hull_UMV").get(4L), + GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.SuperconductorUMV, 4L), + ItemList.Circuit_Chip_QPIC.get(16L), + getItemContainer("QuantumCircuit").get(2), + ItemList.UHV_Coil.get(32L), + ItemList.Reactor_Coolant_Sp_6.get(1L), + ItemList.Reactor_Coolant_Sp_6.get(1L), + ItemList.Reactor_Coolant_Sp_6.get(1L), + ItemList.Reactor_Coolant_Sp_6.get(1L), + ItemList.Reactor_Coolant_Sp_6.get(1L), + ItemList.Reactor_Coolant_Sp_6.get(1L), + ItemList.Reactor_Coolant_Sp_6.get(1L), + ItemList.Reactor_Coolant_Sp_6.get(1L), + ItemList.Reactor_Coolant_Sp_6.get(1L), + ItemList.Reactor_Coolant_Sp_6.get(1L), + ItemList.Electric_Pump_UMV.get(4L) + }, + new FluidStack[] { + Materials.SuperCoolant.getFluid(64_000L), + new FluidStack(solderUEV, 80 * 144), + Materials.UUMatter.getFluid(64000L) + }, + getItemContainer("Hatch_Energy_UXV").get(1L), + 1000, + 512_000_000); + + TT_recipeAdder.addResearchableAssemblylineRecipe( + getItemContainer("Hatch_Dynamo_UMV").get(1L), + 384000, + 256, + 800000, + 32, + new Object[] { + getItemContainer("Hull_UMV").get(4L), + GT_OreDictUnificator.get(OrePrefixes.spring, Materials.SuperconductorUMVBase, 16L), + ItemList.Circuit_Chip_QPIC.get(16L), + getItemContainer("QuantumCircuit").get(2), + ItemList.UHV_Coil.get(32L), + ItemList.Reactor_Coolant_Sp_6.get(1L), + ItemList.Reactor_Coolant_Sp_6.get(1L), + ItemList.Reactor_Coolant_Sp_6.get(1L), + ItemList.Reactor_Coolant_Sp_6.get(1L), + ItemList.Reactor_Coolant_Sp_6.get(1L), + ItemList.Reactor_Coolant_Sp_6.get(1L), + ItemList.Reactor_Coolant_Sp_6.get(1L), + ItemList.Reactor_Coolant_Sp_6.get(1L), + ItemList.Reactor_Coolant_Sp_6.get(1L), + ItemList.Reactor_Coolant_Sp_6.get(1L), + ItemList.Electric_Pump_UMV.get(4L) + }, + new FluidStack[] { + Materials.SuperCoolant.getFluid(64_000L), + new FluidStack(solderUEV, 80 * 144), + Materials.UUMatter.getFluid(64000L) + }, + getItemContainer("Hatch_Dynamo_UXV").get(1L), + 1000, + 512_000_000); + // UHV Circuit Wetwaremainframe TT_recipeAdder.addResearchableAssemblylineRecipe( ItemList.Circuit_Wetwaresupercomputer.get(1L), @@ -5740,7 +5807,8 @@ public class DreamCraftRecipeLoader { ItemList.Hatch_Energy_MAX.get(1), getItemContainer("Hatch_Energy_UEV").get(1L), getItemContainer("Hatch_Energy_UIV").get(1L), - getItemContainer("Hatch_Energy_UMV").get(1L) + getItemContainer("Hatch_Energy_UMV").get(1L), + getItemContainer("Hatch_Energy_UXV").get(1L) }; ItemStack[] dynamo_hatches = { @@ -5756,7 +5824,8 @@ public class DreamCraftRecipeLoader { ItemList.Hatch_Dynamo_MAX.get(1), getItemContainer("Hatch_Dynamo_UEV").get(1L), getItemContainer("Hatch_Dynamo_UIV").get(1L), - getItemContainer("Hatch_Dynamo_UMV").get(1L) + getItemContainer("Hatch_Dynamo_UMV").get(1L), + getItemContainer("Hatch_Dynamo_UXV").get(1L) }; Object[] circuits_tier_plus_two = { @@ -5790,6 +5859,7 @@ public class DreamCraftRecipeLoader { ItemList.Wireless_Hatch_Energy_UEV.get(1), ItemList.Wireless_Hatch_Energy_UIV.get(1), ItemList.Wireless_Hatch_Energy_UMV.get(1), + ItemList.Wireless_Hatch_Energy_UXV.get(1), }; ItemStack[] wireless_dynamos = { @@ -5806,6 +5876,7 @@ public class DreamCraftRecipeLoader { ItemList.Wireless_Dynamo_Energy_UEV.get(1), ItemList.Wireless_Dynamo_Energy_UIV.get(1), ItemList.Wireless_Dynamo_Energy_UMV.get(1), + ItemList.Wireless_Dynamo_Energy_UXV.get(1), }; // ------------------------ Wireless EU hatches ------------------------ -- cgit From eb54cc0fb6e4330d73f6de42585b151602bea535 Mon Sep 17 00:00:00 2001 From: adam riondy Date: Wed, 4 Jan 2023 03:16:15 +0100 Subject: spotlessApply --- .../dreamcraft/DreamCraftRecipeLoader.java | 76 +++++++++++----------- 1 file changed, 38 insertions(+), 38 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java b/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java index d0650163c6..c6378dc8ad 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java +++ b/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java @@ -3391,27 +3391,27 @@ public class DreamCraftRecipeLoader { 800000, 32, new Object[] { - getItemContainer("Hull_UMV").get(4L), - GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.SuperconductorUMV, 4L), - ItemList.Circuit_Chip_QPIC.get(16L), - getItemContainer("QuantumCircuit").get(2), - ItemList.UHV_Coil.get(32L), - ItemList.Reactor_Coolant_Sp_6.get(1L), - ItemList.Reactor_Coolant_Sp_6.get(1L), - ItemList.Reactor_Coolant_Sp_6.get(1L), - ItemList.Reactor_Coolant_Sp_6.get(1L), - ItemList.Reactor_Coolant_Sp_6.get(1L), - ItemList.Reactor_Coolant_Sp_6.get(1L), - ItemList.Reactor_Coolant_Sp_6.get(1L), - ItemList.Reactor_Coolant_Sp_6.get(1L), - ItemList.Reactor_Coolant_Sp_6.get(1L), - ItemList.Reactor_Coolant_Sp_6.get(1L), - ItemList.Electric_Pump_UMV.get(4L) + getItemContainer("Hull_UMV").get(4L), + GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.SuperconductorUMV, 4L), + ItemList.Circuit_Chip_QPIC.get(16L), + getItemContainer("QuantumCircuit").get(2), + ItemList.UHV_Coil.get(32L), + ItemList.Reactor_Coolant_Sp_6.get(1L), + ItemList.Reactor_Coolant_Sp_6.get(1L), + ItemList.Reactor_Coolant_Sp_6.get(1L), + ItemList.Reactor_Coolant_Sp_6.get(1L), + ItemList.Reactor_Coolant_Sp_6.get(1L), + ItemList.Reactor_Coolant_Sp_6.get(1L), + ItemList.Reactor_Coolant_Sp_6.get(1L), + ItemList.Reactor_Coolant_Sp_6.get(1L), + ItemList.Reactor_Coolant_Sp_6.get(1L), + ItemList.Reactor_Coolant_Sp_6.get(1L), + ItemList.Electric_Pump_UMV.get(4L) }, new FluidStack[] { - Materials.SuperCoolant.getFluid(64_000L), - new FluidStack(solderUEV, 80 * 144), - Materials.UUMatter.getFluid(64000L) + Materials.SuperCoolant.getFluid(64_000L), + new FluidStack(solderUEV, 80 * 144), + Materials.UUMatter.getFluid(64000L) }, getItemContainer("Hatch_Energy_UXV").get(1L), 1000, @@ -3424,27 +3424,27 @@ public class DreamCraftRecipeLoader { 800000, 32, new Object[] { - getItemContainer("Hull_UMV").get(4L), - GT_OreDictUnificator.get(OrePrefixes.spring, Materials.SuperconductorUMVBase, 16L), - ItemList.Circuit_Chip_QPIC.get(16L), - getItemContainer("QuantumCircuit").get(2), - ItemList.UHV_Coil.get(32L), - ItemList.Reactor_Coolant_Sp_6.get(1L), - ItemList.Reactor_Coolant_Sp_6.get(1L), - ItemList.Reactor_Coolant_Sp_6.get(1L), - ItemList.Reactor_Coolant_Sp_6.get(1L), - ItemList.Reactor_Coolant_Sp_6.get(1L), - ItemList.Reactor_Coolant_Sp_6.get(1L), - ItemList.Reactor_Coolant_Sp_6.get(1L), - ItemList.Reactor_Coolant_Sp_6.get(1L), - ItemList.Reactor_Coolant_Sp_6.get(1L), - ItemList.Reactor_Coolant_Sp_6.get(1L), - ItemList.Electric_Pump_UMV.get(4L) + getItemContainer("Hull_UMV").get(4L), + GT_OreDictUnificator.get(OrePrefixes.spring, Materials.SuperconductorUMVBase, 16L), + ItemList.Circuit_Chip_QPIC.get(16L), + getItemContainer("QuantumCircuit").get(2), + ItemList.UHV_Coil.get(32L), + ItemList.Reactor_Coolant_Sp_6.get(1L), + ItemList.Reactor_Coolant_Sp_6.get(1L), + ItemList.Reactor_Coolant_Sp_6.get(1L), + ItemList.Reactor_Coolant_Sp_6.get(1L), + ItemList.Reactor_Coolant_Sp_6.get(1L), + ItemList.Reactor_Coolant_Sp_6.get(1L), + ItemList.Reactor_Coolant_Sp_6.get(1L), + ItemList.Reactor_Coolant_Sp_6.get(1L), + ItemList.Reactor_Coolant_Sp_6.get(1L), + ItemList.Reactor_Coolant_Sp_6.get(1L), + ItemList.Electric_Pump_UMV.get(4L) }, new FluidStack[] { - Materials.SuperCoolant.getFluid(64_000L), - new FluidStack(solderUEV, 80 * 144), - Materials.UUMatter.getFluid(64000L) + Materials.SuperCoolant.getFluid(64_000L), + new FluidStack(solderUEV, 80 * 144), + Materials.UUMatter.getFluid(64000L) }, getItemContainer("Hatch_Dynamo_UXV").get(1L), 1000, -- cgit From ad36dfb729c8347960e90445cc6639f9482eb84b Mon Sep 17 00:00:00 2001 From: adam riondy Date: Wed, 4 Jan 2023 03:32:22 +0100 Subject: now wireless work too --- .../tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/main/java') diff --git a/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java b/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java index c6378dc8ad..ee0b90a523 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java +++ b/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java @@ -5843,6 +5843,8 @@ public class DreamCraftRecipeLoader { new Object[] {OrePrefixes.circuit.get(Materials.Quantum), 1L}, // UXV new Object[] {OrePrefixes.circuit.get(Materials.Quantum), 4L }, // MAX (Technically not MAX, can be changed once MAX circuits become craftable) + new Object[] {OrePrefixes.circuit.get(Materials.Quantum), 16L + }, // MAX (Technically not MAX, can be changed once MAX circuits become craftable) }; ItemStack[] wireless_hatches = { -- cgit From e171992c52c6c5179123e632b6d9172f3507c898 Mon Sep 17 00:00:00 2001 From: minecraft7771 Date: Thu, 5 Jan 2023 11:02:20 +0100 Subject: Added overloaded trySetParameters which only sets one parameter --- .../tectech/thing/metaTileEntity/multi/base/Parameters.java | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/main/java') diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/Parameters.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/Parameters.java index f6016a7482..c2bf711b86 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/Parameters.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/Parameters.java @@ -52,6 +52,15 @@ public class Parameters { return false; } + public boolean trySetParameters(int hatchNo, int parameterId, double parameter) { + Group p = groups[hatchNo]; + if (parent.mMaxProgresstime <= 0 || (p != null && p.updateWhileRunning)) { + iParamsIn[hatchNo + 10 * parameterId] = parameter; + return true; + } + return false; + } + public void setToDefaults(int hatch, boolean defaultIn, boolean defaultOut) { Group p = groups[hatch]; if (p == null) { -- cgit From 5e81e40cf806ab10b32b7cb5676c7d5a1f266a45 Mon Sep 17 00:00:00 2001 From: minecraft7771 Date: Thu, 5 Jan 2023 16:59:49 +0100 Subject: Close all other LED windows when one is opened --- .../multi/base/GT_MetaTileEntity_MultiblockBase_EM.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/main/java') 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 8146414ac8..eb972e7b37 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 @@ -3245,7 +3245,11 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt if (!widget.isClient() && input && parametrization.eParamsInStatus[parameterIndex] != LedStatus.STATUS_UNUSED) - widget.getContext().openSyncedWindow(LED_WINDOW_BASE_ID + parameterIndex); + // We don't use CloseAllButMain here in case MB implementation adds their own window + for (int i = 0; i < parametrization.eParamsInStatus.length; i++) { + widget.getContext().closeWindow(LED_WINDOW_BASE_ID + i); + } + widget.getContext().openSyncedWindow(LED_WINDOW_BASE_ID + parameterIndex); }); builder.widget(ledWidget .dynamicTooltip(() -> { -- cgit From 2317d4a63c6d6c0c89185bf39cd4f2a6e24fe515 Mon Sep 17 00:00:00 2001 From: minecraft7771 Date: Thu, 5 Jan 2023 17:02:40 +0100 Subject: Derp --- .../multi/base/GT_MetaTileEntity_MultiblockBase_EM.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/main/java') 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 eb972e7b37..74760bb84a 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 @@ -3244,12 +3244,13 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt }.setOnClick((clickData, widget) -> { if (!widget.isClient() && input - && parametrization.eParamsInStatus[parameterIndex] != LedStatus.STATUS_UNUSED) + && parametrization.eParamsInStatus[parameterIndex] != LedStatus.STATUS_UNUSED) { // We don't use CloseAllButMain here in case MB implementation adds their own window for (int i = 0; i < parametrization.eParamsInStatus.length; i++) { widget.getContext().closeWindow(LED_WINDOW_BASE_ID + i); } - widget.getContext().openSyncedWindow(LED_WINDOW_BASE_ID + parameterIndex); + widget.getContext().openSyncedWindow(LED_WINDOW_BASE_ID + parameterIndex); + } }); builder.widget(ledWidget .dynamicTooltip(() -> { -- cgit From f61ca583beb2c5cea9a5566a9c09e3c34b4182f2 Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Fri, 6 Jan 2023 19:35:36 +0100 Subject: recipe error --- .../tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java b/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java index ee0b90a523..a87d37ec37 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java +++ b/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java @@ -3391,7 +3391,7 @@ public class DreamCraftRecipeLoader { 800000, 32, new Object[] { - getItemContainer("Hull_UMV").get(4L), + getItemContainer("Hull_UXV").get(4L), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.SuperconductorUMV, 4L), ItemList.Circuit_Chip_QPIC.get(16L), getItemContainer("QuantumCircuit").get(2), @@ -3424,7 +3424,7 @@ public class DreamCraftRecipeLoader { 800000, 32, new Object[] { - getItemContainer("Hull_UMV").get(4L), + getItemContainer("Hull_UXV").get(4L), GT_OreDictUnificator.get(OrePrefixes.spring, Materials.SuperconductorUMVBase, 16L), ItemList.Circuit_Chip_QPIC.get(16L), getItemContainer("QuantumCircuit").get(2), -- cgit From 429b881bf49254591026e196558b78f8bf0aa956 Mon Sep 17 00:00:00 2001 From: GDCloud Date: Fri, 6 Jan 2023 21:35:31 +0100 Subject: Fix uxv hull amount --- .../tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java b/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java index a87d37ec37..850c31ae94 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java +++ b/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java @@ -3391,7 +3391,7 @@ public class DreamCraftRecipeLoader { 800000, 32, new Object[] { - getItemContainer("Hull_UXV").get(4L), + getItemContainer("Hull_UXV").get(1L), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.SuperconductorUMV, 4L), ItemList.Circuit_Chip_QPIC.get(16L), getItemContainer("QuantumCircuit").get(2), @@ -3424,7 +3424,7 @@ public class DreamCraftRecipeLoader { 800000, 32, new Object[] { - getItemContainer("Hull_UXV").get(4L), + getItemContainer("Hull_UXV").get(1L), GT_OreDictUnificator.get(OrePrefixes.spring, Materials.SuperconductorUMVBase, 16L), ItemList.Circuit_Chip_QPIC.get(16L), getItemContainer("QuantumCircuit").get(2), -- cgit