Skip to content

Commit 7492373

Browse files
committed
some more fixes
1 parent 90896a4 commit 7492373

File tree

8 files changed

+40
-2
lines changed

8 files changed

+40
-2
lines changed

src/main/java/io/github/axolotlclient/config/AxolotlClientConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public class AxolotlClientConfig {
3232
public final BooleanOption showOptionTooltips = new BooleanOption("showOptionTooltips", true);
3333
public final BooleanOption showCategoryTooltips = new BooleanOption("showCategoryTooltips", false);
3434
public final BooleanOption quickToggles = new BooleanOption("quickToggles", false);
35-
public final ColorOption loadingScreenColor = new ColorOption("loadingBgColor", new Color(-1));
35+
public final ColorOption loadingScreenColor = new ColorOption("loadingBgColor", new Color(239, 50, 61, 255));
3636
public final BooleanOption nightMode = new BooleanOption("nightMode", false);
3737

3838
public final BooleanOption enableCustomOutlines = new BooleanOption("enabled", false);

src/main/java/io/github/axolotlclient/config/ConfigManager.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ private static void setOptions(JsonObject config, OptionCategory category){
8282
if (config.has(option.getName())) {
8383
JsonElement part = config.get(option.getName());
8484
option.setValueFromJsonElement(part);
85+
} else {
86+
option.setDefaults();
8587
}
8688
}
8789
if(!category.getSubCategories().isEmpty()){

src/main/java/io/github/axolotlclient/config/options/StringOption.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ public void setDefaults() {
4444

4545
@Override
4646
public JsonElement getJson() {
47+
if(value==null)setDefaults();
4748
return new JsonPrimitive(value);
4849
}
4950

src/main/java/io/github/axolotlclient/config/screen/CreditsScreen.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,11 @@ public boolean mouseDragged(double mouseX, double mouseY, int button, double del
159159
return super.mouseDragged(mouseX, mouseY, button, deltaX, deltaY)|| creditsList.mouseDragged(mouseX, mouseY, button, deltaX, deltaY);
160160
}
161161

162+
@Override
163+
public boolean mouseScrolled(double mouseX, double mouseY, double amount) {
164+
return super.mouseScrolled(mouseX, mouseY, amount) || creditsList.mouseScrolled(mouseX, mouseY, amount);
165+
}
166+
162167
private class CreditsList extends EntryListWidget<Credit> {
163168

164169
public CreditsList(MinecraftClient minecraftClient, int width, int height, int top, int bottom, int entryHeight) {

src/main/java/io/github/axolotlclient/mixin/MixinEntityRenderer.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,15 @@ public void addBadges(T entity, Text text, MatrixStack matrices, VertexConsumerP
2727
AxolotlClient.addBadge(entity, matrices);
2828
}
2929

30+
@ModifyArg(method = "renderLabelIfPresent", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/font/TextRenderer;draw(Lnet/minecraft/text/Text;FFIZLnet/minecraft/util/math/Matrix4f;Lnet/minecraft/client/render/VertexConsumerProvider;ZII)I"), index = 8)
31+
public int bgColor(int color){
32+
if(AxolotlClient.CONFIG.nametagBackground.get()){
33+
return color;
34+
} else {
35+
return 0;
36+
}
37+
}
38+
3039
@ModifyArg(method = "renderLabelIfPresent", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/font/TextRenderer;draw(Lnet/minecraft/text/Text;FFIZLnet/minecraft/util/math/Matrix4f;Lnet/minecraft/client/render/VertexConsumerProvider;ZII)I"), index = 4)
3140
public boolean enableShadows(boolean shadow){
3241
return AxolotlClient.CONFIG.useShadows.get();
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package io.github.axolotlclient.mixin;
2+
3+
import io.github.axolotlclient.AxolotlClient;
4+
import net.minecraft.client.gui.screen.SplashOverlay;
5+
import org.spongepowered.asm.mixin.Mixin;
6+
import org.spongepowered.asm.mixin.injection.At;
7+
import org.spongepowered.asm.mixin.injection.Redirect;
8+
9+
import java.util.function.IntSupplier;
10+
11+
@Mixin(SplashOverlay.class)
12+
public class MixinSplashOverlay {
13+
14+
@Redirect(method = "render", at = @At(value = "INVOKE", target = "Ljava/util/function/IntSupplier;getAsInt()I"))
15+
public int bgColor(IntSupplier instance){
16+
return AxolotlClient.CONFIG.loadingScreenColor.get().getAsInt();
17+
}
18+
}

src/main/java/io/github/axolotlclient/modules/hud/HudEditScreen.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,12 @@ public boolean mouseClicked(double mouseX, double mouseY, int button) {
8989

9090
@Override
9191
public boolean mouseReleased(double mouseX, double mouseY, int button) {
92+
if(current!=null){
93+
ConfigManager.save();
94+
}
9295
current = null;
9396
snap = null;
9497
mouseDown = false;
95-
ConfigManager.save();
9698
return super.mouseReleased(mouseX, mouseY, button);
9799
}
98100

src/main/resources/axolotlclient.mixins.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
"MixinReloadableResourceManager",
4545
"MixinRenderSystem",
4646
"MixinScreen",
47+
"MixinSplashOverlay",
4748
"MixinTitleScreen",
4849
"MixinWorldListWidgetEntry",
4950
"MixinWorldRenderer"

0 commit comments

Comments
 (0)