Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
fix: Rotations' isValid.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Apr 16, 2023
1 parent d6aeb32 commit 2ff4381
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 30 deletions.
22 changes: 9 additions & 13 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,6 @@ jobs:
Invoke-WebRequest -Uri https://goatcorp.github.io/dalamud-distrib/latest.zip -OutFile latest.zip
Expand-Archive -Force latest.zip "$env:AppData\XIVLauncher\addon\Hooks\dev"
- name: publish on version change
id: publish_nuget
uses: alirezanet/publish-nuget@v3.0.4
with:
PROJECT_FILE_PATH: RotationSolver.Basic/RotationSolver.Basic.csproj
VERSION_FILE_PATH: Directory.Build.props
NUGET_KEY: ${{secrets.nuget_api_key}}

- name: Build Plugin
run: |
invoke-expression 'dotnet build --no-restore --configuration Release RotationSolver'
Expand All @@ -56,6 +48,14 @@ jobs:
with:
path: .\RotationSolver\bin\Release\RotationSolver\

- name: publish on version change
id: publish_nuget
uses: alirezanet/publish-nuget@v3.0.4
with:
PROJECT_FILE_PATH: RotationSolver.Basic/RotationSolver.Basic.csproj
VERSION_FILE_PATH: Directory.Build.props
NUGET_KEY: ${{secrets.nuget_api_key}}

release:
name: release
needs: build
Expand All @@ -78,11 +78,7 @@ jobs:
asset_name: latest.zip
asset_content_type: application/zip

on-released:
runs-on: ubuntu-latest
needs: release
steps:
- name: Trigger Repo Update
uses: peter-evans/repository-dispatch@v2
with:
event-type: new-release
event-type: new-release
17 changes: 1 addition & 16 deletions RotationSolver.Basic/Rotations/CustomRotation_BasicInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,27 +72,12 @@ public bool IsEnabled

public IAction AntiKnockbackAbility { get; private set; }

public bool IsValid { get; } = false;
public bool IsValid { get; private set; } = true;

private protected CustomRotation()
{
IconID = IconSet.GetJobIcon(this);
Configs = CreateConfiguration();

try
{
for (byte i = 0; i < 3; i++)
{
Ability(i, GCD(i, true, true), out _, true, true);
}
IsValid = true;
}
catch (Exception ex)
{
PluginLog.Warning(ex, $"The rotation {Name} is not valid, please tell to the author");
IsValid = false;
}

}

protected virtual IRotationConfigSet CreateConfiguration()
Expand Down
8 changes: 7 additions & 1 deletion RotationSolver.Basic/Rotations/CustomRotation_Invoke.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ namespace RotationSolver.Basic.Rotations;

public abstract partial class CustomRotation
{
Exception _lastException;
public bool TryInvoke(out IAction newAction, out IAction gcdAction)
{
newAction = gcdAction = null;
Expand Down Expand Up @@ -69,7 +70,12 @@ public bool TryInvoke(out IAction newAction, out IAction gcdAction)
}
catch(Exception ex)
{
PluginLog.Error(ex, "Failed to invoke the next action");
if(_lastException != ex)
{
PluginLog.Error(ex, "Failed to invoke the next action");
}
_lastException = ex;
IsValid = false;
}

return newAction != null;
Expand Down

0 comments on commit 2ff4381

Please sign in to comment.