Skip to content

Commit 3f47d8c

Browse files
committed
delete cached panel
1 parent f3a1f22 commit 3f47d8c

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/main/java/gregtech/api/mui/GTGuis.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package gregtech.api.mui;
22

3+
import com.cleanroommc.modularui.api.IPanelHandler;
4+
35
import gregtech.api.cover.Cover;
46
import gregtech.api.items.metaitem.MetaItem;
57
import gregtech.api.metatileentity.MetaTileEntity;
@@ -103,6 +105,9 @@ public PopupPanel(@NotNull String name, int width, int height, boolean disableBe
103105
.onMousePressed(mouseButton -> {
104106
if (mouseButton == 0 || mouseButton == 1) {
105107
this.closeIfOpen(true);
108+
if (isSynced() && getSyncHandler() instanceof IPanelHandler handler) {
109+
handler.deleteCachedPanel();
110+
}
106111
return true;
107112
}
108113
return false;

src/main/java/gregtech/common/covers/ender/CoverAbstractEnderLink.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,7 @@ public ModularPanel buildUI(SidedPosGuiData guiData, PanelSyncManager guiSyncMan
151151
protected Flow createWidgets(GuiData data, PanelSyncManager syncManager) {
152152
var name = new StringSyncValue(this::getColorStr, this::updateColor);
153153

154-
// todo unneeded cast in mui2 rc3
155-
var entrySelectorSH = (PanelSyncHandler) syncManager.panel("entry_selector", entrySelector(getType()), true);
154+
var entrySelectorSH = syncManager.panel("entry_selector", entrySelector(getType()), true);
156155

157156
return Flow.column().coverChildrenHeight().top(24)
158157
.margin(7, 0).widthRel(1f)
@@ -175,6 +174,7 @@ protected Flow createWidgets(GuiData data, PanelSyncManager syncManager) {
175174
.onMousePressed(i -> {
176175
if (entrySelectorSH.isPanelOpen()) {
177176
entrySelectorSH.closePanel();
177+
entrySelectorSH.deleteCachedPanel();
178178
} else {
179179
entrySelectorSH.openPanel();
180180
}

0 commit comments

Comments
 (0)