Search in sources :

Example 1 with ModuleWindow

use of org.bleachhack.gui.clickgui.window.ModuleWindow in project BleachHack by BleachDrinker420.

the class UIClickGuiScreen method init.

public void init() {
    super.init();
    uiContainer.windows.values().forEach(this::addWindow);
    clearWindows();
    addWindow(new ModuleWindow(List.of(ModuleManager.getModule(UI.class)), 200, 200, 75, "Render", new ItemStack(Items.YELLOW_STAINED_GLASS)));
}
Also used : UI(org.bleachhack.module.mods.UI) ModuleWindow(org.bleachhack.gui.clickgui.window.ModuleWindow) ItemStack(net.minecraft.item.ItemStack)

Example 2 with ModuleWindow

use of org.bleachhack.gui.clickgui.window.ModuleWindow in project BleachHack by BleachDrinker420.

the class ModuleClickGuiScreen method initWindows.

public void initWindows() {
    int len = ModuleManager.getModule(ClickGui.class).getSetting(0).asSlider().getValueInt();
    int y = 50;
    for (ModuleCategory c : ModuleCategory.values()) {
        addWindow(new ModuleWindow(ModuleManager.getModulesInCat(c), 30, y, len, StringUtils.capitalize(c.name().toLowerCase()), c.getItem()));
        y += 16;
    }
    for (Window w : getWindows()) {
        if (w instanceof ClickGuiWindow) {
            ((ClickGuiWindow) w).hiding = true;
        }
    }
}
Also used : ModuleWindow(org.bleachhack.gui.clickgui.window.ModuleWindow) ClickGuiWindow(org.bleachhack.gui.clickgui.window.ClickGuiWindow) Window(org.bleachhack.gui.window.Window) ClickGui(org.bleachhack.module.mods.ClickGui) ModuleCategory(org.bleachhack.module.ModuleCategory) ClickGuiWindow(org.bleachhack.gui.clickgui.window.ClickGuiWindow) ModuleWindow(org.bleachhack.gui.clickgui.window.ModuleWindow)

Example 3 with ModuleWindow

use of org.bleachhack.gui.clickgui.window.ModuleWindow in project BleachHack by BleachDrinker420.

the class ModuleClickGuiScreen method render.

public void render(MatrixStack matrices, int mouseX, int mouseY, float delta) {
    BleachFileHelper.SCHEDULE_SAVE_CLICKGUI.set(true);
    ClickGui clickGui = ModuleManager.getModule(ClickGui.class);
    searchField.visible = clickGui.getSetting(1).asToggle().getState();
    if (clickGui.getSetting(1).asToggle().getState()) {
        searchField.setSuggestion(searchField.getText().isEmpty() ? "Search here" : "");
        Set<Module> seachMods = new HashSet<>();
        if (!searchField.getText().isEmpty()) {
            for (Module m : ModuleManager.getModules()) {
                if (m.getName().toLowerCase(Locale.ENGLISH).contains(searchField.getText().toLowerCase(Locale.ENGLISH).replace(" ", ""))) {
                    seachMods.add(m);
                }
            }
        }
        for (Window w : getWindows()) {
            if (w instanceof ModuleWindow) {
                ((ModuleWindow) w).setSearchedModule(seachMods);
            }
        }
    }
    int len = clickGui.getSetting(0).asSlider().getValueInt();
    for (Window w : getWindows()) {
        if (w instanceof ModuleWindow) {
            ((ModuleWindow) w).setLen(len);
        }
    }
    super.render(matrices, mouseX, mouseY, delta);
    textRenderer.draw(matrices, "BleachHack-" + BleachHack.VERSION + "-" + SharedConstants.getGameVersion().getName(), 3, 3, 0x305090);
    textRenderer.draw(matrices, "BleachHack-" + BleachHack.VERSION + "-" + SharedConstants.getGameVersion().getName(), 2, 2, 0x6090d0);
    if (clickGui.getSetting(2).asToggle().getState()) {
        textRenderer.drawWithShadow(matrices, "Current prefix is: \"" + Command.getPrefix() + "\" (" + Command.getPrefix() + "help)", 2, height - 20, 0x99ff99);
        textRenderer.drawWithShadow(matrices, "Use " + Command.getPrefix() + "clickgui to reset the clickgui", 2, height - 10, 0x9999ff);
    }
}
Also used : ModuleWindow(org.bleachhack.gui.clickgui.window.ModuleWindow) ClickGuiWindow(org.bleachhack.gui.clickgui.window.ClickGuiWindow) Window(org.bleachhack.gui.window.Window) ClickGui(org.bleachhack.module.mods.ClickGui) ModuleWindow(org.bleachhack.gui.clickgui.window.ModuleWindow) Module(org.bleachhack.module.Module) HashSet(java.util.HashSet)

Aggregations

ModuleWindow (org.bleachhack.gui.clickgui.window.ModuleWindow)3 ClickGuiWindow (org.bleachhack.gui.clickgui.window.ClickGuiWindow)2 Window (org.bleachhack.gui.window.Window)2 ClickGui (org.bleachhack.module.mods.ClickGui)2 HashSet (java.util.HashSet)1 ItemStack (net.minecraft.item.ItemStack)1 Module (org.bleachhack.module.Module)1 ModuleCategory (org.bleachhack.module.ModuleCategory)1 UI (org.bleachhack.module.mods.UI)1