mirror of
https://github.com/refactorinqq/SLC-1.8.9.git
synced 2024-11-13 02:01:32 +01:00
Rounded Corners
This commit is contained in:
parent
131222238e
commit
261ad63308
@ -3,6 +3,7 @@ package net.silentclient.client.mods;
|
|||||||
import net.silentclient.client.Client;
|
import net.silentclient.client.Client;
|
||||||
import net.silentclient.client.gui.hud.ScreenPosition;
|
import net.silentclient.client.gui.hud.ScreenPosition;
|
||||||
import net.silentclient.client.gui.lite.clickgui.utils.RenderUtils;
|
import net.silentclient.client.gui.lite.clickgui.utils.RenderUtils;
|
||||||
|
import net.silentclient.client.gui.util.RenderUtil;
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
|
|
||||||
@ -33,6 +34,7 @@ public class HudMod extends ModDraggable {
|
|||||||
this.addBooleanSetting("Font Shadow", this, true);
|
this.addBooleanSetting("Font Shadow", this, true);
|
||||||
this.addBooleanSetting("Brackets", this, false);
|
this.addBooleanSetting("Brackets", this, false);
|
||||||
this.addBooleanSetting("Fancy Font", this, false);
|
this.addBooleanSetting("Fancy Font", this, false);
|
||||||
|
this.addBooleanSetting("Rounded Corners", this, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getText() {
|
public String getText() {
|
||||||
@ -100,13 +102,18 @@ public class HudMod extends ModDraggable {
|
|||||||
font.setRenderMode(fancyFont ? CustomFontRenderer.RenderMode.CUSTOM : CustomFontRenderer.RenderMode.DEFAULT);
|
font.setRenderMode(fancyFont ? CustomFontRenderer.RenderMode.CUSTOM : CustomFontRenderer.RenderMode.DEFAULT);
|
||||||
|
|
||||||
boolean background = Client.getInstance().getSettingsManager().getSettingByName(this, "Background").getValBoolean();
|
boolean background = Client.getInstance().getSettingsManager().getSettingByName(this, "Background").getValBoolean();
|
||||||
|
boolean roundedCorners = Client.getInstance().getSettingsManager().getSettingByName(this, "Rounded Corners").getValBoolean();
|
||||||
Color backgroundColor = Client.getInstance().getSettingsManager().getSettingByName(this, "Background Color").getValColor();
|
Color backgroundColor = Client.getInstance().getSettingsManager().getSettingByName(this, "Background Color").getValColor();
|
||||||
boolean fontShadow = Client.getInstance().getSettingsManager().getSettingByName(this, "Font Shadow").getValBoolean();
|
boolean fontShadow = Client.getInstance().getSettingsManager().getSettingByName(this, "Font Shadow").getValBoolean();
|
||||||
boolean brackets = Client.getInstance().getSettingsManager().getSettingByName(this, "Brackets").getValBoolean();
|
boolean brackets = Client.getInstance().getSettingsManager().getSettingByName(this, "Brackets").getValBoolean();
|
||||||
Color color = Client.getInstance().getSettingsManager().getSettingByName(this, "Color").getValColor();
|
Color color = Client.getInstance().getSettingsManager().getSettingByName(this, "Color").getValColor();
|
||||||
preRender();
|
preRender();
|
||||||
if(background) {
|
if(background) {
|
||||||
RenderUtils.drawRect(getX(), getY(), this.getRealWidth(), this.getHeight(), backgroundColor.getRGB());
|
if(roundedCorners) {
|
||||||
|
RenderUtil.drawRoundedRect(getX(), getY(), this.getRealWidth(), this.getHeight(), 6, backgroundColor.getRGB());
|
||||||
|
} else {
|
||||||
|
RenderUtils.drawRect(getX(), getY(), this.getRealWidth(), this.getHeight(), backgroundColor.getRGB());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!background) {
|
if(!background) {
|
||||||
|
@ -10,6 +10,7 @@ import net.silentclient.client.gui.font.SilentFontRenderer;
|
|||||||
import net.silentclient.client.gui.hud.ScreenPosition;
|
import net.silentclient.client.gui.hud.ScreenPosition;
|
||||||
import net.silentclient.client.gui.lite.clickgui.utils.GlUtils;
|
import net.silentclient.client.gui.lite.clickgui.utils.GlUtils;
|
||||||
import net.silentclient.client.gui.lite.clickgui.utils.RenderUtils;
|
import net.silentclient.client.gui.lite.clickgui.utils.RenderUtils;
|
||||||
|
import net.silentclient.client.gui.util.RenderUtil;
|
||||||
import net.silentclient.client.mods.CustomFontRenderer;
|
import net.silentclient.client.mods.CustomFontRenderer;
|
||||||
import net.silentclient.client.mods.ModCategory;
|
import net.silentclient.client.mods.ModCategory;
|
||||||
import net.silentclient.client.mods.ModDraggable;
|
import net.silentclient.client.mods.ModDraggable;
|
||||||
@ -37,6 +38,7 @@ public class KeystrokesMod extends ModDraggable {
|
|||||||
this.addBooleanSetting("Font Shadow", this, true);
|
this.addBooleanSetting("Font Shadow", this, true);
|
||||||
this.addBooleanSetting("Fancy Font", this, false);
|
this.addBooleanSetting("Fancy Font", this, false);
|
||||||
this.addBooleanSetting("Background", this, true);
|
this.addBooleanSetting("Background", this, true);
|
||||||
|
this.addBooleanSetting("Rounded Corners", this, false);
|
||||||
this.addModeSetting("CPS Mode", this, "Small", cpsModes);
|
this.addModeSetting("CPS Mode", this, "Small", cpsModes);
|
||||||
this.addColorSetting("Color", this, new Color(255, 255, 255));
|
this.addColorSetting("Color", this, new Color(255, 255, 255));
|
||||||
this.addColorSetting("Background Color", this, new Color(0, 0, 0), 127);
|
this.addColorSetting("Background Color", this, new Color(0, 0, 0), 127);
|
||||||
@ -182,7 +184,8 @@ public class KeystrokesMod extends ModDraggable {
|
|||||||
Color color = Client.getInstance().getSettingsManager().getSettingByName(this, "Color").getValColor();
|
Color color = Client.getInstance().getSettingsManager().getSettingByName(this, "Color").getValColor();
|
||||||
Color clickedColor = Client.getInstance().getSettingsManager().getSettingByName(this, "Clicked Color").getValColor();
|
Color clickedColor = Client.getInstance().getSettingsManager().getSettingByName(this, "Clicked Color").getValColor();
|
||||||
int fadeDelay = Client.getInstance().getSettingsManager().getSettingByName(this, "Fade Delay").getValInt() != 0 ? 100000 / Client.getInstance().getSettingsManager().getSettingByName(this, "Fade Delay").getValInt() : 0;
|
int fadeDelay = Client.getInstance().getSettingsManager().getSettingByName(this, "Fade Delay").getValInt() != 0 ? 100000 / Client.getInstance().getSettingsManager().getSettingByName(this, "Fade Delay").getValInt() : 0;
|
||||||
|
boolean roundedCorners = Client.getInstance().getSettingsManager().getSettingByName(this, "Rounded Corners").getValBoolean();
|
||||||
|
|
||||||
for(Key key : mode.getKeys()) {
|
for(Key key : mode.getKeys()) {
|
||||||
String renderString = key.getName();
|
String renderString = key.getName();
|
||||||
|
|
||||||
@ -202,13 +205,24 @@ public class KeystrokesMod extends ModDraggable {
|
|||||||
setAnimation(key.green, key.isDown() ? clickedBackgroundColor.getGreen() : backgroundColor.getGreen(), fadeDelay);
|
setAnimation(key.green, key.isDown() ? clickedBackgroundColor.getGreen() : backgroundColor.getGreen(), fadeDelay);
|
||||||
setAnimation(key.blue, key.isDown() ? clickedBackgroundColor.getBlue() : backgroundColor.getBlue(), fadeDelay);
|
setAnimation(key.blue, key.isDown() ? clickedBackgroundColor.getBlue() : backgroundColor.getBlue(), fadeDelay);
|
||||||
setAnimation(key.alpha, key.isDown() ? clickedBackgroundColor.getAlpha() : backgroundColor.getAlpha(), fadeDelay);
|
setAnimation(key.alpha, key.isDown() ? clickedBackgroundColor.getAlpha() : backgroundColor.getAlpha(), fadeDelay);
|
||||||
RenderUtils.drawRect(
|
if(roundedCorners) {
|
||||||
0 + key.getX(),
|
RenderUtil.drawRoundedRect(
|
||||||
0 + key.getY(),
|
key.getX(),
|
||||||
key.getWidth(),
|
key.getY(),
|
||||||
key.getHeight(),
|
key.getWidth(),
|
||||||
new Color((int) key.red.getValue(), (int) key.green.getValue(), (int) key.blue.getValue(), (int) key.alpha.getValue()).getRGB()
|
key.getHeight(),
|
||||||
|
6,
|
||||||
|
new Color((int) key.red.getValue(), (int) key.green.getValue(), (int) key.blue.getValue(), (int) key.alpha.getValue()).getRGB()
|
||||||
);
|
);
|
||||||
|
} else {
|
||||||
|
RenderUtils.drawRect(
|
||||||
|
key.getX(),
|
||||||
|
key.getY(),
|
||||||
|
key.getWidth(),
|
||||||
|
key.getHeight(),
|
||||||
|
new Color((int) key.red.getValue(), (int) key.green.getValue(), (int) key.blue.getValue(), (int) key.alpha.getValue()).getRGB()
|
||||||
|
);
|
||||||
|
}
|
||||||
ColorUtils.setColor(-1);
|
ColorUtils.setColor(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -294,13 +308,24 @@ public class KeystrokesMod extends ModDraggable {
|
|||||||
setAnimation(Space.green, Space.isDown() ? clickedBackgroundColor.getGreen() : backgroundColor.getGreen(), fadeDelay);
|
setAnimation(Space.green, Space.isDown() ? clickedBackgroundColor.getGreen() : backgroundColor.getGreen(), fadeDelay);
|
||||||
setAnimation(Space.blue, Space.isDown() ? clickedBackgroundColor.getBlue() : backgroundColor.getBlue(), fadeDelay);
|
setAnimation(Space.blue, Space.isDown() ? clickedBackgroundColor.getBlue() : backgroundColor.getBlue(), fadeDelay);
|
||||||
setAnimation(Space.alpha, Space.isDown() ? clickedBackgroundColor.getAlpha() : backgroundColor.getAlpha(), fadeDelay);
|
setAnimation(Space.alpha, Space.isDown() ? clickedBackgroundColor.getAlpha() : backgroundColor.getAlpha(), fadeDelay);
|
||||||
RenderUtils.drawRect(
|
if(roundedCorners) {
|
||||||
0,
|
RenderUtil.drawRoundedRect(
|
||||||
0 + mode.getHeight() + 2,
|
0,
|
||||||
mode.getWidth(),
|
0 + mode.getHeight() + 2,
|
||||||
10,
|
mode.getWidth(),
|
||||||
new Color((int) Space.red.getValue(), (int) Space.green.getValue(), (int) Space.blue.getValue(), (int) Space.alpha.getValue()).getRGB()
|
10,
|
||||||
|
6,
|
||||||
|
new Color((int) Space.red.getValue(), (int) Space.green.getValue(), (int) Space.blue.getValue(), (int) Space.alpha.getValue()).getRGB()
|
||||||
);
|
);
|
||||||
|
} else {
|
||||||
|
RenderUtils.drawRect(
|
||||||
|
0,
|
||||||
|
0 + mode.getHeight() + 2,
|
||||||
|
mode.getWidth(),
|
||||||
|
10,
|
||||||
|
new Color((int) Space.red.getValue(), (int) Space.green.getValue(), (int) Space.blue.getValue(), (int) Space.alpha.getValue()).getRGB()
|
||||||
|
);
|
||||||
|
}
|
||||||
ColorUtils.setColor(-1);
|
ColorUtils.setColor(-1);
|
||||||
}
|
}
|
||||||
font.drawString(
|
font.drawString(
|
||||||
|
@ -1,8 +1,5 @@
|
|||||||
package net.silentclient.client.mods.player;
|
package net.silentclient.client.mods.player;
|
||||||
|
|
||||||
import java.awt.Color;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
import net.minecraft.client.settings.KeyBinding;
|
import net.minecraft.client.settings.KeyBinding;
|
||||||
import net.silentclient.client.Client;
|
import net.silentclient.client.Client;
|
||||||
import net.silentclient.client.event.EventTarget;
|
import net.silentclient.client.event.EventTarget;
|
||||||
@ -12,6 +9,9 @@ import net.silentclient.client.gui.hud.ScreenPosition;
|
|||||||
import net.silentclient.client.mods.HudMod;
|
import net.silentclient.client.mods.HudMod;
|
||||||
import net.silentclient.client.mods.ModCategory;
|
import net.silentclient.client.mods.ModCategory;
|
||||||
|
|
||||||
|
import java.awt.*;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
public class AutoSprintMod extends HudMod {
|
public class AutoSprintMod extends HudMod {
|
||||||
|
|
||||||
private boolean toggled = false;
|
private boolean toggled = false;
|
||||||
@ -30,6 +30,7 @@ public class AutoSprintMod extends HudMod {
|
|||||||
this.addBooleanSetting("Font Shadow", this, true);
|
this.addBooleanSetting("Font Shadow", this, true);
|
||||||
this.addBooleanSetting("Brackets", this, true);
|
this.addBooleanSetting("Brackets", this, true);
|
||||||
this.addBooleanSetting("Fancy Font", this, false);
|
this.addBooleanSetting("Fancy Font", this, false);
|
||||||
|
this.addBooleanSetting("Rounded Corners", this, false);
|
||||||
ArrayList<String> options = new ArrayList<String>();
|
ArrayList<String> options = new ArrayList<String>();
|
||||||
options.add("Toggle");
|
options.add("Toggle");
|
||||||
options.add("Auto");
|
options.add("Auto");
|
||||||
|
Loading…
Reference in New Issue
Block a user