use of net.geforcemods.securitycraft.gui.components.GuiSlider in project SecurityCraft by Geforce132.
the class GuiCustomizeBlock method initGui.
@Override
public void initGui() {
super.initGui();
for (int i = 0; i < tileEntity.getNumberOfCustomizableOptions(); i++) {
descriptionButtons[i] = new GuiItemButton(i, guiLeft + 130, (guiTop + 10) + (i * 25), 20, 20, "", itemRender, new ItemStack(tileEntity.acceptedModules()[i].getItem()));
buttonList.add(descriptionButtons[i]);
hoverCheckers[i] = new HoverChecker(descriptionButtons[i], 20);
}
if (tileEntity.customOptions() != null)
for (int i = 0; i < tileEntity.customOptions().length; i++) {
Option option = tileEntity.customOptions()[i];
if (option instanceof OptionDouble && ((OptionDouble) option).isSlider()) {
optionButtons[i] = new GuiSlider((StatCollector.translateToLocal("option." + blockName + "." + option.getName()) + " ").replace("#", option.toString()), blockName, i, guiLeft + 178, (guiTop + 10) + (i * 25), 120, 20, "", "", (Double) option.getMin(), (Double) option.getMax(), (Double) option.getValue(), true, true, (OptionDouble) option);
optionButtons[i].packedFGColour = 14737632;
} else {
optionButtons[i] = new GuiButton(i, guiLeft + 178, (guiTop + 10) + (i * 25), 120, 20, getOptionButtonTitle(option));
optionButtons[i].packedFGColour = option.toString().matches(option.getDefaultValue().toString()) ? 16777120 : 14737632;
}
buttonList.add(optionButtons[i]);
hoverCheckers[i + tileEntity.getNumberOfCustomizableOptions()] = new HoverChecker(optionButtons[i], 20);
}
}
Aggregations