public override bool CreateConfigurationMenu(ExtensionParameter extensionParameter, ref Dictionary <String, Object> Parameters)
        {
            ImGui.TextDisabled("Condition Info");
            ImGuiExtension.ToolTip("This condition is used to determine if we can use a specific flask.\nIt will ensure that health/hybrid/mana potions are not used when we are at full health/mana.\nThis will also ensure that we do not use up reserved uses.");

            base.CreateConfigurationMenu(extensionParameter, ref Parameters);

            TimerName = ImGuiExtension.InputText("Timer Name", TimerName, 30, InputTextFlags.Default);
            ImGuiExtension.ToolTip("Name for this timer");
            Parameters[TimerNameString] = TimerName.ToString();

            var tempTimerLength = ImGuiExtension.InputText("Time Elapsed (ms)", TimeElapsed.ToString(), 30, InputTextFlags.Default);

            if (Int32.TryParse(tempTimerLength, out int convertedTimerLength))
            {
                TimeElapsed = convertedTimerLength;
            }
            ImGuiExtension.ToolTip("True if timer has run longer than specified time\n1000 ms = 1 sec");
            Parameters[TimeElapsedString] = TimeElapsed.ToString();

            TrueIfStopped = ImGuiExtension.Checkbox("True if stopped", TrueIfStopped);
            ImGuiExtension.ToolTip("When enabled, returns true if timer is stopped (or never started)");
            Parameters[TrueIfStoppedString] = TrueIfStopped.ToString();

            return(true);
        }
        public override bool CreateConfigurationMenu(ExtensionParameter extensionParameter, ref Dictionary <String, Object> Parameters)
        {
            ImGui.TextDisabled("Condition Info");
            ImGuiExtension.ToolTip("This condition will return true if the player has any of the selected ailments or a minimum of the specified corrupted blood stacks.");

            base.CreateConfigurationMenu(extensionParameter, ref Parameters);

            RemFrozen = ImGuiExtension.Checkbox("Frozen", RemFrozen);
            Parameters[RemFrozenString] = RemFrozen.ToString();

            RemBurning = ImGuiExtension.Checkbox("Burning", RemBurning);
            Parameters[RemBurningString] = RemBurning.ToString();

            RemShocked = ImGuiExtension.Checkbox("Shocked", RemShocked);
            Parameters[RemShockedString] = RemShocked.ToString();

            RemCurse = ImGuiExtension.Checkbox("Curse", RemCurse);
            Parameters[RemCurseString] = RemCurse.ToString();

            RemPoison = ImGuiExtension.Checkbox("Poison", RemPoison);
            Parameters[RemPoisonString] = RemPoison.ToString();

            RemBleed = ImGuiExtension.Checkbox("Bleed", RemBleed);
            Parameters[RemBleedString] = RemBleed.ToString();

            CorruptCount = ImGuiExtension.IntSlider("Corruption Count", CorruptCount, 0, 20);
            Parameters[CorruptCountString] = CorruptCount.ToString();
            return(true);
        }
Example #3
0
        public override bool CreateConfigurationMenu(ExtensionParameter extensionParameter, ref Dictionary <String, Object> Parameters)
        {
            ImGui.TextDisabled("Condition Info");
            ImGuiExtension.ToolTip("This condition will return true if the player's energy shield percentage is above/below the specified amount.");

            base.CreateConfigurationMenu(extensionParameter, ref Parameters);

            int radioTarget = IsAbove ? 0 : 1;

            if (ImGui.RadioButton("Above Percentage", ref radioTarget, 0))
            {
                IsAbove = true;
            }
            if (ImGui.RadioButton("Below Percentage", ref radioTarget, 1))
            {
                IsAbove = false;
            }

            Parameters[IsAboveString] = IsAbove.ToString();

            Percentage = ImGuiExtension.IntSlider("Energy Shield Percentage", Percentage, 1, 100);
            Parameters[PercentageString] = Percentage.ToString();

            return(true);
        }
Example #4
0
        public override bool CreateConfigurationMenu(ExtensionParameter extensionParameter, ref Dictionary <String, Object> Parameters)
        {
            ImGui.TextDisabled("Condition Info");
            ImGuiExtension.ToolTip("This condition will return true if any of the selected player's resistances\nare reduced by more than or equal to the specified amount.\nReduced max resistance modifiers are taken into effect automatically (e.g. -res map mods).");


            base.CreateConfigurationMenu(extensionParameter, ref Parameters);

            CheckCold = ImGuiExtension.Checkbox("Cold", CheckCold);
            Parameters[CheckColdString] = CheckCold.ToString();

            CheckFire = ImGuiExtension.Checkbox("Fire", CheckFire);
            Parameters[CheckFireString] = CheckFire.ToString();

            CheckLightning = ImGuiExtension.Checkbox("Lightning", CheckLightning);
            Parameters[CheckLightningString] = CheckLightning.ToString();

            CheckChaos = ImGuiExtension.Checkbox("Chaos", CheckChaos);
            Parameters[CheckChaosString] = CheckChaos.ToString();

            ResistanceThreshold = ImGuiExtension.IntSlider("Resistance Threshold", ResistanceThreshold, 0, 125);
            Parameters[ResistanceThresholdString] = ResistanceThreshold.ToString();

            return(true);
        }
Example #5
0
        public override bool CreateConfigurationMenu(ExtensionParameter extensionParameter, ref Dictionary <String, Object> Parameters)
        {
            ImGui.TextDisabled("Vaal Skills");

            ImGui.Spacing();
            ImGui.Separator();
            ImGui.Spacing();

            useVaalHaste = ImGuiExtension.Checkbox("Vaal Haste", useVaalHaste);
            Parameters[useHasteString] = useVaalHaste.ToString();
            ImGui.SameLine();

            useVaalGrace = ImGuiExtension.Checkbox("Vaal Grace", useVaalGrace);
            Parameters[useDodgeString] = useVaalGrace.ToString();
            ImGui.SameLine();

            useVaalClarity = ImGuiExtension.Checkbox("Vaal Clarity", useVaalClarity);
            Parameters[useNoManaString] = useVaalClarity.ToString();
            ImGui.SameLine();

            useVaalClarity = ImGuiExtension.Checkbox("Vaal Reave", useVaalReave);
            Parameters[useAoeExtenderString] = useVaalReave.ToString();
            ImGui.SameLine();


            ImGui.Spacing();
            ImGui.Separator();
            ImGui.Spacing();
            ImGuiExtension.ToolTip("This action is used to configure Vaal Skills");
            Key = (int)ImGuiExtension.HotkeySelector("Hotkey", (Keys)Key);
            ImGuiExtension.ToolTip("Hotkey to press for the first Vaal Skill.");
            Parameters[keyString] = Key.ToString();
            return(true);
        }
