@@ -24,22 +24,15 @@ public ModMenuScreen() {
24
24
}
25
25
26
26
@ Override
27
- protected void init () {
27
+ protected void init () {
28
28
super .init ();
29
29
30
30
container = new SpruceContainerWidget (Position .of (0 , 0 ), this .width , this .height );
31
31
container .setBackground ((graphics , widget , vOffset , mouseX , mouseY , delta ) -> {
32
32
int x = widget .getX ();
33
33
int y = widget .getY ();
34
34
int width = widget .getWidth ();
35
-
36
35
graphics .fill (x , y , x + width , y + widget .getHeight (), 0x88000000 );
37
-
38
- int lineColor = 0xFF444444 ;
39
- int horizontalInset = 20 ;
40
-
41
- int bottomLineY = y + 140 + 16 + 14 * 4 + 25 ;
42
- graphics .fill (x + horizontalInset , bottomLineY , x + width - horizontalInset , bottomLineY + 1 , lineColor );
43
36
});
44
37
45
38
SpruceLabelWidget label = new SpruceLabelWidget (
@@ -86,29 +79,29 @@ protected void init() {
86
79
TooltipData .builder ().text ("Toggle hiding F3 face info" ).build ()
87
80
)
88
81
);
89
-
82
+
90
83
optionList .addOptionEntry (
91
- new SpruceCheckboxBooleanOption (
92
- "key.streamermodeplusplus.toggle_hide_F3_targeted_block_info_option" ,
93
- () -> StreamerModePlusPlusClient .mixinHideTargetedBlockDebugHudEnabled ,
94
- newValue -> StreamerModePlusPlusClient .mixinHideTargetedBlockDebugHudEnabled = newValue ,
95
- TooltipData .builder ().text ("Toggle hiding F3 Targeted Block info" ).build ()
96
- ),
97
- new SpruceCheckboxBooleanOption (
98
- "key.streamermodeplusplus.toggle_hide_F3_targeted_fluid_info_option" ,
99
- () -> StreamerModePlusPlusClient .mixinHideTargetedFluidDebugHudEnabled ,
100
- newValue -> StreamerModePlusPlusClient .mixinHideTargetedFluidDebugHudEnabled = newValue ,
101
- TooltipData .builder ().text ("Toggle hiding F3 Targeted Fluid info" ).build ()
102
- )
103
- );
84
+ new SpruceCheckboxBooleanOption (
85
+ "key.streamermodeplusplus.toggle_hide_F3_targeted_block_info_option" ,
86
+ () -> StreamerModePlusPlusClient .mixinHideTargetedBlockDebugHudEnabled ,
87
+ newValue -> StreamerModePlusPlusClient .mixinHideTargetedBlockDebugHudEnabled = newValue ,
88
+ TooltipData .builder ().text ("Toggle hiding F3 Targeted Block info" ).build ()
89
+ ),
90
+ new SpruceCheckboxBooleanOption (
91
+ "key.streamermodeplusplus.toggle_hide_F3_targeted_fluid_info_option" ,
92
+ () -> StreamerModePlusPlusClient .mixinHideTargetedFluidDebugHudEnabled ,
93
+ newValue -> StreamerModePlusPlusClient .mixinHideTargetedFluidDebugHudEnabled = newValue ,
94
+ TooltipData .builder ().text ("Toggle hiding F3 Targeted Fluid info" ).build ()
95
+ )
96
+ );
104
97
105
98
container .addChild (optionList );
106
99
107
100
int groupStartX = this .width / 2 - 90 ;
108
- int groupStartY = 140 ;
101
+ int groupStartY = 130 ;
109
102
int fieldWidth = 180 ;
110
- int fieldHeight = 12 ;
111
- int fieldSpacing = 14 ;
103
+ int fieldHeight = 12 ;
104
+ int fieldSpacing = 13 ;
112
105
113
106
SpruceLabelWidget hiddenFieldsLabel = new SpruceLabelWidget (
114
107
Position .of (groupStartX , groupStartY ),
@@ -120,53 +113,63 @@ protected void init() {
120
113
container .addChild (hiddenFieldsLabel );
121
114
122
115
var client = StreamerModePlusPlusClient .getInstance ();
116
+ int fieldX = groupStartX + 10 ;
117
+ int baseY = groupStartY + 15 ;
123
118
124
119
SpruceTextFieldWidget coordField = SpruceTextFieldWidget .builder (
125
- Position .of (groupStartX + 10 , groupStartY + 16 ),
120
+ Position .of (fieldX , baseY ),
126
121
fieldWidth - 20 , fieldHeight
127
- ).title (Text .of ("Coord Text" ))
128
- .placeholder (Text .of ("Coord Text" ))
129
- .build ();
122
+ ).title (Text .of ("Coord Text" )).placeholder (Text .of ("Coord Text" )).build ();
130
123
coordField .setText (client .getHiddenCoordsMessage ());
131
124
addDrawableChild (coordField );
132
125
133
126
SpruceTextFieldWidget blockField = SpruceTextFieldWidget .builder (
134
- Position .of (groupStartX + 10 , groupStartY + 16 + fieldSpacing ),
127
+ Position .of (fieldX , baseY + fieldSpacing * 1 ),
135
128
fieldWidth - 20 , fieldHeight
136
- ).title (Text .of ("Block Info Text" ))
137
- .placeholder (Text .of ("Block Info Text" ))
138
- .build ();
129
+ ).title (Text .of ("Block Info Text" )).placeholder (Text .of ("Block Info Text" )).build ();
139
130
blockField .setText (client .getHiddenBlockMessage ());
140
131
addDrawableChild (blockField );
141
132
142
133
SpruceTextFieldWidget chunkField = SpruceTextFieldWidget .builder (
143
- Position .of (groupStartX + 10 , groupStartY + 16 + fieldSpacing * 2 ),
134
+ Position .of (fieldX , baseY + fieldSpacing * 2 ),
144
135
fieldWidth - 20 , fieldHeight
145
- ).title (Text .of ("Chunk Info Text" ))
146
- .placeholder (Text .of ("Chunk Info Text" ))
147
- .build ();
136
+ ).title (Text .of ("Chunk Info Text" )).placeholder (Text .of ("Chunk Info Text" )).build ();
148
137
chunkField .setText (client .getHiddenChunkMessage ());
149
138
addDrawableChild (chunkField );
150
139
151
140
SpruceTextFieldWidget faceField = SpruceTextFieldWidget .builder (
152
- Position .of (groupStartX + 10 , groupStartY + 16 + fieldSpacing * 3 ),
141
+ Position .of (fieldX , baseY + fieldSpacing * 3 ),
153
142
fieldWidth - 20 , fieldHeight
154
- ).title (Text .of ("Facing Info Text" ))
155
- .placeholder (Text .of ("Facing Info Text" ))
156
- .build ();
143
+ ).title (Text .of ("Facing Info Text" )).placeholder (Text .of ("Facing Info Text" )).build ();
157
144
faceField .setText (client .getHiddenFaceMessage ());
158
145
addDrawableChild (faceField );
159
146
147
+ SpruceTextFieldWidget targetedBlockField = SpruceTextFieldWidget .builder (
148
+ Position .of (fieldX , baseY + fieldSpacing * 4 ),
149
+ fieldWidth - 20 , fieldHeight
150
+ ).title (Text .of ("Targeted Block Info Text" )).placeholder (Text .of ("Targeted Block Info Text" )).build ();
151
+ targetedBlockField .setText (client .getHiddenTargetedBlockMessage ());
152
+ addDrawableChild (targetedBlockField );
153
+
154
+ SpruceTextFieldWidget targetedFluidField = SpruceTextFieldWidget .builder (
155
+ Position .of (fieldX , baseY + fieldSpacing * 5 ),
156
+ fieldWidth - 20 , fieldHeight
157
+ ).title (Text .of ("Targeted Fluid Info Text" )).placeholder (Text .of ("Targeted Fluid Info Text" )).build ();
158
+ targetedFluidField .setText (client .getHiddenTargetedFluidMessage ());
159
+ addDrawableChild (targetedFluidField );
160
+
160
161
this .addDrawableChild (new SpruceButtonWidget (
161
- Position .of (groupStartX , groupStartY + 16 + fieldSpacing * 4 + 5 ),
162
+ Position .of (groupStartX , baseY + fieldSpacing * 6 + 3 ),
162
163
fieldWidth ,
163
- 16 ,
164
+ 16 ,
164
165
Text .of ("Submit" ),
165
166
btn -> {
166
167
client .setHiddenCoordsMessage (coordField .getText ());
167
168
client .setHiddenBlockMessage (blockField .getText ());
168
169
client .setHiddenChunkMessage (chunkField .getText ());
169
170
client .setHiddenFaceMessage (faceField .getText ());
171
+ client .setHiddenTargetedBlockMessage (targetedBlockField .getText ());
172
+ client .setHiddenTargetedFluidMessage (targetedFluidField .getText ());
170
173
}
171
174
));
172
175
0 commit comments