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