powergrid-viewer 1.11.11 → 1.11.13
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "powergrid-viewer",
|
|
3
|
-
"version": "1.11.
|
|
3
|
+
"version": "1.11.13",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/boardgamers/powergrid.git",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"vue": "^2.6.11",
|
|
19
19
|
"vue-class-component": "^7.2.3",
|
|
20
20
|
"vue-property-decorator": "^8.4.2",
|
|
21
|
-
"powergrid-engine": "1.15.
|
|
21
|
+
"powergrid-engine": "1.15.13"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"@types/assert": "^1.4.7",
|
|
@@ -18,12 +18,12 @@
|
|
|
18
18
|
</g>
|
|
19
19
|
</template>
|
|
20
20
|
<script lang="ts">
|
|
21
|
-
import { Vue, Component, Prop } from 'vue-property-decorator';
|
|
21
|
+
import { Vue, Component, Prop, Watch } from 'vue-property-decorator';
|
|
22
22
|
|
|
23
23
|
@Component({
|
|
24
24
|
created(this: Calculator) {
|
|
25
25
|
this.value = this.minValue;
|
|
26
|
-
}
|
|
26
|
+
},
|
|
27
27
|
})
|
|
28
28
|
export default class Calculator extends Vue {
|
|
29
29
|
@Prop()
|
|
@@ -34,6 +34,13 @@ export default class Calculator extends Vue {
|
|
|
34
34
|
|
|
35
35
|
value: number = 0;
|
|
36
36
|
|
|
37
|
+
// The legal floor can rise while the calculator is open (e.g. a rival bid in a
|
|
38
|
+
// classic auction). Lift a stale value to the floor; never lower a dialed-in bid.
|
|
39
|
+
@Watch('minValue')
|
|
40
|
+
onMinValueChanged() {
|
|
41
|
+
this.value = Math.max(this.value, this.minValue);
|
|
42
|
+
}
|
|
43
|
+
|
|
37
44
|
add() {
|
|
38
45
|
this.value = Math.min(this.maxValue, this.value + 1);
|
|
39
46
|
}
|
package/src/components/Game.vue
CHANGED
|
@@ -459,7 +459,11 @@
|
|
|
459
459
|
<strong>{{ G.map.uraniumMineResupply[G.players.length - 2][0] }}</strong>
|
|
460
460
|
token(s) from the cheapest slots
|
|
461
461
|
</li>
|
|
462
|
-
<li
|
|
462
|
+
<li v-if="G.map.name === 'Manhattan'">
|
|
463
|
+
Bureaucracy: move the <strong>two highest</strong> future-market plants to the
|
|
464
|
+
discard pile (see Map Specific Rules for the full deck cycle)
|
|
465
|
+
</li>
|
|
466
|
+
<li v-else>Bureaucracy: remove <strong>highest</strong> power plant from market</li>
|
|
463
467
|
</ul>
|
|
464
468
|
</li>
|
|
465
469
|
<li v-if="G.map.name !== 'Manhattan'">
|
|
@@ -54,8 +54,11 @@
|
|
|
54
54
|
:targetState="{ x: chosenPowerPlant.x, y: chosenPowerPlant.y }"
|
|
55
55
|
:powerPlant="chosenPowerPlant.powerPlant"
|
|
56
56
|
/>
|
|
57
|
+
<!-- Keyed per plant so every auction gets a fresh calculator: a reused
|
|
58
|
+
instance would keep displaying the previous auction's bid floor. -->
|
|
57
59
|
<Calculator
|
|
58
60
|
v-if="canBid"
|
|
61
|
+
:key="'calc' + chosenPowerPlant.powerPlant.number"
|
|
59
62
|
:transform="`translate(${actualMarketWidth}, 80)`"
|
|
60
63
|
:minValue="minBid"
|
|
61
64
|
:maxValue="maxBid"
|
|
@@ -81,7 +84,7 @@
|
|
|
81
84
|
v-else
|
|
82
85
|
x="160"
|
|
83
86
|
y="5"
|
|
84
|
-
width="
|
|
87
|
+
:width="actualMarketHighlightWidth"
|
|
85
88
|
height="120"
|
|
86
89
|
fill="none"
|
|
87
90
|
stroke="blue"
|
|
@@ -104,7 +107,7 @@ import Calculator from './../Calculator.vue';
|
|
|
104
107
|
@Component({
|
|
105
108
|
components: {
|
|
106
109
|
Card,
|
|
107
|
-
Calculator
|
|
110
|
+
Calculator,
|
|
108
111
|
},
|
|
109
112
|
})
|
|
110
113
|
export default class PowerPlantMarket extends Vue {
|
|
@@ -123,10 +126,16 @@ export default class PowerPlantMarket extends Vue {
|
|
|
123
126
|
futureMarketCards: Piece[] = [];
|
|
124
127
|
chosenPowerPlant: Piece | null = null;
|
|
125
128
|
actualMarketWidth: number = 430;
|
|
129
|
+
actualMarketHighlightWidth: number = 200;
|
|
126
130
|
|
|
127
131
|
createPieces(gameState: GameState) {
|
|
128
132
|
this.actualMarketWidth = gameState.map.actualMarketWidth ?? 430;
|
|
129
133
|
this.actualMarketCards = [];
|
|
134
|
+
// Step 3 holds at most 6 plants (3+3), but Manhattan's second-depletion
|
|
135
|
+
// "whole market buyable" state keeps up to 8 in the actual market — wrap
|
|
136
|
+
// at 4 per row there so cards 7 and 8 don't paint on top of the second row.
|
|
137
|
+
const actualPerRow = gameState.actualMarket.length > 6 ? 4 : 3;
|
|
138
|
+
this.actualMarketHighlightWidth = 65 * Math.min(gameState.actualMarket.length, actualPerRow) + 5;
|
|
130
139
|
gameState.actualMarket.forEach((card, i) => {
|
|
131
140
|
if (gameState.futureMarket.length > 0) {
|
|
132
141
|
if (card.number != gameState.chosenPowerPlant?.number) {
|
|
@@ -134,16 +143,16 @@ export default class PowerPlantMarket extends Vue {
|
|
|
134
143
|
id: 'actual_' + i,
|
|
135
144
|
x: 165 + i * 65,
|
|
136
145
|
y: 24,
|
|
137
|
-
powerPlant: card
|
|
146
|
+
powerPlant: card,
|
|
138
147
|
});
|
|
139
148
|
}
|
|
140
149
|
} else {
|
|
141
150
|
if (card.number != gameState.chosenPowerPlant?.number) {
|
|
142
151
|
this.actualMarketCards.push({
|
|
143
152
|
id: 'actual_' + i,
|
|
144
|
-
x: 165 + (i %
|
|
145
|
-
y:
|
|
146
|
-
powerPlant: card
|
|
153
|
+
x: 165 + (i % actualPerRow) * 65,
|
|
154
|
+
y: 24 + Math.floor(i / actualPerRow) * 56,
|
|
155
|
+
powerPlant: card,
|
|
147
156
|
});
|
|
148
157
|
}
|
|
149
158
|
}
|
|
@@ -159,7 +168,7 @@ export default class PowerPlantMarket extends Vue {
|
|
|
159
168
|
id: 'future_' + i,
|
|
160
169
|
x: 165 + (i % 4) * 65,
|
|
161
170
|
y: 90 + Math.floor(i / 4) * 50,
|
|
162
|
-
powerPlant: card
|
|
171
|
+
powerPlant: card,
|
|
163
172
|
});
|
|
164
173
|
}
|
|
165
174
|
});
|
|
@@ -169,7 +178,7 @@ export default class PowerPlantMarket extends Vue {
|
|
|
169
178
|
id: 'chosen',
|
|
170
179
|
x: this.actualMarketWidth + 30,
|
|
171
180
|
y: 30,
|
|
172
|
-
powerPlant: gameState.chosenPowerPlant
|
|
181
|
+
powerPlant: gameState.chosenPowerPlant,
|
|
173
182
|
};
|
|
174
183
|
} else {
|
|
175
184
|
this.chosenPowerPlant = null;
|