-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
76a801d
commit 72058ae
Showing
7 changed files
with
199 additions
and
1 deletion.
There are no files selected for viewing
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
39 changes: 39 additions & 0 deletions
39
...main/java/com/nomiceu/nomilabs/mixin/ae2/GuiFluidInterfaceConfigurationTerminalMixin.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,39 @@ | ||
package com.nomiceu.nomilabs.mixin.ae2; | ||
|
||
import net.minecraft.inventory.Container; | ||
|
||
import org.spongepowered.asm.mixin.Mixin; | ||
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 com.nomiceu.nomilabs.config.LabsConfig; | ||
|
||
import appeng.client.gui.AEBaseGui; | ||
import appeng.client.gui.implementations.GuiFluidInterfaceConfigurationTerminal; | ||
import appeng.client.gui.widgets.MEGuiTextField; | ||
|
||
/** | ||
* Allows Auto-Focusing of the Fluid Interface Configuration Terminal. Allows Not Saving Searches. | ||
*/ | ||
@Mixin(value = GuiFluidInterfaceConfigurationTerminal.class, remap = false) | ||
public abstract class GuiFluidInterfaceConfigurationTerminalMixin extends AEBaseGui { | ||
|
||
@Shadow | ||
private MEGuiTextField searchFieldInputs; | ||
|
||
/** | ||
* Default Ignored Constructor | ||
*/ | ||
public GuiFluidInterfaceConfigurationTerminalMixin(Container container) { | ||
super(container); | ||
} | ||
|
||
@Inject(method = "initGui", at = @At("RETURN"), remap = true) | ||
private void focusGui(CallbackInfo ci) { | ||
searchFieldInputs.setFocused(LabsConfig.modIntegration.ae2TerminalOptions.autoFocusConfigFluidInterface); | ||
if (!LabsConfig.modIntegration.ae2TerminalOptions.saveConfigInterfaceSearch) | ||
searchFieldInputs.setText(""); | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
src/main/java/com/nomiceu/nomilabs/mixin/ae2/GuiFluidTerminalMixin.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,37 @@ | ||
package com.nomiceu.nomilabs.mixin.ae2; | ||
|
||
import net.minecraft.inventory.Container; | ||
|
||
import org.spongepowered.asm.mixin.Mixin; | ||
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 com.nomiceu.nomilabs.config.LabsConfig; | ||
|
||
import appeng.client.gui.AEBaseGui; | ||
import appeng.client.gui.widgets.MEGuiTextField; | ||
import appeng.fluids.client.gui.GuiFluidTerminal; | ||
|
||
/** | ||
* Allows Auto-Focusing Fluid Terminal.A | ||
*/ | ||
@Mixin(value = GuiFluidTerminal.class, remap = false) | ||
public abstract class GuiFluidTerminalMixin extends AEBaseGui { | ||
|
||
@Shadow | ||
private MEGuiTextField searchField; | ||
|
||
/** | ||
* Default Ignored Constructor | ||
*/ | ||
public GuiFluidTerminalMixin(Container container) { | ||
super(container); | ||
} | ||
|
||
@Inject(method = "initGui", at = @At("RETURN"), remap = true) | ||
private void focusGui(CallbackInfo ci) { | ||
searchField.setFocused(LabsConfig.modIntegration.ae2TerminalOptions.autoFocusFluid); | ||
} | ||
} |
39 changes: 39 additions & 0 deletions
39
src/main/java/com/nomiceu/nomilabs/mixin/ae2/GuiInterfaceConfigurationTerminalMixin.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,39 @@ | ||
package com.nomiceu.nomilabs.mixin.ae2; | ||
|
||
import net.minecraft.inventory.Container; | ||
|
||
import org.spongepowered.asm.mixin.Mixin; | ||
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 com.nomiceu.nomilabs.config.LabsConfig; | ||
|
||
import appeng.client.gui.AEBaseGui; | ||
import appeng.client.gui.implementations.GuiInterfaceConfigurationTerminal; | ||
import appeng.client.gui.widgets.MEGuiTextField; | ||
|
||
/** | ||
* Allows Auto-Focusing of the Interface Configuration Terminal. Allows Not Saving Searches. | ||
*/ | ||
@Mixin(value = GuiInterfaceConfigurationTerminal.class, remap = false) | ||
public abstract class GuiInterfaceConfigurationTerminalMixin extends AEBaseGui { | ||
|
||
@Shadow | ||
private MEGuiTextField searchFieldInputs; | ||
|
||
/** | ||
* Default Ignored Constructor | ||
*/ | ||
public GuiInterfaceConfigurationTerminalMixin(Container container) { | ||
super(container); | ||
} | ||
|
||
@Inject(method = "initGui", at = @At("RETURN"), remap = true) | ||
private void focusGui(CallbackInfo ci) { | ||
searchFieldInputs.setFocused(LabsConfig.modIntegration.ae2TerminalOptions.autoFocusConfigInterface); | ||
if (!LabsConfig.modIntegration.ae2TerminalOptions.saveConfigInterfaceSearch) | ||
searchFieldInputs.setText(""); | ||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
src/main/java/com/nomiceu/nomilabs/mixin/ae2/GuiInterfaceTerminalMixin.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,42 @@ | ||
package com.nomiceu.nomilabs.mixin.ae2; | ||
|
||
import net.minecraft.inventory.Container; | ||
|
||
import org.spongepowered.asm.mixin.Final; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
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 com.nomiceu.nomilabs.config.LabsConfig; | ||
|
||
import appeng.client.gui.AEBaseGui; | ||
import appeng.client.gui.implementations.GuiInterfaceTerminal; | ||
import appeng.client.gui.widgets.MEGuiTooltipTextField; | ||
|
||
/** | ||
* Focuses the Interface Terminal on entry, so that keybinds (like Bogosort Cfg Keybind) doesn't register. | ||
*/ | ||
@Mixin(value = GuiInterfaceTerminal.class, remap = false) | ||
public abstract class GuiInterfaceTerminalMixin extends AEBaseGui { | ||
|
||
@Shadow | ||
@Final | ||
private MEGuiTooltipTextField searchFieldNames; | ||
|
||
/** | ||
* Default Ignored Constructor | ||
*/ | ||
public GuiInterfaceTerminalMixin(Container container) { | ||
super(container); | ||
} | ||
|
||
@Inject(method = "initGui", at = @At("RETURN"), remap = true) | ||
private void focusGui(CallbackInfo ci) { | ||
searchFieldNames.setFocused(LabsConfig.modIntegration.ae2TerminalOptions.autoFocusInterface); | ||
// Since its focused by default, we need to manually focus GUI | ||
if (LabsConfig.modIntegration.ae2TerminalOptions.autoFocusInterface) | ||
setFocused(true); | ||
} | ||
} |
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
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