Example #6
0
 public void DrawWithTooltip()
 {
     Draw();
     if (!string.IsNullOrEmpty(SettingTooltip))
     {
         ImGuiExtension.ToolTip(SettingTooltip);
     }
 }
Example #7
0
        public override bool CreateConfigurationMenu(ExtensionParameter extensionParameter, ref Dictionary <string, object> Parameters)
        {
            Invert = ImGuiExtension.Checkbox("Invert", Invert);
            ImGuiExtension.ToolTip("Check this box to invert the returned value of this condition.\nFor Example when enabled, if the condition returns true when in hideout, it would now return true when NOT in hideout.");
            Parameters[InvertString] = Invert.ToString();

            return(true);
        }
 public override bool CreateConfigurationMenu(ExtensionParameter extensionParameter, ref Dictionary <String, Object> Parameters)
 {
     ImGui.TextDisabled("Action Info");
     ImGuiExtension.ToolTip("This action is used to send a hotkey to the game.");
     Key = (int)ImGuiExtension.HotkeySelector("Hotkey", (Keys)Key);
     ImGuiExtension.ToolTip("Hotkey to press for this action.");
     Parameters[keyString] = Key.ToString();
     return(true);
 }
Example #9
0
        public override void DrawSettingsMenu()
        {
            for (int i = 0; i < 5; i++)
            {
                if (ImGui.TreeNode("Flask " + (i + 1) + " Settings"))
                {
                    Settings.FlaskSettings[i].Enable.Value = ImGuiExtension.Checkbox("Enable", Settings.FlaskSettings[i].Enable);
                    ImGuiExtension.ToolTip("Enables the macro");

                    Settings.FlaskSettings[i].Hotkey.Value = ImGuiExtension.HotkeySelector("Flask Hotkey", "Flask Hotkey", Settings.FlaskSettings[i].Hotkey);
                    ImGuiExtension.ToolTip("Path of Exile key for flask in this slot");

                    ImGui.TreePop();
                }
            }

            if (ImGui.TreeNode("Macro Settings"))
            {
                for (int i = 0; i < 5; i++)
                {
                    if (ImGui.TreeNode("Macro " + (i + 1)))
                    {
                        Settings.MacroSettings[i].Enable.Value = ImGuiExtension.Checkbox("Enable", Settings.MacroSettings[i].Enable);
                        ImGuiExtension.ToolTip("Enables the macro");

                        Settings.MacroSettings[i].UseFlask1.Value = ImGuiExtension.Checkbox("Flask 1 Enable", Settings.MacroSettings[i].UseFlask1);
                        ImGuiExtension.ToolTip("Enables using Flask 1 for this macro");

                        Settings.MacroSettings[i].UseFlask2.Value = ImGuiExtension.Checkbox("Flask 2 Enable", Settings.MacroSettings[i].UseFlask2);
                        ImGuiExtension.ToolTip("Enables using Flask 2 for this macro");

                        Settings.MacroSettings[i].UseFlask3.Value = ImGuiExtension.Checkbox("Flask 3 Enable", Settings.MacroSettings[i].UseFlask3);
                        ImGuiExtension.ToolTip("Enables using Flask 3 for this macro");


                        Settings.MacroSettings[i].UseFlask4.Value = ImGuiExtension.Checkbox("Flask 4 Enable", Settings.MacroSettings[i].UseFlask4);
                        ImGuiExtension.ToolTip("Enables using Flask 4 for this macro");

                        Settings.MacroSettings[i].UseFlask5.Value = ImGuiExtension.Checkbox("Flask 5 Enable", Settings.MacroSettings[i].UseFlask5);
                        ImGuiExtension.ToolTip("Enables using Flask 5 for this macro");

                        ImGui.TreePop();
                    }

                    Settings.MacroSettings[i].Hotkey.Value = ImGuiExtension.HotkeySelector($"Macro Hotkey {i+1}", $"Macro Hotkey {i + 1}", Settings.MacroSettings[i].Hotkey);
                    ImGuiExtension.ToolTip("Hotkey for using the flask");
                }

                ImGui.TreePop();
            }

            Settings.TicksPerSecond.Value = ImGuiExtension.IntSlider("Ticks Per Second", Settings.TicksPerSecond);
            ImGuiExtension.ToolTip("Specifies number of ticks per second");

            Settings.Debug.Value = ImGuiExtension.Checkbox("Debug", Settings.Debug);
            ImGuiExtension.ToolTip("Enables debug logging to help debug flask issues.");
        }
        public override bool CreateConfigurationMenu(ExtensionParameter extensionParameter, ref Dictionary <String, Object> Parameters)
        {
            ImGui.TextDisabled("Action Info");
            ImGuiExtension.ToolTip("This action is used to use a specific flask.\nFlask Hotkey will be pulled from plugin settings.");

            FlaskIndex = ImGuiExtension.IntSlider("Flask Index", FlaskIndex, 1, 5);
            ImGuiExtension.ToolTip("Index for flask to be used (1= farthest left, 5 = farthest right)");
            Parameters[flaskIndexString] = FlaskIndex.ToString();
            return(true);
        }
Example #11
0
        public override bool CreateConfigurationMenu(ExtensionParameter extensionParameter, ref Dictionary <String, Object> Parameters)
        {
            ImGui.TextDisabled("Condition Info");
            ImGuiExtension.ToolTip("This condition is used to determine if we have the flask buff up already.");

            base.CreateConfigurationMenu(extensionParameter, ref Parameters);

            FlaskIndex = ImGuiExtension.IntSlider("Flask Index", FlaskIndex, 1, 5);
            Parameters[flaskIndexString] = FlaskIndex.ToString();
            return(true);
        }
Example #12
0
        public override bool CreateConfigurationMenu(ExtensionParameter extensionParameter, ref Dictionary <String, Object> Parameters)
        {
            ImGui.TextDisabled("Condition Info");
            ImGuiExtension.ToolTip("This condition will return true if the player has been moving longer than the specified time.");

            base.CreateConfigurationMenu(extensionParameter, ref Parameters);

            MsMoving = ImGuiExtension.IntSlider("Time spent moving (ms)", (int)MsMoving, 0, 10000);
            ImGuiExtension.ToolTip("Player must remain moving for this configured number of milliseconds (1000ms = 1 sec) before this condition returns true");
            Parameters[msMovingString] = MsMoving.ToString();
            return(true);
        }
        public override bool CreateConfigurationMenu(ExtensionParameter extensionParameter, ref Dictionary <String, Object> Parameters)
        {
            ImGui.TextDisabled("Condition Info");
            ImGuiExtension.ToolTip("Hotkey to check for pressed down state");

            base.CreateConfigurationMenu(extensionParameter, ref Parameters);

            Key = (int)ImGuiExtension.HotkeySelector("Hotkey", (Keys)Key);
            ImGuiExtension.ToolTip("Hotkey to press for this action.");
            Parameters[keyString] = Key.ToString();

            return(true);
        }
        public override bool CreateConfigurationMenu(ExtensionParameter extensionParameter, ref Dictionary <String, Object> Parameters)
        {
            ImGui.TextDisabled("Condition Info");
            ImGuiExtension.ToolTip("This condition is used to determine if we can use a specific flask.\nIt will ensure that health/hybrid/mana potions are not used when we are at full health/mana.\nThis will also ensure that we do not use up reserved uses.");

            base.CreateConfigurationMenu(extensionParameter, ref Parameters);

            FlaskIndex = ImGuiExtension.IntSlider("Flask Index", FlaskIndex, 1, 5);
            Parameters[flaskIndexString] = FlaskIndex.ToString();
            ReservedUses = ImGuiExtension.IntSlider("Reserved Uses", ReservedUses, 0, 5);
            Parameters[flaskIndexString] = ReservedUses.ToString();
            return(true);
        }
Example #15
0
        private void DrawIgnoredCellsSettings()
        {
            ImGuiNative.igGetContentRegionAvail(out var newcontentRegionArea);
            ImGui.BeginChild("##IgnoredCellsMain", new System.Numerics.Vector2(newcontentRegionArea.X, 183), true,
                             WindowFlags.NoScrollWithMouse);
            ImGui.Text("Ignored Inventory Slots");
            ImGuiExtension.ToolTip(
                $"Checked = Item will be ignored{Environment.NewLine}UnChecked = Item will be processed");
            ImGui.Text("    ");
            ImGui.SameLine();
            ImGuiNative.igGetContentRegionAvail(out newcontentRegionArea);
            ImGui.BeginChild("##IgnoredCellsCels",
                             new System.Numerics.Vector2(newcontentRegionArea.X, newcontentRegionArea.Y), true,
                             WindowFlags.NoScrollWithMouse);
            try
            {
                if (ImGui.Button("Copy Inventory"))
                {
                    SaveIgnoredSLotsFromInventoryTemplate();
                }
            }
            catch (Exception e)
            {
                LogError(e, 10);
            }

            var _numb = 1;

            for (var i = 0; i < 5; i++)
            {
                for (var j = 0; j < 12; j++)
                {
                    var toggled = Convert.ToBoolean(Settings.IgnoredCells[i, j]);
                    if (ImGui.Checkbox($"##{_numb}IgnoredCells", ref toggled))
                    {
                        Settings.IgnoredCells[i, j] ^= 1;
                    }

                    if ((_numb - 1) % 12 < 11)
                    {
                        ImGui.SameLine();
                    }

                    _numb += 1;
                }
            }

            ImGui.EndChild();
            ImGui.EndChild();
        }
Example #16
0
        public override bool CreateConfigurationMenu(ExtensionParameter extensionParameter, ref Dictionary <String, Object> Parameters)
        {
            ImGui.TextDisabled("Condition Info");
            ImGuiExtension.ToolTip("This condition will return true if the player has any of the selected ailments or a minimum of the specified corrupted blood stacks.");

            base.CreateConfigurationMenu(extensionParameter, ref Parameters);
            var buffList       = GetEnumList <BuffEnums>().ToList();
            var buffListSearch = buffList.Where(x => x.Contains(SearchString)).ToList();

            HasBuffReady = ImGuiExtension.ComboBox("Buff List", HasBuffReady, buffListSearch);
            Parameters[SearchingBuff] = HasBuffReady.ToString();

            SearchString = ImGuiExtension.InputText("Filter Buffs", SearchString, 32, InputTextFlags.AllowTabInput);
            Parameters[SearchStringString] = SearchString.ToString();
            return(true);
        }
Example #17
0
        public override bool CreateConfigurationMenu(ExtensionParameter extensionParameter, ref Dictionary <String, Object> Parameters)
        {
            ImGui.TextDisabled("Action Info");
            ImGuiExtension.ToolTip("This timer is used to begin or end a specific timer");
            TimerName = ImGuiExtension.InputText("Timer Name", TimerName, 30, InputTextFlags.Default);
            ImGuiExtension.ToolTip("Name for this timer");
            Parameters[TimerNameString] = TimerName.ToString();

            var selectedOption = ForceStop ? 1 : 0;

            ImGui.RadioButton("Start Timer", ref selectedOption, 0);
            ImGui.RadioButton("End Timer", ref selectedOption, 1);
            ForceStop = selectedOption == 1;
            Parameters[ForceStopString] = ForceStop.ToString();

            return(true);
        }
