mirror of
https://github.com/GTNewHorizons/Applied-Energistics-2-Unofficial.git
synced 2026-10-26 14:25:20 +00:00
Pattern multiplication in interface terminal (#1396)
Authored-by: Sampsa
This commit is contained in:
1 parent
67285281de
commit
e586bd33db
19 files changed
+68
-2
No files matched your search
@@ -30,6 +30,7 @@ import java.util.function.Predicate;
|
||||
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
@@ -1940,6 +1941,10 @@ public class GuiInterfaceTerminal extends AEBaseGui
|
||||
|
||||
if (Keyboard.isKeyDown(Keyboard.KEY_SPACE)) {
|
||||
packet = new PacketInventoryAction(InventoryAction.MOVE_REGION, 0, id);
|
||||
} else if (GuiScreen.isCtrlKeyDown() && (btn == 0)) {
|
||||
packet = new PacketInventoryAction(InventoryAction.MULTIPLY_PATTERN, slotIdx, id);
|
||||
} else if (GuiScreen.isCtrlKeyDown() && (btn == 1)) {
|
||||
packet = new PacketInventoryAction(InventoryAction.DIVIDE_PATTERN, slotIdx, id);
|
||||
} else if (isShiftKeyDown() && (btn == 0 || btn == 1)) {
|
||||
packet = new PacketInventoryAction(InventoryAction.SHIFT_CLICK, slotIdx, id);
|
||||
} else if (btn == 0 || btn == 1) {
|
||||
@@ -1955,4 +1960,24 @@ public class GuiInterfaceTerminal extends AEBaseGui
|
||||
}
|
||||
}
|
||||
|
||||
// Individual pattern slot multiplication using scrollwheel
|
||||
@Override
|
||||
public void handleMouseInput() {
|
||||
if (!GuiScreen.isCtrlKeyDown()) {
|
||||
super.handleMouseInput();
|
||||
} else {
|
||||
int wheel = Mouse.getEventDWheel();
|
||||
if (wheel == 0) {
|
||||
super.handleMouseInput();
|
||||
} else {
|
||||
final int x = Mouse.getEventX() * this.width / this.mc.displayWidth;
|
||||
final int y = this.height - Mouse.getEventY() * this.height / this.mc.displayHeight - 1;
|
||||
if (wheel > 0) {
|
||||
mouseClicked(x, y, 0);
|
||||
} else {
|
||||
mouseClicked(x, y, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -52,6 +52,7 @@ import appeng.parts.AEBasePart;
|
||||
import appeng.parts.misc.PartPatternRepeater;
|
||||
import appeng.parts.p2p.PartP2PTunnel;
|
||||
import appeng.util.InventoryAdaptor;
|
||||
import appeng.util.PatternMultiplierHelper;
|
||||
import appeng.util.Platform;
|
||||
import appeng.util.inv.AdaptorPlayerHand;
|
||||
import appeng.util.inv.ItemSlot;
|
||||
@@ -234,6 +235,22 @@ public final class ContainerInterfaceTerminal extends AEBaseContainer implements
|
||||
isDirty = true;
|
||||
}
|
||||
}
|
||||
case MULTIPLY_PATTERN -> {
|
||||
if (slotStack != null) {
|
||||
ItemStack copy = slotStack.copy();
|
||||
PatternMultiplierHelper.applyModification(copy, 1);
|
||||
inv.patterns.setInventorySlotContents(slot, copy);
|
||||
syncIfaceSlot(inv, id, slot, copy);
|
||||
}
|
||||
}
|
||||
case DIVIDE_PATTERN -> {
|
||||
if (slotStack != null) {
|
||||
ItemStack copy = slotStack.copy();
|
||||
PatternMultiplierHelper.applyModification(copy, -1);
|
||||
inv.patterns.setInventorySlotContents(slot, copy);
|
||||
syncIfaceSlot(inv, id, slot, copy);
|
||||
}
|
||||
}
|
||||
case CREATIVE_DUPLICATE -> {
|
||||
if (player.capabilities.isCreativeMode) {
|
||||
playerHand.addItems(handStack);
|
||||
|
||||
@@ -120,6 +120,7 @@ public enum GuiText implements Localization {
|
||||
ProcessingPattern,
|
||||
Crafts,
|
||||
HoldShift,
|
||||
HoldControl,
|
||||
Result,
|
||||
Results,
|
||||
Ingredients,
|
||||
|
||||
@@ -27,5 +27,7 @@ public enum InventoryAction {
|
||||
UPDATE_HAND,
|
||||
AUTO_CRAFT,
|
||||
PLACE_SINGLE,
|
||||
FIND_ITEMS
|
||||
FIND_ITEMS,
|
||||
MULTIPLY_PATTERN,
|
||||
DIVIDE_PATTERN
|
||||
}
|
||||
@@ -16,5 +16,7 @@ public enum MonitorableAction {
|
||||
FILL_CONTAINERS,
|
||||
DRAIN_SINGLE_CONTAINER,
|
||||
DRAIN_CONTAINERS,
|
||||
CONTAINER_QUICK_TRANSFER
|
||||
CONTAINER_QUICK_TRANSFER,
|
||||
MULTIPLY_PATTERN,
|
||||
DIVIDE_PATTERN
|
||||
}
|
||||
@@ -155,6 +155,7 @@ public class ItemEncodedPattern extends AEBaseItem implements ICraftingPatternIt
|
||||
final String ingredients = (inItems.length > 1 ? EnumChatFormatting.DARK_GREEN + GuiText.Ingredients.getLocal()
|
||||
: EnumChatFormatting.DARK_GREEN + GuiText.Ingredient.getLocal()) + ": " + EnumChatFormatting.RESET;
|
||||
final String holdShift = EnumChatFormatting.GRAY + GuiText.HoldShift.getLocal() + EnumChatFormatting.RESET;
|
||||
final String holdControl = EnumChatFormatting.GRAY + GuiText.HoldControl.getLocal() + EnumChatFormatting.RESET;
|
||||
final String viewPattern = EnumChatFormatting.GRAY
|
||||
+ String.format(GuiText.PatternView.getLocal(), NEIClientConfig.getKeyName("gui.pattern_view"))
|
||||
+ EnumChatFormatting.RESET;
|
||||
@@ -170,6 +171,11 @@ public class ItemEncodedPattern extends AEBaseItem implements ICraftingPatternIt
|
||||
lines.addAll(in);
|
||||
} else {
|
||||
lines.add(holdShift);
|
||||
if (GuiScreen.isCtrlKeyDown()) {
|
||||
lines.add("x2/x0.5");
|
||||
} else {
|
||||
lines.add(holdControl);
|
||||
}
|
||||
}
|
||||
|
||||
lines.add(viewPattern);
|
||||
|
||||
@@ -249,6 +249,7 @@ gui.appliedenergistics2.MolecularAssembler=Molekulární sestavovač
|
||||
gui.appliedenergistics2.ProcessingPattern=Procesní schéma
|
||||
gui.appliedenergistics2.Crafts=Výroby
|
||||
gui.appliedenergistics2.HoldShift=Hold [LSHIFT] to show Ingredients
|
||||
gui.appliedenergistics2.HoldControl=Hold [CONTROL] to multiply/divide pattern
|
||||
gui.appliedenergistics2.PatternView=Press [%s] to view pattern
|
||||
gui.appliedenergistics2.Result=Result
|
||||
gui.appliedenergistics2.Results=Results
|
||||
|
||||
@@ -249,6 +249,7 @@ gui.appliedenergistics2.MolecularAssembler=Molekularassembler
|
||||
gui.appliedenergistics2.ProcessingPattern=Processing Pattern
|
||||
gui.appliedenergistics2.Crafts=Fertigt
|
||||
gui.appliedenergistics2.HoldShift=Hold [LSHIFT] to show Ingredients
|
||||
gui.appliedenergistics2.HoldControl=Hold [CONTROL] to multiply/divide pattern
|
||||
gui.appliedenergistics2.PatternView=Press [%s] to view pattern
|
||||
gui.appliedenergistics2.Result=Result
|
||||
gui.appliedenergistics2.Results=Results
|
||||
|
||||
@@ -252,6 +252,7 @@ gui.appliedenergistics2.MolecularAssembler=Molecular Assembler
|
||||
gui.appliedenergistics2.ProcessingPattern=Processing Pattern
|
||||
gui.appliedenergistics2.Crafts=Crafts
|
||||
gui.appliedenergistics2.HoldShift=Hold [LSHIFT] to show Ingredients
|
||||
gui.appliedenergistics2.HoldControl=Hold [CONTROL] to multiply/divide pattern
|
||||
gui.appliedenergistics2.PatternView=Press [%s] to view pattern
|
||||
gui.appliedenergistics2.Result=Result
|
||||
gui.appliedenergistics2.Results=Results
|
||||
|
||||
@@ -339,6 +339,7 @@ gui.appliedenergistics2.MolecularAssembler=Molecular Assembler
|
||||
gui.appliedenergistics2.ProcessingPattern=Processing Pattern
|
||||
gui.appliedenergistics2.Crafts=Crafts
|
||||
gui.appliedenergistics2.HoldShift=Hold [LSHIFT] to show ingredients
|
||||
gui.appliedenergistics2.HoldControl=Hold [CONTROL] to multiply/divide pattern
|
||||
gui.appliedenergistics2.PatternView=Press [%s] to view pattern
|
||||
gui.appliedenergistics2.Result=Result
|
||||
gui.appliedenergistics2.Results=Results
|
||||
|
||||
@@ -249,6 +249,7 @@ gui.appliedenergistics2.MolecularAssembler=Ensambladora Molecular
|
||||
gui.appliedenergistics2.ProcessingPattern=Procesando Patrón
|
||||
gui.appliedenergistics2.Crafts=Construir
|
||||
gui.appliedenergistics2.HoldShift=Hold [LSHIFT] to show Ingredients
|
||||
gui.appliedenergistics2.HoldControl=Hold [CONTROL] to multiply/divide pattern
|
||||
gui.appliedenergistics2.PatternView=Press [%s] to view pattern
|
||||
gui.appliedenergistics2.Result=Result
|
||||
gui.appliedenergistics2.Results=Results
|
||||
|
||||
@@ -249,6 +249,7 @@ gui.appliedenergistics2.MolecularAssembler=Assembleur moléculaire
|
||||
gui.appliedenergistics2.ProcessingPattern=Modèle de traitement
|
||||
gui.appliedenergistics2.Crafts=Fabrications
|
||||
gui.appliedenergistics2.HoldShift=Hold [LSHIFT] to show Ingredients
|
||||
gui.appliedenergistics2.HoldControl=Hold [CONTROL] to multiply/divide pattern
|
||||
gui.appliedenergistics2.PatternView=Press [%s] to view pattern
|
||||
gui.appliedenergistics2.Result=Result
|
||||
gui.appliedenergistics2.Results=Results
|
||||
|
||||
@@ -249,6 +249,7 @@ gui.appliedenergistics2.MolecularAssembler=Molekuláris Összeállító
|
||||
gui.appliedenergistics2.ProcessingPattern=Feldolgozó Minta
|
||||
gui.appliedenergistics2.Crafts=Barkácsol
|
||||
gui.appliedenergistics2.HoldShift=Hold [LSHIFT] to show Ingredients
|
||||
gui.appliedenergistics2.HoldControl=Hold [CONTROL] to multiply/divide pattern
|
||||
gui.appliedenergistics2.PatternView=Press [%s] to view pattern
|
||||
gui.appliedenergistics2.Result=Result
|
||||
gui.appliedenergistics2.Results=Results
|
||||
|
||||
@@ -249,6 +249,7 @@ gui.appliedenergistics2.MolecularAssembler=Assemblatore moleculare
|
||||
gui.appliedenergistics2.ProcessingPattern=Modelli in lavoro
|
||||
gui.appliedenergistics2.Crafts=Fabbrica
|
||||
gui.appliedenergistics2.HoldShift=Hold [LSHIFT] to show Ingredients
|
||||
gui.appliedenergistics2.HoldControl=Hold [CONTROL] to multiply/divide pattern
|
||||
gui.appliedenergistics2.PatternView=Press [%s] to view pattern
|
||||
gui.appliedenergistics2.Result=Result
|
||||
gui.appliedenergistics2.Results=Results
|
||||
|
||||
@@ -249,6 +249,7 @@ gui.appliedenergistics2.MolecularAssembler=ME分子組立機
|
||||
gui.appliedenergistics2.ProcessingPattern=実行パターン
|
||||
gui.appliedenergistics2.Crafts=クラフト
|
||||
gui.appliedenergistics2.HoldShift=Hold [LSHIFT] to show Ingredients
|
||||
gui.appliedenergistics2.HoldControl=Hold [CONTROL] to multiply/divide pattern
|
||||
gui.appliedenergistics2.PatternView=Press [%s] to view pattern
|
||||
gui.appliedenergistics2.Result=Result
|
||||
gui.appliedenergistics2.Results=Results
|
||||
|
||||
@@ -249,6 +249,7 @@ gui.appliedenergistics2.MolecularAssembler=분자 조합기
|
||||
gui.appliedenergistics2.ProcessingPattern=패턴 제작하기
|
||||
gui.appliedenergistics2.Crafts=다음을 조합:
|
||||
gui.appliedenergistics2.HoldShift=Hold [LSHIFT] to show Ingredients
|
||||
gui.appliedenergistics2.HoldControl=Hold [CONTROL] to multiply/divide pattern
|
||||
gui.appliedenergistics2.PatternView=Press [%s] to view pattern
|
||||
gui.appliedenergistics2.Result=Result
|
||||
gui.appliedenergistics2.Results=Results
|
||||
|
||||
@@ -249,6 +249,7 @@ gui.appliedenergistics2.MolecularAssembler=Montador Molecular
|
||||
gui.appliedenergistics2.ProcessingPattern=Processando Padrão
|
||||
gui.appliedenergistics2.Crafts=Receitas
|
||||
gui.appliedenergistics2.HoldShift=Hold [LSHIFT] to show Ingredients
|
||||
gui.appliedenergistics2.HoldControl=Hold [CONTROL] to multiply/divide pattern
|
||||
gui.appliedenergistics2.PatternView=Press [%s] to view pattern
|
||||
gui.appliedenergistics2.Result=Result
|
||||
gui.appliedenergistics2.Results=Results
|
||||
|
||||
@@ -249,6 +249,7 @@ gui.appliedenergistics2.MolecularAssembler=Molecular Assembler
|
||||
gui.appliedenergistics2.ProcessingPattern=Processing Pattern
|
||||
gui.appliedenergistics2.Crafts=Crafts
|
||||
gui.appliedenergistics2.HoldShift=Hold [LSHIFT] to show Ingredients
|
||||
gui.appliedenergistics2.HoldControl=Hold [CONTROL] to multiply/divide pattern
|
||||
gui.appliedenergistics2.PatternView=Press [%s] to view pattern
|
||||
gui.appliedenergistics2.Result=Result
|
||||
gui.appliedenergistics2.Results=Results
|
||||
|
||||
@@ -249,6 +249,7 @@ gui.appliedenergistics2.MolecularAssembler=分子裝配室
|
||||
gui.appliedenergistics2.ProcessingPattern=處理樣板
|
||||
gui.appliedenergistics2.Crafts=合成
|
||||
gui.appliedenergistics2.HoldShift=Hold [LSHIFT] to show Ingredients
|
||||
gui.appliedenergistics2.HoldControl=Hold [CONTROL] to multiply/divide pattern
|
||||
gui.appliedenergistics2.PatternView=Press [%s] to view pattern
|
||||
gui.appliedenergistics2.Result=Result
|
||||
gui.appliedenergistics2.Results=Results
|
||||
|
||||
Reference in new issue
Block a user