forked from reserveword/IMBlocker
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move state checker of Axiom GUI to client tick event.
- Loading branch information
1 parent
f9a4eaa
commit 75f164f
Showing
5 changed files
with
65 additions
and
40 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
common/src/main/java/io/github/reserveword/imblocker/AxiomGuiAccessor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package io.github.reserveword.imblocker; | ||
|
||
public abstract class AxiomGuiAccessor { | ||
public static AxiomGuiAccessor instance; | ||
|
||
public abstract boolean isCaptureKeyboard(); | ||
public abstract boolean isTextFieldFocused(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
fabric/src/client/java/io/github/reserveword/imblocker/mixin/AxiomEditorUIMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package io.github.reserveword.imblocker.mixin; | ||
|
||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Pseudo; | ||
import org.spongepowered.asm.mixin.Shadow; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
import imgui.ImGuiIO; | ||
import io.github.reserveword.imblocker.AxiomGuiAccessor; | ||
|
||
@Pseudo | ||
@Mixin(targets = "com.moulberry.axiom.editor.EditorUI", remap = false) | ||
public abstract class AxiomEditorUIMixin { | ||
@Shadow | ||
public static ImGuiIO imGuiIO; | ||
|
||
@Inject(method = "init", at = @At("TAIL")) | ||
private static void loadImGui(CallbackInfo ci) { | ||
AxiomGuiAccessor.instance = new AxiomGuiAccessor() { | ||
@Override | ||
public boolean isTextFieldFocused() { | ||
return imGuiIO.getWantTextInput(); | ||
} | ||
|
||
@Override | ||
public boolean isCaptureKeyboard() { | ||
return imGuiIO.getWantCaptureKeyboard(); | ||
} | ||
}; | ||
} | ||
} |
33 changes: 0 additions & 33 deletions
33
fabric/src/client/java/io/github/reserveword/imblocker/mixin/ImGuiMixin.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters