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

Commit

Permalink
fix: add an option for saying hello to users.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Sep 27, 2023
1 parent 85634a4 commit 8c96494
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
1 change: 1 addition & 0 deletions RotationSolver.Basic/Configuration/Configs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@ public enum PluginConfigBool : byte

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

public enum PluginConfigFloat : byte
Expand Down
2 changes: 2 additions & 0 deletions RotationSolver/Localization/Strings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -675,6 +675,7 @@ internal class Strings
public string ConfigWindow_List_NoProvokeName { get; set; } = "The name of the enemy that you don't want to be provoked";

public string ConfigWindow_Basic_AutoSwitch { get; set; } = "Auto Switch";
public string ConfigWindow_Basic_Others { get; set; } = "Others";

public string ConfigWindow_Basic_Timer { get; set; } = "Timer";
public string ConfigWindow_UI_Windows { get; set; } = "Windows";
Expand Down Expand Up @@ -746,4 +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.";
}
12 changes: 7 additions & 5 deletions RotationSolver/UI/RotationConfigWindow_Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,12 @@ private static void DrawBasic()
{
{ () => LocalizationManager.RightLang.ConfigWindow_Basic_Timer, DrawBasicTimer },
{ () => LocalizationManager.RightLang.ConfigWindow_Basic_AutoSwitch, DrawBasicAutoSwitch },
{ () => "Others", () =>
{ () => LocalizationManager.RightLang.ConfigWindow_Basic_Others, () =>
{
foreach (var searchable in _basicParamsSearchable)
{
searchable?.Draw(Job);
}
foreach (var searchable in _basicParamsSearchable)
{
searchable?.Draw(Job);
}
} },
});

Expand Down Expand Up @@ -288,6 +288,8 @@ private static void DrawBasicAutoSwitch()

new CheckBoxSearchPlugin(PluginConfigBool.UseWorkTask),

new CheckBoxSearchPlugin(PluginConfigBool.SayHelloToUsers),

new DragFloatSearchPlugin(PluginConfigFloat.MistakeRatio, 0.002f),

new DragFloatRangeSearchPlugin(PluginConfigFloat.NotInCombatDelayMin, PluginConfigFloat.NotInCombatDelayMax, 0.002f),
Expand Down
9 changes: 6 additions & 3 deletions RotationSolver/Updaters/SocialUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,12 @@ private static async void SayHelloToAuthor()
.Where(p => DownloadHelper.ContributorsHash.Contains(p.Item2))
.Select(p => new ContributorChatEntity(p.player));

entities = entities.Union(players
.Where(p => DownloadHelper.UsersHash.Contains(p.Item2))
.Select(p => new UserChatEntity(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 8c96494

Please sign in to comment.