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

Commit

Permalink
fix: fixed rotation type displaying.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Feb 5, 2024
1 parent 2442b35 commit beffdf2
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 21 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<TargetFramework>net7.0-windows</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Authors>ArchiTed</Authors>
<Version>4.0.0</Version>
<Version>4.0.0.1</Version>
<PlatformTarget>x64</PlatformTarget>
<Platforms>AnyCPU</Platforms>
<LangVersion>latest</LangVersion>
Expand Down
1 change: 1 addition & 0 deletions RotationSolver.Basic/Actions/ActionBasicInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ internal readonly bool BasicCheck(bool skipStatusProvideCheck, bool skipCombo, b
&& DataCenter.TimeSinceLastAction.TotalSeconds < 3) return false;

if (!(_action.Setting.ActionCheck?.Invoke() ?? true)) return false;
if (!(_action.Setting.RotationCheck?.Invoke() ?? true)) return false;

return true;
}
Expand Down
6 changes: 3 additions & 3 deletions RotationSolver.Basic/Actions/ActionSetting.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ public class ActionSetting()
/// </summary>
public StatusID[]? StatusNeed { get; set; } = null;

public Func<bool>? ActionCheck { get; set; } = null;

public Func<ActionConfig>? CreateConfig { get; set; } = null;
public Func<bool>? RotationCheck { get; set; } = null;
internal Func<bool>? ActionCheck { get; set; } = null;

internal Func<ActionConfig>? CreateConfig { get; set; } = null;

public bool IsFriendly { get; set; }

Expand Down
2 changes: 0 additions & 2 deletions RotationSolver.Basic/Rotations/CustomRotation_BasicInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ namespace RotationSolver.Basic.Rotations;
[Jobs()]
partial class CustomRotation : ICustomRotation
{
public abstract CombatType Type { get; }

private Job? _job = null;
public Job Job => _job ??= this.GetType().GetCustomAttribute<JobsAttribute>()?.Jobs[0] ?? Job.ADV;

Expand Down
5 changes: 0 additions & 5 deletions RotationSolver.Basic/Rotations/ICustomRotation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@ namespace RotationSolver.Basic.Rotations;
/// </summary>
public interface ICustomRotation : ITexture
{
/// <summary>
/// The type of this rotation, pvp, pve, or both.
/// </summary>
CombatType Type { get; }

/// <summary>
/// The average count of not recommend members using.
/// </summary>
Expand Down
12 changes: 8 additions & 4 deletions RotationSolver/Commands/RSCommands_Actions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,15 @@ public static void DoAction()

if (act.Setting.EndSpecial) ResetSpecial();
#if DEBUG
Svc.Chat.Print(act.Name);
Svc.Chat.Print(act.Target?.Target?.Name.TextValue ?? string.Empty);
//foreach (var item in act.AffectedTargets)
//Svc.Chat.Print(act.Name);

//if(act.Target != null)
//{
// Svc.Chat.Print(item?.Name.TextValue ?? string.Empty);
// Svc.Chat.Print(act.Target.Value.Target?.Name.TextValue ?? string.Empty);
// foreach (var item in act.Target.Value.AffectedTargets)
// {
// Svc.Chat.Print(item?.Name.TextValue ?? string.Empty);
// }
//}
#endif
//Change Target
Expand Down
12 changes: 6 additions & 6 deletions RotationSolver/UI/RotationConfigWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -408,11 +408,11 @@ private void DrawHeader(float wholeWidth)

if (DataCenter.Territory?.IsPvpZone ?? false)
{
rotations = rotations.Where(r => r.GetType().GetCustomAttribute<RotationAttribute>()?.Type.HasFlag(CombatType.PvP) ?? false).ToArray();
rotations = rotations.Where(r => r.GetCustomAttribute<RotationAttribute>()?.Type.HasFlag(CombatType.PvP) ?? false).ToArray();
}
else
{
rotations = rotations.Where(r => r.GetType().GetCustomAttribute<RotationAttribute>()?.Type.HasFlag(CombatType.PvE) ?? false).ToArray();
rotations = rotations.Where(r => r.GetCustomAttribute<RotationAttribute>()?.Type.HasFlag(CombatType.PvE) ?? false).ToArray();
}

var iconSize = Math.Max(Scale * MIN_COLUMN_WIDTH, Math.Min(wholeWidth, Scale * JOB_ICON_WIDTH));
Expand Down Expand Up @@ -477,15 +477,15 @@ private void DrawRotationIcon(ICustomRotation rotation, float iconSize)
ImguiTooltips.ShowTooltip(() =>
{
ImGui.Text(rotation.Name + $" ({rotation.GetType().GetCustomAttribute<RotationAttribute>()!.Name})");
rotation.Type.Draw();
rotation.GetType().GetCustomAttribute<RotationAttribute>()!.Type.Draw();
if (!string.IsNullOrEmpty(rotation.Description))
{
ImGui.Text(rotation.Description);
}
});
}

if (IconSet.GetTexture(rotation.Type.GetIcon(), out var texture))
if (IconSet.GetTexture(rotation.GetType().GetCustomAttribute<RotationAttribute>()!.Type.GetIcon(), out var texture))
{
ImGui.SetCursorPos(cursor + Vector2.One * iconSize / 2);

Expand Down Expand Up @@ -514,7 +514,7 @@ private static void DrawRotationCombo(float comboSize, Type[] rotations, ICustom
{
foreach (var r in rotations)
{
var rAttr = r.GetType().GetCustomAttribute<RotationAttribute>()!;
var rAttr = r.GetCustomAttribute<RotationAttribute>()!;

if (IconSet.GetTexture(rAttr.Type.GetIcon(), out var texture))
{
Expand All @@ -523,7 +523,7 @@ private static void DrawRotationCombo(float comboSize, Type[] rotations, ICustom
{
ImguiTooltips.ShowTooltip(() =>
{
rotation.Type.Draw();
rotation.GetType().GetCustomAttribute<RotationAttribute>()!.Type.Draw();
});
}
}
Expand Down

0 comments on commit beffdf2

Please sign in to comment.