Skip to content

Commit bc46b21

Browse files
committed
make delivery
1 parent 2fe5548 commit bc46b21

2 files changed

Lines changed: 41 additions & 11 deletions

File tree

src/components/round/SoloBoardPassActionInfo.vue

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<template>
2-
<span v-if="income || actions || burnCardCount">: </span>
2+
<span>:</span>
3+
<span v-if="!(income || actions || burnCardCount)" class="noAction">-</span>
34
<span v-if="income"><span class="income">$<span class="value">{{income}}</span></span></span>
45
<div class="actions">
56
<template v-for="action of actions" :key="action">
@@ -86,7 +87,10 @@ export default defineComponent({
8687
}
8788
}
8889
.burnCards {
89-
margin-left: 0.5rem;
90+
margin-left: 0.25rem;
9091
color: #000;
9192
}
93+
.noAction {
94+
margin-left: 0.25rem;
95+
}
9296
</style>

src/views/RoundTurnPlayer.vue

Lines changed: 35 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,30 @@
55
<p class="mt-4">Select your action:</p>
66

77
<div class="actions">
8-
<button class="btn btn-primary btn-lg" @click="next">
8+
<button class="btn btn-primary btn-lg" v-if="!showDeliveryActions" @click="showDeliveryActions = true">
99
Make Delivery
1010
</button>
11+
<div class="deliveryActions" v-if="showDeliveryActions">
12+
<button class="btn btn-primary btn-lg" v-for="floor of floors" :key="floor" @click="deliverToFloor(floor)">
13+
Delivered to Floor {{floor}}
14+
</button>
15+
</div>
1116
<button class="btn btn-primary btn-lg" @click="next">
1217
Buy Flower
1318
</button>
1419
<button class="btn btn-primary btn-lg" @click="next">
1520
Other Action
1621
</button>
1722
<div>
18-
<button class="btn btn-outline-danger btn-lg w-100 d-flex align-items-center" data-bs-toggle="modal" data-bs-target="#passModal">
23+
<button class="btn btn-outline-danger btn-lg passButton" data-bs-toggle="modal" data-bs-target="#passModal">
1924
{{t('action.pass')}}<SoloBoardPassActionInfo :soloBoardPassAction="soloBoardPassAction"/>
2025
</button>
21-
<div class="small mt-1 fst-italic d-flex align-items-center">
26+
<div class="small mt-1 fst-italic passNextTurnInfo">
2227
<span>{{t('roundTurnPlayer.passInfo.nextTurn')}}</span><SoloBoardPassActionInfo :soloBoardPassAction="soloBoardPassActionNextTurn" :small="true"/>
2328
</div>
2429
</div>
2530
</div>
2631

27-
<button class="btn btn-primary btn-lg mt-4" @click="next">
28-
{{t('action.next')}}
29-
</button>
30-
3132
<ModalDialog id="passModal" :title="t('action.pass')">
3233
<template #body>
3334
<p v-html="t('roundTurnPlayer.passConfirm')"></p>
@@ -74,9 +75,11 @@ export default defineComponent({
7475
7576
const navigationState = new NavigationState(route, state)
7677
const { round, turn } = navigationState
78+
7779
const playerDeliveryFloor = ref(navigationState.playerDeliveryFloor)
80+
const showDeliveryActions = ref(false)
7881
79-
return { t, router, navigationState, state, round, turn, playerDeliveryFloor }
82+
return { t, router, navigationState, state, round, turn, playerDeliveryFloor, showDeliveryActions }
8083
},
8184
computed: {
8285
backButtonRouteTo() : string {
@@ -85,6 +88,9 @@ export default defineComponent({
8588
}
8689
return ''
8790
},
91+
floors() : number[] {
92+
return [5,4,3,2,1]
93+
},
8894
soloBoardPassAction() : SoloBoardPassAction {
8995
const { soloBoard, playerTurns, playerDeliveryFloor } = this.navigationState
9096
return getSoloBoardPassAction(soloBoard, playerTurns, playerDeliveryFloor)
@@ -95,6 +101,10 @@ export default defineComponent({
95101
}
96102
},
97103
methods: {
104+
deliverToFloor(floor: number) : void {
105+
this.playerDeliveryFloor = floor
106+
this.next()
107+
},
98108
next() : void {
99109
this.nextWithPassed(false)
100110
},
@@ -125,6 +135,22 @@ export default defineComponent({
125135
display: flex;
126136
flex-direction: column;
127137
gap: 1rem;
128-
max-width: 15rem;
138+
max-width: 18rem;
139+
}
140+
.deliveryActions {
141+
display: flex;
142+
flex-direction: column;
143+
gap: 0.25rem;
144+
}
145+
.passButton {
146+
display: flex;
147+
justify-content: center;
148+
align-items: center;
149+
width: 100%;
150+
}
151+
.passNextTurnInfo {
152+
display: flex;
153+
justify-content: center;
154+
align-items: center;
129155
}
130156
</style>

0 commit comments

Comments
 (0)