Вопрос Как сделать иконки всем категориям ? Expensive

Начинающий
Статус
Оффлайн
Регистрация
24 Авг 2022
Сообщения
308
Реакции[?]
2
Поинты[?]
2K

Перед прочтением основного контента ниже, пожалуйста, обратите внимание на обновление внутри секции Майна на нашем форуме. У нас появились:

  • бесплатные читы для Майнкрафт — любое использование на свой страх и риск;
  • маркетплейс Майнкрафт — абсолютно любая коммерция, связанная с игрой, за исключением продажи читов (аккаунты, предоставления услуг, поиск кодеров читов и так далее);
  • приватные читы для Minecraft — в этом разделе только платные хаки для игры, покупайте группу "Продавец" и выставляйте на продажу свой софт;
  • обсуждения и гайды — всё тот же раздел с вопросами, но теперь модернизированный: поиск нужных хаков, пати с игроками-читерами и другая полезная информация.

Спасибо!

1689443715771.png
Помогите пожалуйста, как мне сделать чтобы эти иконки были по всем категориям ? Так же хотелось бы чтобы эти категории были с больших букв.
Заранее спасибо

Вот код:
CSGui:
package wtf.expensive.ui.csgo;

import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.MathHelper;
import org.lwjgl.input.Keyboard;
import org.lwjgl.input.Mouse;
import wtf.expensive.Expensive;
import wtf.expensive.modules.Type;
import wtf.expensive.modules.impl.render.ClickGuiModule;
import wtf.expensive.ui.csgo.elements.ModuleElement;
import wtf.expensive.ui.csgo.elements.StyleElement;
import wtf.expensive.utility.animations.Animation;
import wtf.expensive.utility.animations.Direction;
import wtf.expensive.utility.animations.impl.DecelerateAnimation;
import wtf.expensive.utility.animations.impl.EaseBackIn;
import wtf.expensive.utility.animations.impl.EaseInOutQuad;
import wtf.expensive.utility.font.Fonts;
import wtf.expensive.utility.math.AnimationMath;
import wtf.expensive.utility.math.HoveringMath;
import wtf.expensive.utility.render.GlowUtility;
import wtf.expensive.utility.render.RenderUtility;
import wtf.expensive.utility.shader.BloomUtil;
import wtf.expensive.utility.shader.GaussianBlur;
import wtf.expensive.utility.shader.StencilUtil;
import wtf.expensive.utility.shader.wtf.shader.RiseShaders;

import java.awt.*;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

public class CSGui extends GuiScreen {

    public float x, y;
    public List<StyleElement> styles = new ArrayList<>();
    public List<StyleElement> styles2 = new ArrayList<>();

    public CSGui() {
        ScaledResolution sr = new ScaledResolution(Minecraft.getMinecraft());
        x = sr.getScaledWidth() / 2 - width / 2 + 70;
        y = sr.getScaledHeight() / 2 - height / 2;
        Expensive.getInstance().getModuleManager().getModules().forEach(module -> {
            if (Expensive.getInstance().getModuleManager().getModules().indexOf(module) % 2 != 0) {
                elements.add(new ModuleElement(module));
            }
            if (Expensive.getInstance().getModuleManager().getModules().indexOf(module) % 2 == 0) {
                elements2.add(new ModuleElement(module));
            }
        });


        Expensive.getInstance().styleManager.styles.forEach(module -> {
            if (Expensive.getInstance().styleManager.styles.indexOf(module) % 2 == 0) {
                styles.add(new StyleElement(module));
            }
            if (Expensive.getInstance().styleManager.styles.indexOf(module) % 2 != 0) {
                styles2.add(new StyleElement(module));
            }
        });


    }

    public float animation;
    public float renderAnimation;

    public Type selected;

    public float scrollY = 10, scrollY2 = 10;

    @Override
    protected void mouseReleased(int mouseX, int mouseY, int state) {
        super.mouseReleased(mouseX, mouseY, state);
        if (selected == Type.THEME) {
            for (StyleElement style : styles) {
                style.mouseReleased(mouseX, mouseY, state);
            }
            for (StyleElement style : styles2) {
                style.mouseReleased(mouseX, mouseY, state);
            }
            dragging = false;
            return;
        }
        for (ModuleElement parameter : elements) {
            if (parameter.module.category != selected) {
                continue;
            }
            parameter.mouseReleased(mouseX, mouseY, state);
        }
        for (ModuleElement parameter : elements2) {
            if (parameter.module.category != selected) {
                continue;
            }
            parameter.mouseReleased(mouseX, mouseY, state);
        }
        dragging = false;
    }

    public List<ModuleElement> elements = new ArrayList<>();

    public List<ModuleElement> elements2 = new ArrayList<>();
    public int prevMouseX, prevMouseY;

    public Animation anim;
    float scale;
    public boolean close;

    @Override
    public void drawScreen(int mouseX, int mouseY, float partialTicks) {
        super.drawScreen(mouseX, mouseY, partialTicks);

        if (close) {

            boolean ok = anim.isDone();
            if (ClickGuiModule.guiAnimations.get()) {
                if (ok) {

                    mc.displayGuiScreen(null);
                    close = false;
                }
            } else {

                mc.displayGuiScreen(null);
                close = false;
            }

        }

        updateMouse(mouseX, mouseY);

        float width = 400;
        float height = 250;
        scale = (float) anim.getOutput();
        GlStateManager.pushMatrix();

        if (ClickGuiModule.guiAnimations.get()) {
            GlStateManager.translate(x + (width / 2), (y + height + 50) / 2, 0);
            GlStateManager.scale(scale, scale, 0);
            GlStateManager.translate(-(x + (width / 2)), -((y + height + 50) / 2), 0);
        }

        if (anim.isDone())
            GaussianBlur.renderBlur(50, () -> RiseShaders.RQ.draw(x, y - 20, width, 50, 7, new Color(21, 21, 25, 200)));
        RiseShaders.RQ.draw(x, y - 20, width, 50, 7, new Color(21, 21, 25, 200));
        Fonts.MONTSERRAT14.drawCenteredString("selfcodesss client", x + width / 2, y - 12.5, -1);
        StencilUtil.initStencilToWrite();
        RiseShaders.RQ.draw(x, y, width, height, 7, new Color(21, 21, 25, 255));
        StencilUtil.readStencilBuffer(1);
        RiseShaders.RQ.draw(x, y, width, height, 7, new Color(13, 13, 17, 255));
        RenderUtility.drawRect(x, y, 100, height, new Color(15, 15, 19, 255).getRGB());
        renderAnimation = AnimationMath.fast(renderAnimation, animation, 5f);
        animation = 1;
        animation = MathHelper.clamp(animation, 0, 1);

        float y = this.y;


        for (Type type : Type.values()) {

            float offset = 0;


            offset = 20;
            if (type == selected) {
//
                RiseShaders.RQ.draw(x + 4f, y + 9.5f + type.ordinal() * offset, 92, 15, 3, new Color(255, 255, 255, 25));
                RenderUtility.drawImage(new ResourceLocation("expensive/images/" + type.name().toLowerCase() + ".png"), x + 7 + 0, y + 11 + type.ordinal() * offset, 12, 12, Color.WHITE, renderAnimation);
            }


            Fonts.nunito14.drawString(type.name().toLowerCase(), x + 23f + (type == selected ? renderAnimation * 3 : -10), y + 15 + type.ordinal() * offset, -1);
        }

        drawingComponents(mouseX, mouseY);

        StencilUtil.uninitStencilBuffer();
        GlStateManager.popMatrix();

    }

    public void drawingComponents(int mouseX, int mouseY) {
        scrollY += Mouse.getDWheel() / 10f;
        float offset = scrollY;
        if (selected == Type.THEME) {
            for (StyleElement style : styles) {
                style.x = x + 110;
                style.y = AnimationMath.fast(style.y, y + offset, 15f);
                style.width = 135;
                style.height = 16;
                style.draw(mouseX, mouseY);
                offset += style.height + 4;
            }
            offset = scrollY;
            for (StyleElement style : styles2) {
                style.x = x + 255;
                style.y = AnimationMath.fast(style.y, y + offset, 15f);
                style.width = 135;
                style.height = 16;
                style.draw(mouseX, mouseY);
                offset += style.height + 4;
            }
            float offsetMax = 0;

            float offset1 = 10;
            for (StyleElement parameter : styles) {
                offset1 += parameter.height + 4;
            }

            float offset2 = 10;
            for (StyleElement parameter : styles2) {
                offset2 += parameter.height + 4;
            }
            offsetMax = Math.max(offset1, offset2);
            if (offsetMax > 300) {
                scrollY = MathHelper.clamp(scrollY, -offsetMax + 300, 10);
            } else
                scrollY = 10;
            return;
        }
        List<ModuleElement> e = this.elements.stream().filter(moduleElement -> moduleElement.module.category == selected).toList();
        for (ModuleElement parameter : e) {
            parameter.x = x + 110;
            parameter.y = AnimationMath.fast(parameter.y, y + offset, 15f);
            parameter.width = 135;
            if (parameter.extended) {
                for (Element element : parameter.elements) {
                    if (!element.isVisible()) continue;
                    offset += element.height;
                }
            }
            parameter.height = 16;
            parameter.draw(mouseX, mouseY);
            offset += parameter.height + 4;
        }
        List<ModuleElement> e2 = this.elements2.stream().filter(moduleElement -> moduleElement.module.category == selected).toList();
        offset = scrollY;
        for (ModuleElement parameter : e2) {
            parameter.x = x + 255;
            parameter.y = AnimationMath.fast(parameter.y, y + offset, 15f);
            parameter.width = 135;
            if (parameter.extended) {
                for (Element element : parameter.elements) {
                    if (!element.isVisible()) continue;
                    offset += element.height;
                }
            }
            parameter.height = 16;
            parameter.draw(mouseX, mouseY);
            offset += parameter.height + 4;
        }

        float offsetMax = 0;

        float offset1 = 10;
        for (ModuleElement parameter : elements) {
            if (parameter.module.category != selected) {
                continue;
            }
            if (parameter.extended) {
                for (Element element : parameter.elements) {
                    offset1 += element.height;
                }
            }
            offset1 += parameter.height + 4;
        }

        float offset2 = 10;
        for (ModuleElement parameter : elements2) {
            if (parameter.module.category != selected) {
                continue;
            }
            if (parameter.extended) {
                for (Element element : parameter.elements) {
                    offset2 += element.height;
                }
            }
            offset2 += parameter.height + 4;
        }
        offsetMax = Math.max(offset1, offset2);
        if (offsetMax > 300) {
            scrollY = MathHelper.clamp(scrollY, -offsetMax + 300, 10);
        } else
            scrollY = 10;


    }

    @Override
    public void initGui() {
        anim = new EaseInOutQuad(400, 1, Direction.FORWARDS);
        anim.setDirection(Direction.FORWARDS);
        anim.setDuration(350);

        super.initGui();
    }


    @Override
    protected void keyTyped(char typedChar, int keyCode) throws IOException {

        for (ModuleElement parameter : elements) {
            if (parameter.module.category != selected) {
                continue;
            }
            parameter.keyTyped(typedChar, keyCode);
        }
        for (ModuleElement parameter : elements2) {
            if (parameter.module.category != selected) {
                continue;
            }
            parameter.keyTyped(typedChar, keyCode);
        }

        if (keyCode == Keyboard.KEY_ESCAPE) {
            anim.setDirection(Direction.BACKWARDS);
            anim.setDuration(250);
            close = true;
        }

        //    super.keyTyped(typedChar, keyCode);
    }

    public boolean dragging = false;

    public void updateMouse(int mouseX, int mouseY) {
        if (dragging) {
            x = mouseX + prevMouseX;
            y = mouseY + prevMouseY;
        }

    }

