@@ -167,14 +167,28 @@ public static Screen genConfigScreen(Screen parent) {
167
167
battery .add (
168
168
entryBuilder .startBooleanToggle (
169
169
Components .translatable ("config" , "battery_tracker_notifications" ),
170
- batteryTracker .notifications ()
170
+ batteryTracker .notifications (). enabled ()
171
171
)
172
- .setDefaultValue (defaultConfig .batteryTracker ().notifications ())
173
- .setSaveConsumer (batteryTracker :: setNotifications )
172
+ .setDefaultValue (defaultConfig .batteryTracker ().notifications (). enabled () )
173
+ .setSaveConsumer (batteryTracker . notifications ():: setEnabled )
174
174
.setTooltip (Components .translatable ("config" , "battery_tracker_notifications_tooltip" ))
175
175
.build ()
176
176
);
177
177
178
+ battery .add (
179
+ entryBuilder .startIntSlider (
180
+ Components .translatable ("config" , "battery_notification_percentage" ),
181
+ batteryTracker .notifications ().percent (),
182
+ 1 ,
183
+ 50
184
+ )
185
+ .setDefaultValue (defaultConfig .batteryTracker ().notifications ().percent ())
186
+ .setSaveConsumer (batteryTracker .notifications ()::setPercent )
187
+ .setTextGetter (ClothConfig ::valueAsPercentMessage )
188
+ .setTooltip (Components .translatable ("config" , "battery_notification_percentage_tooltip" ))
189
+ .build ()
190
+ );
191
+
178
192
battery .add (
179
193
entryBuilder .startEnumSelector (
180
194
Components .translatable ("config" , "battery_indicator_condition" ),
@@ -259,7 +273,7 @@ public static Screen genConfigScreen(Screen parent) {
259
273
)
260
274
.setDefaultValue ((int ) (standard .rawVolumeMultiplier (source ) * 100 ))
261
275
.setSaveConsumer (value -> instance .setVolumeMultiplier (source , value / 100f ))
262
- .setTextGetter (ClothConfig ::volumeMultiplierMessage )
276
+ .setTextGetter (ClothConfig ::valueAsPercentMessage )
263
277
.build ()
264
278
);
265
279
}
@@ -387,7 +401,7 @@ private static Component fpsTargetMessage(int step) {
387
401
}
388
402
}
389
403
390
- private static Component volumeMultiplierMessage (int value ) {
404
+ private static Component valueAsPercentMessage (int value ) {
391
405
return Components .literal (Integer .toString (value ) + "%" );
392
406
}
393
407
0 commit comments