private void RenderSaveProfileMenu() { if (ImGui.BeginPopupModal("Save Profile", WindowFlags.AlwaysAutoResize)) { currentFileName = ImGuiExtension.InputText("File Name", currentFileName, 100, InputTextFlags.AlwaysInsertMode); if (currentFileName != null && currentFileName.Length > 0) { if (ImGui.Button("Save")) { BaseTreeRoutinePlugin <BuildYourOwnRoutineSettings, BaseTreeCache> .SaveSettingFile <Profile.LoadedProfile>(Plugin.ProfileDirectory + currentFileName, Plugin.Settings.LoadedProfile); currentFileName = ""; ImGui.CloseCurrentPopup(); } ImGui.SameLine(); } if (ImGui.Button("Cancel")) { currentFileName = ""; ImGui.CloseCurrentPopup(); } ImGui.EndPopup(); } }
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); }
private void RenderSaveProfileMenu() { if (ImGui.BeginPopupModal($"Save Profile", WindowFlags.AlwaysAutoResize)) { currentFileName = ImGuiExtension.InputText("File Name", currentFileName, 100, InputTextFlags.AlwaysInsertMode); if (!String.IsNullOrEmpty(currentFileName)) { if (ImGui.Button("Save")) { LoadedProfile profileToSave = LoadSaveTrigger != null ? new LoadedProfile() { Composite = LoadSaveTrigger } : Plugin.Settings.LoadedProfile; BaseTreeRoutinePlugin <BuildYourOwnRoutineSettings, BaseTreeCache> .SaveSettingFile <Profile.LoadedProfile>(Plugin.ProfileDirectory + currentFileName, profileToSave); currentFileName = ""; forceOpenSave = false; ImGui.CloseCurrentPopup(); } ImGui.SameLine(); } if (ImGui.Button("Cancel")) { currentFileName = ""; forceOpenSave = false; ImGui.CloseCurrentPopup(); } ImGui.EndPopup(); } }
public override bool CreateConfigurationMenu(ExtensionParameter extensionParameter, ref Dictionary <String, Object> Parameters) { ImGui.TextDisabled("Condition Info"); ImGuiExtension.ToolTipWithText("(?)", "This condition is used to determine if we can use a specific skill.\nSkill name can be obtained through DevTree by looking through the player's actor component, then actor skills list."); base.CreateConfigurationMenu(extensionParameter, ref Parameters); SkillName = ImGuiExtension.InputText("Skill Name", SkillName, 100, ImGuiInputTextFlags.AllowTabInput); Parameters[skillNameString] = SkillName.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); 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); }
public override bool CreateConfigurationMenu(ExtensionParameter extensionParameter, ref Dictionary <String, Object> Parameters) { ImGui.TextDisabled("Action Info"); ImGuiExtension.ToolTipWithText("(?)", "This timer is used to begin or end a specific timer"); TimerName = ImGuiExtension.InputText("Timer Name", TimerName, 30, ImGuiInputTextFlags.AlwaysInsertMode); ImGuiExtension.ToolTipWithText("(?)", "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); }
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.ToolTipWithText("(?)", "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, ImGuiInputTextFlags.AllowTabInput); Parameters[SearchStringString] = SearchString.ToString(); RemainingDuration = ImGuiExtension.IntSlider("Remaining Duration", RemainingDuration, 0, 4000); ImGuiExtension.ToolTipWithText("(?)", "Includes buffs with duration longer than specified. Set to 0 to ignore duration."); Parameters[RemainingDurationString] = RemainingDuration.ToString(); MinimumCharges = ImGuiExtension.IntSlider("Minimum Charges", MinimumCharges, 0, 20); ImGuiExtension.ToolTipWithText("(?)", "Includes buffs with charges greater or equal to specified value. Set to 0 to ignore charges."); Parameters[MinimumChargesString] = MinimumCharges.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); }
internal override void DrawSettingsMenu() { #region var newSelectedTheme = ImGuiExtension.ComboBox("Select Theme", "Themes", SelectedThemeName, MainMenuWindow.Settings.Theme.Values); if (SelectedThemeName != newSelectedTheme) { SelectedThemeName = newSelectedTheme; LoadedTheme = LoadTheme(newSelectedTheme, false); ApplyTheme(LoadedTheme); } if (ImGuiExtension.Button("Save current theme settings to selected")) { var currentThemeNew = ReadThemeFromCurrent(); SaveTheme(currentThemeNew, SelectedThemeName); } ImGui.Text(""); NewThemeName = ImGuiExtension.InputText("New theme name", NewThemeName, 200, InputTextFlags.Default); if (ImGuiExtension.Button("Create new theme from current")) { if (!string.IsNullOrEmpty(NewThemeName)) { string regexSearch = new string(Path.GetInvalidFileNameChars()) + new string(Path.GetInvalidPathChars()); Regex r = new Regex(string.Format("[{0}]", Regex.Escape(regexSearch))); NewThemeName = r.Replace(NewThemeName, ""); var currentThemeNew = ReadThemeFromCurrent(); SaveTheme(currentThemeNew, NewThemeName); SelectedThemeName = NewThemeName; LoadThemeFilesList(); } } #endregion ImGui.Text(""); var style = ImGui.GetStyle(); if (ImGui.TreeNode("Theme settings")) { style.AntiAliasedFill = DrawBoolSetting("AntiAliasedFill", style.AntiAliasedFill); style.AntiAliasedLines = DrawBoolSetting("AntiAliasedLines", style.AntiAliasedLines); style.Alpha = DrawFloatSetting("Alpha", style.Alpha * 100, 0, 100) / 100f; style.DisplayWindowPadding = DrawVectorSetting("DisplayWindowPadding", style.DisplayWindowPadding, 0, 20); style.TouchExtraPadding = DrawVectorSetting("TouchExtraPadding", style.TouchExtraPadding, 0, 10); style.WindowPadding = DrawVectorSetting("WindowPadding", style.WindowPadding, 0, 20); style.FramePadding = DrawVectorSetting("FramePadding", style.FramePadding, 0, 20); style.DisplaySafeAreaPadding = DrawVectorSetting("DisplaySafeAreaPadding", style.DisplaySafeAreaPadding, 0, 20); style.ItemInnerSpacing = DrawVectorSetting("ItemInnerSpacing", style.ItemInnerSpacing, 0, 20); style.ItemSpacing = DrawVectorSetting("ItemSpacing", style.ItemSpacing, 0, 20); style.GrabMinSize = DrawFloatSetting("GrabMinSize", style.GrabMinSize, 0, 20); style.GrabRounding = DrawFloatSetting("GrabRounding", style.GrabRounding, 0, 12); style.IndentSpacing = DrawFloatSetting("IndentSpacing", style.IndentSpacing, 0, 30); style.ScrollbarRounding = DrawFloatSetting("ScrollbarRounding", style.ScrollbarRounding, 0, 19); style.ScrollbarSize = DrawFloatSetting("ScrollbarSize", style.ScrollbarSize, 0, 20); style.WindowTitleAlign = DrawVectorSetting("WindowTitleAlign", style.WindowTitleAlign, 0, 1, 0.1f); style.WindowRounding = DrawFloatSetting("WindowRounding", style.WindowRounding, 0, 14); style.ChildWindowRounding = DrawFloatSetting("ChildWindowRounding", style.ChildWindowRounding, 0, 16); style.FrameRounding = DrawFloatSetting("FrameRounding", style.FrameRounding, 0, 12); style.ColumnsMinSpacing = DrawFloatSetting("ColumnsMinSpacing", style.ColumnsMinSpacing, 0, 30); style.CurveTessellationTolerance = DrawFloatSetting("CurveTessellationTolerance", style.CurveTessellationTolerance * 100, 0, 100) / 100; } ImGui.Text(""); #region ColorsDraw ImGui.Text("Colors:"); ImGui.Columns(2, "Columns", true); var colorTypes = Enum.GetValues(typeof(ColorTarget)).Cast <ColorTarget>(); var count = colorTypes.Count() / 2; foreach (var type in colorTypes) { var nameFixed = Regex.Replace(type.ToString(), "(\\B[A-Z])", " $1"); var colorValue = style.GetColor(type); if (ImGui.ColorEdit4(nameFixed, ref colorValue, ColorEditFlags.AlphaBar | ColorEditFlags.NoInputs | ColorEditFlags.AlphaPreviewHalf)) { style.SetColor(type, colorValue); } if (count-- == -1) { ImGui.NextColumn(); } } #endregion }
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) }); } } }