    @Override
    protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException {
        super.mouseClicked(mouseX, mouseY, mouseButton);
        if (selected == Type.THEME) {
            for (StyleElement style : styles) {
                style.mouseClicked(mouseX, mouseY, mouseButton);
            }
            for (StyleElement style : styles2) {
                style.mouseClicked(mouseX, mouseY, mouseButton);
            }
            if (mouseX > x && mouseX < x + 100 && mouseY > y && mouseY < y + 340) {
                float y = this.y;
                for (Type type : Type.values()) {
                    float offset = 20;
                    if (HoveringMath.isHovering(x + 4f, y + 9.5f + type.ordinal() * offset, 92, 15, mouseX, mouseY) && type != selected) {
                        selected = type;
                        renderAnimation = 0;
                        animation = 0;
                    }
                }
            }
            if (HoveringMath.isHovering(x, y - 20, width, 25, mouseX, mouseY)) {
                prevMouseX = (int) (x - mouseX);
                prevMouseY = (int) (y - mouseY);
                dragging = true;
            }
            return;
        }
        if (HoveringMath.isHovering(x, y - 20, width, 25, mouseX, mouseY)) {
            prevMouseX = (int) (x - mouseX);
            prevMouseY = (int) (y - mouseY);
            dragging = true;
        }

        for (ModuleElement parameter : elements) {
            if (parameter.module.category != selected) {
                continue;
            }
            parameter.mouseClicked(mouseX, mouseY, mouseButton);
        }
        for (ModuleElement parameter : elements2) {
            if (parameter.module.category != selected) {
                continue;
            }
            parameter.mouseClicked(mouseX, mouseY, mouseButton);
        }
        if (mouseX > x && mouseX < x + 100 && mouseY > y && mouseY < y + 340) {
            float y = this.y;
            for (Type type : Type.values()) {
                float offset = 20;
                if (HoveringMath.isHovering(x + 4f, y + 9.5f + type.ordinal() * offset, 92, 15, mouseX, mouseY) && type != selected) {
                    selected = type;
                    renderAnimation = 0;
                    animation = 0;
                }
            }
        }

    }

    @Override
    public boolean doesGuiPauseGame() {
        return false;
    }
}
 
Начинающий
Статус
Оффлайн
Регистрация
22 Фев 2023
Сообщения
110
Реакции[?]
0
Поинты[?]
0
Посмотреть вложение 253484
Помогите пожалуйста, как мне сделать чтобы эти иконки были по всем категориям ? Так же хотелось бы чтобы эти категории были с больших букв.
Заранее спасибо

Вот код:
CSGui:
package wtf.expensive.ui.csgo;

import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.MathHelper;
import org.lwjgl.input.Keyboard;
import org.lwjgl.input.Mouse;
import wtf.expensive.Expensive;
import wtf.expensive.modules.Type;
import wtf.expensive.modules.impl.render.ClickGuiModule;
import wtf.expensive.ui.csgo.elements.ModuleElement;
import wtf.expensive.ui.csgo.elements.StyleElement;
import wtf.expensive.utility.animations.Animation;
import wtf.expensive.utility.animations.Direction;
import wtf.expensive.utility.animations.impl.DecelerateAnimation;
import wtf.expensive.utility.animations.impl.EaseBackIn;
import wtf.expensive.utility.animations.impl.EaseInOutQuad;
import wtf.expensive.utility.font.Fonts;
import wtf.expensive.utility.math.AnimationMath;
import wtf.expensive.utility.math.HoveringMath;
import wtf.expensive.utility.render.GlowUtility;
import wtf.expensive.utility.render.RenderUtility;
import wtf.expensive.utility.shader.BloomUtil;
import wtf.expensive.utility.shader.GaussianBlur;
import wtf.expensive.utility.shader.StencilUtil;
import wtf.expensive.utility.shader.wtf.shader.RiseShaders;

import java.awt.*;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

public class CSGui extends GuiScreen {

    public float x, y;
    public List<StyleElement> styles = new ArrayList<>();
    public List<StyleElement> styles2 = new ArrayList<>();

    public CSGui() {
        ScaledResolution sr = new ScaledResolution(Minecraft.getMinecraft());
        x = sr.getScaledWidth() / 2 - width / 2 + 70;
        y = sr.getScaledHeight() / 2 - height / 2;
        Expensive.getInstance().getModuleManager().getModules().forEach(module -> {
            if (Expensive.getInstance().getModuleManager().getModules().indexOf(module) % 2 != 0) {
                elements.add(new ModuleElement(module));
            }
            if (Expensive.getInstance().getModuleManager().getModules().indexOf(module) % 2 == 0) {
                elements2.add(new ModuleElement(module));
            }
        });


        Expensive.getInstance().styleManager.styles.forEach(module -> {
            if (Expensive.getInstance().styleManager.styles.indexOf(module) % 2 == 0) {
                styles.add(new StyleElement(module));
            }
            if (Expensive.getInstance().styleManager.styles.indexOf(module) % 2 != 0) {
                styles2.add(new StyleElement(module));
            }
        });


    }

    public float animation;
    public float renderAnimation;

    public Type selected;

    public float scrollY = 10, scrollY2 = 10;

    @Override
    protected void mouseReleased(int mouseX, int mouseY, int state) {
        super.mouseReleased(mouseX, mouseY, state);
        if (selected == Type.THEME) {
            for (StyleElement style : styles) {
                style.mouseReleased(mouseX, mouseY, state);
            }
            for (StyleElement style : styles2) {
                style.mouseReleased(mouseX, mouseY, state);
            }
            dragging = false;
            return;
        }
        for (ModuleElement parameter : elements) {
            if (parameter.module.category != selected) {
                continue;
            }
            parameter.mouseReleased(mouseX, mouseY, state);
        }
        for (ModuleElement parameter : elements2) {
            if (parameter.module.category != selected) {
                continue;
            }
            parameter.mouseReleased(mouseX, mouseY, state);
        }
        dragging = false;
    }

    public List<ModuleElement> elements = new ArrayList<>();

    public List<ModuleElement> elements2 = new ArrayList<>();
    public int prevMouseX, prevMouseY;

    public Animation anim;
    float scale;
    public boolean close;

    @Override
    public void drawScreen(int mouseX, int mouseY, float partialTicks) {
        super.drawScreen(mouseX, mouseY, partialTicks);

        if (close) {

            boolean ok = anim.isDone();
            if (ClickGuiModule.guiAnimations.get()) {
                if (ok) {

                    mc.displayGuiScreen(null);
                    close = false;
                }
            } else {

                mc.displayGuiScreen(null);
                close = false;
            }

        }

        updateMouse(mouseX, mouseY);

        float width = 400;
        float height = 250;
        scale = (float) anim.getOutput();
        GlStateManager.pushMatrix();

        if (ClickGuiModule.guiAnimations.get()) {
            GlStateManager.translate(x + (width / 2), (y + height + 50) / 2, 0);
            GlStateManager.scale(scale, scale, 0);
            GlStateManager.translate(-(x + (width / 2)), -((y + height + 50) / 2), 0);
        }

        if (anim.isDone())
            GaussianBlur.renderBlur(50, () -> RiseShaders.RQ.draw(x, y - 20, width, 50, 7, new Color(21, 21, 25, 200)));
        RiseShaders.RQ.draw(x, y - 20, width, 50, 7, new Color(21, 21, 25, 200));
        Fonts.MONTSERRAT14.drawCenteredString("selfcodesss client", x + width / 2, y - 12.5, -1);
        StencilUtil.initStencilToWrite();
        RiseShaders.RQ.draw(x, y, width, height, 7, new Color(21, 21, 25, 255));
        StencilUtil.readStencilBuffer(1);
        RiseShaders.RQ.draw(x, y, width, height, 7, new Color(13, 13, 17, 255));
        RenderUtility.drawRect(x, y, 100, height, new Color(15, 15, 19, 255).getRGB());
        renderAnimation = AnimationMath.fast(renderAnimation, animation, 5f);
        animation = 1;
        animation = MathHelper.clamp(animation, 0, 1);

        float y = this.y;


        for (Type type : Type.values()) {

            float offset = 0;


            offset = 20;
            if (type == selected) {
//
                RiseShaders.RQ.draw(x + 4f, y + 9.5f + type.ordinal() * offset, 92, 15, 3, new Color(255, 255, 255, 25));
                RenderUtility.drawImage(new ResourceLocation("expensive/images/" + type.name().toLowerCase() + ".png"), x + 7 + 0, y + 11 + type.ordinal() * offset, 12, 12, Color.WHITE, renderAnimation);
            }


            Fonts.nunito14.drawString(type.name().toLowerCase(), x + 23f + (type == selected ? renderAnimation * 3 : -10), y + 15 + type.ordinal() * offset, -1);
        }

        drawingComponents(mouseX, mouseY);

        StencilUtil.uninitStencilBuffer();
        GlStateManager.popMatrix();

    }

    public void drawingComponents(int mouseX, int mouseY) {
        scrollY += Mouse.getDWheel() / 10f;
        float offset = scrollY;
        if (selected == Type.THEME) {
            for (StyleElement style : styles) {
                style.x = x + 110;
                style.y = AnimationMath.fast(style.y, y + offset, 15f);
                style.width = 135;
                style.height = 16;
                style.draw(mouseX, mouseY);
                offset += style.height + 4;
            }
            offset = scrollY;
            for (StyleElement style : styles2) {
                style.x = x + 255;
                style.y = AnimationMath.fast(style.y, y + offset, 15f);
                style.width = 135;
                style.height = 16;
                style.draw(mouseX, mouseY);
                offset += style.height + 4;
            }
            float offsetMax = 0;

            float offset1 = 10;
            for (StyleElement parameter : styles) {
                offset1 += parameter.height + 4;
            }

            float offset2 = 10;
            for (StyleElement parameter : styles2) {
                offset2 += parameter.height + 4;
            }
            offsetMax = Math.max(offset1, offset2);
            if (offsetMax > 300) {
                scrollY = MathHelper.clamp(scrollY, -offsetMax + 300, 10);
            } else
                scrollY = 10;
            return;
        }
        List<ModuleElement> e = this.elements.stream().filter(moduleElement -> moduleElement.module.category == selected).toList();
        for (ModuleElement parameter : e) {
            parameter.x = x + 110;
            parameter.y = AnimationMath.fast(parameter.y, y + offset, 15f);
            parameter.width = 135;
            if (parameter.extended) {
                for (Element element : parameter.elements) {
                    if (!element.isVisible()) continue;
                    offset += element.height;
                }
            }
            parameter.height = 16;
            parameter.draw(mouseX, mouseY);
            offset += parameter.height + 4;
        }
        List<ModuleElement> e2 = this.elements2.stream().filter(moduleElement -> moduleElement.module.category == selected).toList();
        offset = scrollY;
        for (ModuleElement parameter : e2) {
            parameter.x = x + 255;
            parameter.y = AnimationMath.fast(parameter.y, y + offset, 15f);
            parameter.width = 135;
            if (parameter.extended) {
                for (Element element : parameter.elements) {
                    if (!element.isVisible()) continue;
                    offset += element.height;
                }
            }
            parameter.height = 16;
            parameter.draw(mouseX, mouseY);
            offset += parameter.height + 4;
        }

        float offsetMax = 0;

        float offset1 = 10;
        for (ModuleElement parameter : elements) {
            if (parameter.module.category != selected) {
                continue;
            }
            if (parameter.extended) {
                for (Element element : parameter.elements) {
                    offset1 += element.height;
                }
            }
            offset1 += parameter.height + 4;
        }

        float offset2 = 10;
        for (ModuleElement parameter : elements2) {
            if (parameter.module.category != selected) {
                continue;
            }
            if (parameter.extended) {
                for (Element element : parameter.elements) {
                    offset2 += element.height;
                }
            }
            offset2 += parameter.height + 4;
        }
        offsetMax = Math.max(offset1, offset2);
        if (offsetMax > 300) {
            scrollY = MathHelper.clamp(scrollY, -offsetMax + 300, 10);
        } else
            scrollY = 10;


    }

