use of com.simibubi.create.foundation.gui.widget.IconButton in project Create by Creators-of-Create.
the class SchematicannonScreen method handleTooltips.
protected void handleTooltips() {
if (placementSettingsHidden())
return;
for (AbstractWidget w : placementSettingWidgets) if (w instanceof IconButton) {
IconButton button = (IconButton) w;
if (!button.getToolTip().isEmpty()) {
button.setToolTip(button.getToolTip().get(0));
button.getToolTip().add(TooltipHelper.holdShift(Palette.Blue, hasShiftDown()));
}
}
if (hasShiftDown()) {
fillToolTip(skipMissingButton, skipMissingIndicator, "skipMissing");
fillToolTip(skipTilesButton, skipTilesIndicator, "skipTileEntities");
fillToolTip(replaceLevelButtons.get(0), replaceLevelIndicators.get(0), "dontReplaceSolid");
fillToolTip(replaceLevelButtons.get(1), replaceLevelIndicators.get(1), "replaceWithSolid");
fillToolTip(replaceLevelButtons.get(2), replaceLevelIndicators.get(2), "replaceWithAny");
fillToolTip(replaceLevelButtons.get(3), replaceLevelIndicators.get(3), "replaceWithEmpty");
}
}
use of com.simibubi.create.foundation.gui.widget.IconButton in project Create by Creators-of-Create.
the class AbstractFilterScreen method handleTooltips.
protected void handleTooltips() {
List<IconButton> tooltipButtons = getTooltipButtons();
for (IconButton button : tooltipButtons) {
if (!button.getToolTip().isEmpty()) {
button.setToolTip(button.getToolTip().get(0));
button.getToolTip().add(TooltipHelper.holdShift(Palette.Yellow, hasShiftDown()));
}
}
if (hasShiftDown()) {
List<MutableComponent> tooltipDescriptions = getTooltipDescriptions();
for (int i = 0; i < tooltipButtons.size(); i++) fillToolTip(tooltipButtons.get(i), tooltipDescriptions.get(i));
}
}
use of com.simibubi.create.foundation.gui.widget.IconButton in project Create by Creators-of-Create.
the class FilterScreen method init.
@Override
protected void init() {
setWindowOffset(-11, 5);
super.init();
int x = leftPos;
int y = topPos;
blacklist = new IconButton(x + 18, y + 73, AllIcons.I_BLACKLIST);
blacklist.withCallback(() -> {
menu.blacklist = true;
sendOptionUpdate(Option.BLACKLIST);
});
blacklist.setToolTip(denyN);
whitelist = new IconButton(x + 36, y + 73, AllIcons.I_WHITELIST);
whitelist.withCallback(() -> {
menu.blacklist = false;
sendOptionUpdate(Option.WHITELIST);
});
whitelist.setToolTip(allowN);
blacklistIndicator = new Indicator(x + 18, y + 67, TextComponent.EMPTY);
whitelistIndicator = new Indicator(x + 36, y + 67, TextComponent.EMPTY);
addRenderableWidgets(blacklist, whitelist, blacklistIndicator, whitelistIndicator);
respectNBT = new IconButton(x + 60, y + 73, AllIcons.I_RESPECT_NBT);
respectNBT.withCallback(() -> {
menu.respectNBT = true;
sendOptionUpdate(Option.RESPECT_DATA);
});
respectNBT.setToolTip(respectDataN);
ignoreNBT = new IconButton(x + 78, y + 73, AllIcons.I_IGNORE_NBT);
ignoreNBT.withCallback(() -> {
menu.respectNBT = false;
sendOptionUpdate(Option.IGNORE_DATA);
});
ignoreNBT.setToolTip(ignoreDataN);
respectNBTIndicator = new Indicator(x + 60, y + 67, TextComponent.EMPTY);
ignoreNBTIndicator = new Indicator(x + 78, y + 67, TextComponent.EMPTY);
addRenderableWidgets(respectNBT, ignoreNBT, respectNBTIndicator, ignoreNBTIndicator);
handleIndicators();
}
use of com.simibubi.create.foundation.gui.widget.IconButton in project Create by Creators-of-Create.
the class SequencedGearshiftScreen method init.
@Override
protected void init() {
setWindowSize(background.width, background.height);
setWindowOffset(-20, 0);
super.init();
int x = guiLeft;
int y = guiTop;
inputs = new Vector<>(5);
for (int row = 0; row < inputs.capacity(); row++) inputs.add(new Vector<>(3));
for (int row = 0; row < instructions.size(); row++) initInputsOfRow(row, x, y);
confirmButton = new IconButton(x + background.width - 33, y + background.height - 24, AllIcons.I_CONFIRM);
confirmButton.withCallback(() -> {
onClose();
});
addRenderableWidget(confirmButton);
}
use of com.simibubi.create.foundation.gui.widget.IconButton in project Create by Creators-of-Create.
the class ZapperScreen method init.
@Override
protected void init() {
setWindowSize(background.width, background.height);
setWindowOffset(-10, 0);
super.init();
animationProgress = 0;
int x = guiLeft;
int y = guiTop;
confirmButton = new IconButton(x + background.width - 33, y + background.height - 24, AllIcons.I_CONFIRM);
confirmButton.withCallback(() -> {
onClose();
});
addRenderableWidget(confirmButton);
patternButtons.clear();
for (int row = 0; row <= 1; row++) {
for (int col = 0; col <= 2; col++) {
int id = patternButtons.size();
PlacementPatterns pattern = PlacementPatterns.values()[id];
IconButton patternButton = new IconButton(x + background.width - 76 + col * 18, y + 21 + row * 18, pattern.icon);
patternButton.withCallback(() -> {
patternButtons.forEach(b -> b.active = true);
patternButton.active = false;
currentPattern = pattern;
});
patternButton.setToolTip(Lang.translate("gui.terrainzapper.pattern." + pattern.translationKey));
patternButtons.add(patternButton);
}
}
patternButtons.get(currentPattern.ordinal()).active = false;
addRenderableWidgets(patternButtons);
}
Aggregations