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

Cleaned visualization up.

parent 63095add
No related branches found
No related tags found
1 merge request!1340-visualisierungsregeln
Pipeline #42069 failed
......@@ -24,7 +24,7 @@ TomatoSoup:
type: Meal
finished_progress_name: TomatoSoup
steps_needed: 500
needs: [ Tomato, Tomato, Tomato , Tomato, Tomato, Tomato, Tomato, Tomato, Tomato, Tomato, Tomato , Tomato, Tomato, Tomato, Tomato, Tomato, Tomato, Tomato, Tomato , Tomato, Tomato, Tomato, Tomato, Tomato, Tomato ]
needs: [ Tomato, Tomato, Tomato ]
equipment: Pot
Plate:
......
......@@ -27,7 +27,7 @@ def create_polygon(n, length):
if n == 0:
return np.array([0, 0])
vector = np.array([0, length])
vector = np.array([length, 0])
angle = (2 * np.pi) / n
rot_matrix = np.array(
......@@ -304,39 +304,16 @@ class PyGameGUI:
if isinstance(item, ProgressibleItem) and not item.finished:
self.draw_progress_bar(pos, item.progressed_steps, item.steps_needed)
# if isinstance(item, Plate) and item.holds:
# self.draw_item(pos, item.holds)
if isinstance(item, CookingEquipment) and item.content:
self.draw_item(pos, item.content)
if isinstance(item, Meal):
if "Soup" in item.name:
if item.finished:
if item.name in self.visualization_config:
image = pygame.image.load(
ROOT_DIR
/ "pygame_gui"
/ self.visualization_config[item.name]["parts"][0]["path"]
).convert_alpha()
size = self.visualization_config[item.name]["parts"][0]["size"]
image = pygame.transform.scale(
image, (size * scale, size * scale)
)
rect = image.get_rect()
rect.center = pos
self.screen.blit(image, rect)
elif item.parts:
triangle_offsets = create_polygon(len(item.parts), length=25)
print(triangle_offsets)
for idx, item in enumerate(item.parts):
self.draw_item(pos + triangle_offsets[idx], item, scale=0.6)
if item.finished:
if item.name in self.visualization_config:
self.draw_thing(pos, self.visualization_config[item.name]["parts"])
else:
for idx, o in enumerate(item.parts):
triangle_offsets = create_polygon(len(item.parts), length=25)
triangle_offsets = create_polygon(len(item.parts), length=10)
self.draw_item(pos + triangle_offsets[idx], o, scale=0.6)
def draw_progress_bar(self, pos, current, needed):
......
......@@ -115,24 +115,6 @@ ChoppedTomato:
path: images/tomato_cut.png
size: 40
TomatoSoup1of3:
parts:
- type: circle
radius: 4
color: firebrick
TomatoSoup2of3:
parts:
- type: circle
radius: 8
color: firebrick
TomatoSoup3of3:
parts:
- type: circle
radius: 12
color: firebrick
TomatoSoup:
parts:
- type: image
......
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