From 863f8d863030f85b51eb984738616985a90ad189 Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Fri, 20 Sep 2024 22:49:06 -0700 Subject: [PATCH] Update lemonade.py --- modules/lemonade.py | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/modules/lemonade.py b/modules/lemonade.py index f49e9b8..b76938b 100644 --- a/modules/lemonade.py +++ b/modules/lemonade.py @@ -293,8 +293,8 @@ def start_lemonade(nodeID, message, celsius=False): # Calculate the unit cost and display the estimated sales from the forecast potential unit = cups.unit + lemons.unit + sugar.unit - buffer += " SupplyCost" + locale.currency(unit, grouping=True) + " per cup." - buffer += " SalesPotential:" + str(potential) + buffer += " SupplyCost" + locale.currency(unit, grouping=True) + "a cup" + buffer += " SalesPotential:" + str(potential) + "🄤" # Display the current inventory buffer += "Inventory:" @@ -309,15 +309,21 @@ def start_lemonade(nodeID, message, celsius=False): buffer += " šŸ‹:" + \ locale.currency(lemons.cost, grouping=True) + " bag of " + str(lemons.count) + "." buffer += " šŸš:" + \ - locale.currency(sugar.cost, grouping=True) + " bag for " + str(sugar.count) + " cups. " + locale.currency(sugar.cost, grouping=True) + " bag for " + str(sugar.count) + "🄤." # Display the current cash gainloss = inventory.cash - inventory.start - buffer += " Cash:" + \ + buffer += " šŸ’µ:" + \ locale.currency(inventory.cash, grouping=True) - buffer += " P&L:" + \ - locale.currency(gainloss, grouping=True) - + + + # if the player is in the red + pnl = locale.currency(gainloss, grouping=True) + if pnl.startswith("-"): + buffer += " P&LšŸ“‰" + pnl + else: + buffer += " P&LšŸ“ˆ" + pnl + buffer += f"\n🄤 to buy? Have {inventory.cups}, Cost {locale.currency(cups.cost, grouping=True)}/box25" saveValues() return buffer