    @Override
    public void initGui() {
        anim = new EaseInOutQuad(400, 1, Direction.FORWARDS);
        anim.setDirection(Direction.FORWARDS);
        anim.setDuration(350);

        super.initGui();
    }


    @Override
    protected void keyTyped(char typedChar, int keyCode) throws IOException {

        for (ModuleElement parameter : elements) {
            if (parameter.module.category != selected) {
                continue;
            }
            parameter.keyTyped(typedChar, keyCode);
        }
        for (ModuleElement parameter : elements2) {
            if (parameter.module.category != selected) {
                continue;
            }
            parameter.keyTyped(typedChar, keyCode);
        }

        if (keyCode == Keyboard.KEY_ESCAPE) {
            anim.setDirection(Direction.BACKWARDS);
            anim.setDuration(250);
            close = true;
        }

        //    super.keyTyped(typedChar, keyCode);
    }

    public boolean dragging = false;

    public void updateMouse(int mouseX, int mouseY) {
        if (dragging) {
            x = mouseX + prevMouseX;
            y = mouseY + prevMouseY;
        }

    }

    @Override
    protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException {
        super.mouseClicked(mouseX, mouseY, mouseButton);
        if (selected == Type.THEME) {
            for (StyleElement style : styles) {
                style.mouseClicked(mouseX, mouseY, mouseButton);
            }
            for (StyleElement style : styles2) {
                style.mouseClicked(mouseX, mouseY, mouseButton);
            }
            if (mouseX > x && mouseX < x + 100 && mouseY > y && mouseY < y + 340) {
                float y = this.y;
                for (Type type : Type.values()) {
                    float offset = 20;
                    if (HoveringMath.isHovering(x + 4f, y + 9.5f + type.ordinal() * offset, 92, 15, mouseX, mouseY) && type != selected) {
                        selected = type;
                        renderAnimation = 0;
                        animation = 0;
                    }
                }
            }
            if (HoveringMath.isHovering(x, y - 20, width, 25, mouseX, mouseY)) {
                prevMouseX = (int) (x - mouseX);
                prevMouseY = (int) (y - mouseY);
                dragging = true;
            }
            return;
        }
        if (HoveringMath.isHovering(x, y - 20, width, 25, mouseX, mouseY)) {
            prevMouseX = (int) (x - mouseX);
            prevMouseY = (int) (y - mouseY);
            dragging = true;
        }

        for (ModuleElement parameter : elements) {
            if (parameter.module.category != selected) {
                continue;
            }
            parameter.mouseClicked(mouseX, mouseY, mouseButton);
        }
        for (ModuleElement parameter : elements2) {
            if (parameter.module.category != selected) {
                continue;
            }
            parameter.mouseClicked(mouseX, mouseY, mouseButton);
        }
        if (mouseX > x && mouseX < x + 100 && mouseY > y && mouseY < y + 340) {
            float y = this.y;
            for (Type type : Type.values()) {
                float offset = 20;
                if (HoveringMath.isHovering(x + 4f, y + 9.5f + type.ordinal() * offset, 92, 15, mouseX, mouseY) && type != selected) {
                    selected = type;
                    renderAnimation = 0;
                    animation = 0;
                }
            }
        }

    }

    @Override
    public boolean doesGuiPauseGame() {
        return false;
    }
}
175 строка

Fonts.nunito14.drawString(type.name().toUpperCase(), x + 23f + (type == selected ? renderAnimation * 3 : -10), y + 15 + type.ordinal() * offset, -1);
и 168 строка
убрать конструкцию иф
и дело в шляпе
 
Начинающий
Статус
Оффлайн
Регистрация
24 Авг 2022
Сообщения
308
Реакции[?]
2
Поинты[?]
2K
175 строка

Fonts.nunito14.drawString(type.name().toUpperCase(), x + 23f + (type == selected ? renderAnimation * 3 : -10), y + 15 + type.ordinal() * offset, -1);
и 168 строка
убрать конструкцию иф
и дело в шляпе
спасибо огромное, дружище. я попробую сейчас
175 строка

Fonts.nunito14.drawString(type.name().toUpperCase(), x + 23f + (type == selected ? renderAnimation * 3 : -10), y + 15 + type.ordinal() * offset, -1);
и 168 строка
убрать конструкцию иф
и дело в шляпе
а мне полностью убрать все что находится в этой конструкции ? или нет
 
Начинающий
Статус
Оффлайн
Регистрация
24 Авг 2022
Сообщения
308
Реакции[?]
2
Поинты[?]
2K
Последнее редактирование:
Начинающий
Статус
Оффлайн
Регистрация
22 Фев 2023
Сообщения
110
Реакции[?]
0
Поинты[?]
0
Начинающий
Статус
Оффлайн
Регистрация
24 Авг 2022
Сообщения
308
Реакции[?]
2
Поинты[?]
2K
Видемо ты где-то накасячил, кст можно не убирать конструкцию, а просто достать от туда дравимедж
можешь пожалуйста подправить ? а то я реально не понимаю что не так.

CSGui:
package wtf.expensive.ui.csgo;

import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.MathHelper;
import org.lwjgl.input.Keyboard;
import org.lwjgl.input.Mouse;
import wtf.expensive.Expensive;
import wtf.expensive.modules.Type;
import wtf.expensive.modules.impl.render.ClickGuiModule;
import wtf.expensive.ui.csgo.elements.ModuleElement;
import wtf.expensive.ui.csgo.elements.StyleElement;
import wtf.expensive.utility.animations.Animation;
import wtf.expensive.utility.animations.Direction;
import wtf.expensive.utility.animations.impl.DecelerateAnimation;
import wtf.expensive.utility.animations.impl.EaseBackIn;
import wtf.expensive.utility.animations.impl.EaseInOutQuad;
import wtf.expensive.utility.font.Fonts;
import wtf.expensive.utility.math.AnimationMath;
import wtf.expensive.utility.math.HoveringMath;
import wtf.expensive.utility.render.GlowUtility;
import wtf.expensive.utility.render.RenderUtility;
import wtf.expensive.utility.shader.BloomUtil;
import wtf.expensive.utility.shader.GaussianBlur;
import wtf.expensive.utility.shader.StencilUtil;
import wtf.expensive.utility.shader.wtf.shader.RiseShaders;

import java.awt.*;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

public class CSGui extends GuiScreen {

    public float x, y;
    public List<StyleElement> styles = new ArrayList<>();
    public List<StyleElement> styles2 = new ArrayList<>();

    public CSGui() {
        ScaledResolution sr = new ScaledResolution(Minecraft.getMinecraft());
        x = sr.getScaledWidth() / 2 - width / 2 + 70;
        y = sr.getScaledHeight() / 2 - height / 2;
        Expensive.getInstance().getModuleManager().getModules().forEach(module -> {
            if (Expensive.getInstance().getModuleManager().getModules().indexOf(module) % 2 != 0) {
                elements.add(new ModuleElement(module));
            }
            if (Expensive.getInstance().getModuleManager().getModules().indexOf(module) % 2 == 0) {
                elements2.add(new ModuleElement(module));
            }
        });


        Expensive.getInstance().styleManager.styles.forEach(module -> {
            if (Expensive.getInstance().styleManager.styles.indexOf(module) % 2 == 0) {
                styles.add(new StyleElement(module));
            }
            if (Expensive.getInstance().styleManager.styles.indexOf(module) % 2 != 0) {
                styles2.add(new StyleElement(module));
            }
        });


    }

    public float animation;
    public float renderAnimation;

    public Type selected;

    public float scrollY = 10, scrollY2 = 10;

    @Override
    protected void mouseReleased(int mouseX, int mouseY, int state) {
        super.mouseReleased(mouseX, mouseY, state);
        if (selected == Type.THEME) {
            for (StyleElement style : styles) {
                style.mouseReleased(mouseX, mouseY, state);
            }
            for (StyleElement style : styles2) {
                style.mouseReleased(mouseX, mouseY, state);
            }
            dragging = false;
            return;
        }
        for (ModuleElement parameter : elements) {
            if (parameter.module.category != selected) {
                continue;
            }
            parameter.mouseReleased(mouseX, mouseY, state);
        }
        for (ModuleElement parameter : elements2) {
            if (parameter.module.category != selected) {
                continue;
            }
            parameter.mouseReleased(mouseX, mouseY, state);
        }
        dragging = false;
    }

    public List<ModuleElement> elements = new ArrayList<>();

    public List<ModuleElement> elements2 = new ArrayList<>();
    public int prevMouseX, prevMouseY;

    public Animation anim;
    float scale;
    public boolean close;

    @Override
    public void drawScreen(int mouseX, int mouseY, float partialTicks) {
        super.drawScreen(mouseX, mouseY, partialTicks);

        if (close) {

            boolean ok = anim.isDone();
            if (ClickGuiModule.guiAnimations.get()) {
                if (ok) {

                    mc.displayGuiScreen(null);
                    close = false;
                }
            } else {

                mc.displayGuiScreen(null);
                close = false;
            }

        }

        updateMouse(mouseX, mouseY);

        float width = 400;
        float height = 250;
        scale = (float) anim.getOutput();
        GlStateManager.pushMatrix();

        if (ClickGuiModule.guiAnimations.get()) {
            GlStateManager.translate(x + (width / 2), (y + height + 50) / 2, 0);
            GlStateManager.scale(scale, scale, 0);
            GlStateManager.translate(-(x + (width / 2)), -((y + height + 50) / 2), 0);
        }

        if (anim.isDone())
            GaussianBlur.renderBlur(50, () -> RiseShaders.RQ.draw(x, y - 20, width, 50, 7, new Color(21, 21, 25, 200)));
        RiseShaders.RQ.draw(x, y - 20, width, 50, 7, new Color(21, 21, 25, 200));
        Fonts.MONTSERRAT14.drawCenteredString("zalupentos client", x + width / 2, y - 12.5, -1);
        StencilUtil.initStencilToWrite();
        RiseShaders.RQ.draw(x, y, width, height, 7, new Color(21, 21, 25, 255));
        StencilUtil.readStencilBuffer(1);
        RiseShaders.RQ.draw(x, y, width, height, 7, new Color(13, 13, 17, 255));
        RenderUtility.drawRect(x, y, 100, height, new Color(15, 15, 19, 255).getRGB());
        renderAnimation = AnimationMath.fast(renderAnimation, animation, 5f);
        animation = 1;
        animation = MathHelper.clamp(animation, 0, 1);

        float y = this.y;


        for (Type type : Type.values()) {

            float offset = 0;

            RiseShaders.RQ.draw(x + 4f, y + 9.5f + type.ordinal() * offset, 92, 15, 3, new Color(255, 255, 255, 25));
            RenderUtility.drawImage(new ResourceLocation("expensive/images/" + type.name().toLowerCase() + ".png"), x + 7 + (type == selected ? renderAnimation * 3 : 0), y + 11 + type.ordinal() * offset, 12, 12, Color.WHITE, renderAnimation);

            Fonts.nunito14.drawString(type.name().toUpperCase(), x + 23f + (type == selected ? renderAnimation * 3 : -10), y + 15 + type.ordinal() * offset, -1);
        }

        drawingComponents(mouseX, mouseY);

        StencilUtil.uninitStencilBuffer();
        GlStateManager.popMatrix();

    }

