From 09b6bff1f59500b144be7fb529673bc322b66bed Mon Sep 17 00:00:00 2001 From: Hohenzoler <127593783+Hohenzoler@users.noreply.github.com> Date: Wed, 7 Feb 2024 20:18:25 +0100 Subject: [PATCH 1/2] FIXED CRASHING!!!! --- gui/ModifyParameters.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/gui/ModifyParameters.py b/gui/ModifyParameters.py index 09295cc..1caaf86 100644 --- a/gui/ModifyParameters.py +++ b/gui/ModifyParameters.py @@ -1,18 +1,17 @@ import tkinter as tk -from tkinter import * -from ttkbootstrap import ttk -from ttkbootstrap import Style +# from tkinter import * +import ttkbootstrap as ttk import os class Parameters: def __init__(self, object): - self.root = tk.Tk() + self.root = ttk.Window(themename='solar') self.object = object - # Apply ttkbootstrap theme 'solar' - self.style = Style(theme='solar') - self.style.master = self.root + # # Apply ttkbootstrap theme 'solar' + # self.style = Style() + # self.style.master = self.root self.root.title("Parameters") self.root.resizable(False, False) From ee77bdce19d55572e259611b7771181e3a7eb526 Mon Sep 17 00:00:00 2001 From: Hohenzoler <127593783+Hohenzoler@users.noreply.github.com> Date: Wed, 7 Feb 2024 20:21:26 +0100 Subject: [PATCH 2/2] fixed texture bugs --- classes/gameobjects.py | 2 ++ gui/ModifyParameters.py | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/classes/gameobjects.py b/classes/gameobjects.py index d86eca3..8014e76 100644 --- a/classes/gameobjects.py +++ b/classes/gameobjects.py @@ -335,6 +335,8 @@ def get_Texture(self): self.texture = images.water elif self.textureName == 'clouds': self.texture = images.clouds + elif self.textureName == 'paper': + self.texture = images.papier else: self.texture = None diff --git a/gui/ModifyParameters.py b/gui/ModifyParameters.py index 1caaf86..7311b71 100644 --- a/gui/ModifyParameters.py +++ b/gui/ModifyParameters.py @@ -60,10 +60,10 @@ def create_element(self, param, row): self.slider_buttons[0].grid(row=row, column=1, padx=25, pady=5, sticky='w') elif param == 'texture': - self.textureOptions = [file[:-4] for file in os.listdir("images/materials") if file.endswith('.png')] + self.textureOptions = [file[:-4].capitalize() for file in os.listdir("images/materials") if file.endswith('.png')] self.TextureDropdown = ttk.Combobox(self.root, values=self.textureOptions) self.TextureDropdown.grid(row=row, column=1, padx=25, pady=5, sticky='w') - self.TextureDropdown.set(self.parameters_dict[param]) + self.TextureDropdown.set(self.parameters_dict[param].capitalize()) else: try: @@ -104,7 +104,7 @@ def store_parameters(self): new_parameters.update(lazer_on) if self.TextureDropdown != None: - new_parameters['texture'] = self.TextureDropdown.get() + new_parameters['texture'] = self.TextureDropdown.get().lower() try: for param, entry_widget in self.parameters_dict.items():