Bounds setting | Any version & base

Начинающий
Начинающий
Статус
Оффлайн
Регистрация
18 Авг 2023
Сообщения
479
Реакции
8
Пожалуйста, авторизуйтесь для просмотра ссылки.


code:
Expand Collapse Copy
package net.evaware.system.clickgui;

import net.evaware.module.modules.Overlay;
import net.evaware.module.setting.settings.DragSetting;
import net.evaware.system.font.Fonts;
import net.evaware.utils.color.ColorUtils;
import net.evaware.utils.math.MathUtil;
import net.evaware.utils.math.MouseUtil;
import net.evaware.utils.render.RenderUtil;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.util.math.MathHelper;

import java.awt.*;

public class Bounds extends Component {
    private final DragSetting setting;

    public Bounds(DragSetting setting) {
        this.setting = setting;
        this.setHeight(18);
    }

    private float anim;
    private boolean draggingFirst, draggingSecond;
    float firstSliderPos, secondSliderPos;

    [USER=1367676]@override[/USER]
    public void render(MatrixStack stack, float mouseX, float mouseY) {
        super.render(stack, mouseX, mouseY);

        anim = MathUtil.fast(anim, (getWidth() - 10) * ((setting.getValue() - setting.getMin()) / (setting.getMax() - setting.getMin())), 25);

        firstSliderPos = (setting.getFirst() - setting.getMin()) / (setting.getMax() - setting.getMin()) * (getWidth() - 10);
        secondSliderPos = (setting.getSecond() - setting.getMin()) / (setting.getMax() - setting.getMin()) * (getWidth() - 10);

        Fonts.normal[16].drawString(stack, setting.getSettingName(), getX() + 4.5f, getY(), ColorUtils.setAlpha(-1, (int) ((255 * getAlpha()) * ClickGuiScreen.getAnim().getValue())));
        Fonts.normal[15].drawString(stack, setting.getFirst() + " - " + setting.getSecond(), getX() + getWidth() - 4.5f - Fonts.normal[15].getStringWidth(setting.getFirst() + " - " + setting.getSecond()), getY() + 0.5f, ColorUtils.setAlpha(-1, (int) ((255 * getAlpha()) * ClickGuiScreen.getAnim().getValue())));

        Color c1 = Overlay.getClientColorWithAlphaC((int) getY(), (float) ((255 * getAlpha()) * ClickGuiScreen.getAnim().getValue()));
        Color c2 = Overlay.getClientColorWithAlphaC((int) getX(), (float) ((255 * getAlpha()) * ClickGuiScreen.getAnim().getValue()));
        Color c3 = ColorUtils.intToColor(ColorUtils.setAlpha(-1, (int) ((255 * getAlpha()) * ClickGuiScreen.getAnim().getValue())));

        RenderUtil.drawRect(stack, getX() + 5, getY() + 9, getWidth() - 10, 2, ColorUtils.intToColor(ColorUtils.rgba(40, 40, 40, (int) ((255 * getAlpha()) * ClickGuiScreen.getAnim().getValue()))));
        RenderUtil.drawRect(stack, getX() + 5 + firstSliderPos, getY() + 9, secondSliderPos - firstSliderPos, 2, c1, c2);

        RenderUtil.drawRect(stack, getX() + 5 + firstSliderPos, getY() + 8, 2, 4, c3);
        RenderUtil.drawRect(stack, getX() + 5 + secondSliderPos, getY() + 8, 2, 4, c3);

        if (setting.getFirst() >= setting.getSecond()) {
            float newFirst = MathHelper.clamp(setting.getFirst() - setting.getStep(), setting.getMin(), setting.getMax());
            setting.setFirst(newFirst);
        }
        if (setting.getSecond() <= setting.getFirst()) {
            float newSecond = MathHelper.clamp(setting.getSecond() + setting.getStep(), setting.getMin(), setting.getMax());
            setting.setSecond(newSecond);
        }

        if (draggingFirst || draggingSecond) {
            float mouseRelativePos = (mouseX - getX() - 5) / (getWidth() - 10);
            float newValue = MathHelper.clamp(mouseRelativePos * (setting.getMax() - setting.getMin()) + setting.getMin(), setting.getMin(), setting.getMax());

            newValue = Math.round(newValue / setting.getStep()) * setting.getStep();

            if (draggingFirst) {
                setting.setFirst(newValue);
                if (setting.getFirst() > setting.getSecond()) {
                    setting.setFirst(setting.getSecond());
                }
            } else if (draggingSecond) {
                setting.setSecond(newValue);
                if (setting.getSecond() < setting.getFirst()) {
                    setting.setSecond(setting.getFirst());
                }
            }
        }

    }

