Search in sources :

Example 1 with WindowWidget

use of org.bleachhack.gui.window.widget.WindowWidget in project BleachHack by BleachDrinker420.

the class BleachCreditsScreen method render.

public void render(MatrixStack matrices, int mouseX, int mouseY, float delta) {
    this.renderBackground(matrices);
    if (!boostersLoaded && boosterList != null) {
        int scroll = scrollbar.getPageOffset();
        init();
        scrollbar.setPageOffset(scroll);
    }
    int offset = scrollbar.getOffsetSinceRender();
    for (WindowWidget widget : getWindow(0).getWidgets()) {
        if (!(widget instanceof WindowScrollbarWidget)) {
            widget.y1 -= offset;
            widget.y2 -= offset;
        }
    }
    super.render(matrices, mouseX, mouseY, delta);
}
Also used : WindowScrollbarWidget(org.bleachhack.gui.window.widget.WindowScrollbarWidget) WindowWidget(org.bleachhack.gui.window.widget.WindowWidget)

Example 2 with WindowWidget

use of org.bleachhack.gui.window.widget.WindowWidget in project BleachHack by BleachDrinker420.

the class BleachCreditsScreen method init.

public void init() {
    super.init();
    addWindow(new Window(width / 8, height / 8, width - width / 8, height - height / 8, "Credits", new ItemStack(Items.DRAGON_HEAD)));
    int w = getWindow(0).x2 - getWindow(0).x1;
    int h = getWindow(0).y2 - getWindow(0).y1;
    getWindow(0).addWidget(new WindowTextWidget(BleachHack.watermark.getText(), true, WindowTextWidget.TextAlign.MIDDLE, 3f, w / 2, 22, 0xb0b0b0));
    getWindow(0).addWidget(new WindowTextWidget(BleachHack.VERSION, true, WindowTextWidget.TextAlign.MIDDLE, 1.5f, w / 2, 41, 0xffc050));
    getWindow(0).addWidget(new WindowTextWidget("- Main Developer -", true, WindowTextWidget.TextAlign.MIDDLE, w / 2, 65, 0xe0e0e0));
    getWindow(0).addWidget(new WindowTextWidget(new LiteralText("Bleach").styled(s -> s.withHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new LiteralText("\u00a77https://github.com/BleachDrinker420\n\n\u00a7eMain Developer!")))), true, WindowTextWidget.TextAlign.MIDDLE, w / 2, 80, 0x51eff5));
    getWindow(0).addWidget(new WindowTextWidget("- Contributors -", true, WindowTextWidget.TextAlign.MIDDLE, w / 2, 100, 0xe0e0e0));
    getWindow(0).addWidget(new WindowTextWidget(new LiteralText("LasnikProgram").styled(s -> s.withHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new LiteralText("\u00a77https://github.com/lasnikprogram\n\n\u00a7fMade first version of LogoutSpot, AirPlace, EntityMenu, HoleESP, AutoParkour and Search.")))), true, WindowTextWidget.TextAlign.MIDDLE, w / 2, 115, 0x00a0a0));
    getWindow(0).addWidget(new WindowTextWidget(new LiteralText("slcoolj").styled(s -> s.withHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new LiteralText("\u00a77https://github.com/slcoolj\n\n\u00a7fMade Criticals, Speedmine OG mode and did the module system rewrite.")))), true, WindowTextWidget.TextAlign.MIDDLE, w / 2, 127, 0x00a0a0));
    getWindow(0).addWidget(new WindowTextWidget(new LiteralText("DevScyu").styled(s -> s.withHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new LiteralText("\u00a77https://github.com/DevScyu\n\n\u00a7fMade first version of AutoTool, Trajectories, NoRender, AutoWalk, ElytraReplace, HandProgress and added Login manager encryption.")))), true, WindowTextWidget.TextAlign.MIDDLE, w / 2, 139, 0x00a0a0));
    getWindow(0).addWidget(new WindowTextWidget(new LiteralText("Bunt3rhund").styled(s -> s.withHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new LiteralText("\u00a77https://github.com/Bunt3rhund\n\n\u00a7fMade first version of Zoom.")))), true, WindowTextWidget.TextAlign.MIDDLE, w / 2, 151, 0x00a0a0));
    getWindow(0).addWidget(new WindowTextWidget(new LiteralText("MorganAnkan").styled(s -> s.withHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new LiteralText("\u00a77https://github.com/MorganAnkan\n\n\u00a7fMade the title screen text Rgb.")))), true, WindowTextWidget.TextAlign.MIDDLE, w / 2, 163, 0x00a0a0));
    getWindow(0).addWidget(new WindowTextWidget(new LiteralText("ThePapanoob").styled(s -> s.withHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new LiteralText("\u00a77https://github.com/thepapanoob\n\n\u00a7fAdded Projectiles mode in Killaura.")))), true, WindowTextWidget.TextAlign.MIDDLE, w / 2, 175, 0x00a0a0));
    getWindow(0).addWidget(new WindowTextWidget("- Donators/Boosters -", true, WindowTextWidget.TextAlign.MIDDLE, w / 2, 195, 0xe0e0e0));
    int y = 210;
    if (boosterList != null) {
        boostersLoaded = true;
        for (ImmutablePair<Boolean, String> i : boosterList) {
            getWindow(0).addWidget(new WindowTextWidget(getBoosterText(i), true, WindowTextWidget.TextAlign.MIDDLE, w / 2, y, 0));
            y += 12;
        }
    } else {
        getWindow(0).addWidget(new WindowTextWidget("\u00a77Loading..", true, WindowTextWidget.TextAlign.MIDDLE, w / 2, y, 0));
        y += 12;
    }
    for (WindowWidget widget : getWindow(0).getWidgets()) {
        if (!(widget instanceof WindowScrollbarWidget)) {
            widget.cullY = true;
        }
    }
    scrollbar = getWindow(0).addWidget(new WindowScrollbarWidget(w - 11, 12, y - 10, h - 13, 0));
}
Also used : Window(org.bleachhack.gui.window.Window) WindowScrollbarWidget(org.bleachhack.gui.window.widget.WindowScrollbarWidget) HoverEvent(net.minecraft.text.HoverEvent) WindowTextWidget(org.bleachhack.gui.window.widget.WindowTextWidget) ItemStack(net.minecraft.item.ItemStack) WindowWidget(org.bleachhack.gui.window.widget.WindowWidget) LiteralText(net.minecraft.text.LiteralText)

