Exemplo n.º 1
0
def main():
    logging_config.init_logging(VERSION)

    logging.debug("Python version %s", sys.version)

    game: Optional[Game] = None

    args = parse_args()

    # TODO: Flesh out data and then make unconditional.
    if args.warn_missing_weapon_data:
        lint_weapon_data()

    if args.subcommand == "new-game":
        with logged_duration("New game creation"):
            game = create_game(
                args.campaign,
                args.blue,
                args.red,
                args.supercarrier,
                args.auto_procurement,
                args.inverted,
                args.cheats,
            )

    run_ui(game)
Exemplo n.º 2
0
def main():
    logging_config.init_logging(VERSION)

    # Load eagerly to catch errors early.
    db.FACTIONS.initialize()

    game: Optional[Game] = None

    args = parse_args()

    # TODO: Flesh out data and then make unconditional.
    if args.warn_missing_weapon_data:
        lint_weapon_data()

    if args.subcommand == "new-game":
        game = create_game(
            args.campaign,
            args.blue,
            args.red,
            args.supercarrier,
            args.auto_procurement,
            args.inverted,
        )

    run_ui(game)
Exemplo n.º 3
0
def main():
    logging_config.init_logging(VERSION)

    # Load eagerly to catch errors early.
    db.FACTIONS.initialize()

    game: Optional[Game] = None

    args = parse_args()
    if args.subcommand == "new-game":
        game = create_game(args.campaign, args.blue, args.red,
                           args.supercarrier, args.auto_procurement,
                           args.inverted)

    run_ui(game)
Exemplo n.º 4
0
def main():
    logging_config.init_logging(VERSION)

    logging.debug("Python version %s", sys.version)

    if not str(Path(__file__)).isascii():
        logging.warning(
            "Installation path contains non-ASCII characters. This is known to cause problems."
        )

    game: Optional[Game] = None

    args = parse_args()

    # TODO: Flesh out data and then make unconditional.
    if args.warn_missing_weapon_data:
        lint_all_weapon_data()

    load_mods()

    if args.subcommand == "new-game":
        with logged_duration("New game creation"):
            game = create_game(
                args.campaign,
                args.blue,
                args.red,
                args.supercarrier,
                args.auto_procurement,
                args.inverted,
                args.cheats,
                args.date,
                args.restrict_weapons_by_date,
            )
    if args.subcommand == "lint-weapons":
        lint_weapon_data_for_aircraft(AircraftType.named(args.aircraft))
        return

    with Server().run_in_thread():
        run_ui(game, args.dev)
Exemplo n.º 5
0
from PySide2.QtWidgets import QApplication, QSplashScreen

from game import db, persistency, VERSION
from qt_ui import (
    liberation_install,
    liberation_theme,
    logging_config,
    uiconstants,
)
from qt_ui.windows.GameUpdateSignal import GameUpdateSignal
from qt_ui.windows.QLiberationWindow import QLiberationWindow
from qt_ui.windows.preferences.QLiberationFirstStartWindow import \
    QLiberationFirstStartWindow

# Logging setup
logging_config.init_logging(VERSION)

if __name__ == "__main__":
    # Load eagerly to catch errors early.
    db.FACTIONS.initialize()

    os.environ[
        "QT_AUTO_SCREEN_SCALE_FACTOR"] = "1"  # Potential fix for 4K screens
    app = QApplication(sys.argv)

    # init the theme and load the stylesheet based on the theme index
    liberation_theme.init()
    css = ""
    with open("./resources/stylesheets/" +
              liberation_theme.get_theme_css_file()) as stylesheet:
        app.setStyleSheet(stylesheet.read())