|
50 | 50 | import com.cleanroommc.modularui.factory.PosGuiData; |
51 | 51 | import com.cleanroommc.modularui.screen.ModularPanel; |
52 | 52 | import com.cleanroommc.modularui.value.sync.DoubleSyncValue; |
| 53 | +import com.cleanroommc.modularui.value.sync.IntSyncValue; |
53 | 54 | import com.cleanroommc.modularui.value.sync.PanelSyncManager; |
54 | 55 | import com.cleanroommc.modularui.widget.Widget; |
55 | 56 | import com.cleanroommc.modularui.widgets.ItemSlot; |
@@ -161,12 +162,14 @@ public void readFromNBT(NBTTagCompound data) { |
161 | 162 | public void writeInitialSyncData(PacketBuffer buf) { |
162 | 163 | super.writeInitialSyncData(buf); |
163 | 164 | buf.writeBoolean(isBurning); |
| 165 | + buf.writeVarInt(currentTemperature); |
164 | 166 | } |
165 | 167 |
|
166 | 168 | @Override |
167 | 169 | public void receiveInitialSyncData(PacketBuffer buf) { |
168 | 170 | super.receiveInitialSyncData(buf); |
169 | 171 | this.isBurning = buf.readBoolean(); |
| 172 | + this.currentTemperature = buf.readVarInt(); |
170 | 173 | } |
171 | 174 |
|
172 | 175 | @Override |
@@ -346,12 +349,17 @@ public boolean usesMui2() { |
346 | 349 |
|
347 | 350 | @Override |
348 | 351 | public ModularPanel buildUI(PosGuiData guiData, PanelSyncManager guiSyncManager) { |
| 352 | + IntSyncValue temp = new IntSyncValue(this::getCurrentTemperature); |
| 353 | + guiSyncManager.syncValue("temperature", temp); |
349 | 354 | return GTGuis.defaultPanel(this) |
350 | 355 | .child(IKey.lang(getMetaFullName()).asWidget().pos(5, 5)) |
351 | 356 | .child(new ProgressWidget() |
352 | 357 | .texture(getEmptyBarDrawable(), GTGuiTextures.PROGRESS_BAR_BOILER_HEAT, -1) |
353 | 358 | .direction(ProgressWidget.Direction.UP) |
354 | 359 | .debugName("temp") |
| 360 | + .tooltipBuilder( |
| 361 | + tooltip -> tooltip.addLine(IKey.lang("gregtech.machine.steam_boiler.heat_tooltip", |
| 362 | + temp.getIntValue(), getMaxTemperate()))) |
355 | 363 | .value(new DoubleSyncValue(this::getTemperaturePercent)) |
356 | 364 | .pos(96, 26) |
357 | 365 | .size(10, 54)) |
|
0 commit comments