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

Commit

Permalink
fix: add warning in CN server.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed May 26, 2023
1 parent a9a4422 commit 5b06021
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions RotationSolver/Updaters/MajorUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ namespace RotationSolver.Updaters;

internal static class MajorUpdater
{
public static bool IsValid => Svc.Condition.Any() && Player.Available && !SocialUpdater.InPvp;
public static bool IsValid => Svc.Condition.Any()
&& !Svc.Condition[ConditionFlag.BetweenAreas]
&& !Svc.Condition[ConditionFlag.BetweenAreas51]
&& Player.Available && !SocialUpdater.InPvp;
public static bool ShouldPreventActions => Basic.Configuration.PluginConfiguration.GetValue(SettingsCommand.PreventActions)
&& Basic.Configuration.PluginConfiguration.GetValue(SettingsCommand.PreventActionsDuty)
&& Svc.Condition[ConditionFlag.BoundByDuty]
Expand All @@ -21,6 +24,7 @@ internal static class MajorUpdater
private static readonly Dictionary<int, bool> _values = new();
#endif

static bool _showed;
private static void FrameworkUpdate(Framework framework)
{
RotationSolverPlugin.UpdateDisplayWindow();
Expand All @@ -29,6 +33,14 @@ private static void FrameworkUpdate(Framework framework)
TargetUpdater.ClearTarget();
return;
}
if ((int)Svc.ClientState.ClientLanguage == 4 && !_showed)
{
_showed = true;
var warning = "Rotation Solver 未进行国服适配并不提供相关支持!";
Svc.Toasts.ShowError(warning);
Svc.Chat.PrintError(warning);
}


#if DEBUG
//Get changed condition.
Expand All @@ -42,7 +54,9 @@ private static void FrameworkUpdate(Framework framework)
bool newValue = Svc.Condition[(ConditionFlag)indexs[i]];
if (_values.TryGetValue(i, out bool value) && value != newValue && indexs[i] != 48 && indexs[i] != 27)
{
//Svc.Toasts.ShowQuest(indexs[i].ToString() + " " + key + ": " + newValue.ToString());
var str = indexs[i].ToString() + " " + key + ": " + newValue.ToString();
Svc.Chat.Print(str);
Svc.Toasts.ShowQuest(str);
}
_values[i] = newValue;
}
Expand Down

0 comments on commit 5b06021

Please sign in to comment.