Example #18
0
        public override bool CreateConfigurationMenu(ExtensionParameter extensionParameter, ref Dictionary <String, Object> Parameters)
        {
            ImGui.TextDisabled("Condition Info");
            ImGuiExtension.ToolTip("This condition will return true if the player has any of the selected ailments or a minimum of the specified corrupted blood stacks.");

            base.CreateConfigurationMenu(extensionParameter, ref Parameters);
            var kappa = GetEnumList <BuffEnums>().ToList();
            var test  = kappa.Where(x => x.Contains(SearchString)).ToList();

            HasBuffReady = ImGuiExtension.ComboBox("Buff List", HasBuffReady, test);
            Parameters[SearchingBuff] = HasBuffReady.ToString();

            SearchString = ImGuiExtension.InputText("Filter Buffs", SearchString, 32, InputTextFlags.AllowTabInput);
            Parameters[SearchStringString] = SearchString.ToString();
            //HasBuff = ExtensionComponent.InitialiseParameterBoolean(HasBuffString, HasBuff, ref Parameters);
            //  CorruptCount = ImGuiExtension.IntSlider("Corruption Count", CorruptCount, 0, 20);
            //  Parameters[CorruptCountString] = CorruptCount.ToString();
            return(true);
        }
        public override bool CreateConfigurationMenu(ExtensionParameter extensionParameter, ref Dictionary <String, Object> Parameters)
        {
            ImGui.TextDisabled("Condition Info");
            ImGuiExtension.ToolTip("This condition will return true if any of the selected player's resistances\nare reduced by more than or equal to the specified amount.\nReduced max resistance modifiers are taken into effect automatically (e.g. -res map mods).");


            base.CreateConfigurationMenu(extensionParameter, ref Parameters);

            MinimumMonsterCount = ImGuiExtension.IntSlider("Minimum Monster Count", MinimumMonsterCount, 1, 50);
            Parameters[MinimumMonsterCountString] = MinimumMonsterCount.ToString();

            MaxDistance = ImGuiExtension.FloatSlider("Maximum Distance", MaxDistance, 1.0f, 5000.0f);
            Parameters[MaxDistanceString] = MaxDistance.ToString();

            PreviewDistance = ImGuiExtension.Checkbox("Preview distance", PreviewDistance);

            if (PreviewDistance)
            {
                extensionParameter.Plugin.PlayerHelper.DrawSquareToWorld(extensionParameter.Plugin.GameController.Player.Pos, MaxDistance);
            }

            ImGui.Spacing();
            ImGui.Separator();
            ImGui.Spacing();

            ColdResistanceThreshold = ImGuiExtension.IntSlider("Cold Resist Above", ColdResistanceThreshold, 0, 75);
            Parameters[ColdResistanceThresholdString] = ColdResistanceThreshold.ToString();

            FireResistanceThreshold = ImGuiExtension.IntSlider("Fire Resist Above", FireResistanceThreshold, 0, 75);
            Parameters[FireResistanceThresholdString] = FireResistanceThreshold.ToString();

            LightningResistanceThreshold = ImGuiExtension.IntSlider("Lightning Resist Above", LightningResistanceThreshold, 0, 75);
            Parameters[LightningResistanceThresholdString] = LightningResistanceThreshold.ToString();

            ChaosResistanceThreshold = ImGuiExtension.IntSlider("Chaos Resist Above", ChaosResistanceThreshold, 0, 75);
            Parameters[ChaosResistanceThresholdString] = ChaosResistanceThreshold.ToString();

            ImGui.Spacing();
            ImGui.Separator();
            ImGui.Spacing();

            CountWhiteMonsters = ImGuiExtension.Checkbox("White Monsters", CountWhiteMonsters);
            Parameters[CountWhiteMonstersString] = CountWhiteMonsters.ToString();

            WhiteMonstersCount = ImGuiExtension.IntSlider("White Monster Count", WhiteMonstersCount, 1, 50);
            Parameters[WhiteMonstersString] = WhiteMonstersCount.ToString();

            CountRareMonsters = ImGuiExtension.Checkbox("Rare Monsters", CountRareMonsters);
            Parameters[CountRareMonstersString] = CountRareMonsters.ToString();

            RareMonstersCount = ImGuiExtension.IntSlider("Rare Monster Count", RareMonstersCount, 1, 50);
            Parameters[RareMonstersString] = RareMonstersCount.ToString();

            CountMagicMonsters = ImGuiExtension.Checkbox("Magic Monsters", CountMagicMonsters);
            Parameters[CountMagicMonstersString] = CountMagicMonsters.ToString();

            MagicMonstersCount = ImGuiExtension.IntSlider("Magic Monster Count", MagicMonstersCount, 1, 50);
            Parameters[MagicMonstersString] = MagicMonstersCount.ToString();

            CountUniqueMonsters = ImGuiExtension.Checkbox("Unique Monsters", CountUniqueMonsters);
            Parameters[CountUniqueMonstersString] = CountUniqueMonsters.ToString();

            UniqueMonstersCount = ImGuiExtension.IntSlider("Unique Monster Count", UniqueMonstersCount, 1, 50);
            Parameters[UniqueMonstersString] = UniqueMonstersCount.ToString();

            ImGui.Spacing();
            ImGui.Separator();
            ImGui.Spacing();

            MonsterHealthPercentThreshold = ImGuiExtension.IntSlider("Monster Health Percent", MonsterHealthPercentThreshold, 0, 100);
            Parameters[MonsterHealthPercentThresholdString] = MonsterHealthPercentThreshold.ToString();

            MonsterAboveHealthThreshold = ImGuiExtension.Checkbox("Above Health Threshold", MonsterAboveHealthThreshold);
            Parameters[MonsterAboveHealthThresholdString] = MonsterAboveHealthThreshold.ToString();

            return(true);
        }
        public void Render()
        {
            if (ImGui.SmallButton("Reload"))
            {
                // Validate current tree
                var root = Plugin.Settings.LoadedProfile.Composite;
                if (root == null)
                {
                    // Warn the user that there is no profile to reload
                    StartNewOKMenu("No profile to reload.");
                }
                else
                {
                    if (!ValidateTree(Plugin.Settings.LoadedProfile.Composite, out string error))
                    {
                        StartNewOKMenu(error);
                    }
                    else
                    {
                        // Everything seems good. Load the tree
                        Plugin.CreateAndStartTreeFromLoadedProfile();
                    }
                }
            }
            ImGuiExtension.ToolTip("The tree MUST be reloaded in order for changes to take effect.");

            ImGui.SameLine();
            ImGui.Spacing();
            ImGui.SameLine();

            if (ImGui.SmallButton("Save"))
            {
                ImGui.OpenPopup("Save Profile");
            }

            RenderSaveProfileMenu();

            ImGui.SameLine();
            ImGui.Spacing();
            ImGui.SameLine();

            if (ImGui.SmallButton("Load"))
            {
                ImGui.OpenPopup("Load Profile");
            }

            RenderLoadProfileMenu();

            ImGui.SameLine();
            ImGui.Spacing();
            ImGui.SameLine();

            if (ImGui.SmallButton("Clear") || Plugin.Settings.LoadedProfile == null)
            {
                Plugin.Settings.LoadedProfile = new Profile.LoadedProfile();
            }
            ImGuiExtension.ToolTip("Clear the tree to start over.");

            RenderOkMenu();

            ImGui.Spacing();
            ImGui.Separator();
            ImGui.Text("Loaded Tree");
            ImGui.Spacing();

            if (Plugin.Settings.LoadedProfile.Composite == null)
            {
                if (ImGui.Button("+"))
                {
                    ImGui.OpenPopup(TriggerMenuLabel);
                    NewTriggerMenu = new TriggerMenu(Plugin.ExtensionParameter, null);
                }
                ImGuiExtension.ToolTip("Add root");


                // If start profile is clicked, trigger menu is rendered
                RenderTriggerMenu();
            }
            else
            {
                var menuAction = CreateTreeForComposite(null, Plugin.Settings.LoadedProfile.Composite, 0);
                if (menuAction == ProfileMenuAction.Remove)
                {
                    // Was asked to remove the root node.
                    Plugin.Settings.LoadedProfile.Composite = null;
                }
            }
        }
        private ProfileMenuAction CreateTreeForComposite(TriggerComposite parent, TriggerComposite composite, int depth)
        {
            String typeTag = "";

            if (composite.Type == TriggerType.Action)
            {
                typeTag = "[A]";
            }
            else if (composite.Type == TriggerType.Decorator)
            {
                typeTag = "[D]";
            }
            else if (composite.Type == TriggerType.PrioritySelector)
            {
                typeTag = "[P]";
            }
            else if (composite.Type == TriggerType.Sequence)
            {
                typeTag = "[S]";
            }

            string label = depth + ":" + typeTag + composite.Name;

            ImGui.PushID("Composite" + depth + label);
            try
            {
                Vector4 chosenColor = GreenColor;
                if (!ValidateTree(composite, out string error))
                {
                    chosenColor = RedColor;
                }

                if (composite.Type == TriggerType.Action)
                {
                    // Push an ID so everything below remains unique
                    ImGuiNative.igIndent();

                    var profileAction = CreateTriggerTextWithPopupMenu(label, chosenColor, parent);
                    if (profileAction == ProfileMenuAction.Edit)
                    {
                        ImGui.OpenPopup(TriggerMenuLabel);
                        NewTriggerMenu = new TriggerMenu(Plugin.ExtensionParameter, parent, composite);
                    }
                    else if (profileAction != ProfileMenuAction.None)
                    {
                        // Pass it up, maybe someone above knows how to deal with it
                        return(profileAction);
                    }

                    RenderTriggerMenu();
                    ImGuiNative.igUnindent();
                }
                else if (ImGui.TreeNodeEx("", TreeNodeFlags.OpenOnArrow | TreeNodeFlags.DefaultOpen))
                {
                    ImGui.SameLine();

                    var profileAction = CreateTriggerTextWithPopupMenu(label, chosenColor, parent);
                    if (profileAction == ProfileMenuAction.Edit)
                    {
                        ImGui.OpenPopup(TriggerMenuLabel);
                        NewTriggerMenu = new TriggerMenu(Plugin.ExtensionParameter, parent, composite);
                    }
                    else if (profileAction != ProfileMenuAction.None)
                    {
                        // Pass it up, maybe someone above knows how to deal with it
                        return(profileAction);
                    }

                    // Decorators can only have one child
                    if (composite.Type != TriggerType.Decorator || (composite.Children == null || composite.Children.Count == 0))
                    {
                        if (ImGui.Button("+"))
                        {
                            ImGui.OpenPopup(TriggerMenuLabel);
                            NewTriggerMenu = new TriggerMenu(Plugin.ExtensionParameter, composite);
                        }
                        ImGuiExtension.ToolTip("Add Child");
                    }

                    if (composite.Children != null && composite.Children.Any())
                    {
                        List <TriggerComposite> childrenToRemove   = new List <TriggerComposite>();
                        List <TriggerComposite> childrenToMoveUp   = new List <TriggerComposite>();
                        List <TriggerComposite> childrenToMoveDown = new List <TriggerComposite>();
                        foreach (var child in composite.Children)
                        {
                            var childAction = CreateTreeForComposite(composite, child, depth + 1);
                            if (childAction == ProfileMenuAction.Remove)
                            {
                                childrenToRemove.Add(child);
                            }
                            else if (childAction == ProfileMenuAction.MoveUp)
                            {
                                childrenToMoveUp.Add(child);
                            }
                            else if (childAction == ProfileMenuAction.MoveDown)
                            {
                                childrenToMoveDown.Add(child);
                            }
                        }
                        // Remove all children who were requested deletion
                        childrenToRemove.ForEach(x => composite.Children.Remove(x));
                        childrenToMoveUp.ForEach(x =>
                        {
                            var index = composite.Children.IndexOf(x);
                            composite.Children.Remove(x);
                            composite.Children.Insert(Math.Max(0, index - 1), x);
                        });
                        childrenToMoveDown.ForEach(x =>
                        {
                            var index = composite.Children.IndexOf(x);
                            composite.Children.Remove(x);
                            composite.Children.Insert(index + 1, x);
                        });
                    }

                    RenderTriggerMenu();

                    ImGui.TreePop();
                }
                else
                {
                    // Tree is closed, but we still want to display the text.
                    ImGui.SameLine();
                    var profileAction = CreateTriggerTextWithPopupMenu(label, chosenColor, parent);
                    if (profileAction == ProfileMenuAction.Edit)
                    {
                        ImGui.OpenPopup(TriggerMenuLabel);
                        NewTriggerMenu = new TriggerMenu(Plugin.ExtensionParameter, parent, composite);
                    }
                    else if (profileAction != ProfileMenuAction.None)
                    {
                        // Pass it up, maybe someone above knows how to deal with it
                        return(profileAction);
                    }

                    RenderTriggerMenu();
                }
            }
            finally
            {
                // Just to make sure we pop the ID, no matter if we return early
                ImGui.PopID();
            }

            return(ProfileMenuAction.None);
        }
