diff --git a/Directory.Build.props b/Directory.Build.props index cf39e52b1..e82a4e7bb 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -3,7 +3,7 @@ net7.0-windows enable ArchiTed - 3.1.4.1 + 3.1.4.2 x64 AnyCPU diff --git a/RotationSolver.Basic/Data/IconSet.cs b/RotationSolver.Basic/Data/IconSet.cs index fb6611c25..533983443 100644 --- a/RotationSolver.Basic/Data/IconSet.cs +++ b/RotationSolver.Basic/Data/IconSet.cs @@ -148,7 +148,7 @@ public static TextureWrap GetTexture(string path) public static bool GetTexture(string path, out TextureWrap texture) => ThreadLoadImageHandler.TryGetTextureWrap(path, out texture) || (path.StartsWith("http:", StringComparison.OrdinalIgnoreCase) || path.StartsWith("https:", StringComparison.OrdinalIgnoreCase)) - && GetTexture((uint)(62571 + Environment.TickCount / 500 % 3), out texture); // loading pics. + && GetTexture((uint)(62571 + Environment.TickCount / 300 % 3), out texture); // loading pics. private static readonly Dictionary _actionIcons = new(); diff --git a/RotationSolver/UI/RotationConfigWindowNew.cs b/RotationSolver/UI/RotationConfigWindowNew.cs index 49eb10066..ad8a24f41 100644 --- a/RotationSolver/UI/RotationConfigWindowNew.cs +++ b/RotationSolver/UI/RotationConfigWindowNew.cs @@ -754,10 +754,10 @@ private static void DrawRotationInformation() var version = assembly.GetName().Version; if (version != null) { - ImGui.Text("v " + version.ToString()); + ImGui.Text(" v " + version.ToString()); } - ImGui.Text("- " + info.Author); + ImGui.Text(" - " + info.Author); ImGui.EndGroup(); var link = rotation.GetType().GetCustomAttribute(); @@ -979,10 +979,10 @@ private static void DrawRotationsLoaded() var version = assembly.GetName().Version; if (version != null) { - ImGui.Text("v " + version.ToString()); + ImGui.Text(" v " + version.ToString()); } - ImGui.Text("- " + info.Author); + ImGui.Text(" - " + info.Author); ImGui.TableNextColumn(); diff --git a/RotationSolver/UI/SearchableConfigs/CheckBoxSearch.cs b/RotationSolver/UI/SearchableConfigs/CheckBoxSearch.cs index b7f59aadc..366885718 100644 --- a/RotationSolver/UI/SearchableConfigs/CheckBoxSearch.cs +++ b/RotationSolver/UI/SearchableConfigs/CheckBoxSearch.cs @@ -68,19 +68,17 @@ protected override void DrawMain(Job job) var hasIcon = Action != ActionID.None && IconSet.GetTexture(Action, out texture); var enable = GetValue(job); - if (ImGui.Checkbox(!hasChild && !hasIcon ? $"{Name}##{ID}" : $"##{ID}", ref enable)) + if (ImGui.Checkbox($"##{ID}", ref enable)) { SetValue(job, enable); } if (ImGui.IsItemHovered()) ShowTooltip(job); - if (!hasChild && !hasIcon) return; + ImGui.SameLine(); var name = $"{Name}##Config_{ID}"; if(hasIcon) { - ImGui.SameLine(); - ImGui.BeginGroup(); var cursor = ImGui.GetCursorPos(); var size = ImGuiHelpers.GlobalScale * 32; @@ -97,8 +95,6 @@ protected override void DrawMain(Job job) } else if (hasChild) { - ImGui.SameLine(); - if (enable) { var x = ImGui.GetCursorPosX(); @@ -127,5 +123,10 @@ protected override void DrawMain(Job job) ImGui.PopStyleColor(2); } } + else + { + ImGui.TextWrapped(Name); + if (ImGui.IsItemHovered()) ShowTooltip(job, false); + } } } diff --git a/RotationSolver/UI/SearchableConfigs/DragFloatRangeSearch.cs b/RotationSolver/UI/SearchableConfigs/DragFloatRangeSearch.cs index cfe9530c0..c3a3a9fbd 100644 --- a/RotationSolver/UI/SearchableConfigs/DragFloatRangeSearch.cs +++ b/RotationSolver/UI/SearchableConfigs/DragFloatRangeSearch.cs @@ -15,6 +15,8 @@ internal class DragFloatRangeSearchJob : DragFloatRangeSearch public override LinkDescription[] Tooltips => _configMin.ToAction(); + protected override bool IsJob => true; + public DragFloatRangeSearchJob(JobConfigFloat configMin, JobConfigFloat configMax, float min, float max, float speed) : base (min, max, speed) { @@ -22,12 +24,6 @@ public DragFloatRangeSearchJob(JobConfigFloat configMin, JobConfigFloat configMa _configMax = configMax; } - protected override void DrawMain(Job job) - { - base.DrawMain(job); - DrawJobIcon(); - } - public override void ResetToDefault(Job job) { Service.ConfigNew.SetValue(job, _configMin, Service.ConfigNew.GetDefault(job, _configMin)); @@ -125,11 +121,16 @@ protected override void DrawMain(Job job) var minValue = GetMinValue(job); var maxValue = GetMaxValue(job); ImGui.SetNextItemWidth(Scale * DRAG_WIDTH); - if (ImGui.DragFloatRange2($"{Name}##Config_{ID}", ref minValue, ref maxValue, Speed, Min, Max)) + if (ImGui.DragFloatRange2($"##Config_{ID}", ref minValue, ref maxValue, Speed, Min, Max)) { SetMinValue(job, Math.Max(Math.Min(minValue, maxValue), Min)); SetMaxValue(job, Math.Min(Math.Max(minValue, maxValue), Max)); } if (ImGui.IsItemHovered()) ShowTooltip(job); + + if (IsJob) DrawJobIcon(); + ImGui.SameLine(); + ImGui.TextWrapped(Name); + if (ImGui.IsItemHovered()) ShowTooltip(job, false); } } diff --git a/RotationSolver/UI/SearchableConfigs/DragFloatSearch.cs b/RotationSolver/UI/SearchableConfigs/DragFloatSearch.cs index f27056fbc..8a53c135b 100644 --- a/RotationSolver/UI/SearchableConfigs/DragFloatSearch.cs +++ b/RotationSolver/UI/SearchableConfigs/DragFloatSearch.cs @@ -17,6 +17,7 @@ internal class DragFloatSearchJob : DragFloatSearch public override LinkDescription[] Tooltips => _config.ToAction(); public override string Command => _config.ToCommand(); + protected override bool IsJob => true; public DragFloatSearchJob(JobConfigFloat config, float min, float max, float speed) : base(min, max, speed) @@ -24,12 +25,6 @@ public DragFloatSearchJob(JobConfigFloat config, float min, float max, float spe _config = config; } - protected override void DrawMain(Job job) - { - base.DrawMain(job); - DrawJobIcon(); - } - public override void ResetToDefault(Job job) { Service.ConfigNew.SetValue(job, _config, Service.ConfigNew.GetDefault(job, _config)); @@ -101,10 +96,16 @@ protected override void DrawMain(Job job) { var value = GetValue(job); ImGui.SetNextItemWidth(Scale * DRAG_WIDTH); - if (ImGui.DragFloat($"{Name}##Config_{ID}", ref value, Speed, Min, Max)) + if (ImGui.DragFloat($"##Config_{ID}", ref value, Speed, Min, Max)) { SetValue(job, Math.Min(Math.Max(value, Min), Max)); } if (ImGui.IsItemHovered()) ShowTooltip(job); + + if (IsJob) DrawJobIcon(); + + ImGui.SameLine(); + ImGui.TextWrapped(Name); + if (ImGui.IsItemHovered()) ShowTooltip(job, false); } } diff --git a/RotationSolver/UI/SearchableConfigs/DragIntRangeSearch.cs b/RotationSolver/UI/SearchableConfigs/DragIntRangeSearch.cs index bbbdfe005..e86b8b147 100644 --- a/RotationSolver/UI/SearchableConfigs/DragIntRangeSearch.cs +++ b/RotationSolver/UI/SearchableConfigs/DragIntRangeSearch.cs @@ -15,6 +15,7 @@ internal class DragIntRangeSearchJob : DragIntRangeSearch public override string Description => _configMin.ToDescription(); public override LinkDescription[] Tooltips => _configMin.ToAction(); + protected override bool IsJob => true; public DragIntRangeSearchJob(JobConfigInt configMin, JobConfigInt configMax, int min, int max, float speed) :base (min, max, speed) @@ -23,12 +24,6 @@ public DragIntRangeSearchJob(JobConfigInt configMin, JobConfigInt configMax, int _configMax = configMax; } - protected override void DrawMain(Job job) - { - base.DrawMain(job); - DrawJobIcon(); - } - public override void ResetToDefault(Job job) { Service.ConfigNew.SetValue(job, _configMin, Service.ConfigNew.GetDefault(job, _configMin)); @@ -126,11 +121,16 @@ protected override void DrawMain(Job job) var minValue = GetMinValue(job); var maxValue = GetMaxValue(job); ImGui.SetNextItemWidth(Scale * DRAG_WIDTH); - if (ImGui.DragIntRange2($"{Name}##Config_{ID}", ref minValue, ref maxValue, Speed, Min, Max)) + if (ImGui.DragIntRange2($"##Config_{ID}", ref minValue, ref maxValue, Speed, Min, Max)) { SetMinValue(job, Math.Max(Math.Min(minValue, maxValue), Min)); SetMaxValue(job, Math.Min(Math.Max(minValue, maxValue), Max)); } if (ImGui.IsItemHovered()) ShowTooltip(job); + + if (IsJob) DrawJobIcon(); + ImGui.SameLine(); + ImGui.TextWrapped(Name); + if (ImGui.IsItemHovered()) ShowTooltip(job, false); } } diff --git a/RotationSolver/UI/SearchableConfigs/DragIntSearch.cs b/RotationSolver/UI/SearchableConfigs/DragIntSearch.cs index ca85da2fb..a24c04968 100644 --- a/RotationSolver/UI/SearchableConfigs/DragIntSearch.cs +++ b/RotationSolver/UI/SearchableConfigs/DragIntSearch.cs @@ -18,18 +18,14 @@ internal class DragIntSearchJob : DragIntSearch public override string Command => _config.ToCommand(); + protected override bool IsJob => true; + public DragIntSearchJob(JobConfigInt config, int min, int max, float speed) :base (min, max, speed) { _config = config; } - protected override void DrawMain(Job job) - { - base.DrawMain(job); - DrawJobIcon(); - } - public override void ResetToDefault(Job job) { Service.ConfigNew.SetValue(job, _config, Service.ConfigNew.GetDefault(job, _config)); @@ -98,10 +94,15 @@ protected override void DrawMain(Job job) { var value = GetValue(job); ImGui.SetNextItemWidth(Scale * DRAG_WIDTH); - if(ImGui.DragInt($"{Name}##Config_{ID}", ref value, Speed, Min, Max)) + if(ImGui.DragInt($"##Config_{ID}", ref value, Speed, Min, Max)) { SetValue(job, Math.Min(Math.Max(value, Min), Max)); } if (ImGui.IsItemHovered()) ShowTooltip(job); + + if (IsJob) DrawJobIcon(); + ImGui.SameLine(); + ImGui.TextWrapped(Name); + if (ImGui.IsItemHovered()) ShowTooltip(job, false); } } diff --git a/RotationSolver/UI/SearchableConfigs/Searchable.cs b/RotationSolver/UI/SearchableConfigs/Searchable.cs index 437d842e6..daed04008 100644 --- a/RotationSolver/UI/SearchableConfigs/Searchable.cs +++ b/RotationSolver/UI/SearchableConfigs/Searchable.cs @@ -21,7 +21,7 @@ internal abstract class Searchable : ISearchable public abstract LinkDescription[] Tooltips { get; } public abstract string ID { get; } private string Popup_Key => "Rotation Solver RightClicking: " + ID; - + protected virtual bool IsJob => false; public void Draw(Job job) { if (string.IsNullOrEmpty(Name)) return; diff --git a/RotationSolver/Updaters/RotationUpdater.cs b/RotationSolver/Updaters/RotationUpdater.cs index 235469f26..acdeba018 100644 --- a/RotationSolver/Updaters/RotationUpdater.cs +++ b/RotationSolver/Updaters/RotationUpdater.cs @@ -246,7 +246,10 @@ private static async Task DownloadOneUrlAsync(string url, string relayFold { if (File.Exists(filePath) && !mustDownload) { - if (new FileInfo(filePath).Length == response.Content.Headers.ContentLength) + var fileInfo = new FileInfo(filePath); + var header = response.Content.Headers; + if (header.LastModified.HasValue && header.LastModified.Value.UtcDateTime < fileInfo.LastWriteTimeUtc + && fileInfo.Length == header.ContentLength) { return false; }