3030import com .cleanroommc .modularui .api .widget .IWidget ;
3131import com .cleanroommc .modularui .screen .ModularPanel ;
3232import com .cleanroommc .modularui .screen .UISettings ;
33+ import com .cleanroommc .modularui .utils .Alignment ;
3334import com .cleanroommc .modularui .value .sync .IntSyncValue ;
3435import com .cleanroommc .modularui .value .sync .PanelSyncHandler ;
3536import com .cleanroommc .modularui .value .sync .PanelSyncManager ;
@@ -92,30 +93,38 @@ public void renderMetaTileEntity(CCRenderState renderState, Matrix4 translation,
9293 createSoundsPopup (soundEventSyncHandler ));
9394
9495 // TODO: Change the position of the name when it's standardized.
95- return GTGuis .createPanel (this , 200 , 56 )
96+ return GTGuis .createPanel (this , 200 , 58 )
9697 .child (Flow .column ()
97- .marginLeft (5 )
98- .marginRight (5 )
99- .top (5 )
98+ .margin (5 )
10099 .coverChildrenHeight ()
100+ .crossAxisAlignment (Alignment .CrossAxis .START )
101101 .child (IKey .lang ("gregtech.gui.alarm.radius" )
102- .asWidget ()
103- .alignX (0.0f ))
102+ .asWidget ())
104103 .child (new TextFieldWidget ()
105104 .widthRel (1.0f )
106- .marginTop ( 1 )
105+ .margin ( 0 , 2 )
107106 .height (16 )
108107 .setMaxLength (10 )
109108 .setNumbers (0 , 128 )
110109 .value (radiusSync )
111110 .background (GTGuiTextures .DISPLAY ))
112111 .child (Flow .row ()
113112 .widthRel (1.0f )
114- .marginTop (1 )
115113 .coverChildrenHeight ()
114+ .mainAxisAlignment (Alignment .MainAxis .START )
115+ .childPadding (2 )
116116 .child (new ButtonWidget <>()
117- .marginRight (4 )
118- .size (16 )
117+ .size (18 )
118+ .onMousePressed (mouse -> {
119+ guiData .getPlayer ().playSound (selectedSound , 1.0f , 1.0f );
120+ // returns false so the default click sound isn't played
121+ return false ;
122+ })
123+ .overlay (GTGuiTextures .SPEAKER_ICON .asIcon ()
124+ .size (18 ))
125+ .addTooltipLine (IKey .lang ("gregtech.gui.alarm.sounds_preview_button" )))
126+ .child (new ButtonWidget <>()
127+ .size (18 )
119128 .onMousePressed (mouse -> {
120129 if (soundSelector .isPanelOpen ()) {
121130 soundSelector .closePanel ();
@@ -125,8 +134,8 @@ public void renderMetaTileEntity(CCRenderState renderState, Matrix4 translation,
125134
126135 return true ;
127136 })
128- .overlay (GTGuiTextures .SPEAKER_ICON .asIcon ()
129- .size (18 ))
137+ .overlay (GTGuiTextures .FILTER_SETTINGS_OVERLAY .asIcon ()
138+ .size (16 ))
130139 .addTooltipLine (IKey .lang ("gregtech.gui.alarm.sounds_popup_button" )))
131140 .child (IKey .dynamic (() -> getSoundName (selectedSound ))
132141 .asWidget ()
@@ -152,7 +161,6 @@ protected PanelSyncHandler.IPanelBuilder createSoundsPopup(@NotNull MetaTileEnti
152161 syncHandler .closePanel ();
153162 return true ;
154163 })
155- .addTooltipLine (IKey .lang ("gregtech.gui.alarm.set_sound" ))
156164 .overlay (IKey .str (name .toString ()))));
157165 }
158166
0 commit comments