Example #22
0
        public override bool CreateConfigurationMenu(ExtensionParameter extensionParameter, ref Dictionary <String, Object> Parameters)
        {
            ImGui.TextDisabled("Action Info");
            ImGuiExtension.ToolTip("This action is used to use a specific type(s) of flask.\nFlask Hotkey will be pulled from plugin settings.\nFlask types will be pulled from the file /config/flaskinfo.json");

            useLife = ImGuiExtension.Checkbox("Life", useLife);
            Parameters[useLifeString] = useLife.ToString();

            ImGui.SameLine();
            useMana = ImGuiExtension.Checkbox("Mana", useMana);
            Parameters[useManaString] = useMana.ToString();

            ImGui.SameLine();
            useHybrid = ImGuiExtension.Checkbox("Hybrid", useHybrid);
            Parameters[useHybridString] = useHybrid.ToString();

            useInstant = ImGuiExtension.Checkbox("Use Instant", useInstant);
            ImGuiExtension.ToolTip("This only makes sense to use with life/mana/hybrid flasks");

            Parameters[useInstantString] = useInstant.ToString();

            ImGui.Spacing();
            ImGui.Separator();
            ImGui.Spacing();

            useDefense = ImGuiExtension.Checkbox("Defense", useDefense);
            Parameters[useDefenseString] = useDefense.ToString();


            ImGui.SameLine();
            useOffense = ImGuiExtension.Checkbox("Offense", useOffense);
            Parameters[useOffenseString] = useOffense.ToString();

            useUtility = ImGuiExtension.Checkbox("Utility", useUtility);
            Parameters[useUtilityString] = useUtility.ToString();

            ImGui.SameLine();
            useSpeedrun = ImGuiExtension.Checkbox("Speedrun", useSpeedrun);
            Parameters[useSpeedrunString] = useSpeedrun.ToString();

            useUnique = ImGuiExtension.Checkbox("Unique", useUnique);
            Parameters[useUniqueString] = useUnique.ToString();

            useOffenseAndSpeedrun = ImGuiExtension.Checkbox("Offense and Speedrun", useOffenseAndSpeedrun);
            Parameters[useOffenseAndSpeedrunString] = useOffenseAndSpeedrun.ToString();

            ImGui.Spacing();
            ImGui.Separator();
            ImGui.Spacing();

            usePoison = ImGuiExtension.Checkbox("Poison", usePoison);
            Parameters[usePoisonString] = usePoison.ToString();

            ImGui.SameLine();
            useFreeze = ImGuiExtension.Checkbox("Freeze", useFreeze);
            Parameters[useFreezeString] = useFreeze.ToString();

            useIgnite = ImGuiExtension.Checkbox("Ignite", useIgnite);
            Parameters[useIgniteString] = useIgnite.ToString();

            ImGui.SameLine();
            useShock = ImGuiExtension.Checkbox("Shock", useShock);
            Parameters[useShockString] = useShock.ToString();

            useBleed = ImGuiExtension.Checkbox("Bleed", useBleed);
            Parameters[useBleedString] = useBleed.ToString();

            ImGui.SameLine();
            useCurse = ImGuiExtension.Checkbox("Curse", useCurse);
            Parameters[useCurseString] = useCurse.ToString();

            ImGui.Spacing();
            ImGui.Separator();
            ImGui.Spacing();

            reserveFlaskCharges = ImGuiExtension.IntSlider("Reserved Charges", reserveFlaskCharges, 0, 5);
            Parameters[reserveFlaskChargesString] = reserveFlaskCharges.ToString();

            return(true);
        }
        public bool Render()
        {
            TriggerComposite.Name = ImGuiExtension.InputText("Trigger Name", TriggerComposite.Name, 50, InputTextFlags.AlwaysInsertMode);

            bool shouldPerformClear = false;
            int  radioTarget        = (int)TriggerComposite.Type;

            shouldPerformClear |= ImGui.RadioButton("PrioritySelector", ref radioTarget, (int)TriggerType.PrioritySelector);
            ImGuiExtension.ToolTip("A PrioritySelector runs a list of composites in order from first to last until one of the composites returns true.");

            ImGui.SameLine();
            shouldPerformClear |= ImGui.RadioButton("Sequence", ref radioTarget, (int)TriggerType.Sequence);
            ImGuiExtension.ToolTip("A Sequence runs a list of composites in order from first to last until one of the composites returns false.");

            shouldPerformClear |= ImGui.RadioButton("Decorator", ref radioTarget, (int)TriggerType.Decorator);
            ImGuiExtension.ToolTip("A Decorator will run its child if all conditions return true.\nThink of this as an if condition.");

            ImGui.SameLine();
            var choseAction = ImGui.RadioButton("Action", ref radioTarget, (int)TriggerType.Action);

            ImGuiExtension.ToolTip("An action is a final point in a behavior tree.\nActions can return true or false.\nAll branches MUST end in an action.");

            if (choseAction && TriggerComposite.Children != null && TriggerComposite.Children.Any() || // If we chose action, make sure we don't have any children
                (TriggerType)radioTarget == TriggerType.Decorator && TriggerComposite.Children != null && TriggerComposite.Children.Count > 1)    // if we chose decorator, make sure we don't have more than 1 child
            {
                OpenOKMenu = true;
                OKMessage  = "Trigger has too many children to change to this type.\nRemove unnecessary children and try again.";

                // Reset everything so the below logic can remain the same
                shouldPerformClear = false;
                choseAction        = false;
                radioTarget        = (int)TriggerComposite.Type;
            }

            if (shouldPerformClear || choseAction)
            {
                ActiveWorkingTriggerCondition = null;
                TriggerComposite.Action       = null;
                SelectedOption1 = -1;
                SelectedOption2 = -1;
            }

            // Save off the selected type into the composite
            TriggerComposite.Type = (TriggerType)radioTarget;

            // There is no configuration unless we are an action or decorator
            if (TriggerComposite.Type == TriggerType.Action || TriggerComposite.Type == TriggerType.Decorator)
            {
                if (ImGui.TreeNodeEx("Configuration", TreeNodeFlags.Leaf))
                {
                    if (TriggerComposite.Type == TriggerType.Action)
                    {
                        // TODO: HashSet is not guaranteed ordered. This should be fixed later
                        var filterList = ExtensionParameter.Plugin.ExtensionCache.ActionFilterList.ToList();
                        FilterOption = ImGuiExtension.ComboBox("Filter Type", FilterOption, filterList);

                        var actionList = ExtensionParameter.Plugin.ExtensionCache.ActionList;
                        if (filterList[FilterOption] != ExtensionComponentFilterType.None)
                        {
                            actionList = actionList.Where(x => x.GetFilterTypes().Contains(filterList[FilterOption])).ToList();
                        }

                        int previouslySelectedAction = SelectedOption1;
                        SelectedOption1 = ImGuiExtension.ComboBox("Action List", SelectedOption1, actionList.Select(x => x.Owner + ": " + x.Name).ToList());
                        if (SelectedOption1 >= 0)
                        {
                            // If we do not have an extension action cached OR we swapped actions... initialize values
                            if (ActiveWorkingExtensionAction == null || previouslySelectedAction != SelectedOption1)
                            {
                                var action = actionList[SelectedOption1];
                                if (TriggerComposite.Action == null)
                                {
                                    TriggerComposite.Action = new TriggerAction(action.Owner, action.Name);
                                }

                                ActiveWorkingExtensionAction = action.GetAction();
                            }

                            // Render the menu and ensure the parameters get saved to the action
                            ActiveWorkingExtensionAction.CreateConfigurationMenu(ExtensionParameter, ref TriggerComposite.Action.Parameters);
                        }
                    }
                    else if (TriggerComposite.Type == TriggerType.Decorator)
                    {
                        SelectedOption1 = ImGuiExtension.ComboBox("Conditions", SelectedOption1, TriggerComposite.ConditionList.Select(x => x.Owner + ": " + x.Name).ToList());
                        if (ImGui.Button("Add"))
                        {
                            //if (ActiveWorkingTriggerCondition == null)
                            //{
                            ActiveWorkingTriggerCondition = new TriggerCondition();
                            //}

                            ImGui.OpenPopup("Add condition");
                        }

                        var selectedCondition = TriggerComposite.ConditionList.ElementAtOrDefault(SelectedOption1);
                        if (selectedCondition != null)
                        {
                            ImGui.SameLine();

                            if (ImGui.Button("Edit"))
                            {
                                //if (ActiveWorkingTriggerCondition == null)
                                //{
                                ActiveWorkingTriggerCondition = new TriggerCondition(selectedCondition);
                                EditedTriggerCondition        = selectedCondition;
                                //}

                                ImGui.OpenPopup("Add condition");
                            }

                            ImGui.SameLine();

                            if (ImGui.Button("Remove"))
                            {
                                TriggerComposite.ConditionList.Remove(TriggerComposite.ConditionList[SelectedOption1]);
                            }
                        }

                        RenderAddConditionMenu();
                    }
                    ImGui.TreePop();
                }
            }

            if (ImGui.Button("Save Trigger"))
            {
                // Validation
                if (TriggerComposite.Name == null || TriggerComposite.Name.Length == 0)
                {
                    OpenOKMenu = true;
                    OKMessage  = "Must give a trigger name.";
                }
                else
                {
                    if (EditedTrigger != null)
                    {
                        // We are editing. Copy everything from the new trigger to the old instance
                        EditedTrigger.Name          = TriggerComposite.Name;
                        EditedTrigger.Type          = TriggerComposite.Type;
                        EditedTrigger.Children      = TriggerComposite.Children;
                        EditedTrigger.ConditionList = TriggerComposite.ConditionList;
                        EditedTrigger.Action        = TriggerComposite.Action;
                        // Finally, clear out our TriggerCompsite. Otherwise, the caller will think we are adding a new trigger
                        TriggerComposite = null;
                    }
                    return(false);
                }
            }


            ImGui.SameLine();

            if (ImGui.Button("Cancel trigger"))
            {
                TriggerComposite = null;
                return(false);
            }

            if (OpenOKMenu)
            {
                ImGui.OpenPopup("OK Menu");
                OpenOKMenu = false;
            }
            if (ImGui.BeginPopupModal("OK Menu", WindowFlags.AlwaysAutoResize))
            {
                ImGui.TextDisabled(OKMessage);
                if (ImGui.SmallButton("OK"))
                {
                    ImGui.CloseCurrentPopup();
                }
                ImGui.EndPopup();
            }

            return(true);
        }
