// Detect It Easy: detection rule file
// Author: BJNFNE <bjnfne@web.de>

// https://wiki.scummvm.org/index.php?title=Director
meta("game engine", "Director");

function detect() {
    if (PE.isExportFunctionPresent("_FindEmbeddedMovie") || PE.isExportFunctionPresent("_GetCurrentEmbeddedMovie")) {
        sVersion = "7.0-7.0.2";
        bDetected = true;
    } else if (PE.getVersionStringInfo("LegalCopyright") == "Copyright © 1985-1996 Macromedia, Inc.") {
        sVersion = "5.0-5.0.1";
        bDetected = true;
    } else if (PE.getVersionStringInfo("LegalCopyright") == "Copyright © 1985-1997 Macromedia, Inc.") {
        sVersion = "6.0-6.5";
        bDetected = true;
    } else if (PE.getVersionStringInfo("ProductName") == "Director 8 Shockwave Studio") {
        sVersion = "8.0";
        sOptions = "Shockwave Studio";
        bDetected = true;
    } else if (PE.getVersionStringInfo("ProductName") == "Director 8.5 Shockwave Studio") {
        sVersion = "8.5";
        sOptions = "Shockwave Studio";
        bDetected = true;
    } else if (PE.getVersionStringInfo("LegalCopyright") == "Copyright © 1985-2002 Macromedia, Inc.") {
        sVersion = "9.0";
        bDetected = true;
    } else if (PE.getVersionStringInfo("LegalCopyright") == "Copyright © 1985-2003 Macromedia, Inc.") {
        sVersion = "10.0";
        bDetected = true;
    } else if (PE.getVersionStringInfo("ProductName") == "Director MX 2004") {
        sVersion = "10.1";
        sOptions = "MX 2004";
        bDetected = true;
    } else if (PE.getVersionStringInfo("ProductName") == "Director 11.3") {
        sVersion = "11.0.3";
        bDetected = true;
    } else if (PE.getVersionStringInfo("ProductName") == "Director 11.5") {
        sVersion = "11.5";
        bDetected = true;
    } else if (PE.getVersionStringInfo("ProductVersion") == "12.0.1 Development") {
        sVersion = "12.0.1";
        sOptions = "Development build";
        bDetected = true;
    }
    return result();
}