From 2c6e8c414c4d9d71b1d2bf0cd59c36e09f2d5961 Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Sat, 5 Mar 2022 11:24:37 -0800 Subject: [PATCH] Add --dev flag to put the game in developer mode. Right now the only thing this does is remove sleeps meant to give people time to read things that developers have already seen hundreds of times. --- qt_ui/main.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/qt_ui/main.py b/qt_ui/main.py index 0a4173c5..5bbbebef 100644 --- a/qt_ui/main.py +++ b/qt_ui/main.py @@ -58,7 +58,7 @@ def inject_custom_payloads(user_path: Path) -> None: PayloadDirectories.set_preferred(user_path / "MissionEditor" / "UnitPayloads") -def run_ui(game: Optional[Game], new_map: bool) -> None: +def run_ui(game: Optional[Game], new_map: bool, dev: bool) -> None: os.environ["QT_AUTO_SCREEN_SCALE_FACTOR"] = "1" # Potential fix for 4K screens app = QApplication(sys.argv) @@ -92,8 +92,10 @@ def run_ui(game: Optional[Game], new_map: bool) -> None: splash = QSplashScreen(pixmap) splash.show() - # Give enough time to read splash screen - time.sleep(3) + # Developers are launching the game in a loop hundreds of times. We've read it. + if not dev: + # Give enough time to read splash screen + time.sleep(3) # Once splash screen is up : load resources & setup stuff uiconstants.load_icons() @@ -172,16 +174,18 @@ def parse_args() -> argparse.Namespace: help="Emits a warning for weapons without date or fallback information.", ) + parser.add_argument("--dev", action="store_true", help="Enable development mode.") + parser.add_argument( "--new-map", action="store_true", - help="Use the Vue based map. Not yet fully functional.", + help="Use the React based map. Not yet fully functional.", ) parser.add_argument( "--old-map", dest="new_map", action="store_false", - help="Deprecated. Does nothing.", + help="Use the legacy map. This is the default.", ) new_game = subparsers.add_parser("new-game") @@ -352,7 +356,7 @@ def main(): return with Server().run_in_thread(): - run_ui(game, args.new_map) + run_ui(game, args.new_map, args.dev) if __name__ == "__main__":