mod layout
This commit is contained in:
parent
6b95c25d9c
commit
99505c1cb4
|
|
@ -0,0 +1,11 @@
|
||||||
|
<!-- Fixierter Bereich innerhalb des Containers -->
|
||||||
|
<div style="position: sticky; top: 64px; z-index: 100; background-color: var(--mud-palette-surface); padding: 16px 0; margin: 0 -24px; padding-left: 24px; padding-right: 24px; box-shadow: 0 2px 4px rgba(0,0,0,0.1);">
|
||||||
|
<MudToolBar>
|
||||||
|
@ChildContent
|
||||||
|
</MudToolBar>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@code {
|
||||||
|
[Parameter]
|
||||||
|
public RenderFragment? ChildContent { get; set; }
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,78 @@
|
||||||
|
@using KoogleApp.Components.Dialogs
|
||||||
|
@using KoogleApp.Model
|
||||||
|
@using KoogleApp.Store.Game.ThrowPanel
|
||||||
|
@using KoogleApp.Store.Game.UndoRedo
|
||||||
|
|
||||||
|
@inherits FluxorComponent
|
||||||
|
|
||||||
|
@inject IDispatcher Dispatcher
|
||||||
|
@inject IState<UndoRedoState> UndoRedoState
|
||||||
|
@inject IState<ThrowPanelState> ThrowPanelState
|
||||||
|
@inject IDialogService DialogService
|
||||||
|
|
||||||
|
<MudTooltip Text="Undo" Color="Color.Primary" Placement="Placement.Bottom" Arrow="true">
|
||||||
|
<MudIconButton Icon="@Icons.Material.Filled.Undo" Variant="Variant.Filled" Color="Color.Primary"
|
||||||
|
Disabled="@(!UndoRedoState.Value.CanUndo)"
|
||||||
|
Class="mr-5"
|
||||||
|
OnClick="@(_ => Dispatcher.Dispatch(new UndoAction()))" />
|
||||||
|
</MudTooltip>
|
||||||
|
|
||||||
|
<MudTooltip Text="Redo" Color="Color.Primary" Placement="Placement.Bottom" Arrow="true">
|
||||||
|
<MudIconButton Icon="@Icons.Material.Filled.Redo" Variant="Variant.Filled" Color="Color.Primary"
|
||||||
|
Disabled="@(!UndoRedoState.Value.CanRedo)"
|
||||||
|
Class="mr-5"
|
||||||
|
OnClick="@(_ => Dispatcher.Dispatch(new RedoAction()))" />
|
||||||
|
</MudTooltip>
|
||||||
|
|
||||||
|
<MudTooltip Text="@(ThrowPanelState.Value.IsStated ? "Stop" : "Start")"
|
||||||
|
Color="Color.Primary" Placement="Placement.Bottom" Arrow="true">
|
||||||
|
<MudIconButton Icon="@(ThrowPanelState.Value.IsStated? Icons.Material.Filled.Stop : Icons.Material.Filled.Start)"
|
||||||
|
Variant="Variant.Filled" Color="Color.Primary"
|
||||||
|
Class="mr-5" OnClick="StartStopClick" />
|
||||||
|
</MudTooltip>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<MudText>Status @UndoRedoState.Value.Version (@ThrowPanelState.Value.ThrowPanelStateStatus)</MudText>
|
||||||
|
|
||||||
|
@code {
|
||||||
|
|
||||||
|
private async Task StartStopClick()
|
||||||
|
{
|
||||||
|
if (!ThrowPanelState.Value.IsStated)
|
||||||
|
{
|
||||||
|
var parameters = new DialogParameters<StartGameDialog> { { x => x.Description, "" } };
|
||||||
|
// parameters.Add<TimeRecordDto>(x => x.Record, Record);
|
||||||
|
|
||||||
|
var options = new DialogOptions
|
||||||
|
{
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
var dialog = await DialogService.ShowAsync<StartGameDialog>("Spiel starten", parameters, options);
|
||||||
|
var result = await dialog.Result;
|
||||||
|
var startParams = result.Data as StartParams;
|
||||||
|
if (!result.Canceled)
|
||||||
|
{
|
||||||
|
var action = new StartStopAction(ThrowPanelState.Value, startParams);
|
||||||
|
Dispatcher.Dispatch(action);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var result = await DialogService.ShowMessageBox("Spiel beenden?", "Spiel wirklich abbrechen?", "JA", "NEIN");
|
||||||
|
if (result.Value)
|
||||||
|
{
|
||||||
|
var action = new StartStopAction(ThrowPanelState.Value, null);
|
||||||
|
Dispatcher.Dispatch(action);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// _throwPanelState = ThrowPanelState.Create();
|
||||||
|
// await BroadcastThrowPanelStateAction(_throwPanelState);
|
||||||
|
|
||||||
|
// await InvokeAsync(StateHasChanged);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -30,65 +30,47 @@
|
||||||
@* @inject IGameStatusDataService _dataService; *@
|
@* @inject IGameStatusDataService _dataService; *@
|
||||||
|
|
||||||
|
|
||||||
<!-- Fixierter Bereich innerhalb des Containers -->
|
|
||||||
<div style="position: sticky; top: 64px; z-index: 100; background-color: var(--mud-palette-surface); padding: 16px 0; margin: 0 -24px; padding-left: 24px; padding-right: 24px; box-shadow: 0 2px 4px rgba(0,0,0,0.1);">
|
|
||||||
<MudToolBar>
|
|
||||||
|
|
||||||
<MudTooltip Text="Undo" Color="Color.Primary" Placement="Placement.Bottom" Arrow="true">
|
@switch (_gameView)
|
||||||
<MudIconButton Icon="@Icons.Material.Filled.Undo" Variant="Variant.Filled" Color="Color.Primary"
|
{
|
||||||
Disabled="@(!UndoRedoState.Value.CanUndo)"
|
case GameView.Throw:
|
||||||
Class="mr-5"
|
<PanelToolbar>
|
||||||
OnClick="@(_ => Dispatcher.Dispatch(new UndoAction()))" />
|
<ThrowPanelMenu />
|
||||||
</MudTooltip>
|
</PanelToolbar>
|
||||||
|
break;
|
||||||
<MudTooltip Text="Redo" Color="Color.Primary" Placement="Placement.Bottom" Arrow="true">
|
case GameView.Board:
|
||||||
<MudIconButton Icon="@Icons.Material.Filled.Redo" Variant="Variant.Filled" Color="Color.Primary"
|
|
||||||
Disabled="@(!UndoRedoState.Value.CanRedo)"
|
break;
|
||||||
Class="mr-5"
|
case GameView.Players:
|
||||||
OnClick="@(_ => Dispatcher.Dispatch(new RedoAction()))" />
|
|
||||||
</MudTooltip>
|
|
||||||
|
|
||||||
<MudTooltip Text="@(ThrowPanelState.Value.IsStated ? "Stop" : "Start")"
|
|
||||||
Color="Color.Primary" Placement="Placement.Bottom" Arrow="true">
|
|
||||||
<MudIconButton Icon="@(ThrowPanelState.Value.IsStated ? Icons.Material.Filled.Stop : Icons.Material.Filled.Start)"
|
|
||||||
Variant="Variant.Filled" Color="Color.Primary"
|
|
||||||
Class="mr-5" OnClick="StartStopClick"/>
|
|
||||||
</MudTooltip>
|
|
||||||
|
|
||||||
|
break;
|
||||||
|
case GameView.Player:
|
||||||
|
|
||||||
|
break;
|
||||||
<MudText>Status @UndoRedoState.Value.Version (@ThrowPanelState.Value.ThrowPanelStateStatus)</MudText>
|
}
|
||||||
</MudToolBar>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Scrollbarer Inhalt -->
|
<!-- Scrollbarer Inhalt -->
|
||||||
|
|
||||||
<MudContainer Class="mt-4">
|
<MudContainer Class="mt-4">
|
||||||
@switch (_gameView)
|
@switch (_gameView)
|
||||||
{
|
{
|
||||||
case GameView.Throw:
|
case GameView.Throw:
|
||||||
<ThrowPanel />
|
<ThrowPanel />
|
||||||
break;
|
break;
|
||||||
case GameView.Board:
|
case GameView.Board:
|
||||||
<BoardPanel />
|
<BoardPanel />
|
||||||
break;
|
break;
|
||||||
case GameView.Players:
|
case GameView.Players:
|
||||||
<PlayersPanel />
|
<PlayersPanel />
|
||||||
break;
|
break;
|
||||||
case GameView.Player:
|
case GameView.Player:
|
||||||
<PlayerPanel />
|
<PlayerPanel />
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
</MudContainer>
|
</MudContainer>
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
// private ThrowPanelState _throwPanelState = null;
|
|
||||||
|
|
||||||
// private BoardPanel? _boardPanel;
|
|
||||||
|
|
||||||
// private ThrowPanel? _throwPanel;
|
|
||||||
|
|
||||||
private GameView _gameView = GameView.Throw;
|
private GameView _gameView = GameView.Throw;
|
||||||
|
|
||||||
|
|
@ -97,11 +79,6 @@
|
||||||
private bool isAuthenticated;
|
private bool isAuthenticated;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// private HubConnection? hubConnection;
|
|
||||||
|
|
||||||
|
|
||||||
protected override void OnInitialized()
|
protected override void OnInitialized()
|
||||||
{
|
{
|
||||||
base.OnInitialized();
|
base.OnInitialized();
|
||||||
|
|
@ -208,44 +185,6 @@
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
private async Task StartStopClick()
|
|
||||||
{
|
|
||||||
if (!ThrowPanelState.Value.IsStated)
|
|
||||||
{
|
|
||||||
var parameters = new DialogParameters<StartGameDialog> { { x => x.Description, "" }};
|
|
||||||
// parameters.Add<TimeRecordDto>(x => x.Record, Record);
|
|
||||||
|
|
||||||
var options = new DialogOptions
|
|
||||||
{
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
var dialog = await DialogService.ShowAsync<StartGameDialog>("Spiel starten", parameters, options);
|
|
||||||
var result = await dialog.Result;
|
|
||||||
var startParams = result.Data as StartParams;
|
|
||||||
if (!result.Canceled)
|
|
||||||
{
|
|
||||||
var action = new StartStopAction(ThrowPanelState.Value, startParams);
|
|
||||||
Dispatcher.Dispatch(action);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
var result = await DialogService.ShowMessageBox("Spiel beenden?", "Spiel wirklich abbrechen?", "JA", "NEIN");
|
|
||||||
if (result.Value)
|
|
||||||
{
|
|
||||||
var action = new StartStopAction(ThrowPanelState.Value,null);
|
|
||||||
Dispatcher.Dispatch(action);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// _throwPanelState = ThrowPanelState.Create();
|
|
||||||
// await BroadcastThrowPanelStateAction(_throwPanelState);
|
|
||||||
|
|
||||||
// await InvokeAsync(StateHasChanged);
|
|
||||||
}
|
|
||||||
|
|
||||||
private async Task SaveClick(MouseEventArgs arg)
|
private async Task SaveClick(MouseEventArgs arg)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue