package wtf.opal.client.feature.module;

import dev.crucifixbeta.api.utils.i18n.LangUtil;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import wtf.opal.utility.misc.INameable;

@Environment(EnvType.CLIENT)
public enum ModuleCategory implements INameable {
   COMBAT("Combat", "\ue9e0"),
   MISC("Misc", "\uea3c"),
   RENDER("Render", "\ue8f4"),
   MOVEMENT("Movement", "\ue566"),
   PLAYER("Player", "\ue7fd"),
   EXPLOIT("Exploit", "\ue868"),
   CLIENT("Client", "\ue8b8"),
   DEBUG("Debug", "\ue868"),
   HUD("HUD", "\ue871"),
   VISUAL("Visual", "\ue8f4"),
   WORLD("World", "\ue80b"),
   UTILITY("Utility", "\uea3c");

   private final String name;
   private final String icon;
   private int moduleIndex;
   public static final ModuleCategory[] VALUES;

   private ModuleCategory(final String name, final String icon) {
      this.name = name;
      this.icon = icon;
   }

   @Override
   public String getName() {
      return this.name;
   }

   public String getDisplayName() {
      return switch (this) {
         case COMBAT -> LangUtil.ui(this.name, "\u6218\u6597");
         case MISC -> LangUtil.ui(this.name, "\u6742\u9879");
         case RENDER, VISUAL -> LangUtil.ui(this.name, "\u6e32\u67d3");
         case MOVEMENT -> LangUtil.ui(this.name, "\u79fb\u52a8");
         case PLAYER -> LangUtil.ui(this.name, "\u73a9\u5bb6");
         case EXPLOIT -> LangUtil.ui(this.name, "\u5229\u7528");
         case CLIENT -> LangUtil.ui(this.name, "\u5ba2\u6237\u7aef");
         case DEBUG -> LangUtil.ui(this.name, "\u8c03\u8bd5");
         case HUD -> "HUD";
         case WORLD -> LangUtil.ui(this.name, "\u4e16\u754c");
         case UTILITY -> LangUtil.ui(this.name, "\u5b9e\u7528");
      };
   }

   public String getIcon() {
      return this.icon;
   }

   public void setModuleIndex(int moduleIndex) {
      this.moduleIndex = moduleIndex;
   }

   public int getModuleIndex() {
      return this.moduleIndex;
   }

   static {
      VALUES = values();
   }
}
