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.saturnclient.config.ConfigManager;
import org.saturnclient.ui.SaturnAnimation; import org.saturnclient.ui.SaturnAnimation;
import org.saturnclient.ui.SaturnUi; import org.saturnclient.ui.SaturnUi;
import org.saturnclient.ui.Textures;
import org.saturnclient.ui.animations.FadeIn; import org.saturnclient.ui.animations.FadeIn;
import net.minecraft.client.font.TextRenderer; import net.minecraft.client.font.TextRenderer;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.ColorHelper; import net.minecraft.util.math.ColorHelper;
public class SaturnClientConfig { public class SaturnClientConfig {
@@ -14,16 +16,20 @@ public class SaturnClientConfig {
public static Property<Integer> COLOR = config.property( public static Property<Integer> COLOR = config.property(
"Primary color", "Primary color",
new Property<Integer>( new Property<>(
ColorHelper.getArgb(255, 251, 60, 79), ColorHelper.getArgb(255, 251, 60, 79),
Property.PropertyType.HEX)); Property.PropertyType.HEX));
public static Property<Integer> NORMAL = config.property( public static Property<Integer> NORMAL = config.property(
"Default color", "Default color",
new Property<Integer>( new Property<>(
ColorHelper.getArgb(255, 182, 182, 182), ColorHelper.getArgb(255, 182, 182, 182),
Property.PropertyType.HEX)); 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 int WHITE = ColorHelper.getArgb(255, 255, 255, 255);
public static TextRenderer textRenderer = null; public static TextRenderer textRenderer = null;
@@ -38,4 +44,12 @@ public class SaturnClientConfig {
public static SaturnAnimation[] getAnimations() { public static SaturnAnimation[] getAnimations() {
return new SaturnAnimation[] { new FadeIn(1) }; 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.client.MinecraftClient;
import net.minecraft.text.Text; import net.minecraft.text.Text;
import org.saturnclient.saturnclient.SaturnClientConfig; import org.saturnclient.saturnclient.SaturnClientConfig;
import org.saturnclient.ui.SaturnUi; import org.saturnclient.ui.SaturnUi;
import org.saturnclient.ui.Textures; import org.saturnclient.ui.Textures;
@@ -65,7 +66,7 @@ public class MainMenu extends SaturnUi {
.setAnimations(new FadeIn(2))); .setAnimations(new FadeIn(2)));
draw( draw(
new SaturnImage(Textures.LOGO) new SaturnImage(SaturnClientConfig.getLogo())
.setX((width - logoSize) / 2) .setX((width - logoSize) / 2)
.setY(height / 2 - logoSize - 24) .setY(height / 2 - logoSize - 24)
.setWidth(logoSize) .setWidth(logoSize)
@@ -13,6 +13,7 @@ import net.minecraft.text.Text;
import net.minecraft.util.math.Vec3d; import net.minecraft.util.math.Vec3d;
import net.minecraft.client.render.LightmapTextureManager; import net.minecraft.client.render.LightmapTextureManager;
import org.saturnclient.saturnclient.SaturnClientConfig;
import org.saturnclient.saturnclient.auth.SaturnSocket; import org.saturnclient.saturnclient.auth.SaturnSocket;
import org.joml.Matrix4f; import org.joml.Matrix4f;
import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Mixin;
@@ -32,7 +33,7 @@ public abstract class NameTagMixin<S extends EntityRenderState> {
@Overwrite @Overwrite
public void renderLabelIfPresent(S state, Text text_o, MatrixStack matrices, public void renderLabelIfPresent(S state, Text text_o, MatrixStack matrices,
VertexConsumerProvider vertexConsumers, int light) { 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; Vec3d vec3d = state.nameLabelPos;
if (vec3d != null) { if (vec3d != null) {
@@ -3,6 +3,7 @@ package org.saturnclient.saturnclient.mixin;
import net.minecraft.client.network.PlayerListEntry; import net.minecraft.client.network.PlayerListEntry;
import net.minecraft.text.Text; import net.minecraft.text.Text;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
import org.saturnclient.saturnclient.SaturnClientConfig;
import org.saturnclient.saturnclient.auth.SaturnSocket; import org.saturnclient.saturnclient.auth.SaturnSocket;
import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite; import org.spongepowered.asm.mixin.Overwrite;
@@ -29,6 +30,6 @@ public abstract class TabListMixin {
String uuid = profile.getId().toString().replaceAll("-", ""); String uuid = profile.getId().toString().replaceAll("-", "");
return Text.literal( 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 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 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"); public static final Identifier LOGO_TEXT = Identifier.of("saturnclient", "textures/logo/text.png");
// Widgets // Widgets
@@ -6,6 +6,13 @@
"ascent": 7, "ascent": 7,
"height": 8, "height": 8,
"chars": ["\uE002"] "chars": ["\uE002"]
},
{
"type": "bitmap",
"file": "minecraft:font/custom/saturn_realistic.png",
"ascent": 7,
"height": 8,
"chars": ["\uE003"]
} }
] ]
} }
Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 705 KiB