Skip to content

Commit 8f845f9

Browse files
committed
Collapse options into groups on general options screen
Signed-off-by: Lilly Rose Berner <lilly@lostluma.net>
1 parent c1a1756 commit 8f845f9

File tree

2 files changed

+26
-20
lines changed

2 files changed

+26
-20
lines changed

platforms/common/src/main/java/dynamic_fps/impl/compat/ClothConfig.java

+21-20
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ public static Screen genConfigScreen(Screen parent) {
4242
DynamicFPSConfig config = DynamicFPSConfig.INSTANCE;
4343
DynamicFPSConfig defaultConfig = DynamicFPSConfig.DEFAULTS;
4444

45-
general.addEntry(
45+
SubCategoryBuilder misc = entryBuilder.startSubCategory(localized("config", "feature.misc"));
46+
47+
misc.add(
4648
entryBuilder.startBooleanToggle(
4749
localized("config", "enabled"),
4850
config.enabled()
@@ -52,7 +54,7 @@ public static Screen genConfigScreen(Screen parent) {
5254
.build()
5355
);
5456

55-
general.addEntry(
57+
misc.add(
5658
entryBuilder.startBooleanToggle(
5759
localized("config", "uncap_menu_frame_rate"),
5860
config.uncapMenuFrameRate()
@@ -63,11 +65,10 @@ public static Screen genConfigScreen(Screen parent) {
6365
.build()
6466
);
6567

66-
general.addEntry(
67-
entryBuilder.startTextDescription(CommonComponents.SPACE).build()
68-
);
68+
general.addEntry(misc.build());
69+
SubCategoryBuilder idle = entryBuilder.startSubCategory(localized("config", "feature.idle"));
6970

70-
general.addEntry(
71+
idle.add(
7172
entryBuilder.startIntSlider(
7273
localized("config", "idle_time"),
7374
config.idle().timeout() / 60,
@@ -80,7 +81,7 @@ public static Screen genConfigScreen(Screen parent) {
8081
.build()
8182
);
8283

83-
general.addEntry(
84+
idle.add(
8485
entryBuilder.startEnumSelector(
8586
localized("config", "idle_condition"),
8687
IdleCondition.class,
@@ -93,13 +94,12 @@ public static Screen genConfigScreen(Screen parent) {
9394
.build()
9495
);
9596

96-
general.addEntry(
97-
entryBuilder.startTextDescription(CommonComponents.SPACE).build()
98-
);
97+
general.addEntry(idle.build());
98+
SubCategoryBuilder volumeTransition = entryBuilder.startSubCategory(localized("config", "feature.volume_transition"));
9999

100100
VariableStepTransformer volumeTransformer = getVolumeStepTransformer();
101101

102-
general.addEntry(
102+
volumeTransition.add(
103103
entryBuilder.startIntSlider(
104104
localized("config", "volume_transition_speed_up"),
105105
volumeTransformer.toStep((int) (config.volumeTransitionSpeed().getUp() * 100)),
@@ -112,7 +112,7 @@ public static Screen genConfigScreen(Screen parent) {
112112
.build()
113113
);
114114

115-
general.addEntry(
115+
volumeTransition.add(
116116
entryBuilder.startIntSlider(
117117
localized("config", "volume_transition_speed_down"),
118118
volumeTransformer.toStep((int) (config.volumeTransitionSpeed().getDown() * 100)),
@@ -125,13 +125,12 @@ public static Screen genConfigScreen(Screen parent) {
125125
.build()
126126
);
127127

128-
general.addEntry(
129-
entryBuilder.startTextDescription(CommonComponents.SPACE).build()
130-
);
128+
general.addEntry(volumeTransition.build());
129+
SubCategoryBuilder battery = entryBuilder.startSubCategory(localized("config", "feature.battery"));
131130

132131
BatteryTrackerConfig batteryTracker = config.batteryTracker();
133132

134-
general.addEntry(
133+
battery.add(
135134
entryBuilder.startBooleanToggle(
136135
localized("config", "battery_tracker"),
137136
batteryTracker.enabled()
@@ -142,7 +141,7 @@ public static Screen genConfigScreen(Screen parent) {
142141
.build()
143142
);
144143

145-
general.addEntry(
144+
battery.add(
146145
entryBuilder.startBooleanToggle(
147146
localized("config", "battery_tracker_switch_states"),
148147
batteryTracker.switchStates()
@@ -153,7 +152,7 @@ public static Screen genConfigScreen(Screen parent) {
153152
.build()
154153
);
155154

156-
general.addEntry(
155+
battery.add(
157156
entryBuilder.startBooleanToggle(
158157
localized("config", "battery_tracker_notifications"),
159158
batteryTracker.notifications()
@@ -164,7 +163,7 @@ public static Screen genConfigScreen(Screen parent) {
164163
.build()
165164
);
166165

167-
general.addEntry(
166+
battery.add(
168167
entryBuilder.startEnumSelector(
169168
localized("config", "battery_indicator_condition"),
170169
BatteryIndicatorCondition.class,
@@ -176,7 +175,7 @@ public static Screen genConfigScreen(Screen parent) {
176175
.build()
177176
);
178177

179-
general.addEntry(
178+
battery.add(
180179
entryBuilder.startEnumSelector(
181180
localized("config", "battery_indicator_placement"),
182181
BatteryIndicatorPlacement.class,
@@ -188,6 +187,8 @@ public static Screen genConfigScreen(Screen parent) {
188187
.build()
189188
);
190189

190+
general.addEntry(battery.build());
191+
191192
// Used for each state's frame rate target slider below
192193
VariableStepTransformer fpsTransformer = getFpsTransformer();
193194

platforms/common/src/main/resources/assets/dynamic_fps/lang/en_us.json

+5
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@
1313
"config.dynamic_fps.category.unplugged": "On Battery",
1414
"config.dynamic_fps.category.abandoned": "Idle",
1515

16+
"config.dynamic_fps.feature.misc": "Misc",
17+
"config.dynamic_fps.feature.volume_transition": "Volume Transition",
18+
"config.dynamic_fps.feature.idle": "Idling",
19+
"config.dynamic_fps.feature.battery": "Battery Integration",
20+
1621
"config.dynamic_fps.enabled": "Enabled",
1722

1823
"config.dynamic_fps.disabled": "Disabled",

0 commit comments

Comments
 (0)