valtech-components 4.0.397 → 4.0.398
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/lib/components/organisms/mini-games/chessimals-game.component.mjs +19 -6
- package/esm2022/lib/version.mjs +2 -2
- package/fesm2022/valtech-components.mjs +19 -6
- package/fesm2022/valtech-components.mjs.map +1 -1
- package/lib/components/organisms/mini-games/chessimals-game.component.d.ts +1 -0
- package/lib/version.d.ts +1 -1
- package/package.json +1 -1
package/esm2022/lib/version.mjs
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
* Current version of valtech-components.
|
|
3
3
|
* This is automatically updated during the publish process.
|
|
4
4
|
*/
|
|
5
|
-
export const VERSION = '4.0.
|
|
6
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
5
|
+
export const VERSION = '4.0.398';
|
|
6
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmVyc2lvbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9saWIvdmVyc2lvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7O0dBR0c7QUFDSCxNQUFNLENBQUMsTUFBTSxPQUFPLEdBQUcsU0FBUyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBDdXJyZW50IHZlcnNpb24gb2YgdmFsdGVjaC1jb21wb25lbnRzLlxuICogVGhpcyBpcyBhdXRvbWF0aWNhbGx5IHVwZGF0ZWQgZHVyaW5nIHRoZSBwdWJsaXNoIHByb2Nlc3MuXG4gKi9cbmV4cG9ydCBjb25zdCBWRVJTSU9OID0gJzQuMC4zOTgnO1xuIl19
|
|
@@ -58,7 +58,7 @@ import fixWebmDuration from 'fix-webm-duration';
|
|
|
58
58
|
* Current version of valtech-components.
|
|
59
59
|
* This is automatically updated during the publish process.
|
|
60
60
|
*/
|
|
61
|
-
const VERSION = '4.0.
|
|
61
|
+
const VERSION = '4.0.398';
|
|
62
62
|
|
|
63
63
|
// Control de estado de refresco (singleton a nivel de módulo)
|
|
64
64
|
let isRefreshing = false;
|
|
@@ -63309,6 +63309,15 @@ class ChessimalsGameComponent {
|
|
|
63309
63309
|
return true;
|
|
63310
63310
|
return this.onlineRole() === game.currentTurn;
|
|
63311
63311
|
});
|
|
63312
|
+
this.canControlCurrentGame = computed(() => {
|
|
63313
|
+
if (this.projectionMode)
|
|
63314
|
+
return false;
|
|
63315
|
+
const game = this.game();
|
|
63316
|
+
if (game.mode !== 'online')
|
|
63317
|
+
return true;
|
|
63318
|
+
const role = this.onlineRole();
|
|
63319
|
+
return role === 'white' || role === 'black';
|
|
63320
|
+
});
|
|
63312
63321
|
this.rematchState = computed(() => {
|
|
63313
63322
|
const game = this.game();
|
|
63314
63323
|
if (game.mode !== 'online' || game.status !== 'finished')
|
|
@@ -63612,6 +63621,8 @@ class ChessimalsGameComponent {
|
|
|
63612
63621
|
this.screen.set('home');
|
|
63613
63622
|
}
|
|
63614
63623
|
requestRestartGame() {
|
|
63624
|
+
if (!this.canControlCurrentGame())
|
|
63625
|
+
return;
|
|
63615
63626
|
this.confirmAction.set('restart');
|
|
63616
63627
|
this.audio.flip();
|
|
63617
63628
|
}
|
|
@@ -63628,7 +63639,7 @@ class ChessimalsGameComponent {
|
|
|
63628
63639
|
this.audio.flip();
|
|
63629
63640
|
}
|
|
63630
63641
|
requestResign() {
|
|
63631
|
-
if (this.game().status === 'finished')
|
|
63642
|
+
if (this.game().status === 'finished' || !this.canControlCurrentGame())
|
|
63632
63643
|
return;
|
|
63633
63644
|
this.confirmAction.set('resign');
|
|
63634
63645
|
this.audio.flip();
|
|
@@ -64143,6 +64154,8 @@ class ChessimalsGameComponent {
|
|
|
64143
64154
|
async requestOnlineRematch() {
|
|
64144
64155
|
if (this.game().mode !== 'online')
|
|
64145
64156
|
return;
|
|
64157
|
+
if (!this.canControlCurrentGame())
|
|
64158
|
+
return;
|
|
64146
64159
|
if (this.rematchState() === 'requested' || this.rematchLoading())
|
|
64147
64160
|
return;
|
|
64148
64161
|
const accepting = this.rematchState() === 'incoming';
|
|
@@ -64704,11 +64717,11 @@ class ChessimalsGameComponent {
|
|
|
64704
64717
|
}
|
|
64705
64718
|
|
|
64706
64719
|
<div class="chessimals-actions">
|
|
64707
|
-
@if (game().status !== 'finished') {
|
|
64720
|
+
@if (game().status !== 'finished' && canControlCurrentGame()) {
|
|
64708
64721
|
<button class="chessimals-secondary" type="button" (click)="requestResign()">
|
|
64709
64722
|
{{ t('chessimalsResign') }}
|
|
64710
64723
|
</button>
|
|
64711
|
-
} @else if (game().mode === 'online' &&
|
|
64724
|
+
} @else if (game().mode === 'online' && canControlCurrentGame()) {
|
|
64712
64725
|
<button
|
|
64713
64726
|
class="chessimals-secondary"
|
|
64714
64727
|
type="button"
|
|
@@ -65275,11 +65288,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
65275
65288
|
}
|
|
65276
65289
|
|
|
65277
65290
|
<div class="chessimals-actions">
|
|
65278
|
-
@if (game().status !== 'finished') {
|
|
65291
|
+
@if (game().status !== 'finished' && canControlCurrentGame()) {
|
|
65279
65292
|
<button class="chessimals-secondary" type="button" (click)="requestResign()">
|
|
65280
65293
|
{{ t('chessimalsResign') }}
|
|
65281
65294
|
</button>
|
|
65282
|
-
} @else if (game().mode === 'online' &&
|
|
65295
|
+
} @else if (game().mode === 'online' && canControlCurrentGame()) {
|
|
65283
65296
|
<button
|
|
65284
65297
|
class="chessimals-secondary"
|
|
65285
65298
|
type="button"
|