add tooltips to filler and emerald transport pipe
This commit is contained in:
parent
6abc40ed48
commit
1e58f6f69e
5 changed files with 53 additions and 6 deletions
|
@ -472,6 +472,9 @@ tip.PipePowerWood=Power Input Pipe
|
||||||
tip.PipeStructureCobblestone=Support pipe
|
tip.PipeStructureCobblestone=Support pipe
|
||||||
tip.deprecated=Deprecated
|
tip.deprecated=Deprecated
|
||||||
|
|
||||||
|
tip.filler.excavate.on=Excavate
|
||||||
|
tip.filler.excavate.off=Do Not Excavate
|
||||||
|
|
||||||
tip.shift.PipeFluidsDiamond=GUI accepts any fluid containers
|
tip.shift.PipeFluidsDiamond=GUI accepts any fluid containers
|
||||||
tip.shift.PipeFluidsEmerald=GUI accepts any fluid container
|
tip.shift.PipeFluidsEmerald=GUI accepts any fluid container
|
||||||
tip.shift.PipeItemsClay=Prioritizes machines and chests\nover neighbouring pipes.
|
tip.shift.PipeItemsClay=Prioritizes machines and chests\nover neighbouring pipes.
|
||||||
|
@ -481,6 +484,9 @@ tip.shift.PipeItemsLapis=Sneak-click to change color
|
||||||
tip.shift.PipeItemsObsidian=Power with an engine\nMore power - greater distance
|
tip.shift.PipeItemsObsidian=Power with an engine\nMore power - greater distance
|
||||||
tip.shift.PipePowerIron=Change the limit with a wrench or gates
|
tip.shift.PipePowerIron=Change the limit with a wrench or gates
|
||||||
|
|
||||||
|
tip.PipeItemsEmerald.whitelist=Whitelist
|
||||||
|
tip.PipeItemsEmerald.blacklist=Blacklist
|
||||||
|
tip.PipeItemsEmerald.roundrobin=Round Robin (In Order)
|
||||||
|
|
||||||
tip.tool.add=Add
|
tip.tool.add=Add
|
||||||
tip.tool.fullscreen=Fullscreen
|
tip.tool.fullscreen=Fullscreen
|
||||||
|
|
|
@ -2,6 +2,10 @@ Additions:
|
||||||
|
|
||||||
* Excavation toggle in the Filler! Finally! (asie)
|
* Excavation toggle in the Filler! Finally! (asie)
|
||||||
|
|
||||||
|
Improvements:
|
||||||
|
|
||||||
|
* Tooltips in Emerald Transport Pipe (asie)
|
||||||
|
|
||||||
Bugs fixed:
|
Bugs fixed:
|
||||||
|
|
||||||
* Crash in rotateLeft (asie)
|
* Crash in rotateLeft (asie)
|
||||||
|
|
|
@ -13,6 +13,7 @@ import io.netty.buffer.ByteBuf;
|
||||||
import net.minecraft.client.gui.GuiButton;
|
import net.minecraft.client.gui.GuiButton;
|
||||||
import net.minecraft.inventory.IInventory;
|
import net.minecraft.inventory.IInventory;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
import net.minecraft.util.StatCollector;
|
||||||
|
|
||||||
import buildcraft.BuildCraftCore;
|
import buildcraft.BuildCraftCore;
|
||||||
import buildcraft.api.filler.FillerManager;
|
import buildcraft.api.filler.FillerManager;
|
||||||
|
@ -30,6 +31,8 @@ import buildcraft.core.lib.gui.buttons.ButtonTextureSet;
|
||||||
import buildcraft.core.lib.gui.buttons.GuiBetterButton;
|
import buildcraft.core.lib.gui.buttons.GuiBetterButton;
|
||||||
import buildcraft.core.lib.gui.buttons.IButtonTextureSet;
|
import buildcraft.core.lib.gui.buttons.IButtonTextureSet;
|
||||||
import buildcraft.core.lib.gui.buttons.StandardButtonTextureSets;
|
import buildcraft.core.lib.gui.buttons.StandardButtonTextureSets;
|
||||||
|
import buildcraft.core.lib.gui.tooltips.ToolTip;
|
||||||
|
import buildcraft.core.lib.gui.tooltips.ToolTipLine;
|
||||||
import buildcraft.core.lib.network.command.CommandWriter;
|
import buildcraft.core.lib.network.command.CommandWriter;
|
||||||
import buildcraft.core.lib.network.command.PacketCommand;
|
import buildcraft.core.lib.network.command.PacketCommand;
|
||||||
import buildcraft.core.lib.utils.StringUtils;
|
import buildcraft.core.lib.utils.StringUtils;
|
||||||
|
@ -82,6 +85,13 @@ public class GuiFiller extends GuiAdvancedInterface {
|
||||||
return filler.isExcavate() ? EXCAVATE_ON : EXCAVATE_OFF;
|
return filler.isExcavate() ? EXCAVATE_ON : EXCAVATE_OFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private GuiBetterButton getExcavateButton() {
|
||||||
|
return new GuiBetterButton(2, guiLeft + 150, guiTop + 30, 16, getExcavateTexture(), "")
|
||||||
|
.setToolTip(new ToolTip(500, new ToolTipLine(
|
||||||
|
StatCollector.translateToLocal("tip.filler.excavate." + (filler.isExcavate() ? "on" : "off"))
|
||||||
|
)));
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initGui() {
|
public void initGui() {
|
||||||
super.initGui();
|
super.initGui();
|
||||||
|
@ -91,8 +101,7 @@ public class GuiFiller extends GuiAdvancedInterface {
|
||||||
StandardButtonTextureSets.LEFT_BUTTON, ""));
|
StandardButtonTextureSets.LEFT_BUTTON, ""));
|
||||||
buttonList.add(new GuiBetterButton(1, guiLeft + 38 + 16 + 8, guiTop + 30, 10,
|
buttonList.add(new GuiBetterButton(1, guiLeft + 38 + 16 + 8, guiTop + 30, 10,
|
||||||
StandardButtonTextureSets.RIGHT_BUTTON, ""));
|
StandardButtonTextureSets.RIGHT_BUTTON, ""));
|
||||||
buttonList.add(new GuiBetterButton(2, guiLeft + 150, guiTop + 30, 16,
|
buttonList.add(getExcavateButton());
|
||||||
getExcavateTexture(), ""));
|
|
||||||
|
|
||||||
slots.clear();
|
slots.clear();
|
||||||
for (int i = 0; i < 4; i++) {
|
for (int i = 0; i < 4; i++) {
|
||||||
|
@ -111,8 +120,7 @@ public class GuiFiller extends GuiAdvancedInterface {
|
||||||
} else if (button.id == 2) {
|
} else if (button.id == 2) {
|
||||||
filler.setExcavate(!filler.isExcavate());
|
filler.setExcavate(!filler.isExcavate());
|
||||||
|
|
||||||
buttonList.set(2, new GuiBetterButton(2, guiLeft + 150, guiTop + 30, 16,
|
buttonList.set(2, getExcavateButton());
|
||||||
getExcavateTexture(), ""));
|
|
||||||
|
|
||||||
BuildCraftCore.instance.sendToServer(new PacketCommand(filler, "setFlags", new CommandWriter() {
|
BuildCraftCore.instance.sendToServer(new PacketCommand(filler, "setFlags", new CommandWriter() {
|
||||||
public void write(ByteBuf data) {
|
public void write(ByteBuf data) {
|
||||||
|
|
|
@ -19,10 +19,12 @@ import net.minecraft.util.ResourceLocation;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
|
import buildcraft.core.lib.gui.tooltips.IToolTipProvider;
|
||||||
|
import buildcraft.core.lib.gui.tooltips.ToolTip;
|
||||||
|
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public class GuiImageButton extends GuiButton implements IButtonClickEventTrigger {
|
public class GuiImageButton extends GuiButton implements IButtonClickEventTrigger, IToolTipProvider {
|
||||||
|
|
||||||
public enum ButtonImage {
|
public enum ButtonImage {
|
||||||
BLANK(1, 19),
|
BLANK(1, 19),
|
||||||
WHITE_LIST(19, 19),
|
WHITE_LIST(19, 19),
|
||||||
|
@ -52,6 +54,7 @@ public class GuiImageButton extends GuiButton implements IButtonClickEventTrigge
|
||||||
private ArrayList<IButtonClickEventListener> listeners = new ArrayList<IButtonClickEventListener>();
|
private ArrayList<IButtonClickEventListener> listeners = new ArrayList<IButtonClickEventListener>();
|
||||||
private ButtonImage image = ButtonImage.BLANK;
|
private ButtonImage image = ButtonImage.BLANK;
|
||||||
private boolean active = false;
|
private boolean active = false;
|
||||||
|
private ToolTip toolTip;
|
||||||
|
|
||||||
public GuiImageButton(int id, int x, int y, ButtonImage image) {
|
public GuiImageButton(int id, int x, int y, ButtonImage image) {
|
||||||
super(id, x, y, SIZE, SIZE, "");
|
super(id, x, y, SIZE, SIZE, "");
|
||||||
|
@ -143,4 +146,24 @@ public class GuiImageButton extends GuiButton implements IButtonClickEventTrigge
|
||||||
private boolean isMouseOverButton(int mouseX, int mouseY) {
|
private boolean isMouseOverButton(int mouseX, int mouseY) {
|
||||||
return mouseX >= xPosition && mouseY >= yPosition && mouseX < xPosition + SIZE && mouseY < yPosition + SIZE;
|
return mouseX >= xPosition && mouseY >= yPosition && mouseX < xPosition + SIZE && mouseY < yPosition + SIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ToolTip getToolTip() {
|
||||||
|
return toolTip;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GuiImageButton setToolTip(ToolTip tips) {
|
||||||
|
this.toolTip = tips;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isToolTipVisible() {
|
||||||
|
return visible;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isMouseOver(int mouseX, int mouseY) {
|
||||||
|
return isMouseOverButton(mouseX, mouseY);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,11 +12,14 @@ import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
import net.minecraft.inventory.IInventory;
|
import net.minecraft.inventory.IInventory;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
import net.minecraft.util.StatCollector;
|
||||||
|
|
||||||
import buildcraft.core.lib.gui.GuiBuildCraft;
|
import buildcraft.core.lib.gui.GuiBuildCraft;
|
||||||
import buildcraft.core.lib.gui.buttons.GuiImageButton;
|
import buildcraft.core.lib.gui.buttons.GuiImageButton;
|
||||||
import buildcraft.core.lib.gui.buttons.IButtonClickEventListener;
|
import buildcraft.core.lib.gui.buttons.IButtonClickEventListener;
|
||||||
import buildcraft.core.lib.gui.buttons.IButtonClickEventTrigger;
|
import buildcraft.core.lib.gui.buttons.IButtonClickEventTrigger;
|
||||||
|
import buildcraft.core.lib.gui.tooltips.ToolTip;
|
||||||
|
import buildcraft.core.lib.gui.tooltips.ToolTipLine;
|
||||||
import buildcraft.core.lib.network.PacketGuiReturn;
|
import buildcraft.core.lib.network.PacketGuiReturn;
|
||||||
import buildcraft.core.lib.utils.StringUtils;
|
import buildcraft.core.lib.utils.StringUtils;
|
||||||
import buildcraft.transport.pipes.PipeItemsEmerald;
|
import buildcraft.transport.pipes.PipeItemsEmerald;
|
||||||
|
@ -53,14 +56,17 @@ public class GuiEmeraldPipe extends GuiBuildCraft implements IButtonClickEventLi
|
||||||
|
|
||||||
this.whiteListButton = new GuiImageButton(WHITE_LIST_BUTTON_ID, this.guiLeft + 7, this.guiTop + 41, GuiImageButton.ButtonImage.WHITE_LIST);
|
this.whiteListButton = new GuiImageButton(WHITE_LIST_BUTTON_ID, this.guiLeft + 7, this.guiTop + 41, GuiImageButton.ButtonImage.WHITE_LIST);
|
||||||
this.whiteListButton.registerListener(this);
|
this.whiteListButton.registerListener(this);
|
||||||
|
this.whiteListButton.setToolTip(new ToolTip(500, new ToolTipLine(StatCollector.translateToLocal("tip.PipeItemsEmerald.whitelist"))));
|
||||||
this.buttonList.add(this.whiteListButton);
|
this.buttonList.add(this.whiteListButton);
|
||||||
|
|
||||||
this.blackListButton = new GuiImageButton(BLACK_LIST_BUTTON_ID, this.guiLeft + 7 + 18, this.guiTop + 41, GuiImageButton.ButtonImage.BLACK_LIST);
|
this.blackListButton = new GuiImageButton(BLACK_LIST_BUTTON_ID, this.guiLeft + 7 + 18, this.guiTop + 41, GuiImageButton.ButtonImage.BLACK_LIST);
|
||||||
this.blackListButton.registerListener(this);
|
this.blackListButton.registerListener(this);
|
||||||
|
this.blackListButton.setToolTip(new ToolTip(500, new ToolTipLine(StatCollector.translateToLocal("tip.PipeItemsEmerald.blacklist"))));
|
||||||
this.buttonList.add(this.blackListButton);
|
this.buttonList.add(this.blackListButton);
|
||||||
|
|
||||||
this.roundRobinButton = new GuiImageButton(ROUND_ROBIN_BUTTON_ID, this.guiLeft + 7 + 36, this.guiTop + 41, GuiImageButton.ButtonImage.ROUND_ROBIN);
|
this.roundRobinButton = new GuiImageButton(ROUND_ROBIN_BUTTON_ID, this.guiLeft + 7 + 36, this.guiTop + 41, GuiImageButton.ButtonImage.ROUND_ROBIN);
|
||||||
this.roundRobinButton.registerListener(this);
|
this.roundRobinButton.registerListener(this);
|
||||||
|
this.roundRobinButton.setToolTip(new ToolTip(500, new ToolTipLine(StatCollector.translateToLocal("tip.PipeItemsEmerald.roundrobin"))));
|
||||||
this.buttonList.add(this.roundRobinButton);
|
this.buttonList.add(this.roundRobinButton);
|
||||||
|
|
||||||
switch (pipe.getSettings().getFilterMode()) {
|
switch (pipe.getSettings().getFilterMode()) {
|
||||||
|
|
Loading…
Reference in a new issue