Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
fix: add ShowStatus for showing the things in formal page.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Aug 11, 2023
1 parent 4cd7ff5 commit 86bdd6b
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 3 deletions.
2 changes: 2 additions & 0 deletions RotationSolver.Basic/Rotations/CustomRotation_BasicInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public bool IsEnabled
public IAction ActionMoveForwardAbility { get; private set; }

public IAction ActionMoveBackAbility { get; private set; }

public IAction ActionSpeedAbility { get; private set; }

public IAction EsunaStanceNorthGCD { get; private set; }
Expand All @@ -81,6 +82,7 @@ public bool IsEnabled
public bool IsValid { get; private set; } = true;
public string WhyNotValid { get; private set; } = string.Empty;

public virtual bool ShowStatus => false;
private protected CustomRotation()
{
IconID = IconSet.GetJobIcon(this);
Expand Down
5 changes: 5 additions & 0 deletions RotationSolver.Basic/Rotations/ICustomRotation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ namespace RotationSolver.Basic.Rotations;
/// </summary>
public interface ICustomRotation : ITexture
{
/// <summary>
/// Whether show the status in the formal page.
/// </summary>
bool ShowStatus { get; }

/// <summary>
/// Is this rotation valid.
/// </summary>
Expand Down
1 change: 1 addition & 0 deletions RotationSolver/Localization/Localization.json
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,7 @@
"ConfigWindow_About_Compatibility_Mislead": "Misleading RS to make the right decision.",
"ConfigWindow_About_Compatibility_Crash": "Cause the game to crash.",
"ConfigWindow_Rotation_Description": "Description",
"ConfigWindow_Rotation_Status": "Status",
"ConfigWindow_Rotation_Configuration": "Configuration",
"ConfigWindow_Rotation_Information": "Information",
"ConfigWindow_Actions_Description": "To customize when Rotation Solver uses specific actions automatically, click on an action's icon in the left list. Below, you may set the conditions for when that specific action is used. Each action can have a different set of conditions to override the default rotation behavior.",
Expand Down
1 change: 1 addition & 0 deletions RotationSolver/Localization/Strings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,7 @@ internal partial class Strings
public string ConfigWindow_About_Compatibility_Crash { get; set; } = "Cause the game to crash.";

public string ConfigWindow_Rotation_Description { get; set; } = "Description";
public string ConfigWindow_Rotation_Status { get; set; } = "Status";
public string ConfigWindow_Rotation_Configuration { get; set; } = "Configuration";
public string ConfigWindow_Rotation_Information { get; set; } = "Information";

Expand Down
20 changes: 17 additions & 3 deletions RotationSolver/UI/RotationConfigWindowNew.cs
Original file line number Diff line number Diff line change
Expand Up @@ -600,12 +600,14 @@ private static void DrawRotation()

_rotationHeader.Draw();
}

private static readonly CollapsingHeaderGroup _rotationHeader = new(new()
{
{ () => LocalizationManager.RightLang.ConfigWindow_Rotation_Description, DrawRotationDescription},
{ () => LocalizationManager.RightLang.ConfigWindow_Rotation_Description, DrawRotationDescription },

{ GetRotationStatusHead , DrawRotationStatus },

{ () => LocalizationManager.RightLang.ConfigWindow_Rotation_Configuration, DrawRotationConfiguration},
{ () => LocalizationManager.RightLang.ConfigWindow_Rotation_Configuration, DrawRotationConfiguration },

{ () => LocalizationManager.RightLang.ConfigWindow_Rotation_Information, DrawRotationInformation },
});
Expand Down Expand Up @@ -712,6 +714,18 @@ internal static void DrawLinkDescription(LinkDescription link, float wholeWidth,
}
}

private static string GetRotationStatusHead()
{
var rotation = RotationUpdater.RightNowRotation;
if (rotation == null || !rotation.ShowStatus) return string.Empty;
return LocalizationManager.RightLang.ConfigWindow_Rotation_Status;
}

private static void DrawRotationStatus()
{
RotationUpdater.RightNowRotation?.DisplayStatus();
}

private static void DrawRotationConfiguration()
{
var rotation = RotationUpdater.RightNowRotation;
Expand Down

0 comments on commit 86bdd6b

Please sign in to comment.