This repository was archived by the owner on Nov 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 10 files changed +72
-7
lines changed
1.16_combat-6/src/main/java/io/github/axolotlclient/modules/hud/gui/hud
1.20/src/main/java/io/github/axolotlclient/modules/hud/gui/hud
1.21.7/src/main/java/io/github/axolotlclient
1.21/src/main/java/io/github/axolotlclient/modules/hud/gui/hud
1.8.9/src/main/java/io/github/axolotlclient/modules/hud/gui/hud
common/src/main/java/io/github/axolotlclient Expand file tree Collapse file tree 10 files changed +72
-7
lines changed Original file line number Diff line number Diff line change @@ -231,6 +231,11 @@ public void reloadConfig() {
231231 keystrokes = null ;
232232 }
233233
234+ @ Override
235+ public void saveConfig () {
236+ saveKeystrokes ();
237+ }
238+
234239 public interface KeystrokeRenderer {
235240
236241 void render (Keystroke stroke , MatrixStack graphics );
Original file line number Diff line number Diff line change 3737import io .github .axolotlclient .AxolotlClientConfig .impl .options .ColorOption ;
3838import io .github .axolotlclient .AxolotlClientConfig .impl .options .IntegerOption ;
3939import io .github .axolotlclient .bridge .render .AxoRenderContext ;
40+ import io .github .axolotlclient .config .profiles .ProfileAware ;
4041import io .github .axolotlclient .mixin .KeyBindAccessor ;
4142import io .github .axolotlclient .modules .hud .ClickInputTracker ;
4243import io .github .axolotlclient .modules .hud .gui .keystrokes .KeystrokePositioningScreen ;
7374 * @license GPL-3.0
7475 */
7576
76- public class KeystrokeHud extends TextHudEntry {
77+ public class KeystrokeHud extends TextHudEntry implements ProfileAware {
7778
7879 private static final Path KEYSTROKE_SAVE_FILE = AxolotlClientCommon .resolveConfigFile ("keystrokes.json" );
7980 public static final Identifier ID = new Identifier ("kronhud" , "keystrokehud" );
@@ -231,6 +232,16 @@ public Identifier getId() {
231232 return ID ;
232233 }
233234
235+ @ Override
236+ public void reloadConfig () {
237+ keystrokes = null ;
238+ }
239+
240+ @ Override
241+ public void saveConfig () {
242+ saveKeystrokes ();
243+ }
244+
234245 public interface KeystrokeRenderer {
235246
236247 void render (Keystroke stroke , GuiGraphics graphics );
Original file line number Diff line number Diff line change 4444import net .minecraft .world .entity .Entity ;
4545import net .minecraft .world .entity .player .Player ;
4646import net .minecraft .world .scores .Objective ;
47- import org .spongepowered .asm .mixin .Debug ;
4847import org .spongepowered .asm .mixin .Final ;
4948import org .spongepowered .asm .mixin .Mixin ;
5049import org .spongepowered .asm .mixin .Shadow ;
5150import org .spongepowered .asm .mixin .injection .At ;
5251import org .spongepowered .asm .mixin .injection .Inject ;
5352import org .spongepowered .asm .mixin .injection .callback .CallbackInfo ;
5453
55- @ Debug (export = true )
5654@ Mixin (Gui .class )
5755public abstract class InGameHudMixin {
5856
Original file line number Diff line number Diff line change 3737import io .github .axolotlclient .AxolotlClientConfig .impl .options .ColorOption ;
3838import io .github .axolotlclient .AxolotlClientConfig .impl .options .IntegerOption ;
3939import io .github .axolotlclient .bridge .render .AxoRenderContext ;
40+ import io .github .axolotlclient .config .profiles .ProfileAware ;
4041import io .github .axolotlclient .modules .hud .ClickInputTracker ;
4142import io .github .axolotlclient .modules .hud .gui .keystrokes .KeystrokePositioningScreen ;
4243import io .github .axolotlclient .modules .hud .gui .keystrokes .KeystrokesScreen ;
7071 * @license GPL-3.0
7172 */
7273
73- public class KeystrokeHud extends TextHudEntry {
74+ public class KeystrokeHud extends TextHudEntry implements ProfileAware {
7475
7576 private static final Path KEYSTROKE_SAVE_FILE = AxolotlClientCommon .resolveConfigFile ("keystrokes.json" );
7677 public static final ResourceLocation ID = ResourceLocation .fromNamespaceAndPath ("kronhud" , "keystrokehud" );
@@ -226,6 +227,16 @@ public ResourceLocation getId() {
226227 return ID ;
227228 }
228229
230+ @ Override
231+ public void reloadConfig () {
232+ keystrokes = null ;
233+ }
234+
235+ @ Override
236+ public void saveConfig () {
237+ saveKeystrokes ();
238+ }
239+
229240 public interface KeystrokeRenderer {
230241
231242 void render (Keystroke stroke , GuiGraphics graphics );
Original file line number Diff line number Diff line change 3737import io .github .axolotlclient .AxolotlClientConfig .impl .options .ColorOption ;
3838import io .github .axolotlclient .AxolotlClientConfig .impl .options .IntegerOption ;
3939import io .github .axolotlclient .bridge .render .AxoRenderContext ;
40+ import io .github .axolotlclient .config .profiles .ProfileAware ;
4041import io .github .axolotlclient .mixin .KeyBindAccessor ;
4142import io .github .axolotlclient .modules .hud .ClickInputTracker ;
4243import io .github .axolotlclient .modules .hud .gui .keystrokes .KeystrokePositioningScreen ;
7172 * @license GPL-3.0
7273 */
7374
74- public class KeystrokeHud extends TextHudEntry {
75+ public class KeystrokeHud extends TextHudEntry implements ProfileAware {
7576
7677 private static final Path KEYSTROKE_SAVE_FILE = AxolotlClientCommon .resolveConfigFile ("keystrokes.json" );
7778 public static final Identifier ID = Identifier .of ("kronhud" , "keystrokehud" );
@@ -228,6 +229,16 @@ public Identifier getId() {
228229 return ID ;
229230 }
230231
232+ @ Override
233+ public void reloadConfig () {
234+ keystrokes = null ;
235+ }
236+
237+ @ Override
238+ public void saveConfig () {
239+ saveKeystrokes ();
240+ }
241+
231242 public interface KeystrokeRenderer {
232243
233244 void render (Keystroke stroke , GuiGraphics graphics );
Original file line number Diff line number Diff line change 3737import io .github .axolotlclient .AxolotlClientConfig .impl .options .ColorOption ;
3838import io .github .axolotlclient .AxolotlClientConfig .impl .options .IntegerOption ;
3939import io .github .axolotlclient .bridge .render .AxoRenderContext ;
40+ import io .github .axolotlclient .config .profiles .ProfileAware ;
4041import io .github .axolotlclient .mixin .KeyBindAccessor ;
4142import io .github .axolotlclient .modules .hud .ClickInputTracker ;
4243import io .github .axolotlclient .modules .hud .gui .keystrokes .KeystrokePositioningScreen ;
7273 * @license GPL-3.0
7374 */
7475
75- public class KeystrokeHud extends TextHudEntry {
76+ public class KeystrokeHud extends TextHudEntry implements ProfileAware {
7677
7778 private static final Path KEYSTROKE_SAVE_FILE = AxolotlClientCommon .resolveConfigFile ("keystrokes.json" );
7879 public static final Identifier ID = new Identifier ("kronhud" , "keystrokehud" );
@@ -225,6 +226,16 @@ public Identifier getId() {
225226 return ID ;
226227 }
227228
229+ @ Override
230+ public void reloadConfig () {
231+ keystrokes = null ;
232+ }
233+
234+ @ Override
235+ public void saveConfig () {
236+ saveKeystrokes ();
237+ }
238+
228239 public interface KeystrokeRenderer {
229240
230241 void render (Keystroke stroke );
Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ public static Path resolveProfileConfigFile(String file) {
6464 }
6565
6666 public static final boolean NVG_SUPPORTED = OSUtil .getOS () != OSUtil .OperatingSystem .OTHER &&
67- !Objects .requireNonNullElse (System .getenv ("TMPDIR" ), "" ).contains ("Android" );
67+ !Objects .requireNonNullElse (System .getenv ("TMPDIR" ), "" ).contains ("Android" ) && ! FabricLoader . getInstance (). isModLoaded ( "vulkanmod" ) ;
6868
6969 public static final String VERSION = FabricLoader .getInstance ()
7070 .getModContainer ("axolotlclient-common" )
@@ -266,6 +266,11 @@ protected final void registerModule(Module module) {
266266
267267 public void saveConfig () {
268268 getConfigManager ().save ();
269+ for (Module m : modules ) {
270+ if (m instanceof ProfileAware p ) {
271+ p .saveConfig ();
272+ }
273+ }
269274 }
270275
271276 public Path getMainConfigFile () {
Original file line number Diff line number Diff line change 2424
2525public interface ProfileAware {
2626
27+ void saveConfig ();
28+
2729 void reloadConfig ();
2830}
Original file line number Diff line number Diff line change @@ -118,6 +118,7 @@ public Profile newProfile(String name) {
118118 }
119119
120120 public Profile duplicate (Profile profile ) {
121+ AxolotlClientCommon .getInstance ().saveConfig ();
121122 var duplicate = newProfile (AxoI18n .translate ("profiles.duplicated" , profile .name ()));
122123 try {
123124 Files .copy (profile .getPath (), duplicate .getPath ());
Original file line number Diff line number Diff line change @@ -299,6 +299,16 @@ public void reloadConfig() {
299299 }
300300 }
301301
302+ @ Override
303+ public void saveConfig () {
304+ saveCustomEntries ();
305+ for (var hud : getEntries ()) {
306+ if (hud instanceof ProfileAware p ) {
307+ p .saveConfig ();
308+ }
309+ }
310+ }
311+
302312 protected abstract void openScreen ();
303313
304314 protected abstract void addExtraHud ();
You can’t perform that action at this time.
0 commit comments