Example 3 with WindowWidget

use of org.bleachhack.gui.window.widget.WindowWidget in project BleachHack by BleachDrinker420.

the class BleachOptionsScreen method init.

@Override
public void init() {
    super.init();
    addWindow(new Window(width / 8, height / 8, width - width / 8, height - height / 8, "Options", new ItemStack(Items.REDSTONE)));
    int w = getWindow(0).x2 - getWindow(0).x1;
    int h = getWindow(0).y2 - getWindow(0).y1;
    int y = 20;
    y = addCategory(0, w / 2, y, "General Settings", Option.GENERAL_CHECK_FOR_UPDATES, Option.GENERAL_SHOW_UPDATE_SCREEN);
    y = addCategory(0, w / 2, y + 15, "Playerlist Settings", Option.PLAYERLIST_SHOW_FRIENDS, Option.PLAYERLIST_SHOW_BH_USERS, Option.PLAYERLIST_SHOW_AS_BH_USER);
    y = addCategory(0, w / 2, y + 15, "Chat Settings", Option.CHAT_COMMAND_PREFIX, Option.CHAT_SHOW_SUGGESTIONS, Option.CHAT_QUICK_PREFIX);
    for (WindowWidget widget : getWindow(0).getWidgets()) {
        if (!(widget instanceof WindowScrollbarWidget)) {
            widget.cullY = true;
        }
    }
    scrollbar = getWindow(0).addWidget(new WindowScrollbarWidget(w - 11, 12, y - 7, h - 13, 0));
}
Also used : Window(org.bleachhack.gui.window.Window) WindowScrollbarWidget(org.bleachhack.gui.window.widget.WindowScrollbarWidget) ItemStack(net.minecraft.item.ItemStack) WindowWidget(org.bleachhack.gui.window.widget.WindowWidget)

Example 4 with WindowWidget

use of org.bleachhack.gui.window.widget.WindowWidget in project BleachHack by BleachDrinker420.

the class BleachOptionsScreen method render.

@Override
public void render(MatrixStack matrices, int mouseX, int mouseY, float delta) {
    this.renderBackground(matrices);
    int offset = scrollbar.getOffsetSinceRender();
    for (WindowWidget widget : getWindow(0).getWidgets()) {
        if (!(widget instanceof WindowScrollbarWidget)) {
            widget.y1 -= offset;
            widget.y2 -= offset;
        }
    }
    super.render(matrices, mouseX, mouseY, delta);
}
Also used : WindowScrollbarWidget(org.bleachhack.gui.window.widget.WindowScrollbarWidget) WindowWidget(org.bleachhack.gui.window.widget.WindowWidget)

Example 5 with WindowWidget

use of org.bleachhack.gui.window.widget.WindowWidget in project BleachHack by BleachDrinker420.

the class Window method mouseClicked.

public void mouseClicked(double mouseX, double mouseY, int button) {
    if (mouseX >= x1 && mouseX <= x2 - 2 && mouseY >= y1 && mouseY <= y1 + 11) {
        dragging = true;
        dragOffX = (int) mouseX - x1;
        dragOffY = (int) mouseY - y1;
    }
    if (selected) {
        try {
            for (WindowWidget w : widgets) {
                if (w.shouldRender(x1, y1, x2, y2)) {
                    w.mouseClicked(x1, y1, (int) mouseX, (int) mouseY, button);
                }
            }
        } catch (ConcurrentModificationException ignored) {
        }
    }
}
Also used : ConcurrentModificationException(java.util.ConcurrentModificationException) WindowWidget(org.bleachhack.gui.window.widget.WindowWidget)

Aggregations

WindowWidget (org.bleachhack.gui.window.widget.WindowWidget)7 WindowScrollbarWidget (org.bleachhack.gui.window.widget.WindowScrollbarWidget)4 ItemStack (net.minecraft.item.ItemStack)2 Window (org.bleachhack.gui.window.Window)2 ConcurrentModificationException (java.util.ConcurrentModificationException)1 TextRenderer (net.minecraft.client.font.TextRenderer)1 BlockItem (net.minecraft.item.BlockItem)1 HoverEvent (net.minecraft.text.HoverEvent)1 LiteralText (net.minecraft.text.LiteralText)1 WindowTextWidget (org.bleachhack.gui.window.widget.WindowTextWidget)1