Skip to content

Commit

Permalink
playing-field: always mirror for convenience
Browse files Browse the repository at this point in the history
even if a field is not mirrored and only cyan is shown, teams may want
to use magenta.
  • Loading branch information
TarikViehmann committed Jul 16, 2024
1 parent a4e0988 commit 760d572
Showing 1 changed file with 26 additions and 28 deletions.
54 changes: 26 additions & 28 deletions src/components/spectator/PlayingField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,34 +10,32 @@
<div id="playingField" ref="playingField">
<template v-for="vIndex in verticalFieldSize">
<!-- negative x coordinates only if field is mirrored -->
<template v-if="isFieldMirrored">
<template v-for="hIndex in horizontalFieldSize">
<PlayingFieldSquare
:zone="
getZoneNameFor(
-(horizontalFieldSize - hIndex + 1),
verticalFieldSize - vIndex + 1,
)
"
:with-dot="vIndex != 1 && hIndex != 1"
:isSelected="
selectedSquare?.zone ===
getZoneNameFor(
-(horizontalFieldSize - hIndex + 1),
verticalFieldSize - vIndex + 1,
)
"
:isTargeted="
targetSquare?.zone ===
getZoneNameFor(
-(horizontalFieldSize - hIndex + 1),
verticalFieldSize - vIndex + 1,
)
"
@square-selected="handleSquareSelected"
@square-targeted="handleSquareTargeted"
/>
</template>
<template v-for="hIndex in horizontalFieldSize">
<PlayingFieldSquare
:zone="
getZoneNameFor(
-(horizontalFieldSize - hIndex + 1),
verticalFieldSize - vIndex + 1,
)
"
:with-dot="vIndex != 1 && hIndex != 1"
:isSelected="
selectedSquare?.zone ===
getZoneNameFor(
-(horizontalFieldSize - hIndex + 1),
verticalFieldSize - vIndex + 1,
)
"
:isTargeted="
targetSquare?.zone ===
getZoneNameFor(
-(horizontalFieldSize - hIndex + 1),
verticalFieldSize - vIndex + 1,
)
"
@square-selected="handleSquareSelected"
@square-targeted="handleSquareTargeted"
/>
</template>
<!-- positive x coordinates -->
<template v-for="hIndex in horizontalFieldSize">
Expand Down

0 comments on commit 760d572

Please sign in to comment.