Add support for rpg maker MZ
This commit is contained in:
parent
5a586d5198
commit
b67739616a
|
@ -19,7 +19,7 @@ namespace RMDEC
|
|||
private bool isKeySet = false;
|
||||
private bool encryptedImages = false;
|
||||
private bool encryptedAudio = false;
|
||||
|
||||
public bool MZ = false;
|
||||
private string gameTitle;
|
||||
private string filePath;
|
||||
private string systemJsonFile;
|
||||
|
@ -174,6 +174,18 @@ namespace RMDEC
|
|||
}
|
||||
|
||||
mvp.filePath = Path.GetDirectoryName(Path.GetDirectoryName(path));
|
||||
|
||||
// Detect MV or MZ
|
||||
|
||||
if (File.Exists(Path.Combine(mvp.filePath, "js", "rmmz_core.js")))
|
||||
{
|
||||
mvp.MZ = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
mvp.MZ = false;
|
||||
}
|
||||
|
||||
mvp.systemJsonFile = path;
|
||||
mvp.jsonData = systemJson;
|
||||
return mvp;
|
||||
|
|
|
@ -13,6 +13,7 @@ namespace RMDEC
|
|||
public partial class mvProjectToolset : Form
|
||||
{
|
||||
public MVProject mvProject;
|
||||
|
||||
public mvProjectToolset(MVProject proj)
|
||||
{
|
||||
mvProject = proj;
|
||||
|
@ -138,12 +139,21 @@ namespace RMDEC
|
|||
case ".rpgmvp":
|
||||
pngList.Add(file);
|
||||
break;
|
||||
case ".png_":
|
||||
pngList.Add(file);
|
||||
break;
|
||||
case ".rpgmvo":
|
||||
oggList.Add(file);
|
||||
break;
|
||||
case ".ogg_":
|
||||
oggList.Add(file);
|
||||
break;
|
||||
case ".rpgmvm":
|
||||
m4aList.Add(file);
|
||||
break;
|
||||
case ".m4a_":
|
||||
m4aList.Add(file);
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -282,11 +292,20 @@ namespace RMDEC
|
|||
{
|
||||
updateTitle();
|
||||
indexFiles();
|
||||
|
||||
if(mvProject.MZ)
|
||||
{
|
||||
unmakeMV.Text = "Deploy MZ Project";
|
||||
makeMV.Text = "Un-Deploy MZ Project";
|
||||
}
|
||||
}
|
||||
|
||||
private void updateTitle()
|
||||
{
|
||||
this.Text = "RMDec - [RMMV] " + mvProject.GameTitle + " - " + mvProject.FilePath + " - encryptedImages: "+mvProject.EncryptedImages.ToString()+" - encrypedAudio: "+mvProject.EncryptedAudio.ToString();
|
||||
string Engine = "[RMMV]";
|
||||
if (mvProject.MZ)
|
||||
Engine = "[RMMZ]";
|
||||
this.Text = "RMDec - "+ Engine +" " + mvProject.GameTitle + " - " + mvProject.FilePath + " - encryptedImages: "+mvProject.EncryptedImages.ToString()+" - encrypedAudio: "+mvProject.EncryptedAudio.ToString();
|
||||
}
|
||||
private string encodeFileExtension(string fileName)
|
||||
{
|
||||
|
@ -296,7 +315,10 @@ namespace RMDEC
|
|||
switch (extension)
|
||||
{
|
||||
case ".png":
|
||||
if (!mvProject.MZ)
|
||||
newExtension = ".rpgmvp";
|
||||
else
|
||||
newExtension = extension + "_";
|
||||
Invoke((Action)delegate
|
||||
{
|
||||
encryptedImageCount += 1;
|
||||
|
@ -304,7 +326,10 @@ namespace RMDEC
|
|||
});
|
||||
break;
|
||||
case ".ogg":
|
||||
if (!mvProject.MZ)
|
||||
newExtension = ".rpgmvo";
|
||||
else
|
||||
newExtension = extension + "_";
|
||||
Invoke((Action)delegate
|
||||
{
|
||||
encryptedMusicCount += 1;
|
||||
|
@ -312,7 +337,10 @@ namespace RMDEC
|
|||
});
|
||||
break;
|
||||
case ".m4a":
|
||||
if (!mvProject.MZ)
|
||||
newExtension = ".rpgmvm";
|
||||
else
|
||||
newExtension = extension + "_";
|
||||
Invoke((Action)delegate
|
||||
{
|
||||
encryptedMusicCount += 1;
|
||||
|
@ -436,7 +464,30 @@ namespace RMDEC
|
|||
unencryptedMusicCount += 1;
|
||||
});
|
||||
break;
|
||||
|
||||
case ".ogg_":
|
||||
newExtension = ".ogg";
|
||||
Invoke((Action)delegate
|
||||
{
|
||||
encryptedMusicCount -= 1;
|
||||
unencryptedMusicCount += 1;
|
||||
});
|
||||
break;
|
||||
case ".m4a_":
|
||||
newExtension = ".m4a";
|
||||
Invoke((Action)delegate
|
||||
{
|
||||
encryptedMusicCount -= 1;
|
||||
unencryptedMusicCount += 1;
|
||||
});
|
||||
break;
|
||||
case ".png_":
|
||||
newExtension = ".png";
|
||||
Invoke((Action)delegate
|
||||
{
|
||||
encryptedMusicCount -= 1;
|
||||
unencryptedMusicCount += 1;
|
||||
});
|
||||
break;
|
||||
}
|
||||
|
||||
return newExtension;
|
||||
|
@ -528,9 +579,18 @@ namespace RMDEC
|
|||
}
|
||||
|
||||
private void onMakeMvComplete()
|
||||
{
|
||||
if(!mvProject.MZ)
|
||||
{
|
||||
string rpgProject = Path.Combine(mvProject.FilePath, "Game.rpgproject");
|
||||
File.WriteAllText(rpgProject, "RPGMV 1.0.0");
|
||||
}
|
||||
else
|
||||
{
|
||||
string rpgProject = Path.Combine(mvProject.FilePath, "game.rmmzproject");
|
||||
File.WriteAllText(rpgProject, "RPGMZ 1.0.1");
|
||||
}
|
||||
|
||||
|
||||
processingText.BackColor = Color.Green;
|
||||
processingText.Text = "Game Un-Deployed!";
|
||||
|
@ -620,7 +680,8 @@ namespace RMDEC
|
|||
private void onUnMakeMvComplete()
|
||||
{
|
||||
string rpgProject = Path.Combine(mvProject.FilePath, "Game.rpgproject");
|
||||
|
||||
if (mvProject.MZ)
|
||||
rpgProject = Path.Combine(mvProject.FilePath, "game.rmmzproject");
|
||||
if (File.Exists(rpgProject))
|
||||
{
|
||||
File.Delete(rpgProject);
|
||||
|
|
|
@ -34,7 +34,10 @@ namespace RMDEC
|
|||
{
|
||||
MVProject proj = MVProject.ParseSystemJson(projectFile);
|
||||
globalProjectList.Add(proj);
|
||||
if(!proj.MZ)
|
||||
projectList.Items.Add("[RMMV] - " + proj.GameTitle + " - " + relativeName);
|
||||
else
|
||||
projectList.Items.Add("[RMMZ] - " + proj.GameTitle + " - " + relativeName);
|
||||
selectButton.Enabled = true;
|
||||
}
|
||||
catch (Exception) { }
|
||||
|
|
Loading…
Reference in New Issue