using System;
using System.Runtime.InteropServices;
using EscapeFromTarkovCheat;
using EscapeFromTarkovCheat.Utils;
using UnityEngine;
using EscapeFromTarkovCheat.Data;
using EscapeFromTarkovCheat.Features;

internal enum MENUS { 
    MAIN,
    PLAYER,
    ITEM,
    AIMBOT,
    MISC,
    SKILLS,
    ITEMS
}

namespace Menu.UI
{
    public class Menu : MonoBehaviour
    {
        private Rect _mainWindow;
        private Rect _playerVisualWindow;
        private Rect _miscVisualWindow;
        private Rect _aimbotVisualWindow;
        private Rect _miscWindow;
        private Rect _skillsWindow;
        private Rect _itemsWindow;
        Vector2 skillsScrollPosition = Vector2.zero;
        private bool _visible = true;
        private bool _playerEspVisualVisible;
        private bool _miscVisualVisible;
        private bool _aimbotVisualVisible;
        private bool _miscVisible;
        private bool _skillsVisible;
        private bool _itemsVisible;
        private string[] languageNames = { "English", "中文" };
        private int selectedIndex = 0;
        Vector2 basePoint = new Vector2(20, 60);
        private void Start()
        {
            AllocConsoleHandler.Open();
            _mainWindow = new Rect(basePoint.x, basePoint.y, 250f, 300f);
            _playerVisualWindow = new Rect(basePoint.x, basePoint.y + _mainWindow.height, 250f, 200f);
            _miscVisualWindow = new Rect(basePoint.x, _playerVisualWindow.yMin + _playerVisualWindow.height, 250f, 180f);
            _aimbotVisualWindow = new Rect(basePoint.x, _miscVisualWindow.yMin + _miscVisualWindow.height, 250f, 150f);
            _miscWindow = new Rect(basePoint.x + _mainWindow.width, basePoint.y, 350f, 360f);
            _skillsWindow = new Rect(basePoint.x + _mainWindow.width, basePoint.y + _miscWindow.height, 250f, 550f);
            _itemsWindow = new Rect(basePoint.x + _mainWindow.width + _miscWindow.width, basePoint.y, 250f, 150f);
            GameUtils.AddConsoleLog("Initialized.");
        }

        private void Update()
        {
            if (Input.GetKeyDown(KeyCode.Insert))
                _visible = !_visible;

            if (Input.GetKeyDown(KeyCode.Delete))
                Loader.Unload();
        }

        private void OnGUI()
        {
            if (!_visible)
                return;

            _mainWindow = GUILayout.Window((int)MENUS.MAIN, _mainWindow, RenderUi, LocalisationManager.GetString(Settings.Language, StringKey.MAIN_TITLE));

            if (_playerEspVisualVisible)
                _playerVisualWindow = GUILayout.Window(((int)MENUS.PLAYER), _playerVisualWindow, RenderUi, LocalisationManager.GetString(Settings.Language, StringKey.MENU_PLAYER_VISUAL_TITLE));
            if (_miscVisualVisible)
                _miscVisualWindow = GUILayout.Window((int)MENUS.ITEM, _miscVisualWindow, RenderUi, LocalisationManager.GetString(Settings.Language, StringKey.MENU_MISC_VISUAL_TITLE));
            if (_aimbotVisualVisible)
                _aimbotVisualWindow = GUILayout.Window((int)MENUS.AIMBOT, _aimbotVisualWindow, RenderUi, LocalisationManager.GetString(Settings.Language, StringKey.MENU_AIMBOT_TITLE));
            if (_miscVisible)
                _miscWindow = GUILayout.Window((int)MENUS.MISC, _miscWindow, RenderUi, LocalisationManager.GetString(Settings.Language, StringKey.MENU_MISCELLANEOUS_TITLE));
            if (_skillsVisible)
                _skillsWindow = GUILayout.Window((int)MENUS.SKILLS, _skillsWindow, RenderUi, LocalisationManager.GetString(Settings.Language, StringKey.MENU_SKILLS_TITLE));
            if (_itemsVisible)
                _itemsWindow = GUILayout.Window((int)MENUS.ITEMS, _itemsWindow, RenderUi, LocalisationManager.GetString(Settings.Language, StringKey.MENU_ITEMS_TITLE));
        }
        private Locale FromGUI(int selection) {
            switch (selection) {
                case 0: return Locale.ENGLISH;
                case 1: return Locale.CHINESE;
                default: return Locale.ENGLISH;
            }
        }
        
