File tree Expand file tree Collapse file tree 3 files changed +9
-5
lines changed
src/main/java/meteordevelopment/meteorclient/utils/render/prompts Expand file tree Collapse file tree 3 files changed +9
-5
lines changed Original file line number Diff line number Diff line change 8
8
import meteordevelopment .meteorclient .gui .GuiTheme ;
9
9
import meteordevelopment .meteorclient .gui .GuiThemes ;
10
10
import meteordevelopment .meteorclient .gui .widgets .pressable .WButton ;
11
- import meteordevelopment .meteorclient .systems .config .Config ;
12
11
import net .minecraft .client .gui .screen .Screen ;
13
12
14
13
import static meteordevelopment .meteorclient .MeteorClient .mc ;
@@ -37,7 +36,7 @@ public OkPrompt onOk(Runnable action) {
37
36
protected void initialiseWidgets (PromptScreen screen ) {
38
37
WButton okButton = screen .list .add (theme .button ("Ok" )).expandX ().widget ();
39
38
okButton .action = () -> {
40
- if (screen . dontShowAgainCheckbox != null && screen . dontShowAgainCheckbox . checked ) Config . get (). dontShowAgainPrompts . add ( id );
39
+ dontShowAgain (screen );
41
40
onOk .run ();
42
41
screen .close ();
43
42
};
Original file line number Diff line number Diff line change @@ -66,6 +66,12 @@ public boolean show() {
66
66
return true ;
67
67
}
68
68
69
+ protected void dontShowAgain (PromptScreen screen ) {
70
+ if (screen .dontShowAgainCheckbox != null && screen .dontShowAgainCheckbox .checked && id != null ) {
71
+ Config .get ().dontShowAgainPrompts .add (id );
72
+ }
73
+ }
74
+
69
75
protected abstract void initialiseWidgets (PromptScreen screen );
70
76
71
77
protected class PromptScreen extends WindowScreen {
Original file line number Diff line number Diff line change 8
8
import meteordevelopment .meteorclient .gui .GuiTheme ;
9
9
import meteordevelopment .meteorclient .gui .GuiThemes ;
10
10
import meteordevelopment .meteorclient .gui .widgets .pressable .WButton ;
11
- import meteordevelopment .meteorclient .systems .config .Config ;
12
11
import net .minecraft .client .gui .screen .Screen ;
13
12
14
13
import static meteordevelopment .meteorclient .MeteorClient .mc ;
@@ -43,14 +42,14 @@ public YesNoPrompt onNo(Runnable action) {
43
42
protected void initialiseWidgets (PromptScreen screen ) {
44
43
WButton yesButton = screen .list .add (theme .button ("Yes" )).expandX ().widget ();
45
44
yesButton .action = () -> {
46
- if (screen . dontShowAgainCheckbox != null && screen . dontShowAgainCheckbox . checked ) Config . get (). dontShowAgainPrompts . add ( id );
45
+ dontShowAgain (screen );
47
46
onYes .run ();
48
47
screen .close ();
49
48
};
50
49
51
50
WButton noButton = screen .list .add (theme .button ("No" )).expandX ().widget ();
52
51
noButton .action = () -> {
53
- if (screen . dontShowAgainCheckbox != null && screen . dontShowAgainCheckbox . checked ) Config . get (). dontShowAgainPrompts . add ( id );
52
+ dontShowAgain (screen );
54
53
onNo .run ();
55
54
screen .close ();
56
55
};
You can’t perform that action at this time.
0 commit comments