diff --git a/AutoDuty/AutoDuty.cs b/AutoDuty/AutoDuty.cs index a1e3f1b1..da38477c 100644 --- a/AutoDuty/AutoDuty.cs +++ b/AutoDuty/AutoDuty.cs @@ -37,11 +37,11 @@ using FFXIVClientStructs.FFXIV.Client.Game.UI; using Serilog.Events; using AutoDuty.Updater; -using System.Threading.Tasks; namespace AutoDuty; // TODO: +// Scrapped interable list, going to implement an internal list that when a interactable step end in fail, the Dataid gets add to the list and is scanned for from there on out, if found we goto it and get it, then remove from list. // Need to expand AutoRepair to include check for level and stuff to see if you are eligible for self repair. and check for dark matter // make config saving per character // drap drop on build is jacked when theres scrolling @@ -337,7 +337,6 @@ internal void LoadPath() PathFile = path?.FilePath ?? ""; Actions = [.. path?.Actions]; - Interactables = [.. path?.Interactables]; //Svc.Log.Info($"Loading Path: {CurrentPath} {ListBoxPOSText.Count}"); } catch (Exception e) diff --git a/AutoDuty/Data/Classes.cs b/AutoDuty/Data/Classes.cs index 8d0a264b..a62d54de 100644 --- a/AutoDuty/Data/Classes.cs +++ b/AutoDuty/Data/Classes.cs @@ -77,9 +77,6 @@ public class PathFile [JsonPropertyName("actions")] public List Actions { get; set; } = []; - [JsonPropertyName("interactables")] - public uint[] Interactables { get; set; } = []; - [JsonPropertyName("meta")] public PathFileMetaData Meta { get; set; } = new() { diff --git a/AutoDuty/Managers/ContentPathsManager.cs b/AutoDuty/Managers/ContentPathsManager.cs index e3887f06..d42b4640 100644 --- a/AutoDuty/Managers/ContentPathsManager.cs +++ b/AutoDuty/Managers/ContentPathsManager.cs @@ -331,7 +331,6 @@ public PathFile PathFile } public List Actions => PathFile.Actions; - public uint[] Interactables => PathFile.Interactables; public bool RevivalFound { get; private set; } } } diff --git a/AutoDuty/Windows/BuildTab.cs b/AutoDuty/Windows/BuildTab.cs index 2d5915b4..e46fbc4b 100644 --- a/AutoDuty/Windows/BuildTab.cs +++ b/AutoDuty/Windows/BuildTab.cs @@ -25,7 +25,6 @@ internal static class BuildTab private static bool _scrollBottom = false; private static string _changelog = string.Empty; private static PathAction? _action = null; - private static HashSet _interactables = []; private static string _actionText = string.Empty; private static string _note = string.Empty; private static Vector3 _position = Vector3.Zero; @@ -41,8 +40,6 @@ internal static class BuildTab private static bool _dragDrop = false; private static bool _noArgument = false; private static bool _comment = false; - private static int _interactableInput = 0; - private static int _interactableModify = -1; private static Vector4 _argumentTextColor = new(1,1,1,1); private static bool _deleteItem = false; private static int _deleteItemIndex = -1; @@ -61,7 +58,6 @@ internal unsafe static void Draw() DrawSeperator(); DrawButtons(); DrawSeperator(); - DrawInteractablesSet(); } DrawBuildList(); } @@ -219,7 +215,6 @@ private static void DrawButtons() pathFile ??= new(); pathFile.Actions = [.. Plugin.Actions]; - pathFile.Interactables = [.. _interactables]; string json = JsonSerializer.Serialize(pathFile, jsonSerializerOptions); File.WriteAllText(Plugin.PathFile, json); Plugin.CurrentPath = 0; @@ -253,9 +248,7 @@ private unsafe static void DrawAddActionUIPopup() { if (ImGuiEx.ButtonWrapped(_addActionButton)) { - if (_action.Name == "Interactable" && !_addActionButton.Equals("Modify", StringComparison.InvariantCultureIgnoreCase)) - ImGui.OpenPopup("InteractableAdd"); - else if (_action.Name == "MoveToObject" || _action.Name == "Target") + if (_action.Name is "MoveToObject" or "Target" or "Interactable") { if (uint.TryParse(_arguments[0], out var dataId)) AddAction(); @@ -266,26 +259,6 @@ private unsafe static void DrawAddActionUIPopup() AddAction(); } } - if (ImGui.BeginPopup("InteractableAdd")) - { - if (ImGui.Selectable("Add to Path")) - { - if (uint.TryParse(_arguments[0], out var dataId)) - AddAction(); - else - ShowPopup("Error", "Interactable's must be uint's corresponding to the objects DataId", true); - - } - if (ImGui.Selectable("Add to Special")) - { - if (uint.TryParse(_arguments[0], out var dataId)) - _interactables.Add(dataId); - else - ShowPopup("Error", "Special interactable's must be uint's corresponding to the objects DataId", true); - } - ImGui.EndPopup(); - } - DrawPopup(true); ImGui.SameLine(); ImGuiEx.CheckboxWrapped("Dont Move", ref _dontMove); ImGui.SameLine(); @@ -345,37 +318,6 @@ private unsafe static void DrawAddActionUIPopup() } } - private static void DrawInteractablesSet() - { - ImGui.TextWrapped("Special Interactables List:"); - ImGuiComponents.HelpMarker("AutoDuty will attempt to interact with these objects under the following conditions:\n- The object exists in our ObjectTable\n- We are on or past the Interactable step in our path file for this object\n*Note* this should not be used for static GameObject's this is meant for those objects\nthat spawn in from an event such as killing some monsters"); - if (!ImGui.BeginListBox("##InteractablesList", new Vector2(ImGui.GetContentRegionAvail().X, _interactables.Count > 0 ? ImGui.GetTextLineHeightWithSpacing() * _interactables.Count: ImGui.GetTextLineHeightWithSpacing() * (_interactables.Count + 1)))) return; - - var removeItem = false; - var removeItemValue = 0u; - - foreach (var item in _interactables.Select((Value, Index) => (Value, Index))) - { - ImGui.Selectable($"{item.Value}"); - if (ImGui.IsItemClicked(ImGuiMouseButton.Left)) - { - Svc.Log.Info("Left"); - _interactableModify = _interactableInput = (int)item.Value; - ImGui.OpenPopup("InputInteractable"); - } - if (ImGui.IsItemClicked(ImGuiMouseButton.Right)) - { - removeItem = true; - removeItemValue = item.Value; - } - } - InteractableInputPopup(); - if (removeItem) - _interactables.Remove(removeItemValue); - - ImGui.EndListBox(); - } - private static void DrawBuildList() { if (!ImGui.BeginListBox("##BuildList", new Vector2(ImGui.GetContentRegionAvail().X, ImGui.GetContentRegionAvail().Y))) return; @@ -457,24 +399,6 @@ private static void DrawBuildList() ImGui.EndListBox(); } - private static void InteractableInputPopup() - { - if (ImGui.BeginPopup("InputInteractable")) - { - if (ImGui.Button(_interactableModify > -1 ? "Modify" : "Add")) - { - if (_interactableModify > -1) - _interactables.Remove((uint)_interactableModify); - _interactables.Add((uint)_interactableInput); - ImGui.CloseCurrentPopup(); - } - ImGui.Text("Data Id:"); - ImGui.SameLine(); - ImGui.InputInt("##DataId", ref _interactableInput); - ImGui.EndPopup(); - } - } - private static void ClearAll() { _actionText = string.Empty;