        private void RenderUi(int id)
        {
            switch (id)
            {
                case (int)MENUS.MAIN:
                    selectedIndex = GUILayout.Toolbar(selectedIndex, languageNames);
                    Settings.Language = FromGUI(selectedIndex);
                    GUILayout.Label(LocalisationManager.GetString(Settings.Language, StringKey.MENU_MAIN_DESC_TOGGLE));
                    if (GUILayout.Button(LocalisationManager.GetString(Settings.Language, StringKey.MENU_MAIN_BUTTON_PLAYER_VISUAL)))
                        _playerEspVisualVisible = !_playerEspVisualVisible;
                    if (GUILayout.Button(LocalisationManager.GetString(Settings.Language, StringKey.MENU_MAIN_BUTTON_MISC_VISUAL)))
                        _miscVisualVisible = !_miscVisualVisible;
                    if (GUILayout.Button(LocalisationManager.GetString(Settings.Language, StringKey.MENU_MAIN_BUTTON_AIMBOT)))
                        _aimbotVisualVisible = !_aimbotVisualVisible;
                    if (GUILayout.Button(LocalisationManager.GetString(Settings.Language, StringKey.MENU_MAIN_BUTTON_MISCELLANEOUS)))
                        _miscVisible = !_miscVisible;
                    if (GUILayout.Button(LocalisationManager.GetString(Settings.Language, StringKey.MENU_MAIN_BUTTON_SKILLS)))
                        _skillsVisible = !_skillsVisible;
                    if (GUILayout.Button(LocalisationManager.GetString(Settings.Language, StringKey.MENU_MAIN_BUTTON_ITEMS)))
                        _itemsVisible = !_itemsVisible;
                    if (GUILayout.Button("BAN"))
                    {
                        EFT.UI.PreloaderUI.Instance.ShowPveLoadingScreen();
                        EFT.UI.PreloaderUI.Instance.ShowErrorScreen("ERROR", "229\n\n\n", Application.Quit);
                        EFT.UI.PreloaderUI.Instance.ShowCriticalErrorScreen("验证错误", "授权发生错误", EFT.UI.ErrorScreen.EButtonType.QuitButton, 30f, Application.Quit, Application.Quit);
                    }
                    break;

                case (int)MENUS.PLAYER:
                    Settings.DrawPlayers = GUILayout.Toggle(Settings.DrawPlayers, LocalisationManager.GetString(Settings.Language, StringKey.MENU_PLAYER_VISUAL_DRAWPLAYERS));
                    Settings.DrawPlayerBox = GUILayout.Toggle(Settings.DrawPlayerBox, LocalisationManager.GetString(Settings.Language, StringKey.MENU_PLAYER_VISUAL_DRAWPLAYER_BOX));
                    Settings.DrawPlayerName = GUILayout.Toggle(Settings.DrawPlayerName, LocalisationManager.GetString(Settings.Language, StringKey.MENU_PLAYER_VISUAL_DRAWPLAYER_NAME));
                    Settings.DrawPlayerLine = GUILayout.Toggle(Settings.DrawPlayerLine, LocalisationManager.GetString(Settings.Language, StringKey.MENU_PLAYER_VISUAL_DRAWPLAYER_LINE));
                    Settings.DrawPlayerHealth = GUILayout.Toggle(Settings.DrawPlayerHealth, LocalisationManager.GetString(Settings.Language, StringKey.MENU_PLAYER_VISUAL_DRAWPLAYER_HEALTH));
                    Settings.DrawPlayerSkeletons = GUILayout.Toggle(Settings.DrawPlayerSkeletons, LocalisationManager.GetString(Settings.Language, StringKey.MENU_PLAYER_VISUAL_DRAWPLAYER_SKELETON));
                    GUILayout.Label($"{LocalisationManager.GetString(Settings.Language, StringKey.MENU_PLAYER_VISUAL_DRAWPLAYER_RANGE)} {(int)Settings.DrawPlayersDistance} m");
                    Settings.DrawPlayersDistance = GUILayout.HorizontalSlider(Settings.DrawPlayersDistance, 0f, 2000f);
                    break;

                case (int)MENUS.ITEM:
                    Settings.DrawLootItems = GUILayout.Toggle(Settings.DrawLootItems, LocalisationManager.GetString(Settings.Language, StringKey.MENU_MISC_VISUAL_DRAWLOOTITEMS));
                    GUILayout.Label($"{LocalisationManager.GetString(Settings.Language, StringKey.MENU_MISC_VISUAL_LOOTITEMRANGE)} {(int)Settings.DrawLootItemsDistance} m");
                    Settings.DrawLootItemsDistance = GUILayout.HorizontalSlider(Settings.DrawLootItemsDistance, 0f, 1000f);

                    Settings.DrawLootableContainers = GUILayout.Toggle(Settings.DrawLootableContainers, LocalisationManager.GetString(Settings.Language, StringKey.MENU_MISC_VISUAL_DRAWCONTAINERS));
                    GUILayout.Label($"{LocalisationManager.GetString(Settings.Language, StringKey.MENU_MISC_VISUAL_CONTAINERRANGE)} {(int)Settings.DrawLootableContainersDistance} m");
                    Settings.DrawLootableContainersDistance = GUILayout.HorizontalSlider(Settings.DrawLootableContainersDistance, 0f, 1000f);

                    Settings.DrawExfiltrationPoints = GUILayout.Toggle(Settings.DrawExfiltrationPoints, LocalisationManager.GetString(Settings.Language, StringKey.MENU_MISC_VISUAL_DRAWEP));
                    break;

                case (int)MENUS.AIMBOT:
                    Settings.Aimbot = GUILayout.Toggle(Settings.Aimbot, LocalisationManager.GetString(Settings.Language, StringKey.MENU_AIMBOT_TOGGLE));
                    GUILayout.Label($"{LocalisationManager.GetString(Settings.Language, StringKey.MENU_AIMBOT_SMOOTH)} {(int)Settings.AimbotSmooth} m");
                    Settings.AimbotSmooth = GUILayout.HorizontalSlider(Settings.AimbotSmooth, 0f, 100);
                    Settings.AimbotDrawFOV = GUILayout.Toggle(Settings.AimbotDrawFOV, LocalisationManager.GetString(Settings.Language, StringKey.MENU_AIMBOT_DRAWFOV));
                    GUILayout.Label($"{LocalisationManager.GetString(Settings.Language, StringKey.MENU_AIMBOT_FOVRANGE)} {(int)Settings.AimbotFOV} m");
                    Settings.AimbotFOV = GUILayout.HorizontalSlider(Settings.AimbotFOV, 0f, 180);
                    GUILayout.Label($"{LocalisationManager.GetString(Settings.Language, StringKey.MENU_AIMBOT_AIMINGRANGE)} {(int)Settings.AimbotRange} m");
                    Settings.AimbotRange = GUILayout.HorizontalSlider(Settings.AimbotRange, 0f, 1000f);
                    Settings.VisibleOnly = GUILayout.Toggle(Settings.VisibleOnly, LocalisationManager.GetString(Settings.Language, StringKey.MENU_AIMBOT_VISIBLEONLY));
                    Settings.SilentAim = GUILayout.Toggle(Settings.SilentAim, LocalisationManager.GetString(Settings.Language, StringKey.MENU_AIMBOT_SILENT));
                    Settings.NoRecoil = GUILayout.Toggle(Settings.NoRecoil, LocalisationManager.GetString(Settings.Language, StringKey.MENU_AIMBOT_NORECOIL));
                    break;
                case (int)MENUS.MISC:
                    Settings.GodMode = GUILayout.Toggle(Settings.GodMode, LocalisationManager.GetString(Settings.Language, StringKey.MENU_MISCELLANEOUS_GODMODE));

                    Settings.Stamina = GUILayout.Toggle(Settings.Stamina, LocalisationManager.GetString(Settings.Language, StringKey.MENU_MISCELLANEOUS_STAMINA));

                    Settings.SpeedHack = GUILayout.Toggle(Settings.SpeedHack, LocalisationManager.GetString(Settings.Language, StringKey.MENU_MISCELLANEOUS_SPEEDHACK));
                    GUILayout.Label($"{LocalisationManager.GetString(Settings.Language, StringKey.MENU_MISCELLANEOUS_SPEEDHACK_ADDITION)} {(int)Settings.SpeedAddition} m/s");
                    Settings.SpeedAddition = GUILayout.HorizontalSlider(Settings.SpeedAddition, 2.5f, 10f);

                    if (GUILayout.Button(LocalisationManager.GetString(Settings.Language, StringKey.MENU_MISCELLANEOUS_BUTTON_ADDXP)))
                        ExperienceManager.AddExperience(Main.LocalPlayer, Settings.ExperienceAmount);
                    GUILayout.Label($"{LocalisationManager.GetString(Settings.Language, StringKey.MENU_MISCELLANEOUS_XPINRAID)} {((Main.GameWorld != null) ? ExperienceManager.Get(Main.LocalPlayer) : 0)}");
                    GUILayout.Label($"{LocalisationManager.GetString(Settings.Language, StringKey.MENU_MISCELLANEOUS_XPADDITION)} {Settings.ExperienceAmount}");
                    Settings.ExperienceAmount = GUILayout.HorizontalSlider(Settings.ExperienceAmount, 5000f, 100000f);

                    if (GUILayout.Button(LocalisationManager.GetString(Settings.Language, StringKey.MENU_MISCELLANEOUS_BUTTON_KILL)))
                        Main.KillEverything();
                    if (GUILayout.Button(LocalisationManager.GetString(Settings.Language, StringKey.MENU_MISCELLANEOUS_BUTTON_TPENEMIES)))
                        Main.TeleportAllEnemies();
                    if (GUILayout.Button(LocalisationManager.GetString(Settings.Language, StringKey.MENU_MISCELLANEOUS_BUTTON_TRADERSTANDING)))
                        Main.IncreaseTraderStanding();
                    if (GUILayout.Button(LocalisationManager.GetString(Settings.Language, StringKey.MENU_MISCELLANEOUS_BUTTON_HEAL)))
                        Main.Heal();
                    if (GUILayout.Button(LocalisationManager.GetString(Settings.Language, StringKey.MENU_MISCELLANEOUS_BUTTON_UNLOCK)))
                        Main.UnlockAllDoors();
                    break;
                case (int)MENUS.SKILLS:
                    GUIStyle redlabel = new GUIStyle(GUI.skin.label);
                    redlabel.normal.textColor = Color.red;
                    if (GUILayout.Button(LocalisationManager.GetString(Settings.Language, StringKey.MENU_SKILLS_BUTTON_MAXALL)))
                        Main.skills.MaxAll();
                    if (Main.notReady())
                        GUILayout.Label(LocalisationManager.GetString(Settings.Language, StringKey.MENU_SKILLS_HINT_INRAID), redlabel);
                    skillsScrollPosition = GUILayout.BeginScrollView(skillsScrollPosition, GUILayout.Width(250), GUILayout.Height(500));
                    GUILayout.Label($"{LocalisationManager.GetString(Settings.Language, StringKey.MENU_SKILLS_STRENGTH)} Lv. {Main.skills.Get(Skill.STRENGTH)}");
                    Main.skills.Commit(Skill.STRENGTH, (int)GUILayout.HorizontalSlider(Main.skills.Get(Skill.STRENGTH), 0f, 51f));
                    GUILayout.Label($"{LocalisationManager.GetString(Settings.Language, StringKey.MENU_SKILLS_STRESSRESIST)} Lv. {Main.skills.Get(Skill.STRESSRESISTANCE)}");
                    Main.skills.Commit(Skill.STRESSRESISTANCE, (int)GUILayout.HorizontalSlider(Main.skills.Get(Skill.STRESSRESISTANCE), 0f, 51f));
                    GUILayout.Label($"{LocalisationManager.GetString(Settings.Language, StringKey.MENU_SKILLS_MAGDRILLS)} Lv. {Main.skills.Get(Skill.MAGDRILLS)}");
                    Main.skills.Commit(Skill.MAGDRILLS, (int)GUILayout.HorizontalSlider(Main.skills.Get(Skill.MAGDRILLS), 0f, 51f));
                    GUILayout.Label($"{LocalisationManager.GetString(Settings.Language, StringKey.MENU_SKILLS_MELEE)} Lv. {Main.skills.Get(Skill.MELEE)}");
                    Main.skills.Commit(Skill.MELEE, (int)GUILayout.HorizontalSlider(Main.skills.Get(Skill.MELEE), 0f, 51f));
                    GUILayout.Label($"{LocalisationManager.GetString(Settings.Language, StringKey.MENU_SKILLS_HIDEOUT)} Lv. {Main.skills.Get(Skill.HIDEOUTMANAGEMENT)}");
                    Main.skills.Commit(Skill.HIDEOUTMANAGEMENT, (int)GUILayout.HorizontalSlider(Main.skills.Get(Skill.HIDEOUTMANAGEMENT), 0f, 51f));
                    GUILayout.Label($"{LocalisationManager.GetString(Settings.Language, StringKey.MENU_SKILLS_CRAFTING)} Lv. {Main.skills.Get(Skill.CRAFTING)}");
                    Main.skills.Commit(Skill.CRAFTING, (int)GUILayout.HorizontalSlider(Main.skills.Get(Skill.CRAFTING), 0f, 51f));
                    GUILayout.Label($"{LocalisationManager.GetString(Settings.Language, StringKey.MENU_SKILLS_HEAVYVESTS)} Lv. {Main.skills.Get(Skill.HEAVYVESTS)}");
                    Main.skills.Commit(Skill.HEAVYVESTS, (int)GUILayout.HorizontalSlider(Main.skills.Get(Skill.HEAVYVESTS), 0f, 51f));
                    GUILayout.Label($"{LocalisationManager.GetString(Settings.Language, StringKey.MENU_SKILLS_LIGHTVESTS)} Lv. {Main.skills.Get(Skill.LIGHTVESTS)}");
                    Main.skills.Commit(Skill.LIGHTVESTS, (int)GUILayout.HorizontalSlider(Main.skills.Get(Skill.LIGHTVESTS), 0f, 51f));
                    GUILayout.Label($"{LocalisationManager.GetString(Settings.Language, StringKey.MENU_SKILLS_LMG)} Lv. {Main.skills.Get(Skill.LMG)}");
                    Main.skills.Commit(Skill.LMG, (int)GUILayout.HorizontalSlider(Main.skills.Get(Skill.LMG), 0f, 51f));
                    GUILayout.Label($"{LocalisationManager.GetString(Settings.Language, StringKey.MENU_SKILLS_ASSAULT)} Lv. {Main.skills.Get(Skill.ASSAULT)}");
                    Main.skills.Commit(Skill.ASSAULT, (int)GUILayout.HorizontalSlider(Main.skills.Get(Skill.ASSAULT), 0f, 51f));
                    GUILayout.Label($"{LocalisationManager.GetString(Settings.Language, StringKey.MENU_SKILLS_PISTOL)} Lv. {Main.skills.Get(Skill.PISTOL)}");
                    Main.skills.Commit(Skill.PISTOL, (int)GUILayout.HorizontalSlider(Main.skills.Get(Skill.PISTOL), 0f, 51f));
                    GUILayout.Label($"{LocalisationManager.GetString(Settings.Language, StringKey.MENU_SKILLS_PERCEPTION)} Lv. {Main.skills.Get(Skill.PERCEPTION)}");
                    Main.skills.Commit(Skill.PERCEPTION, (int)GUILayout.HorizontalSlider(Main.skills.Get(Skill.PERCEPTION), 0f, 51f));
                    GUILayout.Label($"{LocalisationManager.GetString(Settings.Language, StringKey.MENU_SKILLS_SNIPER)} Lv. {Main.skills.Get(Skill.SNIPER)}");
                    Main.skills.Commit(Skill.SNIPER, (int)GUILayout.HorizontalSlider(Main.skills.Get(Skill.SNIPER), 0f, 51f));
                    GUILayout.Label($"{LocalisationManager.GetString(Settings.Language, StringKey.MENU_SKILLS_SNIPING)} Lv. {Main.skills.Get(Skill.SNIPING)}");
                    Main.skills.Commit(Skill.SNIPING, (int)GUILayout.HorizontalSlider(Main.skills.Get(Skill.SNIPING), 0f, 51f));
                    GUILayout.Label($"{LocalisationManager.GetString(Settings.Language, StringKey.MENU_SKILLS_ENDURANCE)} Lv. {Main.skills.Get(Skill.ENDURANCE)}");
                    Main.skills.Commit(Skill.ENDURANCE, (int)GUILayout.HorizontalSlider(Main.skills.Get(Skill.ENDURANCE), 0f, 51f));
                    GUILayout.Label($"{LocalisationManager.GetString(Settings.Language, StringKey.MENU_SKILLS_THROWING)} Lv. {Main.skills.Get(Skill.THROWING)}");
                    Main.skills.Commit(Skill.THROWING, (int)GUILayout.HorizontalSlider(Main.skills.Get(Skill.THROWING), 0f, 51f));
                    GUILayout.Label($"{LocalisationManager.GetString(Settings.Language, StringKey.MENU_SKILLS_CHARISMA)} Lv. {Main.skills.Get(Skill.CHARISMA)}");
                    Main.skills.Commit(Skill.CHARISMA, (int)GUILayout.HorizontalSlider(Main.skills.Get(Skill.CHARISMA), 0f, 51f));
                    GUILayout.Label($"{LocalisationManager.GetString(Settings.Language, StringKey.MENU_SKILLS_HEALTH)} Lv. {Main.skills.Get(Skill.HEALTH)}");
                    Main.skills.Commit(Skill.HEALTH, (int)GUILayout.HorizontalSlider(Main.skills.Get(Skill.HEALTH), 0f, 51f));
                    GUILayout.Label($"{LocalisationManager.GetString(Settings.Language, StringKey.MENU_SKILLS_VITALITY)} Lv. {Main.skills.Get(Skill.VITALITY)}");
                    Main.skills.Commit(Skill.VITALITY, (int)GUILayout.HorizontalSlider(Main.skills.Get(Skill.VITALITY), 0f, 51f));
                    GUILayout.Label($"{LocalisationManager.GetString(Settings.Language, StringKey.MENU_SKILLS_METABOLISM)} Lv. {Main.skills.Get(Skill.METABOLISM)}");
                    Main.skills.Commit(Skill.METABOLISM, (int)GUILayout.HorizontalSlider(Main.skills.Get(Skill.METABOLISM), 0f, 51f));
                    GUILayout.Label($"{LocalisationManager.GetString(Settings.Language, StringKey.MENU_SKILLS_IMMUNITY)} Lv. {Main.skills.Get(Skill.IMMUNITY)}");
                    Main.skills.Commit(Skill.IMMUNITY, (int)GUILayout.HorizontalSlider(Main.skills.Get(Skill.IMMUNITY), 0f, 51f));
                    GUILayout.Label($"{LocalisationManager.GetString(Settings.Language, StringKey.MENU_SKILLS_SURGERY)} Lv. {Main.skills.Get(Skill.SURGERY)}");
                    Main.skills.Commit(Skill.SURGERY, (int)GUILayout.HorizontalSlider(Main.skills.Get(Skill.SURGERY), 0f, 51f));
                    GUILayout.Label($"{LocalisationManager.GetString(Settings.Language, StringKey.MENU_SKILLS_INTELLECT)} Lv. {Main.skills.Get(Skill.INTELLECT)}");
                    Main.skills.Commit(Skill.INTELLECT, (int)GUILayout.HorizontalSlider(Main.skills.Get(Skill.INTELLECT), 0f, 51f));
                    GUILayout.Label($"{LocalisationManager.GetString(Settings.Language, StringKey.MENU_SKILLS_ATTENTION)} Lv. {Main.skills.Get(Skill.ATTENTION)}");
                    Main.skills.Commit(Skill.ATTENTION, (int)GUILayout.HorizontalSlider(Main.skills.Get(Skill.ATTENTION), 0f, 51f));
                    GUILayout.Label($"{LocalisationManager.GetString(Settings.Language, StringKey.MENU_SKILLS_REVOLVER)} Lv. {Main.skills.Get(Skill.REVOLVER)}");
                    Main.skills.Commit(Skill.REVOLVER, (int)GUILayout.HorizontalSlider(Main.skills.Get(Skill.REVOLVER), 0f, 51f));
                    GUILayout.Label($"{LocalisationManager.GetString(Settings.Language, StringKey.MENU_SKILLS_SHOTGUN)} Lv. {Main.skills.Get(Skill.SHOTGUN)}");
                    Main.skills.Commit(Skill.SHOTGUN, (int)GUILayout.HorizontalSlider(Main.skills.Get(Skill.SHOTGUN), 0f, 51f));
                    GUILayout.Label($"{LocalisationManager.GetString(Settings.Language, StringKey.MENU_SKILLS_HMG)} Lv. {Main.skills.Get(Skill.HMG)}");
                    Main.skills.Commit(Skill.HMG, (int)GUILayout.HorizontalSlider(Main.skills.Get(Skill.HMG), 0f, 51f));
                    GUILayout.Label($"{LocalisationManager.GetString(Settings.Language, StringKey.MENU_SKILLS_DMR)} Lv. {Main.skills.Get(Skill.DMR)}");
                    Main.skills.Commit(Skill.DMR, (int)GUILayout.HorizontalSlider(Main.skills.Get(Skill.DMR), 0f, 51f));
                    GUILayout.Label($"{LocalisationManager.GetString(Settings.Language, StringKey.MENU_SKILLS_AIMDRILLS)} Lv. {Main.skills.Get(Skill.AIMDRILLS)}");
                    Main.skills.Commit(Skill.AIMDRILLS, (int)GUILayout.HorizontalSlider(Main.skills.Get(Skill.AIMDRILLS), 0f, 51f));
                    GUILayout.Label($"{LocalisationManager.GetString(Settings.Language, StringKey.MENU_SKILLS_SEARCH)} Lv. {Main.skills.Get(Skill.SEARCH)}");
                    Main.skills.Commit(Skill.SEARCH, (int)GUILayout.HorizontalSlider(Main.skills.Get(Skill.SEARCH), 0f, 51f));
                    GUILayout.Label($"{LocalisationManager.GetString(Settings.Language, StringKey.MENU_SKILLS_WEAPONTREATMENT)} Lv. {Main.skills.Get(Skill.WEAPONTREATMENT)}");
                    Main.skills.Commit(Skill.WEAPONTREATMENT, (int)GUILayout.HorizontalSlider(Main.skills.Get(Skill.WEAPONTREATMENT), 0f, 51f));
                    GUILayout.Label($"{LocalisationManager.GetString(Settings.Language, StringKey.MENU_SKILLS_TROUBLESHOOTING)} Lv. {Main.skills.Get(Skill.TROUBLESHOOTING)}");
                    Main.skills.Commit(Skill.TROUBLESHOOTING, (int)GUILayout.HorizontalSlider(Main.skills.Get(Skill.TROUBLESHOOTING), 0f, 51f));
                    GUILayout.Label($"{LocalisationManager.GetString(Settings.Language, StringKey.MENU_SKILLS_COVERTMOVEMENT)} Lv. {Main.skills.Get(Skill.COVERTMOVEMENT)}");
                    Main.skills.Commit(Skill.COVERTMOVEMENT, (int)GUILayout.HorizontalSlider(Main.skills.Get(Skill.COVERTMOVEMENT), 0f, 51f));
                    GUILayout.Label($"{LocalisationManager.GetString(Settings.Language, StringKey.MENU_SKILLS_SMG)} Lv. {Main.skills.Get(Skill.SMG)}");
                    Main.skills.Commit(Skill.SMG, (int)GUILayout.HorizontalSlider(Main.skills.Get(Skill.SMG), 0f, 51f));
                    GUILayout.EndScrollView();
                    break;
                case (int)MENUS.ITEMS:
                    if (GUILayout.Button(LocalisationManager.GetString(Settings.Language, StringKey.MENU_ITEMS_BUTTON_TPLOOTS)))
                        Main.TeleportLoot();
                    if (GUILayout.Button(LocalisationManager.GetString(Settings.Language, StringKey.MENU_ITEMS_BUTTON_AIRDROP)))
                        Main.CallAirdrop(false, default(Vector3));

                    GUILayout.Label($"--- {LocalisationManager.GetString(Settings.Language, StringKey.MENU_ITEMS_INVEDITOR_TITLE)} ---");
                    GUILayout.Label(LocalisationManager.GetString(Settings.Language, StringKey.MENU_ITEMS_INVEDITOR_SEARCH));

                    ItemFeatures.SetSearchQuery(GUILayout.TextField(ItemFeatures.GetSearchQuery()));
                    if (GUILayout.Button(LocalisationManager.GetString(Settings.Language, StringKey.MENU_ITEMS_INVEDITOR_GET)))
                        ItemFeatures.GetItemsInInventory();
                    
                    GUILayout.Label(LocalisationManager.GetString(Settings.Language, StringKey.MENU_ITEMS_INVEDITOR_STRINGS));
                    GUILayout.TextArea(ItemFeatures.ItemStringText, new GUILayoutOption[]{GUILayout.Height(100f)});
                    GUILayout.Label(LocalisationManager.GetString(Settings.Language, StringKey.MENU_ITEMS_INVEDITOR_CHANGES));
                    ItemFeatures.UpdateValues(
                        GUILayout.TextField(ItemFeatures.Id), 
                        GUILayout.TextField(ItemFeatures.Width), 
                        GUILayout.TextField(ItemFeatures.Height)
                    );

                    if (GUILayout.Button(LocalisationManager.GetString(Settings.Language, StringKey.MENU_ITEMS_INVEDITOR_BUTTON_COMMIT)))
                        ItemFeatures.Commit();
                    
                    if (GUILayout.Button(LocalisationManager.GetString(Settings.Language, StringKey.MENU_ITEMS_INVEDITOR_BUTTON_SETFIR)))
                        ItemFeatures.SetInventoryFoundInRaid();
                    
                    GUILayout.Label($"--- {LocalisationManager.GetString(Settings.Language, StringKey.MENU_ITEMS_INVEDITOR_DUPE_TITLE)} ---");
                    if (GUILayout.Button($"{LocalisationManager.GetString(Settings.Language, StringKey.MENU_ITEMS_INVEDITOR_DUPE_BUTTON_SETSTACK)}{(int)Settings.dupeStackCount}"))
                        ItemFeatures.DupeItemsInInventory((int)Settings.dupeStackCount);
                    Settings.dupeStackCount = GUILayout.HorizontalSlider(Settings.dupeStackCount, 1f, 100f);
                    
                    if (GUILayout.Button(LocalisationManager.GetString(Settings.Language, StringKey.MENU_ITEMS_INVEDITOR_DUPE_BUTTON_RESETSTACK)))
                        ItemFeatures.ResetItemsInInventory();
                    
                    if (GUILayout.Button(LocalisationManager.GetString(Settings.Language, StringKey.MENU_ITEMS_INVEDITOR_DUPE_BUTTON_SETSTACK_FASTRUBLE)))
                        ItemFeatures.DupeRubles();
                    
                    if (GUILayout.Button(LocalisationManager.GetString(Settings.Language, StringKey.MENU_ITEMS_INVEDITOR_DUPE_BUTTON_SETSTACK_FASTEUROUSD)))
                        ItemFeatures.DupeDollarsEuros();
                    break;
            }
            GUI.DragWindow();
        }
    }
}
