Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

276 spec info #293

Merged
merged 60 commits into from
Sep 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
676e475
Update current map design to fit mockup
araszka Aug 20, 2024
f669ff6
Update next map widget design
araszka Aug 20, 2024
fe7f07c
Center author name in next map widget
araszka Aug 20, 2024
1f3da08
Merge remote-tracking branch 'origin/master' into 277-current-map-red…
araszka Aug 24, 2024
7dd5d85
Show correct diffs in spectator target info and update design
araszka Aug 24, 2024
9b94fc4
Stash
araszka Aug 26, 2024
face066
Add SpectatorTargetInfo tests
araszka Sep 1, 2024
8795740
Add more spectator target info tests
araszka Sep 1, 2024
3b4644d
Send updated widget to spectators if target player changes or is updated
araszka Sep 1, 2024
05c6614
Reset spectator info widgets on new round and hide on podium start
araszka Sep 1, 2024
31e8358
Remove spectators on disconnect and do not update widget if spec targ…
araszka Sep 1, 2024
5a3bdbf
Add team colors in spectator target info
araszka Sep 3, 2024
4cf93fa
Implement change spec target
araszka Sep 7, 2024
63fd01c
Make spectator info module hide Nadeo counterpart
araszka Sep 11, 2024
485d64a
Add request current spectator target after controller start to show w…
araszka Sep 11, 2024
e6a3914
Add custom cam mode widget
araszka Sep 14, 2024
51ed44f
Improve spectator info pad/keyboard detections
araszka Sep 14, 2024
635b3fe
Improve showing/hiding of spectator target info
araszka Sep 14, 2024
1066869
Simplify spectator cam mode module
araszka Sep 15, 2024
06531c4
Add dropup to select cam mode
araszka Sep 15, 2024
68fade0
Add tests for SpectatorCamModeModule
araszka Sep 15, 2024
9eb15f3
Make cam mode menu hidden by default
araszka Sep 15, 2024
c34949f
Improve detection of spectator target and simplify code
araszka Sep 18, 2024
897133e
Use 1 default rank in spectator target
araszka Sep 18, 2024
dce72d3
Fix existing spectator target tests
araszka Sep 18, 2024
751e83a
Remove redundant spec target reporting
araszka Sep 18, 2024
3cf1b98
Add tests for spectator target manialink controller
araszka Sep 18, 2024
e2bf309
Add doc comments for ISpectatorTargetInfoService
araszka Sep 20, 2024
7bbd370
Clean up GameModeUiModule
araszka Sep 21, 2024
ffb3dd6
Remove unnecessary code and add another overload to GameModeUiModuleS…
araszka Sep 21, 2024
6a0bada
Use GameModeUiModule in Scoreboard
araszka Sep 21, 2024
abd2d0f
Load GameModeUiModule before any other module else depndency might fail
araszka Sep 21, 2024
ef652c4
Add SpectatorTargetEventControllerTests
araszka Sep 21, 2024
9cd5692
Add tests for SpectatorTargetInfoService
araszka Sep 21, 2024
e677517
Add tests for CheckpointGroup
araszka Sep 21, 2024
ae3f0db
Fix TeamInfoEventControllerTests
araszka Sep 21, 2024
d262fa5
Merge remote-tracking branch 'origin/master' into 276-spec-info
araszka Sep 21, 2024
0400dc5
Merge fix
araszka Sep 21, 2024
eae31c1
Revert "Merge fix"
araszka Sep 21, 2024
328d6a9
Update SpectatorTargetInfoServiceTests
araszka Sep 21, 2024
77e599f
Remove commented out code from tests
araszka Sep 21, 2024
87a6685
Convert constants to static readonly properties
araszka Sep 21, 2024
c9cd6f9
Replace Moq with EvoSC.Testing reference
araszka Sep 21, 2024
f0e7f13
Fix dependencies in csproj
araszka Sep 21, 2024
7108c29
Add async suffix to methods
araszka Sep 21, 2024
8cfebb9
Add async suffix
araszka Sep 21, 2024
9fa18f1
Use Find instead of FirstOrDefault on List
araszka Sep 21, 2024
bdc18d0
Add curly braces
araszka Sep 21, 2024
0177d13
Fix spectator target tests
araszka Sep 21, 2024
e2b6fc9
Rename tests project to fit module name
araszka Sep 21, 2024
5bb6510
Update src/EvoSC.Common/Interfaces/Models/IPlayer.cs
araszka Sep 29, 2024
c7b685a
Add property comments to GameModeUiComponentSettings
araszka Sep 29, 2024
dbac768
Remove debug code
araszka Sep 29, 2024
9cf59fb
Make GameModeUiModuleService transient lifecycle
araszka Sep 29, 2024
99f2b96
Change log level in SpectatorTargetInfoService
araszka Sep 29, 2024
d8a66e6
Move maniascript of spectator mode to own file
araszka Sep 29, 2024
28df54d
Move SpectatorTargetInfo maniascript to own file
araszka Sep 29, 2024
c14d11b
Follow AAA principle in tests
araszka Sep 29, 2024
92ce113
Fix tests
araszka Sep 29, 2024
f468a93
Add reference to script
araszka Sep 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion EvoSC.sln
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TeamChatModule", "src/Modul
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TeamChatModule.Tests", "tests\Modules\TeamChatModule.Tests\TeamChatModule.Tests.csproj", "{7BD60D6E-7B7E-4771-87C0-7F98FC82F990}"
EndProject

Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SpectatorTargetInfoModule.Tests", "tests\Modules\SpectatorTargetInfoModule.Tests\SpectatorTargetInfoModule.Tests.csproj", "{E4BF17BE-A517-4D3C-8DCA-DA99A100EBFE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SpectatorCamModeModule", "src\Modules\SpectatorCamModeModule\SpectatorCamModeModule.csproj", "{E9806703-6E24-4F05-A728-A04F7EB31749}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SpectatorCamModeModule.Tests", "tests\Modules\SpectatorCamModeModule.Tests\SpectatorCamModeModule.Tests.csproj", "{09A88256-8008-4085-A8E6-CA6DEFAC63E3}"
EndProject



Expand Down Expand Up @@ -430,6 +435,18 @@ Global
{7BD60D6E-7B7E-4771-87C0-7F98FC82F990}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7BD60D6E-7B7E-4771-87C0-7F98FC82F990}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7BD60D6E-7B7E-4771-87C0-7F98FC82F990}.Release|Any CPU.Build.0 = Release|Any CPU
{E4BF17BE-A517-4D3C-8DCA-DA99A100EBFE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E4BF17BE-A517-4D3C-8DCA-DA99A100EBFE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E4BF17BE-A517-4D3C-8DCA-DA99A100EBFE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E4BF17BE-A517-4D3C-8DCA-DA99A100EBFE}.Release|Any CPU.Build.0 = Release|Any CPU
{E9806703-6E24-4F05-A728-A04F7EB31749}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E9806703-6E24-4F05-A728-A04F7EB31749}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E9806703-6E24-4F05-A728-A04F7EB31749}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E9806703-6E24-4F05-A728-A04F7EB31749}.Release|Any CPU.Build.0 = Release|Any CPU
{09A88256-8008-4085-A8E6-CA6DEFAC63E3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{09A88256-8008-4085-A8E6-CA6DEFAC63E3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{09A88256-8008-4085-A8E6-CA6DEFAC63E3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{09A88256-8008-4085-A8E6-CA6DEFAC63E3}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -497,5 +514,8 @@ Global
{4AA1890A-1423-4831-95B2-E29B9A7A58D1} = {6D75D6A2-6ECD-4DE4-96C5-CAD7D134407A}
{DDB0A249-BD1C-4556-BFE1-362B17EDA874} = {DC47658A-F421-4BA4-B617-090A7DFB3900}
{7BD60D6E-7B7E-4771-87C0-7F98FC82F990} = {6D75D6A2-6ECD-4DE4-96C5-CAD7D134407A}
{E4BF17BE-A517-4D3C-8DCA-DA99A100EBFE} = {6D75D6A2-6ECD-4DE4-96C5-CAD7D134407A}
{E9806703-6E24-4F05-A728-A04F7EB31749} = {DC47658A-F421-4BA4-B617-090A7DFB3900}
{09A88256-8008-4085-A8E6-CA6DEFAC63E3} = {6D75D6A2-6ECD-4DE4-96C5-CAD7D134407A}
EndGlobalSection
EndGlobal
1 change: 1 addition & 0 deletions src/EvoSC/EvoSC.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
<ProjectReference Include="..\Modules\MatchManagerModule\MatchManagerModule.csproj" />
<ProjectReference Include="..\Modules\ASayModule\ASayModule.csproj" />
<ProjectReference Include="..\Modules\ServerManagementModule\ServerManagementModule.csproj" />
<ProjectReference Include="..\Modules\SpectatorCamModeModule\SpectatorCamModeModule.csproj" />
<ProjectReference Include="..\Modules\SpectatorTargetInfoModule\SpectatorTargetInfoModule.csproj" />
<ProjectReference Include="..\Modules\TeamChatModule\TeamChatModule.csproj" />
<ProjectReference Include="..\Modules\TeamInfoModule\TeamInfoModule.csproj" />
Expand Down
4 changes: 3 additions & 1 deletion src/EvoSC/InternalModules.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
using EvoSC.Modules.Official.Scoreboard;
using EvoSC.Modules.Official.ServerManagementModule;
using EvoSC.Modules.Official.SetName;
using EvoSC.Modules.Official.SpectatorCamModeModule;
using EvoSC.Modules.Official.SpectatorTargetInfoModule;
using EvoSC.Modules.Official.TeamChatModule;
using EvoSC.Modules.Official.TeamInfoModule;
Expand All @@ -37,6 +38,7 @@ public static class InternalModules
public static readonly Type[] Modules =
[
//typeof(ExampleModule),
typeof(GameModeUiModule),
typeof(PlayerModule),
typeof(MapsModule),
typeof(WorldRecordModule),
Expand All @@ -55,14 +57,14 @@ public static class InternalModules
typeof(MatchRankingModule),
typeof(ASayModule),
typeof(SpectatorTargetInfoModule),
typeof(SpectatorCamModeModule),
typeof(MapQueueModule),
typeof(MapListModule),
typeof(LocalRecordsModule),
typeof(ForceTeamModule),
typeof(TeamSettingsModule),
typeof(ServerManagementModule),
typeof(TeamInfoModule),
typeof(GameModeUiModule),
typeof(TeamChatModule)
];

Expand Down
20 changes: 20 additions & 0 deletions src/Modules/GameModeUiModule/Enums/GameModeUiComponents.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
namespace EvoSC.Modules.Official.GameModeUiModule.Enums;

public static class GameModeUiComponents
{
public static readonly string Chrono = "Race_Chrono";
public static readonly string RespawnHelper = "Race_RespawnHelper";
public static readonly string Checkpoint = "Race_Checkpoint";
public static readonly string LapsCounter = "Race_LapsCounter";
public static readonly string TimeGap = "Race_TimeGap";
public static readonly string ScoresTable = "Race_ScoresTable";
public static readonly string DisplayMessage = "Race_DisplayMessage";
public static readonly string Countdown = "Race_Countdown";
public static readonly string SpectatorBaseName = "Race_SpectatorBase_Name";
public static readonly string SpectatorBaseCommands = "Race_SpectatorBase_Commands";
public static readonly string Record = "Race_Record";
public static readonly string BigMessage = "Race_BigMessage";
public static readonly string BlockHelper = "Race_BlockHelper";
public static readonly string WarmUp = "Race_WarmUp";
public static readonly string BestRaceViewer = "Race_BestRaceViewer";
}
2 changes: 1 addition & 1 deletion src/Modules/GameModeUiModule/GameModeUiModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace EvoSC.Modules.Official.GameModeUiModule;
[Module(IsInternal = true)]
public class GameModeUiModule(IGameModeUiModuleService gameModeUiModuleService) : EvoScModule, IToggleable
{
public Task EnableAsync() => gameModeUiModuleService.ApplyConfigurationAsync();
public Task EnableAsync() => gameModeUiModuleService.ApplyComponentSettingsAsync(gameModeUiModuleService.GetDefaultSettings());

public Task DisableAsync() => Task.CompletedTask;
}
2 changes: 0 additions & 2 deletions src/Modules/GameModeUiModule/GameModeUiModule.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
<ProjectReference Include="..\..\EvoSC.Modules\EvoSC.Modules.csproj"/>
<EmbeddedResource Include="Templates\**\*"/>
<EmbeddedResource Update="Localization.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Localization.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,27 +1,50 @@
namespace EvoSC.Modules.Official.GameModeUiModule.Interfaces;
using EvoSC.Modules.Official.GameModeUiModule.Models;

namespace EvoSC.Modules.Official.GameModeUiModule.Interfaces;

public interface IGameModeUiModuleService
{
/// <summary>
/// Applies the configured UI modules property values.
/// Applies the given game mode component settings collection.
/// </summary>
/// <param name="componentSettingsList"></param>
/// <returns></returns>
public Task ApplyConfigurationAsync();
public Task ApplyComponentSettingsAsync(IEnumerable<GameModeUiComponentSettings> componentSettingsList);

/// <summary>
/// Returns the configured UI modules properties as JSON string.
/// Applies the given game mode component settings.
/// </summary>
/// <param name="componentSettings"></param>
/// <returns></returns>
public Task<string> GetUiModulesPropertiesJsonAsync();
public Task ApplyComponentSettingsAsync(GameModeUiComponentSettings componentSettings);

/// <summary>
/// Generates a UI properties object for the given values.
/// Applies the given game mode component settings.
/// </summary>
/// <param name="uiModuleName"></param>
/// <param name="name"></param>
/// <param name="visible"></param>
/// <param name="x"></param>
/// <param name="y"></param>
/// <param name="scale"></param>
/// <returns></returns>
public Task<dynamic> GeneratePropertyObjectAsync(string uiModuleName, bool visible, double x, double y, double scale);
public Task ApplyComponentSettingsAsync(string name, bool visible, double x, double y, double scale);

/// <summary>
/// Returns the configured UI modules properties as JSON string.
/// </summary>
/// <returns></returns>
public string GetUiModulesPropertiesJson(IEnumerable<GameModeUiComponentSettings> componentSettingsList);

/// <summary>
/// Generates a UI properties object for the given values.
/// </summary>
/// <param name="componentSettings"></param>
/// <returns></returns>
public dynamic GeneratePropertyObject(GameModeUiComponentSettings componentSettings);

/// <summary>
/// Gets the default game mode component settings collection.
/// </summary>
/// <returns></returns>
public List<GameModeUiComponentSettings> GetDefaultSettings();
}
44 changes: 44 additions & 0 deletions src/Modules/GameModeUiModule/Models/GameModeUiComponentSettings.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
namespace EvoSC.Modules.Official.GameModeUiModule.Models;

public class GameModeUiComponentSettings(string name, bool visible, double x, double y, double scale)
araszka marked this conversation as resolved.
Show resolved Hide resolved
{
/// <summary>
/// The Name/ID of the game mode UI component.
/// </summary>
public string Name { get; init; } = name;

/// <summary>
/// Sets whether the component should be visible.
/// </summary>
public bool Visible { get; set; } = visible;

/// <summary>
/// Sets the X position of the component.
/// </summary>
public double X { get; set; } = x;

/// <summary>
/// Sets the Y position of the component.
/// </summary>
public double Y { get; set; } = y;

/// <summary>
/// Sets the scale of the component.
/// </summary>
public double Scale { get; set; } = scale;

/// <summary>
/// Sets whether the visibility of the component should be overwritten.
/// </summary>
public bool UpdateVisible { get; set; } = true;

/// <summary>
/// Sets whether the position of the component should be overwritten.
/// </summary>
public bool UpdatePosition { get; set; } = true;

/// <summary>
/// Sets whether the scale of the component should be overwritten.
/// </summary>
public bool UpdateScale { get; set; } = true;
}
Loading
Loading