    public void drawingComponents(int mouseX, int mouseY) {
        scrollY += Mouse.getDWheel() / 10f;
        float offset = scrollY;
        if (selected == Type.THEME) {
            for (StyleElement style : styles) {
                style.x = x + 110;
                style.y = AnimationMath.fast(style.y, y + offset, 15f);
                style.width = 135;
                style.height = 16;
                style.draw(mouseX, mouseY);
                offset += style.height + 4;
            }
            offset = scrollY;
            for (StyleElement style : styles2) {
                style.x = x + 255;
                style.y = AnimationMath.fast(style.y, y + offset, 15f);
                style.width = 135;
                style.height = 16;
                style.draw(mouseX, mouseY);
                offset += style.height + 4;
            }
            float offsetMax = 0;

            float offset1 = 10;
            for (StyleElement parameter : styles) {
                offset1 += parameter.height + 4;
            }

            float offset2 = 10;
            for (StyleElement parameter : styles2) {
                offset2 += parameter.height + 4;
            }
            offsetMax = Math.max(offset1, offset2);
            if (offsetMax > 300) {
                scrollY = MathHelper.clamp(scrollY, -offsetMax + 300, 10);
            } else
                scrollY = 10;
            return;
        }
        List<ModuleElement> e = this.elements.stream().filter(moduleElement -> moduleElement.module.category == selected).toList();
        for (ModuleElement parameter : e) {
            parameter.x = x + 110;
            parameter.y = AnimationMath.fast(parameter.y, y + offset, 15f);
            parameter.width = 135;
            if (parameter.extended) {
                for (Element element : parameter.elements) {
                    if (!element.isVisible()) continue;
                    offset += element.height;
                }
            }
            parameter.height = 16;
            parameter.draw(mouseX, mouseY);
            offset += parameter.height + 4;
        }
        List<ModuleElement> e2 = this.elements2.stream().filter(moduleElement -> moduleElement.module.category == selected).toList();
        offset = scrollY;
        for (ModuleElement parameter : e2) {
            parameter.x = x + 255;
            parameter.y = AnimationMath.fast(parameter.y, y + offset, 15f);
            parameter.width = 135;
            if (parameter.extended) {
                for (Element element : parameter.elements) {
                    if (!element.isVisible()) continue;
                    offset += element.height;
                }
            }
            parameter.height = 16;
            parameter.draw(mouseX, mouseY);
            offset += parameter.height + 4;
        }

        float offsetMax = 0;

        float offset1 = 10;
        for (ModuleElement parameter : elements) {
            if (parameter.module.category != selected) {
                continue;
            }
            if (parameter.extended) {
                for (Element element : parameter.elements) {
                    offset1 += element.height;
                }
            }
            offset1 += parameter.height + 4;
        }

        float offset2 = 10;
        for (ModuleElement parameter : elements2) {
            if (parameter.module.category != selected) {
                continue;
            }
            if (parameter.extended) {
                for (Element element : parameter.elements) {
                    offset2 += element.height;
                }
            }
            offset2 += parameter.height + 4;
        }
        offsetMax = Math.max(offset1, offset2);
        if (offsetMax > 300) {
            scrollY = MathHelper.clamp(scrollY, -offsetMax + 300, 10);
        } else
            scrollY = 10;


    }

    @Override
    public void initGui() {
        anim = new EaseInOutQuad(400, 1, Direction.FORWARDS);
        anim.setDirection(Direction.FORWARDS);
        anim.setDuration(350);

        super.initGui();
    }


    @Override
    protected void keyTyped(char typedChar, int keyCode) throws IOException {

        for (ModuleElement parameter : elements) {
            if (parameter.module.category != selected) {
                continue;
            }
            parameter.keyTyped(typedChar, keyCode);
        }
        for (ModuleElement parameter : elements2) {
            if (parameter.module.category != selected) {
                continue;
            }
            parameter.keyTyped(typedChar, keyCode);
        }

        if (keyCode == Keyboard.KEY_ESCAPE) {
            anim.setDirection(Direction.BACKWARDS);
            anim.setDuration(250);
            close = true;
        }

        //    super.keyTyped(typedChar, keyCode);
    }

    public boolean dragging = false;

    public void updateMouse(int mouseX, int mouseY) {
        if (dragging) {
            x = mouseX + prevMouseX;
            y = mouseY + prevMouseY;
        }

    }

    @Override
    protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException {
        super.mouseClicked(mouseX, mouseY, mouseButton);
        if (selected == Type.THEME) {
            for (StyleElement style : styles) {
                style.mouseClicked(mouseX, mouseY, mouseButton);
            }
            for (StyleElement style : styles2) {
                style.mouseClicked(mouseX, mouseY, mouseButton);
            }
            if (mouseX > x && mouseX < x + 100 && mouseY > y && mouseY < y + 340) {
                float y = this.y;
                for (Type type : Type.values()) {
                    float offset = 20;
                    if (HoveringMath.isHovering(x + 4f, y + 9.5f + type.ordinal() * offset, 92, 15, mouseX, mouseY) && type != selected) {
                        selected = type;
                        renderAnimation = 0;
                        animation = 0;
                    }
                }
            }
            if (HoveringMath.isHovering(x, y - 20, width, 25, mouseX, mouseY)) {
                prevMouseX = (int) (x - mouseX);
                prevMouseY = (int) (y - mouseY);
                dragging = true;
            }
            return;
        }
        if (HoveringMath.isHovering(x, y - 20, width, 25, mouseX, mouseY)) {
            prevMouseX = (int) (x - mouseX);
            prevMouseY = (int) (y - mouseY);
            dragging = true;
        }

        for (ModuleElement parameter : elements) {
            if (parameter.module.category != selected) {
                continue;
            }
            parameter.mouseClicked(mouseX, mouseY, mouseButton);
        }
        for (ModuleElement parameter : elements2) {
            if (parameter.module.category != selected) {
                continue;
            }
            parameter.mouseClicked(mouseX, mouseY, mouseButton);
        }
        if (mouseX > x && mouseX < x + 100 && mouseY > y && mouseY < y + 340) {
            float y = this.y;
            for (Type type : Type.values()) {
                float offset = 20;
                if (HoveringMath.isHovering(x + 4f, y + 9.5f + type.ordinal() * offset, 92, 15, mouseX, mouseY) && type != selected) {
                    selected = type;
                    renderAnimation = 0;
                    animation = 0;
                }
            }
        }

    }

    @Override
    public boolean doesGuiPauseGame() {
        return false;
    }
}
 
Начинающий
Статус
Оффлайн
Регистрация
24 Авг 2022
Сообщения
308
Реакции[?]
2
Поинты[?]
2K
бля, не то
ты фиксанул килку? если да то дай сурсы килки)
AuraModule:
package wtf.expensive.modules.impl.combat;


import lombok.Getter;
import lombok.Setter;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.EntityPlayerSP;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.item.EntityArmorStand;
import net.minecraft.entity.monster.EntityGolem;
import net.minecraft.entity.monster.EntityMob;
import net.minecraft.entity.monster.EntitySlime;
import net.minecraft.entity.passive.EntityAnimal;
import net.minecraft.entity.passive.EntitySquid;
import net.minecraft.entity.passive.EntityVillager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumAction;
import net.minecraft.item.ItemAxe;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemSword;
import net.minecraft.network.play.client.CPacketEntityAction;
import net.minecraft.network.play.client.CPacketPlayerTryUseItem;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Vec3d;
import org.lwjgl.opengl.GL11;
import wtf.expensive.Expensive;
import wtf.expensive.event.EventListener;
import wtf.expensive.event.impl.player.EventInteractEntity;
import wtf.expensive.event.impl.player.EventMotion;
import wtf.expensive.event.impl.player.EventUpdate;
import wtf.expensive.event.impl.render.EventDraw;
import wtf.expensive.modules.Module;
import wtf.expensive.modules.ModuleAnnotation;
import wtf.expensive.modules.Type;
import wtf.expensive.modules.impl.player.BackTrackModule;
import wtf.expensive.modules.impl.util.TimerUtility;
import wtf.expensive.modules.settings.imp.BooleanSetting;
import wtf.expensive.modules.settings.imp.ModeSetting;
import wtf.expensive.modules.settings.imp.MultiBoxSetting;
import wtf.expensive.modules.settings.imp.SliderSetting;
import wtf.expensive.utility.color.ColorUtility;
import wtf.expensive.utility.math.*;
import wtf.expensive.utility.movement.MoveUtility;

import javax.vecmath.Vector2f;
import java.awt.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

@ModuleAnnotation(name = "Aura", type = Type.COMBAT)

public class AuraModule extends Module {

    [USER=270918]@Getter[/USER]
    @Setter
    public EntityLivingBase target;

    public static float yaw;
    public float pitch;
    public static SliderSetting pitchHead;

    public Vector2f rotation = new Vector2f();
    public ModeSetting rotateMode = new ModeSetting("Rotation Mode", "Advanced", "Advanced", "Vulcan");
    public MultiBoxSetting targetsSelection = new MultiBoxSetting("Target Selection", new String[]{"Players", "Naked Players", "NPC / Bots", "Mobs"});

    public SliderSetting range = new SliderSetting("Range", 3.0f, 2.5f, 5.0f, 0.05f);
    public SliderSetting rotateRange = new SliderSetting("Rotate Range", 0.5f, 0.f, 2.f, 0.05f);
    public BooleanSetting randomClicks = new BooleanSetting("Random Clicks", false, () -> rotateMode.is("Vulcan"));

    public BooleanSetting onlyCritical = new BooleanSetting("Only Critical", true);
    public BooleanSetting onlyWaterCritical = new BooleanSetting("Water Critical", true, () -> onlyCritical.get());
    public BooleanSetting onlyWeapon = new BooleanSetting("Only Weapon", false);
    public BooleanSetting targetESP = new BooleanSetting("Target ESP", false);
    public SliderSetting circleSpeed = new SliderSetting("Circle Speed", 2, 1, 5, 0.01f, () -> targetESP.get());
    public static double prevCircleStep, circleStep;

    private boolean rotatedBefore;
    public TimerUtility timer = new TimerUtility();
    public static AuraModule instance;
    public int hitDelay = 0;
    float Yaw = 0, Pitch = 0;
    float prevAdditionYaw;

    public AuraModule() {
        instance = this;
    }


    private final EventListener<EventInteractEntity> onInteract = e -> {
        if (target != null) {
            e.cancel();
        }
    };

    private final EventListener<EventUpdate> onUpdate = e -> {
        setDisplayName(rotateMode.get());
        boolean isTargetValid = target != null && isValid(target);
        if (!isTargetValid) target = findTarget();
        if (target == null) {
            rotation.x = mc.player.rotationYaw;
            rotation.y = mc.player.rotationPitch;
            return;
        }

        rotatedBefore = false;
        attack(target);

        if (!rotatedBefore) {
            rotation(target, false);
        }

    };
    public ItemStack lastData;
    public TimerUtility timerUtility = new TimerUtility();


