-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: snixtho <[email protected]>
- Loading branch information
Showing
48 changed files
with
2,428 additions
and
630 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
src/Modules/GameModeUiModule/Enums/GameModeUiComponents.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 31 additions & 8 deletions
39
src/Modules/GameModeUiModule/Interfaces/IGameModeUiModuleService.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
44
src/Modules/GameModeUiModule/Models/GameModeUiComponentSettings.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
{ | ||
/// <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; | ||
} |
Oops, something went wrong.