import os
import subprocess



print("\n")
print("================================================================================")
print("CRYSIS 3 VIDEO SIGNER")
print("AUTHOR: Lord Zapharos (www.lordzapharos.com)")
print("DATE: 19 August 2020")
print("================================================================================")
print("This application will compile all files in the '__videosInput' folder and place")
print("them in the '__videosOutput' folder. The modded files can then be placed in your")
print("Crysis 3 game directory.")
print("\n")
print("Depending on the size and number of your mod files, this script may take only a")
print("few seconds or up to 10 minutes to finish. Be patient! You will see several")
print("messages from the compiler when running this script, which can be safely")
print("ignored unless there is an error.")
print("\n")
print("Are you ready to compile your video files now?")
print("Any existing files in '__videosOutput' will be overwritten.")
print("\n")



proceed = ""
while len(proceed) == 0 \
        or (proceed != "y" and proceed != "Y" and proceed != "yes" and proceed != "YES" \
            and proceed.lower() != "yes"):
    proceed = input("Continue packing video files? (yes/no): ")
    if proceed == "n" or proceed == "N" or proceed == "no" or proceed == "NO" \
            or proceed.lower() == "no" or proceed == "q" or proceed == "Q" \
            or proceed == "quit" or proceed == "QUIT" or proceed.lower() == "quit":
        print("\nUser requested exit. The '__videosOutput' folder has NOT been changed.")
        print("\n")
        quit()
print("\n\n")



root = os.getcwd()
input = root + "\\__videosInput"
output = root + "\\__videosOutput"

command = "runSign.bat \"" + input + "\" \"" + output + "\""
subprocess.call(command, shell=True, cwd="bin")



print("\n\n")
print("================================================================================")
print("Your video files were successfully compiled and have been placed in the")
print("'__videosOutput' folder. Don't forget to move them to your Crysis 3 game directory")
print("before starting up the game!")
print("\n")
print("This script will now exit.")
print("\n")
