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

Commit

Permalink
fix: the say hello feature can be disabled entirely.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Sep 27, 2023
1 parent 8c96494 commit eeeef6a
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion RotationSolver.Basic/Configuration/Configs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ public enum PluginConfigBool : byte

[Default(true)] HealWhenNothingTodo,
[Default(true)] UseResourcesAction,
[Default(true)] SayHelloToUsers,
[Default(true)] SayHelloToParticipants,
}

public enum PluginConfigFloat : byte
Expand Down
1 change: 1 addition & 0 deletions RotationSolver/Localization/ConfigTranslation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ internal static class ConfigTranslation
PluginConfigBool.ToggleManual => LocalizationManager.RightLang.ConfigWindow_Param_ToggleManual,
PluginConfigBool.ToggleAuto => LocalizationManager.RightLang.ConfigWindow_Param_ToggleAuto,
PluginConfigBool.UseStopCasting => LocalizationManager.RightLang.ConfigWindow_Param_UseStopCasting,
PluginConfigBool.SayHelloToParticipants => LocalizationManager.RightLang.ConfigWindow_Basic_SayHelloToParticipants,

// UI
PluginConfigBool.HideWarning => LocalizationManager.RightLang.ConfigWindow_UI_HideWarning,
Expand Down
2 changes: 1 addition & 1 deletion RotationSolver/Localization/Strings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -747,5 +747,5 @@ internal class Strings

public string ConfigWindow_Auto_UseResourcesAction { get; set; } = "Use actions that use resources";
public string ConfigWindow_Auto_HealthForAutoDefense { get; set; } = "HP Ratio about defense single of Tanks";
public string ConfigWindow_Basic_SayHelloToUsers { get; set; } = "Say hello to the users of Rotation Solver.";
public string ConfigWindow_Basic_SayHelloToParticipants { get; set; } = "Say hello to the participants of Rotation Solver.";
}
2 changes: 1 addition & 1 deletion RotationSolver/UI/RotationConfigWindow_Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ private static void DrawBasicAutoSwitch()

new CheckBoxSearchPlugin(PluginConfigBool.UseWorkTask),

new CheckBoxSearchPlugin(PluginConfigBool.SayHelloToUsers),
new CheckBoxSearchPlugin(PluginConfigBool.SayHelloToParticipants),

new DragFloatSearchPlugin(PluginConfigFloat.MistakeRatio, 0.002f),

Expand Down
11 changes: 6 additions & 5 deletions RotationSolver/Updaters/SocialUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,15 @@ internal static async void UpdateSocial()
#endif
Service.Config.GlobalConfig.DutyStart.AddMacro();
await Task.Delay(new Random().Next(1000, 1500));
SayHelloToAuthor();

if (Service.Config.GetValue(Basic.Configuration.PluginConfigBool.SayHelloToParticipants))
{
SayHelloToParticipants();
}
}
}

private static async void SayHelloToAuthor()
private static async void SayHelloToParticipants()
{
var players = DataCenter.AllianceMembers.OfType<PlayerCharacter>()
#if DEBUG
Expand All @@ -159,12 +163,9 @@ private static async void SayHelloToAuthor()
.Where(p => DownloadHelper.ContributorsHash.Contains(p.Item2))
.Select(p => new ContributorChatEntity(p.player));

if (Service.Config.GetValue(Basic.Configuration.PluginConfigBool.SayHelloToUsers))
{
entities = entities.Union(players
.Where(p => DownloadHelper.UsersHash.Contains(p.Item2))
.Select(p => new UserChatEntity(p.player)));
}

entities = entities.Union(players
.Select(c =>
Expand Down

0 comments on commit eeeef6a

Please sign in to comment.