Skip to content

Commit

Permalink
Update main.py
Browse files Browse the repository at this point in the history
  • Loading branch information
supercam19 committed Mar 24, 2024
1 parent 4f93cf5 commit 0b855c4
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def __init__(self):
self.title("GameMonitor")
# self.resizable(False, False)
self.protocol("WM_DELETE_WINDOW", self.withdraw)
self.iconbitmap("icon.ico")
if os.path.isfile("icon.ico"): self.iconbitmap("icon.ico")
self.visible = True
self.toplevels = []

Expand Down Expand Up @@ -303,16 +303,19 @@ def main(open_window):


if __name__ == "__main__":
os.chdir(os.path.realpath(os.path.dirname(sys.argv[0])))
check_files()
try:
os.chdir(os.path.realpath(os.path.dirname(sys.argv[0])))
check_files()

default_monitor = 0
show_on_startup = False if "--startup" in sys.argv else True
default_monitor = 0
show_on_startup = False if "--startup" in sys.argv else True

for i, arg in enumerate(sys.argv):
show_on_startup = False if arg == '--startup' else True
if arg == '--launch-game' and len(sys.argv) > i + 1:
launch_game(sys.argv[i + 1])
for i, arg in enumerate(sys.argv):
show_on_startup = False if arg == '--startup' else True
if arg == '--launch-game' and len(sys.argv) > i + 1:
launch_game(sys.argv[i + 1])

main(show_on_startup)
main(show_on_startup)
except Exception as e:
popup("Error", f"An error occurred. If you believe this to be a bug, please submit an issue at github.com/supercam19/GameMonitor/issues with the error message:\n\n{e}")

0 comments on commit 0b855c4

Please sign in to comment.