Skip to content
Snippets Groups Projects
Commit 51782767 authored by Fabian Heinrich's avatar Fabian Heinrich
Browse files

Better recipe and meal names displayed in gui

parent c99ef71b
No related branches found
No related tags found
1 merge request!74Resolve "Study instructions"
Pipeline #48061 passed
...@@ -3,6 +3,7 @@ import json ...@@ -3,6 +3,7 @@ import json
import logging import logging
import os import os
import random import random
import re
import signal import signal
import subprocess import subprocess
import sys import sys
...@@ -1133,7 +1134,9 @@ class PyGameGUI: ...@@ -1133,7 +1134,9 @@ class PyGameGUI:
anchors=anchors, anchors=anchors,
) )
text = f"Player {player} served meal {meal}." meal = re.sub(r"(?<!^)(?=[A-Z])", " ", meal)
meal = meal.replace("(", "").replace(")", "")
text = f"Player {player} served a {meal}."
meal_label = pygame_gui.elements.UILabel( meal_label = pygame_gui.elements.UILabel(
text=text, text=text,
relative_rect=pygame.Rect( relative_rect=pygame.Rect(
...@@ -1345,6 +1348,7 @@ class PyGameGUI: ...@@ -1345,6 +1348,7 @@ class PyGameGUI:
for idx, rg in enumerate(self.level_info["recipe_graphs"]): for idx, rg in enumerate(self.level_info["recipe_graphs"]):
meal = rg["meal"] meal = rg["meal"]
meal = re.sub(r"(?<!^)(?=[A-Z])", " ", meal)
positions = np.array(list(rg["layout"].values())) positions = np.array(list(rg["layout"].values()))
unique_vals = np.unique(positions[:, 1]) unique_vals = np.unique(positions[:, 1])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment