This commit is contained in:
@@ -26,14 +26,14 @@ public class PriorityPresetScreen extends Screen {
|
|||||||
@Override
|
@Override
|
||||||
protected void init() {
|
protected void init() {
|
||||||
super.init();
|
super.init();
|
||||||
this.clearChildren(); // ✅ Fix layout duplication after re-init
|
this.clearChildren();
|
||||||
PriorityConfig.load();
|
PriorityConfig.load();
|
||||||
int y = 30;
|
int y = 30;
|
||||||
|
|
||||||
for (String name : PriorityConfig.presets.keySet()) {
|
for (String name : PriorityConfig.presets.keySet()) {
|
||||||
boolean isActive = name.equals(PriorityConfig.activePreset);
|
boolean isActive = name.equals(PriorityConfig.activePreset);
|
||||||
this.addDrawableChild(ButtonWidget.builder(
|
this.addDrawableChild(ButtonWidget.builder(
|
||||||
Text.literal((isActive ? "§a✔ Selected Profile " : "") + name),
|
Text.literal((isActive ? "§a✔ Priority Profile: " : "") + name),
|
||||||
btn -> {
|
btn -> {
|
||||||
PriorityConfig.applyPreset(name);
|
PriorityConfig.applyPreset(name);
|
||||||
PriorityConfig.save();
|
PriorityConfig.save();
|
||||||
@@ -61,7 +61,7 @@ public class PriorityPresetScreen extends Screen {
|
|||||||
String name = inputName.getText().trim();
|
String name = inputName.getText().trim();
|
||||||
String layout = inputLayout.getText().trim();
|
String layout = inputLayout.getText().trim();
|
||||||
if (!isValidLayout(layout)) {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
List<Integer> slots = layout.chars().map(c -> c - '1').boxed().toList();
|
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",
|
"id": "prioritykeys",
|
||||||
"version": "${version}",
|
"version": "${version}",
|
||||||
"name": "PriorityKeys",
|
"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": [
|
"authors": [
|
||||||
"Advait"
|
"Advait"
|
||||||
],
|
],
|
||||||
"contact": {
|
"contact": {
|
||||||
"homepage": "https://fabricmc.net/",
|
"homepage": "https://www.youtube.com/@ignswight/",
|
||||||
"sources": "https://github.com/FabricMC/fabric-example-mod"
|
"sources": "https://git.advait.wtf/advait/PriorityKeys"
|
||||||
},
|
},
|
||||||
"license": "CC0-1.0",
|
"license": "CC0-1.0",
|
||||||
"icon": "assets/prioritykeys/icon.png",
|
"icon": "assets/prioritykeys/icon.png",
|
||||||
@@ -30,9 +30,9 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"depends": {
|
"depends": {
|
||||||
"fabricloader": ">=0.16.14",
|
"fabricloader": ">=0.15.0",
|
||||||
"minecraft": "~1.21.7",
|
"fabric": "*",
|
||||||
"java": ">=21",
|
"minecraft": ">=1.21 <1.22",
|
||||||
"fabric-api": "*"
|
"fabric-api": "*"
|
||||||
},
|
},
|
||||||
"suggests": {
|
"suggests": {
|
||||||
|
|||||||
Reference in New Issue
Block a user