Skip to content

Commit

Permalink
Merge pull request #142 from FFXIV-CombatReborn/ui-updates
Browse files Browse the repository at this point in the history
UI Updates
  • Loading branch information
NostraThomas99 authored May 4, 2024
2 parents 13de290 + 9c1bad4 commit 633f262
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 56 deletions.
1 change: 0 additions & 1 deletion RotationSolver.Basic/DataCenter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -436,5 +436,4 @@ internal static void AddDamageRec(float damageRatio)
#endregion

internal static SortedList<string, string> AuthorHashes { get; set; } = [];
internal static string[] ContributorsHash { get; set; } = [];
}
15 changes: 0 additions & 15 deletions RotationSolver/Commands/RSCommands_Actions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,21 +66,6 @@ public static void DoAction()
ControlWindow.DidTime = DateTime.Now;
}

if (nextAction is BaseAction act1 && act1.Info.IsPvP && !act1.Setting.IsFriendly
&& act1.TargetInfo.IsSingleTarget
&& act1.Target.Target is PlayerCharacter p && p != Player.Object)
{
var hash = p.EncryptString();

//Don't attack authors and contributors!!
if ((DataCenter.AuthorHashes.ContainsKey(hash)
|| DataCenter.ContributorsHash.Contains(hash)))
{
Svc.Chat.PrintError($"Please don't attack RS developers with RS by {act1}!");
return;
}
}

#if DEBUG
//if (nextAction is BaseAction acti)
// Svc.Log.Debug($"Will Do {acti}");
Expand Down
12 changes: 0 additions & 12 deletions RotationSolver/Helpers/DownloadHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,11 @@ namespace RotationSolver.Helpers;

public static class DownloadHelper
{
/// <summary>
/// <see href="https://garlandtools.org/db/#status/1093"><strong>HP and MP Boost</strong></see> ↑ (All Classes)
/// <para>Maximum HP and MP are increased.</para>
/// </summary>
public static string[] UsersHash { get; private set; } = [];
public static string[] Supporters { get; private set; } = [];
public static IncompatiblePlugin[] IncompatiblePlugins { get; private set; } = [];

public static async Task DownloadAsync()
{
IncompatiblePlugins = await DownloadOneAsync<IncompatiblePlugin[]>($"https://raw.githubusercontent.com/{Service.USERNAME}/{Service.REPO}/main/Resources/IncompatiblePlugins.json") ?? [];

DataCenter.ContributorsHash = await DownloadOneAsync<string[]>($"https://raw.githubusercontent.com/{Service.USERNAME}/{Service.REPO}/main/Resources/ContributorsHash.json") ?? [];

UsersHash = await DownloadOneAsync<string[]>($"https://raw.githubusercontent.com/{Service.USERNAME}/{Service.REPO}/main/Resources/UsersHash.json") ?? [];

Supporters = await DownloadOneAsync<string[]>($"https://raw.githubusercontent.com/{Service.USERNAME}/{Service.REPO}/main/Resources/Supporters.json") ?? [];
}

private static async Task<T?> DownloadOneAsync<T>(string url)
Expand Down
35 changes: 27 additions & 8 deletions RotationSolver/Localization/Localization.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"RotationSolver.Data.UiString.ConfigWindowHeader": "Rotation Solver Settings v",
"RotationSolver.Data.UiString.ConfigWindowHeader": "Rotation Solver Reborn Settings v",
"RotationSolver.Data.UiString.Commands_Rotation": "Open config window.",
"RotationSolver.Basic.Data.StateCommandType.Manual": "Start the addon in Manual mode. You need to choose the target manually. This will bypass any engage settings that you have set up and will start attacking immediately once something is targeted.",
"RotationSolver.Basic.Data.StateCommandType.Cancel": "Stop the addon. Always remember to turn it off when it is not in use!",
Expand All @@ -25,14 +25,14 @@
"RotationSolver.Data.UiString.ActionFriendly": "Friendly",
"RotationSolver.Data.UiString.ConfigWindow_About_Punchline": "Analyses PvE combat information in every frame and finds the best action.",
"RotationSolver.Data.UiString.ConfigWindow_About_Clicking100k": "Well, you must be a lazy player!",
"RotationSolver.Data.UiString.ConfigWindow_About_Clicking500k": "You're tiring RS out, give it a break!",
"RotationSolver.Data.UiString.ConfigWindow_About_Clicking500k": "You're tiring RSR out, give it a break!",
"RotationSolver.Data.UiString.ConfigWindow_Helper_GameVersion": "Game",
"RotationSolver.Data.UiString.ConfigWindow_Helper_SwitchRotation": "Click to switch rotations",
"RotationSolver.Data.UiString.ConfigWindow_ConditionSetDesc": "The condition set you chose, click to modify.",
"RotationSolver.Data.UiString.ConfigWindow_Searching": "Search... ",
"RotationSolver.Data.UiString.ConfigWindow_About_Description": "This means almost all the information available in one frame in combat, including the status of all players in the party, the status of any hostile targets, skill cooldowns, the MP and HP of characters, the location of characters, casting status of the hostile target, combo, combat duration, player level, etc.\n\nThen, it will highlight the best action on the hot bar, or help you to click on it.",
"RotationSolver.Data.UiString.ConfigWindow_About_Warning": "It is designed for GENERAL COMBAT, not for savage or ultimate. Use it carefully.",
"RotationSolver.Data.UiString.ConfigWindow_About_ClickingCount": "Rotation Solver helped you by clicking actions {0:N0} times.",
"RotationSolver.Data.UiString.ConfigWindow_About_ClickingCount": "RSR helped you by clicking actions {0:N0} times.",
"RotationSolver.Data.UiString.ConfigWindow_About_SayHelloCount": "You have said hello to other users {0:N0} times!",
"RotationSolver.Data.UiString.ConfigWindow_About_Macros": "Macro",
"RotationSolver.Data.UiString.ConfigWindow_About_Compatibility": "Compatibility",
Expand All @@ -49,15 +49,15 @@
"RotationSolver.Data.UiString.SpecialCommandType_MoveForward": "Move Forward",
"RotationSolver.Data.UiString.SpecialCommandType_Start": "Start ",
"RotationSolver.Data.UiString.SpecialCommandType_Manual": "Manual Target",
"RotationSolver.Data.UiString.ConfigWindow_Extra_Description": "Rotation Solver focuses on the rotation itself. These are side features. If there are some other plugins can do that, these features will be deleted.",
"RotationSolver.Data.UiString.ConfigWindow_Extra_Description": "RSR focuses on the rotation itself. These are side features. If there are some other plugins can do that, these features will be deleted.",
"RotationSolver.Data.UiString.ConfigWindow_EventItem": "Event",
"RotationSolver.Data.UiString.ConfigWindow_Extra_Others": "Others",
"RotationSolver.UI.RotationConfigWindowTab.Auto": "About some general actions usage and conditions.",
"RotationSolver.UI.RotationConfigWindowTab.UI": "Settings about the user interface.",
"RotationSolver.UI.RotationConfigWindowTab.Basic": "Basic settings",
"RotationSolver.UI.RotationConfigWindowTab.List": "Some things that have to be lists.",
"RotationSolver.UI.RotationConfigWindowTab.Rotations": "All rotations that RS has loaded.",
"RotationSolver.Data.UiString.ConfigWindow_Rotations_Download": "Download Rotations",
"RotationSolver.Data.UiString.ConfigWindow_Rotations_Download": "Update Rotations",
"RotationSolver.Data.UiString.ConfigWindow_Rotations_Links": "Links of the rotations online",
"RotationSolver.Data.UiString.ConfigWindow_Rotations_Settings": "Settings",
"RotationSolver.Data.UiString.ConfigWindow_Rotations_Loaded": "Loaded",
Expand Down Expand Up @@ -215,7 +215,7 @@
"RotationSolver.Data.UiString.ConfigWindow_Events_ShareMacro": "Is Shared",
"RotationSolver.Data.UiString.ConfigWindow_Events_DutyEnd": "Duty End: ",
"PoslockCastingName": "Lock the movement when casting or when doing some actions.",
"UseStopCastingName": "Stops casting when the target is dead.",
"UseStopCastingName": "Stop casting if the target dies.",
"AutoOpenChestName": "Auto Open the treasure chest",
"PoslockCastingDescription": "LT is for gamepad player",
"PoslockModifierName": "The modifier key to unlock the movement temporary",
Expand Down Expand Up @@ -253,7 +253,7 @@
"RotationSolver.Data.UiString.SpecialCommandType_Raise": "Raise",
"DownloadRotationsName": "Auto Download Rotations",
"AutoLoadCustomRotationsName": "Auto load rotations",
"RotationSolver.Data.UiString.ConfigWindow_Rotations_Library": "The folder contains rotation libs or the download url about rotation lib.",
"RotationSolver.Data.UiString.ConfigWindow_Rotations_Library": "The folder contains the rotation library or the download url for the rotation library.",
"RotationSolver.Data.UiString.SpecialCommandType_LimitBreak": "Limit Break",
"UseOverlayWindowDescription": "This top window is used to display some extra information on your game window, such as target's positional, target and sub-target, etc.",
"DrawingHeightName": "The height of the drawing things.",
Expand Down Expand Up @@ -405,5 +405,24 @@
"HealWhenNothingTodoDelayName": "The delay of this type of healing.",
"HealthDifferenceName": "HP for standard deviation for using AoE heal.",
"AutoHealTimeToKillName": "Stop healing when time to kill is lower then...",
"RotationSolver.Data.UiString.ConfigWindow_DutyRotationDesc": "The duty rotation you chose, click to modify."
"RotationSolver.Data.UiString.ConfigWindow_DutyRotationDesc": "The duty rotation you chose, click to modify.",
"RotationSolver.Data.UiString.ConfigWindow_About_Warnings": "System Warnings",
"RotationSolver.Data.UiString.ConfigWindow_Rotations_Warning": "Custom rotations are just like plugins and have full access to the game and your computer",
"RotationSolver.Data.UiString.ConfigWindow_Rotations_Warning2": "Please only load rotations from sources that you trust",
"AutoLoadRotationsName": "Load rotations automatically at startup",
"DownloadCustomRotationsName": "Download custom rotations from the internet",
"AutoReloadRotationsName": "Monitor local rotations for changes (Developer Mode)",
"RotationSolver.Data.UiString.ConfigWindow_Rotations_Reset": "Reset To Defaults",
"RotationSolver.Data.UiString.ConfigWindow_Rotations_Sources": "Rotation Sources:",
"RotationSolver.Basic.Data.StateCommandType.Off": "Stop the addon. Always remember to turn it off when it is not in use!",
"RotationSolver.Basic.Data.TargetingType.LowHP": "Low HP",
"DefaultRotations.Ranged.MCH_zBeta.Name": "UseQueenWhenever",
"DefaultRotations.Ranged.MCH_zBeta.DisplayName": "Uses Rook Autoturret/Automaton Queen immediately whenever you get 50 battery",
"RotationSolver.Basic.Data.TargetHostileType.AllTargetsWhenSolo": "All targets when solo, or previously engaged.",
"RotationSolver.Data.UiString.ConfigWindow_About_ThanksToSupporters": "Many thanks to the sponsors.",
"RotationSolver.Data.UiString.ConfigWindow_About_Compatibility_Others": "Please don't relog without closing the game. Crashes may occur.",
"RotationSolver.Data.UiString.ConfigWindow_About_Compatibility_Description": "Literally, Rotation Solver helps you to choose the target and then click the action. So any plugin that changes these will affect its decision.\n\nHere is a list of known incompatible plugins:",
"RotationSolver.Data.UiString.ConfigWindow_About_Compatibility_Mislead": "Conflicts with RSR decision making",
"RotationSolver.Data.UiString.ConfigWindow_About_Compatibility_Mistake": "Can't properly execute the behavior that RSR wants to do.",
"RotationSolver.Data.UiString.ConfigWindow_About_Compatibility_Crash": "Causes the game to crash."
}
26 changes: 6 additions & 20 deletions RotationSolver/UI/RotationConfigWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,11 @@ private static bool GetLocalImage(string name, out IDalamudTextureWrap texture)

var file = dir + $"\\{name}.png";

if (File.Exists(file))
if (File.Exists(file) && File.GetLastWriteTime(file).AddDays(1) < DateTime.Now)
{
File.Delete(file);
}
else if (File.Exists(file))
{
if (!_logosWrap.ContainsKey(file))
{
Expand Down Expand Up @@ -361,8 +365,7 @@ private void DrawHeader(float wholeWidth)

var frame = Environment.TickCount / 34 % FRAME_COUNT;
if (frame <= 0) frame += FRAME_COUNT;
if (GetLocalImage(Service.Config.DrawIconAnimation
? frame.ToString("D4") : "Logo", out var logo))
if (GetLocalImage("Logo", out var logo))
{
ImGui.SetCursorPos(cursor);
ImGui.Image(logo.ImGuiHandle, Vector2.One * size);
Expand Down Expand Up @@ -685,7 +688,6 @@ private static void DrawAbout()
{
{ UiString.ConfigWindow_About_Macros.Local, DrawAboutMacros},
{ UiString.ConfigWindow_About_Compatibility.Local, DrawAboutCompatibility},
{ UiString.ConfigWindow_About_Supporters.Local, DrawAboutSupporters},
{ UiString.ConfigWindow_About_Links.Local, DrawAboutLinks},
{ UiString.ConfigWindow_About_Warnings.Local, DrawAboutWarnings},
});
Expand Down Expand Up @@ -846,22 +848,6 @@ private static void DrawAboutCompatibility()
}
}
}
private static void DrawAboutSupporters()
{
ImGui.TextWrapped(UiString.ConfigWindow_About_ThanksToSupporters.Local());

var width = ImGui.GetWindowWidth();
using var font = ImRaii.PushFont(DrawingExtensions.GetFont(12));
using var color = ImRaii.PushColor(ImGuiCol.Text, ImGui.ColorConvertFloat4ToU32(ImGuiColors.DalamudYellow));

foreach (var name in DownloadHelper.Supporters)
{
ImGuiHelper.DrawItemMiddle(() =>
{
ImGui.TextWrapped(name);
}, width, ImGui.CalcTextSize(name).X);
}
}

private static void DrawAboutLinks()
{
Expand Down

0 comments on commit 633f262

Please sign in to comment.