use of buildcraft.core.lib.gui.tooltips.ToolTipLine in project BuildCraft by BuildCraft.
the class GuiArchitectOld method initGui.
@SuppressWarnings("unchecked")
@Override
public void initGui() {
super.initGui();
Keyboard.enableRepeatEvents(true);
optionRotate = new GuiBetterButton(0, guiLeft + 5, guiTop + 30, 79, "");
buttonList.add(optionRotate);
optionExcavate = new GuiBetterButton(1, guiLeft + 5, guiTop + 55, 79, "");
buttonList.add(optionExcavate);
optionAllowCreative = new GuiBetterButton(2, guiLeft + 5, guiTop + 80, 79, "");
optionAllowCreative.setToolTip(new ToolTip(500, new ToolTipLine(LocaleUtil.localize("tile.architect.tooltip.allowCreative.1")), new ToolTipLine(LocaleUtil.localize("tile.architect.tooltip.allowCreative.2"))));
buttonList.add(optionAllowCreative);
textField = new GuiTextField(0, this.fontRendererObj, TEXT_X, TEXT_Y, TEXT_WIDTH, TEXT_HEIGHT);
textField.setMaxStringLength(DefaultProps.MAX_NAME_SIZE);
textField.setText(architect.name);
textField.setFocused(true);
updateButtons();
}
use of buildcraft.core.lib.gui.tooltips.ToolTipLine in project BuildCraft by BuildCraft.
the class GuiZonePlan method actionPerformed.
@Override
protected void actionPerformed(GuiButton button) {
if (button == tool) {
if (tool.displayString.equals("+")) {
tool.displayString = "-";
tool.getToolTip().remove(0);
tool.getToolTip().add(new ToolTipLine(LocaleUtil.localize("tip.tool.remove")));
} else {
tool.displayString = "+";
tool.getToolTip().remove(0);
tool.getToolTip().add(new ToolTipLine(LocaleUtil.localize("tip.tool.add")));
}
} else if (button == fsButton) {
toFullscreen();
}
}
use of buildcraft.core.lib.gui.tooltips.ToolTipLine in project BuildCraft by BuildCraft.
the class GuiBuildCraft method drawToolTips.
private void drawToolTips(ToolTip toolTips, int mouseX, int mouseY) {
if (toolTips.size() > 0) {
int left = this.guiLeft;
int top = this.guiTop;
int length = 0;
int x;
int y;
for (ToolTipLine tip : toolTips) {
y = this.fontRendererObj.getStringWidth(tip.text);
if (y > length) {
length = y;
}
}
x = mouseX - left + 12;
y = mouseY - top - 12;
int var14 = 8;
if (toolTips.size() > 1) {
var14 += 2 + (toolTips.size() - 1) * 10;
}
this.zLevel = 300.0F;
itemRender.zLevel = 300.0F;
int var15 = -267386864;
this.drawGradientRect(x - 3, y - 4, x + length + 3, y - 3, var15, var15);
this.drawGradientRect(x - 3, y + var14 + 3, x + length + 3, y + var14 + 4, var15, var15);
this.drawGradientRect(x - 3, y - 3, x + length + 3, y + var14 + 3, var15, var15);
this.drawGradientRect(x - 4, y - 3, x - 3, y + var14 + 3, var15, var15);
this.drawGradientRect(x + length + 3, y - 3, x + length + 4, y + var14 + 3, var15, var15);
int var16 = 1347420415;
int var17 = (var16 & 16711422) >> 1 | var16 & -16777216;
this.drawGradientRect(x - 3, y - 3 + 1, x - 3 + 1, y + var14 + 3 - 1, var16, var17);
this.drawGradientRect(x + length + 2, y - 3 + 1, x + length + 3, y + var14 + 3 - 1, var16, var17);
this.drawGradientRect(x - 3, y - 3, x + length + 3, y - 3 + 1, var16, var16);
this.drawGradientRect(x - 3, y + var14 + 2, x + length + 3, y + var14 + 3, var17, var17);
for (ToolTipLine tip : toolTips) {
String line = tip.text;
if (tip.color == -1) {
line = "\u00a77" + line;
} else {
line = "\u00a7" + Integer.toHexString(tip.color) + line;
}
this.fontRendererObj.drawStringWithShadow(line, x, y, -1);
y += 10 + tip.getSpacing();
}
this.zLevel = 0.0F;
itemRender.zLevel = 0.0F;
}
}
use of buildcraft.core.lib.gui.tooltips.ToolTipLine in project BuildCraft by BuildCraft.
the class GuiZonePlan method initGui.
@SuppressWarnings("unchecked")
@Override
public void initGui() {
super.initGui();
tool = new GuiBetterButton(0, guiLeft + 27, guiTop + 111, 15, StandardButtonTextureSets.SMALL_BUTTON, "+");
tool.setToolTip(new ToolTip(new ToolTipLine(LocaleUtil.localize("tip.tool.add"))));
buttonList.add(tool);
fsButton = new GuiBetterButton(1, guiLeft + 44, guiTop + 111, 20, StandardButtonTextureSets.SMALL_BUTTON, "FS");
fsButton.setToolTip(new ToolTip(new ToolTipLine(LocaleUtil.localize("tip.tool.fullscreen"))));
buttonList.add(fsButton);
savedButtonList = buttonList;
textField = new GuiTextField(1, this.fontRendererObj, 28, 129, 156, 12);
textField.setMaxStringLength(DefaultProps.MAX_NAME_SIZE);
textField.setText(zonePlan.mapName);
textField.setFocused(true);
}
Aggregations