Example #24
0
        public void DrawProfilesTable(Profile profile)
        {
            var buffsToRemove = new List <int>();

            ImGui.Separator();
            ImGui.Columns(8, $"EditColums{profile.Name}", true);
            ImGui.Text("Toggles");
            ImGuiExtension.ToolTip("Remove / Status / Show Inactive / Draw an Image", true);
            ImGui.NextColumn();
            ImGui.Text("Colors");
            ImGuiExtension.ToolTip("Text / Text Background", true);
            ImGui.NextColumn();
            ImGui.Text("Buff Name");
            ImGui.NextColumn();
            ImGui.Text("File Name");
            ImGui.NextColumn();
            ImGui.Text("Type");
            ImGui.NextColumn();
            ImGui.Text("Size");
            ImGui.NextColumn();
            ImGui.Text("X");
            ImGui.NextColumn();
            ImGui.Text("Y");
            ImGui.NextColumn();
            if (profile.BuffSettings.BuffList.Count != 0)
            {
                ImGui.Separator();
            }

            var typeSelector = new List <string>
            {
                "Duration",
                "Charge",
                "Count",
                "Duration + Charges",
                "Duration + Count",
                "Image Only"
            };

            for (var i = 0; i < profile.BuffSettings.BuffList.Count; i++)
            {
                // Remove / Status / Show Inactive
                if (ImGui.Button($"X##Delete{profile.Name}{i}"))
                {
                    buffsToRemove.Add(i);
                }
                ImGuiExtension.ToolTip("Remove This Buff", false, true);
                ImGui.SameLine();
                profile.BuffSettings.BuffList[i].Settings.Enabled = PoeHUD.Hud.UI.ImGuiExtension.Checkbox($"##Status{profile.Name}{i}", profile.BuffSettings.BuffList[i].Settings.Enabled);
                ImGuiExtension.ToolTip("Enable This Buff", false, true);
                ImGui.SameLine();
                profile.BuffSettings.BuffList[i].Settings.ShowInactive = PoeHUD.Hud.UI.ImGuiExtension.Checkbox($"##ShowInactive{profile.Name}{i}", profile.BuffSettings.BuffList[i].Settings.ShowInactive);
                ImGuiExtension.ToolTip("Show a dimmed verison if the buff is inactive", false, true);
                ImGui.SameLine();
                profile.BuffSettings.BuffList[i].Settings.ShowImage = PoeHUD.Hud.UI.ImGuiExtension.Checkbox($"##ShowImage{profile.Name}{i}", profile.BuffSettings.BuffList[i].Settings.ShowImage);
                ImGuiExtension.ToolTip("Draw an Image", false, true);
                ImGui.NextColumn();
                // Colors - Text / Text Background
                profile.BuffSettings.BuffList[i].Settings.Colors.Text = PoeHUD.Hud.UI.ImGuiExtension.ColorPicker($"##TextColor{profile.Name}{i}", profile.BuffSettings.BuffList[i].Settings.Colors.Text);
                ImGuiExtension.ToolTip("Text Color", false, true);
                ImGui.SameLine();
                profile.BuffSettings.BuffList[i].Settings.Colors.TextBackground = PoeHUD.Hud.UI.ImGuiExtension.ColorPicker($"##TextBackgroundColor{profile.Name}{i}", profile.BuffSettings.BuffList[i].Settings.Colors.TextBackground);
                ImGuiExtension.ToolTip("Text Background Color", false, true);
                ImGui.NextColumn();
                // Buff Name
                ImGui.PushItemWidth(ImGui.GetContentRegionAvailableWidth());
                profile.BuffSettings.BuffList[i].Settings.BuffName = PoeHUD.Hud.UI.ImGuiExtension.InputText($"##BuffName{profile.Name}{i}", profile.BuffSettings.BuffList[i].Settings.BuffName, 1000, InputTextFlags.EnterReturnsTrue);
                ImGui.PopItemWidth();
                ImGui.NextColumn();
                // Image File
                ImGui.PushItemWidth(ImGui.GetContentRegionAvailableWidth());
                profile.BuffSettings.BuffList[i].Settings.Image = PoeHUD.Hud.UI.ImGuiExtension.InputText($"##Image{profile.Name}{i}", profile.BuffSettings.BuffList[i].Settings.Image, 1000, InputTextFlags.EnterReturnsTrue);
                ImGui.PopItemWidth();
                ImGui.NextColumn();
                // Buff Type
                ImGui.PushItemWidth(ImGui.GetContentRegionAvailableWidth());
                profile.BuffSettings.BuffList[i].Settings.Type = (Buff.BuffType)ImGuiExtension.ComboBox($"##Type{profile.Name}{i}", (int)profile.BuffSettings.BuffList[i].Settings.Type, typeSelector);
                ImGui.PopItemWidth();
                ImGui.NextColumn();
                // Buff Size
                ImGui.PushItemWidth(ImGui.GetContentRegionAvailableWidth());
                profile.BuffSettings.BuffList[i].Settings.Size = ImGuiExtension.IntDrag($"##Size{profile.Name}{i}", profile.BuffSettings.BuffList[i].Settings.Size, 1, 300);
                ImGui.PopItemWidth();
                ImGui.NextColumn();
                // X Axis
                ImGui.PushItemWidth(ImGui.GetContentRegionAvailableWidth());
                profile.BuffSettings.BuffList[i].Settings.Location.X = ImGuiExtension.IntDrag($"##X{profile.Name}{i}", profile.BuffSettings.BuffList[i].Settings.Location.X, 0, (int)GameController.Window.GetWindowRectangle().Width);
                ImGui.PopItemWidth();
                ImGui.NextColumn();
                // Y Axis
                ImGui.PushItemWidth(ImGui.GetContentRegionAvailableWidth());
                profile.BuffSettings.BuffList[i].Settings.Location.Y = ImGuiExtension.IntDrag($"##Y{profile.Name}{i}", profile.BuffSettings.BuffList[i].Settings.Location.Y, 0, (int)GameController.Window.GetWindowRectangle().Height);
                ImGui.PopItemWidth();
                ImGui.NextColumn();
            }

            // Remove items in deleteion queue
            foreach (var i in buffsToRemove)
            {
                profile.BuffSettings.BuffList.Remove(profile.BuffSettings.BuffList[i]);
            }

            ImGui.Separator();
            ImGui.Columns(1, "", false);

            // Make add new button
            if (ImGui.Button($"+##Add{profile.Name}"))
            {
                var newItem = new Buff.Base
                {
                    Settings = new Buff.Settings
                    {
                        Location = new Buff.Location {
                            X = 200, Y = 200
                        },
                        Size         = 64,
                        ShowInactive = false,
                        Image        = "Image",
                        BuffName     = "BuffName",
                        Type         = Buff.BuffType.Duration,
                        Enabled      = false,
                        Colors       = new Colors {
                            Text = Color.White, TextBackground = new Color(0, 0, 0, 220)
                        }
                    },
                    DisposableData = new Buff.DisposableData()
                };
                profile.BuffSettings.BuffList.Add(newItem);
            }
            ImGui.SameLine();
            if (ImGui.Button($"Save##{profile.Name}"))
            {
                SaveBuffSettings(profile);
            }
            ImGui.SameLine();
            if (ImGui.Button($"Reload##{profile.Name}"))
            {
                profile.BuffSettings = LoadBuffSettings(profile);
            }
            ImGui.Separator();
        }
