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; *@
|
||||
|
||||
|
||||
<!-- 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">
|
||||
<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>
|
||||
@switch (_gameView)
|
||||
{
|
||||
case GameView.Throw:
|
||||
<PanelToolbar>
|
||||
<ThrowPanelMenu />
|
||||
</PanelToolbar>
|
||||
break;
|
||||
case GameView.Board:
|
||||
|
||||
break;
|
||||
case GameView.Players:
|
||||
|
||||
break;
|
||||
case GameView.Player:
|
||||
|
||||
|
||||
<MudText>Status @UndoRedoState.Value.Version (@ThrowPanelState.Value.ThrowPanelStateStatus)</MudText>
|
||||
</MudToolBar>
|
||||
</div>
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
<!-- Scrollbarer Inhalt -->
|
||||
|
||||
<MudContainer Class="mt-4">
|
||||
@switch (_gameView)
|
||||
{
|
||||
case GameView.Throw:
|
||||
<ThrowPanel />
|
||||
break;
|
||||
case GameView.Board:
|
||||
<BoardPanel />
|
||||
break;
|
||||
case GameView.Players:
|
||||
<PlayersPanel />
|
||||
break;
|
||||
case GameView.Player:
|
||||
<PlayerPanel />
|
||||
break;
|
||||
}
|
||||
|
||||
@switch (_gameView)
|
||||
{
|
||||
case GameView.Throw:
|
||||
<ThrowPanel />
|
||||
break;
|
||||
case GameView.Board:
|
||||
<BoardPanel />
|
||||
break;
|
||||
case GameView.Players:
|
||||
<PlayersPanel />
|
||||
break;
|
||||
case GameView.Player:
|
||||
<PlayerPanel />
|
||||
break;
|
||||
}
|
||||
</MudContainer>
|
||||
|
||||
@code {
|
||||
// private ThrowPanelState _throwPanelState = null;
|
||||
|
||||
// private BoardPanel? _boardPanel;
|
||||
|
||||
// private ThrowPanel? _throwPanel;
|
||||
|
||||
private GameView _gameView = GameView.Throw;
|
||||
|
||||
|
|
@ -97,11 +79,6 @@
|
|||
private bool isAuthenticated;
|
||||
|
||||
|
||||
|
||||
|
||||
// private HubConnection? hubConnection;
|
||||
|
||||
|
||||
protected override void 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)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue