diff --git a/Directory.Build.props b/Directory.Build.props
index 5a4b47b83..cf39e52b1 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -3,7 +3,7 @@
net7.0-windows
enable
ArchiTed
- 3.1.4
+ 3.1.4.1
x64
AnyCPU
diff --git a/RotationSolver.Basic/Attributes/AssemblyLinkAttribute.cs b/RotationSolver.Basic/Attributes/AssemblyLinkAttribute.cs
index faff68b00..bafa51968 100644
--- a/RotationSolver.Basic/Attributes/AssemblyLinkAttribute.cs
+++ b/RotationSolver.Basic/Attributes/AssemblyLinkAttribute.cs
@@ -27,7 +27,7 @@ public class AssemblyLinkAttribute : Attribute
///
///
///
- [Obsolete("Never use it anymore, it'll be deleted in a month!")]
+ [Obsolete("Never use it anymore, it'll be deleted in a month!", true)]
public AssemblyLinkAttribute(string supportLink = null, string helpLink = null,
string changeLog = null, string donate = null)
{
diff --git a/RotationSolver.Basic/Attributes/AuthorHashAttribute.cs b/RotationSolver.Basic/Attributes/AuthorHashAttribute.cs
index 0d779c9e3..504144eb2 100644
--- a/RotationSolver.Basic/Attributes/AuthorHashAttribute.cs
+++ b/RotationSolver.Basic/Attributes/AuthorHashAttribute.cs
@@ -16,7 +16,7 @@ public class AuthorHashAttribute : Attribute
/// Constructer
///
///
- [Obsolete]
+ [Obsolete("This method will be deleted in one month.", true)]
public AuthorHashAttribute(string hash)
{
Hash = hash;
diff --git a/RotationSolver.Basic/Attributes/LinkDescriptionAttribute.cs b/RotationSolver.Basic/Attributes/LinkDescriptionAttribute.cs
index 2b7de1232..4382d1b43 100644
--- a/RotationSolver.Basic/Attributes/LinkDescriptionAttribute.cs
+++ b/RotationSolver.Basic/Attributes/LinkDescriptionAttribute.cs
@@ -14,11 +14,11 @@ public class LinkDescriptionAttribute : Attribute
///
/// Constructer.
///
- ///
+ ///
///
- public LinkDescriptionAttribute(string path, string description = "")
+ public LinkDescriptionAttribute(string url, string description = "")
{
- LinkDescription = new() { Path = path, Description = description };
+ LinkDescription = new() { Url = url, Description = description };
}
}
@@ -35,5 +35,5 @@ public struct LinkDescription
///
/// Url.
///
- public string Path { get; init; }
+ public string Url { get; init; }
}
diff --git a/RotationSolver.Basic/Attributes/SourceCodeAttribute.cs b/RotationSolver.Basic/Attributes/SourceCodeAttribute.cs
index c0c7b94fa..3f7fa55f5 100644
--- a/RotationSolver.Basic/Attributes/SourceCodeAttribute.cs
+++ b/RotationSolver.Basic/Attributes/SourceCodeAttribute.cs
@@ -9,16 +9,16 @@ public class SourceCodeAttribute : Attribute
///
/// The link to the source code.
///
- public string Url { get; set; }
+ public string Path { get; set; }
///
/// Constructer.
///
- ///
- [Obsolete]
- public SourceCodeAttribute(string url)
+ ///
+ [Obsolete("This method will be deleted in several months.", true)]
+ public SourceCodeAttribute(string path)
{
- Url = url;
+ Path = path;
}
///
diff --git a/RotationSolver/Localization/ConfigTranslation.cs b/RotationSolver/Localization/ConfigTranslation.cs
index 7b370136e..9f05a4ba1 100644
--- a/RotationSolver/Localization/ConfigTranslation.cs
+++ b/RotationSolver/Localization/ConfigTranslation.cs
@@ -246,7 +246,7 @@ private static string ToCommandStr(object obj)
{
new LinkDescription()
{
- Path = "https://raw.githubusercontent.com/ArchiDog1998/RotationSolver/main/Images/HowAndWhenToClick.svg",
+ Url = "https://raw.githubusercontent.com/ArchiDog1998/RotationSolver/main/Images/HowAndWhenToClick.svg",
Description = "This plugin helps you to use the right action during the combat. Here is a guide about the different options.",
},
},
diff --git a/RotationSolver/Localization/Localization.json b/RotationSolver/Localization/Localization.json
index ff8e5e7ee..d66618877 100644
--- a/RotationSolver/Localization/Localization.json
+++ b/RotationSolver/Localization/Localization.json
@@ -446,5 +446,9 @@
"ConfigWindow_Rotations_Loaded": "Loaded",
"ConfigWindow_Rotations_GitHub": "GitHub",
"ConfigWindow_Rotations_Libraries": "Libraries",
- "ConfigWindow_Rotations_AutoLoadCustomRotations": "Auto load rotations"
+ "ConfigWindow_Rotations_AutoLoadCustomRotations": "Auto load rotations",
+ "ConfigWindow_Rotations_UserName": "User Name",
+ "ConfigWindow_Rotations_Repository": "Repository",
+ "ConfigWindow_Rotations_FileName": "File Name",
+ "ConfigWindow_Rotations_Library": "The folder contains rotation libs or the download url about rotation lib."
}
\ No newline at end of file
diff --git a/RotationSolver/Localization/Strings.cs b/RotationSolver/Localization/Strings.cs
index a358bf523..8d054333b 100644
--- a/RotationSolver/Localization/Strings.cs
+++ b/RotationSolver/Localization/Strings.cs
@@ -649,4 +649,11 @@ internal partial class Strings
public string ConfigWindow_Rotations_GitHub { get; set; } = "GitHub";
public string ConfigWindow_Rotations_Libraries { get; set; } = "Libraries";
public string ConfigWindow_Rotations_AutoLoadCustomRotations { get; set; } = "Auto load rotations";
+
+ public string ConfigWindow_Rotations_UserName { get; set; } = "User Name";
+ public string ConfigWindow_Rotations_Repository { get; set; } = "Repository";
+
+ public string ConfigWindow_Rotations_FileName { get; set; } = "File Name";
+
+ public string ConfigWindow_Rotations_Library { get; set; } = "The folder contains rotation libs or the download url about rotation lib.";
}
diff --git a/RotationSolver/UI/ImGuiHelper.cs b/RotationSolver/UI/ImGuiHelper.cs
index d28fd59f1..5ecfc8d52 100644
--- a/RotationSolver/UI/ImGuiHelper.cs
+++ b/RotationSolver/UI/ImGuiHelper.cs
@@ -548,7 +548,7 @@ public unsafe static void Display(this ICustomRotation rotation, ICustomRotation
{
try
{
- Util.OpenLink(link.Url);
+ Util.OpenLink(link.Path);
}
catch
{
diff --git a/RotationSolver/UI/RotationConfigWindowNew.cs b/RotationSolver/UI/RotationConfigWindowNew.cs
index 08600eaa2..49eb10066 100644
--- a/RotationSolver/UI/RotationConfigWindowNew.cs
+++ b/RotationSolver/UI/RotationConfigWindowNew.cs
@@ -331,9 +331,10 @@ private static void DrawItemMiddle(System.Action drawAction, float wholeWidth, f
drawAction();
}
+ private static float BodyMargin => 8 * _scale;
private void DrawBody()
{
- var margin = 8 * _scale;
+ var margin = BodyMargin;
ImGui.SetCursorPos(ImGui.GetCursorPos() + Vector2.One * margin);
if (ImGui.BeginChild("Rotation Solver Body", Vector2.One * -margin))
{
@@ -695,20 +696,20 @@ private static void DrawRotationDescription()
internal static void DrawLinkDescription(LinkDescription link, float wholeWidth, bool drawQuestion)
{
- var hasTexture = IconSet.GetTexture(link.Path, out var texture);
+ var hasTexture = IconSet.GetTexture(link.Url, out var texture);
if (hasTexture && TextureButton(texture, wholeWidth, wholeWidth))
{
- Util.OpenLink(link.Path);
+ Util.OpenLink(link.Url);
}
ImGui.TextWrapped(link.Description);
- if (drawQuestion && !hasTexture && !string.IsNullOrEmpty(link.Path))
+ if (drawQuestion && !hasTexture && !string.IsNullOrEmpty(link.Url))
{
if (ImGuiEx.IconButton(FontAwesomeIcon.Question, link.Description))
{
- Util.OpenLink(link.Path);
+ Util.OpenLink(link.Url);
}
}
}
@@ -738,25 +739,13 @@ private static void DrawRotationInformation()
{
var rotation = RotationUpdater.RightNowRotation;
if (rotation == null) return;
- var wholeWidth = ImGui.GetWindowWidth();
-
- var link = rotation.GetType().GetCustomAttribute();
-
- if (link != null)
- {
- if (IconSet.GetTexture("https://GitHub.GitHubassets.com/images/modules/logos_page/GitHub-Logo.png", out var icon) && TextureButton(icon, wholeWidth, 200 * _scale))
- {
- Util.OpenLink(link.Url);
- }
- }
var assembly = rotation.GetType().Assembly;
var info = assembly.GetInfo();
- if (info != null )
+ if (info != null)
{
- ImGui.Text("Assembly Name: ");
- ImGui.SameLine();
+ ImGui.BeginGroup();
if (ImGui.Button(info.Name))
{
Process.Start("explorer.exe", "/select, \"" + info.FilePath + "\"");
@@ -765,10 +754,20 @@ private static void DrawRotationInformation()
var version = assembly.GetName().Version;
if (version != null)
{
- ImGui.Text("Assembly Version: " + version.ToString());
+ ImGui.Text("v " + version.ToString());
}
- ImGui.Text("Assembly Author: " + info.Author);
+ ImGui.Text("- " + info.Author);
+ ImGui.EndGroup();
+
+ var link = rotation.GetType().GetCustomAttribute();
+ if(link != null)
+ {
+ ImGui.SameLine();
+ var userName = info.GitHubUserName;
+ var repository = info.GitHubRepository;
+ DrawGitHubBadge(userName, repository, $"https://github.com/{userName}/{repository}/blob/{link.Path}");
+ }
}
}
#endregion
@@ -1014,13 +1013,13 @@ private static void DrawRotationsLoaded()
}
}
- private static void DrawGitHubBadge(string userName, string repository, string id = "")
+ private static void DrawGitHubBadge(string userName, string repository, string id = "", string link = "")
{
if (!string.IsNullOrEmpty(userName) && !string.IsNullOrEmpty(repository)
&& IconSet.GetTexture($"https://GitHub-readme-stats.vercel.app/api/pin/?username={userName}&repo={repository}&theme=dark", out var icon)
- && NoPaddingNoColorImageButton(icon.ImGuiHandle, new Vector2(icon.Width, icon.Height),id))
+ && NoPaddingNoColorImageButton(icon.ImGuiHandle, new Vector2(icon.Width, icon.Height), id))
{
- Util.OpenLink($"https://GitHub.com/{userName}/{repository}");
+ Util.OpenLink(string.IsNullOrEmpty(link) ? $"https://GitHub.com/{userName}/{repository}" : link);
}
}
@@ -1045,16 +1044,19 @@ private static void DrawRotationsGitHub()
var changed = false;
- ImGui.SetNextItemWidth(120 * _scale);
- changed |= ImGui.InputText($"##GitHubLib{i}UserName", ref userName, 1024);
+ var width = ImGui.GetWindowWidth() - ImGuiEx.CalcIconSize(FontAwesomeIcon.Ban).X - ImGui.GetStyle().ItemSpacing.X * 3 - BodyMargin;
+ width /= 3;
+
+ ImGui.SetNextItemWidth(width);
+ changed |= ImGui.InputTextWithHint($"##GitHubLib{i}UserName", LocalizationManager.RightLang.ConfigWindow_Rotations_UserName, ref userName, 1024);
ImGui.SameLine();
- ImGui.SetNextItemWidth(120 * _scale);
- changed |= ImGui.InputText($"##GitHubLib{i}Repository", ref repository, 1024);
+ ImGui.SetNextItemWidth(width);
+ changed |= ImGui.InputTextWithHint($"##GitHubLib{i}Repository", LocalizationManager.RightLang.ConfigWindow_Rotations_Repository, ref repository, 1024);
ImGui.SameLine();
- ImGui.SetNextItemWidth(120 * _scale);
- changed |= ImGui.InputText($"##GitHubLib{i}FileName", ref fileName, 1024);
+ ImGui.SetNextItemWidth(width);
+ changed |= ImGui.InputTextWithHint($"##GitHubLib{i}FileName", LocalizationManager.RightLang.ConfigWindow_Rotations_FileName, ref fileName, 1024);
ImGui.SameLine();
if(changed)
@@ -1084,10 +1086,13 @@ private static void DrawRotationsLibraries()
ImGui.Spacing();
+ var width = ImGui.GetWindowWidth() - ImGuiEx.CalcIconSize(FontAwesomeIcon.Ban).X - ImGui.GetStyle().ItemSpacing.X - BodyMargin;
+
int removeIndex = -1;
for (int i = 0; i < Service.ConfigNew.GlobalConfig.OtherLibs.Length; i++)
{
- ImGui.InputText($"##Rotation Solver OtherLib{i}", ref Service.ConfigNew.GlobalConfig.OtherLibs[i], 1024);
+ ImGui.SetNextItemWidth(width);
+ ImGui.InputTextWithHint($"##Rotation Solver OtherLib{i}", LocalizationManager.RightLang.ConfigWindow_Rotations_Library, ref Service.ConfigNew.GlobalConfig.OtherLibs[i], 1024);
ImGui.SameLine();
if (ImGuiHelper.IconButton(FontAwesomeIcon.Ban, $"##Rotation Solver Remove OtherLibs{i}"))
diff --git a/RotationSolver/Updaters/SocialUpdater.cs b/RotationSolver/Updaters/SocialUpdater.cs
index d751ae115..006555da2 100644
--- a/RotationSolver/Updaters/SocialUpdater.cs
+++ b/RotationSolver/Updaters/SocialUpdater.cs
@@ -3,6 +3,7 @@
using Dalamud.Game.Text.SeStringHandling;
using Dalamud.Game.Text.SeStringHandling.Payloads;
using Dalamud.Logging;
+using ECommons.Automation;
using ECommons.DalamudServices;
using ECommons.GameFunctions;
using ECommons.GameHelpers;