Skip to content

Commit b2932a7

Browse files
committed
Fix ImGUI layering
1 parent 984b26c commit b2932a7

File tree

4 files changed

+18
-8
lines changed

4 files changed

+18
-8
lines changed

src/main/java/com/lambda/mixin/render/GameRendererMixin.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import com.lambda.event.EventFlow;
2121
import com.lambda.event.events.RenderEvent;
2222
import com.lambda.graphics.RenderMain;
23+
import com.lambda.gui.DearImGui;
2324
import com.lambda.module.modules.render.NoRender;
2425
import com.lambda.module.modules.render.Zoom;
2526
import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
@@ -80,4 +81,9 @@ private void injectShowFloatingItem(ItemStack floatingItem, CallbackInfo ci) {
8081
private float modifyGetFov(float original) {
8182
return original / Zoom.getLerpedZoom();
8283
}
84+
85+
@Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/render/GuiRenderer;render(Lcom/mojang/blaze3d/buffers/GpuBufferSlice;)V", shift = At.Shift.AFTER))
86+
private void onGuiRenderComplete(RenderTickCounter tickCounter, boolean tick, CallbackInfo ci) {
87+
DearImGui.INSTANCE.render();
88+
}
8389
}

src/main/java/com/lambda/mixin/render/InGameHudMixin.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,6 @@
3535

3636
@Mixin(InGameHud.class)
3737
public class InGameHudMixin {
38-
/**
39-
* Begins our 2d render after the game has rendered all 2d elements
40-
*/
41-
@Inject(method = "render", at = @At("TAIL"))
42-
private void onRender(DrawContext context, RenderTickCounter tickCounter, CallbackInfo ci) {
43-
DearImGui.INSTANCE.render();
44-
}
4538

4639
@Inject(method = "renderNauseaOverlay", at = @At("HEAD"), cancellable = true)
4740
private void injectRenderNauseaOverlay(DrawContext context, float nauseaStrength, CallbackInfo ci) {

src/main/kotlin/com/lambda/gui/LambdaScreen.kt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,14 @@ object LambdaScreen : Screen(Text.of("Lambda")) {
2626
override fun shouldPause() = false
2727
override fun removed() = ClickGuiLayout.close()
2828
override fun render(context: DrawContext?, mouseX: Int, mouseY: Int, deltaTicks: Float) {}
29-
override fun renderBackground(context: DrawContext?, mouseX: Int, mouseY: Int, deltaTicks: Float) {}
29+
30+
override fun applyBlur(context: DrawContext?) {
31+
if (!ClickGuiLayout.backgroundBlur) return
32+
super.applyBlur(context)
33+
}
34+
35+
override fun renderDarkening(context: DrawContext?) {
36+
if (!ClickGuiLayout.backgroundDarkening) return
37+
super.renderDarkening(context)
38+
}
3039
}

src/main/kotlin/com/lambda/gui/components/ClickGuiLayout.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@ object ClickGuiLayout : Loadable, Configurable(GuiConfig) {
122122
@JvmStatic
123123
val setLambdaWindowTitle by setting("Set Lambda Window Title", true).onValueChange { _, _ -> mc.updateWindowTitle() }.group(Group.General)
124124
val lambdaTitleAppendixName by setting("Append Username", true) { setLambdaWindowTitle }.onValueChange { _, _ -> mc.updateWindowTitle() }.group(Group.General)
125+
val backgroundBlur by setting("Background Blur", true).group(Group.General)
126+
val backgroundDarkening by setting("Background Darkening", true).group(Group.General)
125127

126128
// Snapping
127129
val snapEnabled by setting("Enable Snapping", true, "Master toggle for GUI/HUD snapping").group(Group.Snapping)

0 commit comments

Comments
 (0)