Search in sources :

Example 1 with Category

use of me.earth.earthhack.api.module.util.Category in project 3arthh4ck by 3arthqu4ke.

the class Click method init.

public void init() {
    if (!attached) {
        CLICK_GUI.get().descriptionWidth.addObserver(e -> descriptionFrame.setWidth(e.getValue()));
        attached = true;
    }
    getFrames().clear();
    int x = CLICK_GUI.get().catEars.getValue() ? 14 : 2;
    int y = CLICK_GUI.get().catEars.getValue() ? 14 : 2;
    for (Category moduleCategory : Category.values()) {
        getFrames().add(new CategoryFrame(moduleCategory, x, y, 110, 16));
        if (x + 220 >= new ScaledResolution(Minecraft.getMinecraft()).getScaledWidth()) {
            x = CLICK_GUI.get().catEars.getValue() ? 14 : 2;
            y += CLICK_GUI.get().catEars.getValue() ? 32 : 20;
        } else
            x += (CLICK_GUI.get().catEars.getValue() ? 132 : 112);
    }
    descriptionFrame = new DescriptionFrame(x, y, CLICK_GUI.get().descriptionWidth.getValue(), 16);
    getFrames().add(descriptionFrame);
    getFrames().forEach(Frame::init);
    oldVal = CLICK_GUI.get().catEars.getValue();
}
Also used : ScaledResolution(net.minecraft.client.gui.ScaledResolution) DescriptionFrame(me.earth.earthhack.impl.gui.click.frame.impl.DescriptionFrame) Frame(me.earth.earthhack.impl.gui.click.frame.Frame) CategoryFrame(me.earth.earthhack.impl.gui.click.frame.impl.CategoryFrame) Category(me.earth.earthhack.api.module.util.Category) DescriptionFrame(me.earth.earthhack.impl.gui.click.frame.impl.DescriptionFrame) CategoryFrame(me.earth.earthhack.impl.gui.click.frame.impl.CategoryFrame)

Aggregations

Category (me.earth.earthhack.api.module.util.Category)1 Frame (me.earth.earthhack.impl.gui.click.frame.Frame)1 CategoryFrame (me.earth.earthhack.impl.gui.click.frame.impl.CategoryFrame)1 DescriptionFrame (me.earth.earthhack.impl.gui.click.frame.impl.DescriptionFrame)1 ScaledResolution (net.minecraft.client.gui.ScaledResolution)1