aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build.gradle19
-rw-r--r--dependencies.gradle16
-rw-r--r--repositories.gradle1
-rw-r--r--src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java77
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Param.java6
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_ParamText.java6
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java239
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/Parameters.java9
8 files changed, 261 insertions, 112 deletions
diff --git a/build.gradle b/build.gradle
index 9ceb5abe8c..bab3a3d8dc 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,4 +1,4 @@
-//version: 1671313514
+//version: 1673027205
/*
DO NOT CHANGE THIS FILE!
Also, you may replace this file at any time if there is an update available.
@@ -319,9 +319,17 @@ if (file('addon.gradle').exists()) {
apply from: 'repositories.gradle'
configurations {
- implementation.extendsFrom(shadowImplementation) // TODO: remove after all uses are refactored
- implementation.extendsFrom(shadowCompile)
- implementation.extendsFrom(shadeCompile)
+ // TODO: remove Compile after all uses are refactored to Implementation
+ for (config in [
+ shadowImplementation,
+ shadowCompile,
+ shadeCompile
+ ]) {
+ compileClasspath.extendsFrom(config)
+ runtimeClasspath.extendsFrom(config)
+ testCompileClasspath.extendsFrom(config)
+ testRuntimeClasspath.extendsFrom(config)
+ }
}
repositories {
@@ -350,7 +358,8 @@ dependencies {
annotationProcessor('com.google.code.gson:gson:2.8.6')
annotationProcessor('com.gtnewhorizon:gtnhmixins:2.1.3:processor')
if (usesMixinDebug.toBoolean()) {
- runtimeOnly('org.jetbrains:intellij-fernflower:1.2.1.16')
+ runtimeClasspath('org.jetbrains:intellij-fernflower:1.2.1.16')
+ testRuntimeClasspath('org.jetbrains:intellij-fernflower:1.2.1.16')
}
}
if (usesMixins.toBoolean() || forceEnableMixins.toBoolean()) {
diff --git a/dependencies.gradle b/dependencies.gradle
index fb52743c7f..e81574bb2e 100644
--- a/dependencies.gradle
+++ b/dependencies.gradle
@@ -2,12 +2,12 @@
dependencies {
shadowImplementation('com.github.GTNewHorizons:AVRcore:1.0.1')
- compile('com.github.GTNewHorizons:GT5-Unofficial:5.09.41.189-pre:dev')
- compile("com.github.GTNewHorizons:ModularUI:1.0.16:dev") {transitive=false}
+ compile('com.github.GTNewHorizons:GT5-Unofficial:5.09.41.204: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')
- compile('com.github.GTNewHorizons:CodeChickenCore:1.1.4:dev')
+ compile('com.github.GTNewHorizons:NotEnoughItems:2.3.20-GTNH:dev')
+ compile('com.github.GTNewHorizons:CodeChickenLib:1.1.5.6:dev')
+ compile('com.github.GTNewHorizons:CodeChickenCore:1.1.7:dev')
compile('com.github.GTNewHorizons:StructureLib:1.2.0-beta.2:dev')
compile('net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev')
compile('com.github.GTNewHorizons:GTNEIOrePlugin:1.0.26:dev')
@@ -17,9 +17,9 @@ dependencies {
compile('com.github.GTNewHorizons:AE2FluidCraft-Rework:1.0.40-gtnh:dev')
compileOnly('com.github.GTNewHorizons:OpenModularTurrets:2.2.11-247:dev') {transitive=false}
- compileOnly('com.github.GTNewHorizons:OpenComputers:1.7.5.23-GTNH:dev') {transitive=false}
- compileOnly('com.github.GTNewHorizons:GTplusplus:1.7.113:dev') {transitive=false}
- compileOnly('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-107-GTNH:dev') {transitive=false}
+ compileOnly('com.github.GTNewHorizons:OpenComputers:1.8.0.4-GTNH:dev') {transitive=false}
+ compileOnly('com.github.GTNewHorizons:GTplusplus:1.7.179:dev') {transitive=false}
+ compileOnly('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-134-GTNH:dev') {transitive=false}
compileOnly('curse.maven:cofh-lib-220333:2388748') {transitive=false}
compileOnly('curse.maven:computercraft-67504:2269339') {transitive=false}
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/compatibility/dreamcraft/DreamCraftRecipeLoader.java b/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java
index a42fddbfd6..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
@@ -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_UXV").get(1L),
+ 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_UXV").get(1L),
+ 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 = {
@@ -5774,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 = {
@@ -5790,6 +5861,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 +5878,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 ------------------------
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 ae1f7fbf56..b3eea38c87 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");
@@ -2931,7 +2934,92 @@ 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++) {
+ 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);
+ }
+ }
+
+ 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");
@@ -2963,12 +3051,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");
@@ -2993,11 +3082,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");
@@ -3026,85 +3117,45 @@ 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;
+ button.addTooltip("Power Switch").setTooltipShowUpDelay(TOOLTIP_DELAY);
+ }
+ return (ButtonWidget) button;
+ }
+
+ 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)
+ .setNumbersDouble((val) -> val)
+ .setGetter(() -> Double.toString(parametrization.iParamsIn[ledID]))
+ .setSetter(val -> {
+ try {
+ parametrization.iParamsIn[ledID] = Double.parseDouble(val);
+ } catch (Exception e) {
+ e.printStackTrace();
}
- 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));
- }
+ .setTextAlignment(Alignment.CenterLeft)
+ .setFocusOnGuiOpen(true)
+ .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;
@@ -3184,11 +3235,21 @@ 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) {
+ // 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(() -> {
if (input) {
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) {