    [USER=1367676]@override[/USER]
    public void mouseClick(float mouseX, float mouseY, int mouse) {
        boolean hover1 = MouseUtil.isHovered(mouseX, mouseY, getX() + 3 + firstSliderPos, getY() + 8, 6, 4);
        boolean hover2 = MouseUtil.isHovered(mouseX, mouseY, getX() + 3 + secondSliderPos, getY() + 8, 6, 4);

        if (hover1 && hover2) {
            if (Math.abs(mouseX - (getX() + 3 + firstSliderPos)) < Math.abs(mouseX - (getX() + 3 + secondSliderPos))) {
                draggingFirst = true;
                draggingSecond = false;
            } else {
                draggingSecond = true;
                draggingFirst = false;
            }
        } else if (hover1) {
            draggingFirst = true;
            draggingSecond = false;
        } else if (hover2) {
            draggingSecond = true;
            draggingFirst = false;
        }

        super.mouseClick(mouseX, mouseY, mouse);
    }


    [USER=1367676]@override[/USER]
    public void mouseRelease(float mouseX, float mouseY, int mouse) {
        draggingFirst = false;
        draggingSecond = false;
        super.mouseRelease(mouseX, mouseY, mouse);
    }

    [USER=1367676]@override[/USER]
    public boolean isVisible() {
        return setting.getVisible().getAsBoolean();
    }
}
 
Пожалуйста, авторизуйтесь для просмотра ссылки.


code:
Expand Collapse Copy
package net.evaware.system.clickgui;

import net.evaware.module.modules.Overlay;
import net.evaware.module.setting.settings.DragSetting;
import net.evaware.system.font.Fonts;
import net.evaware.utils.color.ColorUtils;
import net.evaware.utils.math.MathUtil;
import net.evaware.utils.math.MouseUtil;
import net.evaware.utils.render.RenderUtil;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.util.math.MathHelper;

import java.awt.*;

public class Bounds extends Component {
    private final DragSetting setting;

    public Bounds(DragSetting setting) {
        this.setting = setting;
        this.setHeight(18);
    }

    private float anim;
    private boolean draggingFirst, draggingSecond;
    float firstSliderPos, secondSliderPos;

    [USER=1367676]@override[/USER]
    public void render(MatrixStack stack, float mouseX, float mouseY) {
        super.render(stack, mouseX, mouseY);

        anim = MathUtil.fast(anim, (getWidth() - 10) * ((setting.getValue() - setting.getMin()) / (setting.getMax() - setting.getMin())), 25);

        firstSliderPos = (setting.getFirst() - setting.getMin()) / (setting.getMax() - setting.getMin()) * (getWidth() - 10);
        secondSliderPos = (setting.getSecond() - setting.getMin()) / (setting.getMax() - setting.getMin()) * (getWidth() - 10);

        Fonts.normal[16].drawString(stack, setting.getSettingName(), getX() + 4.5f, getY(), ColorUtils.setAlpha(-1, (int) ((255 * getAlpha()) * ClickGuiScreen.getAnim().getValue())));
        Fonts.normal[15].drawString(stack, setting.getFirst() + " - " + setting.getSecond(), getX() + getWidth() - 4.5f - Fonts.normal[15].getStringWidth(setting.getFirst() + " - " + setting.getSecond()), getY() + 0.5f, ColorUtils.setAlpha(-1, (int) ((255 * getAlpha()) * ClickGuiScreen.getAnim().getValue())));

        Color c1 = Overlay.getClientColorWithAlphaC((int) getY(), (float) ((255 * getAlpha()) * ClickGuiScreen.getAnim().getValue()));
        Color c2 = Overlay.getClientColorWithAlphaC((int) getX(), (float) ((255 * getAlpha()) * ClickGuiScreen.getAnim().getValue()));
        Color c3 = ColorUtils.intToColor(ColorUtils.setAlpha(-1, (int) ((255 * getAlpha()) * ClickGuiScreen.getAnim().getValue())));

        RenderUtil.drawRect(stack, getX() + 5, getY() + 9, getWidth() - 10, 2, ColorUtils.intToColor(ColorUtils.rgba(40, 40, 40, (int) ((255 * getAlpha()) * ClickGuiScreen.getAnim().getValue()))));
        RenderUtil.drawRect(stack, getX() + 5 + firstSliderPos, getY() + 9, secondSliderPos - firstSliderPos, 2, c1, c2);

        RenderUtil.drawRect(stack, getX() + 5 + firstSliderPos, getY() + 8, 2, 4, c3);
        RenderUtil.drawRect(stack, getX() + 5 + secondSliderPos, getY() + 8, 2, 4, c3);

        if (setting.getFirst() >= setting.getSecond()) {
            float newFirst = MathHelper.clamp(setting.getFirst() - setting.getStep(), setting.getMin(), setting.getMax());
            setting.setFirst(newFirst);
        }
        if (setting.getSecond() <= setting.getFirst()) {
            float newSecond = MathHelper.clamp(setting.getSecond() + setting.getStep(), setting.getMin(), setting.getMax());
            setting.setSecond(newSecond);
        }

        if (draggingFirst || draggingSecond) {
            float mouseRelativePos = (mouseX - getX() - 5) / (getWidth() - 10);
            float newValue = MathHelper.clamp(mouseRelativePos * (setting.getMax() - setting.getMin()) + setting.getMin(), setting.getMin(), setting.getMax());

            newValue = Math.round(newValue / setting.getStep()) * setting.getStep();

            if (draggingFirst) {
                setting.setFirst(newValue);
                if (setting.getFirst() > setting.getSecond()) {
                    setting.setFirst(setting.getSecond());
                }
            } else if (draggingSecond) {
                setting.setSecond(newValue);
                if (setting.getSecond() < setting.getFirst()) {
                    setting.setSecond(setting.getFirst());
                }
            }
        }

    }

    [USER=1367676]@override[/USER]
    public void mouseClick(float mouseX, float mouseY, int mouse) {
        boolean hover1 = MouseUtil.isHovered(mouseX, mouseY, getX() + 3 + firstSliderPos, getY() + 8, 6, 4);
        boolean hover2 = MouseUtil.isHovered(mouseX, mouseY, getX() + 3 + secondSliderPos, getY() + 8, 6, 4);

        if (hover1 && hover2) {
            if (Math.abs(mouseX - (getX() + 3 + firstSliderPos)) < Math.abs(mouseX - (getX() + 3 + secondSliderPos))) {
                draggingFirst = true;
                draggingSecond = false;
            } else {
                draggingSecond = true;
                draggingFirst = false;
            }
        } else if (hover1) {
            draggingFirst = true;
            draggingSecond = false;
        } else if (hover2) {
            draggingSecond = true;
            draggingFirst = false;
        }

        super.mouseClick(mouseX, mouseY, mouse);
    }


    [USER=1367676]@override[/USER]
    public void mouseRelease(float mouseX, float mouseY, int mouse) {
        draggingFirst = false;
        draggingSecond = false;
        super.mouseRelease(mouseX, mouseY, mouse);
    }

    [USER=1367676]@override[/USER]
    public boolean isVisible() {
        return setting.getVisible().getAsBoolean();
    }
}
ивенты дай нам лучше на 1.20.4 твои
 
вы че евенты не можете написать:NotLikeThis:
евенты и ютилки всякие типо рендер и т.д ) Сделай вообще нам базу какую-то с ватермаркой с ютилками с модулями с кликгуи какой-то пропоносенной со шрифтами я тебе пятку обцелую
 
евенты и ютилки всякие типо рендер и т.д ) Сделай вообще нам базу какую-то с ватермаркой с ютилками с модулями с кликгуи какой-то пропоносенной со шрифтами я тебе пятку обцелую
много хотите чета
 
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Пожалуйста, авторизуйтесь для просмотра ссылки.


code:
Expand Collapse Copy
package net.evaware.system.clickgui;

import net.evaware.module.modules.Overlay;
import net.evaware.module.setting.settings.DragSetting;
import net.evaware.system.font.Fonts;
import net.evaware.utils.color.ColorUtils;
import net.evaware.utils.math.MathUtil;
import net.evaware.utils.math.MouseUtil;
import net.evaware.utils.render.RenderUtil;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.util.math.MathHelper;

import java.awt.*;

public class Bounds extends Component {
    private final DragSetting setting;

    public Bounds(DragSetting setting) {
        this.setting = setting;
        this.setHeight(18);
    }

    private float anim;
    private boolean draggingFirst, draggingSecond;
    float firstSliderPos, secondSliderPos;

