extracted the ItemSelection from athmos and created a parent class

This commit is contained in:
2025-08-03 18:29:25 +02:00
parent f55522f03c
commit 9f9f667a86
3 changed files with 58 additions and 33 deletions

View File

@ -116,7 +116,8 @@ class GuiMain:
self.athmos.index = index
def set_selected_athmo(self):
self.selected_athmo_srf = font_helvetica16.render(self.athmos.filenames[self.athmos.index], False, color_primary)
self.selected_athmo_srf = font_helvetica16.render(
self.athmos.get_name_by_index(self.athmos.index), False, color_primary)
def set_athmo_filenames(self, filenames):
self.athmos.set_filenames(filenames)
@ -185,11 +186,11 @@ class GuiMain:
if event.key == pygame.K_UP:
if self.athmos.show_list:
self.athmos.index -= 1
self.athmos.index %= len(self.athmos.filenames)
self.athmos.index %= self.athmos.get_count()
if event.key == pygame.K_DOWN:
if self.athmos.show_list:
self.athmos.index += 1
self.athmos.index %= len(self.athmos.filenames)
self.athmos.index %= self.athmos.get_count()
elif event.type == pygame.QUIT:
self.running = False
elif event.type == pygame.MOUSEBUTTONDOWN: