Skip to content

Commit

Permalink
Fix unfocused clickgui issue (#417)
Browse files Browse the repository at this point in the history
  • Loading branch information
rfresh2 authored Nov 21, 2022
1 parent 71508be commit c073a8f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/main/java/com/lambda/mixin/accessor/gui/AccessorGuiScreen.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.lambda.mixin.accessor.gui;

import net.minecraft.client.gui.GuiScreen;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;

@Mixin(value = GuiScreen.class)
public interface AccessorGuiScreen {

@Accessor("eventButton")
void setEventButton(final int eventButton);
}
2 changes: 2 additions & 0 deletions src/main/kotlin/com/lambda/client/gui/AbstractLambdaGui.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import com.lambda.client.util.graphics.font.FontRenderAdapter
import com.lambda.client.util.math.Vec2d
import com.lambda.client.util.math.Vec2f
import com.lambda.client.util.threads.safeListener
import com.lambda.mixin.accessor.gui.AccessorGuiScreen
import net.minecraft.client.gui.GuiScreen
import net.minecraft.client.gui.ScaledResolution
import net.minecraft.client.renderer.GlStateManager
Expand Down Expand Up @@ -140,6 +141,7 @@ abstract class AbstractLambdaGui<S : SettingWindow<*>, E : Any> : GuiScreen() {
open fun onDisplayed() {
lastClickedWindow = null
lastEventButton = -1
(this as AccessorGuiScreen).setEventButton(-1)

displayed.value = true

Expand Down
1 change: 1 addition & 0 deletions src/main/resources/mixins.lambda.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"accessor.gui.AccessorGuiChat",
"accessor.gui.AccessorGuiDisconnected",
"accessor.gui.AccessorGuiEditSign",
"accessor.gui.AccessorGuiScreen",
"accessor.network.AccessorCPacketChatMessage",
"accessor.network.AccessorCPacketCloseWindow",
"accessor.network.AccessorCPacketPlayer",
Expand Down

0 comments on commit c073a8f

Please sign in to comment.