Skip to content

Commit

Permalink
Add encrypted 2k3MP to unsupported engines
Browse files Browse the repository at this point in the history
  • Loading branch information
Primekick committed Jan 14, 2025
1 parent a52a641 commit 6d932db
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 84 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ public enum ProjectType {
, RPG_MAKER_VX("RPG Maker VX")
, RPG_MAKER_VX_ACE("RPG Maker VX Ace")
, RPG_MAKER_MV_MZ("RPG Maker MV/MZ")
, WOLF_RPG_EDITOR("Wolf RPG Editor");
, WOLF_RPG_EDITOR("Wolf RPG Editor")
, ENCRYPTED_2K3_MANIACS("Encrypted 2k3 (Maniacs Patch)");

private final String label;

Expand Down
52 changes: 28 additions & 24 deletions src/filefinder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -313,31 +313,35 @@ bool FileFinder::IsRPG2kProjectWithRenames(const FilesystemView& fs) {
}

FileFinder::ProjectType FileFinder::GetProjectType(const FilesystemView &fs) {
if (IsValidProject(fs)) {
return FileFinder::ProjectType::Supported;
}
if (IsValidProject(fs)) {
return FileFinder::ProjectType::Supported;
}

if (!fs.FindFile("RGSS10??.dll").empty()) {
return FileFinder::ProjectType::RpgMakerXp;
}
if (!fs.FindFile("RGSS10??.dll").empty()) {
return FileFinder::ProjectType::RpgMakerXp;
}

if (!fs.FindFile("RGSS20??.dll").empty()) {
return FileFinder::ProjectType::RpgMakerVx;
}
if (!fs.FindFile("RGSS20??.dll").empty()) {
return FileFinder::ProjectType::RpgMakerVx;
}

if (!fs.FindFile("System", "RGSS30?.dll").empty()) {
return FileFinder::ProjectType::RpgMakerVxAce;
}

if (!fs.FindFile("System", "RGSS30?.dll").empty()) {
return FileFinder::ProjectType::RpgMakerVxAce;
}
if (!fs.FindFile("nw.dll").empty()) {
return FileFinder::ProjectType::RpgMakerMvMz;
}

if (!fs.FindFile("nw.dll").empty()) {
return FileFinder::ProjectType::RpgMakerMvMz;
}
if (!fs.FindFile("GuruGuruSMF4.dll").empty()) {
return FileFinder::ProjectType::WolfRpgEditor;
}

if (!fs.FindFile("GuruGuruSMF4.dll").empty()) {
return FileFinder::ProjectType::WolfRpgEditor;
}
if (!fs.FindFile("RPG_RT.rs1").empty()) {
return FileFinder::ProjectType::Encrypted2k3Maniacs;
}

return FileFinder::ProjectType::Unknown;
return FileFinder::ProjectType::Unknown;
}

bool FileFinder::OpenViewToEasyRpgFile(FilesystemView& fs) {
Expand Down Expand Up @@ -569,11 +573,11 @@ std::vector<FileFinder::GameEntry> FileFinder::FindGames(FilesystemView fs, int
return;
}

auto project_type = GetProjectType(subfs);
if (project_type != ProjectType::Unknown) {
games.push_back({ subfs, project_type });
return;
}
auto project_type = GetProjectType(subfs);
if (project_type != ProjectType::Unknown) {
games.push_back({ subfs, project_type });
return;
}

auto entries = subfs.ListDirectory();

Expand Down
121 changes: 62 additions & 59 deletions src/filefinder.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,34 +45,35 @@ namespace FileFinder {
constexpr const auto FONTS_TYPES = Utils::MakeSvArray(".fon", ".fnt", ".bdf", ".ttf", ".ttc", ".otf", ".woff2", ".woff");
constexpr const auto TEXT_TYPES = Utils::MakeSvArray(".txt", ".csv", ""); // "" = Complete Filename (incl. extension) provided by the user

/**
* Type of the project. Used to differentiate between supported games (2kX or EasyRPG)
* and known but unsupported (i.e. newer RPG Makers).
*/
enum ProjectType {
Unknown,
// 2kX or EasyRPG
Supported,
// Known unsupported engines
RpgMakerXp,
RpgMakerVx,
RpgMakerVxAce,
RpgMakerMvMz,
WolfRpgEditor,
};

/**
* Helper struct combining the project's directory and its type.
*/
struct GameEntry {
FilesystemView fs;
ProjectType type;
};

/** @return Human readable project type label */
static const char* GetProjectTypeLabel(ProjectType pt);

/**
/**
* Type of the project. Used to differentiate between supported games (2kX or EasyRPG)
* and known but unsupported (i.e. newer RPG Makers).
*/
enum ProjectType {
Unknown,
// 2kX or EasyRPG
Supported,
// Known unsupported engines
RpgMakerXp,
RpgMakerVx,
RpgMakerVxAce,
RpgMakerMvMz,
WolfRpgEditor,
Encrypted2k3Maniacs,
};

/**
* Helper struct combining the project's directory and its type.
*/
struct GameEntry {
FilesystemView fs;
ProjectType type;
};

/** @return Human readable project type label */
static const char* GetProjectTypeLabel(ProjectType pt);

/**
* Quits FileFinder.
*/
void Quit();
Expand Down Expand Up @@ -314,11 +315,11 @@ namespace FileFinder {
*/
bool IsRPG2kProjectWithRenames(const FilesystemView& fs);

/**
* @param p fs Tree to check
* @return Project type whether the tree contains a supported project type, known but unsupported engines, or something unknown
*/
ProjectType GetProjectType(const FilesystemView& fs);
/**
* @param p fs Tree to check
* @return Project type whether the tree contains a supported project type, known but unsupported engines, or something unknown
*/
ProjectType GetProjectType(const FilesystemView& fs);

/**
* Determines if the directory contains a single file/directory ending in ".easyrpg" for use in the
Expand Down Expand Up @@ -355,18 +356,18 @@ namespace FileFinder {
bool IsMajorUpdatedTree();

/** RPG_RT.exe file size thresholds
*
* 2k v1.51 (Japanese) : 746496
* 2k v1.50 (Japanese) : 745984
* -- threshold (2k) -- : 735000
* 2k v1.10 (Japanese) : 726016
*
* 2k3 v1.09a (Japanese) : 950784
* 2k3 v1.06 (Japanese) : 949248
* 2k3 v1.05 (Japanese) : unknown
* -- threshold (2k3) -- : 927000
* 2k3 v1.04 (Japanese) : 913408
*/
*
* 2k v1.51 (Japanese) : 746496
* 2k v1.50 (Japanese) : 745984
* -- threshold (2k) -- : 735000
* 2k v1.10 (Japanese) : 726016
*
* 2k3 v1.09a (Japanese) : 950784
* 2k3 v1.06 (Japanese) : 949248
* 2k3 v1.05 (Japanese) : unknown
* -- threshold (2k3) -- : 927000
* 2k3 v1.04 (Japanese) : 913408
*/
enum RpgrtMajorUpdateThreshold {
RPG2K = 735000,
RPG2K3 = 927000,
Expand Down Expand Up @@ -408,22 +409,24 @@ std::string FileFinder::MakePath(lcf::Span<T> components) {
}

static inline const char* FileFinder::GetProjectTypeLabel(ProjectType pt) {
switch (pt) {
case Supported:
return "Supported";
case RpgMakerXp:
return "RPG Maker XP";
case RpgMakerVx:
return "RPG Maker VX";
case RpgMakerVxAce:
return "RPG Maker VX Ace";
case RpgMakerMvMz:
return "RPG Maker MV/MZ";
case WolfRpgEditor:
return "Wolf RPG Editor";
switch (pt) {
case Supported:
return "Supported";
case RpgMakerXp:
return "RPG Maker XP";
case RpgMakerVx:
return "RPG Maker VX";
case RpgMakerVxAce:
return "RPG Maker VX Ace";
case RpgMakerMvMz:
return "RPG Maker MV/MZ";
case WolfRpgEditor:
return "Wolf RPG Editor";
case Encrypted2k3Maniacs:
return "Encrypted 2k3MP";
default:
return "Unknown";
}
}
}

#endif

0 comments on commit 6d932db

Please sign in to comment.