mirror of
https://github.com/GTNewHorizons/AE2FluidCraft-Rework.git
synced 2026-11-11 15:57:55 +00:00
keep mouse pos
This commit is contained in:
1 parent
8e230af664
commit
5f6a826ed9
4 files changed
+39
-5
No files matched your search
@@ -56,6 +56,7 @@ import com.glodblock.github.inventory.gui.GuiType;
|
||||
import com.glodblock.github.network.CPacketInventoryAction;
|
||||
import com.glodblock.github.util.Ae2ReflectClient;
|
||||
import com.glodblock.github.util.ModAndClassUtil;
|
||||
import com.glodblock.github.util.Util;
|
||||
|
||||
public abstract class FCGuiMonitor<T extends IAEStack<T>> extends AEBaseMEGui
|
||||
implements ISortSource, IConfigManagerHost, IDropToFillTextField {
|
||||
@@ -343,7 +344,10 @@ public abstract class FCGuiMonitor<T extends IAEStack<T>> extends AEBaseMEGui
|
||||
|
||||
craftingGridOffsetX -= 25;
|
||||
craftingGridOffsetY -= 6;
|
||||
if (drawSwitchGuiBtn) drawSwitchGuiBtns();
|
||||
if (drawSwitchGuiBtn) {
|
||||
drawSwitchGuiBtns();
|
||||
Util.MouseHandler.loadMousePos();
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@@ -597,6 +601,7 @@ public abstract class FCGuiMonitor<T extends IAEStack<T>> extends AEBaseMEGui
|
||||
super.onGuiClosed();
|
||||
Keyboard.enableRepeatEvents(false);
|
||||
memoryText = this.searchField.getText();
|
||||
Util.MouseHandler.saveMousePos();
|
||||
}
|
||||
|
||||
public void bindTextureBack(final String file) {
|
||||
|
||||
@@ -16,6 +16,7 @@ import net.minecraftforge.fluids.*;
|
||||
|
||||
import org.apache.commons.lang3.tuple.ImmutablePair;
|
||||
import org.apache.commons.lang3.tuple.MutablePair;
|
||||
import org.lwjgl.input.Mouse;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.Actionable;
|
||||
@@ -52,6 +53,25 @@ import io.netty.buffer.ByteBuf;
|
||||
|
||||
public final class Util {
|
||||
|
||||
public static class MouseHandler {
|
||||
|
||||
private static int mouse_x = 0;
|
||||
private static int mouse_y = 0;
|
||||
|
||||
public static void saveMousePos() {
|
||||
mouse_x = Mouse.getX();
|
||||
mouse_y = Mouse.getY();
|
||||
}
|
||||
|
||||
public static void loadMousePos() {
|
||||
if (mouse_x != 0 && mouse_y != 0) {
|
||||
Mouse.setCursorPosition(mouse_x, mouse_y);
|
||||
mouse_y = 0;
|
||||
mouse_x = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static int drainItemPower(AEBaseContainer c, InventoryPlayer ip, int slot, int ticks, double pm,
|
||||
IFluidPortableCell wt) {
|
||||
final ItemStack currentItem = slot < 0 ? ip.getCurrentItem() : ip.getStackInSlot(slot);
|
||||
|
||||
Reference in new issue
Block a user