public void Update()
        {
            if (Player.main != null)
            {
                if (Input.GetKeyDown(Config.KEYBINDINGS["ToggleWindow"]))
                {
                    isActive = !isActive;
                }

                if (!isActive)
                {
                    return;
                }

                if (Input.GetKeyDown(Config.KEYBINDINGS["ToggleMouse"]))
                {
                    UWE.Utils.lockCursor = !UWE.Utils.lockCursor;
                }

                if (!initToggleButtons && !uGUI.main.loading.IsLoading)
                {
                    SetToggleButtons();
                    initToggleButtons = true;
                    UpdateButtonsState();
                }

                if (CommandsGroup.ItemID != -1 && CommandsGroup.MouseButton == 0)
                {
                    buttonControl.NormalButtonControl(CommandsGroup.ItemID, ref commands, ref toggleCommands);
                }

                if (ToggleCommandsGroup.ItemID != -1 && ToggleCommandsGroup.MouseButton == 0)
                {
                    buttonControl.ToggleButtonControl(ToggleCommandsGroup.ItemID, ref toggleCommands);
                }

                if (DayNightGroup.ItemID != -1 && DayNightGroup.MouseButton == 0)
                {
                    buttonControl.DayNightButtonControl(DayNightGroup.ItemID, ref currentdaynightTab, ref daynightTab);
                }

                if (CategoriesGroup.ItemID != -1 && CategoriesGroup.MouseButton == 0)
                {
                    if (CategoriesGroup.ItemID != currentTab)
                    {
                        //categoriesTab[currentTab].State = SNGUI.SetStateInverse(categoriesTab[currentTab].State);
                        //categoriesTab[categoriesTabID].State = SNGUI.SetStateInverse(categoriesTab[categoriesTabID].State);
                        currentTab = CategoriesGroup.ItemID;
                        scrollPos  = Vector2.zero;
                    }
                }

                if (ScrollViewGroup.ItemID != -1 && ScrollViewGroup.MouseButton == 0)
                {
                    buttonControl.ScrollViewControl(currentTab, ScrollViewGroup.ItemID, ref scrollItemsList[currentTab], ref tMatrix, ref commands);
                }

                if (VehicleSettingsGroup.ItemID != -1 && VehicleSettingsGroup.MouseButton == 0)
                {
                    if (VehicleSettingsGroup.ItemID == 0)
                    {
                        isSeamothCanFly.Update(!isSeamothCanFly.value);
                        vehicleSettings[0].State = SNGUI.ConvertBoolToState(isSeamothCanFly.value);
                    }

                    if (VehicleSettingsGroup.ItemID == 1)
                    {
                        isSeaglideFast.Update(!isSeaglideFast.value);
                        vehicleSettings[1].State = SNGUI.ConvertBoolToState(isSeaglideFast.value);
                    }
                }
            }
        }
        public void Update()
        {
            if (Player.main != null)
            {
                if (Input.GetKeyDown(Config.Config.KEYBINDINGS[0]))
                {
                    isActive = !isActive;
                }

                if (isActive)
                {
                    windowTitle = $"CheatManager v.{Config.Config.VERSION}, {Config.Config.KEYBINDINGS[0]} Toggle Window, {Config.Config.KEYBINDINGS[1]} Toggle Mouse";

                    if (Input.GetKeyDown(Config.Config.KEYBINDINGS[1]))
                    {
                        UWE.Utils.lockCursor = !UWE.Utils.lockCursor;
                    }

                    if (!initToggleButtons)
                    {
                        ReadGameValues();
                        initToggleButtons = true;
                    }

                    if (normalButtonID != -1)
                    {
                        ButtonControl.NormalButtonControl(normalButtonID, ref Buttons, ref toggleButtons);
                    }

                    if (toggleButtonID != -1)
                    {
                        ButtonControl.ToggleButtonControl(toggleButtonID, ref toggleButtons);
                    }

                    if (daynightTabID != -1)
                    {
                        ButtonControl.DayNightButtonControl(daynightTabID, ref currentdaynightTab, ref daynightTab);
                    }

                    if (categoriesTabID != -1)
                    {
                        if (categoriesTabID != currentTab)
                        {
                            categoriesTab[currentTab].Pressed      = false;
                            categoriesTab[categoriesTabID].Pressed = true;
                            currentTab = categoriesTabID;
                            scrollPos  = Vector2.zero;
                        }
                    }

                    if (vehicleSettingsID != -1)
                    {
                        if (vehicleSettingsID == 0)
                        {
                            if (SeamothOverDrive.Main != null)
                            {
                                seamothCanFly = !seamothCanFly;
                                vehicleSettings[0].Pressed = seamothCanFly;
                            }
                            else
                            {
                                ErrorMessage.AddMessage("CheatManager Error!\nYou do not have a Seamoth!");
                            }
                        }

                        if (vehicleSettingsID == 1)
                        {
                            if (SeaglideOverDrive.Main != null)
                            {
                                isSeaglideFast.Update(!isSeaglideFast.value);
                                vehicleSettings[1].Pressed = isSeaglideFast.value;
                            }
                            else
                            {
                                ErrorMessage.AddMessage("CheatManager Error!\nYou do not have a Seaglide!");
                            }
                        }
                    }
                }

                if (toggleButtons[18].Pressed)
                {
                    Player.main.infectedMixin.SetInfectedAmount(0f);
                }
            }
        }