Example #25
0
        public void LevelSkillGemsMenu()
        {
            Settings.LevelSkillGems.Value = ImGuiExtension.Checkbox("Active Skill Gem Leveling Functions", Settings.LevelSkillGems.Value);
            ImGui.Spacing();
            Settings.LevelSkillGemsHotkey = ImGuiExtension.HotkeySelector("Level Up Skill Gems: " + Settings.LevelSkillGemsHotkey.Value.ToString(), Settings.LevelSkillGemsHotkey);
            ImGui.Separator();
            Settings.LevlSkillGemIsLeftClick.Value = ImGuiExtension.Checkbox("Left click to level Gems Up, Unticked if Right Click", Settings.LevlSkillGemIsLeftClick);
            ImGui.Separator();
            ImGui.Spacing();

            bool WeExistInRuleSet = false;
            var  PlayerName       = GameController.Player.GetComponent <Player>().PlayerName;

            if (Settings.SkillGemStopList == null)
            {
                Settings.SkillGemStopList.Add(new Person()
                {
                    Character = PlayerName,
                    Rules     = new List <GemLevelRule>()
                });
            }
            if (Settings.SkillGemStopList.Any(t => t.Character == PlayerName))
            {
                WeExistInRuleSet = true;
            }

            if (!WeExistInRuleSet)
            {
                Settings.SkillGemStopList.Add(new Person
                {
                    Character = PlayerName,
                    Rules     = new List <GemLevelRule>()
                });
            }

            //not sure about "ref" usage
            bool refBool = true;

            if (ImGui.CollapsingHeader($"Gem Leveling Rules For - {PlayerName}", ref refBool))
            {
                ImGui.Text("How Does It Work");
                ImGuiExtension.ToolTip("All gems are leveled up UNLESS the rules below catch the gem\n"
                                       + "Example, you dont want CWDT to be leveled past 3\n"
                                       + "Add \"Cast When Damage Taken Support\" with max level of 3\n"
                                       + "When the gem is level 3 it will right click to hide that gem and it wont be leveled any further");

                var i = -1;
                for (int index = 0; index < Settings.SkillGemStopList.Count; index++)
                {
                    Person PersonCheck = Settings.SkillGemStopList[index];
                    if (PersonCheck.Character == GameController.Player.GetComponent <Player>().PlayerName)
                    {
                        i = index;
                    }
                }

                var RulesToRemove = new List <int>();

                ImGui.Separator();
                ImGui.Columns(3, "Columns", true);
                ImGui.SetColumnWidth(0, 30f);
                ImGui.Text("");
                ImGui.NextColumn();
                ImGui.Text("Full Gem Name");
                ImGui.NextColumn();
                ImGui.Text("Maximum Level");
                ImGui.NextColumn();
                if (Settings.SkillGemStopList[i].Rules.Count != 0)
                {
                    ImGui.Separator();
                }
                for (int j = 0; j < Settings.SkillGemStopList[i].Rules.Count; j++)
                {
                    if (ImGui.Button($"X##REMOVERULE{i}{j}"))
                    {
                        RulesToRemove.Add(j);
                    }

                    ImGui.NextColumn();
                    ImGui.PushItemWidth(ImGui.GetContentRegionAvail().X);
                    Settings.SkillGemStopList[i].Rules[j].GemName =
                        ImGuiExtension.InputText($"##GN{i}{j}", Settings.SkillGemStopList[i].Rules[j].GemName, 35,
                                                 ImGuiInputTextFlags.None);
                    ImGui.PopItemWidth();
                    ImGui.SameLine();
                    ImGui.NextColumn();
                    ImGui.PushItemWidth(ImGui.GetContentRegionAvail().X);
                    Settings.SkillGemStopList[i].Rules[j].MaxLevel.Value =
                        ImGuiExtension.IntSlider($"##ML{i}{j}", Settings.SkillGemStopList[i].Rules[j].MaxLevel, 1, 20);
                    ImGui.NextColumn();
                    ImGui.PopItemWidth();
                }

                foreach (int i1 in RulesToRemove)
                {
                    Settings.SkillGemStopList[i].Rules.Remove(Settings.SkillGemStopList[i].Rules[i1]);
                }

                ImGui.Separator();
                ImGui.Columns(1, "", false);
                if (ImGui.Button($"Add New##AN{i}"))
                {
                    Settings.SkillGemStopList[i]
                    .Rules.Add(new GemLevelRule
                    {
                        GemName  = "Cast when Damage Taken Support",
                        MaxLevel = new RangeNode <int>(1, 1, 20)
                    });
                }
            }
        }