diff --git a/KoogleApp/Components/Controls/ThrowPanel.razor b/KoogleApp/Components/Controls/ThrowPanel.razor index 64be293..dc13897 100644 --- a/KoogleApp/Components/Controls/ThrowPanel.razor +++ b/KoogleApp/Components/Controls/ThrowPanel.razor @@ -2,6 +2,7 @@ @using KoogleApp.Store.Game @using KoogleApp.Store.Game.ThrowPanel @using KoogleApp.Store.Game.UndoRedo +@using Microsoft.AspNetCore.Mvc.TagHelpers @inherits FluxorComponent @@ -12,44 +13,80 @@ @if (ThrowPanelState.Value.IsStated) { - - - - - - Gosse - - - - - - - - Wurf - - - - - - - - Gosse - - - + + + @if ((@UndoRedoState.Value.CanRedo && _locked) && (!_correcting)) + { + + + @if (!_canUnlock) + { + Wurf @(UndoRedoState.Value.Version - 1) von XX um YY + } + else + { + Bild @((UndoRedoState.Value.Version / 2) + 1) + } + + + + + + + + Korrigieren + + + + } + else + { + + + + + Gosse + + + + + + + + Wurf + + + + + + + + Gosse + + + + } } @code { + private bool _canUnlock => ThrowPanelState.Value.ThrowPanelStateStatus == ThrowPanelStateStatus.AfterThrow || ThrowPanelState.Value.ThrowPanelStateStatus == ThrowPanelStateStatus.GameStart; + private bool _locked = true; + + private bool _disabled => (UndoRedoState.Value.CanRedo && _locked) && !_correcting; + private bool _correcting = false; protected override void OnAfterRender(bool firstRender) { @@ -57,7 +94,7 @@ { Dispatcher.Dispatch(new LoadStateFromSessionAction()); } - + _locked = true; base.OnAfterRender(firstRender); } @@ -78,6 +115,14 @@ private void DoThrow(bool leftSink, bool rightSink) { + _correcting = false; Dispatcher.Dispatch(new ThrowAction(LeftSink: leftSink, RightSink: rightSink)); } + + private void UnlockClick(MouseEventArgs obj) + { + _correcting = true; + _locked = false; + } + } diff --git a/KoogleApp/ThrowPanelState.json b/KoogleApp/ThrowPanelState.json deleted file mode 100644 index aea7c3a..0000000 --- a/KoogleApp/ThrowPanelState.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "IsStated": true, - "BellValue": false, - "Pin1Value": false, - "Pin2Value": false, - "Pin3Value": false, - "Pin4Value": false, - "Pin5Value": false, - "Pin6Value": false, - "Pin7Value": false, - "Pin8Value": false, - "Pin9Value": true, - "Pin1Disabled": false, - "Pin2Disabled": false, - "Pin3Disabled": false, - "Pin4Disabled": false, - "Pin5Disabled": false, - "Pin6Disabled": false, - "Pin7Disabled": false, - "Pin8Disabled": false, - "Pin9Disabled": true, - "ThrowsPerRound": 3, - "ThrowCounter": 2, - "ThrowMode": 1, - "ThrowPanelStateStatus": 2 -} \ No newline at end of file diff --git a/KoogleApp/appdata.json b/KoogleApp/appdata.json index 6160d12..f982d7e 100644 --- a/KoogleApp/appdata.json +++ b/KoogleApp/appdata.json @@ -10,8 +10,8 @@ "Pin4Value": false, "Pin5Value": false, "Pin6Value": false, - "Pin7Value": false, - "Pin8Value": false, + "Pin7Value": true, + "Pin8Value": true, "Pin9Value": true, "Pin1Disabled": false, "Pin2Disabled": false, @@ -19,20 +19,119 @@ "Pin4Disabled": false, "Pin5Disabled": false, "Pin6Disabled": false, - "Pin7Disabled": false, - "Pin8Disabled": false, - "Pin9Disabled": false, + "Pin7Disabled": true, + "Pin8Disabled": true, + "Pin9Disabled": true, "ThrowsPerRound": 3, - "ThrowCounter": 1, + "ThrowCounter": 3, "ThrowMode": 1, - "ThrowPanelStateStatus": 2 + "ThrowPanelStateStatus": 3 } }, - "Version": 2, - "LastModified": "2025-11-11T12:00:22.6133973+01:00", + "Version": 5, + "LastModified": "2025-11-11T13:46:24.8835415+01:00", "LastModifiedBy": "test1@test.de" }, "UndoHistory": [ + { + "Status": { + "ThrowPanelState": { + "IsStated": true, + "BellValue": false, + "Pin1Value": false, + "Pin2Value": false, + "Pin3Value": false, + "Pin4Value": false, + "Pin5Value": false, + "Pin6Value": false, + "Pin7Value": true, + "Pin8Value": true, + "Pin9Value": true, + "Pin1Disabled": false, + "Pin2Disabled": false, + "Pin3Disabled": false, + "Pin4Disabled": false, + "Pin5Disabled": false, + "Pin6Disabled": false, + "Pin7Disabled": true, + "Pin8Disabled": false, + "Pin9Disabled": true, + "ThrowsPerRound": 3, + "ThrowCounter": 2, + "ThrowMode": 1, + "ThrowPanelStateStatus": 2 + } + }, + "Version": 4, + "LastModified": "2025-11-11T13:46:24.8797561+01:00", + "LastModifiedBy": "test1@test.de" + }, + { + "Status": { + "ThrowPanelState": { + "IsStated": true, + "BellValue": false, + "Pin1Value": false, + "Pin2Value": false, + "Pin3Value": false, + "Pin4Value": false, + "Pin5Value": false, + "Pin6Value": false, + "Pin7Value": true, + "Pin8Value": false, + "Pin9Value": true, + "Pin1Disabled": false, + "Pin2Disabled": false, + "Pin3Disabled": false, + "Pin4Disabled": false, + "Pin5Disabled": false, + "Pin6Disabled": false, + "Pin7Disabled": true, + "Pin8Disabled": false, + "Pin9Disabled": true, + "ThrowsPerRound": 3, + "ThrowCounter": 2, + "ThrowMode": 1, + "ThrowPanelStateStatus": 3 + } + }, + "Version": 3, + "LastModified": "2025-11-11T13:45:23.5062354+01:00", + "LastModifiedBy": "test1@test.de" + }, + { + "Status": { + "ThrowPanelState": { + "IsStated": true, + "BellValue": false, + "Pin1Value": false, + "Pin2Value": false, + "Pin3Value": false, + "Pin4Value": false, + "Pin5Value": false, + "Pin6Value": false, + "Pin7Value": true, + "Pin8Value": false, + "Pin9Value": true, + "Pin1Disabled": false, + "Pin2Disabled": false, + "Pin3Disabled": false, + "Pin4Disabled": false, + "Pin5Disabled": false, + "Pin6Disabled": false, + "Pin7Disabled": false, + "Pin8Disabled": false, + "Pin9Disabled": false, + "ThrowsPerRound": 3, + "ThrowCounter": 1, + "ThrowMode": 1, + "ThrowPanelStateStatus": 2 + } + }, + "Version": 2, + "LastModified": "2025-11-11T13:45:23.4953972+01:00", + "LastModifiedBy": "test1@test.de" + }, { "Status": { "ThrowPanelState": { @@ -67,39 +166,5 @@ "LastModifiedBy": "test1@test.de" } ], - "RedoHistory": [ - { - "Status": { - "ThrowPanelState": { - "IsStated": true, - "BellValue": false, - "Pin1Value": false, - "Pin2Value": false, - "Pin3Value": false, - "Pin4Value": false, - "Pin5Value": false, - "Pin6Value": false, - "Pin7Value": false, - "Pin8Value": false, - "Pin9Value": true, - "Pin1Disabled": false, - "Pin2Disabled": false, - "Pin3Disabled": false, - "Pin4Disabled": false, - "Pin5Disabled": false, - "Pin6Disabled": false, - "Pin7Disabled": false, - "Pin8Disabled": false, - "Pin9Disabled": true, - "ThrowsPerRound": 3, - "ThrowCounter": 2, - "ThrowMode": 1, - "ThrowPanelStateStatus": 3 - } - }, - "Version": 3, - "LastModified": "2025-11-11T12:00:22.6164777+01:00", - "LastModifiedBy": "test1@test.de" - } - ] + "RedoHistory": [] } \ No newline at end of file