    [USER=1367676]@override[/USER]
    public void render(MatrixStack stack, float mouseX, float mouseY) {
        super.render(stack, mouseX, mouseY);

        anim = MathUtil.fast(anim, (getWidth() - 10) * ((setting.getValue() - setting.getMin()) / (setting.getMax() - setting.getMin())), 25);

        firstSliderPos = (setting.getFirst() - setting.getMin()) / (setting.getMax() - setting.getMin()) * (getWidth() - 10);
        secondSliderPos = (setting.getSecond() - setting.getMin()) / (setting.getMax() - setting.getMin()) * (getWidth() - 10);

        Fonts.normal[16].drawString(stack, setting.getSettingName(), getX() + 4.5f, getY(), ColorUtils.setAlpha(-1, (int) ((255 * getAlpha()) * ClickGuiScreen.getAnim().getValue())));
        Fonts.normal[15].drawString(stack, setting.getFirst() + " - " + setting.getSecond(), getX() + getWidth() - 4.5f - Fonts.normal[15].getStringWidth(setting.getFirst() + " - " + setting.getSecond()), getY() + 0.5f, ColorUtils.setAlpha(-1, (int) ((255 * getAlpha()) * ClickGuiScreen.getAnim().getValue())));

        Color c1 = Overlay.getClientColorWithAlphaC((int) getY(), (float) ((255 * getAlpha()) * ClickGuiScreen.getAnim().getValue()));
        Color c2 = Overlay.getClientColorWithAlphaC((int) getX(), (float) ((255 * getAlpha()) * ClickGuiScreen.getAnim().getValue()));
        Color c3 = ColorUtils.intToColor(ColorUtils.setAlpha(-1, (int) ((255 * getAlpha()) * ClickGuiScreen.getAnim().getValue())));

        RenderUtil.drawRect(stack, getX() + 5, getY() + 9, getWidth() - 10, 2, ColorUtils.intToColor(ColorUtils.rgba(40, 40, 40, (int) ((255 * getAlpha()) * ClickGuiScreen.getAnim().getValue()))));
        RenderUtil.drawRect(stack, getX() + 5 + firstSliderPos, getY() + 9, secondSliderPos - firstSliderPos, 2, c1, c2);

        RenderUtil.drawRect(stack, getX() + 5 + firstSliderPos, getY() + 8, 2, 4, c3);
        RenderUtil.drawRect(stack, getX() + 5 + secondSliderPos, getY() + 8, 2, 4, c3);

        if (setting.getFirst() >= setting.getSecond()) {
            float newFirst = MathHelper.clamp(setting.getFirst() - setting.getStep(), setting.getMin(), setting.getMax());
            setting.setFirst(newFirst);
        }
        if (setting.getSecond() <= setting.getFirst()) {
            float newSecond = MathHelper.clamp(setting.getSecond() + setting.getStep(), setting.getMin(), setting.getMax());
            setting.setSecond(newSecond);
        }

        if (draggingFirst || draggingSecond) {
            float mouseRelativePos = (mouseX - getX() - 5) / (getWidth() - 10);
            float newValue = MathHelper.clamp(mouseRelativePos * (setting.getMax() - setting.getMin()) + setting.getMin(), setting.getMin(), setting.getMax());

            newValue = Math.round(newValue / setting.getStep()) * setting.getStep();

            if (draggingFirst) {
                setting.setFirst(newValue);
                if (setting.getFirst() > setting.getSecond()) {
                    setting.setFirst(setting.getSecond());
                }
            } else if (draggingSecond) {
                setting.setSecond(newValue);
                if (setting.getSecond() < setting.getFirst()) {
                    setting.setSecond(setting.getFirst());
                }
            }
        }

    }

    [USER=1367676]@override[/USER]
    public void mouseClick(float mouseX, float mouseY, int mouse) {
        boolean hover1 = MouseUtil.isHovered(mouseX, mouseY, getX() + 3 + firstSliderPos, getY() + 8, 6, 4);
        boolean hover2 = MouseUtil.isHovered(mouseX, mouseY, getX() + 3 + secondSliderPos, getY() + 8, 6, 4);

        if (hover1 && hover2) {
            if (Math.abs(mouseX - (getX() + 3 + firstSliderPos)) < Math.abs(mouseX - (getX() + 3 + secondSliderPos))) {
                draggingFirst = true;
                draggingSecond = false;
            } else {
                draggingSecond = true;
                draggingFirst = false;
            }
        } else if (hover1) {
            draggingFirst = true;
            draggingSecond = false;
        } else if (hover2) {
            draggingSecond = true;
            draggingFirst = false;
        }

        super.mouseClick(mouseX, mouseY, mouse);
    }


    [USER=1367676]@override[/USER]
    public void mouseRelease(float mouseX, float mouseY, int mouse) {
        draggingFirst = false;
        draggingSecond = false;
        super.mouseRelease(mouseX, mouseY, mouse);
    }

    [USER=1367676]@override[/USER]
    public boolean isVisible() {
        return setting.getVisible().getAsBoolean();
    }
}
интересно, базу на фабрике легко сделать я хз чо типы просят
 
Назад
Сверху Снизу