-
Автор темы
- #1
Перед прочтением основного контента ниже, пожалуйста, обратите внимание на обновление внутри секции Майна на нашем форуме. У нас появились:
- бесплатные читы для Майнкрафт — любое использование на свой страх и риск;
- маркетплейс Майнкрафт — абсолютно любая коммерция, связанная с игрой, за исключением продажи читов (аккаунты, предоставления услуг, поиск кодеров читов и так далее);
- приватные читы для Minecraft — в этом разделе только платные хаки для игры, покупайте группу "Продавец" и выставляйте на продажу свой софт;
- обсуждения и гайды — всё тот же раздел с вопросами, но теперь модернизированный: поиск нужных хаков, пати с игроками-читерами и другая полезная информация.
Спасибо!
Java:
package fun.rich.client.ui.clickgui;
import fun.rich.client.Rich;
import fun.rich.client.feature.Feature;
import fun.rich.client.feature.impl.FeatureCategory;
import fun.rich.client.feature.impl.hud.ClickGUI;
import fun.rich.client.ui.clickgui.component.AnimationState;
import fun.rich.client.ui.clickgui.component.Component;
import fun.rich.client.ui.clickgui.component.DraggablePanel;
import fun.rich.client.ui.clickgui.component.ExpandableComponent;
import fun.rich.client.ui.clickgui.component.impl.ModuleComponent;
import fun.rich.client.utils.render.RenderUtils;
import fun.rich.client.utils.render.RoundedUtil;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.ScaledResolution;
import java.awt.*;
import java.util.List;
public final class Panel extends DraggablePanel {
Minecraft mc = Minecraft.getMinecraft();
public static final int HEADER_WIDTH = 110;
public static final int X_ITEM_OFFSET = 1;
public static final int ITEM_HEIGHT = 13;
public static final int HEADER_HEIGHT = 17;
public List<Feature> features;
public FeatureCategory type;
public AnimationState state;
private int prevX;
private int prevY;
private boolean dragging;
public Panel(FeatureCategory category, int x, int y) {
super(null, category.name(), x, y, HEADER_WIDTH, HEADER_HEIGHT);
int moduleY = HEADER_HEIGHT;
this.state = AnimationState.STATIC;
this.features = Rich.instance.featureManager.getFeaturesCategory(category);
for (Feature feature : features) {
this.components.add(new ModuleComponent(this, feature, X_ITEM_OFFSET, moduleY, HEADER_WIDTH - (X_ITEM_OFFSET * 2), ITEM_HEIGHT));
moduleY += ITEM_HEIGHT;
}
this.type = category;
}
@Override
public void drawComponent(ScaledResolution scaledResolution, int mouseX, int mouseY) {
if (dragging) {
setX(mouseX - prevX);
setY(mouseY - prevY);
}
int x = getX();
int y = getY();
int width = getWidth();
int height = getHeight();
int headerHeight;
int heightWithExpand = getHeightWithExpand();
headerHeight = (isExpanded() ? heightWithExpand : height);
float startAlpha1 = 0.14f;
int size1 = 25;
float left1 = x + 1.0f;
float right1 = x + width;
float bottom1 = y + headerHeight - 6.0f;
float top1 = y + headerHeight - 2.0f;
float top2 = y + 13.0f;
Color color = new Color(ClickGUI.color.getColorValue());
float extendedHeight = 2;
if(ClickGUI.panelMode.currentMode.equals("Rect")){
RoundedUtil.drawRound(x, y - 16.5f, width, headerHeight + 12, 3 , new Color(0, 0, 0, 65));
RenderUtils.drawBlurredShadow(x, y - 16.5f, width, headerHeight + 12, 10 , new Color(0, 0, 0, 116));
}
mc.rubik_30.drawCenteredString(getName(), x + 53.5f, y + HEADER_HEIGHT / 2F - 16.5f, Color.WHITE.getRGB());
RoundedUtil.drawRound(x, y + 9.5f , width - 0.5f, 0.4f, 0, new Color(119, 118, 118, 255));
//RenderUtils.drawBlurredShadow(x, y + 9.5f , width - 0.5f, 0.4f, 4, new Color(255, 255, 255, 255));
super.drawComponent(scaledResolution, mouseX, mouseY);
if (isExpanded()) {
for (Component component : components) {
component.setY(height);
component.drawComponent(scaledResolution, mouseX, mouseY);
int cHeight = component.getHeight();
if (component instanceof ExpandableComponent) {
ExpandableComponent expandableComponent = (ExpandableComponent) component;
if (expandableComponent.isExpanded()) {
cHeight = expandableComponent.getHeightWithExpand() + 5;
}
}
height += cHeight;
}
}
}
@Override
public void onPress(int mouseX, int mouseY, int button) {
if (button == 0 && !this.dragging) {
dragging = true;
prevX = mouseX - getX();
prevY = mouseY - getY();
}
}
@Override
public void onMouseRelease(int button) {
super.onMouseRelease(button);
dragging = false;
}
@Override
public boolean canExpand() {
return !features.isEmpty();
}
@Override
public int getHeightWithExpand() {
int height = getHeight();
if (isExpanded()) {
for (Component component : components) {
int cHeight = component.getHeight();
if (component instanceof ExpandableComponent) {
ExpandableComponent expandableComponent = (ExpandableComponent) component;
if (expandableComponent.isExpanded())
cHeight = expandableComponent.getHeightWithExpand() + 5;
}
height += cHeight;
}
}
return height;
}
}
Java:
/* */ package fun.rich.client.ui.clickgui.component.impl;
/* */ import fun.rich.client.feature.Feature;
/* */ import fun.rich.client.feature.impl.hud.ClickGUI;
/* */ import fun.rich.client.ui.clickgui.ClickGuiScreen;
/* */ import fun.rich.client.ui.clickgui.component.Component;
/* */ import fun.rich.client.ui.clickgui.component.ExpandableComponent;
/* */ import fun.rich.client.ui.components.SorterHelper;
/* */ import fun.rich.client.ui.settings.Setting;
/* */ import fun.rich.client.ui.settings.impl.*;
/* */
/* */
/* */
/* */ import fun.rich.client.utils.math.TimerHelper;
/* */ import fun.rich.client.utils.render.RenderUtils;
/* */ import java.awt.Color;
/* */ import java.util.Comparator;
/* */ import net.minecraft.client.Minecraft;
/* */ import net.minecraft.client.gui.ScaledResolution;
/* */ import org.lwjgl.input.Keyboard;
/* */
/* */ public final class ModuleComponent extends ExpandableComponent {
/* 22 */ Minecraft mc = Minecraft.getMinecraft();
/* */ private final Feature module;
/* 24 */ public static TimerHelper timerHelper = new TimerHelper();
/* */ private boolean binding;
/* 26 */ int alpha = 0;
/* 27 */ private final TimerHelper descTimer = new TimerHelper();
/* */ public boolean ready;
/* */
/* 30 */ public ModuleComponent(Component parent, Feature module, int x, int y, int width, int height) { super(parent, module.getLabel(), x, y, width, height);
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* 49 */ this.ready = false; this.module = module; int propertyX = 1; for (Setting setting : module.getSettings()) { if (setting instanceof BooleanSetting) { this.components.add(new BooleanSettingComponent((Component)this, (BooleanSetting)setting, propertyX, height, width - 2, 21)); continue; } if (setting instanceof ColorSetting) { this.components.add(new ColorPickerComponent((Component)this, (ColorSetting)setting, propertyX, height, width - 2, 15)); continue; } if (setting instanceof NumberSetting) { this.components.add(new NumberSettingComponent((Component)this, (NumberSetting)setting, propertyX, height, width - 2, 20)); continue; } if (setting instanceof ListSetting) { this.components.add(new ListSettingComponent((Component)this, (ListSetting)setting, propertyX, height, width - 2, 17)); continue; } if (setting instanceof MultipleBoolSetting)
/* 50 */ this.components.add(new MultipleBoolSettingComponent((Component)this, (MultipleBoolSetting)setting, propertyX, height, width - 2, 16)); } } static String i = " ";
/* */
/* */ String getI(String s) {
/* 53 */ if (!timerHelper.hasReached(5.0D)) {
/* 54 */ return i;
/* */ }
/* 56 */ timerHelper.reset();
/* */
/* 58 */ if (i.length() < s.length()) {
/* 59 */ this.ready = false;
/* 60 */ return i += i;
/* */ }
/* 62 */ this.ready = true;
/* 63 */ return i;
/* */ }
/* */
/* */
/* */ public void drawComponent(ScaledResolution scaledResolution, int mouseX, int mouseY) {
/* 68 */ this.components.sort((Comparator)new SorterHelper());
/* 69 */ float x = getX();
/* 70 */ float y = (getY() - 2);
/* 71 */ int width = getWidth();
/* 72 */ int height = getHeight();
/* 73 */ if (isExpanded()) {
/* 74 */ int childY = 15;
/* 75 */ for (Component child : this.components) {
/* 76 */ int cHeight = child.getHeight();
/* 77 */ if (child instanceof BooleanSettingComponent) {
/* 78 */ BooleanSettingComponent booleanSettingComponent = (BooleanSettingComponent)child;
/* 79 */ if (!booleanSettingComponent.booleanSetting.isVisible()) {
/* */ continue;
/* */ }
/* */ }
/* 83 */ if (child instanceof NumberSettingComponent) {
/* 84 */ NumberSettingComponent numberSettingComponent = (NumberSettingComponent)child;
/* 85 */ if (!numberSettingComponent.numberSetting.isVisible()) {
/* */ continue;
/* */ }
/* */ }
/* */
/* 90 */ if (child instanceof ColorPickerComponent) {
/* 91 */ ColorPickerComponent colorPickerComponent = (ColorPickerComponent)child;
/* 92 */ if (!colorPickerComponent.getSetting().isVisible()) {
/* */ continue;
/* */ }
/* */ }
/* 96 */ if (child instanceof ListSettingComponent) {
/* 97 */ ListSettingComponent listSettingComponent = (ListSettingComponent)child;
/* 98 */ if (!listSettingComponent.getSetting().isVisible()) {
/* */ continue;
/* */ }
/* */ }
/* 102 */ if (child instanceof ExpandableComponent) {
/* 103 */ ExpandableComponent expandableComponent = (ExpandableComponent)child;
/* 104 */ if (expandableComponent.isExpanded()) cHeight = expandableComponent.getHeightWithExpand();
/* */ }
/* 106 */ child.setY(childY);
/* 107 */ child.drawComponent(scaledResolution, mouseX, mouseY);
/* 108 */ childY += cHeight;
/* */ }
/* */ }
/* 111 */ if (!ClickGuiScreen.search.getText().isEmpty() && !this.module.getLabel().toLowerCase().contains(ClickGuiScreen.search.getText().toLowerCase()))
/* */ return;
/* 113 */ Color color = new Color(ClickGUI.color.getColorValue());
/* 114 */ Color color2 = new Color(color.getRed(), color.getGreen(), color.getBlue(), 140);
/* 115 */ boolean hovered = isHovered(mouseX, mouseY);
/* */
/* */
/* 118 */ if (this.components.size() > 0.5D) {
/* 119 */ this.mc.rubik_18.drawStringWithShadow(isExpanded() ? "?" : "?", (x + width - 8.5F), (y + height / 2.0F) - 3.5D, -1);
/* */ }
/* */
/* 122 */ this.components.sort((Comparator)new SorterHelper());
/* 123 */ if (hovered && this.module.getDesc() != null) {
/* 124 */ RenderUtils.drawShadow(5.0F, 1.0F, () -> {
/* */ ScaledResolution sr = new ScaledResolution(this.mc);
/* */
/* */
/* */ if (!hovered) {
/* */ i = " ";
/* */ }
/* */
/* */ RenderUtils.drawRect((sr.getScaledWidth() / 2 - this.mc.sfui16.getStringWidth(this.module.getDesc()) / 2 - 10), (sr.getScaledHeight() - 25), (sr.getScaledWidth() / 2 + this.mc.rubik_16.getStringWidth(this.module.getDesc()) / 2 + 10), sr.getScaledHeight(), (new Color(0, 0, 0, 150)).getRGB());
/* */
/* */ this.mc.rubik_16.drawCenteredStringWithShadow((this.module == null) ? "null pointer :(" : getI(this.module.getDesc()), sr.getScaledWidth() / 2.0F, (sr.getScaledHeight() - 10), -1);
/* */
/* */ RenderUtils.drawRect((sr.getScaledWidth() / 2 - this.mc.sfui16.getStringWidth(this.module.getDesc()) / 2 - 10), (sr.getScaledHeight() - 25), (sr.getScaledWidth() / 2 + this.mc.rubik_16.getStringWidth(this.module.getDesc()) / 2 + 10), (sr.getScaledHeight() - 26), color2.getRGB());
/* */
/* */ if (!ClickGUI.potato_mode.getBoolValue()) {
/* */ this.mc.rubik_16.drawCenteredBlurredString(this.module.getLabel(), (sr.getScaledWidth() / 2), (sr.getScaledHeight() - 21), 8, new Color(255, 255, 255, 255), -1);
/* */ } else {
/* */ this.mc.rubik_16.drawCenteredString(this.module.getLabel(), (sr.getScaledWidth() / 2), (sr.getScaledHeight() - 21), -1);
/* */ }
/* */ });
/* */
/* 145 */ ScaledResolution sr = new ScaledResolution(this.mc);
/* */
/* 147 */ if (!hovered) {
/* 148 */ i = " ";
/* */ }
/* 150 */ RenderUtils.drawRect((sr.getScaledWidth() / 2 - this.mc.rubik_16.getStringWidth(this.module.getDesc()) / 2 - 10), (sr.getScaledHeight() - 25), (sr.getScaledWidth() / 2 + this.mc.rubik_16.getStringWidth(this.module.getDesc()) / 2 + 10), sr.getScaledHeight(), (new Color(0, 0, 0, 150)).getRGB());
/* 151 */ this.mc.rubik_16.drawCenteredStringWithShadow((this.module == null) ? "null pointer :(" : getI(this.module.getDesc()), sr.getScaledWidth() / 2.0F, (sr.getScaledHeight() - 10), -1);
/* */
/* */
/* 154 */ RenderUtils.drawRect((sr.getScaledWidth() / 2 - this.mc.rubik_16.getStringWidth(this.module.getDesc()) / 2 - 10), (sr.getScaledHeight() - 25), (sr.getScaledWidth() / 2 + this.mc.rubik_16.getStringWidth(this.module.getDesc()) / 2 + 10), (sr.getScaledHeight() - 26), color2.getRGB());
/* 155 */ if (!ClickGUI.potato_mode.getBoolValue()) {
/* 156 */ this.mc.rubik_16.drawCenteredBlurredString(this.module.getLabel(), (sr.getScaledWidth() / 2), (sr.getScaledHeight() - 21), 8, new Color(255, 255, 255, 255), -1);
/* */ } else {
/* */
/* 159 */ this.mc.rubik_16.drawCenteredString(this.module.getLabel(), (sr.getScaledWidth() / 2), (sr.getScaledHeight() - 21), -1);
/* */ }
/* */
/* 162 */ if (this.module == null) { i = ""; }
/* */
/* 164 */ else if (this.ready && !i.equals(this.module.getDesc())) { i = ""; }
/* */
/* */ } else {
/* 167 */ this.ready = false;
/* */ }
/* */
/* 170 */ if (this.module.isEnabled()) {
/* */
/* 172 */ if (!ClickGUI.potato_mode.getBoolValue() && ClickGUI.glow.getBoolValue()) {
/* 173 */ this.mc.rubik_16.drawCenteredBlurredStringWithShadow(this.binding ? ("Press a key.. " + Keyboard.getKeyName(this.module.getBind())) : getName(), (x + 53.5F), (y + height / 2.0F - 3.0F), (int)ClickGUI.glowRadius2.getNumberValue(), this.module.isEnabled() ? RenderUtils.injectAlpha(new Color((new Color(color.getRed(), color.getGreen(), color.getBlue())).getRGB()), 100) : Color.GRAY, this.module.isEnabled() ? ClickGUI.color.getColorValue() : Color.GRAY.getRGB());
/* */ } else {
/* 175 */ this.mc.rubik_16.drawCenteredStringWithShadow(this.binding ? ("Press a key.. " + Keyboard.getKeyName(this.module.getBind())) : getName(), x + 53.5F, y + height / 2.0F - 3.0F, this.module.isEnabled() ? color.getRGB() : Color.GRAY.getRGB());
/* */ }
/* */ } else {
/* 178 */ this.mc.rubik_16.drawCenteredStringWithShadow(this.binding ? ("Press a key.. " + Keyboard.getKeyName(this.module.getBind())) : getName(), x + 53.5F, y + height / 2.0F - 3.0F, this.module.isEnabled() ? (new Color(color.getRGB())).getRGB() : Color.GRAY.getRGB());
/* */ }
/* */ }
/* */
/* */
/* */ public boolean canExpand() {
/* 184 */ return !this.components.isEmpty();
/* */ }
/* */
/* */
/* */ public void onPress(int mouseX, int mouseY, int button) {
/* 189 */ switch (button) {
/* */ case 0:
/* 191 */ this.module.toggle();
/* */ break;
/* */ case 2:
/* 194 */ this.binding = !this.binding;
/* */ break;
/* */ }
/* */ }
/* */
/* */
/* */ public void onKeyPress(int keyCode) {
/* 201 */ if (this.binding) {
/* 202 */ ClickGuiScreen.escapeKeyInUse = true;
/* 203 */ this.module.setBind((keyCode == 211) ? 0 : keyCode);
/* 204 */ this.binding = false;
/* */ }
/* */ }
/* */
/* */
/* */ public int getHeightWithExpand() {
/* 210 */ int height = getHeight();
/* 211 */ if (isExpanded()) {
/* 212 */ for (Component child : this.components) {
/* 213 */ int cHeight = child.getHeight();
/* 214 */ if (child instanceof BooleanSettingComponent) {
/* 215 */ BooleanSettingComponent booleanSettingComponent = (BooleanSettingComponent)child;
/* 216 */ if (!booleanSettingComponent.booleanSetting.isVisible()) {
/* */ continue;
/* */ }
/* */ }
/* 220 */ if (child instanceof NumberSettingComponent) {
/* 221 */ NumberSettingComponent numberSettingComponent = (NumberSettingComponent)child;
/* 222 */ if (!numberSettingComponent.numberSetting.isVisible()) {
/* */ continue;
/* */ }
/* */ }
/* 226 */ if (child instanceof ColorPickerComponent) {
/* 227 */ ColorPickerComponent colorPickerComponent = (ColorPickerComponent)child;
/* 228 */ if (!colorPickerComponent.getSetting().isVisible()) {
/* */ continue;
/* */ }
/* */ }
/* 232 */ if (child instanceof ListSettingComponent) {
/* 233 */ ListSettingComponent listSettingComponent = (ListSettingComponent)child;
/* 234 */ if (!listSettingComponent.getSetting().isVisible()) {
/* */ continue;
/* */ }
/* */ }
/* 238 */ if (child instanceof ExpandableComponent) {
/* 239 */ ExpandableComponent expandableComponent = (ExpandableComponent)child;
/* 240 */ if (expandableComponent.isExpanded()) cHeight = expandableComponent.getHeightWithExpand();
/* */ }
/* 242 */ height += cHeight;
/* */ }
/* */ }
/* 245 */ return height;
/* */ }
/* */ }
/* Location: C:\Users\C523~1\AppData\Local\Temp\Rar$DRa6544.15747\Meteor\Meteor.jar!\fun\rich\clien\\ui\clickgui\component\impl\ModuleComponent.class
* Java compiler version: 18 (62.0)
* JD-Core Version: 1.1.3
*/
пов замените шрифт любой на тенасити братики