    private final EventListener<EventMotion> onMotion = e -> {
        if (lastData != mc.player.getActiveItemStack()) {
            timerUtility.reset();
            lastData = mc.player.getActiveItemStack();
        }
        if (target != null) {
            e.setYaw(rotation.x);
            e.setPitch(rotation.y);
            mc.player.rotationYawHead = rotation.x;
            mc.player.renderYawOffset = rotation.x;


        }

    };
    private final EventListener<EventDraw> onDraw = event -> {
        if (event.type == EventDraw.RenderType.RENDER) {
            if (target != null && targetESP.get()) {

                prevCircleStep = circleStep;
                circleStep += circleSpeed.get() * AnimationMath.deltaTime();

                float eyeHeight = target.getEyeHeight();
                if (target.isSneaking()) eyeHeight -= 0.2f;

                double cs = prevCircleStep + (circleStep - prevCircleStep) * mc.getRenderPartialTicks();
                double prevSinAnim = Math.abs(1 + Math.sin(cs - 0.5)) / 2;
                double sinAnim = Math.abs(1 + Math.sin(cs)) / 2;
                double x = target.lastTickPosX + (target.posX - target.lastTickPosX) * mc.getRenderPartialTicks()
                        - mc.getRenderManager().renderPosX;
                double y = target.lastTickPosY + (target.posY - target.lastTickPosY) * mc.getRenderPartialTicks()
                        - mc.getRenderManager().renderPosY + prevSinAnim * eyeHeight;
                double z = target.lastTickPosZ + (target.posZ - target.lastTickPosZ) * mc.getRenderPartialTicks()
                        - mc.getRenderManager().renderPosZ;
                double nextY = target.lastTickPosY
                        + (target.posY - target.lastTickPosY) * mc.getRenderPartialTicks()
                        - mc.getRenderManager().renderPosY + sinAnim * eyeHeight;

                GL11.glPushMatrix();
                GL11.glDisable(GL11.GL_CULL_FACE);
                GL11.glDisable(GL11.GL_TEXTURE_2D);
                GL11.glEnable(GL11.GL_BLEND);
                GL11.glDisable(GL11.GL_DEPTH_TEST);
                GL11.glDisable(GL11.GL_ALPHA_TEST);
                GL11.glShadeModel(GL11.GL_SMOOTH);
                GL11.glBegin(GL11.GL_QUAD_STRIP);
                for (int i = 0; i <= 360; i++) {
                    final Color color = ColorUtility.getColorStyleColor(i);
                    GL11.glColor4f(color.getRed() / 255f, color.getGreen() / 255f, color.getBlue() / 255f, 0.6F);
                    GL11.glVertex3d(x + Math.cos(Math.toRadians(i)) * target.width * 0.8, nextY,
                            z + Math.sin(Math.toRadians(i)) * target.width * 0.8);
                    GL11.glColor4f(color.getRed() / 255f, color.getGreen() / 255f, color.getBlue() / 255f, 0.01F);
                    GL11.glVertex3d(x + Math.cos(Math.toRadians(i)) * target.width * 0.8, y,
                            z + Math.sin(Math.toRadians(i)) * target.width * 0.8);
                }
                GL11.glEnd();
                GL11.glEnable(GL11.GL_LINE_SMOOTH);
                GL11.glBegin(GL11.GL_LINE_LOOP);
                for (int i = 0; i <= 360; i++) {
                    final Color color = ColorUtility.getColorStyleColor(i );
                    GL11.glColor4f(color.getRed() / 255f, color.getGreen() / 255f, color.getBlue() / 255f, 0.8F);
                        GL11.glVertex3d(x + Math.cos(Math.toRadians(i)) * target.width * 0.8, nextY,
                            z + Math.sin(Math.toRadians(i)) * target.width * 0.8);
                }
                GL11.glEnd();
                GL11.glDisable(GL11.GL_LINE_SMOOTH);
                GL11.glEnable(GL11.GL_TEXTURE_2D);
                GL11.glEnable(GL11.GL_ALPHA_TEST);
                GL11.glEnable(GL11.GL_DEPTH_TEST);
                GL11.glShadeModel(GL11.GL_FLAT);
                GL11.glDisable(GL11.GL_BLEND);
                GL11.glEnable(GL11.GL_CULL_FACE);
                GL11.glPopMatrix();
                GlStateManager.resetColor();

            }
        }
    };

    private void attack(EntityLivingBase base) {
        if (whenFalling()) {

            rotation(base, true);

            if (DistanceUtility.calculateDistance(base, rotation.x, rotation.y,
                    range.get(),true) == base) {


                if (mc.player.isHandActive() && mc.player.getActiveItemStack().getItem()
                        .getItemUseAction(mc.player.getActiveItemStack()) == EnumAction.BLOCK) {
                    mc.playerController.onStoppedUsingItem(mc.player);
                }
                timerUtility.reset();
                mc.player.connection.sendPacket(new CPacketEntityAction(mc.player, CPacketEntityAction.Action.STOP_SPRINTING));

                mc.playerController.attackEntity(mc.player, base);
                mc.player.swingArm(EnumHand.MAIN_HAND);

                if (mc.player.isHandActive() && mc.player.getActiveItemStack().getItem()
                        .getItemUseAction(mc.player.getActiveItemStack()) == EnumAction.BLOCK) {
                    mc.player.connection.sendPacket(new CPacketPlayerTryUseItem(mc.player.getActiveHand()));
                }
                ShieldBreaker.breakShieldMethod(base, true);

            }

        }
    }




    public boolean whenFalling() {
        boolean reason = MoveUtility.reason(onlyWaterCritical.get());

        //System.out.println(mc.player.getEntityAttribute(SharedMonsterAttributes.ATTACK_SPEED).getAttributeValue() * 20);

        int time = Math.max((int) (mc.player.getCooldownPeriod() * 40), 250);

        if (!timerUtility.hasTimeElapsed(time)) return false;

        if (Expensive.getInstance().getModuleManager().
                backTrackModule.getNearest(target).distanceTo(mc.player.getPositionEyes(1)) > range.get()) return false;

        if (!reason && onlyCritical.get()) {

            return (!mc.player.onGround && mc.player.fallDistance > (randomClicks.get() && rotateMode.is("Vulcan") ? MathUtility.randomizeFloat(0, 0.3f) : 0));
        }

        return true;
    }


    public final void rotation(EntityLivingBase base, boolean attack) {
        this.rotatedBefore = true;

        Vec3d bestHitbox = getVector(base, rotateRange.get() + range.get());

        if (bestHitbox == null) {
            bestHitbox = base.getPositionEyes(1);
        }

        if (Expensive.getInstance().getModuleManager().get(BackTrackModule.class).state
                && Expensive.getInstance().getModuleManager().backTrackModule.getNearest(base) != null) {
            bestHitbox = Expensive.getInstance().getModuleManager().backTrackModule.getNearest(base);
        }

        EntityPlayerSP client = Minecraft.getMinecraft().player;

        float sensitivity = 1.0001f;
        double x = bestHitbox.x - client.posX;
        double y = bestHitbox.y - client.getPositionEyes(1).y;
        double z = bestHitbox.z - client.posZ;
        double dst = Math.sqrt(Math.pow(x, 2) + Math.pow(z, 2));
        float yawToTarget = (float) MathHelper.wrapDegrees(Math.toDegrees(Math.atan2(z, x)) - 90);
        float pitchToTarget = (float) (-Math.toDegrees(Math.atan2(y, dst)));
        float yawDelta = MathHelper.wrapDegrees(yawToTarget - rotation.x) / sensitivity;
        float pitchDelta = (pitchToTarget - rotation.y) / sensitivity;
        float[] matrix = RotationHelper.getRotations(target);
        float[] fake = RotationHelper.getFakeRotations(target);
        float[] matrix2 = RotationHelper.getMatrix2Rotations((Entity) target);
        if (yawDelta > 180) {
            yawDelta = yawDelta - 180;
        }
        int yawDeltaAbs = (int) Math.abs(yawDelta);
        if (yawDeltaAbs < 180.0D) {
            switch (rotateMode.get()) {
                case "Advanced" -> {
                    float pitchDeltaAbs = Math.abs(pitchDelta);
                    float additionYaw = Math.min(Math.max(yawDeltaAbs, 1.0F), 80.F);
                    float additionPitch = Math.max(attack ? pitchDeltaAbs : 1, 2.0F);
                    if (Math.abs(additionYaw - this.prevAdditionYaw) <= 3.0f) {
                        additionYaw = GCDFixUtility.getSensitivity(this.prevAdditionYaw + 3.1f);
                    }

                    float newYaw = rotation.x + (yawDelta > 0 ? additionYaw : -additionYaw) * sensitivity;
                    float newPitch = MathHelper.clamp(
                            rotation.y + (pitchDelta > 0 ? additionPitch : -additionPitch) * sensitivity, -90, 90);
                    rotation.x = newYaw;
                    rotation.y = newPitch;
                    this.prevAdditionYaw = additionYaw;
                }
                case "Vulcan" -> {
                    float pitchDeltaAbs = Math.abs(pitchDelta);
                    float additionYaw = Math.min(Math.max(yawDeltaAbs, 1), 80);
                    float additionPitch = !AuraUtility.checkIfVisible(rotation.x, rotation.y, 0.06f, target, range.get() + rotateRange.get()) ? 10 : 1;
                    if (Math.abs(additionYaw - this.prevAdditionYaw) <= 3.0f) {
                        additionYaw = this.prevAdditionYaw + 3.1f;
                    }
                    float newYaw = rotation.x + (yawDelta > 0 ? additionYaw : -additionYaw) * sensitivity;
                    float newPitch = MathHelper.clamp(
                            rotation.y + (pitchDelta > 0 ? additionPitch : -additionPitch) * sensitivity, -90, 90);

                    rotation.x = newYaw;
                    rotation.y = newPitch;
                    this.prevAdditionYaw = additionYaw;
                }
                case "StormHvH" -> {
                    float[] rotVisual = RotationHelper.getRotations(target);
                    mc.player.renderYawOffset = fake[0];
                    mc.player.rotationPitchHead = fake[1];
                    mc.player.rotationYawHead = fake[0];
                    yaw = matrix[0];
                    this.pitch = matrix[1];
                }
            }
        } else {
            rotation.x = mc.player.rotationYaw;
            rotation.y = mc.player.rotationPitch;
        }
    }

    public EntityLivingBase findTarget() {
        List<EntityLivingBase> targets = new ArrayList<>();

        for (Entity entity : mc.world.loadedEntityList) {
            if (entity instanceof EntityLivingBase && isValid((EntityLivingBase) entity)) {
                targets.add((EntityLivingBase) entity);
            }
        }

        targets.sort((e1, e2) -> {
            int dst1 = (int) (mc.player.getDistanceToEntity(e1) * 1000);
            int dst2 = (int) (mc.player.getDistanceToEntity(e2) * 1000);
            return dst1 - dst2;
        });

        return targets.isEmpty() ? null : targets.get(0);
    }

    public Vec3d getVector(Entity target, double rotateDistance) {
        if (target.getDistanceSqToEntity(target) >= 36) {
            return null;
        } else {
            Vec3d head = findHitboxCoord(Hitbox.HEAD, target);
            Vec3d chest = findHitboxCoord(Hitbox.CHEST, target);
            Vec3d legs = findHitboxCoord(Hitbox.LEGS, target);

            ArrayList<Vec3d> points = new ArrayList<>(Arrays.asList(head, chest));

            if (MoveUtility.isBlockAboveHead()) {
                points.add(legs);
            }

            points.removeIf(point -> !AuraUtility.isHitBoxVisible(target, point, rotateDistance));
            if (points.isEmpty()) {
                return null;
            } else {
                points.sort((d1, d2) -> {
                    Vector2f r1 = AuraUtility.getVectorForCoord(rotation, d1);
                    Vector2f r2 = AuraUtility.getVectorForCoord(rotation, d2);
                    float y1 = Math.abs(r1.y);
                    float y2 = Math.abs(r2.y);
                    return (int) ((y1 - y2) * 1000.0F);
                });
                return points.get(0);
            }
        }
    }


    public static Vec3d findHitboxCoord(Hitbox box, Entity target) {

        double yCoord = switch (box) {
            case HEAD -> target.getEyeHeight();
            case CHEST -> target.getEyeHeight() / 2;
            case LEGS -> 0.08;
        };
        return target.getPositionVector().addVector(0, yCoord, 0);
    }

