• Ищем качественного (не новичок) разработчиков Xenforo для этого форума! В идеале, чтобы ты был фулл стек программистом. Если у тебя есть что показать, то свяжись с нами по контактным данным: https://t.me/DREDD

Bind wexside clickgui

Начинающий
Начинающий
Статус
Оффлайн
Регистрация
16 Дек 2023
Сообщения
634
Реакции
9
1737914213732.png

хз нахер вам,пойдут в общем
кнопка visible нада допилить


Код:
Expand Collapse Copy
package dev.lumora.RenderClient.ClickGui;

import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.platform.GlStateManager;
import dev.lumora.EventSystem.core.IMinecraft;
import dev.lumora.LumoraClient;
import dev.lumora.RenderClient.ClickGui.api.component.Component;
import dev.lumora.RenderClient.ClickGui.component.ModuleComponent;
import dev.lumora.UtilsSystem.animation.extended.Animation;
import dev.lumora.UtilsSystem.client.KeyBindingStorage.KeyBindingStorage;
import dev.lumora.UtilsSystem.client.vector.Vec4i;
import dev.lumora.UtilsSystem.font.Fonts;
import dev.lumora.UtilsSystem.math.core.MathUtil;
import dev.lumora.UtilsSystem.render.ColorUtils;
import dev.lumora.UtilsSystem.render.DisplayUtils;
import org.lwjgl.glfw.GLFW;

public class BindModuleGui implements IMinecraft {
    public static BindModuleGui currentlyOpen = null;
    public Component component;
    public float x, y, width, height;
    public boolean openAnimation;
    public float animation;
    public boolean binding = false;
    float animationBoolean;

    public BindModuleGui(Component component) {
        this.component = component;
    }

    public void render(MatrixStack matrixStack) {
        animation = Animation.fast(animation, openAnimation ? 1 : 0, 20);
        animationBoolean = Animation.fast(animationBoolean, binding ? 1 : 0, 20);

        GlStateManager.pushMatrix();
        GlStateManager.translatef(x + width / 2f, y + height / 2f, 0);
        GlStateManager.scalef(animation, animation, 1);
        GlStateManager.translatef(-(x + width / 2f), -(y + height / 2f), 0);

        DisplayUtils.drawRoundedOutline(x, y, width, height, 4, 0.1f, ColorUtils.setAlpha(ColorUtils.rgb(25, 25, 35), (int) (255 * animation)), Vec4i.copy(ColorUtils.setAlpha(ColorUtils.rgb(45, 47, 60), (int) (255 * animation))));
        DisplayUtils.drawRoundedOutline(x + this.width - 21f, y + 22, 15.5f, 9, 4, 0.1f, ColorUtils.rgba(0, 0, 0, 0), Vec4i.copy(LumoraClient.getHandler().getThemeManager().getCurrent().getColor()));
        DisplayUtils.drawCircles(
                x + width - 16f + animationBoolean,
                y + 26.5f,
                0,
                360,
                2,
                1.0f,
                true,
                ColorUtils.setAlpha(ColorUtils.rgb(148, 148, 152), (int) (255 * animation)
                )
        );

        int bind = -1;
        if (component instanceof ModuleComponent m) {
            bind = m.module.bind;
        }

        Fonts.lumoraIcon[16].drawString(matrixStack, "J", x + 6, y + 9.5f, ColorUtils.setAlpha(-1, (int) (255 * animation)));
        Fonts.client[14].drawString(matrixStack, "Bind", x + Fonts.lumoraIcon[16].getWidth("J") + 10, y + 9, ColorUtils.setAlpha(-1, (int) (255 * animation)));

        Fonts.client[16].drawString(matrixStack, "Visible", x + 6, y + height / 2f - 2, ColorUtils.setAlpha(-1, (int) (255 * animation)));
        Fonts.client[16].drawString(matrixStack, "Bind", x + 6, y + height / 2f + 14, ColorUtils.setAlpha(-1, (int) (255 * animation)));

        String key;
        if (binding) {
            key = "...";
        } else {
            key = (bind == 0 || bind == -1) ? "None" : KeyBindingStorage.getKey(bind);
        }

        if (key == null || key.isEmpty()) {
            key = "None";
        }

        float width = Fonts.client[14].getWidth(key.toUpperCase()) + 10;
        DisplayUtils.drawRoundedOutline(x + this.width - 5 - width, y + height / 2f + 10, width, 25 / 2f, 2, 0.1f, ColorUtils.rgba(0, 0, 0, 0), Vec4i.copy(ColorUtils.setAlpha(ColorUtils.rgb(45, 47, 60), (int) (255 * animation))));
        Fonts.client[14].drawCenteredString(matrixStack, key.toUpperCase(), x + this.width - 5 - width / 2f, y + height / 2f + 15, -1);
        GlStateManager.popMatrix();
    }

