Skip to content

Commit

Permalink
disable button functionality instead
Browse files Browse the repository at this point in the history
Instead of killing the UI elements for the error box upon pressing a button, disable the functionality of the other buttons instead.
  • Loading branch information
Treefire33 committed Dec 3, 2024
1 parent 3abe433 commit a18aff6
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions scripts/screens/StartScreen.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ def __init__(self, name=None):

self.social_buttons = {}

self.error_open = False

def handle_event(self, event):
"""This is where events that occur on this page are handled.
For the pygame_gui rewrite, button presses are also handled here."""
Expand All @@ -73,7 +75,7 @@ def handle_event(self, event):
self.new_clan_button: "make clan screen",
self.settings_button: "settings screen",
}
if event.ui_element in screens:
if event.ui_element in screens and not self.error_open:
self.change_screen(screens[event.ui_element])
elif event.ui_element == self.open_data_directory_button:
if platform.system() == "Darwin":
Expand All @@ -89,6 +91,7 @@ def handle_event(self, event):
self.error_gethelp.kill()
self.closebtn.kill()
self.open_data_directory_button.kill()
self.error_open = True
# game.switches['error_message'] = ''
# game.switches['traceback'] = ''
elif event.ui_element == self.update_button:
Expand Down Expand Up @@ -145,11 +148,6 @@ def exit_screen(self):
self.switch_clan_button.kill()
self.new_clan_button.kill()
self.settings_button.kill()
if game.switches["error_message"]:
self.error_box.kill()
self.error_gethelp.kill()
self.closebtn.kill()
self.open_data_directory_button.kill()
self.error_label.kill()
self.warning_label.kill()
self.update_button.kill()
Expand Down Expand Up @@ -415,6 +413,7 @@ def screen_switches(self):
self.open_data_directory_button.hide()

self.closebtn.show()
self.error_open = True

if game.clan is not None:
key_copy = tuple(Cat.all_cats.keys())
Expand Down

0 comments on commit a18aff6

Please sign in to comment.