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

Commit

Permalink
fix: add two options for cooldown window.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Mar 22, 2023
1 parent 2ef07a3 commit 45047a0
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
2 changes: 2 additions & 0 deletions RotationSolver.Basic/Configuration/PluginConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ public class PluginConfiguration : IPluginConfiguration
public bool IsInfoWindowLock = false;
public bool UseKeyboardCommand = false;
public bool UseGamepadCommand = false;
public bool ShowItemsCooldown = false;
public int CooldownActionOneLine = 14;

public Vector4 ControlWindowLockBg = new Vector4(0, 0, 0, 0.6f);
public Vector4 ControlWindowUnlockBg = new Vector4(0, 0, 0, 0.9f);
Expand Down
4 changes: 4 additions & 0 deletions RotationSolver/Localization/Strings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,10 @@ internal partial class Strings
public string ConfigWindow_Control_UseGamepadCommand { get; set; } = "Use GamePad Command";
public string ConfigWindow_Control_ShowCooldownWindow { get; set; } = "Show Cooldown Window";
public string ConfigWindow_Control_IsWindowLock { get; set; } = "Lock";

public string ConfigWindow_Control_ShowItemsCooldown { get; set; } = "Show Items' Cooldown";

public string ConfigWindow_Control_CooldownActionOneLine { get; set; } = "The count of cooldown actions in one line.";
public string ConfigWindow_Control_BackgroundColor { get; set; } = "Control Window's Background";
public string ConfigWindow_Control_InfoWindowBg { get; set; } = "Next Action Window's Background";
public string ConfigWindow_Control_ControlWindowGCDSize { get; set; } = "GCD icon size";
Expand Down
3 changes: 2 additions & 1 deletion RotationSolver/UI/CooldownWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,14 @@ public override void Draw()
var showItems = pair.Where(i => !(i is IBaseAction a && a.IsGeneralGCD)).OrderBy(a => a.ID);

if (!showItems.Any()) continue;
if (!Service.Config.ShowItemsCooldown && showItems.Any(i => i is IBaseItem)) continue;

ImGui.Text(pair.Key);

uint started = 0;
foreach (var item in showItems)
{
if (started % 14 != 0)
if (started % Math.Max(1, Service.Config.CooldownActionOneLine) != 0)
{
ImGui.SameLine();
}
Expand Down
8 changes: 8 additions & 0 deletions RotationSolver/UI/RotationConfigWindow_Control.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ private void DrawControlTab()

DrawCheckBox(LocalizationManager.RightLang.ConfigWindow_Control_IsWindowLock,
ref Service.Config.IsInfoWindowLock);

if (Service.Config.ShowCooldownWindow)
{
DrawCheckBox(LocalizationManager.RightLang.ConfigWindow_Control_ShowItemsCooldown,
ref Service.Config.ShowItemsCooldown);

DrawIntNumber(LocalizationManager.RightLang.ConfigWindow_Control_CooldownActionOneLine, ref Service.Config.CooldownActionOneLine, min: 1, max: 30);
}
}

ImGui.Separator();
Expand Down

0 comments on commit 45047a0

Please sign in to comment.