    public boolean isValid(EntityLivingBase base) {

        if (base == mc.player || base.isDead || base.getHealth() <= 0)
            return false;
        if ((Expensive.getInstance().getModuleManager().
                backTrackModule.getNearest(base).distanceTo(mc.player.getPositionEyes(1)) > range.get() + rotateRange.get()))
            return false;
        if (base.getPositionVector().distanceTo(mc.player.getPositionEyes(1)) > 6 + rotateRange.get())
            return false;
        if (base instanceof EntityPlayer && base.getTotalArmorValue() == 0 && !targetsSelection.get(1))
            return false;
        if ((base instanceof EntityPlayer || base.isInvisible()) && !targetsSelection.get(0))
            return false;
        if (this.onlyWeapon.get() && !(mc.player.getHeldItemMainhand().getItem() instanceof ItemSword
                || mc.player.getHeldItemMainhand().getItem() instanceof ItemAxe)) {
            return false;
        }
        if (base.getName().equals(mc.player.getName())) return false;
        if (Expensive.getInstance().friendManager.isFriend(base.getName()))
            return false;
        if ((base instanceof EntityMob || base instanceof EntityAnimal || base instanceof EntityGolem
                || base instanceof EntitySlime || base instanceof EntitySquid || base instanceof EntityVillager) && !targetsSelection.get(3))
            return false;
        if (base instanceof EntityPlayer && ((EntityPlayer) base).isBot)
            return false;

        if (base instanceof EntityArmorStand)
            return false;

        return true;
    }

    @Override
    public void onDisable() {
        if (mc.player == null) return;
        Yaw = mc.player.rotationYaw;
        Pitch = mc.player.rotationPitch;
        rotation.x = mc.player.rotationYaw;
        rotation.y = mc.player.rotationPitch;
        target = null;
        super.onDisable();
    }

    public float[] Rotation(Entity e) {
        AxisAlignedBB aabb = e.getRenderBoundingBox();
        double eX = aabb.minX + ((aabb.maxX - aabb.minX) / 2);
        double eY = aabb.minY;
        double eZ = aabb.minZ + ((aabb.maxZ - aabb.minZ) / 2);
        double x = eX - mc.player.posX;
        double z = eZ - mc.player.posZ;
        EntityLivingBase ent = (EntityLivingBase) e;
        double y = eY + ent.getEyeHeight() * 0.666666666f;
        double dy = y - (mc.player.posY + (double) mc.player.getEyeHeight());
        double dstxz = MathHelper.sqrt(x * x + z * z);
        float yaw = (float) (Math.atan2(z, x) * 180.0 / Math.PI - 92.0);
        float pitch = (float) (Math.toDegrees(-Math.atan2(dy, dstxz)));
        yaw = Yaw + GCDFixUtility.getSensitivity(MathHelper.wrapDegrees(yaw - Yaw));
        pitch = Pitch + GCDFixUtility.getSensitivity(MathHelper.wrapDegrees(pitch - Pitch));
        pitch = MathHelper.clamp(pitch, -88.5f, 89.9f);
        return new float[]{yaw, pitch};
    }

    public float[] getNeededFacing2(Entity target, boolean randomizer) {
        float yaw = Rotation(target)[0];
        float pitch = Rotation(target)[1];
        int speed = mc.player.ticksExisted % 2 == 0 ? 20 : 1;
        if (MoveUtility.isMoving() || MoveUtility.getDifferenceOf(Yaw, yaw) > 10) {
            Yaw = MathUtility.lerp(Yaw, yaw, 0.05f * speed);
            Pitch = MathUtility.lerp(Pitch, pitch, 0.05f * speed);
            Pitch = MathUtility.clamp(Pitch, -90, 90);
            Yaw = Yaw + GCDFixUtility.getSensitivity(MathHelper.wrapDegrees(Rotation(target)[0] - Yaw));
            Pitch = Pitch + GCDFixUtility.getSensitivity(MathHelper.wrapDegrees(Rotation(target)[1] - Pitch));
        }
        return new float[]{Yaw, Pitch};
    }

    public enum Hitbox {
        HEAD, CHEST, LEGS
    }
}
держи, дружище
 
Пользователь
Статус
Оффлайн
Регистрация
23 Авг 2021
Сообщения
521
Реакции[?]
53
Поинты[?]
20K
Посмотреть вложение 253484
Помогите пожалуйста, как мне сделать чтобы эти иконки были по всем категориям ? Так же хотелось бы чтобы эти категории были с больших букв.
Заранее спасибо

Вот код:
CSGui:
package wtf.expensive.ui.csgo;

import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.MathHelper;
import org.lwjgl.input.Keyboard;
import org.lwjgl.input.Mouse;
import wtf.expensive.Expensive;
import wtf.expensive.modules.Type;
import wtf.expensive.modules.impl.render.ClickGuiModule;
import wtf.expensive.ui.csgo.elements.ModuleElement;
import wtf.expensive.ui.csgo.elements.StyleElement;
import wtf.expensive.utility.animations.Animation;
import wtf.expensive.utility.animations.Direction;
import wtf.expensive.utility.animations.impl.DecelerateAnimation;
import wtf.expensive.utility.animations.impl.EaseBackIn;
import wtf.expensive.utility.animations.impl.EaseInOutQuad;
import wtf.expensive.utility.font.Fonts;
import wtf.expensive.utility.math.AnimationMath;
import wtf.expensive.utility.math.HoveringMath;
import wtf.expensive.utility.render.GlowUtility;
import wtf.expensive.utility.render.RenderUtility;
import wtf.expensive.utility.shader.BloomUtil;
import wtf.expensive.utility.shader.GaussianBlur;
import wtf.expensive.utility.shader.StencilUtil;
import wtf.expensive.utility.shader.wtf.shader.RiseShaders;

import java.awt.*;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

public class CSGui extends GuiScreen {

    public float x, y;
    public List<StyleElement> styles = new ArrayList<>();
    public List<StyleElement> styles2 = new ArrayList<>();

    public CSGui() {
        ScaledResolution sr = new ScaledResolution(Minecraft.getMinecraft());
        x = sr.getScaledWidth() / 2 - width / 2 + 70;
        y = sr.getScaledHeight() / 2 - height / 2;
        Expensive.getInstance().getModuleManager().getModules().forEach(module -> {
            if (Expensive.getInstance().getModuleManager().getModules().indexOf(module) % 2 != 0) {
                elements.add(new ModuleElement(module));
            }
            if (Expensive.getInstance().getModuleManager().getModules().indexOf(module) % 2 == 0) {
                elements2.add(new ModuleElement(module));
            }
        });


        Expensive.getInstance().styleManager.styles.forEach(module -> {
            if (Expensive.getInstance().styleManager.styles.indexOf(module) % 2 == 0) {
                styles.add(new StyleElement(module));
            }
            if (Expensive.getInstance().styleManager.styles.indexOf(module) % 2 != 0) {
                styles2.add(new StyleElement(module));
            }
        });


    }

    public float animation;
    public float renderAnimation;

    public Type selected;

    public float scrollY = 10, scrollY2 = 10;

    @Override
    protected void mouseReleased(int mouseX, int mouseY, int state) {
        super.mouseReleased(mouseX, mouseY, state);
        if (selected == Type.THEME) {
            for (StyleElement style : styles) {
                style.mouseReleased(mouseX, mouseY, state);
            }
            for (StyleElement style : styles2) {
                style.mouseReleased(mouseX, mouseY, state);
            }
            dragging = false;
            return;
        }
        for (ModuleElement parameter : elements) {
            if (parameter.module.category != selected) {
                continue;
            }
            parameter.mouseReleased(mouseX, mouseY, state);
        }
        for (ModuleElement parameter : elements2) {
            if (parameter.module.category != selected) {
                continue;
            }
            parameter.mouseReleased(mouseX, mouseY, state);
        }
        dragging = false;
    }

    public List<ModuleElement> elements = new ArrayList<>();

    public List<ModuleElement> elements2 = new ArrayList<>();
    public int prevMouseX, prevMouseY;

    public Animation anim;
    float scale;
    public boolean close;

    @Override
    public void drawScreen(int mouseX, int mouseY, float partialTicks) {
        super.drawScreen(mouseX, mouseY, partialTicks);

        if (close) {

            boolean ok = anim.isDone();
            if (ClickGuiModule.guiAnimations.get()) {
                if (ok) {

                    mc.displayGuiScreen(null);
                    close = false;
                }
            } else {

                mc.displayGuiScreen(null);
                close = false;
            }

        }

        updateMouse(mouseX, mouseY);

        float width = 400;
        float height = 250;
        scale = (float) anim.getOutput();
        GlStateManager.pushMatrix();

        if (ClickGuiModule.guiAnimations.get()) {
            GlStateManager.translate(x + (width / 2), (y + height + 50) / 2, 0);
            GlStateManager.scale(scale, scale, 0);
            GlStateManager.translate(-(x + (width / 2)), -((y + height + 50) / 2), 0);
        }

        if (anim.isDone())
            GaussianBlur.renderBlur(50, () -> RiseShaders.RQ.draw(x, y - 20, width, 50, 7, new Color(21, 21, 25, 200)));
        RiseShaders.RQ.draw(x, y - 20, width, 50, 7, new Color(21, 21, 25, 200));
        Fonts.MONTSERRAT14.drawCenteredString("selfcodesss client", x + width / 2, y - 12.5, -1);
        StencilUtil.initStencilToWrite();
        RiseShaders.RQ.draw(x, y, width, height, 7, new Color(21, 21, 25, 255));
        StencilUtil.readStencilBuffer(1);
        RiseShaders.RQ.draw(x, y, width, height, 7, new Color(13, 13, 17, 255));
        RenderUtility.drawRect(x, y, 100, height, new Color(15, 15, 19, 255).getRGB());
        renderAnimation = AnimationMath.fast(renderAnimation, animation, 5f);
        animation = 1;
        animation = MathHelper.clamp(animation, 0, 1);

        float y = this.y;


        for (Type type : Type.values()) {

            float offset = 0;


            offset = 20;
            if (type == selected) {
//
                RiseShaders.RQ.draw(x + 4f, y + 9.5f + type.ordinal() * offset, 92, 15, 3, new Color(255, 255, 255, 25));
                RenderUtility.drawImage(new ResourceLocation("expensive/images/" + type.name().toLowerCase() + ".png"), x + 7 + 0, y + 11 + type.ordinal() * offset, 12, 12, Color.WHITE, renderAnimation);
            }


            Fonts.nunito14.drawString(type.name().toLowerCase(), x + 23f + (type == selected ? renderAnimation * 3 : -10), y + 15 + type.ordinal() * offset, -1);
        }

        drawingComponents(mouseX, mouseY);

        StencilUtil.uninitStencilBuffer();
        GlStateManager.popMatrix();

    }

