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.
This commit is contained in:
Dan Albert 2022-03-05 11:24:37 -08:00
parent b4edd5d841
commit 2c6e8c414c

View File

@ -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__":