Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions src/generated/resources/assets/gtceu/lang/en_ud.json
Original file line number Diff line number Diff line change
Expand Up @@ -2126,14 +2126,13 @@
"cover.pump.mode.import": "ʇɹodɯI :ǝpoW",
"cover.pump.title": ")%s( sbuıʇʇǝS ɹǝʌoƆ dɯnԀ",
"cover.pump.transfer_rate": "%s",
"cover.robotic_arm.transfer_mode.description.0": "˙ǝןqıssod sɐ ɹǝʇןıɟ sʇı buıɥɔʇɐɯ sɯǝʇı ʎuɐɯ sɐ ɹǝɟsuɐɹʇ ןןıʍ ɹǝʌoɔ 'ǝpoɯ sıɥʇ uı - ɹ§ʎuⱯ ɹǝɟsuɐɹ⟘ǝ§",
"cover.robotic_arm.transfer_mode.description.1": "˙pǝʌoɯ ǝq ʇ,uoʍ sɯǝʇı 'ǝzıs uoıʇɹod uɐɥʇ ssǝן sı sɯǝʇı ɟo ʇunoɯɐ ɟI ˙)ɹǝʇןıɟ bɐʇ ɹoɟ uoʇʇnq sıɥʇ ɹǝpun ǝןqɐıɹɐʌ ɹo( sʇoןs ɹǝʇןıɟ ɯǝʇı uı pǝıɟıɔǝds suoıʇɹod uı sɯǝʇı ʎןddns ןןıʍ ɹǝʌoɔ 'ǝpoɯ sıɥʇ uı - ɹ§ʇɔɐxƎ ʎןddnSǝ§",
"cover.robotic_arm.transfer_mode.description.2": "˙pǝɹınbǝɹ ɟı sɯǝʇı ɟo ʇunoɯɐ ןɐuoıʇıppɐ buıʎןddns 'ʎɹoʇuǝʌuı uoıʇɐuıʇsǝp ǝɥʇ uı sɯǝʇı ɟo ʇunoɯɐ pǝıɟıɔǝds dǝǝʞ ןןıʍ ɹǝʌoɔ 'ǝpoɯ sıɥʇ uı - ɹ§ʇɔɐxƎ dǝǝʞǝ§",
"cover.robotic_arm.transfer_mode.description.3": "˙ɹǝʇsɐɟ ʇunoɯɐ ǝbuɐɥɔ oʇ buıʞɔıןɔ ʇɟıɥs ǝsn 'ʇunoɯɐ ɯǝʇı ǝbuɐɥɔ oʇ sʇoןs ɹǝʇןıɟ uo ʞɔıןɔ ʇɥbıɹ/ʇɟǝן :dı⟘ㄥ§",
"cover.robotic_arm.transfer_mode.keep_exact": "ʇɔɐxƎ dǝǝʞ",
"cover.robotic_arm.transfer_mode.description.0": "˙ɹǝʇsɐɟ ʇunoɯɐ ǝbuɐɥɔ oʇ buıʞɔıןɔ ʇɟıɥs ǝsn 'ʇunoɯɐ ɯǝʇı ǝbuɐɥɔ oʇ sʇoןs ɹǝʇןıɟ uo ʞɔıןɔ ʇɥbıɹ/ʇɟǝן :dı⟘ㄥ§",
"cover.robotic_arm.transfer_mode.keep_exact": "˙pǝɹınbǝɹ ɟı sɯǝʇı ɟo ʇunoɯɐ ןɐuoıʇıppɐ buıʎןddns 'ʎɹoʇuǝʌuı uoıʇɐuıʇsǝp ǝɥʇ uı sɯǝʇı ɟo ʇunoɯɐ pǝıɟıɔǝds dǝǝʞ ןןıʍ ɹǝʌoɔ 'ǝpoɯ sıɥʇ uı - ɹ§ʇɔɐxƎ dǝǝʞǝ§",
"cover.robotic_arm.transfer_mode.keep_multiple": "˙sɯǝʇı ɟo ʇunoɯɐ pǝıɟıɔǝds ǝɥʇ ɟo ǝןdıʇןnɯ ɐ ǝʌɐɥ ןןıʍ ʇndʇno ǝɥʇ ʇɐɥʇ ɥɔns 'ǝןqıssod sɐ sɯǝʇı ʎuɐɯ sɐ ɹǝɟsuɐɹʇ ןןıʍ ɹǝʌoɔ ǝɥʇ 'ǝpoɯ sıɥʇ uı - ɹ§ǝןdıʇןnW dǝǝʞǝ§",
"cover.robotic_arm.transfer_mode.title": "ǝpoW ɹǝɟsuɐɹ⟘",
"cover.robotic_arm.transfer_mode.transfer_any": "ʎuⱯ ɹǝɟsuɐɹ⟘",
"cover.robotic_arm.transfer_mode.transfer_exact": "ʇɔɐxƎ ʎןddnS",
"cover.robotic_arm.transfer_mode.transfer_any": "˙ǝןqıssod sɐ ɹǝʇןıɟ sʇı buıɥɔʇɐɯ sɯǝʇı ʎuɐɯ sɐ ɹǝɟsuɐɹʇ ןןıʍ ɹǝʌoɔ 'ǝpoɯ sıɥʇ uı - ɹ§ʎuⱯ ɹǝɟsuɐɹ⟘ǝ§",
"cover.robotic_arm.transfer_mode.transfer_exact": "˙pǝʌoɯ ǝq ʇ,uoʍ sɯǝʇı 'ǝzıs uoıʇɹod uɐɥʇ ssǝן sı sɯǝʇı ɟo ʇunoɯɐ ɟI ˙)ɹǝʇןıɟ bɐʇ ɹoɟ uoʇʇnq sıɥʇ ɹǝpun ǝןqɐıɹɐʌ ɹo( sʇoןs ɹǝʇןıɟ ɯǝʇı uı pǝıɟıɔǝds suoıʇɹod uı sɯǝʇı ʎןddns ןןıʍ ɹǝʌoɔ 'ǝpoɯ sıɥʇ uı - ɹ§ʇɔɐxƎ ʎןddnSǝ§",
"cover.robotic_arm.transfer_mode.transfer_multiple": "˙)pǝɹɹǝɟsuɐɹʇ ǝq ןןıʍ 0Ɛ 'ʇnduı ǝɥʇ uı sɯǝʇı ᄅƐ ǝɹɐ ǝɹǝɥʇ puɐ 'ϛ sı ʇunoɯɐ ǝɥʇ ɟı ˙ǝ˙ı( uoıʇɐɹǝdo Ɩ uı ʇunoɯɐ pǝıɟıɔǝds ǝɥʇ ɟo ǝןdıʇןnɯ ɐ ɹǝɟsuɐɹʇ uɐɔ ʇnq 'ʇɔɐxǝ ʎןddns ǝʞıן - ɹ§ǝןdıʇןnW ɹǝɟsuɐɹ⟘ǝ§",
"cover.shutter.message.disabled": "ɹǝʇʇnɥs pǝuǝdO",
"cover.shutter.message.enabled": "ɹǝʇʇnɥs pǝsoןƆ",
"cover.storage.title": "ɹǝʌoƆ ǝbɐɹoʇS",
Expand Down
13 changes: 6 additions & 7 deletions src/generated/resources/assets/gtceu/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -2126,14 +2126,13 @@
"cover.pump.mode.import": "Mode: Import",
"cover.pump.title": "Pump Cover Settings (%s)",
"cover.pump.transfer_rate": "%s",
"cover.robotic_arm.transfer_mode.description.0": "§eTransfer Any§r - in this mode, cover will transfer as many items matching its filter as possible.",
"cover.robotic_arm.transfer_mode.description.1": "§eSupply Exact§r - in this mode, cover will supply items in portions specified in item filter slots (or variable under this button for tag filter). If amount of items is less than portion size, items won't be moved.",
"cover.robotic_arm.transfer_mode.description.2": "§eKeep Exact§r - in this mode, cover will keep specified amount of items in the destination inventory, supplying additional amount of items if required.",
"cover.robotic_arm.transfer_mode.description.3": "§7Tip: left/right click on filter slots to change item amount, use shift clicking to change amount faster.",
"cover.robotic_arm.transfer_mode.keep_exact": "Keep Exact",
"cover.robotic_arm.transfer_mode.description.0": "§7Tip: left/right click on filter slots to change item amount, use shift clicking to change amount faster.",
"cover.robotic_arm.transfer_mode.keep_exact": "§eKeep Exact§r - in this mode, cover will keep specified amount of items in the destination inventory, supplying additional amount of items if required.",
"cover.robotic_arm.transfer_mode.keep_multiple": "§eKeep Multiple§r - in this mode, the cover will transfer as many items as possible, such that the output will have a multiple of the specified amount of items.",
"cover.robotic_arm.transfer_mode.title": "Transfer Mode",
"cover.robotic_arm.transfer_mode.transfer_any": "Transfer Any",
"cover.robotic_arm.transfer_mode.transfer_exact": "Supply Exact",
"cover.robotic_arm.transfer_mode.transfer_any": "§eTransfer Any§r - in this mode, cover will transfer as many items matching its filter as possible.",
"cover.robotic_arm.transfer_mode.transfer_exact": "§eSupply Exact§r - in this mode, cover will supply items in portions specified in item filter slots (or variable under this button for tag filter). If amount of items is less than portion size, items won't be moved.",
"cover.robotic_arm.transfer_mode.transfer_multiple": "§eTransfer Multiple§r - like supply exact, but can transfer a multiple of the specified amount in 1 operation (i.e. if the amount is 5, and there are 32 items in the input, 30 will be transferred).",
"cover.shutter.message.disabled": "Opened shutter",
"cover.shutter.message.enabled": "Closed shutter",
"cover.storage.title": "Storage Cover",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import brachy.modularui.value.BoolValue;
import brachy.modularui.value.sync.EnumSyncValue;
import brachy.modularui.value.sync.PanelSyncManager;
import brachy.modularui.widgets.SlotGroupWidget;
import brachy.modularui.widgets.layout.Flow;

