Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 17 additions & 6 deletions src/main/java/com/lambda/mixin/render/SplashOverlayMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

package com.lambda.mixin.render;

import com.lambda.module.modules.client.Client;
import com.lambda.util.LambdaResourceKt;
import net.minecraft.client.gui.screen.SplashOverlay;
import net.minecraft.client.texture.ReloadableTexture;
Expand All @@ -25,10 +26,7 @@
import net.minecraft.util.math.ColorHelper;
import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Mutable;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.*;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
Expand All @@ -43,13 +41,21 @@ public class SplashOverlayMixin {
@Final
public static Identifier LOGO;

@Unique
private static Identifier VANILLA_LOGO;

@Inject(method = "<init>", at = @At("RETURN"))
private void onInit(CallbackInfo ci) {
LOGO = Identifier.of("lambda", "textures/lambda_banner.png");
if (VANILLA_LOGO == null) VANILLA_LOGO = LOGO;

LOGO = (Client.INSTANCE.getLoadScreen())
? Identifier.of("lambda", "textures/lambda_banner.png")
: VANILLA_LOGO;
}

@WrapOperation(method = "render", at = @At(value = "INVOKE", target = "Ljava/util/function/IntSupplier;getAsInt()I"))
private int wrapBrandArgb(IntSupplier originalSupplier, Operation<Integer> original) {
if (!Client.INSTANCE.getLoadScreen()) return original.call(originalSupplier);
return ColorHelper.getArgb(255, 35, 35, 35);
}

Expand All @@ -61,7 +67,12 @@ public LogoTextureMixin(Identifier location) {

@WrapOperation(method = "loadContents", at = @At(value = "INVOKE", target = "Lnet/minecraft/resource/ResourceFactory;open(Lnet/minecraft/util/Identifier;)Ljava/io/InputStream;"))
InputStream wrapLoadTextureData(ResourceFactory instance, Identifier id, Operation<InputStream> original) {
return LambdaResourceKt.getStream("textures/lambda_banner.png");
if ("lambda".equals(id.getNamespace())
&& "textures/lambda_banner.png".equals(id.getPath())) {
Comment on lines +70 to +71
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure to understand this condition here. Could you explain it ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

During my testing, resource reload would replace the Lambda banner with a blue box rather than the vanilla banner, which was persistent across resource reloads. That check fixed it for reasons I'm unsure of, as again I was on a tight timeframe and could not look into it further. Could definitely be a local issue, I'll look into it.

return LambdaResourceKt.getStream("textures/lambda_banner.png");
}

return original.call(instance, id);
}
}
}
10 changes: 6 additions & 4 deletions src/main/kotlin/com/lambda/module/Module.kt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import com.lambda.event.listener.Listener
import com.lambda.event.listener.SafeListener
import com.lambda.event.listener.SafeListener.Companion.listen
import com.lambda.event.listener.UnsafeListener
import com.lambda.module.modules.client.Client
import com.lambda.module.tag.ModuleTag
import com.lambda.sound.LambdaSound
import com.lambda.sound.SoundManager.play
Expand Down Expand Up @@ -155,11 +156,12 @@ abstract class Module(
else if (event.isReleased && disableOnRelease) disable()
}

onEnable { LambdaSound.ModuleOn.play() }
onDisable { LambdaSound.ModuleOff.play() }
onEnable { if (Client.toggleSounds) LambdaSound.ModuleOn.play() }
onDisable { if (Client.toggleSounds) LambdaSound.ModuleOff.play() }

onEnableUnsafe { LambdaSound.ModuleOn.play() }
onDisableUnsafe { LambdaSound.ModuleOff.play() }
//not sure if these should also be effected, remove if not.
onEnableUnsafe { if (Client.toggleSounds) LambdaSound.ModuleOn.play() }
onDisableUnsafe { if (Client.toggleSounds) LambdaSound.ModuleOff.play() }

listen<ClientEvent.Shutdown> { if (autoDisable) disable() }
listen<ClientEvent.Startup> { if (autoDisable) disable() }
Expand Down
30 changes: 30 additions & 0 deletions src/main/kotlin/com/lambda/module/modules/client/Client.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Copyright 2026 Lambda
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

package com.lambda.module.modules.client

import com.lambda.module.Module
import com.lambda.module.tag.ModuleTag

object Client : Module(
name = "Client",
description = "Customize various client features.",
tag = ModuleTag.CLIENT,
) {
val loadScreen by setting("Custom Loading Screen", true)
val toggleSounds by setting("Toggle Sounds", true)
}
1 change: 1 addition & 0 deletions src/main/kotlin/com/lambda/sound/SoundManager.kt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package com.lambda.sound

import com.lambda.Lambda.mc
import com.lambda.core.Loadable
import com.lambda.module.modules.client.Client
import com.lambda.util.math.random
import net.minecraft.client.sound.PositionedSoundInstance
import net.minecraft.registry.Registries
Expand Down