|
11 | 11 | import gregtech.api.metatileentity.interfaces.IGregTechTileEntity; |
12 | 12 | import gregtech.api.mui.GTGuis; |
13 | 13 | import gregtech.api.util.GTUtility; |
| 14 | +import gregtech.api.util.LocalizationUtils; |
14 | 15 | import gregtech.client.renderer.texture.Textures; |
15 | 16 | import gregtech.client.renderer.texture.custom.QuantumStorageRenderer; |
16 | 17 | import gregtech.client.utils.TooltipHelper; |
|
34 | 35 | import codechicken.lib.render.pipeline.ColourMultiplier; |
35 | 36 | import codechicken.lib.render.pipeline.IVertexOperation; |
36 | 37 | import codechicken.lib.vec.Matrix4; |
| 38 | +import com.cleanroommc.modularui.api.drawable.IKey; |
37 | 39 | import com.cleanroommc.modularui.factory.PosGuiData; |
38 | 40 | import com.cleanroommc.modularui.screen.ModularPanel; |
| 41 | +import com.cleanroommc.modularui.utils.Alignment; |
| 42 | +import com.cleanroommc.modularui.value.sync.BooleanSyncValue; |
| 43 | +import com.cleanroommc.modularui.value.sync.FluidSlotSyncHandler; |
| 44 | +import com.cleanroommc.modularui.value.sync.IntSyncValue; |
39 | 45 | import com.cleanroommc.modularui.value.sync.PanelSyncManager; |
| 46 | +import com.cleanroommc.modularui.widgets.FluidSlot; |
| 47 | +import com.cleanroommc.modularui.widgets.ToggleButton; |
| 48 | +import com.cleanroommc.modularui.widgets.layout.Column; |
| 49 | +import com.cleanroommc.modularui.widgets.textfield.TextFieldWidget; |
40 | 50 | import org.apache.commons.lang3.ArrayUtils; |
41 | 51 | import org.jetbrains.annotations.Nullable; |
42 | 52 |
|
@@ -84,7 +94,50 @@ public MetaTileEntity createMetaTileEntity(IGregTechTileEntity tileEntity) { |
84 | 94 |
|
85 | 95 | @Override |
86 | 96 | public ModularPanel buildUI(PosGuiData guiData, PanelSyncManager guiSyncManager) { |
87 | | - return GTGuis.createPanel(this, 176, 166); |
| 97 | + return GTGuis.createPanel(this, 176, 166) |
| 98 | + .child(IKey.lang("gregtech.creative.tank.fluid").asWidget() |
| 99 | + .pos(7, 9)) |
| 100 | + // todo replace with our fluid slot |
| 101 | + .child(new FluidSlot() |
| 102 | + .syncHandler(new FluidSlotSyncHandler(this.fluidTank) |
| 103 | + .phantom(true) |
| 104 | + .controlsAmount(true)) |
| 105 | + .pos(36, 6)) |
| 106 | + .child(new Column() |
| 107 | + .pos(7, 28) |
| 108 | + .crossAxisAlignment(Alignment.CrossAxis.START) |
| 109 | + .coverChildren() |
| 110 | + .child(IKey.lang("gregtech.creative.tank.mbpc").asWidget() |
| 111 | + .marginBottom(2)) |
| 112 | + .child(new TextFieldWidget() |
| 113 | + .left(2) |
| 114 | + .marginBottom(15) |
| 115 | + .size(154, 14) |
| 116 | + .setNumbers(1, Integer.MAX_VALUE) |
| 117 | + .setMaxLength(11) |
| 118 | + .value(new IntSyncValue(() -> mBPerCycle, value -> mBPerCycle = value))) |
| 119 | + .child(IKey.lang("gregtech.creative.tank.tpc").asWidget() |
| 120 | + .marginBottom(2)) |
| 121 | + .child(new TextFieldWidget() |
| 122 | + .left(2) |
| 123 | + .size(154, 14) |
| 124 | + .setNumbers(1, Integer.MAX_VALUE) |
| 125 | + .setMaxLength(11) |
| 126 | + .value(new IntSyncValue(() -> ticksPerCycle, value -> ticksPerCycle = value)))) |
| 127 | + .child(new ToggleButton() |
| 128 | + .disableHoverBackground() |
| 129 | + .pos(7, 101) |
| 130 | + .size(162, 20) |
| 131 | + .overlay(IKey.dynamic(() -> LocalizationUtils.format( |
| 132 | + active ? "gregtech.creative.activity.on" : "gregtech.creative.activity.off"))) |
| 133 | + .value(new BooleanSyncValue(() -> active, value -> { |
| 134 | + active = value; |
| 135 | + scheduleRenderUpdate(); |
| 136 | + var c = getQuantumController(); |
| 137 | + if (c != null) c.updateHandler(); |
| 138 | + }))) |
| 139 | + .child(createConnectionButton() |
| 140 | + .top(6)); |
88 | 141 | } |
89 | 142 |
|
90 | 143 | @Override |
|
0 commit comments