Skip to content

Commit

Permalink
Remove HideTeamSettingsForEveryoneAsync
Browse files Browse the repository at this point in the history
  • Loading branch information
araszka committed Jul 9, 2024
1 parent 266dcf7 commit eceb915
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,4 @@ public Task<string> GenerateClubLinkUrl(
/// <param name="player">The player where team settings should be closed.</param>
/// <returns></returns>
public Task HideTeamSettingsAsync(IPlayer player);

/// <summary>
/// Hides the team settings for every player.
/// Only used when module is unloaded.
/// </summary>
/// <returns></returns>
public Task HideTeamSettingsForEveryoneAsync();
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

namespace EvoSC.Modules.Official.TeamSettingsModule.Services;

[Service(LifeStyle = ServiceLifeStyle.Scoped)]
[Service(LifeStyle = ServiceLifeStyle.Singleton)]
public class TeamSettingsService(IServerClient server, IManialinkManager manialinks, Locale locale)
: ITeamSettingsService
{
Expand Down Expand Up @@ -74,7 +74,4 @@ await manialinks.SendManialinkAsync(player, "TeamSettings.EditTeamSettings",

public async Task HideTeamSettingsAsync(IPlayer player)
=> await manialinks.HideManialinkAsync(player, "TeamSettings.EditTeamSettings");

public async Task HideTeamSettingsForEveryoneAsync() =>
await manialinks.HideManialinkAsync("TeamSettings.EditTeamSettings");
}
5 changes: 2 additions & 3 deletions src/Modules/TeamSettingsModule/TeamSettingsModule.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
using EvoSC.Modules.Attributes;
using EvoSC.Modules.Interfaces;
using EvoSC.Modules.Official.TeamSettingsModule.Interfaces;

namespace EvoSC.Modules.Official.TeamSettingsModule;

[Module(IsInternal = true)]
public class TeamSettingsModule(ITeamSettingsService teamSettingsService) : EvoScModule, IToggleable
public class TeamSettingsModule : EvoScModule, IToggleable
{
public Task EnableAsync() => Task.CompletedTask;

public Task DisableAsync() => teamSettingsService.HideTeamSettingsForEveryoneAsync();
public Task DisableAsync() => Task.CompletedTask;
}

0 comments on commit eceb915

Please sign in to comment.