Skip to content

Commit

Permalink
i think im done for today 💀
Browse files Browse the repository at this point in the history
  • Loading branch information
gatooooooo committed Jan 10, 2025
1 parent 6ed183b commit 11e5055
Show file tree
Hide file tree
Showing 15 changed files with 86 additions and 63 deletions.
8 changes: 6 additions & 2 deletions src/main/java/me/eldodebug/soar/Glide.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import me.eldodebug.soar.management.remote.discord.DiscordManager;
import me.eldodebug.soar.management.remote.update.Update;
import me.eldodebug.soar.management.remote.update.UpdateManager;
import me.eldodebug.soar.ui.ClickEffects;
import org.apache.commons.lang3.ArrayUtils;

import me.eldodebug.soar.injection.mixin.GlideTweaker;
Expand All @@ -21,7 +22,7 @@
import me.eldodebug.soar.management.file.FileManager;
import me.eldodebug.soar.management.language.LanguageManager;
import me.eldodebug.soar.management.mods.ModManager;
import me.eldodebug.soar.management.mods.impl.GlobalSettingsMod;
import me.eldodebug.soar.management.mods.impl.InternalSettingsMod;
import me.eldodebug.soar.management.nanovg.NanoVGManager;
import me.eldodebug.soar.management.notification.NotificationManager;
import me.eldodebug.soar.management.profile.ProfileManager;
Expand Down Expand Up @@ -63,6 +64,7 @@ public class Glide {
private long launchTime;
private File firstLoginFile;
private Update update;
private ClickEffects clickEffects;

public Glide() {
name = "Glide";
Expand Down Expand Up @@ -106,7 +108,8 @@ public void start() {

eventManager.register(new GlideHandler());

GlobalSettingsMod.getInstance().setToggled(true);
InternalSettingsMod.getInstance().setToggled(true);
clickEffects = new ClickEffects();
mc.updateDisplay();
}

Expand Down Expand Up @@ -234,4 +237,5 @@ public Update getUpdateInstance(){
}
public void setUpdateNeeded(boolean in) {updateNeeded = in;}
public boolean getUpdateNeeded() {return updateNeeded;}
public ClickEffects getClickEffects() {return clickEffects;}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import me.eldodebug.soar.management.color.palette.ColorPalette;
import me.eldodebug.soar.management.color.palette.ColorType;
import me.eldodebug.soar.management.language.TranslateText;
import me.eldodebug.soar.management.mods.impl.GlobalSettingsMod;
import me.eldodebug.soar.management.mods.impl.InternalSettingsMod;
import me.eldodebug.soar.management.nanovg.NanoVGManager;
import me.eldodebug.soar.management.nanovg.font.Fonts;
import me.eldodebug.soar.management.nanovg.font.LegacyIcon;
Expand All @@ -32,7 +32,7 @@ public AppearanceScene(SettingCategory parent) {

@Override
public void initGui() {
modTheme = new CompComboBox(75, GlobalSettingsMod.getInstance().getModThemeSetting());
modTheme = new CompComboBox(75, InternalSettingsMod.getInstance().getModThemeSetting());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,30 +1,33 @@
package me.eldodebug.soar.gui.modmenu.category.impl.setting.impl;

import me.eldodebug.soar.Glide;
import me.eldodebug.soar.gui.modmenu.category.impl.ModuleCategory;
import me.eldodebug.soar.gui.modmenu.category.impl.SettingCategory;
import me.eldodebug.soar.gui.modmenu.category.impl.setting.SettingScene;
import me.eldodebug.soar.management.color.ColorManager;
import me.eldodebug.soar.management.color.palette.ColorPalette;
import me.eldodebug.soar.management.color.palette.ColorType;
import me.eldodebug.soar.management.language.TranslateText;
import me.eldodebug.soar.management.mods.impl.GlobalSettingsMod;
import me.eldodebug.soar.management.mods.impl.InternalSettingsMod;
import me.eldodebug.soar.management.nanovg.NanoVGManager;
import me.eldodebug.soar.management.nanovg.font.Fonts;
import me.eldodebug.soar.management.nanovg.font.LegacyIcon;
import me.eldodebug.soar.ui.comp.Comp;
import me.eldodebug.soar.ui.comp.impl.CompKeybind;
import me.eldodebug.soar.ui.comp.impl.CompToggleButton;

public class GeneralScene extends SettingScene {

private CompKeybind modMenuKeybind;
private CompToggleButton clickEffectSetting;

public GeneralScene(SettingCategory parent) {
super(parent, TranslateText.GENERAL, TranslateText.GENERAL_DESCRIPTION, LegacyIcon.LIST);
}

@Override
public void initGui() {
modMenuKeybind = new CompKeybind(75, GlobalSettingsMod.getInstance().getModMenuKeybindSetting());
modMenuKeybind = new CompKeybind(75, InternalSettingsMod.getInstance().getModMenuKeybindSetting());
clickEffectSetting = new CompToggleButton(InternalSettingsMod.getInstance().getClickEffectsSetting());
}

@Override
Expand All @@ -35,20 +38,25 @@ public void drawScreen(int mouseX, int mouseY, float partialTicks) {
ColorManager colorManager = instance.getColorManager();
ColorPalette palette = colorManager.getPalette();
int offsetY = 0;
// mod menu keybind
nvg.drawRoundedRect(this.getX(), this.getY() + offsetY, this.getWidth(), 41, 6, palette.getBackgroundColor(ColorType.DARK));
nvg.drawText(TranslateText.OPEN_MOD_MENU.getText(), this.getX() + 8, this.getY() + 20.5F + offsetY - (nvg.getTextHeight(TranslateText.OPEN_MOD_MENU.getText(), 13, Fonts.MEDIUM)/2), palette.getFontColor(ColorType.DARK), 13, Fonts.MEDIUM);
modMenuKeybind.setX(this.getX() + this.getWidth() - 87);
modMenuKeybind.setY(this.getY() + 12.5F + offsetY);
modMenuKeybind.draw(mouseX, mouseY, partialTicks);
offsetY += 51;
drawItemInList(TranslateText.OPEN_MOD_MENU.getText(), "NOT IMPLIMENTED YET", this.getY(), offsetY, 87, modMenuKeybind, nvg, palette, mouseX, mouseY, partialTicks); offsetY += 51;
drawItemInList(TranslateText.CLICK_EFFECT.getText(), TranslateText.CLICK_EFFECT_DESCRIPTION.getText(), this.getY(), offsetY, 46, clickEffectSetting, nvg, palette, mouseX, mouseY, partialTicks); offsetY += 51;

}

private void drawItemInList(String title, String description, float y, float offset, float xRemove, Comp comp, NanoVGManager nvg, ColorPalette palette, int mouseX, int mouseY, float partialTicks) {
nvg.drawRoundedRect(this.getX(), y + offset, this.getWidth(), 41, 6, palette.getBackgroundColor(ColorType.DARK));
nvg.drawText(title, this.getX() + 8, y + 9.5F + offset, palette.getFontColor(ColorType.DARK), 12.5F, Fonts.MEDIUM);
nvg.drawText(description, this.getX() + 8, y + 23.5F + offset, palette.getFontColor(ColorType.NORMAL), 7.5F, Fonts.REGULAR);
comp.setX(this.getX() + this.getWidth() - xRemove);
comp.setY(y + 12.5F + offset);
comp.draw(mouseX, mouseY, partialTicks);
}

@Override
public void mouseClicked(int mouseX, int mouseY, int mouseButton) {
Glide instance = Glide.getInstance();
modMenuKeybind.mouseClicked(mouseX, mouseY, mouseButton);
clickEffectSetting.mouseClicked(mouseX, mouseY, mouseButton);
}

public void keyTyped(char typedChar, int keyCode) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import java.io.IOException;

import me.eldodebug.soar.Glide;
import me.eldodebug.soar.management.mods.impl.InternalSettingsMod;
import org.lwjgl.input.Keyboard;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
Expand All @@ -10,7 +12,6 @@
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

import me.eldodebug.soar.management.mods.impl.ClickEffectMod;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen;

Expand All @@ -25,15 +26,15 @@ public abstract class MixinGuiScreen {

@Inject(method = "drawScreen", at = @At("TAIL"))
public void postDrawScreen(int mouseX, int mouseY, float partialTicks, CallbackInfo ci) {
if(ClickEffectMod.getInstance().isToggled()) {
ClickEffectMod.getInstance().drawClickEffects();
if(InternalSettingsMod.getInstance().getClickEffectsSetting().isToggled()) {
Glide.getInstance().getClickEffects().drawClickEffects();
}
}

@Inject(method = "mouseClicked", at = @At("HEAD"))
public void preMouseClicked(int mouseX, int mouseY, int mouseButton, CallbackInfo ci) {
if(ClickEffectMod.getInstance().isToggled()) {
ClickEffectMod.getInstance().addClickEffect(mouseX, mouseY);
if(InternalSettingsMod.getInstance().getClickEffectsSetting().isToggled()) {
Glide.getInstance().getClickEffects().addClickEffect(mouseX, mouseY);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import me.eldodebug.soar.management.cape.impl.CustomCape;
import me.eldodebug.soar.management.cape.impl.NormalCape;
import me.eldodebug.soar.management.file.FileManager;
import me.eldodebug.soar.management.mods.impl.GlobalSettingsMod;
import me.eldodebug.soar.management.mods.impl.InternalSettingsMod;
import me.eldodebug.soar.utils.ImageUtils;
import me.eldodebug.soar.utils.file.FileUtils;
import net.minecraft.client.Minecraft;
Expand Down Expand Up @@ -100,7 +100,7 @@ public CapeManager() {
add("Horse", "misc/horse-sample.png", "misc/horse.png", CapeCategory.MISC);
add("Trans Arch", "misc/transarch-sample.png", "misc/transarch.png", CapeCategory.MISC);

currentCape = getCapeByName(GlobalSettingsMod.getInstance().getCapeConfigName());
currentCape = getCapeByName(InternalSettingsMod.getInstance().getCapeConfigName());

for(File f : customCapeDir.listFiles()) {

Expand Down Expand Up @@ -184,7 +184,7 @@ public Cape getCurrentCape() {

public void setCurrentCape(Cape currentCape) {
this.currentCape = currentCape;
GlobalSettingsMod.getInstance().setCapeConfigName(currentCape.getName());
InternalSettingsMod.getInstance().setCapeConfigName(currentCape.getName());
}

public Cape getCapeByName(String name) {
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/me/eldodebug/soar/management/mods/HUDMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import me.eldodebug.soar.management.color.AccentColor;
import me.eldodebug.soar.management.color.ColorManager;
import me.eldodebug.soar.management.language.TranslateText;
import me.eldodebug.soar.management.mods.impl.GlobalSettingsMod;
import me.eldodebug.soar.management.mods.impl.InternalSettingsMod;
import me.eldodebug.soar.management.mods.settings.impl.ComboSetting;
import me.eldodebug.soar.management.mods.settings.impl.combo.Option;
import me.eldodebug.soar.management.nanovg.NanoVGManager;
Expand Down Expand Up @@ -173,7 +173,7 @@ public void drawBackground(float addX, float addY, float width, float height, fl
NanoVGManager nvg = instance.getNanoVGManager();
ColorManager colorManager = instance.getColorManager();
AccentColor currentColor = colorManager.getCurrentColor();
ComboSetting setting = GlobalSettingsMod.getInstance().getModThemeSetting();
ComboSetting setting = InternalSettingsMod.getInstance().getModThemeSetting();
Option theme = setting.getOption();

boolean isNormal = theme.getTranslate().equals(TranslateText.NORMAL);
Expand Down Expand Up @@ -227,8 +227,8 @@ public void drawBackground(float addX, float addY, float width, float height, fl
nvg.drawHorizontalGradientRect(x, y - (2 * scale), lastWidth, (2* scale), ColorUtils.interpolateColors(8, 0, currentColor.getColor1(), currentColor.getColor2()), ColorUtils.interpolateColors(10, 20, currentColor.getColor1(), currentColor.getColor2()));
}
if(isModern) {
nvg.drawRoundedRect(x, y, lastWidth, lastHeight, radius, new Color(0, 0, 0, 150));
nvg.drawOutlineRoundedRect(x - 0.5F, y - 0.5F, lastWidth + 1, lastHeight + 1, radius + 0.5F, 0.5F, new Color(255,255,255,150));
nvg.drawRoundedRect(x, y, lastWidth, lastHeight, radius, new Color(0, 0, 0, 110));
nvg.drawOutlineRoundedRect(x - 0.5F, y - 0.5F, lastWidth + 1, lastHeight + 1, radius + 0.5F, 0.5F, new Color(255,255,255,110));

}

Expand All @@ -250,7 +250,7 @@ public void drawText(String text, float addX, float addY, float size, Font font,

NanoVGManager nvg = Glide.getInstance().getNanoVGManager();
float lastSize = size * scale;
Option theme = GlobalSettingsMod.getInstance().getModThemeSetting().getOption();
Option theme = InternalSettingsMod.getInstance().getModThemeSetting().getOption();
boolean isText = theme.getTranslate().equals(TranslateText.TEXT);

if(isText){
Expand Down Expand Up @@ -295,7 +295,7 @@ public float getTextWidth(String text, float size, Font font) {

public Color getFontColor(int alpha) {

ComboSetting setting = GlobalSettingsMod.getInstance().getModThemeSetting();
ComboSetting setting = InternalSettingsMod.getInstance().getModThemeSetting();
Option theme = setting.getOption();

boolean isDark = theme.getTranslate().equals(TranslateText.DARK);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ public void init() {
mods.add(new ChunkBordersMod());
mods.add(new ClearGlassMod());
mods.add(new ClearWaterMod());
mods.add(new ClickEffectMod());
mods.add(new ClientSpooferMod());
mods.add(new ClockMod());
mods.add(new ColorSaturationMod());
Expand Down Expand Up @@ -61,7 +60,7 @@ public void init() {
mods.add(new FullbrightMod());
mods.add(new GameModeDisplayMod());
mods.add(new GlintColorMod());
mods.add(new GlobalSettingsMod());
mods.add(new InternalSettingsMod());
mods.add(new GodbridgeAssistMod());
mods.add(new HealthDisplayMod());
mods.add(new HitBoxMod());
Expand Down Expand Up @@ -219,6 +218,6 @@ public void disableAll() {
for(Mod m : mods) {
m.setToggled(false);
}
GlobalSettingsMod.getInstance().setToggled(true);
InternalSettingsMod.getInstance().setToggled(true);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import java.util.ArrayList;
import java.util.Arrays;

import me.eldodebug.soar.management.mods.settings.impl.*;
import org.lwjgl.input.Keyboard;

import me.eldodebug.soar.Glide;
Expand All @@ -11,26 +12,28 @@
import me.eldodebug.soar.management.language.TranslateText;
import me.eldodebug.soar.management.mods.Mod;
import me.eldodebug.soar.management.mods.ModCategory;
import me.eldodebug.soar.management.mods.settings.impl.ComboSetting;
import me.eldodebug.soar.management.mods.settings.impl.KeybindSetting;
import me.eldodebug.soar.management.mods.settings.impl.NumberSetting;
import me.eldodebug.soar.management.mods.settings.impl.TextSetting;
import me.eldodebug.soar.management.mods.settings.impl.combo.Option;

public class GlobalSettingsMod extends Mod {
public class InternalSettingsMod extends Mod {

private static GlobalSettingsMod instance;
private static InternalSettingsMod instance;

private ComboSetting modThemeSetting = new ComboSetting(TranslateText.HUD_THEME, this, TranslateText.NORMAL, new ArrayList<Option>(Arrays.asList(
new Option(TranslateText.NORMAL), new Option(TranslateText.GLOW), new Option(TranslateText.OUTLINE), new Option(TranslateText.VANILLA),
new Option(TranslateText.OUTLINE_GLOW), new Option(TranslateText.VANILLA_GLOW), new Option(TranslateText.SHADOW),
new Option(TranslateText.DARK), new Option(TranslateText.LIGHT), new Option(TranslateText.RECT), new Option(TranslateText.MODERN), new Option(TranslateText.TEXT), new Option(TranslateText.GRADIENT_SIMPLE))));
new Option(TranslateText.DARK), new Option(TranslateText.LIGHT), new Option(TranslateText.RECT), new Option(TranslateText.MODERN),
new Option(TranslateText.TEXT), new Option(TranslateText.GRADIENT_SIMPLE))));


private NumberSetting volumeSetting = new NumberSetting(TranslateText.VOLUME, this, 0.8, 0, 1, false);

private KeybindSetting modMenuKeybindSetting = new KeybindSetting(TranslateText.KEYBIND, this, Keyboard.KEY_RSHIFT);

private TextSetting capeNameSetting = new TextSetting(TranslateText.CUSTOM_CAPE, this, "None");

public GlobalSettingsMod() {
private BooleanSetting clickEffectsSetting = new BooleanSetting(TranslateText.CLICK_EFFECT, this, true);

public InternalSettingsMod() {
super(TranslateText.NONE, TranslateText.NONE, ModCategory.OTHER);

instance = this;
Expand All @@ -49,25 +52,24 @@ public void onKey(EventKey event) {
}
}

public static GlobalSettingsMod getInstance() {
public static InternalSettingsMod getInstance() {
return instance;
}

public BooleanSetting getClickEffectsSetting(){return clickEffectsSetting;}

public NumberSetting getVolumeSetting() {
return volumeSetting;
}

public ComboSetting getModThemeSetting() {
return modThemeSetting;
}
public ComboSetting getModThemeSetting() {return modThemeSetting;}

public KeybindSetting getModMenuKeybindSetting() {
return modMenuKeybindSetting;
}
public KeybindSetting getModMenuKeybindSetting() {return modMenuKeybindSetting;}

public String getCapeConfigName(){
return capeNameSetting.getText();
}

public void setCapeConfigName(String a){
capeNameSetting.setText(a);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
package me.eldodebug.soar.management.mods.impl;

import me.eldodebug.soar.Glide;
import me.eldodebug.soar.management.language.TranslateText;
import me.eldodebug.soar.management.mods.Mod;
import me.eldodebug.soar.management.mods.ModCategory;
import me.eldodebug.soar.management.notification.Notification;
import me.eldodebug.soar.management.notification.NotificationType;

public class Items2DMod extends Mod {

Expand All @@ -20,6 +23,7 @@ public void onEnable() {

if(ItemPhysicsMod.getInstance().isToggled()) {
ItemPhysicsMod.getInstance().setToggled(false);
Glide.getInstance().getNotificationManager().post(TranslateText.ITEM_PHYSICS.getText(), "Disabled due to incompatibility" , NotificationType.WARNING);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ private void drawNanoVG() {
this.setHeight(spaceSetting.isToggled() ? 64 + 22 : 32 + 28);
}
private void drawHighlight(float addX, float addY, float width, float height, float radius, Color color){
boolean rect = GlobalSettingsMod.getInstance().getModThemeSetting().getOption().getTranslate().equals(TranslateText.RECT);
boolean rect = InternalSettingsMod.getInstance().getModThemeSetting().getOption().getTranslate().equals(TranslateText.RECT);
if (!rect) this.drawRoundedRect(addX, addY, width, height, radius, color); else this.drawRect(addX, addY, width, height, color);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,9 @@
import me.eldodebug.soar.management.nanovg.NanoVGManager;
import me.eldodebug.soar.utils.ColorUtils;
import me.eldodebug.soar.utils.animation.simple.SimpleAnimation;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.entity.RenderItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;

Expand Down Expand Up @@ -123,7 +121,7 @@ private void drawNanoVG(NanoVGManager nvg) {
ScaledResolution sr = new ScaledResolution(mc);
Option option = designSetting.getOption();
AccentColor currentColor = Glide.getInstance().getColorManager().getCurrentColor();
boolean isText = GlobalSettingsMod.getInstance().getModThemeSetting().getOption().getTranslate().equals(TranslateText.TEXT);
boolean isText = InternalSettingsMod.getInstance().getModThemeSetting().getOption().getTranslate().equals(TranslateText.TEXT);

if (mc.getRenderViewEntity() instanceof EntityPlayer) {

Expand Down
Loading

0 comments on commit 11e5055

Please sign in to comment.