Начинающий
- Статус
- Оффлайн
- Регистрация
- 1 Авг 2024
- Сообщения
- 413
- Реакции
- 0
Перед прочтением основного контента ниже, пожалуйста, обратите внимание на обновление внутри секции Майна на нашем форуме. У нас появились:
- бесплатные читы для Майнкрафт — любое использование на свой страх и риск;
- маркетплейс Майнкрафт — абсолютно любая коммерция, связанная с игрой, за исключением продажи читов (аккаунты, предоставления услуг, поиск кодеров читов и так далее);
- приватные читы для Minecraft — в этом разделе только платные хаки для игры, покупайте группу "Продавец" и выставляйте на продажу свой софт;
- обсуждения и гайды — всё тот же раздел с вопросами, но теперь модернизированный: поиск нужных хаков, пати с игроками-читерами и другая полезная информация.
Спасибо!
Помогите!!!
есть у меня такая мейн менюшка, при изменении разрешения экрана она короче ломается
можете помочь, как это зафиксить?
Код -
есть у меня такая мейн менюшка, при изменении разрешения экрана она короче ломается
можете помочь, как это зафиксить?
Код -
Код:
package wtf.season.ui.mainmenu;
import com.mojang.blaze3d.matrix.MatrixStack;
import wtf.season.Season;
import wtf.season.altmanager.AccountManagement;
import wtf.season.utils.client.ClientUtil;
import wtf.season.utils.client.IMinecraft;
import wtf.season.utils.client.Vec2i;
import wtf.season.utils.math.MathUtil;
import wtf.season.utils.render.*;
import wtf.season.utils.render.font.Fonts;
import lombok.AllArgsConstructor;
import lombok.Getter;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.screen.MultiplayerScreen;
import net.minecraft.client.gui.screen.OptionsScreen;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.screen.WorldSelectionScreen;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.Util;
import net.minecraft.util.math.vector.Vector4f;
import net.minecraft.util.text.ITextComponent;
import java.util.ArrayList;
import java.util.List;
public class MainScreen extends Screen implements IMinecraft {
public MainScreen() {
super(ITextComponent.getTextComponentOrEmpty(""));
}
private final List<Button> buttons = new ArrayList<>();
private boolean blursex = true;
@Override
public void init(Minecraft minecraft, int width, int height) {
super.init(minecraft, width, height);
float widthButton = 430 / 3f;
float x = ClientUtil.calc(width) / 2f - widthButton / 2f;
float y = Math.round(ClientUtil.calc(height) / 2f - 24);
buttons.clear();
buttons.add(new Button(x, y, 71, 58 / 2f, "Single", () -> {
mc.displayGuiScreen(new WorldSelectionScreen(this));
}));
y += 50 / 2f - 25;
buttons.add(new Button(x + 72, y, 71, 58 / 2f, "Multi", () -> {
mc.displayGuiScreen(new MultiplayerScreen(this));
}));
y += 50 / 2f + 5;
buttons.add(new Button(x, y, widthButton, 58 / 2f, "AltManager", () -> {
mc.displayGuiScreen(new AccountManagement());
}));
y -= 8 / 2f + 5;
buttons.add(new Button(x, y + 39, 71, 58 / 2f, "Options", () -> {
mc.displayGuiScreen(new OptionsScreen(this, mc.gameSettings));
}));
y += 68 / 2f + 5;
buttons.add(new Button(x + 72, y, 71, 58 / 2f, "Leave", mc::shutdownMinecraftApplet));
}
@Override
public boolean mouseScrolled(double mouseX, double mouseY, double delta) {
Season.getInstance().getAltWidget().updateScroll((int) mouseX, (int) mouseY, (float) delta);
return super.mouseScrolled(mouseX, mouseY, delta);
}
@Override
public void render(MatrixStack matrixStack, int mouseX, int mouseY, float partialTicks) {
super.render(matrixStack, mouseX, mouseY, partialTicks);
DisplayUtils.drawGradientRound(0, 0, width, height, 3, ColorUtils.rgba(45, 46, 65, 255), ColorUtils.rgba(0, 0, 15, 189), ColorUtils.rgba(0, 0, 15, 189), ColorUtils.rgba(0, 0, 15, 255));
DisplayUtils.drawRoundedRect(380, 140, 200, 280 -60, 22, ColorUtils.rgba(45, 46, 65, 255));
DisplayUtils.drawGradientRound(380 +2f, 140 +2f, 196, 276 -60, 22, ColorUtils.rgba(25, 26, 45, 255), ColorUtils.rgba(0, 0, 15, 189), ColorUtils.rgba(0, 0, 15, 189), ColorUtils.rgba(0, 0, 15, 255));
int desccolor2 = ColorUtils.rgba(255, 255, 255, 130);
int desccolor22 = ColorUtils.rgba(255, 255, 255, 60);
DisplayUtils.drawRoundedRect(408, 162, 196-52, 26, new Vector4f(3, 3, 3, 3), ColorUtils.rgba(45, 46, 65, 255));
DisplayUtils.drawRoundedRect(408 +0.5f, 162 +0.5f, 195-52, 25, new Vector4f(3, 3, 3, 3), ColorUtils.rgba(0, 0, 15, 189));
DisplayUtils.drawImage(new ResourceLocation("expensive/images/hud/logoseason.png"),434 +20, 166, 18, 18, ColorUtils.rgba(129,135,255, 255));
Scissor.push();
Scissor.setFromComponentCoordinates(409, 163, 194 -52, 24);
DisplayUtils.drawImage(new ResourceLocation("expensive/images/hud/pizda.png"),424 +20, 136, 134, 94, ColorUtils.rgba(129,135,255, 70));
DisplayUtils.drawRectVerticalW(408, 162, 196-52, 26, ColorUtils.rgba(0, 0, 15, 55), ColorUtils.rgba(0, 0, 15, 255));
DisplayUtils.drawRectVerticalW(408, 162, 196-52, 26, ColorUtils.rgba(0, 0, 15, 50), ColorUtils.rgba(0, 0, 15, 12));
Scissor.pop();
Scissor.unset();
DisplayUtils.drawRoundedRect(408, 189, 196 -52, 26, new Vector4f(3, 3, 3, 3), ColorUtils.rgba(45, 46, 65, 255));
DisplayUtils.drawRoundedRect(408 +0.5f, 189 +0.5f, 195-52, 25, new Vector4f(3, 3, 3, 3), ColorUtils.rgba(0, 0, 15, 189));
Scissor.push();
Scissor.setFromComponentCoordinates(409, 163+26, 194 -52, 24);
DisplayUtils.drawImage(new ResourceLocation("expensive/images/hud/pizda.png"),424 +20, 136+26, 134, 94, ColorUtils.rgba(129,135,255, 70));
DisplayUtils.drawRectVerticalW(408, 162+26, 196-52, 26, ColorUtils.rgba(0, 0, 15, 55), ColorUtils.rgba(0, 0, 15, 255));
DisplayUtils.drawRectVerticalW(408, 162 +26, 196-52, 26, ColorUtils.rgba(0, 0, 15, 50), ColorUtils.rgba(0, 0, 15, 12));
Scissor.pop();
Scissor.unset();
Fonts.sfregular.drawCenteredText(matrixStack, "Season", 412 +20, 170, desccolor2, 10, .06F);
Fonts.sfregular.drawCenteredText(matrixStack, "Socials", 412 +20, 196, desccolor2, 10, .06F);
Fonts.sfregular.drawText(matrixStack, "Season - лучшее решение!", 417, 226, desccolor22, 9, .06F);
if (blursex == true){
KawaseBlur.blur.updateBlur(2, 1);
KawaseBlur.blur.render(() -> {
DisplayUtils.drawRoundedRect(416, 226, 144, 10, 0, -1);
});
}
DisplayUtils.drawImage(new ResourceLocation("expensive/images/hud/telegram.png"),434 +20, 136+56, 18, 18, ColorUtils.rgba(129,135,255, 70));
mc.gameRenderer.setupOverlayRendering(2);
drawButtons(matrixStack, mouseX, mouseY , partialTicks);
mc.gameRenderer.setupOverlayRendering();
}
@Override
public boolean charTyped(char codePoint, int modifiers) {
Season.getInstance().getAltWidget().onChar(codePoint);
return super.charTyped(codePoint, modifiers);
}
@Override
public boolean keyPressed(int keyCode, int scanCode, int modifiers) {
Season.getInstance().getAltWidget().onKey(keyCode);
return false;
}
@Override
public boolean mouseClicked(double mouseX, double mouseY, int button) {
Vec2i fixed = ClientUtil.getMouse((int) mouseX, (int) mouseY);
buttons.forEach(b -> b.click(fixed.getX(), fixed.getY(), button));
Season.getInstance().getAltWidget().click(fixed.getX(), fixed.getY(), button);
return super.mouseClicked(mouseX, mouseY, button);
}
private void drawButtons(MatrixStack stack, int mX, int mY, float pt) {
buttons.forEach(b -> b.render(stack, mX, mY, pt));
}
public static final ResourceLocation button = new ResourceLocation("expensive/images/button.png");
@AllArgsConstructor
private class Button {
@Getter
private final float x, y, width, height;
private String text;
private Runnable action;
public void render(MatrixStack stack, int mouseX, int mouseY, float pt) {
DisplayUtils.drawRoundedRect(x, y + 2, width, height, 3, ColorUtils.rgba(45, 46, 65, 189));
DisplayUtils.drawRoundedRect(x+ 0.5f, y + 2 +0.5f, width -1, height-1, 3, ColorUtils.rgba(5, 5, 20, 189));
float callwidfikdsikf = Fonts.sfregular.getWidth(text, 9, .06f);
DisplayUtils.drawImage(new ResourceLocation("expensive/images/mainmenu/" + text + ".png"), x + 9 + callwidfikdsikf, y + 10, 12, 12, ColorUtils.rgba(129,135,255, 70));
if (MathUtil.isInRegion(mouseX, mouseY, x, y + 2, width, height)) {
int color = ColorUtils.rgba(255, 255, 255, 190);
Fonts.sfregular.drawText(stack, text, x + 6 , y + height / 2f - 5.5f + 2, color, 9f, .06f);
}
else {
int color = ColorUtils.rgba(255, 255, 255, 130);
Fonts.sfregular.drawText(stack, text, x + 6, y + height / 2f - 5.5f + 2, color, 9f, .06f);
}
}
public void click(int mouseX, int mouseY, int button) {
if (MathUtil.isInRegion(mouseX, mouseY, x, y, width, height)) {
action.run();
}
if (MathUtil.isInRegion(mouseX, mouseY, 434 +20, 136+56, 18, 18)) {
Util.getOSType().openURI("https://t.me/seasondlc");
}
if (MathUtil.isInRegion(mouseX, mouseY,408, 226, 144, 10)) {
if (blursex == true){
blursex = false;
}
else {
blursex = true;
}
}
}
}
}