From 9963d125703a7866f01e5645b485fd5ef904311f Mon Sep 17 00:00:00 2001 From: Peterrr__ Date: Sat, 23 Oct 2021 17:22:39 -0300 Subject: [PATCH] CSGOWatermark module added and version rename --- gradle.properties | 2 +- src/main/java/me/earth/phobos/Phobos.java | 6 +-- .../modules/client/CSGOWatermark.java | 46 +++++++++++++++++++ .../phobos/features/modules/client/HUD.java | 6 +-- .../earth/phobos/manager/ModuleManager.java | 1 + src/main/resources/mcmod.info | 2 +- 6 files changed, 55 insertions(+), 8 deletions(-) create mode 100644 src/main/java/me/earth/phobos/features/modules/client/CSGOWatermark.java diff --git a/gradle.properties b/gradle.properties index 84a1427..3e34259 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,6 @@ org.gradle.jvmargs=-Xmx3G modGroup=me.earth -modVersion=2.0.2 +modVersion=2.0.3 modBaseName=NsmPhobos forgeVersion=1.12.2-14.23.5.2768 mcpVersion=stable_39 diff --git a/src/main/java/me/earth/phobos/Phobos.java b/src/main/java/me/earth/phobos/Phobos.java index ee92330..715838a 100644 --- a/src/main/java/me/earth/phobos/Phobos.java +++ b/src/main/java/me/earth/phobos/Phobos.java @@ -22,11 +22,11 @@ import java.awt.datatransfer.StringSelection; import java.io.IOException; -@Mod(modid = "nsm", name = "Nsm Phobos", version = "2.0.2") +@Mod(modid = "nsm", name = "Nsm Phobos", version = Phobos.MODVER) public class Phobos { public static final String MODID = "nsm"; public static final String MODNAME = "Nsm Phobos"; - public static final String MODVER = "2.0.2"; + public static final String MODVER = "2.0.3"; public static final String NAME_UNICODE = "3\u1d00\u0280\u1d1b\u029c\u029c4\u1d04\u1d0b"; public static final String PHOBOS_UNICODE = "Nsm \u1d18\u029c\u1d0f\u0299\u1d0f\ua731"; public static final String CHAT_SUFFIX = " \u23d0 3\u1d00\u0280\u1d1b\u029c\u029c4\u1d04\u1d0b"; @@ -195,7 +195,7 @@ public void init(FMLInitializationEvent event) { if (moduleManager.getModuleByClass(CustomMainScreen.class).isEnabled()) { customMainScreen = new GuiCustomMainScreen(); } - Display.setTitle("Nsm Phobos - v2.0.2"); + Display.setTitle("Nsm Phobos - v" + Phobos.MODVER); Phobos.load(); } } diff --git a/src/main/java/me/earth/phobos/features/modules/client/CSGOWatermark.java b/src/main/java/me/earth/phobos/features/modules/client/CSGOWatermark.java new file mode 100644 index 0000000..8c89b83 --- /dev/null +++ b/src/main/java/me/earth/phobos/features/modules/client/CSGOWatermark.java @@ -0,0 +1,46 @@ +package me.earth.phobos.features.modules.client; + +import me.earth.phobos.Phobos; +import me.earth.phobos.event.events.Render2DEvent; +import me.earth.phobos.features.modules.Module; +import me.earth.phobos.features.setting.Setting; +import me.earth.phobos.util.ColorUtil; +import me.earth.phobos.util.ColorUtil1; +import me.earth.phobos.util.RenderUtil; +import me.earth.phobos.util.Timer; + +public class CSGOWatermark extends Module { + Timer delayTimer = new Timer(); + public Setting X = this.register(new Setting("WatermarkX", 0, 0, 300)); + public Setting Y = this.register(new Setting("WatermarkY", 0, 0, 300)); + public Setting delay = this.register(new Setting("Delay", 240, 0, 600)); + public Setting saturation = this.register(new Setting("Saturation", 127, 1, 255)); + public Setting brightness = this.register(new Setting("Brightness", 100, 0, 255)); + public float hue; + public int red = 1; + public int green = 1; + public int blue = 1; + + private String message = ""; + + public CSGOWatermark() { + super("CSGOWatermark", "noat em cee actually makes something", Module.Category.CLIENT, true, false, false); + } + + @Override + public void onRender2D(Render2DEvent event) { + drawCsgoWatermark(); + } + + public void drawCsgoWatermark() { + int padding = 5; + message = "Nsm Phobos v" + Phobos.MODVER + " | " + mc.player.getName() + " | " + Phobos.serverManager.getPing() + "ms"; + Integer textWidth = mc.fontRenderer.getStringWidth(message); // taken from wurst+ 3 + Integer textHeight = mc.fontRenderer.FONT_HEIGHT; // taken from wurst+ 3 + RenderUtil.drawRectangleCorrectly(X.getValue() - 4, Y.getValue() - 4, textWidth + 16, textHeight + 12, ColorUtil.toRGBA(22, 22, 22, 255)); + RenderUtil.drawRectangleCorrectly(X.getValue(), Y.getValue(), textWidth + 4, textHeight + 4, ColorUtil.toRGBA(0, 0, 0, 255)); + RenderUtil.drawRectangleCorrectly(X.getValue(), Y.getValue(), textWidth + 8, textHeight + 4, ColorUtil.toRGBA(0, 0, 0, 255)); + RenderUtil.drawRectangleCorrectly(X.getValue(), Y.getValue(), textWidth + 8, 1, ColorUtil1.rainbow(this.delay.getValue()).hashCode()); + mc.fontRenderer.drawString(message, X.getValue() + 3, Y.getValue() + 3, ColorUtil.toRGBA(255, 255, 255, 255), false); + } +} diff --git a/src/main/java/me/earth/phobos/features/modules/client/HUD.java b/src/main/java/me/earth/phobos/features/modules/client/HUD.java index a915e01..72277fc 100644 --- a/src/main/java/me/earth/phobos/features/modules/client/HUD.java +++ b/src/main/java/me/earth/phobos/features/modules/client/HUD.java @@ -204,15 +204,15 @@ public void onRender2D(final Render2DEvent event) { final String grayString = this.grayNess.getValue() ? "" : ""; switch (this.watermark.getValue()) { case PHOBOS: { - this.renderer.drawString("Nsm Phobos" + (this.modeVer.getValue() ? " v2.0.2" : ""), 2.0f, 2.0f, (this.rolling.getValue() && this.rainbow.getValue()) ? this.colorMap.get(2) : this.color, true); + this.renderer.drawString("Nsm Phobos" + (this.modeVer.getValue() ? " v2.0.3" : ""), 2.0f, 2.0f, (this.rolling.getValue() && this.rainbow.getValue()) ? this.colorMap.get(2) : this.color, true); break; } case EARTH: { - this.renderer.drawString("3arthh4ck" + (this.modeVer.getValue() ? " v2.0.2" : ""), 2.0f, 2.0f, (this.rolling.getValue() && this.rainbow.getValue()) ? this.colorMap.get(2) : this.color, true); + this.renderer.drawString("3arthh4ck" + (this.modeVer.getValue() ? " v2.0.3" : ""), 2.0f, 2.0f, (this.rolling.getValue() && this.rainbow.getValue()) ? this.colorMap.get(2) : this.color, true); break; } case CUSTOM: { - this.renderer.drawString(this.customWatermark.getValue() + (this.modeVer.getValue() ? " v2.0.2" : ""), 2.0f, 2.0f, (this.rolling.getValue() && this.rainbow.getValue()) ? this.colorMap.get(2) : this.color, true); + this.renderer.drawString(this.customWatermark.getValue() + (this.modeVer.getValue() ? " v2.0.3" : ""), 2.0f, 2.0f, (this.rolling.getValue() && this.rainbow.getValue()) ? this.colorMap.get(2) : this.color, true); break; } } diff --git a/src/main/java/me/earth/phobos/manager/ModuleManager.java b/src/main/java/me/earth/phobos/manager/ModuleManager.java index ef8b4aa..e7cf6e5 100644 --- a/src/main/java/me/earth/phobos/manager/ModuleManager.java +++ b/src/main/java/me/earth/phobos/manager/ModuleManager.java @@ -117,6 +117,7 @@ public void init() { this.modules.add(new Speedmine()); this.modules.add(new SafeWalk()); this.modules.add(new Blink()); + this.modules.add(new CSGOWatermark()); this.modules.add(new CustomMainScreen()); this.modules.add(new MultiTask()); this.modules.add(new BlockTweaks()); diff --git a/src/main/resources/mcmod.info b/src/main/resources/mcmod.info index 7034d5a..f48affc 100644 --- a/src/main/resources/mcmod.info +++ b/src/main/resources/mcmod.info @@ -3,7 +3,7 @@ "modid": "nsm", "name": "Nsm Phobos", "description": "Phobos is nice.", - "version": "2.0.2", + "version": "2.0.3", "mcversion": "1.12.2", "logoFile": "phobos.png", "url": "",