void _OnGUI_Selected(Path path, iSelectable selectable, Action <iSelectable> cbk = null) { bool isPath = selectable is Path; string label = string.Format("{0}##Project_{1}_{2}", selectable.name, isPath ? "Path" : "File", path.name); bool isSelected = curSelected == selectable; ImGuiTreeNodeFlags flag = baseFlag | (isPath ? ImGuiTreeNodeFlags.None : ImGuiTreeNodeFlags.Leaf) | (isSelected ? ImGuiTreeNodeFlags.Selected : ImGuiTreeNodeFlags.None); if (ImGui.TreeNodeEx(label, flag)) { if (cbk != null) { cbk(selectable); } ImGui.TreePop(); } if (ImGui.IsItemClicked()) { if (!clicked && curSelected != selectable) { curSelected = selectable; Selector.Select(selectable); } clicked = true; } }
public static bool TreeNodeTitleColored(string label, ImGuiTreeNodeFlags flags = ImGuiTreeNodeFlags.None) { Vector4 color = GetStyleColorVec4Safe(ImGuiCol.CheckMark); string[] splitId = label.Split("##"); string[] textForLabelArray = splitId[0].Split("'"); //SplitID and Text string id = ""; if (splitId.Length > 1) { id = splitId[1]; } //Create Padding String consisting of whitespaces string paddingString = ""; for (int i = 0; i < textForLabelArray.Length; i++) { foreach (char chr in textForLabelArray[i]) { paddingString += " "; } } //Calculate Width of white space and width of padding float whitespaceCharWidth = ImGui.CalcTextSize(" ").X; float paddingWidth = whitespaceCharWidth * paddingString.Length; //Initialize TreeNode bool passThrough = ImGui.TreeNodeEx(paddingString + "##" + id, flags); for (int i = 0; i < textForLabelArray.Length; i++) { if (i % 2 == 1) { ImGui.SameLine(); ImGui.SetCursorPosX(ImGui.GetCursorPosX() - whitespaceCharWidth); ImGui.TextColored(color, textForLabelArray[i]); } else { ImGui.SameLine(); if (i == 0) { ImGui.SetCursorPosX(ImGui.GetCursorPosX() - paddingWidth - whitespaceCharWidth); } else { ImGui.SetCursorPosX(ImGui.GetCursorPosX() - whitespaceCharWidth); } ImGui.Text(textForLabelArray[i]); } } ImGui.SameLine(); ImGui.SetCursorPosX(ImGui.GetCursorPosX() - paddingWidth - (whitespaceCharWidth * 5 - 6f)); ImGui.Text(paddingString + " "); return(passThrough); }
public override void OnGuiRender() { ImGui.Begin("Scene Hierarchy"); const ImGuiTreeNodeFlags flags = ImGuiTreeNodeFlags.OpenOnArrow | ImGuiTreeNodeFlags.SpanAvailWidth; foreach (var entityId in _hierarchyFilter) { DrawEntitynode(entityId, flags); } if (ImGui.IsMouseDown(0) && ImGui.IsWindowHovered()) { _guiService.SelectedEntity = default; } if (ImGui.BeginPopupContextWindow("", ImGuiPopupFlags.MouseButtonRight | ImGuiPopupFlags.NoOpenOverItems)) { if (ImGui.MenuItem("Create Entity")) { _guiService.SelectedEntity = _scene.CreateEntity("New Entity").EntityHandle; } ImGui.EndPopup(); } ImGui.End(); }
private static void DummyTreeNode(string label, ImGuiTreeNodeFlags flags = ImGuiTreeNodeFlags.Leaf | ImGuiTreeNodeFlags.NoTreePushOnOpen) { ImGui.PushStyleColor(ImGuiCol.HeaderHovered, 0x0); ImGui.PushStyleColor(ImGuiCol.HeaderActive, 0x0); ImGui.TreeNodeEx(label, flags); ImGui.PopStyleColor(); ImGui.PopStyleColor(); }
public void FlagsInChildren(ImGuiTreeNodeFlags flags) { Flags |= flags; foreach (var child in _children.OfType <TreeNode>()) { child.FlagsInChildren(flags); } }
private void RecursivelyRender(Entity en) { ImGui.PushID(en.GetHashCode()); ImGuiTreeNodeFlags nodeFlags = ImGuiTreeNodeFlags.OpenOnArrow; if (SelectedEntity == en) { nodeFlags |= ImGuiTreeNodeFlags.Selected; } if (!en.Active) { ImGui.PushStyleColor(ImGuiCol.Text, new System.Numerics.Vector4(0.4f, 0.4f, 0.4f, 1f)); } bool nodeOpen = ImGui.TreeNodeEx(en.Name, nodeFlags); if (ImGui.IsItemClicked()) { SelectedEntity = en; } //new entity delete menu if (ImGui.BeginPopupContextItem("Entity Popup")) { if (ImGui.MenuItem("New Entity")) { _ = new Entity("New Entity", parent: en); } if (ImGui.MenuItem("Delete")) { en.Destroy(); } ImGui.EndPopup(); } if (nodeOpen) { for (int i = 0; i < en.Children.Count; i++) { RecursivelyRender(en.Children[i]); } ImGui.TreePop(); } if (!en.Active) { ImGui.PopStyleColor(); } ImGui.PopID(); }
//private int NewRuleTab = 0; //private RangeNode<int> NewRuleTabSetting = new RangeNode<int>(0, 0, 20); //private uint coroutineIteration = 0; //private Coroutine MoveToStashCoroutine; //private const string MoveToStashChecker = "MoveToStash"; public override void DrawSettings() { ImGuiTreeNodeFlags collapsingHeaderFlags = ImGuiTreeNodeFlags.CollapsingHeader; if (ImGui.TreeNodeEx("Advanced Filter Setting", collapsingHeaderFlags)) { NewRuleText = ImGuiExtension.InputText("Contain text", NewRuleText, 1024, ImGuiInputTextFlags.EnterReturnsTrue | ImGuiInputTextFlags.AutoSelectAll); Settings.NewRuleRarity.Value = ImGuiExtension.IntSlider("rarity", Settings.NewRuleRarity); Settings.NewRuleTab.Value = ImGuiExtension.IntSlider("move to tab", Settings.NewRuleTab); //ImGui.Separator(); if (ImGui.Button("Create")) { AddFilter(); } ImGui.Separator(); //foreach (FilterItem i in _filterItems) //{ // ImGui.TextColored(new Vector4(1f, 0.3f, 0.6f, 0.8f), $"\"{i.Type}\" Rarity:{i.ItemRarity} Tab:{i.Tab}"); // ImGui.SameLine(); // if (ImGui.Button($"remove {i.ItemRarity}") ) // { // LogMessage($"remove {i.Type}!", 3); // RemoveFilter(i); // break; // } //} var uniqId = 0; for (var i = 0; i < _filterItems.Count; i++) { var item = _filterItems[i]; ImGui.TextColored(new Vector4(1f, 0.3f, 0.6f, 0.8f), $"\"{item.Type}\" Rarity:{item.ItemRarity} Tab:{item.Tab}"); ImGui.SameLine(); if (ImGui.Button($"Remove##{uniqId++}")) { LogMessage($"remove {item.Type}!", 3); RemoveFilter(i); i--; } } //ImGui.TreePop(); } if (ImGui.TreeNodeEx("Plugin Options", collapsingHeaderFlags)) { base.DrawSettings(); //ImGui.TreePop(); } //ImGui.TreePop(); }
void CreateScreenObject(IScreenObject obj) { const ImGuiTreeNodeFlags baseTreeFlags = ImGuiTreeNodeFlags.OpenOnArrow | ImGuiTreeNodeFlags.OpenOnDoubleClick | ImGuiTreeNodeFlags.SpanAvailWidth; ImGuiTreeNodeFlags treeFlags = baseTreeFlags; ScreenObjectState state; if (GuiState.ScreenObjectUniques.ContainsKey(obj)) { state = GuiState.ScreenObjectUniques[obj]; state.Found = true; } else { state = ScreenObjectState.Create(obj); GuiState.ScreenObjectUniques[obj] = state; } if (GuiState._selectedScreenObject == obj) { treeFlags |= ImGuiTreeNodeFlags.Selected; } if (obj.Children.Count == 0) { treeFlags |= ImGuiTreeNodeFlags.Leaf | ImGuiTreeNodeFlags.NoTreePushOnOpen; ImGui.TreeNodeEx(state.Identifier.ToString(), treeFlags, obj.ToString()); if (ImGui.IsItemClicked()) { SetScreenObject(obj, state); } } else { bool opened = ImGui.TreeNodeEx(state.Identifier.ToString(), treeFlags, obj.ToString()); if (ImGui.IsItemClicked()) { SetScreenObject(obj, state); } if (opened) { foreach (IScreenObject item in obj.Children) { CreateScreenObject(item); } ImGui.TreePop(); } } }
public TreeNode(string text, IEnumerable <TreeNode> children = null, Action <TreeNode> onSelect = null, ContextMenu contextMenu = null) : base(contextMenu) { if (children != null) { _children.AddRange(children); } else { Flags |= ImGuiTreeNodeFlags.Leaf; } OnSelect = onSelect; Text = text; }
protected override void renderSelf() { ImGui.SetNextWindowPos(new Vector2(0, TITLEBAR_HEIGHT), ImGuiCond.Always, Vector2.Zero); ImGui.SetNextWindowSize(new Vector2(_io.DisplaySize.X, _io.DisplaySize.Y - TITLEBAR_HEIGHT), ImGuiCond.Always); ImGui.PushStyleVar(ImGuiStyleVar.WindowRounding, 0); if (ImGui.Begin("", ImGuiWindowFlags.NoMove | ImGuiWindowFlags.NoResize | ImGuiWindowFlags.NoCollapse | ImGuiWindowFlags.NoSavedSettings | ImGuiWindowFlags.NoTitleBar | ImGuiWindowFlags.NoBringToFrontOnFocus)) { ImGuiTreeNodeFlags flags = ImGuiTreeNodeFlags.DefaultOpen | ImGuiTreeNodeFlags.OpenOnDoubleClick | ImGuiTreeNodeFlags.OpenOnArrow; renderChildren(); ImGui.End(); } ImGui.PopStyleVar(); }
private void DrawNode(Core.Node node) { ImGuiTreeNodeFlags flags = 0; flags |= ImGuiTreeNodeFlags.DefaultOpen; flags |= ImGuiTreeNodeFlags.OpenOnDoubleClick; flags |= ImGuiTreeNodeFlags.OpenOnArrow; flags |= ImGuiTreeNodeFlags.SpanFullWidth; flags |= ImGuiTreeNodeFlags.AllowItemOverlap; //flags |= m_objectSelection.isSelected(object) ? ImGuiTreeNodeFlags_Selected : 0; flags |= node.ChildNodeCount == 0 ? ImGuiTreeNodeFlags.Bullet : ImGuiTreeNodeFlags.Leaf; if (ImGui.TreeNodeEx(node.GetType().FullName)) { foreach (var c in node.ChildNodes) { DrawNode(c); } ImGui.TreePop(); } }
static void SubmitObjectInspector(object selectedObject) { ImGuiTreeNodeFlags collapsingHeaderFlags = ImGuiTreeNodeFlags.CollapsingHeader; collapsingHeaderFlags |= ImGuiTreeNodeFlags.DefaultOpen; var selectedType = selectedObject.GetType(); if (ImGui.CollapsingHeader("Fields", collapsingHeaderFlags)) { var fields = selectedType.GetFields(); foreach (var info in fields.Where(field => !field.IsLiteral && !field.IsInitOnly)) { SubmitFieldPropertyInspector(new FieldPropertyListInfo(info, selectedObject), selectedObject); } } var properties = selectedType.GetProperties(); if (ImGui.CollapsingHeader("Properties", collapsingHeaderFlags)) { // When SetMethod is private, it will still be writable so long as it's class isn't inherited, so check to see if it's public too for the behaviour I want. foreach (var info in properties.Where(prop => prop.CanRead && prop.CanWrite && prop.SetMethod.IsPublic)) { SubmitFieldPropertyInspector(new FieldPropertyListInfo(info, selectedObject), selectedObject); } } if (ImGui.CollapsingHeader("Read-Only Properties", collapsingHeaderFlags)) { // When SetMethod is private, it will still be writable so long as it's class isn't inherited, so check to see if it's public too for the behaviour I want. foreach (var info in properties.Where(prop => prop.CanRead && (!prop.CanWrite || !prop.SetMethod.IsPublic))) { var fieldPropertyInfo = new FieldPropertyListInfo(info, selectedObject); SubmitReadonlyFieldPropertyInspector(fieldPropertyInfo); SubmitHelpMarker(fieldPropertyInfo); } } }
private static unsafe void SubmitEntitiesWindow(EntityAdmin admin, Dictionary <Entity, List <int> > entityToComponentGroups) { ImGui.Begin("Entities and Components"); bool createEntity = SubmitAddComponent("Create Entity", out Type componentType); Entity entityToDestroy = SelectedEntityComponent as Entity; bool disabled = entityToDestroy == null; if (disabled) { Util.ImGuiUtil.BeginDisable(); } if (ImGui.Button("Destroy Entity") && !disabled) { admin.DestroyEntity(entityToDestroy); } if (disabled) { Util.ImGuiUtil.EndDisable(); } ImGui.Separator(); ImGui.BeginChild("scrolling", Vector2.Zero, false, ImGuiWindowFlags.HorizontalScrollbar); var entities = EntityAdminUtil.GetEntities(admin); foreach (var entity in entities) { var components = entity.Components; ImGuiTreeNodeFlags nodeFlags = ImGuiTreeNodeFlags.OpenOnArrow | ImGuiTreeNodeFlags.OpenOnDoubleClick | ImGuiTreeNodeFlags.SpanAvailWidth; // OpenOnDoubleClick doesn't seem to work. Not sure why. if (entity.Components.Count == 0) { nodeFlags |= ImGuiTreeNodeFlags.Leaf; } if (entity == SelectedEntityComponent) { nodeFlags |= ImGuiTreeNodeFlags.Selected; if (scrollEntitiesView) { ImGui.SetScrollHereY(); } } if (entity.HasComponent <DontDestroyOnClear>(true)) { ImGui.PushFont(ImGuiController.BoldFont); } if (!entity.IsActive) { ImGui.PushStyleColor(ImGuiCol.Text, new Vector4(0.5f, 0.5f, 0.5f, 1f)); } bool errorInEntity = false; for (int i = 0; i < components.Count; i++) { if (!RequiresSystem.HasECSSystemForType(components[i].GetType(), HostHelper.GameSystems, out _)) { errorInEntity = true; } if (components[i] == SelectedEntityComponent) { ImGui.SetNextItemOpen(true); } } string componentGroupsText = string.Empty; if (entityToComponentGroups.ContainsKey(entity)) { foreach (int groupNum in entityToComponentGroups[entity]) { componentGroupsText = $"({groupNum}){componentGroupsText}"; } if (entityToComponentGroups[entity].Count() > 1) { errorInEntity = true; } } if (errorInEntity) { ImGui.PushStyleColor(ImGuiCol.Text, new Vector4(1f, 0f, 0f, 1f)); } string entityTransformText = !entity.HasComponent <Transform>(true) ? "~ " : ""; string entityLabelText = $"{componentGroupsText}{entityTransformText}{entity.Name}"; bool expanded = ImGui.TreeNodeEx(entity.Guid.ToString(), nodeFlags, entityLabelText); if (errorInEntity) { ImGui.PopStyleColor(); } if (!entity.IsActive) { ImGui.PopStyleColor(); } if (entity.HasComponent <DontDestroyOnClear>(true)) { ImGui.PopFont(); } if (ImGui.IsItemClicked()) { SelectedEntityComponent = entity; scrollSceneGraphView = true; } if (ImGui.BeginDragDropSource()) { ImGui.SetDragDropPayload(PAYLOAD_STRING, IntPtr.Zero, 0); // Payload is needed to trigger BeginDragDropTarget() draggedObject = entity; ImGui.Text(entity.Name); ImGui.EndDragDropSource(); } if (expanded) { for (int i = 0; i < components.Count; i++) { Component component = components[i]; nodeFlags = ImGuiTreeNodeFlags.Leaf | ImGuiTreeNodeFlags.SpanAvailWidth | ImGuiTreeNodeFlags.NoTreePushOnOpen; // This last one means that you can't do aImGui.TreePop(); or things will be messed up. if (component == SelectedEntityComponent) { nodeFlags |= ImGuiTreeNodeFlags.Selected; if (scrollEntitiesView) { ImGui.SetScrollHereY(); } } if (!component.IsActive) { ImGui.PushStyleColor(ImGuiCol.Text, new Vector4(0.5f, 0.5f, 0.5f, 1f)); } bool hasRequiredSystems = RequiresSystem.HasECSSystemForType(component.GetType(), HostHelper.GameSystems, out _); if (!hasRequiredSystems) { ImGui.PushStyleColor(ImGuiCol.Text, new Vector4(1f, 0f, 0f, 1f)); } ImGui.TreeNodeEx(component.Guid.ToString(), nodeFlags, component.Name); if (!hasRequiredSystems) { ImGui.PopStyleColor(); } if (!component.IsActive) { ImGui.PopStyleColor(); } if (ImGui.IsItemClicked()) { SelectedEntityComponent = component; scrollSceneGraphView = true; } if (ImGui.BeginDragDropSource()) { ImGui.SetDragDropPayload(PAYLOAD_STRING, IntPtr.Zero, 0); // Payload is needed to trigger BeginDragDropTarget() draggedObject = component; ImGui.Text(component.Name); ImGui.EndDragDropSource(); } } ImGui.TreePop(); } } scrollEntitiesView = false; if (createEntity) { var entity = admin.CreateEntity($"{componentType.Name}'s Entity"); SelectedEntityComponent = admin.AddComponent(entity, componentType); scrollEntitiesView = true; // For some reason this doesn't work half the time -_- Not sure why... } ImGui.End(); }
private static unsafe void AddSceneGraphTransforms(EntityAdmin admin, List <Transform> list) { // The selectedTransform is either the selectedEntityComponent (if it's a Transform) or the Transform associated with the selected Entity/Component. Transform selectedTransform = SelectedEntityComponent as Transform; if (selectedTransform == null) { Entity entity = SelectedEntityComponent as Entity; if (entity == null) { Component component = SelectedEntityComponent as Component; if (component != null) { entity = component.Entity; } } if (entity != null) { selectedTransform = entity.GetComponent <Transform>(true); } } foreach (var transform in list) { ImGuiTreeNodeFlags nodeFlags = ImGuiTreeNodeFlags.OpenOnArrow | ImGuiTreeNodeFlags.OpenOnDoubleClick | ImGuiTreeNodeFlags.SpanAvailWidth; // OpenOnDoubleClick doesn't seem to work. Not sure why. if (transform.Children.Count == 0) { nodeFlags |= ImGuiTreeNodeFlags.Leaf; } if (transform == selectedTransform) { nodeFlags |= ImGuiTreeNodeFlags.Selected; if (scrollSceneGraphView) { ImGui.SetScrollHereY(); } } bool parentOfSelected = false; Transform parent = selectedTransform as Transform; while (parent != null) { parent = parent.Parent; if (parent == transform) { parentOfSelected = true; break; } } if (parentOfSelected) { ImGui.SetNextItemOpen(true); } if (!transform.IsActive) { ImGui.PushStyleColor(ImGuiCol.Text, new Vector4(0.5f, 0.5f, 0.5f, 1f)); } bool expanded = ImGui.TreeNodeEx(transform.Guid.ToString(), nodeFlags, transform.EntityName); if (!transform.IsActive) { ImGui.PopStyleColor(); } if (ImGui.IsItemClicked()) { SelectedEntityComponent = transform; scrollEntitiesView = true; } if (ImGui.BeginDragDropSource()) { ImGui.SetDragDropPayload(PAYLOAD_STRING, IntPtr.Zero, 0); // Payload is needed to trigger BeginDragDropTarget() draggedObject = transform; ImGui.Text(transform.EntityName); ImGui.EndDragDropSource(); } if (draggedObject != null && draggedObject is Transform) { if (ImGui.BeginDragDropTarget()) { var payload = ImGui.AcceptDragDropPayload(PAYLOAD_STRING); if (payload.NativePtr != null) // Only when this is non-null does it mean that we've released the drag { Transform draggedTransform = draggedObject as Transform; Transform newParent; if (draggedTransform.Parent == transform) { newParent = null; } else { newParent = transform; } Transform.AssignParent(draggedTransform, newParent, admin, true); draggedObject = null; } ImGui.EndDragDropTarget(); } } if (expanded) { AddSceneGraphTransforms(admin, transform.Children.ToList()); ImGui.TreePop(); } } }
public static bool CollapsingHeader(string label, ImGuiTreeNodeFlags flags = 0) { return(ImGuiNative.igCollapsingHeader(label, flags)); }
public static bool TreeNodeEx(string label, ImGuiTreeNodeFlags flags = 0) { return(ImGuiNative.igTreeNodeEx(label, flags)); }
private void DrawEntitynode(int entityId, ImGuiTreeNodeFlags flags) { ref var entt = ref _hierarchyFilter.GetEntity(entityId);
public static bool CollapsingHeader(string label, ImGuiTreeNodeFlags flags = ImGuiTreeNodeFlags.None) => CollapsingHeaderTreeNodeFlags(label, flags);
internal static void DrawImGuiSettings() { System.Numerics.Vector4 green = new System.Numerics.Vector4(0.102f, 0.388f, 0.106f, 1.000f); System.Numerics.Vector4 red = new System.Numerics.Vector4(0.388f, 0.102f, 0.102f, 1.000f); ImGuiTreeNodeFlags collapsingHeaderFlags = ImGuiTreeNodeFlags.CollapsingHeader; ImGui.Text("Plugin by Totalschaden. https://github.com/totalschaden/copilot"); try { // Input Keys ImGui.PushStyleColor(ImGuiCol.Header, green); ImGui.PushID(1000); if (ImGui.TreeNodeEx("Input Keys", collapsingHeaderFlags)) { CoPilot.instance.Settings.InputKey1.Value = ImGuiExtension.HotkeySelector("Use bound skill 2 Key: " + CoPilot.instance.Settings.InputKey1.Value, CoPilot.instance.Settings.InputKey1.Value); CoPilot.instance.Settings.InputKey3.Value = ImGuiExtension.HotkeySelector("Use bound skill 4 Key: " + CoPilot.instance.Settings.InputKey3.Value, CoPilot.instance.Settings.InputKey3.Value); CoPilot.instance.Settings.InputKey4.Value = ImGuiExtension.HotkeySelector("Use bound skill 5 Key: " + CoPilot.instance.Settings.InputKey4.Value, CoPilot.instance.Settings.InputKey4.Value); CoPilot.instance.Settings.InputKey5.Value = ImGuiExtension.HotkeySelector("Use bound skill 6 Key: " + CoPilot.instance.Settings.InputKey5.Value, CoPilot.instance.Settings.InputKey5.Value); CoPilot.instance.Settings.InputKey6.Value = ImGuiExtension.HotkeySelector("Use bound skill 7 Key: " + CoPilot.instance.Settings.InputKey6.Value, CoPilot.instance.Settings.InputKey6.Value); CoPilot.instance.Settings.InputKey7.Value = ImGuiExtension.HotkeySelector("Use bound skill 8 Key: " + CoPilot.instance.Settings.InputKey7.Value, CoPilot.instance.Settings.InputKey7.Value); CoPilot.instance.Settings.InputKey8.Value = ImGuiExtension.HotkeySelector("Use bound skill 9 Key: " + CoPilot.instance.Settings.InputKey8.Value, CoPilot.instance.Settings.InputKey8.Value); CoPilot.instance.Settings.InputKey9.Value = ImGuiExtension.HotkeySelector("Use bound skill 10 Key: " + CoPilot.instance.Settings.InputKey9.Value, CoPilot.instance.Settings.InputKey9.Value); CoPilot.instance.Settings.InputKey10.Value = ImGuiExtension.HotkeySelector("Use bound skill 11 Key: " + CoPilot.instance.Settings.InputKey10.Value, CoPilot.instance.Settings.InputKey10.Value); CoPilot.instance.Settings.InputKey11.Value = ImGuiExtension.HotkeySelector("Use bound skill 12 Key: " + CoPilot.instance.Settings.InputKey11.Value, CoPilot.instance.Settings.InputKey11.Value); CoPilot.instance.Settings.InputKey12.Value = ImGuiExtension.HotkeySelector("Use bound skill 13 Key: " + CoPilot.instance.Settings.InputKey12.Value, CoPilot.instance.Settings.InputKey12.Value); } } catch (Exception e) { CoPilot.instance.LogError(e.ToString()); } try { if (CoPilot.instance.Settings.confirm5) { ImGui.PushStyleColor(ImGuiCol.Header, green); } else { ImGui.PushStyleColor(ImGuiCol.Header, red); } ImGui.PushID(1001); if (ImGui.TreeNodeEx("Importand Informations", collapsingHeaderFlags)) { ImGui.Text("Go to Input Keys Tab, and set them According to your Ingame Settings -> Settings -> Input -> Use bound skill X"); ImGui.NewLine(); ImGui.Text("If your a noob dont make changes to -> Input Keys <- and change your Ingame Settings to the Keys that are predefined in the Plugin!"); ImGui.NewLine(); ImGui.Text("DO NOT ASSIGN MOUSE KEYS TO -> Input Keys <- in the Plugin !!!"); ImGui.NewLine(); ImGui.Text("The Top Left and Top Right Skill Slots are EXCLUDED!!! (Ingame bound skill 1 and 3) I recommend you use these for your Mouse."); ImGui.NewLine(); ImGui.Text("The Plugin is currently forced to use Timers for Cooldowns as there is no Proper Skill Api for Ready/Cooldown."); ImGui.NewLine(); ImGui.Text("I STRONGLY recommend that you add 80-100ms extra delay to your Skill Settings, so a Skill wont be skipped sometimes."); ImGui.NewLine(); ImGui.Text("Unhappy with Cooldown Slider ? Set your own Value with STRG/CTRL + Mouseclick"); ImGui.NewLine(); ImGui.Text("Using Auto Attack and Cyclone for example? If you want to Cyclone yourself, put it on Right Mouse Slot, and have Cyclone in the Slot before that one."); ImGui.NewLine(); CoPilot.instance.Settings.confirm1.Value = ImGuiExtension.Checkbox("I did READ the text above.", CoPilot.instance.Settings.confirm1.Value); if (!CoPilot.instance.Settings.confirm1) { return; } CoPilot.instance.Settings.confirm2.Value = ImGuiExtension.Checkbox("I did READ and UNDERSTAND the text above.", CoPilot.instance.Settings.confirm2.Value); if (!CoPilot.instance.Settings.confirm2) { return; } CoPilot.instance.Settings.confirm3.Value = ImGuiExtension.Checkbox("I just READ it again and understood it.", CoPilot.instance.Settings.confirm3.Value); if (!CoPilot.instance.Settings.confirm3) { return; } CoPilot.instance.Settings.confirm4.Value = ImGuiExtension.Checkbox("I did everything stated above and im ready to go.", CoPilot.instance.Settings.confirm4.Value); if (!CoPilot.instance.Settings.confirm4) { return; } CoPilot.instance.Settings.confirm5.Value = ImGuiExtension.Checkbox("Let me use the Plugin already !!!", CoPilot.instance.Settings.confirm5.Value); if (!CoPilot.instance.Settings.confirm5) { return; } } } catch (Exception e) { CoPilot.instance.LogError(e.ToString()); } if (!CoPilot.instance.Settings.confirm5) { return; } try { // Donation ImGui.PushStyleColor(ImGuiCol.Header, new System.Numerics.Vector4(0.454f, 0.031f, 0.768f, 1.000f)); ImGui.PushID(99999); if (ImGui.TreeNodeEx("Donation", collapsingHeaderFlags)) { ImGui.Text("Thanks to anyone who is considering this."); if (ImGui.Button("Open Amazon.de Wishlist")) { System.Diagnostics.Process.Start("https://www.amazon.de/hz/wishlist/ls/MZ543BDBC6PJ?ref_=wl_share"); } if (ImGui.Button("Copy BTC Adress")) { SetText("bc1qwjpdf9q3n94e88m3z398udjagach5u56txwpkh"); } if (ImGui.Button("Copy ETH Adress")) { SetText("0x78Af12D08B32f816dB9788C5Cf3122693143ed78"); } } } catch (Exception e) { CoPilot.instance.LogError(e.ToString()); } try { // Auto Attack if (CoPilot.instance.Settings.autoAttackEnabled) { ImGui.PushStyleColor(ImGuiCol.Header, green); } else { ImGui.PushStyleColor(ImGuiCol.Header, red); } ImGui.PushID(1); if (ImGui.TreeNodeEx("Auto Attack with Cyclone / Nova / Flicker", collapsingHeaderFlags)) { CoPilot.instance.Settings.autoAttackEnabled.Value = ImGuiExtension.Checkbox("Enabled", CoPilot.instance.Settings.autoAttackEnabled.Value); CoPilot.instance.Settings.autoAttackLeftMouseCheck.Value = ImGuiExtension.Checkbox("Pause on Left Mouse Pressed", CoPilot.instance.Settings.autoAttackLeftMouseCheck.Value); CoPilot.instance.Settings.autoAttackPickItKey.Value = ImGuiExtension.HotkeySelector("PickIt Key: " + CoPilot.instance.Settings.autoAttackPickItKey.Value, CoPilot.instance.Settings.autoAttackPickItKey.Value); CoPilot.instance.Settings.autoAttackRange.Value = ImGuiExtension.IntSlider("Range", CoPilot.instance.Settings.autoAttackRange); } } catch (Exception e) { CoPilot.instance.LogError(e.ToString()); } try { // Auto Golem if (CoPilot.instance.Settings.autoSummonEnabled) { ImGui.PushStyleColor(ImGuiCol.Header, green); } else { ImGui.PushStyleColor(ImGuiCol.Header, red); } ImGui.PushID(2); if (ImGui.TreeNodeEx("Auto Summon", collapsingHeaderFlags)) { CoPilot.instance.Settings.autoSummonEnabled.Value = ImGuiExtension.Checkbox("Auto Summons", CoPilot.instance.Settings.autoSummonEnabled.Value); CoPilot.instance.Settings.autoGolemEnabled.Value = ImGuiExtension.Checkbox("Auto Golem", CoPilot.instance.Settings.autoGolemEnabled.Value); CoPilot.instance.Settings.autoZombieEnabled.Value = ImGuiExtension.Checkbox("Auto Zombies", CoPilot.instance.Settings.autoZombieEnabled.Value); CoPilot.instance.Settings.autoGolemAvoidRange.Value = ImGuiExtension.IntSlider("Do not use when Enemys within", CoPilot.instance.Settings.autoGolemAvoidRange); CoPilot.instance.Settings.autoGolemChaosMax.Value = ImGuiExtension.IntSlider("Chaos Golems max.", CoPilot.instance.Settings.autoGolemChaosMax); CoPilot.instance.Settings.autoGolemFireMax.Value = ImGuiExtension.IntSlider("Flame Golems max.", CoPilot.instance.Settings.autoGolemFireMax); CoPilot.instance.Settings.autoGolemIceMax.Value = ImGuiExtension.IntSlider("Ice Golems max.", CoPilot.instance.Settings.autoGolemIceMax); CoPilot.instance.Settings.autoGolemLightningMax.Value = ImGuiExtension.IntSlider("Lightning Golems max.", CoPilot.instance.Settings.autoGolemLightningMax); CoPilot.instance.Settings.autoGolemRockMax.Value = ImGuiExtension.IntSlider("Stone Golems max.", CoPilot.instance.Settings.autoGolemRockMax); CoPilot.instance.Settings.autoBoneMax.Value = ImGuiExtension.IntSlider("Carrion Golems max.", CoPilot.instance.Settings.autoBoneMax); CoPilot.instance.Settings.autoGolemDropBearMax.Value = ImGuiExtension.IntSlider("Beastial Ursa Max.", CoPilot.instance.Settings.autoGolemDropBearMax); } } catch (Exception e) { CoPilot.instance.LogError(e.ToString()); } try { // Auto Quit if (CoPilot.instance.Settings.autoQuitEnabled) { ImGui.PushStyleColor(ImGuiCol.Header, green); } else { ImGui.PushStyleColor(ImGuiCol.Header, red); } ImGui.PushID(3); if (ImGui.TreeNodeEx("Auto Quit", collapsingHeaderFlags)) { CoPilot.instance.Settings.autoQuitEnabled.Value = ImGuiExtension.Checkbox("Enabled", CoPilot.instance.Settings.autoQuitEnabled.Value); CoPilot.instance.Settings.hpPctQuit.Value = ImGuiExtension.FloatSlider("HP%", CoPilot.instance.Settings.hpPctQuit); CoPilot.instance.Settings.esPctQuit.Value = ImGuiExtension.FloatSlider("ES%", CoPilot.instance.Settings.esPctQuit); CoPilot.instance.Settings.autoQuitGuardian.Value = ImGuiExtension.Checkbox("Guardian Auto Quit", CoPilot.instance.Settings.autoQuitGuardian.Value); CoPilot.instance.Settings.guardianHpPct.Value = ImGuiExtension.FloatSlider("Guardian HP%", CoPilot.instance.Settings.guardianHpPct); CoPilot.instance.Settings.autoQuitHotkeyEnabled.Value = ImGuiExtension.Checkbox("Hotkey Enabled", CoPilot.instance.Settings.autoQuitHotkeyEnabled.Value); CoPilot.instance.Settings.forcedAutoQuit.Value = ImGuiExtension.HotkeySelector("Force Quit Hotkey: " + CoPilot.instance.Settings.forcedAutoQuit.Value, CoPilot.instance.Settings.forcedAutoQuit.Value); } } catch (Exception e) { CoPilot.instance.LogError(e.ToString()); } try { // Blood Rage if (CoPilot.instance.Settings.bloodRageEnabled) { ImGui.PushStyleColor(ImGuiCol.Header, green); } else { ImGui.PushStyleColor(ImGuiCol.Header, red); } ImGui.PushID(4); if (ImGui.TreeNodeEx("Blood Rage", collapsingHeaderFlags)) { CoPilot.instance.Settings.bloodRageEnabled.Value = ImGuiExtension.Checkbox("Enabled", CoPilot.instance.Settings.bloodRageEnabled.Value); CoPilot.instance.Settings.bloodRageDelay.Value = ImGuiExtension.IntSlider("Delay", CoPilot.instance.Settings.bloodRageDelay); CoPilot.instance.Settings.bloodRageRange.Value = ImGuiExtension.IntSlider("Range", CoPilot.instance.Settings.bloodRageRange); } } catch (Exception e) { CoPilot.instance.LogError(e.ToString()); } try { if (CoPilot.instance.Settings.delveFlareEnabled) { ImGui.PushStyleColor(ImGuiCol.Header, green); } else { ImGui.PushStyleColor(ImGuiCol.Header, red); } ImGui.PushID(5); if (ImGui.TreeNodeEx("Delve Flare", collapsingHeaderFlags)) { CoPilot.instance.Settings.delveFlareEnabled.Value = ImGuiExtension.Checkbox("Enabled", CoPilot.instance.Settings.delveFlareEnabled); CoPilot.instance.Settings.delveFlareKey.Value = ImGuiExtension.HotkeySelector("Key: " + CoPilot.instance.Settings.delveFlareKey.Value, CoPilot.instance.Settings.delveFlareKey.Value); CoPilot.instance.Settings.delveFlareDebuffStacks.Value = ImGuiExtension.IntSlider("min. Debuff Stacks", CoPilot.instance.Settings.delveFlareDebuffStacks); CoPilot.instance.Settings.delveFlareHpBelow.Value = ImGuiExtension.FloatSlider("HP%", CoPilot.instance.Settings.delveFlareHpBelow); CoPilot.instance.Settings.delveFlareEsBelow.Value = ImGuiExtension.FloatSlider("ES%", CoPilot.instance.Settings.delveFlareEsBelow); } } catch (Exception e) { CoPilot.instance.LogError(e.ToString()); } try { // Doedre Effigy if (CoPilot.instance.Settings.doedreEffigyEnabled) { ImGui.PushStyleColor(ImGuiCol.Header, green); } else { ImGui.PushStyleColor(ImGuiCol.Header, red); } ImGui.PushID(6); if (ImGui.TreeNodeEx("Doedre Effigy", collapsingHeaderFlags)) { CoPilot.instance.Settings.doedreEffigyEnabled.Value = ImGuiExtension.Checkbox("Enabled", CoPilot.instance.Settings.doedreEffigyEnabled.Value); CoPilot.instance.Settings.doedreEffigyDelay.Value = ImGuiExtension.IntSlider("min. Debuff Stacks", CoPilot.instance.Settings.doedreEffigyDelay); } } catch (Exception e) { CoPilot.instance.LogError(e.ToString()); } try { if (CoPilot.instance.Settings.divineIreEnabled) { ImGui.PushStyleColor(ImGuiCol.Header, green); } else { ImGui.PushStyleColor(ImGuiCol.Header, red); } ImGui.PushID(7); if (ImGui.TreeNodeEx("Divine Ire / Blade Flurry / Scourge Arrow (Do NOT bind on Mousekeys!!!)", collapsingHeaderFlags)) { CoPilot.instance.Settings.divineIreEnabled.Value = ImGuiExtension.Checkbox("Enabled", CoPilot.instance.Settings.divineIreEnabled.Value); CoPilot.instance.Settings.divineIreStacks.Value = ImGuiExtension.IntSlider("Stacks", CoPilot.instance.Settings.divineIreStacks); CoPilot.instance.Settings.divineIreWaitForInfused.Value = ImGuiExtension.Checkbox("Wait for Infused Channeling Support", CoPilot.instance.Settings.divineIreWaitForInfused.Value); } } catch (Exception e) { CoPilot.instance.LogError(e.ToString()); } try { // Warcrys if (CoPilot.instance.Settings.enduringCryEnabled || CoPilot.instance.Settings.rallyingCryEnabled) { ImGui.PushStyleColor(ImGuiCol.Header, green); } else { ImGui.PushStyleColor(ImGuiCol.Header, red); } ImGui.PushID(8); if (ImGui.TreeNodeEx("Enduring Cry / Rallying Cry", collapsingHeaderFlags)) { CoPilot.instance.Settings.warCryCooldown.Value = ImGuiExtension.IntSlider("Cooldown", CoPilot.instance.Settings.warCryCooldown); CoPilot.instance.Settings.warCryKeepRage.Value = ImGuiExtension.Checkbox("Keep Rage Up", CoPilot.instance.Settings.warCryKeepRage.Value); CoPilot.instance.Settings.enduringCryEnabled.Value = ImGuiExtension.Checkbox("Enduring Cry Enabled", CoPilot.instance.Settings.enduringCryEnabled.Value); CoPilot.instance.Settings.warCryTriggerRange.Value = ImGuiExtension.IntSlider("Range", CoPilot.instance.Settings.warCryTriggerRange); CoPilot.instance.Settings.rallyingCryEnabled.Value = ImGuiExtension.Checkbox("Rallying Cry Enabled", CoPilot.instance.Settings.rallyingCryEnabled.Value); } } catch (Exception e) { CoPilot.instance.LogError(e.ToString()); } try { // Molten Shell / Steelskin / Bone Armour / Arcane Cloak if (CoPilot.instance.Settings.moltenShellEnabled) { ImGui.PushStyleColor(ImGuiCol.Header, green); } else { ImGui.PushStyleColor(ImGuiCol.Header, red); } ImGui.PushID(9); if (ImGui.TreeNodeEx("Molten Shell / Steelskin / Bone Armour / Arcane Cloak", collapsingHeaderFlags)) { CoPilot.instance.Settings.moltenShellEnabled.Value = ImGuiExtension.Checkbox("Enabled", CoPilot.instance.Settings.moltenShellEnabled.Value); CoPilot.instance.Settings.moltenShellDelay.Value = ImGuiExtension.IntSlider("Cooldown", CoPilot.instance.Settings.moltenShellDelay); CoPilot.instance.Settings.moltenShellRange.Value = ImGuiExtension.IntSlider("Range", CoPilot.instance.Settings.moltenShellRange); } } catch (Exception e) { CoPilot.instance.LogError(e.ToString()); } try { // Offerings if (CoPilot.instance.Settings.offeringsEnabled) { ImGui.PushStyleColor(ImGuiCol.Header, green); } else { ImGui.PushStyleColor(ImGuiCol.Header, red); } ImGui.PushID(10); if (ImGui.TreeNodeEx("Offerings (This will get you stuck in Animation for your Casttime !)", collapsingHeaderFlags)) { CoPilot.instance.Settings.offeringsEnabled.Value = ImGuiExtension.Checkbox("Enabled", CoPilot.instance.Settings.offeringsEnabled.Value); CoPilot.instance.Settings.offeringsUseWhileCasting.Value = ImGuiExtension.Checkbox("Use while Casting/Attacking", CoPilot.instance.Settings.offeringsUseWhileCasting.Value); CoPilot.instance.Settings.offeringsMinEnemys.Value = ImGuiExtension.IntSlider("min. Enemys", CoPilot.instance.Settings.offeringsMinEnemys); CoPilot.instance.Settings.offeringsTriggerRange.Value = ImGuiExtension.IntSlider("Trigger Range", CoPilot.instance.Settings.offeringsTriggerRange); } } catch (Exception e) { CoPilot.instance.LogError(e.ToString()); } try { // Phaserun if (CoPilot.instance.Settings.phaserunEnabled) { ImGui.PushStyleColor(ImGuiCol.Header, green); } else { ImGui.PushStyleColor(ImGuiCol.Header, red); } ImGui.PushID(11); if (ImGui.TreeNodeEx("Phaserun", collapsingHeaderFlags)) { CoPilot.instance.Settings.phaserunEnabled.Value = ImGuiExtension.Checkbox("Enabled", CoPilot.instance.Settings.phaserunEnabled.Value); CoPilot.instance.Settings.phaserunDelay.Value = ImGuiExtension.IntSlider("Cooldown", CoPilot.instance.Settings.phaserunDelay); } } catch (Exception e) { CoPilot.instance.LogError(e.ToString()); } try { // Vortex if (CoPilot.instance.Settings.vortexEnabled) { ImGui.PushStyleColor(ImGuiCol.Header, green); } else { ImGui.PushStyleColor(ImGuiCol.Header, red); } ImGui.PushID(13); if (ImGui.TreeNodeEx("Vortex", collapsingHeaderFlags)) { CoPilot.instance.Settings.vortexEnabled.Value = ImGuiExtension.Checkbox("Enabled", CoPilot.instance.Settings.vortexEnabled.Value); CoPilot.instance.Settings.vortexFrostbolt.Value = ImGuiExtension.Checkbox("When Frostbolt's flying", CoPilot.instance.Settings.vortexFrostbolt.Value); CoPilot.instance.Settings.vortexDelay.Value = ImGuiExtension.IntSlider("Cooldown", CoPilot.instance.Settings.vortexDelay); CoPilot.instance.Settings.vortexRange.Value = ImGuiExtension.IntSlider("Range", CoPilot.instance.Settings.vortexRange); } } catch (Exception e) { CoPilot.instance.LogError(e.ToString()); } try { if (CoPilot.instance.Settings.anyVaalEnabled) { ImGui.PushStyleColor(ImGuiCol.Header, green); } else { ImGui.PushStyleColor(ImGuiCol.Header, red); } ImGui.PushID(14); if (ImGui.TreeNodeEx("Any Vaal Skill", collapsingHeaderFlags)) { CoPilot.instance.Settings.anyVaalEnabled.Value = ImGuiExtension.Checkbox("Enabled", CoPilot.instance.Settings.anyVaalEnabled.Value); CoPilot.instance.Settings.anyVaalMinEnemys.Value = ImGuiExtension.IntSlider("min. Enemys in Trigger Range", CoPilot.instance.Settings.anyVaalMinEnemys); CoPilot.instance.Settings.anyVaalTriggerRange.Value = ImGuiExtension.IntSlider("Trigger Range", CoPilot.instance.Settings.anyVaalTriggerRange); CoPilot.instance.Settings.anyVaalHpPct.Value = ImGuiExtension.FloatSlider("HP%", CoPilot.instance.Settings.anyVaalHpPct); CoPilot.instance.Settings.anyVaalEsPct.Value = ImGuiExtension.FloatSlider("ES%", CoPilot.instance.Settings.anyVaalEsPct); } } catch (Exception e) { CoPilot.instance.LogError(e.ToString()); } try { if (CoPilot.instance.Settings.customEnabled) { ImGui.PushStyleColor(ImGuiCol.Header, green); } else { ImGui.PushStyleColor(ImGuiCol.Header, red); } ImGui.PushID(15); if (ImGui.TreeNodeEx("Custom Skill (Use any Skill not Supported here.)", collapsingHeaderFlags)) { CoPilot.instance.Settings.customEnabled.Value = ImGuiExtension.Checkbox("Enabled", CoPilot.instance.Settings.customEnabled.Value); CoPilot.instance.Settings.customKey.Value = ImGuiExtension.HotkeySelector("Key: " + CoPilot.instance.Settings.customKey.Value, CoPilot.instance.Settings.customKey); CoPilot.instance.Settings.customCooldown.Value = ImGuiExtension.IntSlider("Cooldown", CoPilot.instance.Settings.customCooldown); CoPilot.instance.Settings.customMinEnemys.Value = ImGuiExtension.IntSlider("min. Enemys in Trigger Range", CoPilot.instance.Settings.customMinEnemys); CoPilot.instance.Settings.customTriggerRange.Value = ImGuiExtension.IntSlider("Trigger Range", CoPilot.instance.Settings.customTriggerRange); CoPilot.instance.Settings.customHpPct.Value = ImGuiExtension.FloatSlider("HP%", CoPilot.instance.Settings.customHpPct); CoPilot.instance.Settings.customEsPct.Value = ImGuiExtension.FloatSlider("ES%", CoPilot.instance.Settings.customEsPct); } } catch (Exception e) { CoPilot.instance.LogError(e.ToString()); } try { if (CoPilot.instance.Settings.customTwoEnabled) { ImGui.PushStyleColor(ImGuiCol.Header, green); } else { ImGui.PushStyleColor(ImGuiCol.Header, red); } ImGui.PushID(15); if (ImGui.TreeNodeEx("Custom Skill 2 (Use any Skill not Supported here.)", collapsingHeaderFlags)) { CoPilot.instance.Settings.customTwoEnabled.Value = ImGuiExtension.Checkbox("Enabled", CoPilot.instance.Settings.customTwoEnabled.Value); CoPilot.instance.Settings.customTwoKey.Value = ImGuiExtension.HotkeySelector("Key: " + CoPilot.instance.Settings.customTwoKey.Value, CoPilot.instance.Settings.customTwoKey); CoPilot.instance.Settings.customTwoCooldown.Value = ImGuiExtension.IntSlider("Cooldown", CoPilot.instance.Settings.customTwoCooldown); CoPilot.instance.Settings.customTwoMinEnemys.Value = ImGuiExtension.IntSlider("min. Enemys in Trigger Range", CoPilot.instance.Settings.customTwoMinEnemys); CoPilot.instance.Settings.customTwoTriggerRange.Value = ImGuiExtension.IntSlider("Trigger Range", CoPilot.instance.Settings.customTwoTriggerRange); CoPilot.instance.Settings.customTwoHpPct.Value = ImGuiExtension.FloatSlider("HP%", CoPilot.instance.Settings.customTwoHpPct); CoPilot.instance.Settings.customTwoEsPct.Value = ImGuiExtension.FloatSlider("ES%", CoPilot.instance.Settings.customTwoEsPct); } } catch (Exception e) { CoPilot.instance.LogError(e.ToString()); } try { if (CoPilot.instance.Settings.brandRecallEnabled) { ImGui.PushStyleColor(ImGuiCol.Header, green); } else { ImGui.PushStyleColor(ImGuiCol.Header, red); } ImGui.PushID(16); if (ImGui.TreeNodeEx("Brand Recall", collapsingHeaderFlags)) { CoPilot.instance.Settings.brandRecallEnabled.Value = ImGuiExtension.Checkbox("Enabled", CoPilot.instance.Settings.brandRecallEnabled.Value); CoPilot.instance.Settings.brandRecallCooldown.Value = ImGuiExtension.IntSlider("Cooldown", CoPilot.instance.Settings.brandRecallCooldown); CoPilot.instance.Settings.brandRecallMinEnemys.Value = ImGuiExtension.IntSlider("min. Enemys in Trigger Range", CoPilot.instance.Settings.brandRecallMinEnemys); CoPilot.instance.Settings.brandRecallTriggerRange.Value = ImGuiExtension.IntSlider("Trigger Range", CoPilot.instance.Settings.brandRecallTriggerRange); CoPilot.instance.Settings.brandRecallMinBrands.Value = ImGuiExtension.IntSlider("min. Brands Summoned", CoPilot.instance.Settings.brandRecallMinBrands); } } catch (Exception e) { CoPilot.instance.LogError(e.ToString()); } try { if (CoPilot.instance.Settings.tempestShieldEnabled) { ImGui.PushStyleColor(ImGuiCol.Header, green); } else { ImGui.PushStyleColor(ImGuiCol.Header, red); } ImGui.PushID(17); if (ImGui.TreeNodeEx("Tempest Shield", collapsingHeaderFlags)) { CoPilot.instance.Settings.tempestShieldEnabled.Value = ImGuiExtension.Checkbox("Enabled", CoPilot.instance.Settings.tempestShieldEnabled.Value); CoPilot.instance.Settings.tempestShieldUseWhileCasting.Value = ImGuiExtension.Checkbox("Use while Casting/Attacking", CoPilot.instance.Settings.tempestShieldUseWhileCasting.Value); CoPilot.instance.Settings.tempestShieldMinEnemys.Value = ImGuiExtension.IntSlider("min. Enemys in Trigger Range", CoPilot.instance.Settings.tempestShieldMinEnemys); CoPilot.instance.Settings.tempestShieldTriggerRange.Value = ImGuiExtension.IntSlider("Trigger Range", CoPilot.instance.Settings.tempestShieldTriggerRange); } } catch (Exception e) { CoPilot.instance.LogError(e.ToString()); } try { if (CoPilot.instance.Settings.convocationEnabled) { ImGui.PushStyleColor(ImGuiCol.Header, green); } else { ImGui.PushStyleColor(ImGuiCol.Header, red); } ImGui.PushID(18); if (ImGui.TreeNodeEx("Convocation", collapsingHeaderFlags)) { CoPilot.instance.Settings.convocationEnabled.Value = ImGuiExtension.Checkbox("Enabled", CoPilot.instance.Settings.convocationEnabled.Value); CoPilot.instance.Settings.convocationAvoidUniqueRange.Value = ImGuiExtension.IntSlider("Do not use when Unique Enemy within", CoPilot.instance.Settings.convocationAvoidUniqueRange); CoPilot.instance.Settings.convocationCooldown.Value = ImGuiExtension.IntSlider("Cooldown", CoPilot.instance.Settings.convocationCooldown); CoPilot.instance.Settings.guardianHpPct.Value = ImGuiExtension.FloatSlider("Summon HP% below", CoPilot.instance.Settings.guardianHpPct); CoPilot.instance.Settings.convocationMobRange.Value = ImGuiExtension.IntSlider("Mob Trigger Range", CoPilot.instance.Settings.convocationMobRange); CoPilot.instance.Settings.convocationMinnionRange.Value = ImGuiExtension.IntSlider("Minnion Range", CoPilot.instance.Settings.convocationMinnionRange); CoPilot.instance.Settings.convocationMinnionPct.Value = ImGuiExtension.IntSlider("min. % Minnions in Range", CoPilot.instance.Settings.convocationMinnionPct); ImGui.Text("This will Summon your Minnions when min% minnions are not within Minnion Range, and there is an enemys within Mob Trigger Range."); } } catch (Exception e) { CoPilot.instance.LogError(e.ToString()); } try { if (CoPilot.instance.Settings.mirageEnabled) { ImGui.PushStyleColor(ImGuiCol.Header, green); } else { ImGui.PushStyleColor(ImGuiCol.Header, red); } ImGui.PushID(19); if (ImGui.TreeNodeEx("Mirage Archer", collapsingHeaderFlags)) { ImGui.Text("Currently only check if an enemy is near mouse, recommend < 75 range when only firing 1 arrow."); ImGui.Text("Works alot better with Volley/GMP, Increase Range by try&error"); CoPilot.instance.Settings.mirageEnabled.Value = ImGuiExtension.Checkbox("Enabled", CoPilot.instance.Settings.mirageEnabled.Value); CoPilot.instance.Settings.mirageRange.Value = ImGuiExtension.IntSlider("Enemy Range near Mouse", CoPilot.instance.Settings.mirageRange); } } catch (Exception e) { CoPilot.instance.LogError(e.ToString()); } try { if (CoPilot.instance.Settings.autoCurseEnabled) { ImGui.PushStyleColor(ImGuiCol.Header, green); } else { ImGui.PushStyleColor(ImGuiCol.Header, red); } ImGui.PushID(20); if (ImGui.TreeNodeEx("Auto Curse (Testing: Only Punishment atm)", collapsingHeaderFlags)) { CoPilot.instance.Settings.autoCurseEnabled.Value = ImGuiExtension.Checkbox("Enabled", CoPilot.instance.Settings.autoCurseEnabled.Value); CoPilot.instance.Settings.autoCurseCooldown.Value = ImGuiExtension.IntSlider("Cooldown", CoPilot.instance.Settings.autoCurseCooldown); CoPilot.instance.Settings.autoCurseRange.Value = ImGuiExtension.IntSlider("Enemy Range near Mouse", CoPilot.instance.Settings.autoCurseRange); CoPilot.instance.Settings.autoCurseMinEnemys.Value = ImGuiExtension.IntSlider("min. Enemys not Cursed", CoPilot.instance.Settings.autoCurseMinEnemys); } } catch (Exception e) { CoPilot.instance.LogError(e.ToString()); } try { if (CoPilot.instance.Settings.minesEnabled) { ImGui.PushStyleColor(ImGuiCol.Header, green); } else { ImGui.PushStyleColor(ImGuiCol.Header, red); } ImGui.PushID(99999); if (ImGui.TreeNodeEx("Mines (Not Implemented)", collapsingHeaderFlags)) { } } catch (Exception e) { CoPilot.instance.LogError(e.ToString()); } ImGui.End(); }
public void DrawSettings() { ImGuiTreeNodeFlags collapsingHeaderFlags = ImGuiTreeNodeFlags.CollapsingHeader; Debug.Value = ImGuiExtension.Checkbox("Debug", Debug); ImGui.Spacing(); if (Debug.Value) { VerboseDebug.Value = ImGuiExtension.Checkbox("Extra Verbose Debug", VerboseDebug); ImGui.Spacing(); ImGui.TextDisabled("Hotkey to randomly generate On Hover events"); ImGui.TextDisabled("This will help to see where follower will click"); ImGui.TextDisabled("This takes \"Random click offset\" into account"); DebugGenerateOnHoverEvents.Value = ImGuiExtension.HotkeySelector("Generate OnHover", DebugGenerateOnHoverEvents); ImGui.Spacing(); DebugShowRadius.Value = ImGuiExtension.Checkbox("Debug: show radius", DebugShowRadius); } ImGui.Spacing(); Profiles.Value = ImGuiExtension.ComboBox("Profiles", Profiles.Value, Profiles.Values); ImGui.Spacing(); ImGui.Spacing(); RandomClickOffset.Value = ImGuiExtension.IntSlider("Random click offset", RandomClickOffset); ImGuiExtension.ToolTipWithText("(?)", "Will randomly offset X and Y coords by - or + of this value"); ImGui.Separator(); ImGui.Spacing(); ImGui.Spacing(); ImGui.SameLine(); ImGui.TextDisabled("***** "); ImGui.SameLine(); if (ImGui.Button("Reset settings to defaults")) { ResetToDefaultsButton.OnPressed(); } ImGui.SameLine(); ImGui.TextDisabled(" *****"); ImGui.Spacing(); ImGui.Spacing(); if (Profiles.Value == ProfilesEnum.Follower) { if (ImGui.TreeNodeEx("Follower Mode Settings", collapsingHeaderFlags)) { FollowerModeSettings.FollowerModes.Value = ImGuiExtension.ComboBox("Follower modes", FollowerModeSettings.FollowerModes.Value, FollowerModeSettings.FollowerModes.Values); if (FollowerModeSettings.FollowerModes.Value == FollowerNetworkActivityModeEnum.Local) { ImGui.TextDisabled("This mode will NOT do any network requests and will use ONLY settings values"); ImGui.Spacing(); ImGui.Spacing(); FollowerModeSettings.LeaderName.Value = ImGuiExtension.InputText("Leader name", FollowerModeSettings.LeaderName); ImGuiExtension.ToolTipWithText("(?)", "Provide character's name this player will follow"); if (NearbyPlayers.Values.Any()) { NearbyPlayers.Value = ImGuiExtension.ComboBox("Use party member as leader", NearbyPlayers.Value, NearbyPlayers.Values); if (!String.IsNullOrEmpty(NearbyPlayers.Value)) { if (ImGui.Button("Set as selected as leader")) { FollowerModeSettings.UseNearbyPlayerAsLeaderButton.OnPressed(); } } } // TODO: Implement this later //FollowerModeSettings.FollowerUseCombat.Value = ImGuiExtension.Checkbox("Use Combat", FollowerModeSettings.FollowerUseCombat); //ImGuiExtension.ToolTipWithText("(?)", "This player will use combat routines"); ImGui.Spacing(); FollowerModeSettings.LeaderProximityRadius.Value = ImGuiExtension.IntSlider("Leader prox. radius", FollowerModeSettings.LeaderProximityRadius); ImGuiExtension.ToolTipWithText("(?)", "Set \"Debug: show radius\" on to see the radius"); ImGuiExtension.ToolTipWithText("(?)", "Color: Red"); } else if (FollowerModeSettings.FollowerModes.Value == FollowerNetworkActivityModeEnum.Network) { ImGui.TextDisabled("This mode will make network requests and use ONLY values from the server"); ImGui.TextDisabled("All local values are disabled and will not be used"); ImGui.TextDisabled("P.S. On server you might want to use something such as \"ngrok\" or \"localtunnel\""); ImGui.TextDisabled(" if your server is outside of localhost"); ImGui.Spacing(); ImGui.Spacing(); FollowerModeSettings.FollowerModeNetworkSettings.Url.Value = ImGuiExtension.InputText("Server URL", FollowerModeSettings.FollowerModeNetworkSettings.Url); ImGuiExtension.ToolTipWithText("(?)", "Provide the URL this follower will connect"); FollowerModeSettings.FollowerModeNetworkSettings.DelayBetweenRequests.Value = ImGuiExtension.IntSlider("Request delay", FollowerModeSettings.FollowerModeNetworkSettings.DelayBetweenRequests); ImGui.Spacing(); FollowerModeSettings.FollowerModeNetworkSettings.RequestTimeoutMs.Value = ImGuiExtension.IntSlider("Request timeout ms", FollowerModeSettings.FollowerModeNetworkSettings.RequestTimeoutMs); ImGui.Spacing(); ImGui.Spacing(); FollowerModeSettings.StartNetworkRequesting.Value = ImGuiExtension.Checkbox("Start network requesting", FollowerModeSettings.StartNetworkRequesting); FollowerModeSettings.StartNetworkRequestingHotkey.Value = ImGuiExtension.HotkeySelector("Hotkey to start network requesting", FollowerModeSettings.StartNetworkRequestingHotkey); ImGui.Spacing(); } ImGui.Spacing(); ImGui.Separator(); //ImGui.TreePop(); } } if (Profiles.Value == ProfilesEnum.Leader) { if (ImGui.TreeNodeEx("Leader Mode Settings", collapsingHeaderFlags)) { FollowerModeSettings.FollowerModes.Value = ImGuiExtension.ComboBox("Follower modes", FollowerModeSettings.FollowerModes.Value, FollowerModeSettings.FollowerModes.Values); if (FollowerModeSettings.FollowerModes.Value == FollowerNetworkActivityModeEnum.Local) { ImGui.TextDisabled("Local mode for leader does not contain any settings"); } else if (FollowerModeSettings.FollowerModes.Value == FollowerNetworkActivityModeEnum.Network) { ImGui.TextDisabled("This is the network mode for LEADER"); ImGui.TextDisabled($"Server will run on port \"{LeaderModeSettings.ServerPort.Value}\""); ImGui.TextDisabled($" hostname: {LeaderModeSettings.ServerHostname.Value}"); ImGui.Spacing(); ImGui.Spacing(); LeaderModeSettings.LeaderNameToPropagate.Value = ImGuiExtension.InputText("Leader FollowerName To Propagate", LeaderModeSettings.LeaderNameToPropagate); ImGui.Spacing(); if (ImGui.Button("Set myself as leader")) { LeaderModeSettings.SetMyselfAsLeader.OnPressed(); } ImGui.Spacing(); LeaderModeSettings.StartServer.Value = ImGuiExtension.Checkbox("Start Server Listening", LeaderModeSettings.StartServer); ImGui.Spacing(); LeaderModeSettings.PropagateWorkingOfFollowers.Value = ImGuiExtension.Checkbox("Propagate working of followers", LeaderModeSettings.PropagateWorkingOfFollowers); LeaderModeSettings.PropagateWorkingOfFollowersHotkey.Value = ImGuiExtension.HotkeySelector("Hotkey to propagate working of follower", LeaderModeSettings.PropagateWorkingOfFollowersHotkey); ImGui.Spacing(); ImGui.Spacing(); LeaderModeSettings.LeaderProximityRadiusToPropagate.Value = ImGuiExtension.IntSlider("Leader proximity radius", LeaderModeSettings.LeaderProximityRadiusToPropagate); ImGuiExtension.ToolTipWithText("(?)", "Set \"Debug: show radius\" on to see the radius"); ImGuiExtension.ToolTipWithText("(?)", "Color: Yellow"); if (ImGui.TreeNodeEx("Follower command settings")) { ImGui.Spacing(); ImGui.Spacing(); ImGui.TextDisabled("Add here new slaves to command them using the server"); ImGui.Spacing(); LeaderModeSettings.NewFollowerCommandClassSetting.FollowerName.Value = ImGuiExtension.InputText("Slave's name", LeaderModeSettings.NewFollowerCommandClassSetting.FollowerName); ImGui.Spacing(); NearbyPlayers.Value = ImGuiExtension.ComboBox("Use nearby player's name", NearbyPlayers.Value, NearbyPlayers.Values); ImGui.Spacing(); if (ImGui.Button("Set selected value")) { LeaderModeSettings.NewFollowerCommandClassSetting.UseNearbyPlayerNameButton.OnPressed(); } ImGui.Spacing(); ImGui.Spacing(); if (ImGui.Button("Add new slave")) { LeaderModeSettings.NewFollowerCommandClassSetting.AddNewFollowerButton.OnPressed(); } ImGui.Spacing(); } if (ImGui.TreeNodeEx("Advanced leader mode settings")) { ImGui.TextDisabled("Remember to restart the server if you have changed the port or the hostname"); ImGui.TextDisabled(" run \"netsh http add urlacl url=http://HOSTNAME:PORT/\" user=YOUR_USER"); ImGui.TextDisabled(" example \"netsh http add urlacl url=http://+:4412/\" user=YOUR_USER"); ImGui.TextDisabled(" if you have changed your hostname"); ImGui.TextDisabled(" allow the inbound connection on the port in firewall as well"); LeaderModeSettings.ServerHostname.Value = ImGuiExtension.InputText("Server Hostname", LeaderModeSettings.ServerHostname); LeaderModeSettings.ServerPort.Value = ImGuiExtension.InputText("Server Port", LeaderModeSettings.ServerPort); ImGui.Spacing(); ImGui.TextDisabled("Server management"); ImGui.Spacing(); ImGui.SameLine(); if (ImGui.Button("Restart Server")) { LeaderModeSettings.ServerRestart.OnPressed(); } ImGui.SameLine(); if (ImGui.Button("Stop Server")) { LeaderModeSettings.ServerStop.OnPressed(); } ImGui.Spacing(); } } ImGui.Spacing(); ImGui.Separator(); //ImGui.TreePop(); } } }
public static bool TreeNodeEx(string label, ImGuiTreeNodeFlags flags, string fmt) => TreeNodeExStrStr(label, flags, fmt);
public override void DrawSettings() { //base.DrawSettings(); ImGuiTreeNodeFlags collapsingHeaderFlags = ImGuiTreeNodeFlags.CollapsingHeader; if (ImGui.TreeNodeEx("Plugin Options", collapsingHeaderFlags)) { Settings.EnableInHideout.Value = ImGuiExtension.Checkbox("Enable in Hideout", Settings.EnableInHideout); ImGui.Separator(); Settings.TicksPerSecond.Value = ImGuiExtension.IntSlider("Ticks Per Second", Settings.TicksPerSecond); ImGuiExtension.ToolTipWithText("(?)", "Determines how many times the plugin checks flasks every second.\nLower for less resources, raise for faster response (but higher chance to chug potions)."); ImGui.Separator(); Settings.Debug.Value = ImGuiExtension.Checkbox("Debug Mode", Settings.Debug); ImGui.Separator(); Settings.BossingModeToggle.Value = ImGuiExtension.Checkbox("Disable Defensive and Offensive Flasking", Settings.BossingModeToggle); ImGui.Separator(); Settings.BossingModeHotkey.Value = ImGuiExtension.HotkeySelector("BossingModeHotkey", Settings.BossingModeHotkey.Value); ImGui.TreePop(); } if (ImGui.TreeNodeEx("Flask Options", collapsingHeaderFlags)) { if (ImGui.TreeNode("Individual Flask Settings")) { for (int i = 0; i < 5; i++) { FlaskSetting currentFlask = Settings.FlaskSettings[i]; if (ImGui.TreeNode("Flask " + (i + 1) + " Settings")) { currentFlask.Enabled.Value = ImGuiExtension.Checkbox("Enable", currentFlask.Enabled); currentFlask.Hotkey.Value = ImGuiExtension.HotkeySelector("Hotkey", currentFlask.Hotkey); currentFlask.ReservedUses.Value = ImGuiExtension.IntSlider("Reserved Uses", currentFlask.ReservedUses); ImGuiExtension.ToolTipWithText("(?)", "The absolute number of uses reserved on a flask.\nSet to 1 to always have 1 use of the flask available for manual use."); ImGui.TreePop(); } } ImGui.TreePop(); } if (ImGui.TreeNode("Health and Mana")) { Settings.AutoFlask.Value = ImGuiExtension.Checkbox("Enable", Settings.AutoFlask); ImGuiExtension.SpacedTextHeader("Settings"); Settings.ForceBubblingAsInstantOnly.Value = ImGuiExtension.Checkbox("Force Bubbling as Instant only", Settings.ForceBubblingAsInstantOnly); ImGuiExtension.ToolTipWithText("(?)", "When enabled, flasks with the Bubbling mod will only be used as an instant flask."); Settings.ForcePanickedAsInstantOnly.Value = ImGuiExtension.Checkbox("Force Panicked as Instant only", Settings.ForcePanickedAsInstantOnly); ImGuiExtension.ToolTipWithText("(?)", "When enabled, flasks with the Panicked mod will only be used as an instant flask. \nNote, Panicked will not be used until under 35%% with this enabled."); // ImGuiExtension.SpacedTextHeader("Health Flask"); Settings.HPPotion.Value = ImGuiExtension.IntSlider("Min Life % Auto HP Flask", Settings.HPPotion); Settings.InstantHPPotion.Value = ImGuiExtension.IntSlider("Min Life % Auto Instant HP Flask", Settings.InstantHPPotion); Settings.DisableLifeSecUse.Value = ImGuiExtension.Checkbox("Disable Life/Hybrid Flask Offensive/Defensive Usage", Settings.DisableLifeSecUse); ImGuiExtension.SpacedTextHeader("Mana Flask"); ImGui.Spacing(); Settings.ManaPotion.Value = ImGuiExtension.IntSlider("Min Mana % Auto Mana Flask", Settings.ManaPotion); Settings.InstantManaPotion.Value = ImGuiExtension.IntSlider("Min Mana % Auto Instant MP Flask", Settings.InstantManaPotion); Settings.MinManaFlask.Value = ImGuiExtension.IntSlider("Min Mana Auto Mana Flask", Settings.MinManaFlask); ImGui.TreePop(); } if (ImGui.TreeNode("Remove Ailments")) { Settings.RemAilment.Value = ImGuiExtension.Checkbox("Enable", Settings.RemAilment); ImGuiExtension.SpacedTextHeader("Ailments"); Settings.RemFrozen.Value = ImGuiExtension.Checkbox("Frozen", Settings.RemFrozen); ImGui.SameLine(); Settings.RemBurning.Value = ImGuiExtension.Checkbox("Burning", Settings.RemBurning); Settings.RemShocked.Value = ImGuiExtension.Checkbox("Shocked", Settings.RemShocked); ImGui.SameLine(); Settings.RemCurse.Value = ImGuiExtension.Checkbox("Cursed", Settings.RemCurse); Settings.RemPoison.Value = ImGuiExtension.Checkbox("Poison", Settings.RemPoison); ImGui.SameLine(); Settings.RemBleed.Value = ImGuiExtension.Checkbox("Bleed", Settings.RemBleed); Settings.CorruptCount.Value = ImGuiExtension.IntSlider("Corrupting Blood Stacks", Settings.CorruptCount); ImGui.TreePop(); } if (ImGui.TreeNode("Speed Flasks")) { Settings.SpeedFlaskEnable.Value = ImGuiExtension.Checkbox("Enable", Settings.SpeedFlaskEnable); ImGuiExtension.SpacedTextHeader("Flasks"); Settings.QuicksilverFlaskEnable.Value = ImGuiExtension.Checkbox("Quicksilver Flask", Settings.QuicksilverFlaskEnable); Settings.SilverFlaskEnable.Value = ImGuiExtension.Checkbox("Silver Flask", Settings.SilverFlaskEnable); ImGuiExtension.SpacedTextHeader("Settings"); Settings.MinMsPlayerMoving.Value = ImGuiExtension.IntSlider("Milliseconds Spent Moving", Settings.MinMsPlayerMoving); ImGuiExtension.ToolTipWithText("(?)", "Milliseconds spent moving before flask will be used.\n1000 milliseconds = 1 second"); ImGui.TreePop(); } if (ImGui.TreeNode("Defensive Flasks")) { Settings.DefensiveFlaskEnable.Value = ImGuiExtension.Checkbox("Enable", Settings.DefensiveFlaskEnable); ImGui.Spacing(); ImGui.Separator(); Settings.HPPercentDefensive.Value = ImGuiExtension.IntSlider("Min Life %", Settings.HPPercentDefensive); Settings.ESPercentDefensive.Value = ImGuiExtension.IntSlider("Min ES %", Settings.ESPercentDefensive); Settings.OffensiveAsDefensiveEnable.Value = ImGuiExtension.Checkbox("Use offensive flasks for defense", Settings.OffensiveAsDefensiveEnable); ImGui.Separator(); Settings.DefensiveMonsterCount.Value = ImGuiExtension.IntSlider("Monster Count", Settings.DefensiveMonsterCount); Settings.DefensiveMonsterDistance.Value = ImGuiExtension.IntSlider("Monster Distance", Settings.DefensiveMonsterDistance); Settings.DefensiveCountNormalMonsters.Value = ImGuiExtension.Checkbox("Normal Monsters", Settings.DefensiveCountNormalMonsters); Settings.DefensiveCountRareMonsters.Value = ImGuiExtension.Checkbox("Rare Monsters", Settings.DefensiveCountRareMonsters); Settings.DefensiveCountMagicMonsters.Value = ImGuiExtension.Checkbox("Magic Monsters", Settings.DefensiveCountMagicMonsters); Settings.DefensiveCountUniqueMonsters.Value = ImGuiExtension.Checkbox("Unique Monsters", Settings.DefensiveCountUniqueMonsters); Settings.DefensiveIgnoreFullHealthUniqueMonsters.Value = ImGuiExtension.Checkbox("Ignore Full Health Unique Monsters", Settings.DefensiveIgnoreFullHealthUniqueMonsters); ImGui.TreePop(); } if (ImGui.TreeNode("Offensive Flasks")) { Settings.OffensiveFlaskEnable.Value = ImGuiExtension.Checkbox("Enable", Settings.OffensiveFlaskEnable); ImGui.Spacing(); ImGui.Separator(); Settings.HPPercentOffensive.Value = ImGuiExtension.IntSlider("Min Life %", Settings.HPPercentOffensive); Settings.ESPercentOffensive.Value = ImGuiExtension.IntSlider("Min ES %", Settings.ESPercentOffensive); ImGui.Separator(); Settings.OffensiveMonsterCount.Value = ImGuiExtension.IntSlider("Monster Count", Settings.OffensiveMonsterCount); Settings.OffensiveMonsterDistance.Value = ImGuiExtension.IntSlider("Monster Distance", Settings.OffensiveMonsterDistance); Settings.OffensiveCountNormalMonsters.Value = ImGuiExtension.Checkbox("Normal Monsters", Settings.OffensiveCountNormalMonsters); Settings.OffensiveCountRareMonsters.Value = ImGuiExtension.Checkbox("Rare Monsters", Settings.OffensiveCountRareMonsters); Settings.OffensiveCountMagicMonsters.Value = ImGuiExtension.Checkbox("Magic Monsters", Settings.OffensiveCountMagicMonsters); Settings.OffensiveCountUniqueMonsters.Value = ImGuiExtension.Checkbox("Unique Monsters", Settings.OffensiveCountUniqueMonsters); Settings.OffensiveIgnoreFullHealthUniqueMonsters.Value = ImGuiExtension.Checkbox("Ignore Full Health Unique Monsters", Settings.OffensiveIgnoreFullHealthUniqueMonsters); ImGui.TreePop(); } ImGui.TreePop(); } }
public static bool TreeNodeEx(string label, ImGuiTreeNodeFlags flags = 0) => ImGuiNative.igTreeNodeEx(label, flags);
public static bool CollapsingHeader(string label, ref bool p_visible, ImGuiTreeNodeFlags flags = ImGuiTreeNodeFlags.None) => CollapsingHeaderBoolPtr(label, ref p_visible, flags);
public void DrawSettings() { ImGuiTreeNodeFlags collapsingHeaderFlags = ImGuiTreeNodeFlags.CollapsingHeader; Debug.Value = ImGuiExtension.Checkbox("Debug", Debug); ImGui.Spacing(); if (Debug.Value) { VerboseDebug.Value = ImGuiExtension.Checkbox("Extra Verbose Debug", VerboseDebug); ImGui.Spacing(); ImGui.TextDisabled("Hotkey to randomly generate On Hover events"); ImGui.TextDisabled("This will help to see where follower will click"); ImGui.TextDisabled("This takes \"Random click offset\" into account"); DebugGenerateOnHoverEvents.Value = ImGuiExtension.HotkeySelector("Generate OnHover", DebugGenerateOnHoverEvents); ImGui.Spacing(); DebugShowRadius.Value = ImGuiExtension.Checkbox("Debug: show radius", DebugShowRadius); } ImGui.Spacing(); Profiles.Value = ImGuiExtension.ComboBox("Profiles", Profiles.Value, Profiles.Values); ImGui.Spacing(); ImGui.Spacing(); RandomClickOffset.Value = ImGuiExtension.IntSlider("Random click offset", RandomClickOffset); ImGuiExtension.ToolTipWithText("(?)", "Will randomly offset X and Y coords by - or + of this value"); ImGui.Separator(); ImGui.Spacing(); ImGui.Spacing(); ImGui.SameLine(); ImGui.TextDisabled("***** "); ImGui.SameLine(); if (ImGui.Button("Reset settings to defaults")) { ResetToDefaultsButton.OnPressed(); } ImGui.SameLine(); ImGui.TextDisabled(" *****"); ImGui.Spacing(); ImGui.Spacing(); if (Profiles.Value == ProfilesEnum.Follower) { if (ImGui.TreeNodeEx("Follower Mode Settings", collapsingHeaderFlags)) { FollowerModeSettings.FollowerModes.Value = ImGuiExtension.ComboBox("Follower modes", FollowerModeSettings.FollowerModes.Value, FollowerModeSettings.FollowerModes.Values); if (FollowerModeSettings.FollowerModes.Value == FollowerNetworkActivityModeEnum.Local) { ImGui.TextDisabled("This mode will NOT do any network requests and will use ONLY settings values"); ImGui.Spacing(); ImGui.Spacing(); FollowerModeSettings.LeaderName.Value = ImGuiExtension.InputText("Leader name", FollowerModeSettings.LeaderName); ImGuiExtension.ToolTipWithText("(?)", "Provide character's name this player will follow"); if (NearbyPlayers.Values.Any()) { NearbyPlayers.Value = ImGuiExtension.ComboBox("Use nearby member as leader", NearbyPlayers.Value, NearbyPlayers.Values); if (!String.IsNullOrEmpty(NearbyPlayers.Value)) { if (ImGui.Button("Set as selected as leader")) { FollowerModeSettings.UseNearbyPlayerAsLeaderButton.OnPressed(); } } } FollowerModeSettings.FollowerShouldWork.Value = ImGuiExtension.Checkbox("Start follower", FollowerModeSettings.FollowerShouldWork); // TODO: Implement this later //FollowerModeSettings.FollowerUseCombat.Value = ImGuiExtension.Checkbox("Use Combat", FollowerModeSettings.FollowerUseCombat); //ImGuiExtension.ToolTipWithText("(?)", "This player will use combat routines"); ImGui.Spacing(); FollowerModeSettings.LeaderProximityRadius.Value = ImGuiExtension.IntSlider("Leader prox. radius", FollowerModeSettings.LeaderProximityRadius); ImGuiExtension.ToolTipWithText("(?)", "Set \"Debug: show radius\" on to see the radius"); ImGuiExtension.ToolTipWithText("(?)", "Color: Red"); } else if (FollowerModeSettings.FollowerModes.Value == FollowerNetworkActivityModeEnum.Network) { ImGui.TextDisabled("This mode will make network requests and use ONLY values from the server"); ImGui.TextDisabled("All local values are disabled and will not be used"); ImGui.TextDisabled("P.S. On server you might want to use something such as \"ngrok\" or \"localtunnel\""); ImGui.TextDisabled(" if your server is outside of localhost"); ImGui.Spacing(); ImGui.Spacing(); FollowerModeSettings.FollowerModeNetworkSettings.Url.Value = ImGuiExtension.InputText("Server URL", FollowerModeSettings.FollowerModeNetworkSettings.Url); ImGuiExtension.ToolTipWithText("(?)", "Provide the URL this follower will connect"); FollowerModeSettings.FollowerModeNetworkSettings.DelayBetweenRequests.Value = ImGuiExtension.IntSlider("Request delay", FollowerModeSettings.FollowerModeNetworkSettings.DelayBetweenRequests); ImGui.Spacing(); FollowerModeSettings.FollowerModeNetworkSettings.RequestTimeoutMs.Value = ImGuiExtension.IntSlider("Request timeout ms", FollowerModeSettings.FollowerModeNetworkSettings.RequestTimeoutMs); ImGui.Spacing(); ImGui.Spacing(); FollowerModeSettings.StartNetworkRequesting.Value = ImGuiExtension.Checkbox("Start network requesting", FollowerModeSettings.StartNetworkRequesting); FollowerModeSettings.StartNetworkRequestingHotkey.Value = ImGuiExtension.HotkeySelector("Hotkey to start network requesting", FollowerModeSettings.StartNetworkRequestingHotkey); ImGui.Spacing(); ImGui.Spacing(); ImGui.TextDisabled("The next hotkey will be used for moving. Follower will click it after hovering"); FollowerModeSettings.MoveHotkey.Value = ImGuiExtension.HotkeySelector("Move hotkey", FollowerModeSettings.MoveHotkey); ImGui.Spacing(); ImGui.TextDisabled("The delay to \"sleep\" between following logic iterations"); FollowerModeSettings.MoveLogicCooldown.Value = ImGuiExtension.IntSlider("Following logic cooldown", FollowerModeSettings.MoveLogicCooldown); } ImGui.Spacing(); ImGui.Separator(); //ImGui.TreePop(); } } if (Profiles.Value == ProfilesEnum.Leader) { if (ImGui.TreeNodeEx("Leader Mode Settings", collapsingHeaderFlags)) { FollowerModeSettings.FollowerModes.Value = ImGuiExtension.ComboBox("Follower modes", FollowerModeSettings.FollowerModes.Value, FollowerModeSettings.FollowerModes.Values); if (FollowerModeSettings.FollowerModes.Value == FollowerNetworkActivityModeEnum.Local) { ImGui.TextDisabled("Local mode for leader does not contain any settings"); } else if (FollowerModeSettings.FollowerModes.Value == FollowerNetworkActivityModeEnum.Network) { ImGui.TextDisabled("This is the network mode for LEADER"); ImGui.TextDisabled($"Server will run on port \"{LeaderModeSettings.ServerPort.Value}\""); ImGui.TextDisabled($" hostname: {LeaderModeSettings.ServerHostname.Value}"); ImGui.Spacing(); ImGui.Spacing(); LeaderModeSettings.LeaderNameToPropagate.Value = ImGuiExtension.InputText("Leader FollowerName To Propagate", LeaderModeSettings.LeaderNameToPropagate); ImGui.Spacing(); if (ImGui.Button("Set myself as leader")) { LeaderModeSettings.SetMyselfAsLeader.OnPressed(); } ImGui.Spacing(); LeaderModeSettings.StartServer.Value = ImGuiExtension.Checkbox("Start Server Listening", LeaderModeSettings.StartServer); ImGui.Spacing(); LeaderModeSettings.PropagateWorkingOfFollowers.Value = ImGuiExtension.Checkbox("Propagate working of followers", LeaderModeSettings.PropagateWorkingOfFollowers); LeaderModeSettings.PropagateWorkingOfFollowersHotkey.Value = ImGuiExtension.HotkeySelector("Hotkey to propagate working of follower", LeaderModeSettings.PropagateWorkingOfFollowersHotkey); ImGui.Spacing(); ImGui.Spacing(); LeaderModeSettings.LeaderProximityRadiusToPropagate.Value = ImGuiExtension.IntSlider("Leader proximity radius", LeaderModeSettings.LeaderProximityRadiusToPropagate); ImGuiExtension.ToolTipWithText("(?)", "Set \"Debug: show radius\" on to see the radius"); ImGuiExtension.ToolTipWithText("(?)", "Color: Yellow"); if (ImGui.TreeNodeEx("Follower command settings")) { ImGui.Spacing(); ImGui.Spacing(); ImGui.TextDisabled("Add here new slaves to command them using the server"); ImGui.Spacing(); LeaderModeSettings.NewFollowerCommandClassSetting.FollowerName.Value = ImGuiExtension.InputText("Slave's name", LeaderModeSettings.NewFollowerCommandClassSetting.FollowerName); ImGui.Spacing(); NearbyPlayers.Value = ImGuiExtension.ComboBox("Use nearby player's name", NearbyPlayers.Value, NearbyPlayers.Values); ImGui.Spacing(); if (ImGui.Button("Set selected value")) { LeaderModeSettings.NewFollowerCommandClassSetting.UseNearbyPlayerNameButton.OnPressed(); } ImGui.Spacing(); ImGui.Spacing(); if (ImGui.Button("Add new slave")) { LeaderModeSettings.NewFollowerCommandClassSetting.AddNewFollowerButton.OnPressed(); } ImGui.Spacing(); } if (LeaderModeSettings.FollowerCommandSetting.FollowerCommandsDataSet.Any()) { foreach (var follower in LeaderModeSettings.FollowerCommandSetting.FollowerCommandsDataSet) { if (ImGui.TreeNodeEx($"Follower \"{follower.FollowerName}\" settings##{follower.FollowerName}")) { string imguiId = follower.FollowerName; ImGui.TextDisabled($"****** Other settings ******"); ImGui.Spacing(); ImGui.Spacing(); follower.ShouldLevelUpGems = ImGuiExtension.Checkbox($"Level up gems##{imguiId}", follower.ShouldLevelUpGems); ImGui.TextDisabled($"****** Skill settings ******"); if (ImGui.Button($"Add new skill##{follower.FollowerName}")) { follower.AddNewEmptySkill(); } ImGui.Spacing(); ImGui.Spacing(); foreach (FollowerSkill skill in follower.FollowerSkills) { ImGui.TextDisabled($"------ Skill (id: {skill.Id}) ------"); skill.Enable = ImGuiExtension.Checkbox($"Enable##{imguiId}", skill.Enable); ImGui.SameLine(); ImGui.TextDisabled(" "); ImGui.SameLine(); if (ImGui.Button($"Remove##{imguiId}")) { follower.RemoveSkill(skill.Id); } ImGui.Spacing(); skill.Hotkey = ImGuiExtension.HotkeySelector($"Hotkey: {skill.Hotkey}##{imguiId}", skill.Hotkey); ImGui.Spacing(); ImGui.SliderInt($"Priority##{imguiId}", ref skill.Priority, 1, 5); ImGui.Spacing(); skill.IsMovingSkill = ImGuiExtension.Checkbox($"Is moving skill##{imguiId}", skill.IsMovingSkill); ImGui.Spacing(); ImGui.SliderInt($"Skill cooldown in ms##{imguiId}", ref skill.CooldownMs, 100, 10000); ImGui.Spacing(); if (!skill.IsMovingSkill) { ImGui.SliderInt($"Max range to monsters##{imguiId}", ref skill.MaxRangeToMonsters, 10, 200); ImGui.Spacing(); } } if (follower.FollowerSkills.Any()) { ImGui.TextDisabled("-----------"); } ImGui.Spacing(); } } } if (ImGui.TreeNodeEx("Advanced leader mode settings")) { ImGui.TextDisabled("Remember to restart the server if you have changed the port or the hostname"); ImGui.TextDisabled(" run \"netsh http add urlacl url=http://HOSTNAME:PORT/\" user=YOUR_USER"); ImGui.TextDisabled(" example \"netsh http add urlacl url=http://+:4412/\" user=YOUR_USER"); ImGui.TextDisabled(" if you have changed your hostname"); ImGui.TextDisabled(" allow the inbound connection on the port in firewall as well"); LeaderModeSettings.ServerHostname.Value = ImGuiExtension.InputText("Server Hostname", LeaderModeSettings.ServerHostname); LeaderModeSettings.ServerPort.Value = ImGuiExtension.InputText("Server Port", LeaderModeSettings.ServerPort); ImGui.Spacing(); ImGui.TextDisabled("Server management"); ImGui.Spacing(); ImGui.SameLine(); if (ImGui.Button("Restart Server")) { LeaderModeSettings.ServerRestart.OnPressed(); } ImGui.SameLine(); if (ImGui.Button("Stop Server")) { LeaderModeSettings.ServerStop.OnPressed(); } ImGui.Spacing(); } } ImGui.Spacing(); ImGui.Separator(); //ImGui.TreePop(); } } }
public static bool TreeNodeEx(string label, ImGuiTreeNodeFlags flags = ImGuiTreeNodeFlags.None) => TreeNodeExStr(label, flags);
public void UpdateUI() { const int MenuWidth = 180; if (_game.DebugDrawer.ShowUI) { _game.Test.Render(); ImGui.SetNextWindowPos(new Vector2((float)Global.Camera.Width - MenuWidth - 10, 10)); ImGui.SetNextWindowSize(new Vector2(MenuWidth, (float)Global.Camera.Height - 20)); ImGui.Begin("Tools", ref _game.DebugDrawer.ShowUI, ImGuiWindowFlags.NoMove | ImGuiWindowFlags.NoResize | ImGuiWindowFlags.NoCollapse); if (ImGui.BeginTabBar("ControlTabs", ImGuiTabBarFlags.None)) { if (ImGui.BeginTabItem("Controls")) { ImGui.SliderInt("Vel Iters", ref Global.Settings.VelocityIterations, 0, 50); ImGui.SliderInt("Pos Iters", ref Global.Settings.PositionIterations, 0, 50); ImGui.SliderFloat("Hertz", ref Global.Settings.Hertz, 5.0f, 120.0f, "%.0f hz"); ImGui.Separator(); ImGui.Checkbox("Sleep", ref Global.Settings.EnableSleep); ImGui.Checkbox("Warm Starting", ref Global.Settings.EnableWarmStarting); ImGui.Checkbox("Time of Impact", ref Global.Settings.EnableContinuous); ImGui.Checkbox("Sub-Stepping", ref Global.Settings.EnableSubStepping); ImGui.Separator(); ImGui.Checkbox("Shapes", ref Global.Settings.DrawShapes); ImGui.Checkbox("Joints", ref Global.Settings.DrawJoints); ImGui.Checkbox("AABBs", ref Global.Settings.DrawAABBs); ImGui.Checkbox("Contact Points", ref Global.Settings.DrawContactPoints); ImGui.Checkbox("Contact Normals", ref Global.Settings.DrawContactNormals); ImGui.Checkbox("Contact Impulses", ref Global.Settings.DrawContactImpulse); ImGui.Checkbox("Friction Impulses", ref Global.Settings.DrawFrictionImpulse); ImGui.Checkbox("Center of Masses", ref Global.Settings.DrawCOMs); ImGui.Checkbox("Statistics", ref Global.Settings.DrawStats); ImGui.Checkbox("Profile", ref Global.Settings.DrawProfile); var buttonSz = new Vector2(-1, 0); if (ImGui.Button("Pause (P)", buttonSz)) { Global.Settings.Pause = !Global.Settings.Pause; } if (ImGui.Button("Single Step (O)", buttonSz)) { Global.Settings.SingleStep = !Global.Settings.SingleStep; } if (ImGui.Button("Restart (R)", buttonSz)) { _game.RestartTest(); } if (ImGui.Button("Quit", buttonSz)) { Application.Quit(); } ImGui.EndTabItem(); } var leafNodeFlags = ImGuiTreeNodeFlags.OpenOnArrow | ImGuiTreeNodeFlags.OpenOnDoubleClick; leafNodeFlags |= ImGuiTreeNodeFlags.Leaf | ImGuiTreeNodeFlags.NoTreePushOnOpen; const ImGuiTreeNodeFlags NodeFlags = ImGuiTreeNodeFlags.OpenOnArrow | ImGuiTreeNodeFlags.OpenOnDoubleClick; if (ImGui.BeginTabItem("Tests")) { var categoryIndex = 0; var category = Global.Tests[categoryIndex].Category; var i = 0; while (i < Global.Tests.Count) { var categorySelected = string.CompareOrdinal(category, Global.Tests[Global.Settings.TestIndex].Category) == 0; var nodeSelectionFlags = categorySelected ? ImGuiTreeNodeFlags.Selected : 0; var nodeOpen = ImGui.TreeNodeEx(category, NodeFlags | nodeSelectionFlags); if (nodeOpen) { while (i < Global.Tests.Count && string.CompareOrdinal(category, Global.Tests[i].Category) == 0) { ImGuiTreeNodeFlags selectionFlags = 0; if (Global.Settings.TestIndex == i) { selectionFlags = ImGuiTreeNodeFlags.Selected; } ImGui.TreeNodeEx((IntPtr)i, leafNodeFlags | selectionFlags, Global.Tests[i].Name); if (ImGui.IsItemClicked()) { _game.SetTest(i); } ++i; } ImGui.TreePop(); } else { while (i < Global.Tests.Count && string.CompareOrdinal(category, Global.Tests[i].Category) == 0) { ++i; } } if (i < Global.Tests.Count) { category = Global.Tests[i].Category; categoryIndex = i; } } ImGui.EndTabItem(); } ImGui.EndTabBar(); } ImGui.End(); } }
public static bool TreeNodeEx(IntPtr ptr_id, ImGuiTreeNodeFlags flags, string fmt) => TreeNodeExPtr(ptr_id, flags, fmt);
internal static void DrawImGuiSettings() { System.Numerics.Vector4 green = new System.Numerics.Vector4(0.102f, 0.388f, 0.106f, 1.000f); System.Numerics.Vector4 red = new System.Numerics.Vector4(0.388f, 0.102f, 0.102f, 1.000f); ImGuiTreeNodeFlags collapsingHeaderFlags = ImGuiTreeNodeFlags.CollapsingHeader; ImGui.Text("Plugin by Totalschaden. https://github.com/totalschaden/copilot"); try { // Input Keys ImGui.PushStyleColor(ImGuiCol.Header, green); ImGui.PushID(1000); if (ImGui.TreeNodeEx("Input Keys", collapsingHeaderFlags)) { CoPilot.instance.Settings.InputKey1.Value = ImGuiExtension.HotkeySelector("Use bound skill 2 Key: " + CoPilot.instance.Settings.InputKey1.Value, CoPilot.instance.Settings.InputKey1.Value); CoPilot.instance.Settings.InputKey3.Value = ImGuiExtension.HotkeySelector("Use bound skill 4 Key: " + CoPilot.instance.Settings.InputKey3.Value, CoPilot.instance.Settings.InputKey3.Value); CoPilot.instance.Settings.InputKey4.Value = ImGuiExtension.HotkeySelector("Use bound skill 5 Key: " + CoPilot.instance.Settings.InputKey4.Value, CoPilot.instance.Settings.InputKey4.Value); CoPilot.instance.Settings.InputKey5.Value = ImGuiExtension.HotkeySelector("Use bound skill 6 Key: " + CoPilot.instance.Settings.InputKey5.Value, CoPilot.instance.Settings.InputKey5.Value); CoPilot.instance.Settings.InputKey6.Value = ImGuiExtension.HotkeySelector("Use bound skill 7 Key: " + CoPilot.instance.Settings.InputKey6.Value, CoPilot.instance.Settings.InputKey6.Value); CoPilot.instance.Settings.InputKey7.Value = ImGuiExtension.HotkeySelector("Use bound skill 8 Key: " + CoPilot.instance.Settings.InputKey7.Value, CoPilot.instance.Settings.InputKey7.Value); CoPilot.instance.Settings.InputKey8.Value = ImGuiExtension.HotkeySelector("Use bound skill 9 Key: " + CoPilot.instance.Settings.InputKey8.Value, CoPilot.instance.Settings.InputKey8.Value); CoPilot.instance.Settings.InputKey9.Value = ImGuiExtension.HotkeySelector("Use bound skill 10 Key: " + CoPilot.instance.Settings.InputKey9.Value, CoPilot.instance.Settings.InputKey9.Value); CoPilot.instance.Settings.InputKey10.Value = ImGuiExtension.HotkeySelector("Use bound skill 11 Key: " + CoPilot.instance.Settings.InputKey10.Value, CoPilot.instance.Settings.InputKey10.Value); CoPilot.instance.Settings.InputKey11.Value = ImGuiExtension.HotkeySelector("Use bound skill 12 Key: " + CoPilot.instance.Settings.InputKey11.Value, CoPilot.instance.Settings.InputKey11.Value); CoPilot.instance.Settings.InputKey12.Value = ImGuiExtension.HotkeySelector("Use bound skill 13 Key: " + CoPilot.instance.Settings.InputKey12.Value, CoPilot.instance.Settings.InputKey12.Value); } } catch (Exception e) { CoPilot.instance.LogError(e.ToString()); } try { if (CoPilot.instance.Settings.confirm5) { ImGui.PushStyleColor(ImGuiCol.Header, green); } else { ImGui.PushStyleColor(ImGuiCol.Header, red); } ImGui.PushID(1001); if (ImGui.TreeNodeEx("Importand Informations", collapsingHeaderFlags)) { ImGui.Text("Go to Input Keys Tab, and set them According to your Ingame Settings -> Settings -> Input -> Use bound skill X"); ImGui.NewLine(); ImGui.Text("If your a noob dont make changes to -> Input Keys <- and change your Ingame Settings to the Keys that are predefined in the Plugin!"); ImGui.NewLine(); ImGui.Text("DO NOT ASSIGN MOUSE KEYS TO -> Input Keys <- in the Plugin !!!"); ImGui.NewLine(); ImGui.Text("The Top Left and Top Right Skill Slots are EXCLUDED!!! (Ingame bound skill 1 and 3) I recommend you use these for your Mouse."); ImGui.NewLine(); ImGui.Text("The Plugin is currently forced to use Timers for Cooldowns as there is no Proper Skill Api for Ready/Cooldown."); ImGui.NewLine(); ImGui.Text("I STRONGLY recommend that you add 80-100ms extra delay to your Skill Settings, so a Skill wont be skipped sometimes."); ImGui.NewLine(); CoPilot.instance.Settings.confirm1.Value = ImGuiExtension.Checkbox("I did READ the text above.", CoPilot.instance.Settings.confirm1.Value); if (!CoPilot.instance.Settings.confirm1) { return; } CoPilot.instance.Settings.confirm2.Value = ImGuiExtension.Checkbox("I did READ and UNDERSTAND the text above.", CoPilot.instance.Settings.confirm2.Value); if (!CoPilot.instance.Settings.confirm2) { return; } CoPilot.instance.Settings.confirm3.Value = ImGuiExtension.Checkbox("I just READ it again and understood it.", CoPilot.instance.Settings.confirm3.Value); if (!CoPilot.instance.Settings.confirm3) { return; } CoPilot.instance.Settings.confirm4.Value = ImGuiExtension.Checkbox("I did everything stated above and im ready to go.", CoPilot.instance.Settings.confirm4.Value); if (!CoPilot.instance.Settings.confirm4) { return; } CoPilot.instance.Settings.confirm5.Value = ImGuiExtension.Checkbox("Let me use the Plugin already !!!", CoPilot.instance.Settings.confirm5.Value); if (!CoPilot.instance.Settings.confirm5) { return; } } } catch (Exception e) { CoPilot.instance.LogError(e.ToString()); } if (!CoPilot.instance.Settings.confirm5) { return; } try { // Donation ImGui.PushStyleColor(ImGuiCol.Header, new System.Numerics.Vector4(0.454f, 0.031f, 0.768f, 1.000f)); ImGui.PushID(99999); if (ImGui.TreeNodeEx("Donation", collapsingHeaderFlags)) { ImGui.Text("I was asked to add a way to donate, as im not using any online payment services the only way would be Amazon.de Wishlist."); ImGui.NewLine(); ImGui.Text("Thanks to anyone who is considering this."); if (ImGui.Button("Open Wishlist")) { System.Diagnostics.Process.Start("https://www.amazon.de/hz/wishlist/ls/MZ543BDBC6PJ?ref_=wl_share"); } } } catch (Exception e) { CoPilot.instance.LogError(e.ToString()); } try { // Auto Attack if (CoPilot.instance.Settings.autoAttackEnabled) { ImGui.PushStyleColor(ImGuiCol.Header, green); } else { ImGui.PushStyleColor(ImGuiCol.Header, red); } ImGui.PushID(1); if (ImGui.TreeNodeEx("Auto Attack with Cyclone / Nova / ...", collapsingHeaderFlags)) { CoPilot.instance.Settings.autoAttackEnabled.Value = ImGuiExtension.Checkbox("Enabled", CoPilot.instance.Settings.autoAttackEnabled.Value); CoPilot.instance.Settings.autoAttackLeftMouseCheck.Value = ImGuiExtension.Checkbox("Pause on Left Mouse Pressed", CoPilot.instance.Settings.autoAttackLeftMouseCheck.Value); CoPilot.instance.Settings.autoAttackPickItKey.Value = ImGuiExtension.HotkeySelector("PickIt Key: " + CoPilot.instance.Settings.autoAttackPickItKey.Value, CoPilot.instance.Settings.autoAttackPickItKey.Value); CoPilot.instance.Settings.autoAttackRange.Value = ImGuiExtension.IntSlider("Range", CoPilot.instance.Settings.autoAttackRange); } } catch (Exception e) { CoPilot.instance.LogError(e.ToString()); } try { // Auto Golem if (CoPilot.instance.Settings.autoSummonEnabled) { ImGui.PushStyleColor(ImGuiCol.Header, green); } else { ImGui.PushStyleColor(ImGuiCol.Header, red); } ImGui.PushID(2); if (ImGui.TreeNodeEx("Auto Summon", collapsingHeaderFlags)) { CoPilot.instance.Settings.autoSummonEnabled.Value = ImGuiExtension.Checkbox("Auto Summons", CoPilot.instance.Settings.autoSummonEnabled.Value); CoPilot.instance.Settings.autoGolemEnabled.Value = ImGuiExtension.Checkbox("Auto Golem", CoPilot.instance.Settings.autoGolemEnabled.Value); CoPilot.instance.Settings.autoGolemChaosMax.Value = ImGuiExtension.IntSlider("Chaos Golems max.", CoPilot.instance.Settings.autoGolemChaosMax); CoPilot.instance.Settings.autoGolemFireMax.Value = ImGuiExtension.IntSlider("Flame Golems max.", CoPilot.instance.Settings.autoGolemFireMax); CoPilot.instance.Settings.autoGolemIceMax.Value = ImGuiExtension.IntSlider("Ice Golems max.", CoPilot.instance.Settings.autoGolemIceMax); CoPilot.instance.Settings.autoGolemLightningMax.Value = ImGuiExtension.IntSlider("Lightning Golems max.", CoPilot.instance.Settings.autoGolemLightningMax); CoPilot.instance.Settings.autoGolemRockMax.Value = ImGuiExtension.IntSlider("Stone Golems max.", CoPilot.instance.Settings.autoGolemRockMax); CoPilot.instance.Settings.autoBoneMax.Value = ImGuiExtension.IntSlider("Carrion Golems max.", CoPilot.instance.Settings.autoBoneMax); CoPilot.instance.Settings.autoGolemDropBearMax.Value = ImGuiExtension.IntSlider("Beastial Ursa Max.", CoPilot.instance.Settings.autoGolemDropBearMax); CoPilot.instance.Settings.autoZombieEnabled.Value = ImGuiExtension.Checkbox("Auto Zombies", CoPilot.instance.Settings.autoZombieEnabled.Value); } } catch (Exception e) { CoPilot.instance.LogError(e.ToString()); } try { // Auto Quit if (CoPilot.instance.Settings.autoQuitEnabled) { ImGui.PushStyleColor(ImGuiCol.Header, green); } else { ImGui.PushStyleColor(ImGuiCol.Header, red); } ImGui.PushID(3); if (ImGui.TreeNodeEx("Auto Quit", collapsingHeaderFlags)) { CoPilot.instance.Settings.autoQuitEnabled.Value = ImGuiExtension.Checkbox("Enabled", CoPilot.instance.Settings.autoQuitEnabled.Value); CoPilot.instance.Settings.hpPctQuit.Value = ImGuiExtension.FloatSlider("HP%", CoPilot.instance.Settings.hpPctQuit); CoPilot.instance.Settings.esPctQuit.Value = ImGuiExtension.FloatSlider("ES%", CoPilot.instance.Settings.esPctQuit); CoPilot.instance.Settings.forcedAutoQuit.Value = ImGuiExtension.HotkeySelector("Force Quit Key: " + CoPilot.instance.Settings.forcedAutoQuit.Value, CoPilot.instance.Settings.forcedAutoQuit.Value); } } catch (Exception e) { CoPilot.instance.LogError(e.ToString()); } try { // Blood Rage if (CoPilot.instance.Settings.bloodRageEnabled) { ImGui.PushStyleColor(ImGuiCol.Header, green); } else { ImGui.PushStyleColor(ImGuiCol.Header, red); } ImGui.PushID(4); if (ImGui.TreeNodeEx("Blood Rage", collapsingHeaderFlags)) { CoPilot.instance.Settings.bloodRageEnabled.Value = ImGuiExtension.Checkbox("Enabled", CoPilot.instance.Settings.bloodRageEnabled.Value); CoPilot.instance.Settings.bloodRageDelay.Value = ImGuiExtension.IntSlider("Delay", CoPilot.instance.Settings.bloodRageDelay); CoPilot.instance.Settings.bloodRageRange.Value = ImGuiExtension.IntSlider("Range", CoPilot.instance.Settings.bloodRageRange); } } catch (Exception e) { CoPilot.instance.LogError(e.ToString()); } try { if (CoPilot.instance.Settings.delveFlareEnabled) { ImGui.PushStyleColor(ImGuiCol.Header, green); } else { ImGui.PushStyleColor(ImGuiCol.Header, red); } ImGui.PushID(5); if (ImGui.TreeNodeEx("Delve Flare", collapsingHeaderFlags)) { CoPilot.instance.Settings.delveFlareEnabled.Value = ImGuiExtension.Checkbox("Enabled", CoPilot.instance.Settings.delveFlareEnabled); CoPilot.instance.Settings.delveFlareKey.Value = ImGuiExtension.HotkeySelector("Key: " + CoPilot.instance.Settings.delveFlareKey.Value, CoPilot.instance.Settings.delveFlareKey.Value); CoPilot.instance.Settings.delveFlareDebuffStacks.Value = ImGuiExtension.IntSlider("min. Debuff Stacks", CoPilot.instance.Settings.delveFlareDebuffStacks); CoPilot.instance.Settings.delveFlareHpBelow.Value = ImGuiExtension.FloatSlider("HP%", CoPilot.instance.Settings.delveFlareHpBelow); CoPilot.instance.Settings.delveFlareEsBelow.Value = ImGuiExtension.FloatSlider("ES%", CoPilot.instance.Settings.delveFlareEsBelow); } } catch (Exception e) { CoPilot.instance.LogError(e.ToString()); } try { // Doedre Effigy if (CoPilot.instance.Settings.doedreEffigyEnabled) { ImGui.PushStyleColor(ImGuiCol.Header, green); } else { ImGui.PushStyleColor(ImGuiCol.Header, red); } ImGui.PushID(6); if (ImGui.TreeNodeEx("Doedre Effigy", collapsingHeaderFlags)) { CoPilot.instance.Settings.doedreEffigyEnabled.Value = ImGuiExtension.Checkbox("Enabled", CoPilot.instance.Settings.doedreEffigyEnabled.Value); CoPilot.instance.Settings.doedreEffigyDelay.Value = ImGuiExtension.IntSlider("min. Debuff Stacks", CoPilot.instance.Settings.doedreEffigyDelay); } } catch (Exception e) { CoPilot.instance.LogError(e.ToString()); } try { if (CoPilot.instance.Settings.divineIreEnabled) { ImGui.PushStyleColor(ImGuiCol.Header, green); } else { ImGui.PushStyleColor(ImGuiCol.Header, red); } ImGui.PushID(7); if (ImGui.TreeNodeEx("Divine Ire / Blade Flurry / Scourge Arrow", collapsingHeaderFlags)) { CoPilot.instance.Settings.divineIreEnabled.Value = ImGuiExtension.Checkbox("Enabled", CoPilot.instance.Settings.divineIreEnabled.Value); CoPilot.instance.Settings.divineIreStacks.Value = ImGuiExtension.IntSlider("Stacks", CoPilot.instance.Settings.divineIreStacks); CoPilot.instance.Settings.divineIreWaitForInfused.Value = ImGuiExtension.Checkbox("Wait for Infused Channeling Support", CoPilot.instance.Settings.divineIreWaitForInfused.Value); } } catch (Exception e) { CoPilot.instance.LogError(e.ToString()); } try { // Warcrys if (CoPilot.instance.Settings.enduringCryEnabled || CoPilot.instance.Settings.rallyingCryEnabled) { ImGui.PushStyleColor(ImGuiCol.Header, green); } else { ImGui.PushStyleColor(ImGuiCol.Header, red); } ImGui.PushID(8); if (ImGui.TreeNodeEx("Enduring Cry / Rallying Cry", collapsingHeaderFlags)) { CoPilot.instance.Settings.warCryCooldown.Value = ImGuiExtension.IntSlider("Cooldown", CoPilot.instance.Settings.warCryCooldown); CoPilot.instance.Settings.warCryKeepRage.Value = ImGuiExtension.Checkbox("Keep Rage Up", CoPilot.instance.Settings.warCryKeepRage.Value); CoPilot.instance.Settings.enduringCryEnabled.Value = ImGuiExtension.Checkbox("Enduring Cry Enabled", CoPilot.instance.Settings.enduringCryEnabled.Value); CoPilot.instance.Settings.warCryTriggerRange.Value = ImGuiExtension.IntSlider("Range", CoPilot.instance.Settings.warCryTriggerRange); CoPilot.instance.Settings.rallyingCryEnabled.Value = ImGuiExtension.Checkbox("Rallying Cry Enabled", CoPilot.instance.Settings.rallyingCryEnabled.Value); } } catch (Exception e) { CoPilot.instance.LogError(e.ToString()); } try { // Molten Shell / Steelskin / Bone Armour / Arcane Cloak if (CoPilot.instance.Settings.moltenShellEnabled) { ImGui.PushStyleColor(ImGuiCol.Header, green); } else { ImGui.PushStyleColor(ImGuiCol.Header, red); } ImGui.PushID(9); if (ImGui.TreeNodeEx("Molten Shell / Steelskin / Bone Armour / Arcane Cloak", collapsingHeaderFlags)) { CoPilot.instance.Settings.moltenShellEnabled.Value = ImGuiExtension.Checkbox("Enabled", CoPilot.instance.Settings.moltenShellEnabled.Value); CoPilot.instance.Settings.moltenShellDelay.Value = ImGuiExtension.IntSlider("Cooldown", CoPilot.instance.Settings.moltenShellDelay); CoPilot.instance.Settings.moltenShellRange.Value = ImGuiExtension.IntSlider("Range", CoPilot.instance.Settings.moltenShellRange); } } catch (Exception e) { CoPilot.instance.LogError(e.ToString()); } try { // Offerings if (CoPilot.instance.Settings.offeringsEnabled) { ImGui.PushStyleColor(ImGuiCol.Header, green); } else { ImGui.PushStyleColor(ImGuiCol.Header, red); } ImGui.PushID(10); if (ImGui.TreeNodeEx("Offerings (This will get you stuck in Animation for your Casttime !)", collapsingHeaderFlags)) { CoPilot.instance.Settings.offeringsEnabled.Value = ImGuiExtension.Checkbox("Enabled", CoPilot.instance.Settings.offeringsEnabled.Value); CoPilot.instance.Settings.offeringsUseWhileCasting.Value = ImGuiExtension.Checkbox("Use while Casting/Attacking", CoPilot.instance.Settings.offeringsUseWhileCasting.Value); CoPilot.instance.Settings.offeringsMinEnemys.Value = ImGuiExtension.IntSlider("min. Enemys", CoPilot.instance.Settings.offeringsMinEnemys); CoPilot.instance.Settings.offeringsTriggerRange.Value = ImGuiExtension.IntSlider("Trigger Range", CoPilot.instance.Settings.offeringsTriggerRange); } } catch (Exception e) { CoPilot.instance.LogError(e.ToString()); } try { // Phaserun if (CoPilot.instance.Settings.phaserunEnabled) { ImGui.PushStyleColor(ImGuiCol.Header, green); } else { ImGui.PushStyleColor(ImGuiCol.Header, red); } ImGui.PushID(11); if (ImGui.TreeNodeEx("Phaserun", collapsingHeaderFlags)) { CoPilot.instance.Settings.phaserunEnabled.Value = ImGuiExtension.Checkbox("Enabled", CoPilot.instance.Settings.phaserunEnabled.Value); CoPilot.instance.Settings.phaserunDelay.Value = ImGuiExtension.IntSlider("Cooldown", CoPilot.instance.Settings.phaserunDelay); } } catch (Exception e) { CoPilot.instance.LogError(e.ToString()); } try { // Speed Flasks if (CoPilot.instance.Settings.useSpeed4 || CoPilot.instance.Settings.useSpeed5) { ImGui.PushStyleColor(ImGuiCol.Header, green); } else { ImGui.PushStyleColor(ImGuiCol.Header, red); } ImGui.PushID(12); if (ImGui.TreeNodeEx("Speed Flask", collapsingHeaderFlags)) { CoPilot.instance.Settings.useSpeed4.Value = ImGuiExtension.Checkbox("Flask 4 Enabled", CoPilot.instance.Settings.useSpeed4.Value); CoPilot.instance.Settings.useSpeed5.Value = ImGuiExtension.Checkbox("Flask 5 Enabled", CoPilot.instance.Settings.useSpeed5.Value); CoPilot.instance.Settings.useSpeedMoving.Value = ImGuiExtension.Checkbox("Use when Moving", CoPilot.instance.Settings.useSpeedMoving.Value); CoPilot.instance.Settings.useSpeedAttack.Value = ImGuiExtension.Checkbox("Use when Attacking", CoPilot.instance.Settings.useSpeedAttack.Value); } } catch (Exception e) { CoPilot.instance.LogError(e.ToString()); } try { // Vortex if (CoPilot.instance.Settings.vortexEnabled) { ImGui.PushStyleColor(ImGuiCol.Header, green); } else { ImGui.PushStyleColor(ImGuiCol.Header, red); } ImGui.PushID(13); if (ImGui.TreeNodeEx("Vortex", collapsingHeaderFlags)) { CoPilot.instance.Settings.vortexEnabled.Value = ImGuiExtension.Checkbox("Enabled", CoPilot.instance.Settings.vortexEnabled.Value); CoPilot.instance.Settings.vortexDelay.Value = ImGuiExtension.IntSlider("Cooldown", CoPilot.instance.Settings.vortexDelay); CoPilot.instance.Settings.vortexRange.Value = ImGuiExtension.IntSlider("Range", CoPilot.instance.Settings.vortexRange); } } catch (Exception e) { CoPilot.instance.LogError(e.ToString()); } try { if (CoPilot.instance.Settings.anyVaalEnabled) { ImGui.PushStyleColor(ImGuiCol.Header, green); } else { ImGui.PushStyleColor(ImGuiCol.Header, red); } ImGui.PushID(14); if (ImGui.TreeNodeEx("Any Vaal Skill", collapsingHeaderFlags)) { CoPilot.instance.Settings.anyVaalEnabled.Value = ImGuiExtension.Checkbox("Enabled", CoPilot.instance.Settings.anyVaalEnabled.Value); CoPilot.instance.Settings.anyVaalMinEnemys.Value = ImGuiExtension.IntSlider("min. Enemys in Trigger Range", CoPilot.instance.Settings.anyVaalMinEnemys); CoPilot.instance.Settings.anyVaalTriggerRange.Value = ImGuiExtension.IntSlider("Trigger Range", CoPilot.instance.Settings.anyVaalTriggerRange); CoPilot.instance.Settings.anyVaalHpPct.Value = ImGuiExtension.FloatSlider("HP%", CoPilot.instance.Settings.anyVaalHpPct); CoPilot.instance.Settings.anyVaalEsPct.Value = ImGuiExtension.FloatSlider("ES%", CoPilot.instance.Settings.anyVaalEsPct); } } catch (Exception e) { CoPilot.instance.LogError(e.ToString()); } try { if (CoPilot.instance.Settings.customEnabled) { ImGui.PushStyleColor(ImGuiCol.Header, green); } else { ImGui.PushStyleColor(ImGuiCol.Header, red); } ImGui.PushID(15); if (ImGui.TreeNodeEx("Custom Skill (Use any Skill not Supported here.)", collapsingHeaderFlags)) { CoPilot.instance.Settings.customEnabled.Value = ImGuiExtension.Checkbox("Enabled", CoPilot.instance.Settings.customEnabled.Value); CoPilot.instance.Settings.customKey.Value = ImGuiExtension.HotkeySelector("Key: " + CoPilot.instance.Settings.customKey.Value, CoPilot.instance.Settings.customKey); CoPilot.instance.Settings.customCooldown.Value = ImGuiExtension.IntSlider("Cooldown", CoPilot.instance.Settings.customCooldown); CoPilot.instance.Settings.customMinEnemys.Value = ImGuiExtension.IntSlider("min. Enemys in Trigger Range", CoPilot.instance.Settings.customMinEnemys); CoPilot.instance.Settings.customTriggerRange.Value = ImGuiExtension.IntSlider("Trigger Range", CoPilot.instance.Settings.customTriggerRange); CoPilot.instance.Settings.customHpPct.Value = ImGuiExtension.FloatSlider("HP%", CoPilot.instance.Settings.customHpPct); CoPilot.instance.Settings.customEsPct.Value = ImGuiExtension.FloatSlider("ES%", CoPilot.instance.Settings.customEsPct); } } catch (Exception e) { CoPilot.instance.LogError(e.ToString()); } try { if (CoPilot.instance.Settings.brandRecallEnabled) { ImGui.PushStyleColor(ImGuiCol.Header, green); } else { ImGui.PushStyleColor(ImGuiCol.Header, red); } ImGui.PushID(16); if (ImGui.TreeNodeEx("Brand Recall", collapsingHeaderFlags)) { CoPilot.instance.Settings.brandRecallEnabled.Value = ImGuiExtension.Checkbox("Enabled", CoPilot.instance.Settings.brandRecallEnabled.Value); CoPilot.instance.Settings.brandRecallCooldown.Value = ImGuiExtension.IntSlider("Cooldown", CoPilot.instance.Settings.brandRecallCooldown); CoPilot.instance.Settings.brandRecallMinEnemys.Value = ImGuiExtension.IntSlider("min. Enemys in Trigger Range", CoPilot.instance.Settings.brandRecallMinEnemys); CoPilot.instance.Settings.brandRecallTriggerRange.Value = ImGuiExtension.IntSlider("Trigger Range", CoPilot.instance.Settings.brandRecallTriggerRange); CoPilot.instance.Settings.brandRecallMinBrands.Value = ImGuiExtension.IntSlider("min. Brands Summoned", CoPilot.instance.Settings.brandRecallMinBrands); } } catch (Exception e) { CoPilot.instance.LogError(e.ToString()); } try { if (CoPilot.instance.Settings.tempestShieldEnabled) { ImGui.PushStyleColor(ImGuiCol.Header, green); } else { ImGui.PushStyleColor(ImGuiCol.Header, red); } ImGui.PushID(17); if (ImGui.TreeNodeEx("Tempest Shield", collapsingHeaderFlags)) { CoPilot.instance.Settings.tempestShieldEnabled.Value = ImGuiExtension.Checkbox("Enabled", CoPilot.instance.Settings.tempestShieldEnabled.Value); CoPilot.instance.Settings.tempestShieldUseWhileCasting.Value = ImGuiExtension.Checkbox("Use while Casting/Attacking", CoPilot.instance.Settings.tempestShieldUseWhileCasting.Value); CoPilot.instance.Settings.tempestShieldMinEnemys.Value = ImGuiExtension.IntSlider("min. Enemys in Trigger Range", CoPilot.instance.Settings.tempestShieldMinEnemys); CoPilot.instance.Settings.tempestShieldTriggerRange.Value = ImGuiExtension.IntSlider("Trigger Range", CoPilot.instance.Settings.tempestShieldTriggerRange); } } catch (Exception e) { CoPilot.instance.LogError(e.ToString()); } try { if (CoPilot.instance.Settings.minesEnabled) { ImGui.PushStyleColor(ImGuiCol.Header, green); } else { ImGui.PushStyleColor(ImGuiCol.Header, red); } ImGui.PushID(99999); if (ImGui.TreeNodeEx("Mines (Not Implemented)", collapsingHeaderFlags)) { } } catch (Exception e) { CoPilot.instance.LogError(e.ToString()); } ImGui.End(); }
public void DrawNode(NodeBase node, float itemHeight) { bool HasText = node.Header != null && node.Header.IndexOf(_searchText, StringComparison.OrdinalIgnoreCase) >= 0; char icon = IconManager.FOLDER_ICON; if (node.Children.Count == 0) { icon = IconManager.FILE_ICON; } if (node.Tag is STGenericMesh) { icon = IconManager.MESH_ICON; } if (node.Tag is STGenericModel) { icon = IconManager.MODEL_ICON; } ImGuiTreeNodeFlags flags = ImGuiTreeNodeFlags.None; flags |= ImGuiTreeNodeFlags.SpanFullWidth; if (node.Children.Count == 0 || isSearch) { flags |= ImGuiTreeNodeFlags.Leaf; } else { flags |= ImGuiTreeNodeFlags.OpenOnDoubleClick; flags |= ImGuiTreeNodeFlags.OpenOnArrow; } if (node.IsExpanded && !isSearch) { flags |= ImGuiTreeNodeFlags.DefaultOpen; } //Node was selected manually outside the outliner so update the list if (node.IsSelected && !SelectedNodes.Contains(node)) { SelectedNodes.Add(node); } //Node was deselected manually outside the outliner so update the list if (!node.IsSelected && SelectedNodes.Contains(node)) { SelectedNodes.Remove(node); } if (SelectedNodes.Contains(node)) { flags |= ImGuiTreeNodeFlags.Selected; } if (isSearch && HasText || !isSearch) { //Add active file format styling. This determines what file to save. //For files inside archives, it gets the parent of the file format to save. bool isActiveFile = false; isActiveFile = ActiveFileFormat == node.Tag; bool isRenaming = node == renameNode && isNameEditing && node.Tag is IRenamableNode; //Improve tree node spacing. var spacing = ImGui.GetStyle().ItemSpacing; ImGui.PushStyleVar(ImGuiStyleVar.ItemSpacing, new Vector2(spacing.X, 1)); //Make the active file noticable if (isActiveFile) { ImGui.PushStyleColor(ImGuiCol.Text, new Vector4(0.834f, 0.941f, 1.000f, 1.000f)); } //Align the text to improve selection sizing. ImGui.AlignTextToFramePadding(); //Disable selection view in renaming handler to make text more clear if (isRenaming) { flags &= ~ImGuiTreeNodeFlags.Selected; flags &= ~ImGuiTreeNodeFlags.SpanFullWidth; } //Load the expander or selection if (isSearch) { ImGui.Selectable(node.ID, flags.HasFlag(ImGuiTreeNodeFlags.Selected)); } else { node.IsExpanded = ImGui.TreeNodeEx(node.ID, flags, $""); } ImGui.SameLine(); ImGuiHelper.IncrementCursorPosX(3); bool leftClicked = ImGui.IsItemClicked(ImGuiMouseButton.Left); bool rightClicked = ImGui.IsItemClicked(ImGuiMouseButton.Right); bool nodeFocused = ImGui.IsItemFocused(); bool isToggleOpened = ImGui.IsItemToggledOpen(); bool beginDragDropSource = !isRenaming && node.Tag is IDragDropNode && ImGui.BeginDragDropSource(); if (beginDragDropSource) { //Placeholder pointer data. Instead use drag/drop nodes from GetDragDropNode() GCHandle handle1 = GCHandle.Alloc(node.ID); ImGui.SetDragDropPayload("OUTLINER_ITEM", (IntPtr)handle1, sizeof(int), ImGuiCond.Once); handle1.Free(); dragDroppedNode = node; //Display icon for texture types if (node.Tag is STGenericTexture) { LoadTextureIcon(node); } //Display text for item being dragged ImGui.Button($"{node.Header}"); ImGui.EndDragDropSource(); } bool hasContextMenu = node is IContextMenu || node is IExportReplaceNode || node.Tag is ICheckableNode || node.Tag is IContextMenu || node.Tag is IExportReplaceNode || node.Tag is STGenericTexture; //Apply a pop up menu for context items. Only do this if the menu has possible items used if (hasContextMenu && SelectedNodes.Contains(node)) { ImGui.PushID(node.Header); if (ImGui.BeginPopupContextItem("##OUTLINER_POPUP", ImGuiPopupFlags.MouseButtonRight)) { SetupRightClickMenu(node); ImGui.EndPopup(); } ImGui.PopID(); } if (node.HasCheckBox) { ImGui.SetItemAllowOverlap(); ImGui.PushStyleVar(ImGuiStyleVar.FramePadding, new Vector2(2, 2)); bool check = node.IsChecked; if (ImGui.Checkbox($"##check{node.ID}", ref check)) { foreach (var n in SelectedNodes) { n.IsChecked = check; } } ImGui.PopStyleVar(); ImGui.SameLine(); ImGuiHelper.IncrementCursorPosX(3); } //Load the icon if (node.Tag is STGenericTexture) { LoadTextureIcon(node); } else { IconManager.DrawIcon(icon); ImGui.SameLine(); ImGuiHelper.IncrementCursorPosX(3); } ImGui.AlignTextToFramePadding(); //if (node.Tag is ICheckableNode) // ImGuiHelper.IncrementCursorPosY(-2); if (!isRenaming) { ImGui.Text(node.Header); } else { var renamable = node.Tag as IRenamableNode; var bg = ImGui.GetStyle().Colors[(int)ImGuiCol.WindowBg]; //Make the textbox frame background blend with the tree background //This is so we don't see the highlight color and can see text clearly ImGui.PushStyleColor(ImGuiCol.FrameBg, bg); ImGui.PushStyleColor(ImGuiCol.Border, new Vector4(1, 1, 1, 1)); ImGui.PushStyleVar(ImGuiStyleVar.FrameBorderSize, 1); var length = ImGui.CalcTextSize(renameText).X + 20; ImGui.PushItemWidth(length); if (ImGui.InputText("##RENAME_NODE", ref renameText, 512, ImGuiInputTextFlags.EnterReturnsTrue | ImGuiInputTextFlags.CallbackCompletion | ImGuiInputTextFlags.CallbackHistory | ImGuiInputTextFlags.NoHorizontalScroll)) { renamable.Renamed(renameText); node.Header = renameText; isNameEditing = false; } if (!ImGui.IsItemHovered() && ImGui.IsMouseClicked(ImGuiMouseButton.Left)) { isNameEditing = false; } ImGui.PopItemWidth(); ImGui.PopStyleVar(); ImGui.PopStyleColor(2); } ImGui.PopStyleVar(); if (isActiveFile) { ImGui.PopStyleColor(); } if (!isRenaming) { //Check for rename selection on selected renamable node if (node.IsSelected && node.Tag is IRenamableNode && RENAME_ENABLE) { bool renameStarting = renameClickTime != 0; bool wasCancelled = false; //Mouse click before editing started cancels the event if (renameStarting && leftClicked) { renameClickTime = 0; renameStarting = false; wasCancelled = true; } //Check for delay if (renameStarting) { //Create a delay between actions. This can be cancelled out during a mouse click var diff = ImGui.GetTime() - renameClickTime; if (diff > RENAME_DELAY_TIME) { //Name edit executed. Setup data for renaming. isNameEditing = true; renameNode = node; renameText = ((IRenamableNode)node.Tag).GetRenameText(); //Reset the time renameClickTime = 0; } } //User has started a rename click. Start a time check if (leftClicked && renameClickTime == 0 && !wasCancelled) { //Do a small delay for the rename event renameClickTime = ImGui.GetTime(); } } //Click event executed on item if ((leftClicked || rightClicked) && !isToggleOpened) //Prevent selection change on toggle { //Reset all selection unless shift/control held down if (!ImGui.GetIO().KeyCtrl&& !ImGui.GetIO().KeyShift) { foreach (var n in SelectedNodes) { n.IsSelected = false; } SelectedNodes.Clear(); } //Check selection range if (ImGui.GetIO().KeyShift) { SelectedRangeIndex = node.DisplayIndex; SelectRange = true; } else { SelectedIndex = node.DisplayIndex; } //Add the clicked node to selection. SelectedNodes.Add(node); node.IsSelected = true; } else if (nodeFocused && !isToggleOpened && !node.IsSelected) { if (!ImGui.GetIO().KeyCtrl&& !ImGui.GetIO().KeyShift) { foreach (var n in SelectedNodes) { n.IsSelected = false; } SelectedNodes.Clear(); } //Add the clicked node to selection. SelectedNodes.Add(node); node.IsSelected = true; } if (leftClicked && node.IsSelected) { if (node is ArchiveHiearchy && node.Tag == null) { var archiveWrapper = (ArchiveHiearchy)node; archiveWrapper.OpenFileFormat(); archiveWrapper.IsExpanded = true; } } //Update the active file format when selected. (updates dockspace layout and file menus) if (node.Tag is IFileFormat && node.IsSelected) { if (ActiveFileFormat != node.Tag) { ActiveFileFormat = (IFileFormat)node.Tag; } } else if (node.IsSelected && node.Parent != null) { } } } if (isSearch || node.IsExpanded) { //Todo find a better alternative to clip parents //Clip only the last level if (ClipNodes && node.Children.Count > 0 && node.Children[0].Children.Count == 0) { var children = node.Children.ToList(); if (isSearch) { children = GetSearchableNodes(children); } var clipper = new ImGuiListClipper2(children.Count, itemHeight); clipper.ItemsCount = children.Count; for (int line_i = clipper.DisplayStart; line_i < clipper.DisplayEnd; line_i++) // display only visible items { DrawNode(children[line_i], itemHeight); } } else { foreach (var child in node.Children) { DrawNode(child, itemHeight); } } if (!isSearch) { ImGui.TreePop(); } } }