Skip to content

Commit

Permalink
add lang
Browse files Browse the repository at this point in the history
fix issue with ClickButtonWidget
  • Loading branch information
ghzdude committed Sep 12, 2024
1 parent 3fb52be commit 05b833e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 18 deletions.
2 changes: 0 additions & 2 deletions src/main/java/gregtech/api/gui/widgets/ClickButtonWidget.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import net.minecraft.item.ItemStack;
import net.minecraft.network.PacketBuffer;

import com.google.common.base.Preconditions;
import org.lwjgl.input.Mouse;

import java.util.Arrays;
Expand Down Expand Up @@ -64,7 +63,6 @@ public ClickButtonWidget setDisplayFunction(Supplier<Boolean> displayFunction) {
}

public ClickButtonWidget setTooltipText(String tooltipText, Object... args) {
Preconditions.checkNotNull(tooltipText, "tooltipText");
this.tooltipText = tooltipText;
this.tooltipArgs = args;
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import gregtech.api.gui.widgets.ClickButtonWidget;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.metatileentity.interfaces.IGregTechTileEntity;
import gregtech.api.util.GTLog;
import gregtech.api.util.GTUtility;
import gregtech.client.renderer.handler.BlockPosHighlightRenderer;
import gregtech.client.renderer.texture.Textures;
Expand Down Expand Up @@ -195,9 +194,8 @@ public void receiveCustomData(int dataId, PacketBuffer buf) {

if (this.connectedIcon != null) {
this.connectedIcon.setButtonTexture(GuiTextures.GREGTECH_LOGO);
String pos = String.format("X=%d, Z=%d, Y=%d", controllerPos.getX(), controllerPos.getZ(),
controllerPos.getY());
this.connectedIcon.setTooltipText("Connected to Quantum Controller at/n" + pos);
this.connectedIcon.setTooltipText("gregtech.machine.quantum_storage.connected",
controllerPos.getX(), controllerPos.getZ(), controllerPos.getY());
}
scheduleRenderUpdate();
} else if (dataId == GregtechDataCodes.REMOVE_CONTROLLER) {
Expand Down Expand Up @@ -234,23 +232,17 @@ public void readFromNBT(NBTTagCompound data) {
}

protected ClickButtonWidget createConnectedGui(int y) {
// todo do something for rendering a highlight at the controller
// todo look into BlockPosHighlightRenderer
// connectedIcon = new ImageWidget(151, y, 18, 18,
// isConnected() ? GuiTextures.GREGTECH_LOGO : GuiTextures.GREGTECH_LOGO_DARK);
connectedIcon = new ClickButtonWidget(151, y, 18, 18,
"", clickData -> {
GTLog.logger.warn("click");
connectedIcon = new ClickButtonWidget(151, y, 18, 18, "",
clickData -> {
writeCustomData(GregtechDataCodes.LOCATE_CONTROLLER, buffer -> {
buffer.writeBoolean(this.isConnected());
});
});
connectedIcon.setButtonTexture(isConnected() ? GuiTextures.GREGTECH_LOGO : GuiTextures.GREGTECH_LOGO_DARK);

if (isConnected()) {
String pos = String.format("X=%d, Z=%d, Y=%d", controllerPos.getX(), controllerPos.getZ(),
controllerPos.getY());
connectedIcon.setTooltipText("Connected to Quantum Controller at/n" + pos);
connectedIcon.setTooltipText("gregtech.machine.quantum_storage.connected",
controllerPos.getX(), controllerPos.getZ(), controllerPos.getY());
}

return connectedIcon;
Expand Down
3 changes: 1 addition & 2 deletions src/main/resources/assets/gregtech/lang/en_us.lang
Original file line number Diff line number Diff line change
Expand Up @@ -4378,8 +4378,7 @@ gregtech.machine.quantum_storage_proxy.name=Quantum Storage Proxy
gregtech.machine.quantum_storage_proxy.tooltip=Proxies the Quantum Storage Network's inventory
gregtech.machine.quantum_storage_extender.name=Quantum Storage Extender
gregtech.machine.quantum_storage_extender.tooltip=Extends the Quantum Storage Network to other chests/tanks
gregtech.machine.quantum_energy_acceptor.name=Quantum Energy Acceptor
gregtech.machine.quantum_energy_acceptor.tooltip=Provides EU to the Quantum Storage Network
gregtech.machine.quantum_storage.connected=Connected to Quantum Controller at [%d, %d, %d]/n/nClick to highlight the controller

#Buffers
gregtech.machine.buffer.tooltip=A Small Buffer to store Items and Fluids
Expand Down

0 comments on commit 05b833e

Please sign in to comment.