mirror of https://github.com/kami-blue/client
[refactor] Removed Hidden module category
This commit is contained in:
parent
7c7f24509c
commit
df62eb804b
|
@ -25,8 +25,6 @@ object GenerateWebsiteCommand : ClientCommand(
|
||||||
var totalMods = 0
|
var totalMods = 0
|
||||||
var str = ""
|
var str = ""
|
||||||
for (module in mods) {
|
for (module in mods) {
|
||||||
if (!module.isProduction) continue
|
|
||||||
if (!module.category.toString().equals(modCategory, ignoreCase = true)) continue
|
|
||||||
totalMods++
|
totalMods++
|
||||||
str += " <li>" + module.name.value + "<p><i>" + module.description + "</i></p></li>\n"
|
str += " <li>" + module.name.value + "<p><i>" + module.description + "</i></p></li>\n"
|
||||||
}
|
}
|
||||||
|
|
|
@ -118,7 +118,6 @@ public class KamiGUI extends GUI {
|
||||||
public void initializeGUI() {
|
public void initializeGUI() {
|
||||||
HashMap<Module.Category, Pair<Scrollpane, SettingsPanel>> categoryScrollpaneHashMap = new HashMap<>();
|
HashMap<Module.Category, Pair<Scrollpane, SettingsPanel>> categoryScrollpaneHashMap = new HashMap<>();
|
||||||
for (Module module : ModuleManager.getModules()) {
|
for (Module module : ModuleManager.getModules()) {
|
||||||
if (module.getCategory().isHidden()) continue;
|
|
||||||
Module.Category moduleCategory = module.getCategory();
|
Module.Category moduleCategory = module.getCategory();
|
||||||
if (!categoryScrollpaneHashMap.containsKey(moduleCategory)) {
|
if (!categoryScrollpaneHashMap.containsKey(moduleCategory)) {
|
||||||
Stretcherlayout stretcherlayout = new Stretcherlayout(1);
|
Stretcherlayout stretcherlayout = new Stretcherlayout(1);
|
||||||
|
@ -187,7 +186,7 @@ public class KamiGUI extends GUI {
|
||||||
for (Map.Entry<Module.Category, Pair<Scrollpane, SettingsPanel>> entry : categoryScrollpaneHashMap.entrySet()) {
|
for (Map.Entry<Module.Category, Pair<Scrollpane, SettingsPanel>> entry : categoryScrollpaneHashMap.entrySet()) {
|
||||||
Stretcherlayout stretcherlayout = new Stretcherlayout(1);
|
Stretcherlayout stretcherlayout = new Stretcherlayout(1);
|
||||||
stretcherlayout.COMPONENT_OFFSET_Y = 1;
|
stretcherlayout.COMPONENT_OFFSET_Y = 1;
|
||||||
Frame frame = new Frame(getTheme(), stretcherlayout, entry.getKey().getCategoryName());
|
Frame frame = new Frame(getTheme(), stretcherlayout, entry.getKey().getDisplayName());
|
||||||
Scrollpane scrollpane = entry.getValue().getFirst();
|
Scrollpane scrollpane = entry.getValue().getFirst();
|
||||||
frame.addChild(scrollpane);
|
frame.addChild(scrollpane);
|
||||||
frame.addChild(entry.getValue().getSecond());
|
frame.addChild(entry.getValue().getSecond());
|
||||||
|
|
|
@ -17,6 +17,7 @@ import me.zeroeightsix.kami.util.Bind
|
||||||
import me.zeroeightsix.kami.util.Wrapper
|
import me.zeroeightsix.kami.util.Wrapper
|
||||||
import me.zeroeightsix.kami.util.text.MessageSendHelper
|
import me.zeroeightsix.kami.util.text.MessageSendHelper
|
||||||
import net.minecraft.client.Minecraft
|
import net.minecraft.client.Minecraft
|
||||||
|
import org.kamiblue.commons.interfaces.DisplayEnum
|
||||||
import org.lwjgl.input.Keyboard
|
import org.lwjgl.input.Keyboard
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
|
@ -55,15 +56,16 @@ open class Module {
|
||||||
*
|
*
|
||||||
* @see me.zeroeightsix.kami.module.modules.client.ActiveModules
|
* @see me.zeroeightsix.kami.module.modules.client.ActiveModules
|
||||||
*/
|
*/
|
||||||
enum class Category(val categoryName: String, val isHidden: Boolean) {
|
enum class Category(override val displayName: String): DisplayEnum {
|
||||||
CHAT("Chat", false),
|
CHAT("Chat"),
|
||||||
COMBAT("Combat", false),
|
COMBAT("Combat"),
|
||||||
CLIENT("Client", false),
|
CLIENT("Client"),
|
||||||
HIDDEN("Hidden", true),
|
MISC("Misc"),
|
||||||
MISC("Misc", false),
|
MOVEMENT("Movement"),
|
||||||
MOVEMENT("Movement", false),
|
PLAYER("Player"),
|
||||||
PLAYER("Player", false),
|
RENDER("Render");
|
||||||
RENDER("Render", false);
|
|
||||||
|
override fun toString() = displayName
|
||||||
}
|
}
|
||||||
/* End of annotations */
|
/* End of annotations */
|
||||||
|
|
||||||
|
@ -88,7 +90,6 @@ open class Module {
|
||||||
val bindName: String get() = if (bind.value.key < 1) "NONE" else Wrapper.getKeyName(bind.value.key)
|
val bindName: String get() = if (bind.value.key < 1) "NONE" else Wrapper.getKeyName(bind.value.key)
|
||||||
val chatName: String get() = "[${name.value}]"
|
val chatName: String get() = "[${name.value}]"
|
||||||
val isOnArray: Boolean get() = showOnArray.value == ShowOnArray.ON
|
val isOnArray: Boolean get() = showOnArray.value == ShowOnArray.ON
|
||||||
val isProduction: Boolean get() = category != Category.HIDDEN
|
|
||||||
/* End of properties */
|
/* End of properties */
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
@file:Suppress("DEPRECATION")
|
|
||||||
|
|
||||||
package me.zeroeightsix.kami.module.modules.client
|
package me.zeroeightsix.kami.module.modules.client
|
||||||
|
|
||||||
import me.zeroeightsix.kami.module.Module
|
import me.zeroeightsix.kami.module.Module
|
||||||
|
@ -8,7 +6,6 @@ import me.zeroeightsix.kami.setting.Settings
|
||||||
import me.zeroeightsix.kami.util.color.ColorConverter.rgbToHex
|
import me.zeroeightsix.kami.util.color.ColorConverter.rgbToHex
|
||||||
import me.zeroeightsix.kami.util.text.MessageSendHelper.sendChatMessage
|
import me.zeroeightsix.kami.util.text.MessageSendHelper.sendChatMessage
|
||||||
import org.kamiblue.commons.utils.MathUtils.reverseNumber
|
import org.kamiblue.commons.utils.MathUtils.reverseNumber
|
||||||
import java.awt.Color
|
|
||||||
|
|
||||||
@Module.Info(
|
@Module.Info(
|
||||||
name = "ActiveModules",
|
name = "ActiveModules",
|
||||||
|
@ -42,17 +39,16 @@ object ActiveModules : Module() {
|
||||||
private val render = register(Settings.s("Render", "105,48,109"))
|
private val render = register(Settings.s("Render", "105,48,109"))
|
||||||
|
|
||||||
fun setColor(category: Category, r: Int, g: Int, b: Int) {
|
fun setColor(category: Category, r: Int, g: Int, b: Int) {
|
||||||
val setting = getSettingForCategory(category) ?: return
|
val setting = getSettingForCategory(category)
|
||||||
setting.value = "$r,$g,$b"
|
setting.value = "$r,$g,$b"
|
||||||
sendChatMessage("Set ${setting.name} colour to $r, $g, $b")
|
sendChatMessage("Set ${setting.name} colour to $r, $g, $b")
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getSettingForCategory(category: Category): Setting<String>? {
|
private fun getSettingForCategory(category: Category): Setting<String> {
|
||||||
return when (category) {
|
return when (category) {
|
||||||
Category.CHAT -> chat
|
Category.CHAT -> chat
|
||||||
Category.COMBAT -> combat
|
Category.COMBAT -> combat
|
||||||
Category.CLIENT -> client
|
Category.CLIENT -> client
|
||||||
Category.HIDDEN -> null // This should never be reached
|
|
||||||
Category.MISC -> misc
|
Category.MISC -> misc
|
||||||
Category.MOVEMENT -> movement
|
Category.MOVEMENT -> movement
|
||||||
Category.PLAYER -> player
|
Category.PLAYER -> player
|
||||||
|
@ -69,7 +65,6 @@ object ActiveModules : Module() {
|
||||||
Category.PLAYER -> rgbToHex(getRgb(player.value, 0), getRgb(player.value, 1), getRgb(player.value, 2))
|
Category.PLAYER -> rgbToHex(getRgb(player.value, 0), getRgb(player.value, 1), getRgb(player.value, 2))
|
||||||
Category.MOVEMENT -> rgbToHex(getRgb(movement.value, 0), getRgb(movement.value, 1), getRgb(movement.value, 2))
|
Category.MOVEMENT -> rgbToHex(getRgb(movement.value, 0), getRgb(movement.value, 1), getRgb(movement.value, 2))
|
||||||
Category.MISC -> rgbToHex(getRgb(misc.value, 0), getRgb(misc.value, 1), getRgb(misc.value, 2))
|
Category.MISC -> rgbToHex(getRgb(misc.value, 0), getRgb(misc.value, 1), getRgb(misc.value, 2))
|
||||||
else -> rgbToHex(1, 1, 1)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue