From 23aa243003032ea4beab38c45ba9ce1857fef540 Mon Sep 17 00:00:00 2001 From: kross <135918757+krossgg@users.noreply.github.com> Date: Sun, 12 Jan 2025 10:55:34 -0500 Subject: [PATCH] Change various Steam Bus elements (#2722) --- .../resources/assets/gtceu/lang/en_ud.json | 4 ++-- .../resources/assets/gtceu/lang/en_us.json | 4 ++-- .../gtceu/common/data/GTMachines.java | 18 +++++++++------- .../part/SteamItemBusPartMachine.java | 21 +++++++++++-------- 4 files changed, 26 insertions(+), 21 deletions(-) diff --git a/src/generated/resources/assets/gtceu/lang/en_ud.json b/src/generated/resources/assets/gtceu/lang/en_ud.json index b70755cbbd..701e9601ba 100644 --- a/src/generated/resources/assets/gtceu/lang/en_ud.json +++ b/src/generated/resources/assets/gtceu/lang/en_ud.json @@ -1085,12 +1085,12 @@ "block.gtceu.steam_casing_steel": "ןןnH ןǝǝʇS", "block.gtceu.steam_casing_steel.tooltip": "sǝuıɥɔɐW ɯɐǝʇS pǝʌoɹdɯı ɹoℲㄥ§", "block.gtceu.steam_grinder": "ɹǝpuıɹ⅁ ɯɐǝʇS", - "block.gtceu.steam_input_bus": ")ɯɐǝʇS( snᗺ ʇnduI", + "block.gtceu.steam_input_bus": "snᗺ ʇnduI ɯɐǝʇS", "block.gtceu.steam_input_hatch": "ɥɔʇɐH ʇnduI ɯɐǝʇS", "block.gtceu.steam_large_turbine": "ǝuıqɹn⟘ ɯɐǝʇS ǝbɹɐꞀ", "block.gtceu.steam_liquid_boiler.bronze": "ɹǝןıoᗺ pınbıꞀ ɯɐǝʇS ןןɐɯS", "block.gtceu.steam_machine_casing": "buısɐƆ ǝuıɥɔɐW ɯɐǝʇS", - "block.gtceu.steam_output_bus": ")ɯɐǝʇS( snᗺ ʇndʇnO", + "block.gtceu.steam_output_bus": "snᗺ ʇndʇnO ɯɐǝʇS", "block.gtceu.steam_oven": "uǝʌO ɯɐǝʇS", "block.gtceu.steam_solid_boiler.bronze": "ɹǝןıoᗺ pıןoS ɯɐǝʇS ןןɐɯS", "block.gtceu.steel_brick_casing": "buısɐƆ uoɹI ʇɥbnoɹM pǝʞɔıɹᗺ", diff --git a/src/generated/resources/assets/gtceu/lang/en_us.json b/src/generated/resources/assets/gtceu/lang/en_us.json index 59a1209eea..c345642d06 100644 --- a/src/generated/resources/assets/gtceu/lang/en_us.json +++ b/src/generated/resources/assets/gtceu/lang/en_us.json @@ -1085,12 +1085,12 @@ "block.gtceu.steam_casing_steel": "Steel Hull", "block.gtceu.steam_casing_steel.tooltip": "§7For improved Steam Machines", "block.gtceu.steam_grinder": "Steam Grinder", - "block.gtceu.steam_input_bus": "Input Bus (Steam)", + "block.gtceu.steam_input_bus": "Steam Input Bus", "block.gtceu.steam_input_hatch": "Steam Input Hatch", "block.gtceu.steam_large_turbine": "Large Steam Turbine", "block.gtceu.steam_liquid_boiler.bronze": "Small Steam Liquid Boiler", "block.gtceu.steam_machine_casing": "Steam Machine Casing", - "block.gtceu.steam_output_bus": "Output Bus (Steam)", + "block.gtceu.steam_output_bus": "Steam Output Bus", "block.gtceu.steam_oven": "Steam Oven", "block.gtceu.steam_solid_boiler.bronze": "Small Steam Solid Boiler", "block.gtceu.steel_brick_casing": "Bricked Wrought Iron Casing", diff --git a/src/main/java/com/gregtechceu/gtceu/common/data/GTMachines.java b/src/main/java/com/gregtechceu/gtceu/common/data/GTMachines.java index e4291c6076..3161fcb796 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/data/GTMachines.java +++ b/src/main/java/com/gregtechceu/gtceu/common/data/GTMachines.java @@ -649,9 +649,7 @@ public class GTMachines { (tier, builder) -> builder .langValue(VNF[tier] + " Input Bus") .rotationState(RotationState.ALL) - .abilities( - tier == 0 ? new PartAbility[] { PartAbility.IMPORT_ITEMS, PartAbility.STEAM_IMPORT_ITEMS } : - new PartAbility[] { PartAbility.IMPORT_ITEMS }) + .abilities(PartAbility.IMPORT_ITEMS) .overlayTieredHullRenderer("item_bus.import") .tooltips(Component.translatable("gtceu.machine.item_bus.import.tooltip"), Component.translatable("gtceu.universal.tooltip.item_storage_capacity", @@ -664,9 +662,7 @@ public class GTMachines { (tier, builder) -> builder .langValue(VNF[tier] + " Output Bus") .rotationState(RotationState.ALL) - .abilities( - tier == 0 ? new PartAbility[] { PartAbility.EXPORT_ITEMS, PartAbility.STEAM_EXPORT_ITEMS } : - new PartAbility[] { PartAbility.EXPORT_ITEMS }) + .abilities(PartAbility.EXPORT_ITEMS) .overlayTieredHullRenderer("item_bus.export") .tooltips(Component.translatable("gtceu.machine.item_bus.export.tooltip"), Component.translatable("gtceu.universal.tooltip.item_storage_capacity", @@ -868,7 +864,10 @@ public class GTMachines { .rotationState(RotationState.ALL) .abilities(PartAbility.STEAM_IMPORT_ITEMS) .overlaySteamHullRenderer("item_bus.import") - .langValue("Input Bus (Steam)") + .langValue("Steam Input Bus") + .tooltips(Component.translatable("gtceu.machine.item_bus.import.tooltip"), + Component.translatable("gtceu.machine.steam_bus.tooltip"), + Component.translatable("gtceu.universal.tooltip.item_storage_capacity", 4)) .register(); public static final MachineDefinition STEAM_EXPORT_BUS = REGISTRATE @@ -876,7 +875,10 @@ public class GTMachines { .rotationState(RotationState.ALL) .abilities(PartAbility.STEAM_EXPORT_ITEMS) .overlaySteamHullRenderer("item_bus.export") - .langValue("Output Bus (Steam)") + .langValue("Steam Output Bus") + .tooltips(Component.translatable("gtceu.machine.item_bus.export.tooltip"), + Component.translatable("gtceu.machine.steam_bus.tooltip"), + Component.translatable("gtceu.universal.tooltip.item_storage_capacity", 4)) .register(); public static final MachineDefinition STEAM_HATCH = REGISTRATE diff --git a/src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/part/SteamItemBusPartMachine.java b/src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/part/SteamItemBusPartMachine.java index 3df724829c..2d0c3316f6 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/part/SteamItemBusPartMachine.java +++ b/src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/part/SteamItemBusPartMachine.java @@ -17,8 +17,11 @@ public class SteamItemBusPartMachine extends ItemBusPartMachine { + private final String autoTooltipKey; + public SteamItemBusPartMachine(IMachineBlockEntity holder, IO io, Object... args) { super(holder, 1, io, args); + autoTooltipKey = io == IO.IN ? "gtceu.gui.item_auto_input.tooltip" : "gtceu.gui.item_auto_output.tooltip"; } @NotNull @@ -27,24 +30,24 @@ public ModularUI createUI(@NotNull Player entityPlayer) { int rowSize = (int) Math.sqrt(getInventorySize()); int xOffset = rowSize == 10 ? 9 : 0; var modular = new ModularUI(176 + xOffset * 2, - 18 + 18 * rowSize + 94, this, entityPlayer) + 18 + 18 * rowSize + 105, this, entityPlayer) .background(GuiTextures.BACKGROUND_STEAM.get(ConfigHolder.INSTANCE.machines.steelSteamMultiblocks)) .widget(new LabelWidget(10, 5, getBlockState().getBlock().getDescriptionId())) - .widget(new ToggleButtonWidget(2, 18 + 18 * rowSize + 12 - 20, 18, 18, - GuiTextures.BUTTON_ITEM_OUTPUT, this::isWorkingEnabled, this::setWorkingEnabled) // todo - // steamify? - .setShouldUseBaseBackground() - .setTooltipText("gtceu.gui.item_auto_input.tooltip")) + .widget(new ToggleButtonWidget(7 + xOffset, 18 + 18 * rowSize, 18, 18, + GuiTextures.BUTTON_ITEM_OUTPUT, this::isWorkingEnabled, this::setWorkingEnabled) + .setShouldUseBaseBackground() // TODO: Steamify background + .setTooltipText(autoTooltipKey)) .widget(UITemplate.bindPlayerInventory(entityPlayer.getInventory(), GuiTextures.SLOT_STEAM.get(ConfigHolder.INSTANCE.machines.steelSteamMultiblocks), - 7 + xOffset, 18 + 18 * rowSize + 12, true)); + 7 + xOffset, 18 + 18 * rowSize + 24, true)); for (int y = 0; y < rowSize; y++) { for (int x = 0; x < rowSize; x++) { int index = y * rowSize + x; modular.widget(new SlotWidget(getInventory().storage, index, - (88 - rowSize * 9 + x * 18) + xOffset, 18 + y * 18, true, io.support(IO.IN)) - .setBackgroundTexture(GuiTextures.SLOT)); + (88 - rowSize * 9 + x * 18) + xOffset, 18 + y * 18 + 6, true, io.support(IO.IN)) + .setBackgroundTexture( + GuiTextures.SLOT_STEAM.get(ConfigHolder.INSTANCE.machines.steelSteamMultiblocks))); } }