public interface IMuiCover extends IUIHolder<SidedPosGuiData> {
Expand Down Expand Up @@ -57,7 +56,7 @@ default ModularPanel<?> buildUI(SidedPosGuiData data, PanelSyncManager syncManag

createCoverUIRows(column, data, syncManager, settings);
return panel.child(column)
.child(SlotGroupWidget.playerInventory(false).left(7).bottom(7));
.bindPlayerInventory();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,11 @@ public FluidRegulatorCover(CoverDefinition definition, ICoverable coverHolder, D
@Override
protected int doTransferFluidsInternal(IFluidHandlerModifiable source, IFluidHandlerModifiable destination,
int platformTransferLimit) {
return switch (transferMode) {
return switch (transferMode) { // TRANSFER_MULTIPLE and KEEP_MULTIPLE don't do anything special with fluids
// right now
case TRANSFER_ANY -> transferAny(source, destination, platformTransferLimit);
case TRANSFER_EXACT -> transferExact(source, destination, platformTransferLimit);
case KEEP_EXACT -> keepExact(source, destination, platformTransferLimit);
case TRANSFER_EXACT, TRANSFER_MULTIPLE -> transferExact(source, destination, platformTransferLimit);
case KEEP_EXACT, KEEP_MULTIPLE -> keepExact(source, destination, platformTransferLimit);
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import net.minecraftforge.items.IItemHandler;

import brachy.modularui.factory.SidedPosGuiData;
import brachy.modularui.screen.ModularPanel;
import brachy.modularui.screen.UISettings;
import brachy.modularui.value.sync.EnumSyncValue;
import brachy.modularui.value.sync.IntSyncValue;
Expand Down Expand Up @@ -65,8 +66,8 @@ protected int doTransferItems(IItemHandler itemHandler, IItemHandler myItemHandl
}
return switch (transferMode) {
case TRANSFER_ANY -> moveInventoryItems(itemHandler, myItemHandler, maxTransferAmount);
case TRANSFER_EXACT -> doTransferExact(itemHandler, myItemHandler, maxTransferAmount);
case KEEP_EXACT -> doKeepExact(itemHandler, myItemHandler, maxTransferAmount);
case TRANSFER_EXACT, TRANSFER_MULTIPLE -> doTransferExact(itemHandler, myItemHandler, maxTransferAmount);
case KEEP_EXACT, KEEP_MULTIPLE -> doKeepExact(itemHandler, myItemHandler, maxTransferAmount);
};
}

Expand All @@ -80,7 +81,11 @@ protected int doTransferExact(IItemHandler sourceInventory, IItemHandler targetI
int itemToMoveAmount = getFilteredItemAmount(sourceInfo.itemStack);

if (itemAmount >= itemToMoveAmount) {
sourceInfo.totalCount = itemToMoveAmount;
if (transferMode == TransferMode.TRANSFER_MULTIPLE) {
sourceInfo.totalCount = itemAmount - (itemAmount % itemToMoveAmount);
} else {
sourceInfo.totalCount = itemToMoveAmount;
}
} else {
iterator.remove();
}
Expand Down Expand Up @@ -116,14 +121,18 @@ protected int doKeepExact(IItemHandler sourceInventory, IItemHandler targetInven
while (iterator.hasNext()) {
ItemStack filteredItem = iterator.next();
GroupItemInfo sourceInfo = sourceItemAmounts.get(filteredItem);
int sourceAmount = sourceInfo.totalCount;
int itemToKeepAmount = getFilteredItemAmount(sourceInfo.itemStack);

int itemAmount = 0;
if (targetItemAmounts.containsKey(filteredItem)) {
GroupItemInfo destItemInfo = targetItemAmounts.get(filteredItem);
itemAmount = destItemInfo.totalCount;
}
if (itemAmount < itemToKeepAmount) {
int maxMultiple = ((sourceAmount + itemAmount) / itemToKeepAmount) * itemToKeepAmount;
if (transferMode == TransferMode.KEEP_MULTIPLE && itemAmount < maxMultiple) {
sourceInfo.totalCount = maxMultiple - itemAmount;
} else if (itemAmount < itemToKeepAmount) {
sourceInfo.totalCount = itemToKeepAmount - itemAmount;
} else {
iterator.remove();
Expand Down Expand Up @@ -156,6 +165,13 @@ public void clearBuffer() {
//////////////////////////////////////
// *********** GUI ***********//

@Override
public ModularPanel<?> buildUI(SidedPosGuiData data, PanelSyncManager syncManager, UISettings settings) {
return super.buildUI(data, syncManager, settings)
.height(192 + 18 + 20)
.width(176 + 20);
}

@Override
public void createCoverUIRows(Flow column, SidedPosGuiData data, PanelSyncManager syncManager,
UISettings settings) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ public enum TransferMode {

TRANSFER_ANY("transfer_any", 1),
TRANSFER_EXACT("transfer_exact", 1024),
KEEP_EXACT("keep_exact", 1024);
KEEP_EXACT("keep_exact", 1024),
TRANSFER_MULTIPLE("transfer_multiple", 1024),
KEEP_MULTIPLE("keep_multiple", 1024);

public static final TransferMode[] VALUES = values();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ interface IDs {
18, 18 * 2, 18, 18, ColorType.DEFAULT);

UITexture[] TRANSFER_MODE_OVERLAY = slice("textures/gui/overlay/transfer_mode_overlay.png",
40, 40 * 3, 40, 40, ColorType.DEFAULT);
40, 40 * 5, 40, 40, ColorType.DEFAULT);

UITexture[] BUTTON_DISTINCT = slice(
"textures/gui/widget/button_distinct_buses.png",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.gregtechceu.gtceu.common.cover.data.FilterMode;
import com.gregtechceu.gtceu.common.cover.data.ManualIOMode;
import com.gregtechceu.gtceu.common.cover.data.TransferMode;
import com.gregtechceu.gtceu.data.lang.LangHandler;

import net.minecraft.network.chat.Component;

Expand Down Expand Up @@ -65,12 +66,8 @@ public static void addFilterModeRow(Flow column, EnumSyncValue<FilterMode> value
}

public static void addTransferModeRow(Flow column, EnumSyncValue<TransferMode> value) {
Component[] transferModeDesc = {
Component.translatable("cover.robotic_arm.transfer_mode.description.0"),
Component.translatable("cover.robotic_arm.transfer_mode.description.1"),
Component.translatable("cover.robotic_arm.transfer_mode.description.2"),
Component.translatable("cover.robotic_arm.transfer_mode.description.3"),
};
Component[] transferModeDesc = LangHandler.getMultiLang("cover.robotic_arm.transfer_mode.description")
.toArray(new Component[0]);
column.child(new GTMuiWidgets.EnumRowBuilder<>(TransferMode.class)
.value(value)
.buttonTooltipSupplier((v) -> () -> Component.translatable(v.getTooltip()))
Expand Down
15 changes: 11 additions & 4 deletions src/main/java/com/gregtechceu/gtceu/data/lang/LangHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -503,11 +503,18 @@ public static void init(RegistrateLangProvider provider) {
multiLang(provider, "cover.conveyor.tag.title", "Tag Name",
"(use * for wildcard)");
provider.add("cover.robotic_arm.transfer_mode.title", "Transfer Mode");
provider.add("cover.robotic_arm.transfer_mode.transfer_any", "Transfer Any");
provider.add("cover.robotic_arm.transfer_mode.transfer_exact", "Supply Exact");
provider.add("cover.robotic_arm.transfer_mode.keep_exact", "Keep Exact");
provider.add("cover.robotic_arm.transfer_mode.transfer_any",
"§eTransfer Any§r - in this mode, cover will transfer as many items matching its filter as possible.");
provider.add("cover.robotic_arm.transfer_mode.transfer_exact",
"§eSupply Exact§r - in this mode, cover will supply items in portions specified in item filter slots (or variable under this button for tag filter). If amount of items is less than portion size, items won't be moved.");
provider.add("cover.robotic_arm.transfer_mode.keep_exact",
"§eKeep Exact§r - in this mode, cover will keep specified amount of items in the destination inventory, supplying additional amount of items if required.");
provider.add("cover.robotic_arm.transfer_mode.transfer_multiple",
"§eTransfer Multiple§r - like supply exact, but can transfer a multiple of the specified amount in 1 operation (i.e. if the amount is 5, and there are 32 items in the input, 30 will be transferred).");
provider.add("cover.robotic_arm.transfer_mode.keep_multiple",
"§eKeep Multiple§r - in this mode, the cover will transfer as many items as possible, such that the output will have a multiple of the specified amount of items.");
multilineLang(provider, "cover.robotic_arm.transfer_mode.description",
eTransfer Any§r - in this mode, cover will transfer as many items matching its filter as possible.\n§eSupply Exact§r - in this mode, cover will supply items in portions specified in item filter slots (or variable under this button for tag filter). If amount of items is less than portion size, items won't be moved.\n§eKeep Exact§r - in this mode, cover will keep specified amount of items in the destination inventory, supplying additional amount of items if required.\n§7Tip: left/right click on filter slots to change item amount, use shift clicking to change amount faster.");
"§7Tip: left/right click on filter slots to change item amount, use shift clicking to change amount faster.");
provider.add("cover.pump.title", "Pump Cover Settings (%s)");
provider.add("cover.pump.transfer_rate", "%s");
provider.add("cover.pump.mode.export", "Mode: Export");
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading