mirror of
https://github.com/refactorinqq/SLC-1.8.9.git
synced 2024-11-10 07:51:32 +01:00
Premium Bandana Color Picker
This commit is contained in:
parent
d1bcfe3fd4
commit
dcd58ab7b6
@ -10,11 +10,11 @@ import java.awt.*;
|
|||||||
public class ColorPicker {
|
public class ColorPicker {
|
||||||
public static void render(int x, int y, int width, String name, int color) {
|
public static void render(int x, int y, int width, String name, int color) {
|
||||||
Client.getInstance().getSilentFontRenderer().drawString(name, x + 100, y - 2, 12, SilentFontRenderer.FontType.TITLE);
|
Client.getInstance().getSilentFontRenderer().drawString(name, x + 100, y - 2, 12, SilentFontRenderer.FontType.TITLE);
|
||||||
RenderUtil.drawRoundedRect(x + width - 20, y + 1, 15, 9, 5, color);
|
RenderUtil.drawRoundedRect(x + width - 20, y + 1, 15, 8, 5, color);
|
||||||
RenderUtil.drawRoundedOutline(x + width - 20, y + 1, 15, 8, 5, 2, new Color(255, 255, 255).getRGB());
|
RenderUtil.drawRoundedOutline(x + width - 20, y + 1, 15, 8, 5, 2, new Color(255, 255, 255).getRGB());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isHovered(int mouseX, int mouseY, int x, int y, int width) {
|
public static boolean isHovered(int mouseX, int mouseY, int x, int y, int width) {
|
||||||
return MouseUtils.isInside(mouseX, mouseY, x + width - 20, y + 1, 15, 9);
|
return MouseUtils.isInside(mouseX, mouseY, x + width - 20, y + 1, 15, 8);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -108,6 +108,7 @@ public class ModMenu extends SilentScreen {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void drawOverlayListBase(float height, String header) {
|
public static void drawOverlayListBase(float height, String header) {
|
||||||
|
ModMenu.introAnimation.setValue(0);
|
||||||
GlStateManager.translate(ModMenu.introAnimation.getValue(), 0, 0);
|
GlStateManager.translate(ModMenu.introAnimation.getValue(), 0, 0);
|
||||||
RenderUtils.drawRect(0, 0, 150, height, Theme.backgroundColor().getRGB());
|
RenderUtils.drawRect(0, 0, 150, height, Theme.backgroundColor().getRGB());
|
||||||
RenderUtil.drawImage(new ResourceLocation("silentclient/logos/logo.png"), 3, 3, 97.7F, 19);
|
RenderUtil.drawImage(new ResourceLocation("silentclient/logos/logo.png"), 3, 3, 97.7F, 19);
|
||||||
@ -118,12 +119,6 @@ public class ModMenu extends SilentScreen {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
|
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
|
||||||
if(ModMenu.introAnimation.getValue() == 0) {
|
|
||||||
ModMenu.loaded = true;
|
|
||||||
}
|
|
||||||
if(!loaded) {
|
|
||||||
ModMenu.introAnimation.setAnimation(0, 30);
|
|
||||||
}
|
|
||||||
MenuBlurUtils.renderBackground(this);
|
MenuBlurUtils.renderBackground(this);
|
||||||
ModMenu.drawOverlayListBase(height, modCategory == ModCategory.PLUS ? "Premium" : null);
|
ModMenu.drawOverlayListBase(height, modCategory == ModCategory.PLUS ? "Premium" : null);
|
||||||
|
|
||||||
@ -416,6 +411,7 @@ public class ModMenu extends SilentScreen {
|
|||||||
premiumY += 15;
|
premiumY += 15;
|
||||||
if(RegularColorPicker.isHovered(mouseX, mouseY, 3, (int) premiumY, 144)) {
|
if(RegularColorPicker.isHovered(mouseX, mouseY, 3, (int) premiumY, 144)) {
|
||||||
// Color Picker
|
// Color Picker
|
||||||
|
mc.displayGuiScreen(new PremiumColorPicker(this));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
premiumY += 15;
|
premiumY += 15;
|
||||||
|
@ -0,0 +1,136 @@
|
|||||||
|
package net.silentclient.client.gui.modmenu;
|
||||||
|
|
||||||
|
import net.minecraft.client.gui.GuiButton;
|
||||||
|
import net.minecraft.client.gui.GuiScreen;
|
||||||
|
import net.silentclient.client.Client;
|
||||||
|
import net.silentclient.client.gui.SilentScreen;
|
||||||
|
import net.silentclient.client.gui.elements.Button;
|
||||||
|
import net.silentclient.client.gui.elements.Checkbox;
|
||||||
|
import net.silentclient.client.gui.lite.clickgui.utils.MouseUtils;
|
||||||
|
import net.silentclient.client.gui.util.RenderUtil;
|
||||||
|
import net.silentclient.client.utils.MenuBlurUtils;
|
||||||
|
|
||||||
|
import java.awt.*;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
public class PremiumColorPicker extends SilentScreen {
|
||||||
|
private long initTime;
|
||||||
|
private final GuiScreen parentScreen;
|
||||||
|
private ArrayList<Color> colors = new ArrayList<Color>();
|
||||||
|
|
||||||
|
public PremiumColorPicker(GuiScreen parentScreen) {
|
||||||
|
this.parentScreen = parentScreen;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void initGui() {
|
||||||
|
super.initGui();
|
||||||
|
this.initTime = System.currentTimeMillis();
|
||||||
|
this.buttonList.clear();
|
||||||
|
this.silentInputs.clear();
|
||||||
|
|
||||||
|
MenuBlurUtils.loadBlur();
|
||||||
|
|
||||||
|
ModMenu.initBaseButtons(this.buttonList);
|
||||||
|
this.buttonList.add(new Button(1, 3, 26, 144, 15, "Back"));
|
||||||
|
|
||||||
|
colors.clear();
|
||||||
|
colors.add(new Color(255, 255, 255));
|
||||||
|
colors.add(new Color(156, 157, 151));
|
||||||
|
colors.add(new Color(71,79,82));
|
||||||
|
colors.add(new Color(0, 0, 0));
|
||||||
|
colors.add(new Color(255,216,61));
|
||||||
|
colors.add(new Color(249,128,29));
|
||||||
|
colors.add(new Color(176,46,38));
|
||||||
|
colors.add(new Color(130,84,50));
|
||||||
|
colors.add(new Color(128,199,31));
|
||||||
|
colors.add(new Color(58,179,218));
|
||||||
|
colors.add(new Color(22,156,157));
|
||||||
|
colors.add(new Color(60,68,169));
|
||||||
|
colors.add(new Color(243,140,170));
|
||||||
|
colors.add(new Color(198,79,189));
|
||||||
|
colors.add(new Color(137,50,183));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
|
||||||
|
MenuBlurUtils.renderBackground(this);
|
||||||
|
|
||||||
|
ModMenu.drawOverlayListBase(height, "Choose a color");
|
||||||
|
|
||||||
|
super.drawScreen(mouseX, mouseY, partialTicks);
|
||||||
|
|
||||||
|
ModMenu.trimContentStart(width, height);
|
||||||
|
float colorY = 66;
|
||||||
|
int colorX = 3;
|
||||||
|
int colorIndex = 0;
|
||||||
|
for(Color color : colors) {
|
||||||
|
RenderUtil.drawRoundedRect(colorX, colorY, 20, 20, 3, new Color(color.getRed(), color.getGreen(), color.getBlue()).getRGB());
|
||||||
|
RenderUtil.drawRoundedOutline(colorX, colorY, 20, 20, 3, 2, new Color(0, 0, 0).getRGB());
|
||||||
|
colorX += 25;
|
||||||
|
colorIndex += 1;
|
||||||
|
if(colorIndex == 6) {
|
||||||
|
colorIndex = 0;
|
||||||
|
colorX = 3;
|
||||||
|
colorY += 25;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int settingHeight = 15;
|
||||||
|
colorY += settingHeight;
|
||||||
|
colorY += settingHeight;
|
||||||
|
|
||||||
|
Checkbox.render(mouseX, mouseY, 3, colorY, "Chroma", Client.getInstance().getAccount().getBandanaColor() == 50);
|
||||||
|
|
||||||
|
ModMenu.trimContentEnd();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void actionPerformed(GuiButton button) throws IOException {
|
||||||
|
super.actionPerformed(button);
|
||||||
|
ModMenu.clickBaseButtons(button, this);
|
||||||
|
|
||||||
|
switch (button.id) {
|
||||||
|
case 1:
|
||||||
|
mc.displayGuiScreen(parentScreen);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException {
|
||||||
|
super.mouseClicked(mouseX, mouseY, mouseButton);
|
||||||
|
float colorY = 66;
|
||||||
|
int colorX = 3;
|
||||||
|
int colorIndex = 0;
|
||||||
|
for(Color color : colors) {
|
||||||
|
if(MouseUtils.isInside(mouseX, mouseY, colorX, colorY, 20, 20)) {
|
||||||
|
Client.getInstance().getAccount().setBandanaColor(color.getRGB());
|
||||||
|
mc.displayGuiScreen(parentScreen);
|
||||||
|
}
|
||||||
|
colorX += 25;
|
||||||
|
colorIndex += 1;
|
||||||
|
if(colorIndex == 6) {
|
||||||
|
colorIndex = 0;
|
||||||
|
colorX = 3;
|
||||||
|
colorY += 25;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int settingHeight = 15;
|
||||||
|
colorY += settingHeight;
|
||||||
|
colorY += settingHeight;
|
||||||
|
|
||||||
|
if(Checkbox.isHovered(mouseX, mouseY, 3, colorY)) {
|
||||||
|
Client.getInstance().getAccount().setBandanaColor(Client.getInstance().getAccount().getBandanaColor() == 50 ? -1 : 50);
|
||||||
|
mc.displayGuiScreen(parentScreen);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onGuiClosed() {
|
||||||
|
super.onGuiClosed();
|
||||||
|
MenuBlurUtils.unloadBlur();
|
||||||
|
}
|
||||||
|
}
|
@ -10,11 +10,11 @@ import java.awt.*;
|
|||||||
public class RegularColorPicker {
|
public class RegularColorPicker {
|
||||||
public static void render(float x, float y, int width, String name, int color) {
|
public static void render(float x, float y, int width, String name, int color) {
|
||||||
Client.getInstance().getSilentFontRenderer().drawString(name, x, y - 1, 12, SilentFontRenderer.FontType.TITLE);
|
Client.getInstance().getSilentFontRenderer().drawString(name, x, y - 1, 12, SilentFontRenderer.FontType.TITLE);
|
||||||
RenderUtil.drawRoundedRect(x + width - 15, y + 2, 15, 9, 5, color);
|
RenderUtil.drawRoundedRect(x + width - 15, y + 2, 15, 8, 5, color);
|
||||||
RenderUtil.drawRoundedOutline(x + width - 15, y + 2, 15, 8, 5, 2, new Color(255, 255, 255).getRGB());
|
RenderUtil.drawRoundedOutline(x + width - 15, y + 2, 15, 8, 5, 2, new Color(255, 255, 255).getRGB());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isHovered(int mouseX, int mouseY, int x, int y, int width) {
|
public static boolean isHovered(int mouseX, int mouseY, int x, int y, int width) {
|
||||||
return MouseUtils.isInside(mouseX, mouseY, x + width - 15, y + 2, 15, 9);
|
return MouseUtils.isInside(mouseX, mouseY, x + width - 15, y + 2, 15, 8);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user