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

Commit

Permalink
fix: fixed load rotation and pulse bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Apr 20, 2023
1 parent 15ae1f7 commit ae84281
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 8 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>2.3.3.1</Version>
<Version>2.3.3.2</Version>
<PlatformTarget>x64</PlatformTarget>
<Platforms>AnyCPU</Platforms>

Expand Down
22 changes: 22 additions & 0 deletions Resources/AnimationLockTime.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
{
"5": 2.1,
"31": 0.6,
"37": 0.6,
"42": 0.6,
"45": 0.6,
"48": 0.6,
"52": 0.6,
"53": 0.6,
"54": 0.6,
Expand All @@ -24,21 +26,41 @@
"3555": 0.6,
"3556": 0.6,
"3557": 0.6,
"3617": 0.6,
"3621": 0.6,
"3623": 0.6,
"3624": 0.6,
"3625": 0.6,
"3629": 0.6,
"3632": 0.6,
"3639": 0.6,
"3640": 0.6,
"3643": 0.6,
"4262": 0.6,
"7386": 0.6,
"7387": 0.6,
"7389": 0.6,
"7390": 0.6,
"7392": 0.6,
"7395": 0.6,
"7396": 0.6,
"7398": 0.6,
"7399": 0.6,
"7400": 0.6,
"7546": 0.6,
"7548": 0.6,
"9826": 0.1,
"16465": 0.6,
"16469": 0.6,
"16470": 0.6,
"16472": 0.6,
"16478": 0.8,
"16479": 0.6,
"16480": 1.5,
"25753": 1.15,
"25755": 0.6,
"25756": 0.6,
"25757": 0.6,
"25771": 0.6,
"25772": 0.6,
"25773": 0.6
Expand Down
9 changes: 5 additions & 4 deletions RotationSolver/Commands/RSCommands_Actions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ internal static unsafe void DoAnAction(bool isGCD)

if (!isGCD && nextAction is IBaseAction act1 && act1.IsRealGCD) return;

if (Service.Config.KeyBoardNoise)
{
PreviewUpdater.PulseActionBar(nextAction.AdjustedID);
}

if (nextAction.Use())
{
if (nextAction is BaseAction act)
Expand All @@ -68,10 +73,6 @@ internal static unsafe void DoAnAction(bool isGCD)
}

}
else if (Service.Config.KeyBoardNoise)
{
PreviewUpdater.PulseActionBar(nextAction.AdjustedID);
}
return;
}

Expand Down
2 changes: 0 additions & 2 deletions RotationSolver/Localization/Localization.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
"ConfigWindow_Param_UseOverlayWindowDesc": "This top window is used to display some extra information on your game window, such as target's positional, target and sub-target, etc.",
"ConfigWindow_Param_Basic": "Basic",
"ConfigWindow_Param_ActionAhead": "Set the time advance of using actions",
"ConfigWindow_Param_AbilitiesInterval": "Set the interval between 0GCD using",
"ConfigWindow_Param_CountDownAhead": "Set the time advance of using casting actions on counting down.",
"ConfigWindow_Param_SpecialDuration": "Set the duration of special windows set by commands",
"ConfigWindow_Param_AddDotGCDCount": "Set GCD advance of DOT refresh",
Expand Down Expand Up @@ -92,7 +91,6 @@
"ConfigWindow_Param_KeyBoardNoise": "Simulate the effect of pressing",
"ConfigWindow_Param_KeyBoardNoiseBefore": "Simulate before action cast",
"ConfigWindow_Param_KeyBoardNoiseTimes": "Effect times",
"ConfigWindow_Param_KeyBoardNoiseTime": "Effect interval",
"ConfigWindow_Param_VoiceVolume": "Voice volume",
"ConfigWindow_Param_ToastPositional": "Hint positional anticipation by Toast",
"ConfigWindow_Param_SayPositional": "Hint positional anticipation by shouting",
Expand Down
15 changes: 14 additions & 1 deletion RotationSolver/Updaters/RotationUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ group author by author.Item2 into gr

_customRotations = (
from a in assemblies
from t in a.GetTypes()
from t in TryGetTypes(a)
where t.GetInterfaces().Contains(typeof(ICustomRotation))
&& !t.IsAbstract && !t.IsInterface
select GetRotation(t) into rotation
Expand All @@ -160,6 +160,19 @@ group rotation by rotation.JobIDs[0] into rotationGrp
.ToDictionary(set => set.Key, set => set.OrderBy(i => i.jobId).ToArray()));
}

private static Type[] TryGetTypes(Assembly assembly)
{
try
{
return assembly.GetTypes();
}
catch(Exception ex)
{
PluginLog.Warning(ex, $"Failed to load the types from {assembly.FullName}");
return new Type[0];
}
}

private static ICustomRotation GetRotation(Type t)
{
try
Expand Down

0 comments on commit ae84281

Please sign in to comment.