    public void drawingComponents(int mouseX, int mouseY) {
        scrollY += Mouse.getDWheel() / 10f;
        float offset = scrollY;
        if (selected == Type.THEME) {
            for (StyleElement style : styles) {
                style.x = x + 110;
                style.y = AnimationMath.fast(style.y, y + offset, 15f);
                style.width = 135;
                style.height = 16;
                style.draw(mouseX, mouseY);
                offset += style.height + 4;
            }
            offset = scrollY;
            for (StyleElement style : styles2) {
                style.x = x + 255;
                style.y = AnimationMath.fast(style.y, y + offset, 15f);
                style.width = 135;
                style.height = 16;
                style.draw(mouseX, mouseY);
                offset += style.height + 4;
            }
            float offsetMax = 0;

            float offset1 = 10;
            for (StyleElement parameter : styles) {
                offset1 += parameter.height + 4;
            }

            float offset2 = 10;
            for (StyleElement parameter : styles2) {
                offset2 += parameter.height + 4;
            }
            offsetMax = Math.max(offset1, offset2);
            if (offsetMax > 300) {
                scrollY = MathHelper.clamp(scrollY, -offsetMax + 300, 10);
            } else
                scrollY = 10;
            return;
        }
        List<ModuleElement> e = this.elements.stream().filter(moduleElement -> moduleElement.module.category == selected).toList();
        for (ModuleElement parameter : e) {
            parameter.x = x + 110;
            parameter.y = AnimationMath.fast(parameter.y, y + offset, 15f);
            parameter.width = 135;
            if (parameter.extended) {
                for (Element element : parameter.elements) {
                    if (!element.isVisible()) continue;
                    offset += element.height;
                }
            }
            parameter.height = 16;
            parameter.draw(mouseX, mouseY);
            offset += parameter.height + 4;
        }
        List<ModuleElement> e2 = this.elements2.stream().filter(moduleElement -> moduleElement.module.category == selected).toList();
        offset = scrollY;
        for (ModuleElement parameter : e2) {
            parameter.x = x + 255;
            parameter.y = AnimationMath.fast(parameter.y, y + offset, 15f);
            parameter.width = 135;
            if (parameter.extended) {
                for (Element element : parameter.elements) {
                    if (!element.isVisible()) continue;
                    offset += element.height;
                }
            }
            parameter.height = 16;
            parameter.draw(mouseX, mouseY);
            offset += parameter.height + 4;
        }

        float offsetMax = 0;

        float offset1 = 10;
        for (ModuleElement parameter : elements) {
            if (parameter.module.category != selected) {
                continue;
            }
            if (parameter.extended) {
                for (Element element : parameter.elements) {
                    offset1 += element.height;
                }
            }
            offset1 += parameter.height + 4;
        }

        float offset2 = 10;
        for (ModuleElement parameter : elements2) {
            if (parameter.module.category != selected) {
                continue;
            }
            if (parameter.extended) {
                for (Element element : parameter.elements) {
                    offset2 += element.height;
                }
            }
            offset2 += parameter.height + 4;
        }
        offsetMax = Math.max(offset1, offset2);
        if (offsetMax > 300) {
            scrollY = MathHelper.clamp(scrollY, -offsetMax + 300, 10);
        } else
            scrollY = 10;


    }

    @Override
    public void initGui() {
        anim = new EaseInOutQuad(400, 1, Direction.FORWARDS);
        anim.setDirection(Direction.FORWARDS);
        anim.setDuration(350);

        super.initGui();
    }


    @Override
    protected void keyTyped(char typedChar, int keyCode) throws IOException {

        for (ModuleElement parameter : elements) {
            if (parameter.module.category != selected) {
                continue;
            }
            parameter.keyTyped(typedChar, keyCode);
        }
        for (ModuleElement parameter : elements2) {
            if (parameter.module.category != selected) {
                continue;
            }
            parameter.keyTyped(typedChar, keyCode);
        }

        if (keyCode == Keyboard.KEY_ESCAPE) {
            anim.setDirection(Direction.BACKWARDS);
            anim.setDuration(250);
            close = true;
        }

        //    super.keyTyped(typedChar, keyCode);
    }

    public boolean dragging = false;

    public void updateMouse(int mouseX, int mouseY) {
        if (dragging) {
            x = mouseX + prevMouseX;
            y = mouseY + prevMouseY;
        }

    }

    @Override
    protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException {
        super.mouseClicked(mouseX, mouseY, mouseButton);
        if (selected == Type.THEME) {
            for (StyleElement style : styles) {
                style.mouseClicked(mouseX, mouseY, mouseButton);
            }
            for (StyleElement style : styles2) {
                style.mouseClicked(mouseX, mouseY, mouseButton);
            }
            if (mouseX > x && mouseX < x + 100 && mouseY > y && mouseY < y + 340) {
                float y = this.y;
                for (Type type : Type.values()) {
                    float offset = 20;
                    if (HoveringMath.isHovering(x + 4f, y + 9.5f + type.ordinal() * offset, 92, 15, mouseX, mouseY) && type != selected) {
                        selected = type;
                        renderAnimation = 0;
                        animation = 0;
                    }
                }
            }
            if (HoveringMath.isHovering(x, y - 20, width, 25, mouseX, mouseY)) {
                prevMouseX = (int) (x - mouseX);
                prevMouseY = (int) (y - mouseY);
                dragging = true;
            }
            return;
        }
        if (HoveringMath.isHovering(x, y - 20, width, 25, mouseX, mouseY)) {
            prevMouseX = (int) (x - mouseX);
            prevMouseY = (int) (y - mouseY);
            dragging = true;
        }

        for (ModuleElement parameter : elements) {
            if (parameter.module.category != selected) {
                continue;
            }
            parameter.mouseClicked(mouseX, mouseY, mouseButton);
        }
        for (ModuleElement parameter : elements2) {
            if (parameter.module.category != selected) {
                continue;
            }
            parameter.mouseClicked(mouseX, mouseY, mouseButton);
        }
        if (mouseX > x && mouseX < x + 100 && mouseY > y && mouseY < y + 340) {
            float y = this.y;
            for (Type type : Type.values()) {
                float offset = 20;
                if (HoveringMath.isHovering(x + 4f, y + 9.5f + type.ordinal() * offset, 92, 15, mouseX, mouseY) && type != selected) {
                    selected = type;
                    renderAnimation = 0;
                    animation = 0;
                }
            }
        }

    }

    @Override
    public boolean doesGuiPauseGame() {
        return false;
    }
}
Java:
for (Type type : Type.values()) {
            float offset = 20;
            
            RiseShaders.RQ.draw(x + 4f, y + 9.5f + type.ordinal() * offset, 92, 15, 3, new Color(255, 255, 255, 25));
            RenderUtility.drawImage(new ResourceLocation("expensive/images/" + type.name().toLowerCase() + ".png"), x + 7 + 0, y + 11 + type.ordinal() * offset, 12, 12, Color.WHITE, renderAnimation);

            Fonts.nunito14.drawString(type.name(), x + 23f + (type == selected ? renderAnimation * 3 : -10), y + 15 + type.ordinal() * offset, -1);
        }
если названия категорий с больших букв или не такие как ты хотел, то зайди в класс Type и там должно быть написаны названия категорий
 
Начинающий
Статус
Оффлайн
Регистрация
24 Авг 2022
Сообщения
308
Реакции[?]
2
Поинты[?]
2K
Java:
for (Type type : Type.values()) {
            float offset = 20;
           
            RiseShaders.RQ.draw(x + 4f, y + 9.5f + type.ordinal() * offset, 92, 15, 3, new Color(255, 255, 255, 25));
            RenderUtility.drawImage(new ResourceLocation("expensive/images/" + type.name().toLowerCase() + ".png"), x + 7 + 0, y + 11 + type.ordinal() * offset, 12, 12, Color.WHITE, renderAnimation);

            Fonts.nunito14.drawString(type.name(), x + 23f + (type == selected ? renderAnimation * 3 : -10), y + 15 + type.ordinal() * offset, -1);
        }
если названия категорий с больших букв или не такие как ты хотел, то зайди в класс Type и там должно быть написаны названия категорий
привет, мне уже помогли. рассказываю для тебя, в классе Type нету этих так называемых названий, поэтому, для того чтобы зарендерить категории с маленькой буквы, нужно использовать toUpperCase. (это вам не рич)
 
Пользователь
Статус
Оффлайн
Регистрация
23 Авг 2021
Сообщения
521
Реакции[?]
53
Поинты[?]
20K
привет, мне уже помогли. рассказываю для тебя, в классе Type нету этих так называемых названий, поэтому, для того чтобы зарендерить категории с маленькой буквы, нужно использовать toUpperCase. (это вам не рич)
так весь текст будет с большой буквы, а ты имел в виду с заглавной буквы (то есть только первая буква в названии должна быть заглавной)

насчёт "это вам не рич" - я не пащу рич, експенсив и т.п. сурсы русских проектов, просто имею енам класс в конструкторе которого я написал два аргумента - первый стринг (который вообщем и отвечает за названия категорий) и второй инт (индекс категории)
а видимо твоя база не имеет конструктора в енам классе поэтому и возникает такая проблемка
 
Начинающий
Статус
Оффлайн
Регистрация
24 Авг 2022
Сообщения
308
Реакции[?]
2
Поинты[?]
2K
так весь текст будет с большой буквы, а ты имел в виду с заглавной буквы (то есть только первая буква в названии должна быть заглавной)

насчёт "это вам не рич" - я не пащу рич, експенсив и т.п. сурсы русских проектов, просто имею енам класс в конструкторе которого я написал два аргумента - первый стринг (который вообщем и отвечает за названия категорий) и второй инт (индекс категории)
а видимо твоя база не имеет конструктора в енам классе поэтому и возникает такая проблемка
да там с ту аппер кейс должно быть еще кое что, а про рич я пошутил
 
Пользователь
Статус
Оффлайн
Регистрация
20 Дек 2022
Сообщения
195
Реакции[?]
65
Поинты[?]
36K
привет, мне уже помогли. рассказываю для тебя, в классе Type нету этих так называемых названий, поэтому, для того чтобы зарендерить категории с маленькой буквы, нужно использовать toUpperCase. (это вам не рич)
а я вижу вы эксперт в JAVA RICH API
 
Начинающий
Статус
Оффлайн
Регистрация
23 Окт 2022
Сообщения
73
Реакции[?]
1
Поинты[?]
0
Посмотреть вложение 253484
Помогите пожалуйста, как мне сделать чтобы эти иконки были по всем категориям ? Так же хотелось бы чтобы эти категории были с больших букв.
Заранее спасибо

Вот код:
CSGui:
package wtf.expensive.ui.csgo;

import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.MathHelper;
import org.lwjgl.input.Keyboard;
import org.lwjgl.input.Mouse;
import wtf.expensive.Expensive;
import wtf.expensive.modules.Type;
import wtf.expensive.modules.impl.render.ClickGuiModule;
import wtf.expensive.ui.csgo.elements.ModuleElement;
import wtf.expensive.ui.csgo.elements.StyleElement;
import wtf.expensive.utility.animations.Animation;
import wtf.expensive.utility.animations.Direction;
import wtf.expensive.utility.animations.impl.DecelerateAnimation;
import wtf.expensive.utility.animations.impl.EaseBackIn;
import wtf.expensive.utility.animations.impl.EaseInOutQuad;
import wtf.expensive.utility.font.Fonts;
import wtf.expensive.utility.math.AnimationMath;
import wtf.expensive.utility.math.HoveringMath;
import wtf.expensive.utility.render.GlowUtility;
import wtf.expensive.utility.render.RenderUtility;
import wtf.expensive.utility.shader.BloomUtil;
import wtf.expensive.utility.shader.GaussianBlur;
import wtf.expensive.utility.shader.StencilUtil;
import wtf.expensive.utility.shader.wtf.shader.RiseShaders;

import java.awt.*;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

public class CSGui extends GuiScreen {

    public float x, y;
    public List<StyleElement> styles = new ArrayList<>();
    public List<StyleElement> styles2 = new ArrayList<>();

    public CSGui() {
        ScaledResolution sr = new ScaledResolution(Minecraft.getMinecraft());
        x = sr.getScaledWidth() / 2 - width / 2 + 70;
        y = sr.getScaledHeight() / 2 - height / 2;
        Expensive.getInstance().getModuleManager().getModules().forEach(module -> {
            if (Expensive.getInstance().getModuleManager().getModules().indexOf(module) % 2 != 0) {
                elements.add(new ModuleElement(module));
            }
            if (Expensive.getInstance().getModuleManager().getModules().indexOf(module) % 2 == 0) {
                elements2.add(new ModuleElement(module));
            }
        });


        Expensive.getInstance().styleManager.styles.forEach(module -> {
            if (Expensive.getInstance().styleManager.styles.indexOf(module) % 2 == 0) {
                styles.add(new StyleElement(module));
            }
            if (Expensive.getInstance().styleManager.styles.indexOf(module) % 2 != 0) {
                styles2.add(new StyleElement(module));
            }
        });


    }

