Search in sources :

Example 1 with GuiButtonIcon

use of cc.hyperium.gui.GuiButtonIcon in project Hyperium by HyperiumClient.

the class GeneralConfigGui method initGui.

@Override
public void initGui() {
    super.initGui();
    reg((edit = new GuiButtonIcon(1, new ResourceLocation("textures/chromahud/iconsheet.png"), 5, 0, 1, .4f)), button -> {
        // Open Gui for editing element
        if (currentElement != null) {
            Hyperium.INSTANCE.getHandlers().getGuiDisplayHandler().setDisplayNextTick(new DisplayElementConfig(currentElement, mod));
        }
    });
    ((GuiButtonIcon) edit).setOutline(true);
    reg(new GuiButton(2, 2, ResolutionUtil.current().getScaledHeight() - 22, 100, 20, "New"), (guiButton) -> {
        DisplayElement blank = DisplayElement.blank();
        ChromaHUDApi.getInstance().getElements().add(blank);
        Hyperium.INSTANCE.getHandlers().getGuiDisplayHandler().setDisplayNextTick(new DisplayElementConfig(blank, mod));
    });
    edit.visible = false;
}
Also used : GuiButton(net.minecraft.client.gui.GuiButton) GuiButtonIcon(cc.hyperium.gui.GuiButtonIcon) ResourceLocation(net.minecraft.util.ResourceLocation) DisplayElement(cc.hyperium.mods.chromahud.DisplayElement)

Aggregations

GuiButtonIcon (cc.hyperium.gui.GuiButtonIcon)1 DisplayElement (cc.hyperium.mods.chromahud.DisplayElement)1 GuiButton (net.minecraft.client.gui.GuiButton)1 ResourceLocation (net.minecraft.util.ResourceLocation)1