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

Commit

Permalink
fix: fix some control window showing stuff.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Mar 19, 2023
1 parent 20bdb07 commit b363364
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 13 deletions.
3 changes: 2 additions & 1 deletion RotationSolver.Basic/Configuration/PluginConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public class PluginConfiguration : IPluginConfiguration
public MacroInfo DutyEnd { get; set; } = new MacroInfo();

public bool ShowControlWindow = false;
public bool IsControlWindowLock = true;
public bool IsControlWindowLock = false;
public bool UseKeyboardCommand = false;
public bool UseGamepadCommand = false;

Expand All @@ -167,6 +167,7 @@ public class PluginConfiguration : IPluginConfiguration
public float ControlWindow0GCDSize = 30;
public float ControlWindowNextSizeRatio = 1.5f;
public float ControlProgressHeight = 8;
public bool ControlShowCooldown = false;

public Dictionary<StateCommandType, KeyRecord> KeyState { get; set; } = new Dictionary<StateCommandType, KeyRecord>();
public Dictionary<SpecialCommandType, KeyRecord> KeySpecial { get; set; } = new Dictionary<SpecialCommandType, KeyRecord>();
Expand Down
16 changes: 8 additions & 8 deletions RotationSolver/Commands/RSCommands_Actions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,16 @@ internal static unsafe void DoAnAction(bool isGCD)
if (DateTime.Now - _fastClickStopwatch < _fastSpan) return;
_fastClickStopwatch = DateTime.Now;

//Do Action
var nextAction = ActionUpdater.NextAction;
if (nextAction == null) return;
#if DEBUG
//if (nextAction is BaseAction acti)
// Service.ChatGui.Print($"Will Do {acti} {ActionUpdater.WeaponElapsed}");
#endif
if (SocialUpdater.InHighEndDuty && !RotationUpdater.RightNowRotation.IsAllowed(out var str))
{
if(_loop % 5 == 0)
if (_loop % 5 == 0)
{
Service.ToastGui.ShowError(string.Format(LocalizationManager.RightLang.HighEndBan, str));
}
Expand All @@ -35,13 +42,6 @@ internal static unsafe void DoAnAction(bool isGCD)
return;
}

//Do Action
var nextAction = ActionUpdater.NextAction;
#if DEBUG
//if (nextAction is BaseAction acti)
// Service.ChatGui.Print($"Will Do {acti} {ActionUpdater.WeaponElapsed}");
#endif
if (nextAction == null) return;
if (!isGCD && nextAction is BaseAction act1 && act1.IsRealGCD) return;

if (nextAction.Use())
Expand Down
10 changes: 6 additions & 4 deletions RotationSolver/UI/ControlWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ internal class ControlWindow : Window
public ControlWindow()
: base(nameof(ControlWindow), _baseFlags)
{
this.IsOpen = true;
Size = new Vector2(540f, 490f);
//SizeCondition = ImGuiCond.FirstUseEver;
}

public override void PreDraw()
Expand Down Expand Up @@ -79,10 +80,10 @@ public override void Draw()
DrawSpecials();

ImGui.Columns(1);
ImGui.Separator();

if(RotationUpdater.RightNowRotation!= null)
if(Service.Config.ControlShowCooldown && RotationUpdater.RightNowRotation!= null)
{
ImGui.Separator();
foreach (var pair in RotationUpdater.AllGroupedActions)
{
ImGui.Text(pair.Key);
Expand Down Expand Up @@ -126,7 +127,8 @@ private static void DrawActionCooldown(IAction act)

if(act is IBaseAction bAct && bAct.MaxCharges > 1)
{
//Draw charges here.
ImGui.SetCursorPos(pos);
ImGui.TextDisabled(bAct.CurrentCharges.ToString());
}

ImGui.EndGroup();
Expand Down
3 changes: 3 additions & 0 deletions RotationSolver/UI/RotationConfigWindow_Control.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ private void DrawControlTab()

if (!Service.Config.ShowControlWindow) return;

DrawCheckBox(LocalizationManager.RightLang.ConfigWindow_Control_IsControlWindowLock,
ref Service.Config.IsControlWindowLock);

DrawCheckBox(LocalizationManager.RightLang.ConfigWindow_Control_UseKeyboardCommand,
ref Service.Config.UseKeyboardCommand);

Expand Down

0 comments on commit b363364

Please sign in to comment.