Skip to content

Commit

Permalink
Update: modules search
Browse files Browse the repository at this point in the history
  • Loading branch information
valekatoz committed Feb 21, 2024
1 parent 6fe72e7 commit 3f13107
Show file tree
Hide file tree
Showing 7 changed files with 88 additions and 16 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Kore (v2.3.3)
# Kore (v3.0.0)

[![Discord](https://img.shields.io/discord/1196891678284460053?style=for-the-badge&logo=discord&label=discord&color=9089DA)](https://discord.gg/H4x6eFp9KR)
[![GitHub Repo stars](https://img.shields.io/github/stars/valekatoz/Kore?style=for-the-badge&label=stargazers&logo=esea&logoColor=FFA500&color=FFFF66)](https://github.com/valekatoz/KoreForge)
Expand Down Expand Up @@ -62,7 +62,7 @@ You can access the mod by using the default keybind (right shift).
- **Discord Rich Presence**
- **Auto Updater**
- **Essential Cosmetics Unlocker**
- Debug
- Debug Mode

## Credits

Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
mod_name = Kore
mod_id = kore
version = 2.3.3
version_number = 23302
version = 3.0.0
version_number = 30001
licensed = true
archiveBaseName = KoreClient
loom.platform=forge
Expand Down
23 changes: 15 additions & 8 deletions src/main/java/net/kore/modules/protection/StaffAnalyser.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import net.kore.Kore;
import net.kore.modules.Module;
import net.kore.settings.ModeSetting;
import net.kore.settings.NumberSetting;
import net.kore.ui.notifications.Notification;
import net.kore.utils.MilliTimer;
Expand All @@ -11,16 +12,24 @@

public class StaffAnalyser extends Module
{
private ModeSetting mode;
private NumberSetting delay;
private MilliTimer timer;
private int lastBans;

public StaffAnalyser() {
super("Staff Analyser", Category.PROTECTIONS);
this.mode = new ModeSetting("Mode", "Chat", "Chat", "Notification");
this.delay = new NumberSetting("Check Delay (Seconds)", 5.0, 5.0, 60.0, 1.0);
this.timer = new MilliTimer();
this.lastBans = -1;
this.addSettings(this.delay);
this.addSettings(this.mode, this.delay);
}

@Override
public void assign()
{
Kore.staffAnalyser = this;
}

@SubscribeEvent
Expand All @@ -30,16 +39,14 @@ public void onTick(final TickEvent.ClientTickEvent event) {
new Thread(() -> {
final int bans = PlanckeScraper.getBans();
if (bans != this.lastBans && this.lastBans != -1 && bans > this.lastBans) {
Kore.notificationManager.showNotification(String.format("Staff has banned %s %s in the last %s seconds", bans - this.lastBans, (bans - this.lastBans > 1) ? "people" : "person", (int)this.delay.getValue()), 2500, (bans - this.lastBans > 2) ? Notification.NotificationType.WARNING : Notification.NotificationType.INFO);
if(this.mode.is("Notification")) {
Kore.notificationManager.showNotification(String.format("Staff has banned %s %s in the last %s seconds", bans - this.lastBans, (bans - this.lastBans > 1) ? "people" : "person", (int)this.delay.getValue()), 2500, (bans - this.lastBans > 2) ? Notification.NotificationType.WARNING : Notification.NotificationType.INFO);
} else {
Kore.sendMessageWithPrefix(String.format("Staff has banned %s %s in the last %s seconds", bans - this.lastBans, (bans - this.lastBans > 1) ? "people" : "person", (int)this.delay.getValue()));
}
}
this.lastBans = bans;
}).start();
}
}

@Override
public void assign()
{
Kore.staffAnalyser = this;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public AutoExperiments()
this.chronomatronSolver = new BooleanSetting("Chronomatron",true);
this.ultrasequencerSolver = new BooleanSetting("Ultrasequencer",true);
this.addSettings(autoExperimentsDelay, delayRandomizer, chronomatronSolver, ultrasequencerSolver);
this.setVersionType(VersionType.PREMIUM);
//this.setVersionType(VersionType.PREMIUM);
setToggled(false);
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/net/kore/modules/skyblock/PurseSpoofer.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class PurseSpoofer extends Module {
public PurseSpoofer() {
super("Purse Spoofer", Category.SKYBLOCK);
this.addSettings(mode, coins);
this.setVersionType(VersionType.PREMIUM);
//this.setVersionType(VersionType.PREMIUM);
}

@Override
Expand Down
61 changes: 59 additions & 2 deletions src/main/java/net/kore/ui/ModernClickGui.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import net.kore.Kore;
import net.kore.managers.WindowManager;
import net.kore.modules.Module;
import net.kore.modules.render.PopupAnimation;
import net.kore.ui.windows.ModuleWindow;
import net.kore.ui.windows.Window;
Expand All @@ -13,14 +14,19 @@
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.util.ChatAllowedCharacters;
import org.lwjgl.input.Keyboard;
import org.lwjgl.opengl.GL11;

import java.awt.*;
import java.util.List;

public class ModernClickGui extends GuiScreen {
public WindowManager windowManager = new WindowManager();
public static Window selectedWindow;
public static boolean settingsOpened;
public static boolean searchOpened;
public static String searchValue = "";
private static double x;
private static double y;
private int settingsOffset = 210;
Expand Down Expand Up @@ -67,9 +73,24 @@ public void drawScreen(int mouseX, int mouseY, float partialTicks) {
RenderUtils.drawBorderedRoundedRect((float)getX(), (float)getY(), 85.0f, getHeight(), 3.0f, 2.0f, Kore.themeManager.getPrimaryColor().getRGB(), Kore.themeManager.getSecondaryColor().getRGB());
RenderUtils.drawBorderedRoundedRect((float)(getX() + 90.0), (float)getY(), getWidth() - 90.0f, 20.0f, 3.0f, 2.0f, Kore.themeManager.getPrimaryColor().getRGB(), Kore.themeManager.getSecondaryColor().getRGB());
RenderUtils.drawBorderedRoundedRect((float)(getX() + 90.0), (float)(getY() + 25.0), getWidth() - 90.0f, getHeight() - 25.0f, 3.0f, 2.0f, Kore.themeManager.getPrimaryColor().getRGB(), Kore.themeManager.getSecondaryColor().getRGB());
Fonts.getSecondary().drawCenteredString("Kore Client", (float)(getX() + 42.5), (float)(getY() + 6.0), Color.WHITE.getRGB());
Fonts.getSecondary().drawCenteredString("Kore (v"+Kore.VERSION+")", (float)(getX() + 42.5), (float)(getY() + 6.0), Color.WHITE.getRGB());
drawTopBar(mouseX, mouseY);

for (Window window : this.windowManager.windows) {
if(window instanceof ModuleWindow) {
boolean containsSearch = false;
for (Module module : ((ModuleWindow) window).modulesInCategory) {
if(!searchValue.isEmpty() && module.getName().toLowerCase().contains(searchValue.toLowerCase())) {
containsSearch = true;
break;
}
}

if(!searchValue.isEmpty() && !containsSearch) {
continue;
}
}

if(window.getName().equals("Settings")) {
if (window == selectedWindow) {
RenderUtils.drawBorderedRoundedRect((float)(getX() + 5.0), (float)(getY() + (double)settingsOffset + 3.0), 75.0f, 12.0f, 4.0f, 4.0f, Kore.themeManager.getSecondaryColor().getRGB(), Kore.themeManager.getSecondaryColor().getRGB());
Expand Down Expand Up @@ -100,7 +121,15 @@ public void drawScreen(int mouseX, int mouseY, float partialTicks) {

public void drawTopBar(int mouseX, int mouseY)
{
Fonts.getPrimary().drawString("Welcome to Kore - v" + Kore.VERSION, (float)(getX() + 95), (float) (getY() + 6f), Color.WHITE.getRGB());
if(!searchOpened) {
if(searchValue.isEmpty()) {
Fonts.getPrimary().drawString("Search ", Fonts.newIcons.drawString("p", (float)(getX() + 95), (float) (getY() + 6f), Color.WHITE.getRGB()) + 5, (float) (getY() + 6f), Color.WHITE.getRGB());
} else {
Fonts.getPrimary().drawString(searchValue, Fonts.newIcons.drawString("p", (float)(getX() + 95), (float) (getY() + 6f), Color.WHITE.getRGB()) + 5, (float) (getY() + 6f), Color.WHITE.getRGB());
}
} else {
Fonts.getPrimary().drawString(searchValue, Fonts.newIcons.drawString("r", (float)(getX() + 95), (float) (getY() + 6f), Color.WHITE.getRGB()) + 5, (float) (getY() + 6f), Color.WHITE.getRGB());
}
}

@Override
Expand All @@ -110,8 +139,24 @@ public void mouseReleased(int mouseX, int mouseY, int mouseButton) {

@Override
public void mouseClicked(int mouseX, int mouseY, int mouseButton) {
searchOpened = this.isHovered(mouseX, mouseY, (getX() + 90.0), (float)getY(), getWidth() - 90.0f, 20.0f) && mouseButton == 0;

int categoryOffset = 25;
for (Window c : this.windowManager.windows) {
if(c instanceof ModuleWindow) {
boolean containsSearch = false;
for (Module module : ((ModuleWindow) c).modulesInCategory) {
if(!searchValue.isEmpty() && module.getName().toLowerCase().contains(searchValue.toLowerCase())) {
containsSearch = true;
break;
}
}

if(!searchValue.isEmpty() && !containsSearch) {
continue;
}
}

if(c.getName().equals("Settings")) {
if (this.isHovered(mouseX, mouseY, getX() + 4.0, getY() + (double)settingsOffset, 75.0, 16.0) && mouseButton == 0) {
selectedWindow = c;
Expand Down Expand Up @@ -169,6 +214,18 @@ else if (!settingsOpened)
this.mc.displayGuiScreen(null);
}
}

if(searchOpened) {
if(keyCode == Keyboard.KEY_BACK) {
if(!searchValue.isEmpty()) {
searchValue = searchValue.substring(0, searchValue.length()-1);
}
} else if (keyCode != Keyboard.KEY_ESCAPE && keyCode != Keyboard.KEY_LMETA) {
searchValue = ChatAllowedCharacters.filterAllowedCharacters(searchValue+typedChar);
} else {
searchOpened = false;
}
}
}

@Override
Expand Down
8 changes: 8 additions & 0 deletions src/main/java/net/kore/ui/windows/ModuleWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ public void drawScreen(int mouseX, int mouseY, float partialTicks) {
int offset = 30;
if (!ModernClickGui.settingsOpened) {
for (Module module : this.modulesInCategory) {
if(!ModernClickGui.searchValue.isEmpty() && !module.getName().toLowerCase().contains(ModernClickGui.searchValue.toLowerCase())) {
continue;
}

if (module.getFlagType() == Module.FlagType.DETECTED)
{
if(Kore.clientSettings.hideModules.getSelected().equals("Detected") || Kore.clientSettings.hideModules.getSelected().equals("Premium + Detected")) {
Expand Down Expand Up @@ -213,6 +217,10 @@ public void mouseClicked(int mouseX, int mouseY, int mouseButton) {
int offset = 30;
if (selectedModule == null) {
for (Module module : this.modulesInCategory) {
if(!ModernClickGui.searchValue.isEmpty() && !module.getName().toLowerCase().contains(ModernClickGui.searchValue.toLowerCase())) {
continue;
}

if (this.isHovered(mouseX, mouseY, ModernClickGui.getX() + 95.0, ModernClickGui.getY() + (double) offset + this.scrollAnimation.getValue(), ModernClickGui.getWidth() - 100.0f, 20.0)) {
switch (mouseButton) {
case 0: {
Expand Down

0 comments on commit 3f13107

Please sign in to comment.