Skip to content

Commit 67f3375

Browse files
set question mark on price if random
1 parent 3aea355 commit 67f3375

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/ui/setup_cocktail_selection.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ def update_random_display(self) -> None:
128128
field_volume.setText("")
129129
if fields_ingredient:
130130
fields_ingredient[0].setText(surprise_label)
131+
self._update_volume_button_labels(random_cocktail=True)
131132

132133
def _prepare_random_cocktail(self, amount: int) -> None:
133134
"""Pick a random cocktail from the pool and prepare it."""
@@ -349,14 +350,16 @@ def _adjust_preparation_buttons(self) -> None:
349350
# Set initial button labels
350351
self._update_volume_button_labels()
351352

352-
def _update_volume_button_labels(self) -> None:
353+
def _update_volume_button_labels(self, random_cocktail: bool = False) -> None:
353354
"""Update the labels of volume buttons, recalculating prices if payment is active."""
354355
for volume, button in self._volume_buttons:
355356
volume_converted = self._decide_rounding(volume * cfg.EXP_MAKER_FACTOR, 20)
356357
label = f"{volume_converted}"
357358
if cfg.payment_enabled:
358359
multiplier = cfg.PAYMENT_VIRGIN_MULTIPLIER / 100 if self.is_virgin else 1.0
359360
price = self.cocktail.current_price(cfg.PAYMENT_PRICE_ROUNDING, volume, price_multiplier=multiplier)
361+
if random_cocktail:
362+
price = "?"
360363
price_str = f"{price}".rstrip("0").rstrip(".")
361364
label += f": {price_str}€"
362365
button.setText(label)

0 commit comments

Comments
 (0)