Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
rutra8002 committed Feb 7, 2024
2 parents eea6dce + ee77bdc commit e67c794
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
2 changes: 2 additions & 0 deletions classes/gameobjects.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
19 changes: 9 additions & 10 deletions gui/ModifyParameters.py
Original file line number Diff line number Diff line change
@@ -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)
Expand Down Expand Up @@ -61,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:
Expand Down Expand Up @@ -105,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():
Expand Down

0 comments on commit e67c794

Please sign in to comment.