From 27b41d33abd09db52c0ac1113913d3479c3adfdc Mon Sep 17 00:00:00 2001 From: Pat Hartl Date: Sun, 5 Feb 2023 16:11:59 -0600 Subject: [PATCH] Multiplayer mode editor component update --- .../Components/MultiplayerModeEditor.razor | 103 ++++++------------ LANCommander/Pages/Games/Edit.razor | 2 + LANCommander/Pages/_Layout.cshtml | 1 + LANCommander/wwwroot/css/site.css | 20 +--- 4 files changed, 41 insertions(+), 85 deletions(-) diff --git a/LANCommander/Components/MultiplayerModeEditor.razor b/LANCommander/Components/MultiplayerModeEditor.razor index 49120e8..0578060 100644 --- a/LANCommander/Components/MultiplayerModeEditor.razor +++ b/LANCommander/Components/MultiplayerModeEditor.razor @@ -1,85 +1,52 @@ @using LANCommander.Data.Enums @using LANCommander.Data.Models -@{ - int i = 0; -} -
- - - - - - - - - - +Multiplayer Modes - - @if (MultiplayerModes.Count == 0) - { - - } + + + Type + Min Players + Max Players + Description + + - @foreach (var multiplayerMode in MultiplayerModes) - { - var index = i; + + + + @foreach (MultiplayerType type in Enum.GetValues(typeof(MultiplayerType))) + { + @type + } + + + + + + + + + + - - - - - - - - - i++; - } - - - - -
TypeMin PlayersMax PlayersDescription
If the game has any multiplayer modes you can add them here to provide metadata to clients.
- - - - -
- -
-
-
- -
-
-
+ + Add + @code { - [Parameter] public ICollection MultiplayerModes { get; set; } - [Parameter] public Guid GameId { get; set; } + [Parameter] public Game Game { get; set; } private void AddMode() { - if (MultiplayerModes == null) - MultiplayerModes = new List(); + if (Game.MultiplayerModes == null) + Game.MultiplayerModes = new List(); - MultiplayerModes.Add(new MultiplayerMode()); + Game.MultiplayerModes.Add(new MultiplayerMode()); } - private void RemoveMode(int index) + private void RemoveMode(MultiplayerMode mode) { - MultiplayerModes.Remove(MultiplayerModes.ElementAt(index)); + Game.MultiplayerModes.Remove(mode); } } diff --git a/LANCommander/Pages/Games/Edit.razor b/LANCommander/Pages/Games/Edit.razor index f3d240f..05cc2cf 100644 --- a/LANCommander/Pages/Games/Edit.razor +++ b/LANCommander/Pages/Games/Edit.razor @@ -42,6 +42,8 @@ } + +
Save
diff --git a/LANCommander/Pages/_Layout.cshtml b/LANCommander/Pages/_Layout.cshtml index 291ef7f..d82ac1f 100644 --- a/LANCommander/Pages/_Layout.cshtml +++ b/LANCommander/Pages/_Layout.cshtml @@ -11,6 +11,7 @@ + diff --git a/LANCommander/wwwroot/css/site.css b/LANCommander/wwwroot/css/site.css index f27e5ad..2aa7083 100644 --- a/LANCommander/wwwroot/css/site.css +++ b/LANCommander/wwwroot/css/site.css @@ -1,18 +1,4 @@ -html { - font-size: 14px; -} - -@media (min-width: 768px) { - html { - font-size: 16px; - } -} - -html { - position: relative; - min-height: 100%; -} - -body { - margin-bottom: 60px; +.mud-table-cell .mud-input-control > .mud-input-control-input-container > div.mud-input.mud-input-text, +.mud-table-cell .mud-input-control { + margin-top: 0; } \ No newline at end of file