Ejemplo n.º 1
0
from game.game import Game
from userdata import persistency, logging as logging_module

assert len(
    sys.argv
) >= 3, "__init__.py should be started with two mandatory arguments: %UserProfile% location and application version"

persistency.setup(sys.argv[1])
dcs.planes.FlyingType.payload_dirs = [
    os.path.join(os.path.dirname(os.path.realpath(__file__)),
                 "resources\\payloads")
]

VERSION_STRING = sys.argv[2]
logging_module.setup_version_string(VERSION_STRING)
logging.info("Using {} as userdata folder".format(persistency.base_path()))


def proceed_to_main_menu(game: Game):
    m = ui.mainmenu.MainMenu(w, None, game)
    m.display()


def is_version_compatible(save_version):
    current_version_components = re.split(r"[\._]", VERSION_STRING)
    save_version_components = re.split(r"[\._]", save_version)

    if "--ignore-save" in sys.argv:
        return False

    if current_version_components == save_version_components:
Ejemplo n.º 2
0
 def debriefing_directory_location(self) -> str:
     return os.path.join(base_path(), "liberation_debriefings")
Ejemplo n.º 3
0
    if os.path.exists(custom_payloads):
        dcs.planes.FlyingType.payload_dirs.append(custom_payloads)
    else:
        # For release version the path is different.
        custom_payloads = os.path.join(os.path.dirname(os.path.realpath(__file__)),
                                       "resources\\customized_payloads")
        if os.path.exists(custom_payloads):
            dcs.planes.FlyingType.payload_dirs.append(custom_payloads)


    first_start = liberation_install.init()
    if first_start:
        window = QLiberationFirstStartWindow()
        window.exec_()

    logging.info("Using {} as 'Saved Game Folder'".format(persistency.base_path()))
    logging.info("Using {} as 'DCS installation folder'".format(liberation_install.get_dcs_install_directory()))

    # Splash screen setup
    pixmap = QPixmap("./resources/ui/splash_screen.png")
    splash = QSplashScreen(pixmap)
    splash.show()

    # Once splash screen is up : load resources & setup stuff
    uiconstants.load_icons()
    uiconstants.load_event_icons()
    uiconstants.load_aircraft_icons()
    uiconstants.load_vehicle_icons()

    # Replace DCS Mission scripting file to allow DCS Liberation to work
    try:
Ejemplo n.º 4
0
        dcs.planes.FlyingType.payload_dirs.append(custom_payloads)
    else:
        # For release version the path is different.
        custom_payloads = os.path.join(
            os.path.dirname(os.path.realpath(__file__)),
            "resources\\customized_payloads")
        if os.path.exists(custom_payloads):
            dcs.planes.FlyingType.payload_dirs.append(custom_payloads)

    first_start = liberation_install.init()
    if first_start:
        window = QLiberationFirstStartWindow()
        window.exec_()

    logging.info("Using {} as 'Saved Game Folder'".format(
        persistency.base_path()))
    logging.info("Using {} as 'DCS installation folder'".format(
        liberation_install.get_dcs_install_directory()))

    # Splash screen setup
    pixmap = QPixmap("./resources/ui/splash_screen.png")
    splash = QSplashScreen(pixmap)
    splash.show()

    # Once splash screen is up : load resources & setup stuff
    uiconstants.load_icons()
    uiconstants.load_event_icons()
    uiconstants.load_aircraft_icons()
    uiconstants.load_vehicle_icons()

    # Replace DCS Mission scripting file to allow DCS Liberation to work