diff --git a/RotationSolver/Actions/BaseAction/BaseAction_Display.cs b/RotationSolver/Actions/BaseAction/BaseAction_Display.cs index 8e6bd05ef..d522d7862 100644 --- a/RotationSolver/Actions/BaseAction/BaseAction_Display.cs +++ b/RotationSolver/Actions/BaseAction/BaseAction_Display.cs @@ -17,7 +17,7 @@ internal partial class BaseAction { public unsafe void Display(bool IsActive) => this.DrawEnableTexture(IsActive, () => RotationConfigWindow.ActiveAction = this, otherThing: () => { - if (IsTimeline) OtherCommandType.Actions.DisplayCommandHelp($"Insert{this}-{5}", + if (IsTimeline) OtherCommandType.Actions.DisplayCommandHelp($"{this}-{5}", type => string.Format(LocalizationManager.RightLang.Configwindow_Helper_InsertCommand, this)); #if DEBUG diff --git a/RotationSolver/Commands/RSCommands_BasicInfo.cs b/RotationSolver/Commands/RSCommands_BasicInfo.cs index 5c522dfd9..16d2f8a39 100644 --- a/RotationSolver/Commands/RSCommands_BasicInfo.cs +++ b/RotationSolver/Commands/RSCommands_BasicInfo.cs @@ -36,11 +36,7 @@ internal static void Enable() private static void OnCommand(string command, string arguments) { - string[] array = arguments.Split(); - - if (!array.Any()) return; - - DoOneCommand(array[0]); + DoOneCommand(arguments); } private static void DoOneCommand(string str) diff --git a/RotationSolver/Commands/RSCommands_Display.cs b/RotationSolver/Commands/RSCommands_Display.cs index 6155a2553..0377c7f39 100644 --- a/RotationSolver/Commands/RSCommands_Display.cs +++ b/RotationSolver/Commands/RSCommands_Display.cs @@ -24,7 +24,7 @@ internal static void DisplayCommandHelp(this T command, string extraCommand = } if (ImGui.IsItemHovered()) { - ImGui.SetTooltip($"{LocalizationManager.RightLang.Configwindow_Helper_RunCommand}: {command}\n{LocalizationManager.RightLang.Configwindow_Helper_CopyCommand}: {command}"); + ImGui.SetTooltip($"{LocalizationManager.RightLang.Configwindow_Helper_RunCommand}: {cmdStr}\n{LocalizationManager.RightLang.Configwindow_Helper_CopyCommand}: {cmdStr}"); if (ImGui.IsMouseDown(ImGuiMouseButton.Right)) { diff --git a/RotationSolver/Commands/RSCommands_OtherCommand.cs b/RotationSolver/Commands/RSCommands_OtherCommand.cs index 458f29e44..beee70d5f 100644 --- a/RotationSolver/Commands/RSCommands_OtherCommand.cs +++ b/RotationSolver/Commands/RSCommands_OtherCommand.cs @@ -109,7 +109,6 @@ private static void DoRotationCommand(ICustomRotation customCombo, string str) { if(config.DoCommand(configs, str)) { - //Say out. Service.ChatGui.Print(string.Format(LocalizationManager.RightLang.Commands_ChangeRotationConfig, config.DisplayName, configs.GetDisplayString(config.Name))); diff --git a/RotationSolver/Commands/RSCommands_StateSpecialCommand.cs b/RotationSolver/Commands/RSCommands_StateSpecialCommand.cs index d6256ad17..62fd255ae 100644 --- a/RotationSolver/Commands/RSCommands_StateSpecialCommand.cs +++ b/RotationSolver/Commands/RSCommands_StateSpecialCommand.cs @@ -26,6 +26,16 @@ internal static partial class RSCommands internal static string EntryString => _stateString + (SpecialTimeLeft < 0 ? string.Empty : $" - {_specialString}: {SpecialTimeLeft:F2}s"); + private static void UpdateToast() + { + if (!Service.Configuration.ShowInfoOnToast) return; + + Service.ToastGui.ShowQuest(" " + EntryString, new Dalamud.Game.Gui.Toast.QuestToastOptions() + { + IconId = 101, + }); + } + internal static void ResetSpecial() => DoSpecialCommandType(SpecialCommandType.EndSpecial); private static void DoStateCommandType(StateCommandType stateType) @@ -42,6 +52,7 @@ private static void DoStateCommandType(StateCommandType stateType) StateType = stateType; _stateString = stateType.ToStateString(role); + UpdateToast(); }); } @@ -53,6 +64,7 @@ private static void DoSpecialCommandType(SpecialCommandType specialType) _specialString = specialType.ToSpecialString(role); _specialStateStartTime = DateTime.Now; + UpdateToast(); }); } diff --git a/RotationSolver/Configuration/PluginConfiguration.cs b/RotationSolver/Configuration/PluginConfiguration.cs index e2488d933..c21745edf 100644 --- a/RotationSolver/Configuration/PluginConfiguration.cs +++ b/RotationSolver/Configuration/PluginConfiguration.cs @@ -33,7 +33,7 @@ public class PluginConfiguration : IPluginConfiguration public bool ChangeTargetForFate = true; public bool MoveTowardsScreenCenter = true; - public bool SayOutStateChanged = false; + public bool SayOutStateChanged = true; public bool ShowInfoOnDtr = true; diff --git a/RotationSolver/Helpers/ImguiHelper.cs b/RotationSolver/Helpers/ImguiHelper.cs index 174548c4f..9e11f2151 100644 --- a/RotationSolver/Helpers/ImguiHelper.cs +++ b/RotationSolver/Helpers/ImguiHelper.cs @@ -22,36 +22,34 @@ public static void DrawEnableTexture(this T texture, bool isSelected, Action { ImGui.PushStyleVar(ImGuiStyleVar.FramePadding, new Vector2(3f, 3f)); + ImGui.Columns(2, texture.Name, false); + var t = texture.GetTexture(); + + ImGui.SetColumnWidth(0, t.Width + 5); + ImGui.Image(t.ImGuiHandle, new Vector2(t.Width, t.Height)); var able = texture as IEnable; var desc = able?.Description; - HoveredString(desc); - ImGui.SameLine(); - Spacing(); - + HoveredString(desc, selected); - if(ImGui.Selectable(texture.Name, isSelected)) - { - selected?.Invoke(); - } - HoveredString(desc); + ImGui.NextColumn(); bool enable = false; if (able != null) { - ImGui.SameLine(); - Spacing(); - + if (isSelected) ImGui.PushStyleColor(ImGuiCol.Text, ImGui.ColorConvertFloat4ToU32(ImGuiColors.DalamudYellow)); enable = able.IsEnabled; - if (ImGui.Checkbox("##" + texture.Name, ref enable)) + if (ImGui.Checkbox($"{texture.Name}##{texture.Name}", ref enable)) { able.IsEnabled = enable; Service.Configuration.Save(); } - HoveredString(desc); + if (isSelected) ImGui.PopStyleColor(); + + HoveredString(desc, selected); } @@ -59,12 +57,13 @@ public static void DrawEnableTexture(this T texture, bool isSelected, Action if (enable) { - ImGui.Indent(t.Width); + ImGui.Indent(20); ImGui.PushStyleVar(ImGuiStyleVar.FramePadding, new Vector2(1f, 1f)); otherThing?.Invoke(); ImGui.PopStyleVar(); - ImGui.Unindent(); + ImGui.Unindent(20); } + ImGui.Columns(1); ImGui.PopStyleVar(); } @@ -79,11 +78,15 @@ public static bool IconButton(FontAwesomeIcon icon, string name) //ImGuiComponents.IconButton(icon) } - public static void HoveredString(string text) + public static void HoveredString(string text, Action selected = null) { if (ImGui.IsItemHovered()) { if (!string.IsNullOrEmpty(text)) ImGui.SetTooltip(text); + if (ImGui.IsMouseDown(ImGuiMouseButton.Left)) + { + selected?.Invoke(); + } } } diff --git a/RotationSolver/Rotations/CustomRotation/CustomRotation_Display.cs b/RotationSolver/Rotations/CustomRotation/CustomRotation_Display.cs index 1aa6baedd..c4f749c6e 100644 --- a/RotationSolver/Rotations/CustomRotation/CustomRotation_Display.cs +++ b/RotationSolver/Rotations/CustomRotation/CustomRotation_Display.cs @@ -41,11 +41,13 @@ public unsafe void Display(ICustomRotation[] rotations, bool canAddButton) => th } ImGui.SameLine(); - ImGui.TextDisabled(" - " + LocalizationManager.RightLang.Configwindow_Helper_GameVersion + ": "); + ImGui.TextDisabled(" - " + LocalizationManager.RightLang.Configwindow_Helper_GameVersion + ": "); ImGui.SameLine(); ImGui.Text(GameVersion); + ImGui.SameLine(); + ImGuiHelper.Spacing(); - if(ImGuiHelper.IconButton(FontAwesomeIcon.Globe, GetHashCode().ToString())) + if (ImGuiHelper.IconButton(FontAwesomeIcon.Globe, GetHashCode().ToString())) { var url = @"https://github.com/ArchiDog1998/RotationSolver/blob/main/" + GetType().FullName.Replace(".", @"/") + ".cs"; diff --git a/RotationSolver/Updaters/PreviewUpdater.cs b/RotationSolver/Updaters/PreviewUpdater.cs index ab4fceb0d..da9ba7416 100644 --- a/RotationSolver/Updaters/PreviewUpdater.cs +++ b/RotationSolver/Updaters/PreviewUpdater.cs @@ -33,7 +33,7 @@ private static void UpdateEntry() { if (dtrEntry == null) { - dtrEntry = Service.DtrBar.Get("Auto Attack"); + dtrEntry = Service.DtrBar.Get("Rotation Solver"); } dtrEntry.Shown = true; dtrEntry.Text = new SeString( diff --git a/RotationSolver/Windows/RotationConfigWindow_Action.cs b/RotationSolver/Windows/RotationConfigWindow_Action.cs index 583f1b7ca..77cb8f853 100644 --- a/RotationSolver/Windows/RotationConfigWindow_Action.cs +++ b/RotationSolver/Windows/RotationConfigWindow_Action.cs @@ -30,7 +30,6 @@ private void DrawActionList() { ImGui.PushStyleVar(ImGuiStyleVar.ItemSpacing, new Vector2(0f, 5f)); - if (ImGui.BeginChild("Action List", new Vector2(0f, -1f), true)) { foreach (var pair in IconReplacer.RightRotationBaseActions.GroupBy(a => a.CateName).OrderBy(g => g.Key)) diff --git a/RotationSolver/Windows/RotationConfigWindow_Help.cs b/RotationSolver/Windows/RotationConfigWindow_Help.cs index 42ee9d215..bef9eed27 100644 --- a/RotationSolver/Windows/RotationConfigWindow_Help.cs +++ b/RotationSolver/Windows/RotationConfigWindow_Help.cs @@ -14,14 +14,14 @@ private void DrawHelpTab() { ImGui.Text(LocalizationManager.RightLang.ConfigWindow_HelpItem_Description); - ImGui.PushStyleColor(ImGuiCol.Button, ImGuiColors.ParsedGreen); + ImGui.SameLine(); + if (ImGui.Button("Github")) { Util.OpenLink("https://github.com/ArchiDog1998/RotationSolver"); } ImGui.SameLine(); - ImGuiHelper.Spacing(); if (ImGui.Button("Discord")) { @@ -29,13 +29,11 @@ private void DrawHelpTab() } ImGui.SameLine(); - ImGuiHelper.Spacing(); if (ImGui.Button("Wiki")) { Util.OpenLink("https://archidog1998.github.io/RotationSolver/"); } - ImGui.PopStyleColor(); if (ImGui.BeginChild("Help Infomation", new Vector2(0f, -1f), true)) {