    public void mouseClicked(int mouseX, int mouseY, int mouseButton) {
        int bind = -1;
        if (component instanceof ModuleComponent m) {
            bind = m.module.bind;
        }

        if (openAnimation) {
            if (currentlyOpen != null && currentlyOpen != this) {
                currentlyOpen.openAnimation = false;
            }

            currentlyOpen = this;

            String key = (bind == 0 || bind == -1) ? "None" : KeyBindingStorage.getKey(bind);

            if (key == null || key.isEmpty()) {
                key = "None";
            }

            float width = Fonts.client[14].getWidth(key.toUpperCase()) + 10;
            if (MathUtil.isHovered(mouseX, mouseY, this.x + this.width - 5 - width, this.y + height / 2f + 10, width, 25 / 2f) && mouseButton == 0) {
                binding = !binding;
            }

            if (binding && mouseButton > 2) {
                if (component instanceof ModuleComponent m) {
                    m.module.bind = -100 + mouseButton;
                }
                binding = false;
            }

            if (binding && mouseButton == 2) {
                if (component instanceof ModuleComponent m) {
                    m.module.bind = -98;
                }
                binding = false;
            }

            if (MathUtil.isHovered(mouseX, mouseY, this.x + this.width - 12 - 1f, this.y + 5 - 1f, 5, 5)) {
                openAnimation = false;
                currentlyOpen = null;
            }
        }
    }

    public void keyPressed(int key) {
        if (binding) {
            if (key == GLFW.GLFW_KEY_DELETE) {
                if (component instanceof ModuleComponent m) {
                    m.module.setBind(0);
                }

                binding = false;
                return;
            }

            if (component instanceof ModuleComponent m) {
                m.module.bind = key;
            }

            binding = false;
        }
    }
}


если у вас гуи аншента 3.1 то в рендер после всех методов выше mc.gameRenderer.setupOverlayClient(); пишем


Код:
Expand Collapse Copy
  for (Component object : objects) {
            if (object instanceof ModuleComponent moduleComponent) {
                ScissorUtil.enable();
                ScissorUtil.setFromComponentCoordinates(x, y + 35, width + 150, height - 45);
                moduleComponent.bindWindow.render(matrixStack);
                ScissorUtil.unset();
                ScissorUtil.disable();
            }
        }
 
не, rich 1.4
Посмотреть вложение 297074
хз нахер вам,пойдут в общем
кнопка visible нада допилить


Код:
Expand Collapse Copy
package dev.lumora.RenderClient.ClickGui;

import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.platform.GlStateManager;
import dev.lumora.EventSystem.core.IMinecraft;
import dev.lumora.LumoraClient;
import dev.lumora.RenderClient.ClickGui.api.component.Component;
import dev.lumora.RenderClient.ClickGui.component.ModuleComponent;
import dev.lumora.UtilsSystem.animation.extended.Animation;
import dev.lumora.UtilsSystem.client.KeyBindingStorage.KeyBindingStorage;
import dev.lumora.UtilsSystem.client.vector.Vec4i;
import dev.lumora.UtilsSystem.font.Fonts;
import dev.lumora.UtilsSystem.math.core.MathUtil;
import dev.lumora.UtilsSystem.render.ColorUtils;
import dev.lumora.UtilsSystem.render.DisplayUtils;
import org.lwjgl.glfw.GLFW;

public class BindModuleGui implements IMinecraft {
    public static BindModuleGui currentlyOpen = null;
    public Component component;
    public float x, y, width, height;
    public boolean openAnimation;
    public float animation;
    public boolean binding = false;
    float animationBoolean;

    public BindModuleGui(Component component) {
        this.component = component;
    }

