Skip to content

Commit e21e8a9

Browse files
committed
Can YACL just work
1 parent 412f52e commit e21e8a9

File tree

3 files changed

+33
-3
lines changed

3 files changed

+33
-3
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ dependencies {
5353
exclude group: "net.fabricmc.fabric-api"
5454
}
5555

56-
modImplementation 'dev.isxander.yacl:yet-another-config-lib-fabric:3.1.0'
56+
modImplementation 'dev.isxander.yacl:yet-another-config-lib-fabric:3.1.0+1.20'
5757
}
5858

5959
processResources {
Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,37 @@
11
package com.carsoncoder.gpws;
22

3+
import dev.isxander.yacl.api.ConfigCategory;
4+
import dev.isxander.yacl.api.Option;
5+
import dev.isxander.yacl.api.OptionGroup;
6+
import dev.isxander.yacl.api.YetAnotherConfigLib;
7+
import dev.isxander.yacl.gui.controllers.TickBoxController;
8+
import net.minecraft.text.Text;
9+
310
public class gpwsConfig {
411
int PullUpRange = 50;
512
int BankAngleAngle = -50;
613
int Volume = 100;
714
int SoundDelay = 30;
8-
}
15+
16+
boolean test = false;
17+
18+
public gpwsConfig() {
19+
YetAnotherConfigLib thing = YetAnotherConfigLib.createBuilder()
20+
.title(Text.literal("Used for narration. Could be used to render a title in the future."))
21+
.category(ConfigCategory.createBuilder()
22+
.name(Text.literal("Name of the category"))
23+
.tooltip(Text.literal("This text will appear as a tooltip when you hover or focus the button with Tab. There is no need to add \n to wrap as YACL will do it for you."))
24+
.group(OptionGroup.createBuilder()
25+
.name(Text.literal("Name of the group"))
26+
.tooltip(Text.literal("This text will appear when you hover over the name or focus on the collapse button with Tab."))
27+
.option(Option.createBuilder(boolean.class)
28+
.name(Text.literal("Boolean Option"))
29+
.tooltip(Text.literal("This text will appear as a tooltip when you hover over the option."))
30+
.binding(true, () -> this.test, newVal -> this.test = newVal)
31+
.controller(TickBoxController::new)
32+
.build())
33+
.build())
34+
.build())
35+
.build();
36+
}
37+
}

src/main/resources/fabric.mod.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@
3333
"fabricloader": ">=0.14.22",
3434
"minecraft": "~1.20.1",
3535
"java": ">=17",
36-
"fabric-api": "*"
36+
"fabric-api": "*",
37+
"yet_another_config_lib_v3": "*"
3738
},
3839
"suggests": {
3940
"another-mod": "*"

0 commit comments

Comments
 (0)