This commit is contained in:
@@ -26,14 +26,14 @@ public class PriorityPresetScreen extends Screen {
|
||||
@Override
|
||||
protected void init() {
|
||||
super.init();
|
||||
this.clearChildren(); // ✅ Fix layout duplication after re-init
|
||||
this.clearChildren();
|
||||
PriorityConfig.load();
|
||||
int y = 30;
|
||||
|
||||
for (String name : PriorityConfig.presets.keySet()) {
|
||||
boolean isActive = name.equals(PriorityConfig.activePreset);
|
||||
this.addDrawableChild(ButtonWidget.builder(
|
||||
Text.literal((isActive ? "§a✔ Selected Profile " : "") + name),
|
||||
Text.literal((isActive ? "§a✔ Priority Profile: " : "") + name),
|
||||
btn -> {
|
||||
PriorityConfig.applyPreset(name);
|
||||
PriorityConfig.save();
|
||||
@@ -61,7 +61,7 @@ public class PriorityPresetScreen extends Screen {
|
||||
String name = inputName.getText().trim();
|
||||
String layout = inputLayout.getText().trim();
|
||||
if (!isValidLayout(layout)) {
|
||||
sendToast(Text.of("§cInvalid layout. Must be 123456789 with no repeats."));
|
||||
sendToast(Text.of("§cInvalid layout. Must be in \"123456789\"-style formatting with no repeats."));
|
||||
return;
|
||||
}
|
||||
List<Integer> slots = layout.chars().map(c -> c - '1').boxed().toList();
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 9.9 KiB |
@@ -3,13 +3,13 @@
|
||||
"id": "prioritykeys",
|
||||
"version": "${version}",
|
||||
"name": "PriorityKeys",
|
||||
"description": "This is an example description! Tell everyone what your mod is about!",
|
||||
"description": "Overrides the vanilla \"priority keys\" (when two hotkeys are pressed at the same time).",
|
||||
"authors": [
|
||||
"Advait"
|
||||
],
|
||||
"contact": {
|
||||
"homepage": "https://fabricmc.net/",
|
||||
"sources": "https://github.com/FabricMC/fabric-example-mod"
|
||||
"homepage": "https://www.youtube.com/@ignswight/",
|
||||
"sources": "https://git.advait.wtf/advait/PriorityKeys"
|
||||
},
|
||||
"license": "CC0-1.0",
|
||||
"icon": "assets/prioritykeys/icon.png",
|
||||
@@ -30,9 +30,9 @@
|
||||
}
|
||||
],
|
||||
"depends": {
|
||||
"fabricloader": ">=0.16.14",
|
||||
"minecraft": "~1.21.7",
|
||||
"java": ">=21",
|
||||
"fabricloader": ">=0.15.0",
|
||||
"fabric": "*",
|
||||
"minecraft": ">=1.21 <1.22",
|
||||
"fabric-api": "*"
|
||||
},
|
||||
"suggests": {
|
||||
|
||||
Reference in New Issue
Block a user