-
Автор темы
- #1
Перед прочтением основного контента ниже, пожалуйста, обратите внимание на обновление внутри секции Майна на нашем форуме. У нас появились:
- бесплатные читы для Майнкрафт — любое использование на свой страх и риск;
- маркетплейс Майнкрафт — абсолютно любая коммерция, связанная с игрой, за исключением продажи читов (аккаунты, предоставления услуг, поиск кодеров читов и так далее);
- приватные читы для Minecraft — в этом разделе только платные хаки для игры, покупайте группу "Продавец" и выставляйте на продажу свой софт;
- обсуждения и гайды — всё тот же раздел с вопросами, но теперь модернизированный: поиск нужных хаков, пати с игроками-читерами и другая полезная информация.
Спасибо!
Помогите пожалуйста, как мне сделать чтобы эти иконки были по всем категориям ? Так же хотелось бы чтобы эти категории были с больших букв.
Заранее спасибо
Вот код:
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;
}
}