    public void render(MatrixStack matrixStack) {
        animation = Animation.fast(animation, openAnimation ? 1 : 0, 20);
        animationBoolean = Animation.fast(animationBoolean, binding ? 1 : 0, 20);

        GlStateManager.pushMatrix();
        GlStateManager.translatef(x + width / 2f, y + height / 2f, 0);
        GlStateManager.scalef(animation, animation, 1);
        GlStateManager.translatef(-(x + width / 2f), -(y + height / 2f), 0);

        DisplayUtils.drawRoundedOutline(x, y, width, height, 4, 0.1f, ColorUtils.setAlpha(ColorUtils.rgb(25, 25, 35), (int) (255 * animation)), Vec4i.copy(ColorUtils.setAlpha(ColorUtils.rgb(45, 47, 60), (int) (255 * animation))));
        DisplayUtils.drawRoundedOutline(x + this.width - 21f, y + 22, 15.5f, 9, 4, 0.1f, ColorUtils.rgba(0, 0, 0, 0), Vec4i.copy(LumoraClient.getHandler().getThemeManager().getCurrent().getColor()));
        DisplayUtils.drawCircles(
                x + width - 16f + animationBoolean,
                y + 26.5f,
                0,
                360,
                2,
                1.0f,
                true,
                ColorUtils.setAlpha(ColorUtils.rgb(148, 148, 152), (int) (255 * animation)
                )
        );

        int bind = -1;
        if (component instanceof ModuleComponent m) {
            bind = m.module.bind;
        }

        Fonts.lumoraIcon[16].drawString(matrixStack, "J", x + 6, y + 9.5f, ColorUtils.setAlpha(-1, (int) (255 * animation)));
        Fonts.client[14].drawString(matrixStack, "Bind", x + Fonts.lumoraIcon[16].getWidth("J") + 10, y + 9, ColorUtils.setAlpha(-1, (int) (255 * animation)));

        Fonts.client[16].drawString(matrixStack, "Visible", x + 6, y + height / 2f - 2, ColorUtils.setAlpha(-1, (int) (255 * animation)));
        Fonts.client[16].drawString(matrixStack, "Bind", x + 6, y + height / 2f + 14, ColorUtils.setAlpha(-1, (int) (255 * animation)));

        String key;
        if (binding) {
            key = "...";
        } else {
            key = (bind == 0 || bind == -1) ? "None" : KeyBindingStorage.getKey(bind);
        }

        if (key == null || key.isEmpty()) {
            key = "None";
        }

        float width = Fonts.client[14].getWidth(key.toUpperCase()) + 10;
        DisplayUtils.drawRoundedOutline(x + this.width - 5 - width, y + height / 2f + 10, width, 25 / 2f, 2, 0.1f, ColorUtils.rgba(0, 0, 0, 0), Vec4i.copy(ColorUtils.setAlpha(ColorUtils.rgb(45, 47, 60), (int) (255 * animation))));
        Fonts.client[14].drawCenteredString(matrixStack, key.toUpperCase(), x + this.width - 5 - width / 2f, y + height / 2f + 15, -1);
        GlStateManager.popMatrix();
    }

    public void mouseClicked(int mouseX, int mouseY, int mouseButton) {
        int bind = -1;
        if (component instanceof ModuleComponent m) {
            bind = m.module.bind;
        }

        if (openAnimation) {
            if (currentlyOpen != null && currentlyOpen != this) {
                currentlyOpen.openAnimation = false;
            }

            currentlyOpen = this;

            String key = (bind == 0 || bind == -1) ? "None" : KeyBindingStorage.getKey(bind);

            if (key == null || key.isEmpty()) {
                key = "None";
            }

            float width = Fonts.client[14].getWidth(key.toUpperCase()) + 10;
            if (MathUtil.isHovered(mouseX, mouseY, this.x + this.width - 5 - width, this.y + height / 2f + 10, width, 25 / 2f) && mouseButton == 0) {
                binding = !binding;
            }

            if (binding && mouseButton > 2) {
                if (component instanceof ModuleComponent m) {
                    m.module.bind = -100 + mouseButton;
                }
                binding = false;
            }

            if (binding && mouseButton == 2) {
                if (component instanceof ModuleComponent m) {
                    m.module.bind = -98;
                }
                binding = false;
            }

            if (MathUtil.isHovered(mouseX, mouseY, this.x + this.width - 12 - 1f, this.y + 5 - 1f, 5, 5)) {
                openAnimation = false;
                currentlyOpen = null;
            }
        }
    }

    public void keyPressed(int key) {
        if (binding) {
            if (key == GLFW.GLFW_KEY_DELETE) {
                if (component instanceof ModuleComponent m) {
                    m.module.setBind(0);
                }

                binding = false;
                return;
            }

            if (component instanceof ModuleComponent m) {
                m.module.bind = key;
            }

            binding = false;
        }
    }
}


если у вас гуи аншента 3.1 то в рендер после всех методов выше mc.gameRenderer.setupOverlayClient(); пишем


Код:
Expand Collapse Copy
  for (Component object : objects) {
            if (object instanceof ModuleComponent moduleComponent) {
                ScissorUtil.enable();
                ScissorUtil.setFromComponentCoordinates(x, y + 35, width + 150, height - 45);
                moduleComponent.bindWindow.render(matrixStack);
                ScissorUtil.unset();
                ScissorUtil.disable();
            }
        }
ну нармас шо
 
Скинь гуи
 
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Назад
Сверху Снизу