Skip to content

Commit 924cb69

Browse files
committed
The list widget has been tamed
1 parent 44e9cb5 commit 924cb69

File tree

1 file changed

+10
-14
lines changed

1 file changed

+10
-14
lines changed

src/main/java/gregtech/common/metatileentities/electric/MetaTileEntityAlarm.java

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
import com.cleanroommc.modularui.value.sync.IntSyncValue;
3131
import com.cleanroommc.modularui.value.sync.PanelSyncHandler;
3232
import com.cleanroommc.modularui.value.sync.PanelSyncManager;
33-
import com.cleanroommc.modularui.widget.ParentWidget;
3433
import com.cleanroommc.modularui.widgets.ButtonWidget;
3534
import com.cleanroommc.modularui.widgets.ListWidget;
3635
import com.cleanroommc.modularui.widgets.layout.Flow;
@@ -88,7 +87,8 @@ public boolean usesMui2() {
8887
public ModularPanel buildUI(PosGuiData guiData, PanelSyncManager panelSyncManager) {
8988
IntSyncValue radiusSync = new IntSyncValue(() -> radius, newRadius -> {
9089
radius = newRadius;
91-
GregTechAPI.soundManager.stopTileSound(getPos());
90+
GregTechAPI.soundManager.stopTileSound(getPos()); // TODO: one of these is making the sound restart when you
91+
// open the gui
9292
});
9393
ResourceLocationSyncHandler soundSync = new ResourceLocationSyncHandler(
9494
() -> getSoundResourceLocation(selectedSound),
@@ -167,19 +167,15 @@ protected PanelSyncHandler.IPanelBuilder createSoundsPopup(@NotNull ResourceLoca
167167
.margin(5)
168168
.child(IKey.lang("gregtech.gui.alarm.sounds")
169169
.asWidget())
170-
.child(new ParentWidget<>()
171-
.widthRel(1.0f)
172-
.margin(2, 2, 6, 2)
170+
.child(new ListWidget<>()
171+
.left(2)
172+
.right(2)
173+
.marginTop(6)
174+
.marginBottom(4)
173175
.expanded()
174-
.child(GTGuiTextures.DISPLAY.asWidget()
175-
.widthRel(1.0f)
176-
.heightRel(1.0f))
177-
.child(new ListWidget<>()
178-
.widthRel(1.0f)
179-
.heightRel(1.0f)
180-
.margin(2)
181-
.expanded()
182-
.children(soundList))));
176+
.children(soundList)
177+
.background(GTGuiTextures.DISPLAY.asIcon()
178+
.margin(0, -2))));
183179
};
184180
}
185181

0 commit comments

Comments
 (0)