Added a realistic logo (optional)

This commit is contained in:
2025-04-06 13:42:36 +02:00
parent 74eb2088e3
commit b4dab6bf52
8 changed files with 30 additions and 5 deletions
@@ -4,9 +4,11 @@ import org.saturnclient.saturnclient.config.Property;
import org.saturnclient.saturnclient.config.ConfigManager;
import org.saturnclient.ui.SaturnAnimation;
import org.saturnclient.ui.SaturnUi;
import org.saturnclient.ui.Textures;
import org.saturnclient.ui.animations.FadeIn;
import net.minecraft.client.font.TextRenderer;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.ColorHelper;
public class SaturnClientConfig {
@@ -14,16 +16,20 @@ public class SaturnClientConfig {
public static Property<Integer> COLOR = config.property(
"Primary color",
new Property<Integer>(
new Property<>(
ColorHelper.getArgb(255, 251, 60, 79),
Property.PropertyType.HEX));
public static Property<Integer> NORMAL = config.property(
"Default color",
new Property<Integer>(
new Property<>(
ColorHelper.getArgb(255, 182, 182, 182),
Property.PropertyType.HEX));
public static Property<Boolean> REALISTIC_LOGO = config.property(
"Realistic logo",
new Property<>(false));
public static int WHITE = ColorHelper.getArgb(255, 255, 255, 255);
public static TextRenderer textRenderer = null;
@@ -38,4 +44,12 @@ public class SaturnClientConfig {
public static SaturnAnimation[] getAnimations() {
return new SaturnAnimation[] { new FadeIn(1) };
}
public static Identifier getLogo() {
return REALISTIC_LOGO.value ? Textures.REALISTIC_LOGO : Textures.LOGO;
}
public static String getSaturnIndicator() {
return REALISTIC_LOGO.value ? "" : "";
}
}
@@ -2,6 +2,7 @@ package org.saturnclient.saturnclient.menus;
import net.minecraft.client.MinecraftClient;
import net.minecraft.text.Text;
import org.saturnclient.saturnclient.SaturnClientConfig;
import org.saturnclient.ui.SaturnUi;
import org.saturnclient.ui.Textures;
@@ -65,7 +66,7 @@ public class MainMenu extends SaturnUi {
.setAnimations(new FadeIn(2)));
draw(
new SaturnImage(Textures.LOGO)
new SaturnImage(SaturnClientConfig.getLogo())
.setX((width - logoSize) / 2)
.setY(height / 2 - logoSize - 24)
.setWidth(logoSize)
@@ -13,6 +13,7 @@ import net.minecraft.text.Text;
import net.minecraft.util.math.Vec3d;
import net.minecraft.client.render.LightmapTextureManager;
import org.saturnclient.saturnclient.SaturnClientConfig;
import org.saturnclient.saturnclient.auth.SaturnSocket;
import org.joml.Matrix4f;
import org.spongepowered.asm.mixin.Mixin;
@@ -32,7 +33,7 @@ public abstract class NameTagMixin<S extends EntityRenderState> {
@Overwrite
public void renderLabelIfPresent(S state, Text text_o, MatrixStack matrices,
VertexConsumerProvider vertexConsumers, int light) {
Text text = isSaturn(state) ? Text.literal("" + text_o.getString()) : text_o;
Text text = isSaturn(state) ? Text.literal(SaturnClientConfig.getSaturnIndicator() + text_o.getString()) : text_o;
Vec3d vec3d = state.nameLabelPos;
if (vec3d != null) {
@@ -3,6 +3,7 @@ package org.saturnclient.saturnclient.mixin;
import net.minecraft.client.network.PlayerListEntry;
import net.minecraft.text.Text;
import org.jetbrains.annotations.Nullable;
import org.saturnclient.saturnclient.SaturnClientConfig;
import org.saturnclient.saturnclient.auth.SaturnSocket;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
@@ -29,6 +30,6 @@ public abstract class TabListMixin {
String uuid = profile.getId().toString().replaceAll("-", "");
return Text.literal(
SaturnSocket.players.containsKey(uuid) ? "" + name : name);
SaturnSocket.players.containsKey(uuid) ? SaturnClientConfig.getSaturnIndicator() + name : name);
}
}
@@ -17,6 +17,7 @@ public class Textures {
public static final Identifier TOGGLE_BG = Identifier.of("saturnclient", "textures/gui/components/toggle_bg.png");
public static final Identifier LOGO = Identifier.of("saturnclient", "textures/logo/logo.png");
public static final Identifier REALISTIC_LOGO = Identifier.of("saturnclient", "textures/logo/realistic.png");
public static final Identifier LOGO_TEXT = Identifier.of("saturnclient", "textures/logo/text.png");
// Widgets