    public float animation;
    public float renderAnimation;

    public Type selected;

    public float scrollY = 10, scrollY2 = 10;

    @Override
    protected void mouseReleased(int mouseX, int mouseY, int state) {
        super.mouseReleased(mouseX, mouseY, state);
        if (selected == Type.THEME) {
            for (StyleElement style : styles) {
                style.mouseReleased(mouseX, mouseY, state);
            }
            for (StyleElement style : styles2) {
                style.mouseReleased(mouseX, mouseY, state);
            }
            dragging = false;
            return;
        }
        for (ModuleElement parameter : elements) {
            if (parameter.module.category != selected) {
                continue;
            }
            parameter.mouseReleased(mouseX, mouseY, state);
        }
        for (ModuleElement parameter : elements2) {
            if (parameter.module.category != selected) {
                continue;
            }
            parameter.mouseReleased(mouseX, mouseY, state);
        }
        dragging = false;
    }

    public List<ModuleElement> elements = new ArrayList<>();

    public List<ModuleElement> elements2 = new ArrayList<>();
    public int prevMouseX, prevMouseY;

    public Animation anim;
    float scale;
    public boolean close;

    @Override
    public void drawScreen(int mouseX, int mouseY, float partialTicks) {
        super.drawScreen(mouseX, mouseY, partialTicks);

        if (close) {

            boolean ok = anim.isDone();
            if (ClickGuiModule.guiAnimations.get()) {
                if (ok) {

                    mc.displayGuiScreen(null);
                    close = false;
                }
            } else {

                mc.displayGuiScreen(null);
                close = false;
            }

        }

        updateMouse(mouseX, mouseY);

        float width = 400;
        float height = 250;
        scale = (float) anim.getOutput();
        GlStateManager.pushMatrix();

        if (ClickGuiModule.guiAnimations.get()) {
            GlStateManager.translate(x + (width / 2), (y + height + 50) / 2, 0);
            GlStateManager.scale(scale, scale, 0);
            GlStateManager.translate(-(x + (width / 2)), -((y + height + 50) / 2), 0);
        }

        if (anim.isDone())
            GaussianBlur.renderBlur(50, () -> RiseShaders.RQ.draw(x, y - 20, width, 50, 7, new Color(21, 21, 25, 200)));
        RiseShaders.RQ.draw(x, y - 20, width, 50, 7, new Color(21, 21, 25, 200));
        Fonts.MONTSERRAT14.drawCenteredString("selfcodesss client", x + width / 2, y - 12.5, -1);
        StencilUtil.initStencilToWrite();
        RiseShaders.RQ.draw(x, y, width, height, 7, new Color(21, 21, 25, 255));
        StencilUtil.readStencilBuffer(1);
        RiseShaders.RQ.draw(x, y, width, height, 7, new Color(13, 13, 17, 255));
        RenderUtility.drawRect(x, y, 100, height, new Color(15, 15, 19, 255).getRGB());
        renderAnimation = AnimationMath.fast(renderAnimation, animation, 5f);
        animation = 1;
        animation = MathHelper.clamp(animation, 0, 1);

        float y = this.y;


        for (Type type : Type.values()) {

            float offset = 0;


            offset = 20;
            if (type == selected) {
//
                RiseShaders.RQ.draw(x + 4f, y + 9.5f + type.ordinal() * offset, 92, 15, 3, new Color(255, 255, 255, 25));
                RenderUtility.drawImage(new ResourceLocation("expensive/images/" + type.name().toLowerCase() + ".png"), x + 7 + 0, y + 11 + type.ordinal() * offset, 12, 12, Color.WHITE, renderAnimation);
            }


            Fonts.nunito14.drawString(type.name().toLowerCase(), x + 23f + (type == selected ? renderAnimation * 3 : -10), y + 15 + type.ordinal() * offset, -1);
        }

        drawingComponents(mouseX, mouseY);

        StencilUtil.uninitStencilBuffer();
        GlStateManager.popMatrix();

    }

    public void drawingComponents(int mouseX, int mouseY) {
        scrollY += Mouse.getDWheel() / 10f;
        float offset = scrollY;
        if (selected == Type.THEME) {
            for (StyleElement style : styles) {
                style.x = x + 110;
                style.y = AnimationMath.fast(style.y, y + offset, 15f);
                style.width = 135;
                style.height = 16;
                style.draw(mouseX, mouseY);
                offset += style.height + 4;
            }
            offset = scrollY;
            for (StyleElement style : styles2) {
                style.x = x + 255;
                style.y = AnimationMath.fast(style.y, y + offset, 15f);
                style.width = 135;
                style.height = 16;
                style.draw(mouseX, mouseY);
                offset += style.height + 4;
            }
            float offsetMax = 0;

            float offset1 = 10;
            for (StyleElement parameter : styles) {
                offset1 += parameter.height + 4;
            }

            float offset2 = 10;
            for (StyleElement parameter : styles2) {
                offset2 += parameter.height + 4;
            }
            offsetMax = Math.max(offset1, offset2);
            if (offsetMax > 300) {
                scrollY = MathHelper.clamp(scrollY, -offsetMax + 300, 10);
            } else
                scrollY = 10;
            return;
        }
        List<ModuleElement> e = this.elements.stream().filter(moduleElement -> moduleElement.module.category == selected).toList();
        for (ModuleElement parameter : e) {
            parameter.x = x + 110;
            parameter.y = AnimationMath.fast(parameter.y, y + offset, 15f);
            parameter.width = 135;
            if (parameter.extended) {
                for (Element element : parameter.elements) {
                    if (!element.isVisible()) continue;
                    offset += element.height;
                }
            }
            parameter.height = 16;
            parameter.draw(mouseX, mouseY);
            offset += parameter.height + 4;
        }
        List<ModuleElement> e2 = this.elements2.stream().filter(moduleElement -> moduleElement.module.category == selected).toList();
        offset = scrollY;
        for (ModuleElement parameter : e2) {
            parameter.x = x + 255;
            parameter.y = AnimationMath.fast(parameter.y, y + offset, 15f);
            parameter.width = 135;
            if (parameter.extended) {
                for (Element element : parameter.elements) {
                    if (!element.isVisible()) continue;
                    offset += element.height;
                }
            }
            parameter.height = 16;
            parameter.draw(mouseX, mouseY);
            offset += parameter.height + 4;
        }

        float offsetMax = 0;

        float offset1 = 10;
        for (ModuleElement parameter : elements) {
            if (parameter.module.category != selected) {
                continue;
            }
            if (parameter.extended) {
                for (Element element : parameter.elements) {
                    offset1 += element.height;
                }
            }
            offset1 += parameter.height + 4;
        }

        float offset2 = 10;
        for (ModuleElement parameter : elements2) {
            if (parameter.module.category != selected) {
                continue;
            }
            if (parameter.extended) {
                for (Element element : parameter.elements) {
                    offset2 += element.height;
                }
            }
            offset2 += parameter.height + 4;
        }
        offsetMax = Math.max(offset1, offset2);
        if (offsetMax > 300) {
            scrollY = MathHelper.clamp(scrollY, -offsetMax + 300, 10);
        } else
            scrollY = 10;


    }

    @Override
    public void initGui() {
        anim = new EaseInOutQuad(400, 1, Direction.FORWARDS);
        anim.setDirection(Direction.FORWARDS);
        anim.setDuration(350);

        super.initGui();
    }


    @Override
    protected void keyTyped(char typedChar, int keyCode) throws IOException {

        for (ModuleElement parameter : elements) {
            if (parameter.module.category != selected) {
                continue;
            }
            parameter.keyTyped(typedChar, keyCode);
        }
        for (ModuleElement parameter : elements2) {
            if (parameter.module.category != selected) {
                continue;
            }
            parameter.keyTyped(typedChar, keyCode);
        }

        if (keyCode == Keyboard.KEY_ESCAPE) {
            anim.setDirection(Direction.BACKWARDS);
            anim.setDuration(250);
            close = true;
        }

        //    super.keyTyped(typedChar, keyCode);
    }

    public boolean dragging = false;

    public void updateMouse(int mouseX, int mouseY) {
        if (dragging) {
            x = mouseX + prevMouseX;
            y = mouseY + prevMouseY;
        }

    }

    @Override
    protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException {
        super.mouseClicked(mouseX, mouseY, mouseButton);
        if (selected == Type.THEME) {
            for (StyleElement style : styles) {
                style.mouseClicked(mouseX, mouseY, mouseButton);
            }
            for (StyleElement style : styles2) {
                style.mouseClicked(mouseX, mouseY, mouseButton);
            }
            if (mouseX > x && mouseX < x + 100 && mouseY > y && mouseY < y + 340) {
                float y = this.y;
                for (Type type : Type.values()) {
                    float offset = 20;
                    if (HoveringMath.isHovering(x + 4f, y + 9.5f + type.ordinal() * offset, 92, 15, mouseX, mouseY) && type != selected) {
                        selected = type;
                        renderAnimation = 0;
                        animation = 0;
                    }
                }
            }
            if (HoveringMath.isHovering(x, y - 20, width, 25, mouseX, mouseY)) {
                prevMouseX = (int) (x - mouseX);
                prevMouseY = (int) (y - mouseY);
                dragging = true;
            }
            return;
        }
        if (HoveringMath.isHovering(x, y - 20, width, 25, mouseX, mouseY)) {
            prevMouseX = (int) (x - mouseX);
            prevMouseY = (int) (y - mouseY);
            dragging = true;
        }

        for (ModuleElement parameter : elements) {
            if (parameter.module.category != selected) {
                continue;
            }
            parameter.mouseClicked(mouseX, mouseY, mouseButton);
        }
        for (ModuleElement parameter : elements2) {
            if (parameter.module.category != selected) {
                continue;
            }
            parameter.mouseClicked(mouseX, mouseY, mouseButton);
        }
        if (mouseX > x && mouseX < x + 100 && mouseY > y && mouseY < y + 340) {
            float y = this.y;
            for (Type type : Type.values()) {
                float offset = 20;
                if (HoveringMath.isHovering(x + 4f, y + 9.5f + type.ordinal() * offset, 92, 15, mouseX, mouseY) && type != selected) {
                    selected = type;
                    renderAnimation = 0;
                    animation = 0;
                }
            }
        }

    }

    @Override
    public boolean doesGuiPauseGame() {
        return false;
    }
}
mc.player.getbrain();
 
Начинающий
Статус
Оффлайн
Регистрация
28 Июн 2023
Сообщения
15
Реакции[?]
0
Поинты[?]
0

Пожалуйста, зарегистрируйтесь или авторизуйтесь, чтобы увидеть содержимое.


Короче там в asssts/название папки клиента/gui вроде/ и туда вставляешь фотку рендера и пишешь название:render.png и там если что 2 папки клиента долнжл быть,в поиск вбей
 
Начинающий
Статус
Оффлайн
Регистрация
24 Авг 2022
Сообщения
308
Реакции[?]
2
Поинты[?]
2K
Скрытое содержимое
Короче там в asssts/название папки клиента/gui вроде/ и туда вставляешь фотку рендера и пишешь название:render.png и там если что 2 папки клиента долнжл быть,в поиск вбей
да я уже решил проблему, и она решается не так как ты сказал
 
Сверху Снизу