File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
src/main/java/com/cleanroommc/modularui/widgets Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ public static ButtonWidget<?> panelCloseButton() {
2828 }
2929
3030 private boolean playClickSound = true ;
31+ private Runnable clickSound ;
3132 private IGuiAction .MousePressed mousePressed ;
3233 private IGuiAction .MouseReleased mouseReleased ;
3334 private IGuiAction .MousePressed mouseTapped ;
@@ -51,7 +52,11 @@ public WidgetTheme getWidgetThemeInternal(ITheme theme) {
5152
5253 public void playClickSound () {
5354 if (this .playClickSound ) {
54- Interactable .playButtonClickSound ();
55+ if (this .clickSound != null ) {
56+ this .clickSound .run ();
57+ } else {
58+ Interactable .playButtonClickSound ();
59+ }
5560 }
5661 }
5762
@@ -168,4 +173,9 @@ public W playClickSound(boolean play) {
168173 this .playClickSound = play ;
169174 return getThis ();
170175 }
176+
177+ public W clickSound (Runnable clickSound ) {
178+ this .clickSound = clickSound ;
179+ return getThis ();
180+ }
171181}
You can’t perform that action at this time.
0 commit comments