Fixed event editor overwrite bug

- also Removed unused SPK
- fixed some movement names (not sure whether there are version differences or not)
- added a few DPPt commands and fixed some params
This commit is contained in:
AdAstra-LD
2021-02-13 00:59:48 +01:00
parent c96abaf484
commit 74a624fd6d
10 changed files with 536 additions and 1536 deletions

View File

@@ -18,7 +18,7 @@ namespace DSPRE.ROMFiles {
public List<CommandContainer> allScripts = new List<CommandContainer>();
public List<CommandContainer> allFunctions = new List<CommandContainer>();
public List<ActionContainer> allActions = new List<ActionContainer>();
int fileID = -1;
public int fileID = -1;
public bool isLevelScript = new bool();
#endregion
@@ -131,13 +131,13 @@ namespace DSPRE.ROMFiles {
"\\" + fileID.ToString("D4"), FileMode.Open)) {
this.fileID = fileID;
}
public ScriptFile(List<CommandContainer> scripts, List<CommandContainer> functions, List<ActionContainer> movements) {
public ScriptFile(List<CommandContainer> scripts, List<CommandContainer> functions, List<ActionContainer> movements, int fileID = -1) {
allScripts = scripts;
allFunctions = functions;
allActions = movements;
isLevelScript = false;
}
public ScriptFile(string[] scriptLines, string[] functionLines, string[] actionLines, int ID = -1) {
public ScriptFile(string[] scriptLines, string[] functionLines, string[] actionLines, int fileID = -1) {
//TODO: give user the possibility to jump to/call a script
//once it's done, this Predicate below will be the only one needed, since there will be no distinction between
//a script and a function
@@ -151,7 +151,7 @@ namespace DSPRE.ROMFiles {
|| source[x].IndexOf(RomInfo.ScriptCommandNamesDict[0x0016] + " Function") >= 0; //Jump Function_#
allScripts = readCommandsFromLines(scriptLines, containerTypes.SCRIPT, scriptEndCondition); //Jump + whitespace
if (allScripts == null)
if (allScripts == null || allScripts.Count <= 0)
return;
allFunctions = readCommandsFromLines(functionLines, containerTypes.FUNCTION, functionEndCondition); //Jump + whitespace
@@ -162,7 +162,7 @@ namespace DSPRE.ROMFiles {
if (allActions == null)
return;
this.fileID = ID;
this.fileID = fileID;
}
#endregion