From a3a2a6c3edd8486ce9995254016fdfad9ba854ae Mon Sep 17 00:00:00 2001
From: AdAstra-LD <76622070+AdAstra-LD@users.noreply.github.com>
Date: Mon, 9 Aug 2021 19:31:15 +0200
Subject: [PATCH] Improved Item Editing [Event editor]
Standardize Items patch is no longer necessary to edit existing Ground items. [it is still necessary to set up items that aren't obtainable by default tho]
---
DS_Map/Main Window.Designer.cs | 52 ++++++++++++++---------
DS_Map/Main Window.cs | 78 ++++++++++++++++++++++++----------
DS_Map/Main Window.resx | 75 ++++++++++++++++++--------------
DS_Map/ROMToolboxDialog.cs | 24 ++++++-----
DS_Map/ROMToolboxDialog.resx | 8 ++--
5 files changed, 149 insertions(+), 88 deletions(-)
diff --git a/DS_Map/Main Window.Designer.cs b/DS_Map/Main Window.Designer.cs
index 50dec5a..d82dc14 100644
--- a/DS_Map/Main Window.Designer.cs
+++ b/DS_Map/Main Window.Designer.cs
@@ -394,6 +394,7 @@
this.owYMapUpDown = new System.Windows.Forms.NumericUpDown();
this.label10 = new System.Windows.Forms.Label();
this.owSpecialGroupBox = new System.Windows.Forms.GroupBox();
+ this.itemsSelectorHelpBtn = new System.Windows.Forms.Button();
this.owPartnerTrainerCheckBox = new System.Windows.Forms.CheckBox();
this.owItemComboBox = new System.Windows.Forms.ComboBox();
this.owItemLabel = new System.Windows.Forms.Label();
@@ -5193,7 +5194,6 @@
// isItemRadioButton
//
this.isItemRadioButton.AutoSize = true;
- this.isItemRadioButton.Enabled = false;
this.isItemRadioButton.Location = new System.Drawing.Point(115, 19);
this.isItemRadioButton.Name = "isItemRadioButton";
this.isItemRadioButton.Size = new System.Drawing.Size(45, 17);
@@ -5483,6 +5483,7 @@
//
// owSpecialGroupBox
//
+ this.owSpecialGroupBox.Controls.Add(this.itemsSelectorHelpBtn);
this.owSpecialGroupBox.Controls.Add(this.owPartnerTrainerCheckBox);
this.owSpecialGroupBox.Controls.Add(this.owItemComboBox);
this.owSpecialGroupBox.Controls.Add(this.owItemLabel);
@@ -5498,6 +5499,16 @@
this.owSpecialGroupBox.TabStop = false;
this.owSpecialGroupBox.Text = "Special Settings";
//
+ // itemsSelectorHelpBtn
+ //
+ this.itemsSelectorHelpBtn.Image = ((System.Drawing.Image)(resources.GetObject("itemsSelectorHelpBtn.Image")));
+ this.itemsSelectorHelpBtn.Location = new System.Drawing.Point(194, 67);
+ this.itemsSelectorHelpBtn.Name = "itemsSelectorHelpBtn";
+ this.itemsSelectorHelpBtn.Size = new System.Drawing.Size(28, 29);
+ this.itemsSelectorHelpBtn.TabIndex = 45;
+ this.itemsSelectorHelpBtn.UseVisualStyleBackColor = true;
+ this.itemsSelectorHelpBtn.Click += new System.EventHandler(this.itemsSelectorHelpBtn_Click);
+ //
// owPartnerTrainerCheckBox
//
this.owPartnerTrainerCheckBox.AutoSize = true;
@@ -5512,11 +5523,10 @@
// owItemComboBox
//
this.owItemComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this.owItemComboBox.Enabled = false;
this.owItemComboBox.FormattingEnabled = true;
- this.owItemComboBox.Location = new System.Drawing.Point(57, 72);
+ this.owItemComboBox.Location = new System.Drawing.Point(49, 72);
this.owItemComboBox.Name = "owItemComboBox";
- this.owItemComboBox.Size = new System.Drawing.Size(165, 21);
+ this.owItemComboBox.Size = new System.Drawing.Size(142, 21);
this.owItemComboBox.TabIndex = 6;
this.owItemComboBox.SelectedIndexChanged += new System.EventHandler(this.owItemComboBox_SelectedIndexChanged);
//
@@ -5535,9 +5545,9 @@
this.owTrainerComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.owTrainerComboBox.Enabled = false;
this.owTrainerComboBox.FormattingEnabled = true;
- this.owTrainerComboBox.Location = new System.Drawing.Point(57, 19);
+ this.owTrainerComboBox.Location = new System.Drawing.Point(49, 19);
this.owTrainerComboBox.Name = "owTrainerComboBox";
- this.owTrainerComboBox.Size = new System.Drawing.Size(165, 21);
+ this.owTrainerComboBox.Size = new System.Drawing.Size(173, 21);
this.owTrainerComboBox.TabIndex = 4;
this.owTrainerComboBox.SelectedIndexChanged += new System.EventHandler(this.owTrainerComboBox_SelectedIndexChanged);
//
@@ -6586,11 +6596,11 @@
//
// scriptTabPage
//
+ this.scriptTabPage.Controls.Add(this.scriptEditorWhitespacesCheckbox);
+ this.scriptTabPage.Controls.Add(this.scriptEditorWordWrapCheckbox);
this.scriptTabPage.Controls.Add(this.compressScriptTextButton);
this.scriptTabPage.Controls.Add(this.expandScriptTextButton);
this.scriptTabPage.Controls.Add(this.findScriptTextButton);
- this.scriptTabPage.Controls.Add(this.scriptEditorWhitespacesCheckbox);
- this.scriptTabPage.Controls.Add(this.scriptEditorWordWrapCheckbox);
this.scriptTabPage.Controls.Add(this.groupBox24);
this.scriptTabPage.Controls.Add(this.clearCurrentLevelScriptButton);
this.scriptTabPage.Controls.Add(this.groupBox8);
@@ -6650,7 +6660,7 @@
//
this.scriptEditorWhitespacesCheckbox.Appearance = System.Windows.Forms.Appearance.Button;
this.scriptEditorWhitespacesCheckbox.AutoSize = true;
- this.scriptEditorWhitespacesCheckbox.Location = new System.Drawing.Point(746, 11);
+ this.scriptEditorWhitespacesCheckbox.Location = new System.Drawing.Point(978, 10);
this.scriptEditorWhitespacesCheckbox.Name = "scriptEditorWhitespacesCheckbox";
this.scriptEditorWhitespacesCheckbox.Size = new System.Drawing.Size(79, 23);
this.scriptEditorWhitespacesCheckbox.TabIndex = 46;
@@ -6665,7 +6675,7 @@
this.scriptEditorWordWrapCheckbox.AutoSize = true;
this.scriptEditorWordWrapCheckbox.Checked = true;
this.scriptEditorWordWrapCheckbox.CheckState = System.Windows.Forms.CheckState.Checked;
- this.scriptEditorWordWrapCheckbox.Location = new System.Drawing.Point(672, 11);
+ this.scriptEditorWordWrapCheckbox.Location = new System.Drawing.Point(904, 10);
this.scriptEditorWordWrapCheckbox.Name = "scriptEditorWordWrapCheckbox";
this.scriptEditorWordWrapCheckbox.Size = new System.Drawing.Size(72, 23);
this.scriptEditorWordWrapCheckbox.TabIndex = 43;
@@ -6969,6 +6979,7 @@
//
this.scriptsTabPage.Controls.Add(this.PanelSearchScripts);
this.scriptsTabPage.Controls.Add(this.scintillaScriptsPanel);
+ this.scriptsTabPage.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.scriptsTabPage.Location = new System.Drawing.Point(4, 22);
this.scriptsTabPage.Name = "scriptsTabPage";
this.scriptsTabPage.Padding = new System.Windows.Forms.Padding(3);
@@ -7064,6 +7075,7 @@
//
this.functionTabPage.Controls.Add(this.PanelSearchFunctions);
this.functionTabPage.Controls.Add(this.scintillaFunctionsPanel);
+ this.functionTabPage.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.functionTabPage.Location = new System.Drawing.Point(4, 22);
this.functionTabPage.Name = "functionTabPage";
this.functionTabPage.Padding = new System.Windows.Forms.Padding(3);
@@ -7159,6 +7171,7 @@
//
this.movementTabPage.Controls.Add(this.PanelSearchActions);
this.movementTabPage.Controls.Add(this.scintillaActionsPanel);
+ this.movementTabPage.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.movementTabPage.Location = new System.Drawing.Point(4, 22);
this.movementTabPage.Name = "movementTabPage";
this.movementTabPage.Padding = new System.Windows.Forms.Padding(3);
@@ -9384,7 +9397,7 @@
// HOWpbEffectsTableButton
//
this.HOWpbEffectsTableButton.Image = ((System.Drawing.Image)(resources.GetObject("HOWpbEffectsTableButton.Image")));
- this.HOWpbEffectsTableButton.Location = new System.Drawing.Point(146, 396);
+ this.HOWpbEffectsTableButton.Location = new System.Drawing.Point(146, 399);
this.HOWpbEffectsTableButton.Name = "HOWpbEffectsTableButton";
this.HOWpbEffectsTableButton.Size = new System.Drawing.Size(28, 29);
this.HOWpbEffectsTableButton.TabIndex = 44;
@@ -9404,7 +9417,7 @@
//
this.saveEffectCombosTableBTN.Image = ((System.Drawing.Image)(resources.GetObject("saveEffectCombosTableBTN.Image")));
this.saveEffectCombosTableBTN.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
- this.saveEffectCombosTableBTN.Location = new System.Drawing.Point(175, 392);
+ this.saveEffectCombosTableBTN.Location = new System.Drawing.Point(175, 395);
this.saveEffectCombosTableBTN.Name = "saveEffectCombosTableBTN";
this.saveEffectCombosTableBTN.Size = new System.Drawing.Size(78, 37);
this.saveEffectCombosTableBTN.TabIndex = 43;
@@ -9434,7 +9447,7 @@
this.groupBox30.Controls.Add(this.label70);
this.groupBox30.Controls.Add(this.pbEffectsTrainerCombobox);
this.groupBox30.Controls.Add(this.pbEffectsVsTrainerListbox);
- this.groupBox30.Location = new System.Drawing.Point(257, 14);
+ this.groupBox30.Location = new System.Drawing.Point(259, 14);
this.groupBox30.Name = "groupBox30";
this.groupBox30.Size = new System.Drawing.Size(481, 250);
this.groupBox30.TabIndex = 34;
@@ -9546,7 +9559,7 @@
this.groupBox29.Controls.Add(this.label71);
this.groupBox29.Controls.Add(this.pbEffectsPokemonCombobox);
this.groupBox29.Controls.Add(this.pbEffectsVsPokemonListbox);
- this.groupBox29.Location = new System.Drawing.Point(257, 265);
+ this.groupBox29.Location = new System.Drawing.Point(259, 265);
this.groupBox29.Name = "groupBox29";
this.groupBox29.Size = new System.Drawing.Size(481, 174);
this.groupBox29.TabIndex = 33;
@@ -9704,7 +9717,7 @@
// HOWconditionalMusicTableButton
//
this.HOWconditionalMusicTableButton.Image = ((System.Drawing.Image)(resources.GetObject("HOWconditionalMusicTableButton.Image")));
- this.HOWconditionalMusicTableButton.Location = new System.Drawing.Point(353, 93);
+ this.HOWconditionalMusicTableButton.Location = new System.Drawing.Point(263, 146);
this.HOWconditionalMusicTableButton.Name = "HOWconditionalMusicTableButton";
this.HOWconditionalMusicTableButton.Size = new System.Drawing.Size(28, 29);
this.HOWconditionalMusicTableButton.TabIndex = 9;
@@ -9727,7 +9740,7 @@
// label65
//
this.label65.AutoSize = true;
- this.label65.Location = new System.Drawing.Point(264, 83);
+ this.label65.Location = new System.Drawing.Point(297, 83);
this.label65.Name = "label65";
this.label65.Size = new System.Drawing.Size(49, 13);
this.label65.TabIndex = 7;
@@ -9735,7 +9748,7 @@
//
// musicIDconditionalMusicUpDown
//
- this.musicIDconditionalMusicUpDown.Location = new System.Drawing.Point(267, 99);
+ this.musicIDconditionalMusicUpDown.Location = new System.Drawing.Point(300, 99);
this.musicIDconditionalMusicUpDown.Maximum = new decimal(new int[] {
32767,
0,
@@ -9759,7 +9772,7 @@
// label64
//
this.label64.AutoSize = true;
- this.label64.Location = new System.Drawing.Point(175, 83);
+ this.label64.Location = new System.Drawing.Point(188, 83);
this.label64.Name = "label64";
this.label64.Size = new System.Drawing.Size(27, 13);
this.label64.TabIndex = 5;
@@ -9767,7 +9780,7 @@
//
// flagConditionalMusicUpDown
//
- this.flagConditionalMusicUpDown.Location = new System.Drawing.Point(178, 99);
+ this.flagConditionalMusicUpDown.Location = new System.Drawing.Point(191, 99);
this.flagConditionalMusicUpDown.Maximum = new decimal(new int[] {
32767,
0,
@@ -11339,6 +11352,7 @@
private System.Windows.Forms.Button findScriptTextButton;
private System.Windows.Forms.Button compressScriptTextButton;
private System.Windows.Forms.Button expandScriptTextButton;
+ private System.Windows.Forms.Button itemsSelectorHelpBtn;
}
}
diff --git a/DS_Map/Main Window.cs b/DS_Map/Main Window.cs
index 2df664b..8d497ee 100644
--- a/DS_Map/Main Window.cs
+++ b/DS_Map/Main Window.cs
@@ -196,7 +196,6 @@ namespace DSPRE {
toolStripProgressBar.Value++;
}
-
public void SetupScriptEditor() {
/* Extract essential NARCs sub-archives*/
statusLabel.Text = "Setting up Script Editor...";
@@ -287,9 +286,8 @@ namespace DSPRE {
private void romToolBoxToolStripMenuItem_Click(object sender, EventArgs e) {
using (ROMToolboxDialog window = new ROMToolboxDialog()) {
window.ShowDialog();
- if (ROMToolboxDialog.flag_standardizedItems) {
- isItemRadioButton.Enabled = true;
- OWTypeChanged(null, null);
+ if (ROMToolboxDialog.flag_standardizedItems && eventEditorIsReady) {
+ UpdateItemComboBox(RomInfo.GetItemNames());
}
if (ROMToolboxDialog.flag_DynamicHeadersPatchApplied) {
addHeaderBTN.Enabled = true;
@@ -297,6 +295,17 @@ namespace DSPRE {
}
}
}
+ private void UpdateItemComboBox(string[] itemNames) {
+ if (itemComboboxIsUpToDate) {
+ return;
+ }
+ itemsSelectorHelpBtn.Visible = false;
+ owItemComboBox.Size = new Size(new Point(owItemComboBox.Size.Width + 30, owItemComboBox.Size.Height));
+ owItemComboBox.Items.Clear();
+ owItemComboBox.Items.AddRange(itemNames);
+ OWTypeChanged(null, null);
+ itemComboboxIsUpToDate = true;
+ }
private void scriptCommandsDatabaseToolStripButton_Click(object sender, EventArgs e) {
OpenCommandsDatabase(RomInfo.ScriptCommandNamesDict, RomInfo.ScriptCommandParametersDict);
}
@@ -704,7 +713,7 @@ namespace DSPRE {
SetupMapEditor();
SetupNSBTXEditor();
SetupTextEditor();
- SetupScriptEditorTabs();
+ SetupScriptEditorTextAreas();
SetupScriptEditor();
SetupTrainerEditor();
@@ -766,7 +775,7 @@ namespace DSPRE {
}
} else if (mainTabControl.SelectedTab == scriptTabPage) {
if (!scriptEditorIsReady) {
- SetupScriptEditorTabs();
+ SetupScriptEditorTextAreas();
SetupScriptEditor();
scriptEditorIsReady = true;
}
@@ -4147,6 +4156,7 @@ namespace DSPRE {
#region Event Editor
#region Variables
+ private bool itemComboboxIsUpToDate = false;
public static NSBMDGlRenderer eventMapRenderer = new NSBMDGlRenderer();
public static NSBMDGlRenderer eventBuildingsRenderer = new NSBMDGlRenderer();
public static MapFile eventMapFile;
@@ -4163,6 +4173,12 @@ namespace DSPRE {
#endregion
#region Subroutines
+ private void itemsSelectorHelpBtn_Click(object sender, EventArgs e) {
+ MessageBox.Show("This selector allows you to pick a preset Ground Item script from the game data.\n" +
+ "Unlike in previous DSPRE versions, you can now change the Ground Item to be obtained even if you decided not to apply the Standardize Items patch from the Rom ToolBox.\n\n" +
+ "However, some items are unavailable by default. The aforementioned patch can neutralize this limitation.\n\n" +
+ "(Please note that it will scramble every existing Ground Item!)", "About Ground Items", MessageBoxButtons.OK, MessageBoxIcon.Information);
+ }
private void CenterEventViewOnEntities() {
disableHandlers = true;
try {
@@ -4611,7 +4627,8 @@ namespace DSPRE {
DirNames.trainerProperties,
DirNames.OWSprites,
- DirNames.scripts, });
+ DirNames.scripts,
+ });
RomInfo.SetOWtable();
RomInfo.Set3DOverworldsDict();
@@ -4671,8 +4688,21 @@ namespace DSPRE {
owTrainerComboBox.Items.AddRange(trainerNames);
/* Add item list to ow item box */
- owItemComboBox.Items.Clear();
- owItemComboBox.Items.AddRange(RomInfo.GetItemNames(0, new TextArchive(RomInfo.itemNamesTextNumber).messages.Count - 1));
+
+
+ string[] itemNames = RomInfo.GetItemNames();
+ if (ROMToolboxDialog.CheckScriptsStandardizedItemNumbers()) {
+ UpdateItemComboBox(itemNames);
+ } else {
+ ScriptFile itemScript = new ScriptFile(RomInfo.itemScriptFileNumber);
+ owItemComboBox.Items.Clear();
+ foreach (CommandContainer cont in itemScript.allScripts) {
+ if (cont.commands.Count > 4) {
+ continue;
+ }
+ owItemComboBox.Items.Add(BitConverter.ToUInt16(cont.commands[1].cmdParams[1], 0) + "x " + itemNames[BitConverter.ToUInt16(cont.commands[0].cmdParams[1], 0)]);
+ }
+ }
/* Add ow movement list to box */
owMovementComboBox.Items.Clear();
@@ -4682,10 +4712,6 @@ namespace DSPRE {
spawnableDirComboBox.Items.AddRange(PokeDatabase.EventEditor.Spawnables.orientationsArray);
spawnableTypeComboBox.Items.AddRange(PokeDatabase.EventEditor.Spawnables.typesArray);
- if (ROMToolboxDialog.CheckScriptsStandardizedItemNumbers()) {
- isItemRadioButton.Enabled = true;
- }
-
disableHandlers = false;
/* Draw matrix 0 in matrix navigator */
@@ -5089,8 +5115,9 @@ namespace DSPRE {
overworldsListBox.SelectedIndex = currentEvFile.overworlds.Count - 1;
}
private void OWTypeChanged(object sender, EventArgs e) {
- if (overworldsListBox.SelectedIndex < 0)
+ if (overworldsListBox.SelectedIndex < 0) {
return;
+ }
if (normalRadioButton.Checked == true) {
owScriptNumericUpDown.Enabled = true;
@@ -5138,8 +5165,9 @@ namespace DSPRE {
return;
}
currentEvFile.overworlds[overworldsListBox.SelectedIndex].type = 0x1;
- if (owTrainerComboBox.SelectedIndex >= 0)
+ if (owTrainerComboBox.SelectedIndex >= 0) {
owTrainerComboBox_SelectedIndexChanged(null, null);
+ }
}
}
private void owItemComboBox_SelectedIndexChanged(object sender, EventArgs e) {
@@ -5639,11 +5667,15 @@ namespace DSPRE {
currentScintillaEditor = ActionTextArea;
}
}
- private void SetupScriptEditorTabs() {
+ private void SetupScriptEditorTextAreas() {
//PREPARE SCRIPT EDITOR KEYWORDS
- cmdKeyWords = String.Join(" ", ScriptCommandNamesDict.Values);
- cmdKeyWords += " " + String.Join(" ", PokeDatabase.ScriptEditor.movementsDictIDName.Values);
- comparisonOperatorsKeyWords = String.Join(" ", PokeDatabase.ScriptEditor.comparisonOperatorsDict.Values);
+ string scriptCmds = String.Join(" ", ScriptCommandNamesDict.Values);
+ cmdKeyWords = scriptCmds + " " + scriptCmds.ToLower() + " " + scriptCmds.ToUpper();
+
+ string actionCmds = String.Join(" ", ScriptDatabase.movementsDictIDName.Values);
+ cmdKeyWords += " " + actionCmds + " " + actionCmds.ToLower() + " " + actionCmds.ToUpper();
+
+ comparisonOperatorsKeyWords = String.Join(" ", RomInfo.ScriptComparisonOperatorsDict.Values);
// CREATE CONTROLS
ScriptTextArea = new ScintillaNET.Scintilla();
@@ -6129,7 +6161,7 @@ namespace DSPRE {
}
private void openScriptButton_Click(object sender, EventArgs e) {
if (!scriptEditorIsReady) {
- SetupScriptEditorTabs();
+ SetupScriptEditorTextAreas();
SetupScriptEditor();
scriptEditorIsReady = true;
}
@@ -6140,7 +6172,7 @@ namespace DSPRE {
}
private void openLevelScriptButton_Click(object sender, EventArgs e) {
if (!scriptEditorIsReady) {
- SetupScriptEditorTabs();
+ SetupScriptEditorTextAreas();
SetupScriptEditor();
scriptEditorIsReady = true;
}
@@ -6297,7 +6329,7 @@ namespace DSPRE {
/* If current script is identical to another, print UseScript instead of commands */
if (currentScript.useScript < 0) {
for (int j = 0; j < currentScript.commands.Count; j++) {
- if (!PokeDatabase.ScriptEditor.endCodes.Contains(currentScript.commands[j].id)) {
+ if (!ScriptDatabase.endCodes.Contains(currentScript.commands[j].id)) {
buffer += '\t';
}
buffer += currentScript.commands[j].name + Environment.NewLine;
@@ -6323,7 +6355,7 @@ namespace DSPRE {
/* If current function is identical to a script, print UseScript instead of commands */
if (currentFunction.useScript < 0) {
for (int j = 0; j < currentFunction.commands.Count; j++) {
- if (!PokeDatabase.ScriptEditor.endCodes.Contains(currentFunction.commands[j].id)) {
+ if (!ScriptDatabase.endCodes.Contains(currentFunction.commands[j].id)) {
buffer += '\t';
}
buffer += currentFunction.commands[j].name + Environment.NewLine;
diff --git a/DS_Map/Main Window.resx b/DS_Map/Main Window.resx
index df3fc16..ce31cba 100644
--- a/DS_Map/Main Window.resx
+++ b/DS_Map/Main Window.resx
@@ -1144,6 +1144,19 @@
V8k5bPmvmz2+/W8xtzXx6Aq5qNgajeLbnnPan7HV6ZcNOZex5UZhFmd27VVsddqTBk+c8ADxOo1/LOS0
L4MedHlNeHJorgaGuhsGWg9sLetUSVgbhLVaUNWhTAZZINC6npVcV8qkooKnUOkoZXIJNclU/fO0sz+Y
XDFYZS4mWQAAAABJRU5ErkJggg==
+
+
+
+
+ iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
+ wwAADsMBx2+oZAAAAYxJREFUOE/NkztLA0EUhe/ERQwoSPwDqQQLC8FKrG0F/4CdKNoFLKwEKysLQdDa
+ 0sJC8YFudiYIY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3SQbJo66US5CzYTijO3UqAdseN20hRRpAkhRJXPNZ8nugxSFiFm4FtrRftBLdDIEC7L9RLgmV5iEjw
+ 5poxSFgdRDzMAuyd88byiPX7+CciHMW8CVaAAO9+Ev0+FH1Uaf0vgFqKdiPgI57AXUjHp7FW9U2gjCzO
+ 6yfgvql7HgTjaIR1Lb0OIA0swl0UA/1MgCuBf092J/oYNMK6DAIMLLIwfs0QDugFACJBgp2GYAaNsC5D
+ cBrMAumgEdbFC0rFfwGDAP7g3gVdaG++SNr6YAaNsC5eUCqYQLjdjXIOiYRYl5NQWFKK9hdgmb8hMNjm
+ QpM4FHZgH94BCO6oPZ60EzQifX171b40M9Ks8kL16AXYDpC/oCl4rLMw/QnIq5VYwDs9rKQUYQLPrrvJ
+ DuhDx5ud6vuekz/pUhuv2dFAPJWAnrEmpzrddyaPTtv8+v62c5G9Hr3Ay0y3OdNamQl75kZb1A+3ypfp
+ rX+xbLbfycMqLiHfx2UAAAAASUVORK5CYII=
@@ -2345,7 +2358,7 @@
- 26
+ 34
diff --git a/DS_Map/ROMToolboxDialog.cs b/DS_Map/ROMToolboxDialog.cs
index 815aa7c..01a223d 100644
--- a/DS_Map/ROMToolboxDialog.cs
+++ b/DS_Map/ROMToolboxDialog.cs
@@ -130,7 +130,9 @@ namespace DSPRE {
DisableOverlay1patch("Unsupported");
DisableMatrixExpansionPatch("Unsupported");
DisableScrcmdRepointPatch("Unsupported");
- CheckBDHCamPatchApplied();
+ if (RomInfo.gameLanguage != gLangEnum.English && RomInfo.gameLanguage != gLangEnum.Spanish) {
+ CheckBDHCamPatchApplied();
+ }
CheckDynamicHeadersPatchApplied();
break;
case gFamEnum.HGSS:
@@ -139,9 +141,8 @@ namespace DSPRE {
overlay1CB.Visible = true;
}
- CheckBDHCamPatchApplied();
-
if (RomInfo.gameLanguage == gLangEnum.English || RomInfo.gameLanguage == gLangEnum.Spanish) {
+ CheckBDHCamPatchApplied();
CheckMatrixExpansionApplied();
CheckScrcmdRepointPatchApplied();
} else {
@@ -307,8 +308,9 @@ namespace DSPRE {
public string backupSuffix = ".backup";
private bool CheckARM9ExpansionApplied() {
if (!ROMToolboxDialog.flag_arm9Expanded) {
- if (!ROMToolboxDialog.CheckFilesArm9ExpansionApplied())
+ if (!ROMToolboxDialog.CheckFilesArm9ExpansionApplied()) {
return false;
+ }
}
ROMToolboxDialog.flag_arm9Expanded = true;
@@ -514,10 +516,11 @@ namespace DSPRE {
itemScript.allScripts.Clear();
for (ushort i = 0; i < itemCount; i++) {
- List cmdList = new List();
- cmdList.Add(new ScriptCommand("SetVar 0x8008 " + i));
- cmdList.Add(new ScriptCommand("SetVar 0x8009 0x1"));
- cmdList.Add(new ScriptCommand("Jump Function_#1"));
+ List cmdList = new List {
+ new ScriptCommand("SetVar 0x8008 " + i),
+ new ScriptCommand("SetVar 0x8009 0x1"),
+ new ScriptCommand("Jump Function_#1")
+ };
itemScript.allScripts.Add(new CommandContainer((ushort)(i + 1), ScriptFile.containerTypes.SCRIPT, commandList: cmdList));
}
@@ -742,9 +745,10 @@ namespace DSPRE {
the data will be packed into a NARC and replace a/0/5/0 in HGSS or
debug/cb_edit/d_test.narc in Platinum */
- for (int i = 0; i < RomInfo.GetHeaderCount(); i++) {
+ int headerCount = RomInfo.GetHeaderCount();
+ for (int i = 0; i < headerCount; i++) {
byte[] headerData = MapHeader.LoadFromARM9((ushort)i).ToByteArray();
- DSUtils.WriteToFile(headersDir + "\\" + i.ToString("D4"), headerData);
+ DSUtils.WriteToFile(headersDir.unpackedDir + "\\" + i.ToString("D4"), headerData);
}
DisableDynamicHeadersPatch("Already applied");
diff --git a/DS_Map/ROMToolboxDialog.resx b/DS_Map/ROMToolboxDialog.resx
index f52b8bd..5f97f12 100644
--- a/DS_Map/ROMToolboxDialog.resx
+++ b/DS_Map/ROMToolboxDialog.resx
@@ -165,11 +165,9 @@ This patch is necessary to accomplish most ASM edits.
- Makes all PokéBall item scripts follow the order of items as indexed in the ROM.
-Inevitably, every Item already on the ground will change.
-This patch is necessary in order to
-edit 'Items' in Event Editor.
-
+ Rearranges the GiveItem scripts to follow the default index order.
+Allows to configure any item as a Ground Item in the Event Editor.
+Inevitably, every Item that is already on the ground will change.