Skip to content

Commit

Permalink
Fixed --launch flag
Browse files Browse the repository at this point in the history
  • Loading branch information
Kataiser committed Oct 12, 2023
1 parent 3354d71 commit 8717f0a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions TF2 Rich Presence/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ def __init__(self, log: Optional[logger.Log] = None, set_process_priority: bool
self.import_custom()

parser = argparse.ArgumentParser()
parser.add_argument('--launch', action='store_true', help="Automatically launch the game on opening the program", default=False)
self.auto_launch = parser.parse_args().launch
parser.add_argument('--launch', action='store_true', help="Automatically launch TF2 when opening the program", default=False)
self.auto_launch_tf2 = parser.parse_args().launch

def __repr__(self) -> str:
return f"main.TF2RichPresense (state={self.test_state})"
Expand Down Expand Up @@ -311,9 +311,8 @@ def loop_body(self):
if self.gui.launched_tf2_with_button:
self.log.debug("Skipping possibly resetting launch button due to game hopefully launching")
else:
if self.auto_launch:
if self.auto_launch_tf2:
self.log.debug("Auto launching TF2")
self.auto_launch = False
self.gui.set_launch_tf2_button_state(True)
self.gui.launch_tf2()
else:
Expand All @@ -334,6 +333,7 @@ def loop_body(self):
self.gui.set_launch_tf2_button_state(p_data['Steam']['running'])
self.gui.launch_tf2_button['state'] = 'disabled'

self.auto_launch_tf2 = False
self.gui.safe_update()
self.init_operations()

Expand Down

0 comments on commit 8717f0a

Please sign in to comment.