Search in sources :

Example 1 with ClickGui

use of org.bleachhack.module.mods.ClickGui 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

HashSet (java.util.HashSet)1 ClickGuiWindow (org.bleachhack.gui.clickgui.window.ClickGuiWindow)1 ModuleWindow (org.bleachhack.gui.clickgui.window.ModuleWindow)1 Window (org.bleachhack.gui.window.Window)1 Module (org.bleachhack.module.Module)1 ClickGui (org.bleachhack.module.mods.ClickGui)1