Misc update

- Added support for HGSS """hidden""" cameras and added new Cam16 picture
- Fixed handling of HGSS headers' last 32 bits (some things are still unimplemented)
--- Fixed HGSS area icon numbers
- Fixed Advanced Header Search to make it compatible with the dynamic headers patch
- Fixed Header load function calls (previously incompatible with dynamic headers patch)
- Fixed event editor not updating coordinates when dragging events across the map
- New warning popup before using Camera Editor, if overlay1 is compressed
- Minor refactor
This commit is contained in:
AdAstra-LD
2021-07-14 05:22:45 +02:00
parent 57548c6000
commit 591138541a
17 changed files with 1045 additions and 864 deletions

View File

@@ -95,6 +95,11 @@
<ItemGroup>
<Compile Include="AB.cs" />
<Compile Include="GameCamera.cs" />
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Resources\ROMToolboxDB\ToolboxDB.cs" />
<Compile Include="ROMFiles\AreaData.cs" />
<Compile Include="DSUtils.cs" />
@@ -105,11 +110,6 @@
<DependentUpon>CommandsDatabase.cs</DependentUpon>
</Compile>
<Compile Include="Resources\PokeDatabase.cs" />
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Resources\ROMToolboxDB\BDHCAMPatchDB.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
@@ -372,6 +372,39 @@
<None Include="Resources\Graphics\Program Icons\RightClick.png" />
<None Include="Resources\Graphics\Program Icons\unpackAllIcon.png" />
<None Include="Resources\Graphics\Program Icons\SurfIcon.png" />
<Content Include="Resources\Graphics\Area Icons\hgsslake.png" />
<Content Include="Resources\Graphics\Camera Angles\DPPt\dpcamera0.png" />
<Content Include="Resources\Graphics\Camera Angles\DPPt\dpcamera1.png" />
<Content Include="Resources\Graphics\Camera Angles\DPPt\dpcamera10.png" />
<Content Include="Resources\Graphics\Camera Angles\DPPt\dpcamera11.png" />
<Content Include="Resources\Graphics\Camera Angles\DPPt\dpcamera12.png" />
<Content Include="Resources\Graphics\Camera Angles\DPPt\dpcamera13.png" />
<Content Include="Resources\Graphics\Camera Angles\DPPt\dpcamera14.png" />
<Content Include="Resources\Graphics\Camera Angles\DPPt\dpcamera15.png" />
<Content Include="Resources\Graphics\Camera Angles\DPPt\dpcamera2.png" />
<Content Include="Resources\Graphics\Camera Angles\DPPt\dpcamera3.png" />
<Content Include="Resources\Graphics\Camera Angles\DPPt\dpcamera4.png" />
<Content Include="Resources\Graphics\Camera Angles\DPPt\dpcamera5.png" />
<Content Include="Resources\Graphics\Camera Angles\DPPt\dpcamera6.png" />
<Content Include="Resources\Graphics\Camera Angles\DPPt\dpcamera7.png" />
<Content Include="Resources\Graphics\Camera Angles\DPPt\dpcamera8.png" />
<Content Include="Resources\Graphics\Camera Angles\DPPt\dpcamera9.png" />
<Content Include="Resources\Graphics\Camera Angles\DPPt\ptcamera0.png" />
<Content Include="Resources\Graphics\Camera Angles\DPPt\ptcamera1.png" />
<Content Include="Resources\Graphics\Camera Angles\DPPt\ptcamera10.png" />
<Content Include="Resources\Graphics\Camera Angles\DPPt\ptcamera11.png" />
<Content Include="Resources\Graphics\Camera Angles\DPPt\ptcamera12.png" />
<Content Include="Resources\Graphics\Camera Angles\DPPt\ptcamera13.png" />
<Content Include="Resources\Graphics\Camera Angles\DPPt\ptcamera14.png" />
<Content Include="Resources\Graphics\Camera Angles\DPPt\ptcamera15.png" />
<Content Include="Resources\Graphics\Camera Angles\DPPt\ptcamera2.png" />
<Content Include="Resources\Graphics\Camera Angles\DPPt\ptcamera3.png" />
<Content Include="Resources\Graphics\Camera Angles\DPPt\ptcamera4.png" />
<Content Include="Resources\Graphics\Camera Angles\DPPt\ptcamera5.png" />
<Content Include="Resources\Graphics\Camera Angles\DPPt\ptcamera6.png" />
<Content Include="Resources\Graphics\Camera Angles\DPPt\ptcamera7.png" />
<Content Include="Resources\Graphics\Camera Angles\DPPt\ptcamera8.png" />
<Content Include="Resources\Graphics\Camera Angles\DPPt\ptcamera9.png" />
<Content Include="Resources\Graphics\Camera Angles\HGSS\hgsscamera00.png" />
<Content Include="Resources\Graphics\Camera Angles\HGSS\hgsscamera01.png" />
<Content Include="Resources\Graphics\Camera Angles\HGSS\hgsscamera02.png" />
@@ -401,6 +434,7 @@
<None Include="Resources\Graphics\Program Icons\unpackBuildingNarcsIcon.png" />
<None Include="Resources\Graphics\Program Icons\deleteIcon.png" />
<None Include="Resources\Graphics\Event Icons\overworldUnreadable.png" />
<Content Include="Resources\Graphics\Camera Angles\HGSS\hgsscamera16.png" />
<Content Include="Resources\Graphics\Program Icons\addIcon.png" />
<None Include="Resources\Graphics\Program Icons\copyIcon_small.png" />
<None Include="Resources\Graphics\Program Icons\checkmark.png" />
@@ -426,6 +460,7 @@
<Content Include="Resources\Graphics\Weather\DPPt\ptredish.png" />
<None Include="Resources\wrenchIcon.png" />
<None Include="Resources\selectBldWithMouse.png" />
<None Include="Resources\hgsscamera16.png" />
<Content Include="Tools\blz.exe">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>

View File

@@ -30,11 +30,13 @@
this.valueTextBox = new System.Windows.Forms.TextBox();
this.startSearchButton = new System.Windows.Forms.Button();
this.headerSearchResetButton = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.autoSearchCB = new System.Windows.Forms.CheckBox();
this.SuspendLayout();
//
// arm9expansionTextLBL
//
this.arm9expansionTextLBL.Location = new System.Drawing.Point(0, 0);
this.arm9expansionTextLBL.Location = new System.Drawing.Point(0, -10);
this.arm9expansionTextLBL.Name = "arm9expansionTextLBL";
this.arm9expansionTextLBL.Size = new System.Drawing.Size(100, 23);
this.arm9expansionTextLBL.TabIndex = 15;
@@ -44,7 +46,7 @@
this.fieldToSearch1ComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.fieldToSearch1ComboBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.fieldToSearch1ComboBox.FormattingEnabled = true;
this.fieldToSearch1ComboBox.Location = new System.Drawing.Point(11, 37);
this.fieldToSearch1ComboBox.Location = new System.Drawing.Point(11, 27);
this.fieldToSearch1ComboBox.Name = "fieldToSearch1ComboBox";
this.fieldToSearch1ComboBox.Size = new System.Drawing.Size(190, 24);
this.fieldToSearch1ComboBox.TabIndex = 6;
@@ -54,37 +56,38 @@
//
this.explanationLabel.AutoSize = true;
this.explanationLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.explanationLabel.Location = new System.Drawing.Point(6, 10);
this.explanationLabel.Location = new System.Drawing.Point(8, 9);
this.explanationLabel.Name = "explanationLabel";
this.explanationLabel.Size = new System.Drawing.Size(269, 15);
this.explanationLabel.Size = new System.Drawing.Size(111, 15);
this.explanationLabel.TabIndex = 7;
this.explanationLabel.Text = "Find all headers that meet this condition:";
this.explanationLabel.Text = "Header Property";
//
// operator1ComboBox
//
this.operator1ComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.operator1ComboBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.operator1ComboBox.FormattingEnabled = true;
this.operator1ComboBox.Location = new System.Drawing.Point(11, 72);
this.operator1ComboBox.Location = new System.Drawing.Point(11, 82);
this.operator1ComboBox.Name = "operator1ComboBox";
this.operator1ComboBox.Size = new System.Drawing.Size(190, 24);
this.operator1ComboBox.TabIndex = 8;
this.operator1ComboBox.SelectedIndexChanged += new System.EventHandler(this.operator1ComboBox_SelectedIndexChanged);
//
// valueTextBox
//
this.valueTextBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.valueTextBox.Location = new System.Drawing.Point(11, 108);
this.valueTextBox.Location = new System.Drawing.Point(11, 110);
this.valueTextBox.MaxLength = 16;
this.valueTextBox.Name = "valueTextBox";
this.valueTextBox.Size = new System.Drawing.Size(190, 22);
this.valueTextBox.TabIndex = 9;
this.valueTextBox.KeyDown += new System.Windows.Forms.KeyEventHandler(this.valueTextBox_KeyDown);
this.valueTextBox.KeyUp += new System.Windows.Forms.KeyEventHandler(this.valueTextBox_KeyUp);
//
// startSearchButton
//
this.startSearchButton.Image = global::DSPRE.Properties.Resources.wideLensImage;
this.startSearchButton.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.startSearchButton.Location = new System.Drawing.Point(209, 37);
this.startSearchButton.Location = new System.Drawing.Point(209, 11);
this.startSearchButton.Name = "startSearchButton";
this.startSearchButton.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.startSearchButton.Size = new System.Drawing.Size(86, 43);
@@ -98,7 +101,7 @@
//
this.headerSearchResetButton.Image = global::DSPRE.Properties.Resources.wideLensImageTransp;
this.headerSearchResetButton.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.headerSearchResetButton.Location = new System.Drawing.Point(209, 87);
this.headerSearchResetButton.Location = new System.Drawing.Point(209, 60);
this.headerSearchResetButton.Name = "headerSearchResetButton";
this.headerSearchResetButton.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.headerSearchResetButton.Size = new System.Drawing.Size(86, 43);
@@ -108,12 +111,36 @@
this.headerSearchResetButton.UseVisualStyleBackColor = true;
this.headerSearchResetButton.Click += new System.EventHandler(this.headerSearchResetButton_Click);
//
// label1
//
this.label1.AutoSize = true;
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label1.Location = new System.Drawing.Point(8, 64);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(54, 15);
this.label1.TabIndex = 18;
this.label1.Text = "Criteria";
//
// autoSearchCB
//
this.autoSearchCB.AutoSize = true;
this.autoSearchCB.Checked = true;
this.autoSearchCB.CheckState = System.Windows.Forms.CheckState.Checked;
this.autoSearchCB.Location = new System.Drawing.Point(212, 113);
this.autoSearchCB.Name = "autoSearchCB";
this.autoSearchCB.Size = new System.Drawing.Size(82, 17);
this.autoSearchCB.TabIndex = 19;
this.autoSearchCB.Text = "AutoSearch";
this.autoSearchCB.UseVisualStyleBackColor = true;
//
// HeaderSearch
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.ClientSize = new System.Drawing.Size(304, 145);
this.ClientSize = new System.Drawing.Size(304, 144);
this.Controls.Add(this.autoSearchCB);
this.Controls.Add(this.label1);
this.Controls.Add(this.headerSearchResetButton);
this.Controls.Add(this.startSearchButton);
this.Controls.Add(this.valueTextBox);
@@ -139,5 +166,7 @@
private System.Windows.Forms.TextBox valueTextBox;
private System.Windows.Forms.Button startSearchButton;
private System.Windows.Forms.Button headerSearchResetButton;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.CheckBox autoSearchCB;
}
}

View File

@@ -1,45 +1,66 @@
using DSPRE.ROMFiles;
using System;
using System.Collections.Generic;
using System;
using System.Windows.Forms;
using static DSPRE.RomInfo;
using System.Reflection;
namespace DSPRE {
public partial class HeaderSearch : Form {
private List<string> searchableHeaderFieldsList = new List<string>() {
"Area Data (ID)",
"Camera Angle (ID)",
"Event File (ID)",
"Internal Name",
"Level Script (ID)",
"Matrix (ID)",
"Music Day (ID)",
//Maybe in the future - "Music Day (Name)",
"Music Night (ID)",
//Maybe in the future - "Music Night (Name)",
"Script File (ID)",
"Text Archive (ID)",
"Weather (ID)",
public static readonly Dictionary<MapHeader.SearchableFields, string> searchableHeaderFieldsDict = new Dictionary<MapHeader.SearchableFields, string>() {
[MapHeader.SearchableFields.AreaDataID] = "Area Data (ID)",
[MapHeader.SearchableFields.CameraAngleID] = "Camera Angle (ID)",
[MapHeader.SearchableFields.EventFileID] = "Event File (ID)",
[MapHeader.SearchableFields.InternalName] = "Internal Name",
[MapHeader.SearchableFields.LevelScriptID] = "Level Script (ID)",
[MapHeader.SearchableFields.MatrixID] = "Matrix (ID)",
[MapHeader.SearchableFields.MusicDayID] = "Music Day (ID)",
//[MapHeader.SearchableFields.MusicDayName] = "Music Day (Name)",
[MapHeader.SearchableFields.MusicNightID] = "Music Night (ID)",
//[MapHeader.SearchableFields.MusicNightName] = "Music Night (Name)",
[MapHeader.SearchableFields.ScriptFileID] = "Script File (ID)",
[MapHeader.SearchableFields.TextArchiveID] = "Text Archive (ID)",
[MapHeader.SearchableFields.WeatherID] = "Weather (ID)"
};
public enum NumOperators : byte {
//Order matters!
Equal,
Different,
Less,
Greater,
LessOrEqual,
GreaterOrEqual
};
private List<string> headerSearchNumericOperatorsList = new List<string>() {
"Equals",
"Is Different than",
"Is Less than",
"Is Less than or Equal to",
"Is Greater than",
"Is Greater than or Equal to",
};
private List<string> headerSearchTextOperatorsList = new List<string>() {
"Is Exactly",
"Is Not",
"Contains",
"Does not contain"
public enum TextOperators : byte {
//Order matters!
Contains,
DoesNotContain,
IsExactly,
IsNot
};
private string[] searchableHeaderFields;
private string[] headerSearchNumericOperators;
private string[] headerSearchTextOperators;
private static readonly Dictionary<NumOperators, string> numOperatorsDict = new Dictionary<NumOperators, string>() {
//Order matters!
[NumOperators.Equal] = "Equals",
[NumOperators.Different] = "Is Different than",
[NumOperators.Less] = "Is Less than",
[NumOperators.Greater] = "Is Greater than",
[NumOperators.LessOrEqual] = "Is Less than or Equal to",
[NumOperators.GreaterOrEqual] = "Is Greater than or Equal to",
};
private static readonly Dictionary<TextOperators, string> textOperatorsDict = new Dictionary<TextOperators, string>() {
//Order matters!
[TextOperators.Contains] = "Contains",
[TextOperators.DoesNotContain] = "Does not contain",
[TextOperators.IsExactly] = "Is Exactly",
[TextOperators.IsNot] = "Is Not",
};
private List<string> intNames;
private ListBox headerListBox;
@@ -49,80 +70,105 @@ namespace DSPRE {
public HeaderSearch(ref List<string> internalNames, ListBox headerListBox, ToolStripStatusLabel statusLabel) {
InitializeComponent();
searchableHeaderFields = searchableHeaderFieldsList.ToArray();
headerSearchNumericOperators = headerSearchNumericOperatorsList.ToArray();
headerSearchTextOperators = headerSearchTextOperatorsList.ToArray();
intNames = internalNames;
this.headerListBox = headerListBox;
this.statusLabel = statusLabel;
fieldToSearch1ComboBox.Items.AddRange(searchableHeaderFields);
foreach (string elem in searchableHeaderFieldsDict.Values) {
fieldToSearch1ComboBox.Items.Add(elem);
}
fieldToSearch1ComboBox.SelectedIndex = 0;
operator1ComboBox.SelectedIndex = 0;
}
private void fieldToSearch1ComboBox_SelectedIndexChanged(object sender, EventArgs e) {
UpdateOperators(operator1ComboBox, fieldToSearch1ComboBox);
}
#region Helper Methods
private void UpdateOperators(ComboBox operatorComboBox, ComboBox fieldToSearchComboBox) {
operatorComboBox.Items.Clear();
if (fieldToSearchComboBox.SelectedItem.ToString().Contains("ID")) {
operatorComboBox.Items.AddRange(headerSearchNumericOperators);
foreach (string elem in numOperatorsDict.Values) {
operatorComboBox.Items.Add(elem);
}
valueTextBox.MaxLength = 5;
} else {
operatorComboBox.Items.AddRange(headerSearchTextOperators);
foreach (string elem in textOperatorsDict.Values) {
operatorComboBox.Items.Add(elem);
}
valueTextBox.MaxLength = 16;
}
operatorComboBox.SelectedIndex = 0;
}
#endregion
public static List<string> advancedSearch(ushort startID, ushort finalID, List<string> intNames, string fieldToSearch, string oper, string valToSearch) {
if (fieldToSearch == "" || oper == "" || valToSearch == "")
public static void ResetResults(ListBox headerListBox, List<string> intNames, bool prependNumbers) {
if (headerListBox.Items.Count < intNames.Count) {
headerListBox.Enabled = true;
headerListBox.Items.Clear();
if (prependNumbers) {
for (int i = 0; i < intNames.Count; i++) {
string name = intNames[i];
headerListBox.Items.Add(i.ToString("D3") + MapHeader.nameSeparator + name);
}
} else {
headerListBox.Items.AddRange(intNames.ToArray());
}
}
}
public static List<string> AdvancedSearch(ushort startID, ushort finalID, List<string> intNames, int fieldToSearch, int oper, string valToSearch) {
if (fieldToSearch < 0 || oper < 0 || valToSearch == "")
return null;
List<string> result = new List<string>();
switch (fieldToSearch) {
case "Internal Name":
case (int)MapHeader.SearchableFields.InternalName:
for (ushort i = startID; i < finalID; i++) {
if (oper.Equals("Is Exactly")) {
if (intNames[i].Equals(valToSearch)) {
result.Add(i.ToString("D3") + MapHeader.nameSeparator + intNames[i]);
}
} else if (oper.Equals("Is Not")) {
if (!intNames[i].Equals(valToSearch)) {
result.Add(i.ToString("D3") + MapHeader.nameSeparator + intNames[i]);
}
} else if (oper.Equals("Contains")) {
if (intNames[i].IndexOf(valToSearch, StringComparison.InvariantCultureIgnoreCase) >= 0) {
result.Add(i.ToString("D3") + MapHeader.nameSeparator + intNames[i]);
}
} else if (oper.Equals("Does not contain")) {
if (intNames[i].IndexOf(valToSearch, StringComparison.InvariantCultureIgnoreCase) < 0) {
result.Add(i.ToString("D3") + MapHeader.nameSeparator + intNames[i]);
}
switch (oper) {
case (int)TextOperators.IsExactly:
if (intNames[i].Equals(valToSearch)) {
result.Add(i.ToString("D3") + MapHeader.nameSeparator + intNames[i]);
}
break;
case (int)TextOperators.IsNot:
if (!intNames[i].Equals(valToSearch)) {
result.Add(i.ToString("D3") + MapHeader.nameSeparator + intNames[i]);
}
break;
case (int)TextOperators.Contains:
if (intNames[i].IndexOf(valToSearch, StringComparison.InvariantCultureIgnoreCase) >= 0) {
result.Add(i.ToString("D3") + MapHeader.nameSeparator + intNames[i]);
}
break;
case (int)TextOperators.DoesNotContain:
if (intNames[i].IndexOf(valToSearch, StringComparison.InvariantCultureIgnoreCase) < 0) {
result.Add(i.ToString("D3") + MapHeader.nameSeparator + intNames[i]);
}
break;
default:
Console.WriteLine("Unrecognized operand!!!");
break;
}
}
break;
case "Music Day (Name)":
//case (int)MapHeader.SearchableFields.MusicDayName:
//Maybe in the future
break;
case "Music Night (Name)":
//break;
//case (int)MapHeader.SearchableFields.MusicNightName:
//Maybe in the future
break;
//break;
default:
string[] fieldSplit = fieldToSearch.Split();
fieldSplit[0] = fieldSplit[0].ToLower();
fieldSplit[fieldSplit.Length - 1] = fieldSplit[fieldSplit.Length - 1].Replace("(", ""); //Remove ( from string
fieldSplit[fieldSplit.Length - 1] = fieldSplit[fieldSplit.Length - 1].Replace(")", ""); //Remove ) from string
string[] fieldSplit = searchableHeaderFieldsDict[(MapHeader.SearchableFields)fieldToSearch].Split();
fieldSplit[0] = fieldSplit[0].ToLower();
fieldSplit[fieldSplit.Length - 1] = fieldSplit[fieldSplit.Length - 1].Replace("(", "").Replace(")", ""); //Remove ( and ) from string
PropertyInfo property = typeof(MapHeader).GetProperty(String.Join("", fieldSplit));
ushort numToSearch;
string property = String.Join("", fieldSplit);
ushort numToSearch = 0;
try {
numToSearch = ushort.Parse(valToSearch);
} catch (OverflowException) {
@@ -131,54 +177,77 @@ namespace DSPRE {
}
for (ushort i = startID; i < finalID; i++) {
var headerFieldEntry = typeof(MapHeader).GetProperty(property).GetValue(MapHeader.LoadFromARM9(i), null);
int headerField = int.Parse(headerFieldEntry.ToString());
if (oper.Equals("Is Less than")) {
if (headerField < numToSearch) {
result.Add(i.ToString("D3") + MapHeader.nameSeparator + intNames[i]);
}
} else if (oper.Equals("Equals")) {
if (headerField == numToSearch) {
result.Add(i.ToString("D3") + MapHeader.nameSeparator + intNames[i]);
}
} else if (oper.StartsWith("Is Greater")) {
if (headerField > numToSearch) {
result.Add(i.ToString("D3") + MapHeader.nameSeparator + intNames[i]);
}
} else if (oper.StartsWith("Is Less than or Equal")) {
if (headerField <= numToSearch) {
result.Add(i.ToString("D3") + MapHeader.nameSeparator + intNames[i]);
}
} else if (oper.StartsWith("Is Greater than or Equal")) {
if (headerField >= numToSearch) {
result.Add(i.ToString("D3") + MapHeader.nameSeparator + intNames[i]);
}
} else if (oper.StartsWith("Is Different")) {
if (headerField != numToSearch) {
result.Add(i.ToString("D3") + MapHeader.nameSeparator + intNames[i]);
}
MapHeader h;
if (ROMToolboxDialog.flag_DynamicHeadersPatchApplied || ROMToolboxDialog.CheckFilesDynamicHeadersPatchApplied()) {
h = MapHeader.LoadFromFile(RomInfo.gameDirs[DirNames.dynamicHeaders].unpackedDir + "\\" + i.ToString("D4"), i, 0);
} else {
Console.WriteLine("Unrecognized operand!!!");
break;
h = MapHeader.LoadFromARM9(i);
}
int headerField = int.Parse(property.GetValue(h, null).ToString());
switch (oper) {
case (int)NumOperators.Less:
if (headerField < numToSearch) {
result.Add(i.ToString("D3") + MapHeader.nameSeparator + intNames[i]);
}
break;
case (int)NumOperators.Equal:
if (headerField == numToSearch) {
result.Add(i.ToString("D3") + MapHeader.nameSeparator + intNames[i]);
}
break;
case (int)NumOperators.Greater:
if (headerField > numToSearch) {
result.Add(i.ToString("D3") + MapHeader.nameSeparator + intNames[i]);
}
break;
case (int)NumOperators.LessOrEqual:
if (headerField <= numToSearch) {
result.Add(i.ToString("D3") + MapHeader.nameSeparator + intNames[i]);
}
break;
case (int)NumOperators.GreaterOrEqual:
if (headerField >= numToSearch) {
result.Add(i.ToString("D3") + MapHeader.nameSeparator + intNames[i]);
}
break;
case (int)NumOperators.Different:
if (headerField != numToSearch) {
result.Add(i.ToString("D3") + MapHeader.nameSeparator + intNames[i]);
}
break;
default:
Console.WriteLine("Unrecognized operand!!!");
break;
}
}
break;
}
return result;
}
private void startSearchButton_Click(object sender, EventArgs e) {
private void startSearchButton_Click(object sender, EventArgs e) {
StartSearch(showDialog: true);
}
private void StartSearch(bool showDialog = true) {
if (valueTextBox.Text == "") {
MessageBox.Show("Value to search is empty", "Can't search", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
//if (showDialog) {
// MessageBox.Show("Value to search is empty", "Can't search", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
//}
headerSearchResetButton_Click(null, null);
return;
}
List<string> result;
headerListBox.Items.Clear();
try {
result = advancedSearch(0, (ushort)intNames.Count, intNames, fieldToSearch1ComboBox.Text, operator1ComboBox.SelectedItem.ToString(), valueTextBox.Text);
try {
result = AdvancedSearch(0, (ushort)intNames.Count, intNames, fieldToSearch1ComboBox.SelectedIndex, operator1ComboBox.SelectedIndex, valueTextBox.Text);
} catch (FormatException) {
MessageBox.Show("Make sure the value to search is correct.", "Format Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
if (showDialog) {
MessageBox.Show("Make sure the value to search is correct.", "Format Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
valueTextBox.Clear();
headerListBox.Items.Add("Search parameters are invalid");
headerListBox.Enabled = false;
@@ -187,7 +256,7 @@ namespace DSPRE {
string searchConfiguration = fieldToSearch1ComboBox.Text + " " + operator1ComboBox.Text.ToLower() + " " + '"' + valueTextBox.Text + '"';
if (result is null || result.Count <= 0) {
string res = "No header suits the search criteria.";
string res = "No header's " + searchConfiguration;
headerListBox.Items.Add(res);
headerListBox.Enabled = false;
statusLabel.Text = res;
@@ -200,30 +269,28 @@ namespace DSPRE {
}
Update();
}
private void valueTextBox_KeyDown(object sender, KeyEventArgs e) {
if (e.KeyCode == Keys.Enter) {
startSearchButton_Click(null, null);
}
private void valueTextBox_KeyUp(object sender, KeyEventArgs e) {
if (autoSearchCB.Checked) {
StartSearch(showDialog: false);
} else if (e.KeyCode == Keys.Enter) {
StartSearch(showDialog: true);
}
}
private void headerSearchResetButton_Click(object sender, EventArgs e) {
ResetResults(headerListBox, intNames, prependNumbers: true);
valueTextBox.Clear();
statusLabel.Text = "Ready";
}
public static void ResetResults(ListBox headerListBox, List<string> intNames, bool prependNumbers) {
if (headerListBox.Items.Count < intNames.Count) {
headerListBox.Enabled = true;
headerListBox.Items.Clear();
if (prependNumbers) {
for (int i = 0; i < intNames.Count; i++) {
string name = intNames[i];
headerListBox.Items.Add(i.ToString("D3") + MapHeader.nameSeparator + name);
}
} else {
headerListBox.Items.AddRange(intNames.ToArray());
}
private void fieldToSearch1ComboBox_SelectedIndexChanged(object sender, EventArgs e) {
UpdateOperators(operator1ComboBox, fieldToSearch1ComboBox);
if (autoSearchCB.Checked) {
StartSearch(showDialog: false);
}
}
private void operator1ComboBox_SelectedIndexChanged(object sender, EventArgs e) {
if (autoSearchCB.Checked) {
StartSearch(showDialog: false);
}
}
}

View File

@@ -30,6 +30,8 @@
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainProgram));
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle16 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle17 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
@@ -45,8 +47,6 @@
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle13 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle14 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle15 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle16 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle17 = new System.Windows.Forms.DataGridViewCellStyle();
this.mainTabControl = new System.Windows.Forms.TabControl();
this.headerEditorTabPage = new System.Windows.Forms.TabPage();
this.removeLastHeaderBTN = new System.Windows.Forms.Button();
@@ -114,6 +114,7 @@
this.areaSettingsComboBox = new System.Windows.Forms.ComboBox();
this.locationNameComboBox = new System.Windows.Forms.ComboBox();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.cameraUpDown = new System.Windows.Forms.NumericUpDown();
this.weatherUpDown = new System.Windows.Forms.NumericUpDown();
this.musicNightUpDown = new System.Windows.Forms.NumericUpDown();
this.musicDayUpDown = new System.Windows.Forms.NumericUpDown();
@@ -180,11 +181,8 @@
this.matrixNameLabel = new System.Windows.Forms.Label();
this.matrixTabControl = new System.Windows.Forms.TabControl();
this.headersTabPage = new System.Windows.Forms.TabPage();
this.headersGridView = new DSPRE.DataGridViewDoubleBuffered();
this.heightsTabPage = new System.Windows.Forms.TabPage();
this.heightsGridView = new DSPRE.DataGridViewDoubleBuffered();
this.mapFilesTabPage = new System.Windows.Forms.TabPage();
this.mapFilesGridView = new DSPRE.DataGridViewDoubleBuffered();
this.matrixNameTextBox = new System.Windows.Forms.TextBox();
this.heightUpDown = new System.Windows.Forms.NumericUpDown();
this.widthUpDown = new System.Windows.Forms.NumericUpDown();
@@ -358,14 +356,14 @@
this.groupBox5 = new System.Windows.Forms.GroupBox();
this.goToSignButton = new System.Windows.Forms.Button();
this.signMatrixYLabel = new System.Windows.Forms.Label();
this.spawnableMatrixXUpDown = new System.Windows.Forms.NumericUpDown();
this.spawnableXMatrixUpDown = new System.Windows.Forms.NumericUpDown();
this.signMatrixXLabel = new System.Windows.Forms.Label();
this.spawnableMatrixYUpDown = new System.Windows.Forms.NumericUpDown();
this.spawnableYMatrixUpDown = new System.Windows.Forms.NumericUpDown();
this.signZLabel = new System.Windows.Forms.Label();
this.spawnableMapXUpDown = new System.Windows.Forms.NumericUpDown();
this.spawnablexMapUpDown = new System.Windows.Forms.NumericUpDown();
this.spawnableUpDown = new System.Windows.Forms.NumericUpDown();
this.signMapXLabel = new System.Windows.Forms.Label();
this.spawnableMapYUpDown = new System.Windows.Forms.NumericUpDown();
this.spawnableYMapUpDown = new System.Windows.Forms.NumericUpDown();
this.signMapYLabel = new System.Windows.Forms.Label();
this.removeSpawnableButton = new System.Windows.Forms.Button();
this.addSpawnableButton = new System.Windows.Forms.Button();
@@ -606,6 +604,9 @@
this.spawnEditorToolStripButton = new System.Windows.Forms.ToolStripButton();
this.versionLabel = new System.Windows.Forms.Label();
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
this.headersGridView = new DSPRE.DataGridViewDoubleBuffered();
this.heightsGridView = new DSPRE.DataGridViewDoubleBuffered();
this.mapFilesGridView = new DSPRE.DataGridViewDoubleBuffered();
this.mainTabControl.SuspendLayout();
this.headerEditorTabPage.SuspendLayout();
this.worldmapCoordsGroupBox.SuspendLayout();
@@ -623,6 +624,7 @@
((System.ComponentModel.ISupportInitialize)(this.areaIconPictureBox)).BeginInit();
this.nameGroupBox.SuspendLayout();
this.groupBox2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.cameraUpDown)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.weatherUpDown)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.musicNightUpDown)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.musicDayUpDown)).BeginInit();
@@ -636,11 +638,8 @@
this.matrixEditorTabPage.SuspendLayout();
this.matrixTabControl.SuspendLayout();
this.headersTabPage.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.headersGridView)).BeginInit();
this.heightsTabPage.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.heightsGridView)).BeginInit();
this.mapFilesTabPage.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.mapFilesGridView)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.heightUpDown)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.widthUpDown)).BeginInit();
this.mapEditorTabPage.SuspendLayout();
@@ -694,11 +693,11 @@
this.eventsTabControl.SuspendLayout();
this.signsTabPage.SuspendLayout();
this.groupBox5.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.spawnableMatrixXUpDown)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.spawnableMatrixYUpDown)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.spawnableMapXUpDown)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.spawnableXMatrixUpDown)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.spawnableYMatrixUpDown)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.spawnablexMapUpDown)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.spawnableUpDown)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.spawnableMapYUpDown)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.spawnableYMapUpDown)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.spawnableScriptUpDown)).BeginInit();
this.overworldsTabPage.SuspendLayout();
this.groupBox22.SuspendLayout();
@@ -769,6 +768,9 @@
this.menuStrip1.SuspendLayout();
this.statusStrip1.SuspendLayout();
this.mainToolStrip.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.headersGridView)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.heightsGridView)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.mapFilesGridView)).BeginInit();
this.SuspendLayout();
//
// mainTabControl
@@ -1551,6 +1553,7 @@
// groupBox2
//
this.groupBox2.BackColor = System.Drawing.SystemColors.Window;
this.groupBox2.Controls.Add(this.cameraUpDown);
this.groupBox2.Controls.Add(this.weatherUpDown);
this.groupBox2.Controls.Add(this.musicNightUpDown);
this.groupBox2.Controls.Add(this.musicDayUpDown);
@@ -1577,6 +1580,19 @@
this.groupBox2.TabStop = false;
this.groupBox2.Text = "Appearance && Sound";
//
// cameraUpDown
//
this.cameraUpDown.Location = new System.Drawing.Point(376, 108);
this.cameraUpDown.Maximum = new decimal(new int[] {
255,
0,
0,
0});
this.cameraUpDown.Name = "cameraUpDown";
this.cameraUpDown.Size = new System.Drawing.Size(45, 20);
this.cameraUpDown.TabIndex = 41;
this.cameraUpDown.ValueChanged += new System.EventHandler(this.cameraUpDown_ValueChanged);
//
// weatherUpDown
//
this.weatherUpDown.Location = new System.Drawing.Point(14, 108);
@@ -1755,9 +1771,9 @@
//
this.cameraComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cameraComboBox.FormattingEnabled = true;
this.cameraComboBox.Location = new System.Drawing.Point(376, 106);
this.cameraComboBox.Location = new System.Drawing.Point(427, 107);
this.cameraComboBox.Name = "cameraComboBox";
this.cameraComboBox.Size = new System.Drawing.Size(196, 21);
this.cameraComboBox.Size = new System.Drawing.Size(145, 21);
this.cameraComboBox.TabIndex = 9;
this.cameraComboBox.SelectedIndexChanged += new System.EventHandler(this.cameraComboBox_SelectedIndexChanged);
//
@@ -2346,64 +2362,6 @@
this.headersTabPage.Text = "Map Headers";
this.headersTabPage.UseVisualStyleBackColor = true;
//
// headersGridView
//
this.headersGridView.AllowUserToAddRows = false;
this.headersGridView.AllowUserToDeleteRows = false;
this.headersGridView.AllowUserToResizeColumns = false;
this.headersGridView.AllowUserToResizeRows = false;
dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
this.headersGridView.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1;
this.headersGridView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.headersGridView.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.None;
dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle2.Font = new System.Drawing.Font("Microsoft Sans Serif", 7F);
dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.headersGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2;
this.headersGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle3.BackColor = System.Drawing.SystemColors.Window;
dataGridViewCellStyle3.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
dataGridViewCellStyle3.ForeColor = System.Drawing.SystemColors.ControlText;
dataGridViewCellStyle3.Format = "D4";
dataGridViewCellStyle3.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle3.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
this.headersGridView.DefaultCellStyle = dataGridViewCellStyle3;
this.headersGridView.Location = new System.Drawing.Point(0, 0);
this.headersGridView.MultiSelect = false;
this.headersGridView.Name = "headersGridView";
dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle4.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle4.Font = new System.Drawing.Font("Microsoft Sans Serif", 7F);
dataGridViewCellStyle4.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle4.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle4.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.headersGridView.RowHeadersDefaultCellStyle = dataGridViewCellStyle4;
this.headersGridView.RowHeadersWidth = 50;
this.headersGridView.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.DisableResizing;
dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle5.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.headersGridView.RowsDefaultCellStyle = dataGridViewCellStyle5;
this.headersGridView.RowTemplate.DefaultCellStyle.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
this.headersGridView.RowTemplate.Height = 18;
this.headersGridView.RowTemplate.Resizable = System.Windows.Forms.DataGridViewTriState.False;
this.headersGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.CellSelect;
this.headersGridView.ShowCellErrors = false;
this.headersGridView.Size = new System.Drawing.Size(1032, 597);
this.headersGridView.TabIndex = 1;
this.headersGridView.CellFormatting += new System.Windows.Forms.DataGridViewCellFormattingEventHandler(this.headersGridView_CellFormatting);
this.headersGridView.CellMouseDoubleClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.headersGridView_CellMouseDoubleClick);
this.headersGridView.CellValueChanged += new System.Windows.Forms.DataGridViewCellEventHandler(this.headersGridView_CellValueChanged);
this.headersGridView.SelectionChanged += new System.EventHandler(this.headersGridView_SelectionChanged);
//
// heightsTabPage
//
this.heightsTabPage.Controls.Add(this.heightsGridView);
@@ -2414,62 +2372,6 @@
this.heightsTabPage.Text = "Map Heights";
this.heightsTabPage.UseVisualStyleBackColor = true;
//
// heightsGridView
//
this.heightsGridView.AllowUserToAddRows = false;
this.heightsGridView.AllowUserToDeleteRows = false;
this.heightsGridView.AllowUserToResizeColumns = false;
this.heightsGridView.AllowUserToResizeRows = false;
dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
this.heightsGridView.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle6;
this.heightsGridView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.heightsGridView.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.None;
dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle7.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle7.Font = new System.Drawing.Font("Microsoft Sans Serif", 7F);
dataGridViewCellStyle7.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle7.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle7.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle7.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.heightsGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle7;
this.heightsGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle8.BackColor = System.Drawing.SystemColors.Window;
dataGridViewCellStyle8.Font = new System.Drawing.Font("Tahoma", 8.25F);
dataGridViewCellStyle8.ForeColor = System.Drawing.SystemColors.ControlText;
dataGridViewCellStyle8.Format = "D2";
dataGridViewCellStyle8.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle8.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle8.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
this.heightsGridView.DefaultCellStyle = dataGridViewCellStyle8;
this.heightsGridView.Location = new System.Drawing.Point(0, 0);
this.heightsGridView.MultiSelect = false;
this.heightsGridView.Name = "heightsGridView";
dataGridViewCellStyle9.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle9.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle9.Font = new System.Drawing.Font("Microsoft Sans Serif", 7F);
dataGridViewCellStyle9.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle9.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle9.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle9.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.heightsGridView.RowHeadersDefaultCellStyle = dataGridViewCellStyle9;
this.heightsGridView.RowHeadersWidth = 50;
this.heightsGridView.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.DisableResizing;
dataGridViewCellStyle10.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle10.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.heightsGridView.RowsDefaultCellStyle = dataGridViewCellStyle10;
this.heightsGridView.RowTemplate.DefaultCellStyle.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
this.heightsGridView.RowTemplate.Height = 18;
this.heightsGridView.RowTemplate.Resizable = System.Windows.Forms.DataGridViewTriState.False;
this.heightsGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.CellSelect;
this.heightsGridView.Size = new System.Drawing.Size(1032, 576);
this.heightsGridView.TabIndex = 2;
this.heightsGridView.CellFormatting += new System.Windows.Forms.DataGridViewCellFormattingEventHandler(this.heightsGridView_CellFormatting);
this.heightsGridView.CellValueChanged += new System.Windows.Forms.DataGridViewCellEventHandler(this.heightsGridView_CellValueChanged);
this.heightsGridView.SelectionChanged += new System.EventHandler(this.heightsGridView_SelectionChanged);
//
// mapFilesTabPage
//
this.mapFilesTabPage.Controls.Add(this.mapFilesGridView);
@@ -2480,63 +2382,6 @@
this.mapFilesTabPage.Text = "Map Files";
this.mapFilesTabPage.UseVisualStyleBackColor = true;
//
// mapFilesGridView
//
this.mapFilesGridView.AllowUserToAddRows = false;
this.mapFilesGridView.AllowUserToDeleteRows = false;
this.mapFilesGridView.AllowUserToResizeColumns = false;
this.mapFilesGridView.AllowUserToResizeRows = false;
dataGridViewCellStyle11.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
this.mapFilesGridView.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle11;
this.mapFilesGridView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.mapFilesGridView.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.None;
dataGridViewCellStyle12.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle12.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle12.Font = new System.Drawing.Font("Microsoft Sans Serif", 7F);
dataGridViewCellStyle12.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle12.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle12.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle12.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.mapFilesGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle12;
this.mapFilesGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
dataGridViewCellStyle13.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle13.BackColor = System.Drawing.SystemColors.Window;
dataGridViewCellStyle13.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
dataGridViewCellStyle13.ForeColor = System.Drawing.SystemColors.ControlText;
dataGridViewCellStyle13.Format = "D4";
dataGridViewCellStyle13.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle13.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle13.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
this.mapFilesGridView.DefaultCellStyle = dataGridViewCellStyle13;
this.mapFilesGridView.Location = new System.Drawing.Point(0, 0);
this.mapFilesGridView.MultiSelect = false;
this.mapFilesGridView.Name = "mapFilesGridView";
dataGridViewCellStyle14.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle14.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle14.Font = new System.Drawing.Font("Microsoft Sans Serif", 7F);
dataGridViewCellStyle14.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle14.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle14.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle14.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.mapFilesGridView.RowHeadersDefaultCellStyle = dataGridViewCellStyle14;
this.mapFilesGridView.RowHeadersWidth = 50;
this.mapFilesGridView.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.DisableResizing;
dataGridViewCellStyle15.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle15.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.mapFilesGridView.RowsDefaultCellStyle = dataGridViewCellStyle15;
this.mapFilesGridView.RowTemplate.DefaultCellStyle.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
this.mapFilesGridView.RowTemplate.Height = 18;
this.mapFilesGridView.RowTemplate.Resizable = System.Windows.Forms.DataGridViewTriState.False;
this.mapFilesGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.CellSelect;
this.mapFilesGridView.Size = new System.Drawing.Size(1032, 576);
this.mapFilesGridView.TabIndex = 2;
this.mapFilesGridView.CellContentDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.mapFilesGridView_CellMouseDoubleClick);
this.mapFilesGridView.CellFormatting += new System.Windows.Forms.DataGridViewCellFormattingEventHandler(this.mapFilesGridView_CellFormatting);
this.mapFilesGridView.CellValueChanged += new System.Windows.Forms.DataGridViewCellEventHandler(this.mapFilesGridView_CellValueChanged);
this.mapFilesGridView.SelectionChanged += new System.EventHandler(this.mapFilesGridView_SelectionChanged);
//
// matrixNameTextBox
//
this.matrixNameTextBox.Location = new System.Drawing.Point(13, 73);
@@ -4365,6 +4210,7 @@
this.eventAreaDataUpDown.Name = "eventAreaDataUpDown";
this.eventAreaDataUpDown.Size = new System.Drawing.Size(40, 20);
this.eventAreaDataUpDown.TabIndex = 30;
this.eventAreaDataUpDown.ValueChanged += new System.EventHandler(this.eventAreaDataUpDown_ValueChanged);
//
// eventMapTextureLabel
//
@@ -4719,14 +4565,14 @@
//
this.groupBox5.Controls.Add(this.goToSignButton);
this.groupBox5.Controls.Add(this.signMatrixYLabel);
this.groupBox5.Controls.Add(this.spawnableMatrixXUpDown);
this.groupBox5.Controls.Add(this.spawnableXMatrixUpDown);
this.groupBox5.Controls.Add(this.signMatrixXLabel);
this.groupBox5.Controls.Add(this.spawnableMatrixYUpDown);
this.groupBox5.Controls.Add(this.spawnableYMatrixUpDown);
this.groupBox5.Controls.Add(this.signZLabel);
this.groupBox5.Controls.Add(this.spawnableMapXUpDown);
this.groupBox5.Controls.Add(this.spawnablexMapUpDown);
this.groupBox5.Controls.Add(this.spawnableUpDown);
this.groupBox5.Controls.Add(this.signMapXLabel);
this.groupBox5.Controls.Add(this.spawnableMapYUpDown);
this.groupBox5.Controls.Add(this.spawnableYMapUpDown);
this.groupBox5.Controls.Add(this.signMapYLabel);
this.groupBox5.Location = new System.Drawing.Point(223, 150);
this.groupBox5.Name = "groupBox5";
@@ -4759,16 +4605,16 @@
//
// spawnableMatrixXUpDown
//
this.spawnableMatrixXUpDown.Location = new System.Drawing.Point(74, 74);
this.spawnableMatrixXUpDown.Maximum = new decimal(new int[] {
this.spawnableXMatrixUpDown.Location = new System.Drawing.Point(74, 74);
this.spawnableXMatrixUpDown.Maximum = new decimal(new int[] {
65535,
0,
0,
0});
this.spawnableMatrixXUpDown.Name = "spawnableMatrixXUpDown";
this.spawnableMatrixXUpDown.Size = new System.Drawing.Size(101, 20);
this.spawnableMatrixXUpDown.TabIndex = 16;
this.spawnableMatrixXUpDown.ValueChanged += new System.EventHandler(this.spawnableMatrixXUpDown_ValueChanged);
this.spawnableXMatrixUpDown.Name = "spawnableMatrixXUpDown";
this.spawnableXMatrixUpDown.Size = new System.Drawing.Size(101, 20);
this.spawnableXMatrixUpDown.TabIndex = 16;
this.spawnableXMatrixUpDown.ValueChanged += new System.EventHandler(this.spawnableMatrixXUpDown_ValueChanged);
//
// signMatrixXLabel
//
@@ -4781,16 +4627,16 @@
//
// spawnableMatrixYUpDown
//
this.spawnableMatrixYUpDown.Location = new System.Drawing.Point(74, 104);
this.spawnableMatrixYUpDown.Maximum = new decimal(new int[] {
this.spawnableYMatrixUpDown.Location = new System.Drawing.Point(74, 104);
this.spawnableYMatrixUpDown.Maximum = new decimal(new int[] {
65535,
0,
0,
0});
this.spawnableMatrixYUpDown.Name = "spawnableMatrixYUpDown";
this.spawnableMatrixYUpDown.Size = new System.Drawing.Size(101, 20);
this.spawnableMatrixYUpDown.TabIndex = 18;
this.spawnableMatrixYUpDown.ValueChanged += new System.EventHandler(this.spawnableMatrixYUpDown_ValueChanged);
this.spawnableYMatrixUpDown.Name = "spawnableMatrixYUpDown";
this.spawnableYMatrixUpDown.Size = new System.Drawing.Size(101, 20);
this.spawnableYMatrixUpDown.TabIndex = 18;
this.spawnableYMatrixUpDown.ValueChanged += new System.EventHandler(this.spawnableMatrixYUpDown_ValueChanged);
//
// signZLabel
//
@@ -4803,21 +4649,21 @@
//
// spawnableMapXUpDown
//
this.spawnableMapXUpDown.Location = new System.Drawing.Point(28, 38);
this.spawnableMapXUpDown.Maximum = new decimal(new int[] {
this.spawnablexMapUpDown.Location = new System.Drawing.Point(28, 38);
this.spawnablexMapUpDown.Maximum = new decimal(new int[] {
32768,
0,
0,
0});
this.spawnableMapXUpDown.Minimum = new decimal(new int[] {
this.spawnablexMapUpDown.Minimum = new decimal(new int[] {
32768,
0,
0,
-2147483648});
this.spawnableMapXUpDown.Name = "spawnableMapXUpDown";
this.spawnableMapXUpDown.Size = new System.Drawing.Size(36, 20);
this.spawnableMapXUpDown.TabIndex = 10;
this.spawnableMapXUpDown.ValueChanged += new System.EventHandler(this.spawnableMapXUpDown_ValueChanged);
this.spawnablexMapUpDown.Name = "spawnableMapXUpDown";
this.spawnablexMapUpDown.Size = new System.Drawing.Size(36, 20);
this.spawnablexMapUpDown.TabIndex = 10;
this.spawnablexMapUpDown.ValueChanged += new System.EventHandler(this.spawnableMapXUpDown_ValueChanged);
//
// spawnableUpDown
//
@@ -4848,16 +4694,16 @@
//
// spawnableMapYUpDown
//
this.spawnableMapYUpDown.Location = new System.Drawing.Point(83, 38);
this.spawnableMapYUpDown.Maximum = new decimal(new int[] {
this.spawnableYMapUpDown.Location = new System.Drawing.Point(83, 38);
this.spawnableYMapUpDown.Maximum = new decimal(new int[] {
65535,
0,
0,
0});
this.spawnableMapYUpDown.Name = "spawnableMapYUpDown";
this.spawnableMapYUpDown.Size = new System.Drawing.Size(36, 20);
this.spawnableMapYUpDown.TabIndex = 12;
this.spawnableMapYUpDown.ValueChanged += new System.EventHandler(this.spawnableMapYUpDown_ValueChanged);
this.spawnableYMapUpDown.Name = "spawnableMapYUpDown";
this.spawnableYMapUpDown.Size = new System.Drawing.Size(36, 20);
this.spawnableYMapUpDown.TabIndex = 12;
this.spawnableYMapUpDown.ValueChanged += new System.EventHandler(this.spawnableMapYUpDown_ValueChanged);
//
// signMapYLabel
//
@@ -7669,6 +7515,177 @@
this.versionLabel.TabIndex = 9;
this.versionLabel.Text = "ROM:";
//
// headersGridView
//
this.headersGridView.AllowUserToAddRows = false;
this.headersGridView.AllowUserToDeleteRows = false;
this.headersGridView.AllowUserToResizeColumns = false;
this.headersGridView.AllowUserToResizeRows = false;
dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
this.headersGridView.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1;
this.headersGridView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.headersGridView.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.None;
dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle2.Font = new System.Drawing.Font("Microsoft Sans Serif", 7F);
dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.headersGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2;
this.headersGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle3.BackColor = System.Drawing.SystemColors.Window;
dataGridViewCellStyle3.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
dataGridViewCellStyle3.ForeColor = System.Drawing.SystemColors.ControlText;
dataGridViewCellStyle3.Format = "D4";
dataGridViewCellStyle3.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle3.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
this.headersGridView.DefaultCellStyle = dataGridViewCellStyle3;
this.headersGridView.Location = new System.Drawing.Point(0, 0);
this.headersGridView.MultiSelect = false;
this.headersGridView.Name = "headersGridView";
dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle4.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle4.Font = new System.Drawing.Font("Microsoft Sans Serif", 7F);
dataGridViewCellStyle4.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle4.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle4.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.headersGridView.RowHeadersDefaultCellStyle = dataGridViewCellStyle4;
this.headersGridView.RowHeadersWidth = 50;
this.headersGridView.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.DisableResizing;
dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle5.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.headersGridView.RowsDefaultCellStyle = dataGridViewCellStyle5;
this.headersGridView.RowTemplate.DefaultCellStyle.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
this.headersGridView.RowTemplate.Height = 18;
this.headersGridView.RowTemplate.Resizable = System.Windows.Forms.DataGridViewTriState.False;
this.headersGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.CellSelect;
this.headersGridView.ShowCellErrors = false;
this.headersGridView.Size = new System.Drawing.Size(1032, 597);
this.headersGridView.TabIndex = 1;
this.headersGridView.CellFormatting += new System.Windows.Forms.DataGridViewCellFormattingEventHandler(this.headersGridView_CellFormatting);
this.headersGridView.CellMouseDoubleClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.headersGridView_CellMouseDoubleClick);
this.headersGridView.CellValueChanged += new System.Windows.Forms.DataGridViewCellEventHandler(this.headersGridView_CellValueChanged);
this.headersGridView.SelectionChanged += new System.EventHandler(this.headersGridView_SelectionChanged);
//
// heightsGridView
//
this.heightsGridView.AllowUserToAddRows = false;
this.heightsGridView.AllowUserToDeleteRows = false;
this.heightsGridView.AllowUserToResizeColumns = false;
this.heightsGridView.AllowUserToResizeRows = false;
dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
this.heightsGridView.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle6;
this.heightsGridView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.heightsGridView.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.None;
dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle7.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle7.Font = new System.Drawing.Font("Microsoft Sans Serif", 7F);
dataGridViewCellStyle7.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle7.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle7.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle7.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.heightsGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle7;
this.heightsGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle8.BackColor = System.Drawing.SystemColors.Window;
dataGridViewCellStyle8.Font = new System.Drawing.Font("Tahoma", 8.25F);
dataGridViewCellStyle8.ForeColor = System.Drawing.SystemColors.ControlText;
dataGridViewCellStyle8.Format = "D2";
dataGridViewCellStyle8.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle8.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle8.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
this.heightsGridView.DefaultCellStyle = dataGridViewCellStyle8;
this.heightsGridView.Location = new System.Drawing.Point(0, 0);
this.heightsGridView.MultiSelect = false;
this.heightsGridView.Name = "heightsGridView";
dataGridViewCellStyle9.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle9.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle9.Font = new System.Drawing.Font("Microsoft Sans Serif", 7F);
dataGridViewCellStyle9.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle9.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle9.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle9.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.heightsGridView.RowHeadersDefaultCellStyle = dataGridViewCellStyle9;
this.heightsGridView.RowHeadersWidth = 50;
this.heightsGridView.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.DisableResizing;
dataGridViewCellStyle10.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle10.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.heightsGridView.RowsDefaultCellStyle = dataGridViewCellStyle10;
this.heightsGridView.RowTemplate.DefaultCellStyle.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
this.heightsGridView.RowTemplate.Height = 18;
this.heightsGridView.RowTemplate.Resizable = System.Windows.Forms.DataGridViewTriState.False;
this.heightsGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.CellSelect;
this.heightsGridView.Size = new System.Drawing.Size(1032, 576);
this.heightsGridView.TabIndex = 2;
this.heightsGridView.CellFormatting += new System.Windows.Forms.DataGridViewCellFormattingEventHandler(this.heightsGridView_CellFormatting);
this.heightsGridView.CellValueChanged += new System.Windows.Forms.DataGridViewCellEventHandler(this.heightsGridView_CellValueChanged);
this.heightsGridView.SelectionChanged += new System.EventHandler(this.heightsGridView_SelectionChanged);
//
// mapFilesGridView
//
this.mapFilesGridView.AllowUserToAddRows = false;
this.mapFilesGridView.AllowUserToDeleteRows = false;
this.mapFilesGridView.AllowUserToResizeColumns = false;
this.mapFilesGridView.AllowUserToResizeRows = false;
dataGridViewCellStyle11.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
this.mapFilesGridView.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle11;
this.mapFilesGridView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.mapFilesGridView.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.None;
dataGridViewCellStyle12.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle12.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle12.Font = new System.Drawing.Font("Microsoft Sans Serif", 7F);
dataGridViewCellStyle12.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle12.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle12.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle12.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.mapFilesGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle12;
this.mapFilesGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
dataGridViewCellStyle13.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle13.BackColor = System.Drawing.SystemColors.Window;
dataGridViewCellStyle13.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
dataGridViewCellStyle13.ForeColor = System.Drawing.SystemColors.ControlText;
dataGridViewCellStyle13.Format = "D4";
dataGridViewCellStyle13.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle13.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle13.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
this.mapFilesGridView.DefaultCellStyle = dataGridViewCellStyle13;
this.mapFilesGridView.Location = new System.Drawing.Point(0, 0);
this.mapFilesGridView.MultiSelect = false;
this.mapFilesGridView.Name = "mapFilesGridView";
dataGridViewCellStyle14.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle14.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle14.Font = new System.Drawing.Font("Microsoft Sans Serif", 7F);
dataGridViewCellStyle14.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle14.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle14.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle14.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.mapFilesGridView.RowHeadersDefaultCellStyle = dataGridViewCellStyle14;
this.mapFilesGridView.RowHeadersWidth = 50;
this.mapFilesGridView.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.DisableResizing;
dataGridViewCellStyle15.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle15.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.mapFilesGridView.RowsDefaultCellStyle = dataGridViewCellStyle15;
this.mapFilesGridView.RowTemplate.DefaultCellStyle.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
this.mapFilesGridView.RowTemplate.Height = 18;
this.mapFilesGridView.RowTemplate.Resizable = System.Windows.Forms.DataGridViewTriState.False;
this.mapFilesGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.CellSelect;
this.mapFilesGridView.Size = new System.Drawing.Size(1032, 576);
this.mapFilesGridView.TabIndex = 2;
this.mapFilesGridView.CellContentDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.mapFilesGridView_CellMouseDoubleClick);
this.mapFilesGridView.CellFormatting += new System.Windows.Forms.DataGridViewCellFormattingEventHandler(this.mapFilesGridView_CellFormatting);
this.mapFilesGridView.CellValueChanged += new System.Windows.Forms.DataGridViewCellEventHandler(this.mapFilesGridView_CellValueChanged);
this.mapFilesGridView.SelectionChanged += new System.EventHandler(this.mapFilesGridView_SelectionChanged);
//
// MainProgram
//
this.AllowDrop = true;
@@ -7714,6 +7731,7 @@
this.nameGroupBox.PerformLayout();
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.cameraUpDown)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.weatherUpDown)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.musicNightUpDown)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.musicDayUpDown)).EndInit();
@@ -7730,11 +7748,8 @@
this.matrixEditorTabPage.PerformLayout();
this.matrixTabControl.ResumeLayout(false);
this.headersTabPage.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.headersGridView)).EndInit();
this.heightsTabPage.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.heightsGridView)).EndInit();
this.mapFilesTabPage.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.mapFilesGridView)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.heightUpDown)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.widthUpDown)).EndInit();
this.mapEditorTabPage.ResumeLayout(false);
@@ -7805,11 +7820,11 @@
this.signsTabPage.PerformLayout();
this.groupBox5.ResumeLayout(false);
this.groupBox5.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.spawnableMatrixXUpDown)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.spawnableMatrixYUpDown)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.spawnableMapXUpDown)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.spawnableXMatrixUpDown)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.spawnableYMatrixUpDown)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.spawnablexMapUpDown)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.spawnableUpDown)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.spawnableMapYUpDown)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.spawnableYMapUpDown)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.spawnableScriptUpDown)).EndInit();
this.overworldsTabPage.ResumeLayout(false);
this.overworldsTabPage.PerformLayout();
@@ -7903,6 +7918,9 @@
this.statusStrip1.PerformLayout();
this.mainToolStrip.ResumeLayout(false);
this.mainToolStrip.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.headersGridView)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.heightsGridView)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.mapFilesGridView)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
@@ -8055,14 +8073,14 @@
private System.Windows.Forms.GroupBox groupBox5;
private System.Windows.Forms.Button goToSignButton;
private System.Windows.Forms.Label signMatrixYLabel;
private System.Windows.Forms.NumericUpDown spawnableMatrixXUpDown;
private System.Windows.Forms.NumericUpDown spawnableXMatrixUpDown;
private System.Windows.Forms.Label signMatrixXLabel;
private System.Windows.Forms.NumericUpDown spawnableMatrixYUpDown;
private System.Windows.Forms.NumericUpDown spawnableYMatrixUpDown;
private System.Windows.Forms.Label signZLabel;
private System.Windows.Forms.NumericUpDown spawnableMapXUpDown;
private System.Windows.Forms.NumericUpDown spawnablexMapUpDown;
private System.Windows.Forms.NumericUpDown spawnableUpDown;
private System.Windows.Forms.Label signMapXLabel;
private System.Windows.Forms.NumericUpDown spawnableMapYUpDown;
private System.Windows.Forms.NumericUpDown spawnableYMapUpDown;
private System.Windows.Forms.Label signMapYLabel;
private System.Windows.Forms.Button removeTriggerButton;
private System.Windows.Forms.Button addTriggerButton;
@@ -8468,6 +8486,7 @@
private System.Windows.Forms.CheckBox SyncNavigatorCB;
private System.Windows.Forms.Button removeLastHeaderBTN;
private System.Windows.Forms.Button addHeaderBTN;
private System.Windows.Forms.NumericUpDown cameraUpDown;
}
}

View File

@@ -840,7 +840,7 @@ namespace DSPRE {
areaIconComboBox.Enabled = false;
areaIconPictureBox.Image = (Image)Properties.Resources.ResourceManager.GetObject("dpareaicon");
areaSettingsLabel.Text = "Show nametag:";
cameraComboBox.Items.AddRange(PokeDatabase.CameraAngles.DPPtCameraValues);
cameraComboBox.Items.AddRange(PokeDatabase.CameraAngles.DPPtCameraDict.Values.ToArray());
musicDayComboBox.Items.AddRange(PokeDatabase.MusicDB.DPMusicDict.Values.ToArray());
musicNightComboBox.Items.AddRange(PokeDatabase.MusicDB.DPMusicDict.Values.ToArray());
areaSettingsComboBox.Items.AddRange(PokeDatabase.ShowName.DPShowNameValues);
@@ -850,7 +850,7 @@ namespace DSPRE {
case "Plat":
areaIconComboBox.Items.AddRange(PokeDatabase.Area.PtAreaIconValues);
areaSettingsLabel.Text = "Show nametag:";
cameraComboBox.Items.AddRange(PokeDatabase.CameraAngles.DPPtCameraValues);
cameraComboBox.Items.AddRange(PokeDatabase.CameraAngles.DPPtCameraDict.Values.ToArray());
musicDayComboBox.Items.AddRange(PokeDatabase.MusicDB.PtMusicDict.Values.ToArray());
musicNightComboBox.Items.AddRange(PokeDatabase.MusicDB.PtMusicDict.Values.ToArray());
areaSettingsComboBox.Items.AddRange(PokeDatabase.ShowName.PtShowNameValues);
@@ -858,8 +858,8 @@ namespace DSPRE {
wildPokeUpDown.Maximum = 65535;
break;
default:
areaIconComboBox.Items.AddRange(PokeDatabase.Area.HGSSAreaIconValues);
cameraComboBox.Items.AddRange(PokeDatabase.CameraAngles.HGSSCameraValues);
areaIconComboBox.Items.AddRange(PokeDatabase.Area.HGSSAreaIconsDict.Values.ToArray());
cameraComboBox.Items.AddRange(PokeDatabase.CameraAngles.HGSSCameraDict.Values.ToArray());
areaSettingsComboBox.Items.AddRange(PokeDatabase.Area.HGSSAreaProperties);
areaSettingsLabel.Text = "Area Settings:";
musicDayComboBox.Items.AddRange(PokeDatabase.MusicDB.HGSSMusicDict.Values.ToArray());
@@ -956,37 +956,12 @@ namespace DSPRE {
areaIconPictureBox.Image = (Image)Properties.Resources.ResourceManager.GetObject(imageName);
break;
default:
((HeaderHGSS)currentHeader).areaIcon = Byte.Parse(areaIconComboBox.SelectedItem.ToString().Substring(1, 3));
((HeaderHGSS)currentHeader).areaIcon = (byte)areaIconComboBox.SelectedIndex;
imageName = PokeDatabase.System.AreaPics.hgssAreaPicDict[areaIconComboBox.SelectedIndex];
areaIconPictureBox.Image = (Image)Properties.Resources.ResourceManager.GetObject(imageName);
break;
}
}
private void cameraComboBox_SelectedIndexChanged(object sender, EventArgs e) {
if (disableHandlers)
return;
string imageName;
try {
switch (RomInfo.gameFamily) {
case "DP":
currentHeader.cameraAngleID = (byte)cameraComboBox.SelectedIndex;
imageName = "dpcamera" + cameraComboBox.SelectedIndex.ToString();
break;
case "Plat":
currentHeader.cameraAngleID = (byte)cameraComboBox.SelectedIndex;
imageName = "ptcamera" + cameraComboBox.SelectedIndex.ToString();
break;
default:
currentHeader.cameraAngleID = Byte.Parse(cameraComboBox.SelectedItem.ToString().Substring(1, 2));
imageName = "hgsscamera" + currentHeader.cameraAngleID.ToString("D2");
break;
}
cameraPictureBox.Image = (Image)Properties.Resources.ResourceManager.GetObject(imageName);
} catch (NullReferenceException) {
MessageBox.Show("The current header uses an unrecognized camera.\n", "Unknown camera settings", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void eventFileUpDown_ValueChanged(object sender, EventArgs e) {
if (disableHandlers)
return;
@@ -1037,10 +1012,10 @@ namespace DSPRE {
} else {
currentHeader = MapHeader.LoadFromARM9(headerNumber);
}
refreshHeaderEditorFields();
RefreshHeaderEditorFields();
}
private void refreshHeaderEditorFields() {
private void RefreshHeaderEditorFields() {
/* Setup controls for common fields across headers */
internalNameBox.Text = internalNames[currentHeader.ID];
matrixUpDown.Value = currentHeader.matrixID;
@@ -1051,16 +1026,13 @@ namespace DSPRE {
textFileUpDown.Value = currentHeader.textArchiveID;
wildPokeUpDown.Value = currentHeader.wildPokémon;
weatherUpDown.Value = currentHeader.weatherID;
cameraUpDown.Value = currentHeader.cameraAngleID;
cameraComboBox.SelectedIndex = cameraComboBox.FindString("[" + currentHeader.cameraAngleID.ToString("D2"));
if (RomInfo.gameFamily == "HGSS") {
areaSettingsComboBox.SelectedIndex = ((HeaderHGSS)currentHeader).locationType;
}
if (RomInfo.gameFamily == "HGSS")
areaSettingsComboBox.SelectedIndex = cameraComboBox.FindString("[" + ((HeaderHGSS)currentHeader).areaSettings.ToString("D2"));
if (currentHeader.wildPokémon == RomInfo.nullEncounterID)
openWildEditorWithIdButton.Enabled = false;
else
openWildEditorWithIdButton.Enabled = true;
openWildEditorWithIdButton.Enabled = currentHeader.wildPokémon != RomInfo.nullEncounterID;
/* Setup controls for fields with version-specific differences */
try {
@@ -1081,21 +1053,24 @@ namespace DSPRE {
battleBackgroundUpDown.Value = currentHeader.battleBackground;
break;
default:
areaIconComboBox.SelectedIndex = areaIconComboBox.FindString("[" + $"{((HeaderHGSS)currentHeader).areaIcon:D3}");
areaIconComboBox.SelectedIndex = ((HeaderHGSS)currentHeader).areaIcon;
locationNameComboBox.SelectedIndex = ((HeaderHGSS)currentHeader).locationName;
musicDayUpDown.Value = ((HeaderHGSS)currentHeader).musicDayID;
musicNightUpDown.Value = ((HeaderHGSS)currentHeader).musicNightID;
worldmapXCoordUpDown.Value = ((HeaderHGSS)currentHeader).worldmapX;
worldmapYCoordUpDown.Value = ((HeaderHGSS)currentHeader).worldmapY;
break;
}
} catch (ArgumentOutOfRangeException) {
MessageBox.Show("This header contains an irregular/unsupported field.", "Error loading header file", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
refreshFlags();
RefreshFlags();
updateWeatherPicAndComboBox();
updateCameraPicAndComboBox();
}
private void refreshFlags() {
private void RefreshFlags() {
BitArray ba = new BitArray(new byte[] { currentHeader.flags });
flag0CheckBox.Checked = ba[0];
@@ -1235,11 +1210,6 @@ namespace DSPRE {
}
disableHandlers = false;
}
private void weatherUpDown_ValueChanged(object sender, EventArgs e) {
currentHeader.weatherID = (byte)weatherUpDown.Value;
updateWeatherPicAndComboBox();
}
private void worldmapXCoordUpDown_ValueChanged(object sender, EventArgs e) {
((HeaderHGSS)currentHeader).worldmapX = (byte)worldmapXCoordUpDown.Value;
}
@@ -1298,6 +1268,51 @@ namespace DSPRE {
weatherPictureBox.Image = null;
}
}
private void updateCameraPicAndComboBox() {
if (disableHandlers)
return;
/* Update Camera Combobox*/
disableHandlers = true;
try {
switch (RomInfo.gameFamily) {
case "DP":
cameraComboBox.SelectedItem = PokeDatabase.CameraAngles.DPPtCameraDict[currentHeader.cameraAngleID];
break;
case "Plat":
cameraComboBox.SelectedItem = PokeDatabase.CameraAngles.DPPtCameraDict[currentHeader.cameraAngleID];
break;
default:
cameraComboBox.SelectedItem = PokeDatabase.CameraAngles.HGSSCameraDict[currentHeader.cameraAngleID];
break;
}
} catch (KeyNotFoundException) {
cameraComboBox.SelectedItem = null;
}
disableHandlers = false;
/* Update Camera Picture */
string imageName;
try {
switch (RomInfo.gameFamily) {
case "DP":
currentHeader.cameraAngleID = (byte)cameraComboBox.SelectedIndex;
imageName = "dpcamera" + cameraUpDown.Value.ToString();
break;
case "Plat":
currentHeader.cameraAngleID = (byte)cameraComboBox.SelectedIndex;
imageName = "ptcamera" + cameraUpDown.Value.ToString();
break;
default:
currentHeader.cameraAngleID = (byte)cameraComboBox.SelectedIndex;
imageName = "hgsscamera" + cameraUpDown.Value.ToString();
break;
}
cameraPictureBox.Image = (Image)Properties.Resources.ResourceManager.GetObject(imageName);
} catch (NullReferenceException) {
MessageBox.Show("The current header uses an unrecognized camera.\n", "Unknown camera settings", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void weatherComboBox_SelectedIndexChanged(object sender, EventArgs e) {
if (disableHandlers || weatherComboBox.SelectedIndex < 0)
@@ -1315,7 +1330,31 @@ namespace DSPRE {
break;
}
currentHeader.weatherID = (byte)weatherUpDown.Value;
}
private void weatherUpDown_ValueChanged(object sender, EventArgs e) {
currentHeader.weatherID = (byte)weatherUpDown.Value;
updateWeatherPicAndComboBox();
}
private void cameraComboBox_SelectedIndexChanged(object sender, EventArgs e) {
if (disableHandlers || cameraComboBox.SelectedIndex < 0)
return;
switch (RomInfo.gameFamily) {
case "DP":
cameraUpDown.Value = PokeDatabase.CameraAngles.DPPtCameraDict.Keys.ElementAt(cameraComboBox.SelectedIndex);
break;
case "Plat":
cameraUpDown.Value = PokeDatabase.CameraAngles.DPPtCameraDict.Keys.ElementAt(cameraComboBox.SelectedIndex);
break;
default:
cameraUpDown.Value = PokeDatabase.CameraAngles.HGSSCameraDict.Keys.ElementAt(cameraComboBox.SelectedIndex);
break;
}
currentHeader.cameraAngleID = (byte)cameraUpDown.Value;
}
private void cameraUpDown_ValueChanged(object sender, EventArgs e) {
currentHeader.cameraAngleID = (byte)cameraUpDown.Value;
updateCameraPicAndComboBox();
}
private void openAreaDataButton_Click(object sender, EventArgs e) {
if (!nsbtxEditorIsReady) {
@@ -1338,8 +1377,9 @@ namespace DSPRE {
eventEditorIsReady = true;
}
if (matrixUpDown.Value != 0)
if (matrixUpDown.Value != 0) {
eventAreaDataUpDown.Value = areaDataUpDown.Value; // Use Area Data for textures if matrix is not 0
}
eventMatrixUpDown.Value = matrixUpDown.Value; // Open the right matrix in event editor
selectEventComboBox.SelectedIndex = (int)eventFileUpDown.Value; // Select event file
@@ -1473,18 +1513,11 @@ namespace DSPRE {
currentHeader.locationSpecifier = Byte.Parse(areaSettingsComboBox.SelectedItem.ToString().Substring(1, 3));
break;
case "HGSS":
HeaderHGSS ch = ((HeaderHGSS)currentHeader);
ch.areaSettings = (byte)areaSettingsComboBox.SelectedIndex;
if (ch.areaSettings == 4) {
areaImageLabel.Text = "[Location Tag hidden]";
areaIconComboBox.Enabled = false;
areaIconPictureBox.Visible = false;
} else {
areaImageLabel.Text = "Area icon";
areaIconComboBox.Enabled = true;
areaIconPictureBox.Visible = true;
}
HeaderHGSS ch = (HeaderHGSS)currentHeader;
ch.locationType = (byte)areaSettingsComboBox.SelectedIndex;
//areaImageLabel.Text = "Area icon";
//areaIconComboBox.Enabled = true;
//areaIconPictureBox.Visible = true;
break;
}
}
@@ -1549,7 +1582,7 @@ namespace DSPRE {
updateHeaderNameShown(headerListBox.SelectedIndex);
} catch (EndOfStreamException) { }
refreshHeaderEditorFields();
RefreshHeaderEditorFields();
}
private void exportHeaderToFileButton_Click(object sender, EventArgs e) {
@@ -1763,7 +1796,7 @@ namespace DSPRE {
worldmapXCoordUpDown.Value = worldmapXCoordCopy;
worldmapYCoordUpDown.Value = worldmapYCoordCopy;
battleBackgroundUpDown.Value = battleBGCopy;
refreshFlags();
RefreshFlags();
}
private void pasteInternalNameButton_Click(object sender, EventArgs e) {
internalNameBox.Text = internalNameCopy;
@@ -1818,7 +1851,7 @@ namespace DSPRE {
private void pasteMapSettingsButton_Click(object sender, EventArgs e) {
currentHeader.flags = flagsCopy;
battleBackgroundUpDown.Value = battleBGCopy;
refreshFlags();
RefreshFlags();
}
#endregion
@@ -2299,7 +2332,7 @@ namespace DSPRE {
Environment.NewLine + "Do you want to check if any Header is using it and choose that one as your Spawn Point? " +
Environment.NewLine + "\nChoosing 'No' will pick the last selected Header.", "Couldn't find Header Tab", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (d == DialogResult.Yes) {
result = HeaderSearch.advancedSearch(0, (ushort)internalNames.Count, internalNames, "Matrix (ID)", "Equals", selectMatrixComboBox.SelectedIndex.ToString());
result = HeaderSearch.AdvancedSearch(0, (ushort)internalNames.Count, internalNames, (int)MapHeader.SearchableFields.MatrixID, (int)HeaderSearch.NumOperators.Equal, selectMatrixComboBox.SelectedIndex.ToString());
if (result.Count < 1) {
MessageBox.Show("The current Matrix isn't assigned to any Header.\nThe default choice has been set to the last selected Header.", "No result", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
headerNumber = currentHeader.ID;
@@ -4059,7 +4092,7 @@ namespace DSPRE {
g.DrawRectangle(eventPen, (ow.xMapPosition) * 17 - 8, (ow.yMapPosition - 1) * 17, 34, 34);
g.DrawRectangle(eventPen, (ow.xMapPosition) * 17 - 9, (ow.yMapPosition - 1) * 17 - 1, 36, 36);
}
private void DisplayEventMap() {
private void DisplayEventMap(bool readGraphicsFromHeader = true) {
/* Determine map file to open and open it in BinaryReader, unless map is VOID */
uint mapIndex = GameMatrix.EMPTY;
if (eventMatrixXUpDown.Value > eventMatrix.width || eventMatrixYUpDown.Value > eventMatrix.height) {
@@ -4076,7 +4109,7 @@ namespace DSPRE {
} else {
/* Determine area data */
byte areaDataID;
if (eventMatrix.hasHeadersSection) {
if (eventMatrix.hasHeadersSection && readGraphicsFromHeader) {
ushort headerID = (ushort)eventMatrix.headers[(short)eventMatrixYUpDown.Value, (short)eventMatrixXUpDown.Value];
MapHeader h;
if (ROMToolboxDialog.flag_DynamicHeadersPatchApplied || ROMToolboxDialog.CheckFilesDynamicHeadersPatchApplied()) {
@@ -4571,6 +4604,9 @@ namespace DSPRE {
private void showEventsCheckBoxes_CheckedChanged(object sender, EventArgs e) {
DisplayActiveEvents();
}
private void eventAreaDataUpDown_ValueChanged(object sender, EventArgs e) {
DisplayEventMap(readGraphicsFromHeader: false);
}
private void eventPictureBox_Click(object sender, EventArgs e) {
int squareSize = 17;
Point coordinates = eventPictureBox.PointToClient(Cursor.Position);
@@ -4579,12 +4615,32 @@ namespace DSPRE {
if (mea.Button == MouseButtons.Left) {
if (selectedEvent != null) {
selectedEvent.xMapPosition = (short)mouseTilePos.X;
selectedEvent.yMapPosition = (short)mouseTilePos.Y;
selectedEvent.xMatrixPosition = (ushort)eventMatrixXUpDown.Value;
selectedEvent.yMatrixPosition = (ushort)eventMatrixYUpDown.Value;
switch (selectedEvent.evType) {
case Event.EventType.SPAWNABLE:
spawnablexMapUpDown.Value = (short)mouseTilePos.X;
spawnableYMapUpDown.Value = (short)mouseTilePos.Y;
spawnableXMatrixUpDown.Value = (short)eventMatrixXUpDown.Value;
spawnableYMatrixUpDown.Value = (short)eventMatrixYUpDown.Value;
break;
case Event.EventType.OVERWORLD:
owXMapUpDown.Value = (short)mouseTilePos.X;
owYMapUpDown.Value = (short)mouseTilePos.Y;
owXMatrixUpDown.Value = (short)eventMatrixXUpDown.Value;
owYMatrixUpDown.Value = (short)eventMatrixYUpDown.Value;
break;
case Event.EventType.WARP:
warpXMapUpDown.Value = (short)mouseTilePos.X;
warpYMapUpDown.Value = (short)mouseTilePos.Y;
warpXMatrixUpDown.Value = (short)eventMatrixXUpDown.Value;
warpYMatrixUpDown.Value = (short)eventMatrixYUpDown.Value;
break;
case Event.EventType.TRIGGER:
triggerXMapUpDown.Value = (short)mouseTilePos.X;
triggerYMapUpDown.Value = (short)mouseTilePos.Y;
triggerXMatrixUpDown.Value = (short)eventMatrixXUpDown.Value;
triggerYMatrixUpDown.Value = (short)eventMatrixYUpDown.Value;
break;
}
DisplayActiveEvents();
}
} else if (mea.Button == MouseButtons.Right) {
@@ -4647,7 +4703,7 @@ namespace DSPRE {
}
}
}
#region Spawnables Editor
#region Spawnables Tab
private void addSpawnableButton_Click(object sender, EventArgs e) {
currentEvFile.spawnables.Add(new Spawnable((int)eventMatrixXUpDown.Value, (int)eventMatrixYUpDown.Value));
spawnablesListBox.Items.Add("Spawnable " + (currentEvFile.spawnables.Count - 1).ToString());
@@ -4697,11 +4753,11 @@ namespace DSPRE {
spawnableTypeComboBox.SelectedIndex = currentEvFile.spawnables[spawnablesListBox.SelectedIndex].type;
spawnableScriptUpDown.Value = currentEvFile.spawnables[spawnablesListBox.SelectedIndex].scriptNumber;
spawnableMapXUpDown.Value = currentEvFile.spawnables[spawnablesListBox.SelectedIndex].xMapPosition;
spawnableMapYUpDown.Value = currentEvFile.spawnables[spawnablesListBox.SelectedIndex].yMapPosition;
spawnablexMapUpDown.Value = currentEvFile.spawnables[spawnablesListBox.SelectedIndex].xMapPosition;
spawnableYMapUpDown.Value = currentEvFile.spawnables[spawnablesListBox.SelectedIndex].yMapPosition;
spawnableUpDown.Value = currentEvFile.spawnables[spawnablesListBox.SelectedIndex].zPosition;
spawnableMatrixXUpDown.Value = currentEvFile.spawnables[spawnablesListBox.SelectedIndex].xMatrixPosition;
spawnableMatrixYUpDown.Value = currentEvFile.spawnables[spawnablesListBox.SelectedIndex].yMatrixPosition;
spawnableXMatrixUpDown.Value = currentEvFile.spawnables[spawnablesListBox.SelectedIndex].xMatrixPosition;
spawnableYMatrixUpDown.Value = currentEvFile.spawnables[spawnablesListBox.SelectedIndex].yMatrixPosition;
DisplayActiveEvents();
disableHandlers = false;
@@ -4710,14 +4766,14 @@ namespace DSPRE {
if (disableHandlers || spawnablesListBox.SelectedIndex < 0)
return;
currentEvFile.spawnables[spawnablesListBox.SelectedIndex].xMatrixPosition = (ushort)spawnableMatrixXUpDown.Value;
currentEvFile.spawnables[spawnablesListBox.SelectedIndex].xMatrixPosition = (ushort)spawnableXMatrixUpDown.Value;
DisplayActiveEvents();
}
private void spawnableMatrixYUpDown_ValueChanged(object sender, EventArgs e) {
if (disableHandlers || spawnablesListBox.SelectedIndex < 0)
return;
currentEvFile.spawnables[spawnablesListBox.SelectedIndex].yMatrixPosition = (ushort)spawnableMatrixYUpDown.Value;
currentEvFile.spawnables[spawnablesListBox.SelectedIndex].yMatrixPosition = (ushort)spawnableYMatrixUpDown.Value;
DisplayActiveEvents();
}
private void spawnableScriptUpDown_ValueChanged(object sender, EventArgs e) {
@@ -4729,18 +4785,18 @@ namespace DSPRE {
if (disableHandlers || spawnablesListBox.SelectedIndex < 0)
return;
currentEvFile.spawnables[spawnablesListBox.SelectedIndex].xMapPosition = (short)spawnableMapXUpDown.Value;
currentEvFile.spawnables[spawnablesListBox.SelectedIndex].xMapPosition = (short)spawnablexMapUpDown.Value;
DisplayActiveEvents();
}
private void spawnableMapYUpDown_ValueChanged(object sender, EventArgs e) {
if (disableHandlers)
if (disableHandlers || spawnablesListBox.SelectedIndex < 0)
return;
currentEvFile.spawnables[spawnablesListBox.SelectedIndex].yMapPosition = (short)spawnableMapYUpDown.Value;
currentEvFile.spawnables[spawnablesListBox.SelectedIndex].yMapPosition = (short)spawnableYMapUpDown.Value;
DisplayActiveEvents();
}
private void spawnableZUpDown_ValueChanged(object sender, EventArgs e) {
if (disableHandlers)
if (disableHandlers || spawnablesListBox.SelectedIndex < 0)
return;
currentEvFile.spawnables[spawnablesListBox.SelectedIndex].zPosition = (short)spawnableUpDown.Value;
@@ -4769,7 +4825,7 @@ namespace DSPRE {
}
#endregion
#region Overworlds Editor
#region Overworlds Tab
private void addOverworldButton_Click(object sender, EventArgs e) {
currentEvFile.overworlds.Add(new Overworld(currentEvFile.overworlds.Count + 1, (int)eventMatrixXUpDown.Value, (int)eventMatrixYUpDown.Value));
overworldsListBox.Items.Add("Overworld " + (currentEvFile.overworlds.Count - 1).ToString());
@@ -5058,7 +5114,7 @@ namespace DSPRE {
#endregion
#region Warps Editor
#region Warps Tab
private void addWarpButton_Click(object sender, EventArgs e) {
currentEvFile.warps.Add(new Warp((int)eventMatrixXUpDown.Value, (int)eventMatrixYUpDown.Value));
warpsListBox.Items.Add("Warp " + (currentEvFile.warps.Count - 1).ToString());
@@ -5164,7 +5220,13 @@ namespace DSPRE {
private void goToWarpDestination_Click(object sender, EventArgs e) {
int destAnchor = (int)warpAnchorUpDown.Value;
ushort destHeaderID = (ushort)warpHeaderUpDown.Value;
MapHeader destHeader = MapHeader.LoadFromARM9(destHeaderID);
MapHeader destHeader;
if (ROMToolboxDialog.flag_DynamicHeadersPatchApplied || ROMToolboxDialog.CheckFilesDynamicHeadersPatchApplied()) {
destHeader = MapHeader.LoadFromFile(RomInfo.gameDirs[DirNames.dynamicHeaders].unpackedDir + "\\" + destHeaderID.ToString("D4"), destHeaderID, 0);
} else {
destHeader = MapHeader.LoadFromARM9(destHeaderID);
}
if (new EventFile(destHeader.eventFileID).warps.Count < destAnchor + 1) {
DialogResult d = MessageBox.Show("The selected warp's destination anchor doesn't exist.\n" +
@@ -5188,7 +5250,7 @@ namespace DSPRE {
}
#endregion
#region Triggers Editor
#region Triggers Tab
private void addTriggerButton_Click(object sender, EventArgs e) {
currentEvFile.triggers.Add(new Trigger((int)eventMatrixXUpDown.Value, (int)eventMatrixYUpDown.Value));
triggersListBox.Items.Add("Trigger " + (currentEvFile.triggers.Count - 1).ToString());
@@ -6334,10 +6396,28 @@ namespace DSPRE {
RomInfo.PrepareCameraData();
if (DSUtils.CheckOverlayHasCompressionFlag(RomInfo.cameraTblOverlayNumber)) {
if (DSUtils.OverlayIsCompressed(RomInfo.cameraTblOverlayNumber)) {
DSUtils.DecompressOverlay(RomInfo.cameraTblOverlayNumber);
DialogResult d1 = MessageBox.Show("It is STRONGLY recommended to configure Overlay1 as uncompressed before proceeding.\n\n" +
"More details in the following dialog.\n\n" + "Do you want to know more?",
"Confirm to proceed", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
bool userConfirmed;
if (d1 == DialogResult.Yes) {
userConfirmed = ROMToolboxDialog.ConfigureOverlay1Uncompressed();
} else {
userConfirmed = false;
}
if (!userConfirmed) {
MessageBox.Show("You chose not to apply the patch. Use this editor responsibly.\n\n" +
"If you change your mind, you can apply it later by accessing the ROM Toolbox.",
"Caution", MessageBoxButtons.OK, MessageBoxIcon.Information);
if (DSUtils.OverlayIsCompressed(RomInfo.cameraTblOverlayNumber)) {
DSUtils.DecompressOverlay(RomInfo.cameraTblOverlayNumber);
}
}
}
uint[] RAMaddresses = new uint[RomInfo.cameraTblOffsetsToRAMaddress.Length];
string camOverlayPath = DSUtils.GetOverlayPath(RomInfo.cameraTblOverlayNumber);
@@ -6360,8 +6440,9 @@ namespace DSPRE {
using (BinaryReader br = new BinaryReader(File.OpenRead(camOverlayPath))) {
br.BaseStream.Position = overlayCameraTblOffset = RAMaddresses[0] - DSUtils.GetOverlayRAMAddress(RomInfo.cameraTblOverlayNumber);
currentCameraTable = new GameCamera[16];
if (RomInfo.gameFamily.Equals("HGSS")) {
currentCameraTable = new GameCamera[17];
for (int i = 0; i < currentCameraTable.Length; i++) {
currentCameraTable[i] = new GameCamera(br.ReadUInt32(), br.ReadInt16(), br.ReadInt16(), br.ReadInt16(),
br.ReadInt16(), br.ReadByte(), br.ReadByte(),
@@ -6370,6 +6451,7 @@ namespace DSPRE {
}
} else {
currentCameraTable = new GameCamera[16];
for (int i = 0; i < 3; i++) {
cameraEditorDataGridView.Columns.RemoveAt(cameraEditorDataGridView.Columns.Count - 3);
}
@@ -6379,6 +6461,7 @@ namespace DSPRE {
br.ReadUInt16(), br.ReadUInt32(), br.ReadUInt32());
}
}
cameraEditorDataGridView.RowTemplate.Height = 32*16 / currentCameraTable.Length;
for (int i = 0; i < currentCameraTable.Length; i++) {
currentCameraTable[i].ShowInGridView(cameraEditorDataGridView, i);
}

View File

@@ -865,7 +865,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAABk
EAAAAk1TRnQBSQFMAgEBCAEAAbQBEgG0ARIBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
EAAAAk1TRnQBSQFMAgEBCAEAAeQBEgHkARIBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
AwABQAMAATADAAEBAQABCAYAAQwYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA

View File

@@ -19,7 +19,7 @@ namespace DSPRE.Properties {
// tramite uno strumento quale ResGen o Visual Studio.
// Per aggiungere o rimuovere un membro, modificare il file con estensione ResX ed eseguire nuovamente ResGen
// con l'opzione /str oppure ricompilare il progetto VS.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
@@ -330,15 +330,6 @@ namespace DSPRE.Properties {
}
}
/// <summary>
/// Cerca una stringa localizzata simile a D.
/// </summary>
internal static string Diamond {
get {
return ResourceManager.GetString("Diamond", resourceCulture);
}
}
/// <summary>
/// Cerca una risorsa localizzata di tipo System.Drawing.Bitmap.
/// </summary>
@@ -749,15 +740,6 @@ namespace DSPRE.Properties {
}
}
/// <summary>
/// Cerca una stringa localizzata simile a HG.
/// </summary>
internal static string HeartGold {
get {
return ResourceManager.GetString("HeartGold", resourceCulture);
}
}
/// <summary>
/// Cerca una risorsa localizzata di tipo System.Drawing.Bitmap.
/// </summary>
@@ -771,9 +753,9 @@ namespace DSPRE.Properties {
/// <summary>
/// Cerca una risorsa localizzata di tipo System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap hgsscamera00 {
internal static System.Drawing.Bitmap hgsscamera0 {
get {
object obj = ResourceManager.GetObject("hgsscamera00", resourceCulture);
object obj = ResourceManager.GetObject("hgsscamera0", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
@@ -781,89 +763,9 @@ namespace DSPRE.Properties {
/// <summary>
/// Cerca una risorsa localizzata di tipo System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap hgsscamera01 {
internal static System.Drawing.Bitmap hgsscamera1 {
get {
object obj = ResourceManager.GetObject("hgsscamera01", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Cerca una risorsa localizzata di tipo System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap hgsscamera02 {
get {
object obj = ResourceManager.GetObject("hgsscamera02", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Cerca una risorsa localizzata di tipo System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap hgsscamera03 {
get {
object obj = ResourceManager.GetObject("hgsscamera03", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Cerca una risorsa localizzata di tipo System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap hgsscamera04 {
get {
object obj = ResourceManager.GetObject("hgsscamera04", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Cerca una risorsa localizzata di tipo System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap hgsscamera05 {
get {
object obj = ResourceManager.GetObject("hgsscamera05", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Cerca una risorsa localizzata di tipo System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap hgsscamera06 {
get {
object obj = ResourceManager.GetObject("hgsscamera06", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Cerca una risorsa localizzata di tipo System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap hgsscamera07 {
get {
object obj = ResourceManager.GetObject("hgsscamera07", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Cerca una risorsa localizzata di tipo System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap hgsscamera08 {
get {
object obj = ResourceManager.GetObject("hgsscamera08", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Cerca una risorsa localizzata di tipo System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap hgsscamera09 {
get {
object obj = ResourceManager.GetObject("hgsscamera09", resourceCulture);
object obj = ResourceManager.GetObject("hgsscamera1", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
@@ -928,6 +830,96 @@ namespace DSPRE.Properties {
}
}
/// <summary>
/// Cerca una risorsa localizzata di tipo System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap hgsscamera16 {
get {
object obj = ResourceManager.GetObject("hgsscamera16", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Cerca una risorsa localizzata di tipo System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap hgsscamera2 {
get {
object obj = ResourceManager.GetObject("hgsscamera2", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Cerca una risorsa localizzata di tipo System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap hgsscamera3 {
get {
object obj = ResourceManager.GetObject("hgsscamera3", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Cerca una risorsa localizzata di tipo System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap hgsscamera4 {
get {
object obj = ResourceManager.GetObject("hgsscamera4", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Cerca una risorsa localizzata di tipo System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap hgsscamera5 {
get {
object obj = ResourceManager.GetObject("hgsscamera5", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Cerca una risorsa localizzata di tipo System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap hgsscamera6 {
get {
object obj = ResourceManager.GetObject("hgsscamera6", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Cerca una risorsa localizzata di tipo System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap hgsscamera7 {
get {
object obj = ResourceManager.GetObject("hgsscamera7", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Cerca una risorsa localizzata di tipo System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap hgsscamera8 {
get {
object obj = ResourceManager.GetObject("hgsscamera8", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Cerca una risorsa localizzata di tipo System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap hgsscamera9 {
get {
object obj = ResourceManager.GetObject("hgsscamera9", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Cerca una risorsa localizzata di tipo System.Drawing.Bitmap.
/// </summary>
@@ -1008,6 +1000,16 @@ namespace DSPRE.Properties {
}
}
/// <summary>
/// Cerca una risorsa localizzata di tipo System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap hgsslake {
get {
object obj = ResourceManager.GetObject("hgsslake", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Cerca una risorsa localizzata di tipo System.Drawing.Bitmap.
/// </summary>
@@ -1178,24 +1180,6 @@ namespace DSPRE.Properties {
}
}
/// <summary>
/// Cerca una stringa localizzata simile a P.
/// </summary>
internal static string Pearl {
get {
return ResourceManager.GetString("Pearl", resourceCulture);
}
}
/// <summary>
/// Cerca una stringa localizzata simile a Plat.
/// </summary>
internal static string Platinum {
get {
return ResourceManager.GetString("Platinum", resourceCulture);
}
}
/// <summary>
/// Cerca una risorsa localizzata di tipo System.Drawing.Bitmap.
/// </summary>
@@ -1726,15 +1710,6 @@ namespace DSPRE.Properties {
}
}
/// <summary>
/// Cerca una stringa localizzata simile a SS.
/// </summary>
internal static string SoulSilver {
get {
return ResourceManager.GetString("SoulSilver", resourceCulture);
}
}
/// <summary>
/// Cerca una risorsa localizzata di tipo System.Drawing.Bitmap.
/// </summary>

View File

@@ -160,7 +160,7 @@
<data name="hgssArcade" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Graphics\weather\hgss\hgssarcade.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="hgsscamera08" type="System.Resources.ResXFileRef, System.Windows.Forms">
<data name="hgsscamera8" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Graphics\camera angles\hgss\hgsscamera08.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="ptcamera4" type="System.Resources.ResXFileRef, System.Windows.Forms">
@@ -193,7 +193,7 @@
<data name="resetColorTable" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Graphics\program icons\resetcolortable.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="hgsscamera06" type="System.Resources.ResXFileRef, System.Windows.Forms">
<data name="hgsscamera6" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Graphics\camera angles\hgss\hgsscamera06.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="LeftClick" type="System.Resources.ResXFileRef, System.Windows.Forms">
@@ -238,15 +238,12 @@
<data name="dpcamera5" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Graphics\Camera Angles\DPPt\dpcamera5.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="hgsscamera04" type="System.Resources.ResXFileRef, System.Windows.Forms">
<data name="hgsscamera4" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Graphics\camera angles\hgss\hgsscamera04.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="goToWarp" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Graphics\Program Icons\goToWarp.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="HeartGold" xml:space="preserve">
<value>HG</value>
</data>
<data name="dpcamera0" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Graphics\Camera Angles\DPPt\dpcamera0.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
@@ -307,22 +304,19 @@
<data name="dpcamera9" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Graphics\Camera Angles\DPPt\dpcamera9.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="hgsscamera05" type="System.Resources.ResXFileRef, System.Windows.Forms">
<data name="hgsscamera5" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Graphics\camera angles\hgss\hgsscamera05.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="ptcamera9" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Graphics\Camera Angles\DPPt\ptcamera9.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Diamond" xml:space="preserve">
<value>D</value>
</data>
<data name="areaicon03" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Graphics\Area Icons\areaicon03.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="ptcamera8" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Graphics\Camera Angles\DPPt\ptcamera8.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="hgsscamera00" type="System.Resources.ResXFileRef, System.Windows.Forms">
<data name="hgsscamera0" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Graphics\camera angles\hgss\hgsscamera00.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="open_file" type="System.Resources.ResXFileRef, System.Windows.Forms">
@@ -385,9 +379,6 @@
<data name="wideLensImageTransp" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Graphics\Program Icons\wideLensImageTransp.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="SoulSilver" xml:space="preserve">
<value>SS</value>
</data>
<data name="exportArrow" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Graphics\program icons\exportarrow.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
@@ -433,7 +424,7 @@
<data name="dplightning" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Graphics\Weather\DPPt\dplightning.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="hgsscamera02" type="System.Resources.ResXFileRef, System.Windows.Forms">
<data name="hgsscamera2" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Graphics\camera angles\hgss\hgsscamera02.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="ptdark" type="System.Resources.ResXFileRef, System.Windows.Forms">
@@ -460,9 +451,6 @@
<data name="dpcamera3" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Graphics\Camera Angles\DPPt\dpcamera3.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Pearl" xml:space="preserve">
<value>P</value>
</data>
<data name="brown_sign" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Graphics\Event Icons\brown_sign.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
@@ -517,7 +505,7 @@
<data name="dpthunderstorm" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Graphics\Weather\DPPt\dpthunderstorm.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="hgsscamera03" type="System.Resources.ResXFileRef, System.Windows.Forms">
<data name="hgsscamera3" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Graphics\camera angles\hgss\hgsscamera03.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="dpareaicon" type="System.Resources.ResXFileRef, System.Windows.Forms">
@@ -547,7 +535,7 @@
<data name="areaicon06" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Graphics\Area Icons\areaicon06.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="hgsscamera01" type="System.Resources.ResXFileRef, System.Windows.Forms">
<data name="hgsscamera1" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Graphics\camera angles\hgss\hgsscamera01.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="blz" type="System.Resources.ResXFileRef, System.Windows.Forms">
@@ -559,9 +547,6 @@
<data name="hgssrain" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Graphics\weather\hgss\hgssrain.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Platinum" xml:space="preserve">
<value>Plat</value>
</data>
<data name="ptspotlight" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Graphics\Weather\DPPt\ptspotlight.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
@@ -586,7 +571,7 @@
<data name="overworldUnreadable" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Graphics\Event Icons\overworldUnreadable.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="hgsscamera09" type="System.Resources.ResXFileRef, System.Windows.Forms">
<data name="hgsscamera9" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Graphics\camera angles\hgss\hgsscamera09.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="unpackBuildingNarcsIcon" type="System.Resources.ResXFileRef, System.Windows.Forms">
@@ -634,7 +619,7 @@
<data name="resetListIcon" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Graphics\Program Icons\resetListIcon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="hgsscamera07" type="System.Resources.ResXFileRef, System.Windows.Forms">
<data name="hgsscamera7" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Graphics\camera angles\hgss\hgsscamera07.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="deleteIcon" type="System.Resources.ResXFileRef, System.Windows.Forms">
@@ -655,4 +640,10 @@
<data name="selectBldWithMouse" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\selectBldWithMouse.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="hgsscamera16" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\hgsscamera16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="hgsslake" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Graphics\Area Icons\hgsslake.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

View File

@@ -7,8 +7,7 @@ namespace DSPRE.ROMFiles {
/// <summary>
/// Classes to store event data in Pok<6F>mon NDS games
/// </summary>
public class EventFile: RomFile
{
public class EventFile : RomFile {
#region<EFBFBD>Fields<EFBFBD>(4)
public List<Spawnable> spawnables = new List<Spawnable>();
public List<Overworld> overworlds = new List<Overworld>();
@@ -21,17 +20,17 @@ namespace DSPRE.ROMFiles {
using (BinaryReader reader = new BinaryReader(data)) {
/* Read spawnables */
uint spawnablesCount = reader.ReadUInt32();
for (int i = 0; i < spawnablesCount; i++)
for (int i = 0; i < spawnablesCount; i++)
spawnables.Add(new Spawnable(new MemoryStream(reader.ReadBytes(0x14))));
/* Read overworlds */
uint overworldsCount = reader.ReadUInt32();
for (int i = 0; i < overworldsCount; i++)
for (int i = 0; i < overworldsCount; i++)
overworlds.Add(new Overworld(new MemoryStream(reader.ReadBytes(0x20))));
/* Read warps */
uint warpsCount = reader.ReadUInt32();
for (int i = 0; i < warpsCount; i++)
for (int i = 0; i < warpsCount; i++)
warps.Add(new Warp(new MemoryStream(reader.ReadBytes(0xC))));
/* Read triggers */
@@ -44,29 +43,27 @@ namespace DSPRE.ROMFiles {
#endregion
#region<EFBFBD>Methods (1)
public override byte[] ToByteArray()
{
public override byte[] ToByteArray() {
MemoryStream newData = new MemoryStream();
using (BinaryWriter writer = new BinaryWriter(newData))
{
using (BinaryWriter writer = new BinaryWriter(newData)) {
/* Write spawnables */
writer.Write((uint)spawnables.Count);
for (int i = 0; i < spawnables.Count; i++)
for (int i = 0; i < spawnables.Count; i++)
writer.Write(spawnables[i].ToByteArray());
/* Write overworlds */
writer.Write((uint)overworlds.Count);
for (int i = 0; i < overworlds.Count; i++)
for (int i = 0; i < overworlds.Count; i++)
writer.Write(overworlds[i].ToByteArray());
/* Write warps */
writer.Write((uint)warps.Count);
for (int i = 0; i < warps.Count; i++)
for (int i = 0; i < warps.Count; i++)
writer.Write(warps[i].ToByteArray());
/* Write triggers */
writer.Write((uint)triggers.Count);
for (int i = 0; i < triggers.Count; i++)
for (int i = 0; i < triggers.Count; i++)
writer.Write(triggers[i].ToByteArray());
}
return newData.ToArray();
@@ -81,9 +78,16 @@ namespace DSPRE.ROMFiles {
}
public abstract class Event
{
public abstract class Event {
public enum EventType : byte {
SPAWNABLE,
OVERWORLD,
WARP,
TRIGGER
}
#region<EFBFBD>Fields<EFBFBD>(6)
public EventType evType;
public short xMapPosition;
public short yMapPosition;
public short zPosition;
@@ -96,8 +100,7 @@ namespace DSPRE.ROMFiles {
#endregion
}
public class Spawnable : Event
{
public class Spawnable : Event {
public const int TYPE_MISC = 0;
public const int TYPE_BOARD = 1;
public const int TYPE_HIDDENITEM = 2;
@@ -114,22 +117,23 @@ namespace DSPRE.ROMFiles {
#region<EFBFBD>Constructors<EFBFBD>(2)
public Spawnable(Stream data) {
evType = EventType.SPAWNABLE;
using (BinaryReader reader = new BinaryReader(data)) {
scriptNumber = reader.ReadUInt16();
type = reader.ReadUInt16();
/* Decompose x coordinate in matrix and map positions */
int xPosition = reader.ReadInt16();
xMapPosition = (short)(xPosition % 32);
xMatrixPosition = (ushort)(xPosition / 32);
unknown2 = reader.ReadUInt16();
/* Decompose y coordinate in matrix and map positions */
int yPosition = reader.ReadInt16();
yMapPosition = (short)(yPosition % 32);
yMatrixPosition = (ushort)(yPosition / 32);
unknown3 = reader.ReadUInt16();
zPosition = reader.ReadInt16();
unknown4 = reader.ReadUInt16();
@@ -138,6 +142,8 @@ namespace DSPRE.ROMFiles {
}
}
public Spawnable(int xMatrixPosition, int yMatrixPosition) {
evType = EventType.SPAWNABLE;
scriptNumber = 0;
type = 0;
unknown2 = 0;
@@ -153,6 +159,8 @@ namespace DSPRE.ROMFiles {
this.yMatrixPosition = (ushort)yMatrixPosition;
}
public Spawnable(Spawnable toCopy) {
evType = EventType.SPAWNABLE;
scriptNumber = toCopy.scriptNumber;
type = toCopy.type;
unknown2 = toCopy.unknown2;
@@ -186,15 +194,14 @@ namespace DSPRE.ROMFiles {
writer.Write(unknown5);
return ((MemoryStream)writer.BaseStream).ToArray();
}
}
}
#endregion
}
public class Overworld : Event
{
public class Overworld : Event {
#region<EFBFBD>Fields<EFBFBD>(14)
public enum owType : ushort { NORMAL = 0, TRAINER = 1, ITEM = 3};
public enum owType : ushort { NORMAL = 0, TRAINER = 1, ITEM = 3 };
public ushort owID;
public ushort overlayTableEntry;
@@ -214,6 +221,7 @@ namespace DSPRE.ROMFiles {
#region<EFBFBD>Constructors<EFBFBD>(2)
public Overworld(Stream data) {
evType = EventType.OVERWORLD;
using (BinaryReader reader = new BinaryReader(data)) {
owID = reader.ReadUInt16();
overlayTableEntry = reader.ReadUInt16();
@@ -227,7 +235,7 @@ namespace DSPRE.ROMFiles {
unknown2 = reader.ReadUInt16();
xRange = reader.ReadUInt16();
yRange = reader.ReadUInt16();
/* Decompose x-y coordinates in matrix and map positions */
int xPosition = reader.ReadInt16();
int yPosition = reader.ReadInt16();
@@ -235,12 +243,14 @@ namespace DSPRE.ROMFiles {
yMapPosition = (short)(yPosition % 32);
xMatrixPosition = (ushort)(xPosition / 32);
yMatrixPosition = (ushort)(yPosition / 32);
zPosition = reader.ReadInt16();
unknown3 = reader.ReadUInt16();
}
}
public Overworld(int owID, int xMatrixPosition, int yMatrixPosition) {
evType = EventType.OVERWORLD;
this.owID = (ushort)owID;
overlayTableEntry = 1;
movement = 0;
@@ -262,6 +272,8 @@ namespace DSPRE.ROMFiles {
this.yMatrixPosition = (ushort)yMatrixPosition;
}
public Overworld(Overworld toCopy) {
evType = EventType.OVERWORLD;
this.owID = toCopy.owID;
overlayTableEntry = toCopy.overlayTableEntry;
movement = toCopy.movement;
@@ -285,10 +297,8 @@ namespace DSPRE.ROMFiles {
#endregion
#region<EFBFBD>Methods (1)
public override byte[] ToByteArray()
{
using (BinaryWriter writer = new BinaryWriter(new MemoryStream()))
{
public override byte[] ToByteArray() {
using (BinaryWriter writer = new BinaryWriter(new MemoryStream())) {
writer.Write(owID);
writer.Write(overlayTableEntry);
writer.Write(movement);
@@ -318,8 +328,7 @@ namespace DSPRE.ROMFiles {
}
public class Warp : Event
{
public class Warp : Event {
#region<EFBFBD>Fields<EFBFBD>(4)
public ushort header;
public ushort anchor;
@@ -327,10 +336,9 @@ namespace DSPRE.ROMFiles {
#endregion
#region<EFBFBD>Constructors<EFBFBD>(2)
public Warp(Stream data)
{
using (BinaryReader reader = new BinaryReader(data))
{
public Warp(Stream data) {
evType = EventType.WARP;
using (BinaryReader reader = new BinaryReader(data)) {
/* Decompose x-y coordinates in matrix and map positions */
int xPosition = reader.ReadInt16();
int yPosition = reader.ReadInt16();
@@ -345,6 +353,8 @@ namespace DSPRE.ROMFiles {
}
}
public Warp(int xMatrixPosition, int yMatrixPosition) {
evType = EventType.WARP;
header = 0;
anchor = 0;
@@ -354,6 +364,8 @@ namespace DSPRE.ROMFiles {
this.yMatrixPosition = (ushort)yMatrixPosition;
}
public Warp(Warp toCopy) {
evType = EventType.WARP;
header = toCopy.header;
anchor = toCopy.anchor;
@@ -384,8 +396,7 @@ namespace DSPRE.ROMFiles {
}
public class Trigger : Event
{
public class Trigger : Event {
#region<EFBFBD>Fields<EFBFBD>(7)
public ushort scriptNumber;
public ushort widthX;
@@ -397,6 +408,7 @@ namespace DSPRE.ROMFiles {
#region<EFBFBD>Constructors<EFBFBD>(2)
public Trigger(Stream data) {
evType = EventType.TRIGGER;
using (BinaryReader reader = new BinaryReader(data)) {
scriptNumber = reader.ReadUInt16();
@@ -414,9 +426,11 @@ namespace DSPRE.ROMFiles {
zPosition = reader.ReadUInt16();
expectedVarValue = reader.ReadUInt16();
variableWatched = reader.ReadUInt16();
}
}
}
public Trigger(int xMatrixPosition, int yMatrixPosition) {
evType = EventType.TRIGGER;
scriptNumber = 0;
variableWatched = 0;
expectedVarValue = 0;
@@ -429,6 +443,8 @@ namespace DSPRE.ROMFiles {
this.yMatrixPosition = (ushort)yMatrixPosition;
}
public Trigger(Trigger toCopy) {
evType = EventType.TRIGGER;
scriptNumber = toCopy.scriptNumber;
variableWatched = toCopy.variableWatched;
expectedVarValue = toCopy.expectedVarValue;
@@ -443,10 +459,8 @@ namespace DSPRE.ROMFiles {
#endregion
#region<EFBFBD>Methods (1)
public override byte[] ToByteArray()
{
using (BinaryWriter writer = new BinaryWriter(new MemoryStream()))
{
public override byte[] ToByteArray() {
using (BinaryWriter writer = new BinaryWriter(new MemoryStream())) {
writer.Write(scriptNumber);
ushort xCoordinate = (ushort)(xMapPosition + 32 * xMatrixPosition);
writer.Write(xCoordinate);

View File

@@ -87,6 +87,22 @@ namespace DSPRE.ROMFiles {
public ushort ID { get; set; }
public static readonly byte length = 24;
public static readonly string nameSeparator = " - ";
public enum SearchableFields: byte {
AreaDataID,
CameraAngleID,
EventFileID,
InternalName,
LevelScriptID,
MatrixID,
MusicDayID,
//MusicDayName,
MusicNightID,
//MusicNightName,
ScriptFileID,
TextArchiveID,
WeatherID,
};
/**/
@@ -277,10 +293,12 @@ namespace DSPRE.ROMFiles {
public byte areaIcon { get; set; }
public byte followMode { get; set; }
public byte locationName { get; set; }
public byte areaSettings { get; set; } // 4 bits only [4 bits for the camera as well]
public byte locationType { get; set; } //4 bits only
public byte unknown0 { get; set; } //4 bits only
public byte unknown1 { get; set; } //4 bits only
public byte worldmapX { get; set; } //6 bits only
public byte worldmapY { get; set; } //6 bits only
public bool kantoFlag { get; set; }
#endregion
#region<EFBFBD>Constructors<EFBFBD>(1)
@@ -304,16 +322,21 @@ namespace DSPRE.ROMFiles {
musicNightID = reader.ReadUInt16();
eventFileID = reader.ReadUInt16();
locationName = reader.ReadByte();
areaIcon = StandardizeAreaIcon(reader.ReadByte());
weatherID = reader.ReadByte();
byte areaProperties = reader.ReadByte();
areaIcon = (byte)(areaProperties & 0b_1111); //get 4 bits
unknown1 = (byte)((areaProperties >> 4) & 0b_1111); //get 4 bits after the first 4
byte cameraAndArea = reader.ReadByte();
areaSettings = (byte)(cameraAndArea & 0b_1111); //get 4 bits
cameraAngleID = (byte)(cameraAndArea >> 4 & 0b_1111); //get 4 bits after the first 4
uint last32 = reader.ReadUInt32();
kantoFlag = (last32 & 0b_1) == 1; //get 1 bit
weatherID = (byte)((last32 >> 1) & 0b_1111_111); //get 7 bits after the first one
locationType = (byte)((last32 >> 8) & 0b_1111); //get 4 bits after the first 8
cameraAngleID = (byte)((last32 >> 12) & 0b_1111_11); //get 6 bits after the first 12
followMode = (byte)((last32 >> 18) & 0b_11); //get 2 bits after the first 17
battleBackground = (byte)((last32 >> 20) & 0b_1111_1); //get 5 bits after the first 19
flags = (byte)(last32 >> 25 & 0b_1111_111); //get 7 bits after the first 24
followMode = reader.ReadByte();
flags = reader.ReadByte();
} catch (EndOfStreamException) {
MessageBox.Show("Error loading header " + ID + '.', "Unexpected EOF", MessageBoxButtons.OK, MessageBoxIcon.Error);
ID = ushort.MaxValue;
@@ -340,86 +363,25 @@ namespace DSPRE.ROMFiles {
writer.Write(musicNightID);
writer.Write(eventFileID);
writer.Write(locationName);
writer.Write(areaIcon);
writer.Write(weatherID);
byte cameraAndArea = (byte)((areaSettings & 0b_1111) + ((cameraAngleID & 0b_1111) << 4));
writer.Write(cameraAndArea);
byte areaProperties = (byte)((areaIcon & 0b_1111) + ((unknown1 & 0b_1111) << 4));
writer.Write(areaProperties);
writer.Write(followMode);
writer.Write(flags);
uint last32 = (uint)(((weatherID & 0b_1111_111) << 1) +
((locationType & 0b_1111) << 8) +
((cameraAngleID & 0b_1111_1) << 12) +
((followMode & 0b_11) << 18) +
((battleBackground & 0b_1111_1) << 20) +
((flags & 0b_1111_111) << 25));
if (kantoFlag) {
last32++;
}
writer.Write(last32);
}
return newData.ToArray();
}
public byte StandardizeAreaIcon(byte areaIcon) {
//TO DO: improve this
//The AreaIcon byte is probably split into bits by the game engine,
//each with a specific purpose...
//there is a very interesting pattern here
/* This function was written to avoid having to account
for duplicate values of the map name textbox types, since
many share the same textbox image */
switch (areaIcon) {
/* Water textbox values */
case 182:
case 198:
return 166;
/* Town textbox values*/
case 147:
case 163:
case 179:
case 195:
return 131;
/* Wall textbox values */
case 33:
case 65:
case 81:
case 97:
case 113:
case 145:
case 161:
case 193:
case 209:
return 17;
/* Gray textbox values */
case 25:
case 41:
case 57:
case 73:
case 89:
case 105:
case 121:
case 137:
case 153:
case 169:
case 185:
case 201:
case 217:
return 9;
/* Cave textbox values */
case 148:
case 164:
case 180:
case 196:
return 132;
/* Field textbox values */
case 151:
return 135;
/* Wooden textbox values */
case 50:
case 162:
case 194:
return 2;
/* Forest textbox values */
case 181:
return 165;
default:
return areaIcon;
}
}
#endregion
}
}

View File

@@ -389,8 +389,7 @@ namespace DSPRE {
if (RomInfo.gameFamily == "HGSS") {
if (DSUtils.CheckOverlayHasCompressionFlag(data.overlayNumber)) {
DialogResult d1;
d1 = MessageBox.Show("It is STRONGLY recommended to configure Overlay1 as uncompressed before proceeding.\n\n" +
DialogResult d1 = MessageBox.Show("It is STRONGLY recommended to configure Overlay1 as uncompressed before proceeding.\n\n" +
"More details in the following dialog.\n\n" + "Do you want to know more?",
"Confirm to proceed", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
@@ -448,25 +447,41 @@ namespace DSPRE {
}
}
private void overlay1uncomprButton_Click(object sender, EventArgs e) {
if (ConfigureOverlay1Uncompressed()) {
DisableOverlay1patch("Already applied");
overlay1CB.Visible = true;
}
}
public static bool ConfigureOverlay1Uncompressed() {
bool isCompressed = false;
string stringDecompressOverlay = "";
if (DSUtils.OverlayIsCompressed(1)) {
isCompressed = true;
stringDecompressOverlay = "- Overlay 1 will be decompressed.\n\n";
}
DialogResult d = MessageBox.Show("This process will apply the following changes:\n\n" +
"- Overlay 1 will be decompressed.\n\n" +
"- Overlay 1 will be configured as \"uncompressed\" in the overlay table.\n\n" +
"Do you wish to continue?",
"Confirm to proceed", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
stringDecompressOverlay +
"- Overlay 1 will be configured as \"uncompressed\" in the overlay table.\n\n" +
"Do you wish to continue?",
"Confirm to proceed", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
if (d == DialogResult.Yes) {
DSUtils.SetOverlayCompressionInTable(1, 0);
if (DSUtils.OverlayIsCompressed(1)) {
if (isCompressed) {
DSUtils.DecompressOverlay(1);
}
DisableOverlay1patch("Already applied");
overlay1CB.Visible = true;
MessageBox.Show("Overlay1 is now configured as uncompressed.", "Operation successful", MessageBoxButtons.OK, MessageBoxIcon.Information);
return true;
} else {
MessageBox.Show("No changes have been made.", "Operation canceled", MessageBoxButtons.OK, MessageBoxIcon.Information);
return false;
}
}
private void ApplyItemStandardizeButton_Click(object sender, EventArgs e) {
DialogResult d = MessageBox.Show("This process will apply the following changes:\n\n" +
"- Item scripts will be rearranged to follow the natural, ascending index order.\n\n" +

Binary file not shown.

After

Width:  |  Height:  |  Size: 303 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 424 B

After

Width:  |  Height:  |  Size: 306 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

View File

@@ -17,36 +17,37 @@ namespace DSPRE.Resources {
"[08] Island",
"[09] Wood"
};
public static string[] HGSSAreaIconValues = new string[] {
"[002] Wood",
"[009] Gray",
"[017] Wall",
"[048] Not displayed",
"[131] Town",
"[132] Cave",
"[135] Field",
"[152] Lake",
"[165] Forest",
"[166] Water"
public static Dictionary<byte, string> HGSSAreaIconsDict = new Dictionary<byte, string>() {
[00] = "Not displayed",
[01] = "Wall",
[02] = "Wood",
[03] = "Town",
[04] = "Cave",
[05] = "Forest",
[06] = "Water",
[07] = "Field",
[08] = "Lake",
[09] = "Gray"
};
public static string[] HGSSAreaProperties = new string[] {
"[00] Unknown",
"[01] Unknown",
"[02] Unknown",
"[03] Cave Animation",
"[04] Hide Location Tag",
"[05] Unknown",
"[06] Unknown",
"[07] Unknown",
"[08] Unknown",
"[09] Unknown",
"[10] Unknown",
"[11] Unknown",
"[12] Unknown",
"[13] Unknown",
"[14] Unknown",
"[15] Unknown",
"[16] Unknown",
"[00] Mystery Zone",
"[01] City/Town",
"[02] Route",
"[03] Cave",
"[04] Interior [Hide Name]",
"[05] Pokémon Center",
"[06] Underground",
"[07] Unknown/Unused",
"[08] Unknown/Unused",
"[09] Unknown/Unused",
"[10] Unknown/Unused",
"[11] Unknown/Unused",
"[12] Unknown/Unused",
"[13] Unknown/Unused",
"[14] Unknown/Unused",
"[15] Unknown/Unused",
"[16] Unknown/Unused",
};
}
public static class ShowName {
@@ -144,76 +145,58 @@ namespace DSPRE.Resources {
};
public static Dictionary<int, string> HGSSWeatherDict = new Dictionary<int, string> {
[00] = "Normal",
[01] = "Normal [1]",
[02] = "Rain",
[01] = "Rain",
[02] = "Rain [2]",
[03] = "Rain [3]",
[04] = "Rain [4]",
[05] = "Rain [5]",
[06] = "Rain [6]",
[07] = "Rain [7]",
[08] = "Rain [8]",
[09] = "Snow [9]",
[10] = "Snow [10]",
[11] = "Snow [11]",
[12] = "Snow [12]",
[13] = "Snow [13]",
[14] = "Sandstorm (in battle only)",
[15] = "Snow [15]",
[16] = "Diamond Dust",
[17] = "Diamond Dust [17]",
[18] = "Fog",
[19] = "Fog [19]",
[20] = "Fog [20]",
[21] = "Fog [21]",
[22] = "Darkness",
[23] = "Darkness [23]",
[24] = "Darkness after flash",
[25] = "Darkness after flash [25]",
[26] = "Low Light (Battle Arcade)"
[05] = "Snow [5]",
[06] = "Snow [6]",
[07] = "Sandstorm (in battle only)",
[08] = "Diamond Dust",
[09] = "Fog",
[10] = "Fog [10]",
[11] = "Darkness",
[12] = "Darkness after flash",
[13] = "Low Light (Battle Arcade)"
};
}
public static class CameraAngles {
public static string[] DPPtCameraValues = new string[] {
"[00] 3D Normal",
"[01] 3D Top View (Higher than [12])",
"[02] 3D Frontal Low (Wider than [15])",
"[03] 3D Frontal",
"[04] 2D Ortho",
"[05] 3D Normal - Wide FOV",
"[06] 3D Bird View",
"[07] 3D Normal",
"[08] 3D Bird View Far",
"[09] 3D Frontal - Wide FOV",
"[10] 3D Top View - Narrow",
"[11] Normal 3D",
"[12] 3D Top View",
"[13] Frontal 3D",
"[14] 3D Top View - Wide FOV",
"[15] 3D Frontal Low"
public static Dictionary<int, string> DPPtCameraDict = new Dictionary<int, string>() {
[00] = "3D Normal",
[01] = "3D Top Higher",
[02] = "3D Front Low - Wide FOV",
[03] = "3D Front",
[04] = "2D Ortho",
[05] = "3D Normal - Wide FOV",
[06] = "3D Bird View",
[07] = "3D Normal [07]",
[08] = "3D Bird View Far",
[09] = "3D Front - Wide FOV",
[10] = "3D Top - Narrow",
[11] = "3D Normal [11]",
[12] = "3D Top",
[13] = "Front 3D",
[14] = "3D Top - Wide FOV",
[15] = "3D Front Low"
};
public static string[] HGSSCameraValues = new string[] {
"[00] 3D Top",
"[01] 3D Front High",
"[02] 3D Lower",
"[03] 3D Frontal",
"[04] 2D Top View",
"[05] Normal 3D",
"[06] 3D Normal",
"[07] High 3D",
"[08] 3D Top View",
"[09] 3D Top View",
"[10] 3D High Wide",
"[11] 3D Frontal Wide",
"[12] 3D Lower Close",
"[13] 3D Full Frontal",
"[14] 3D Top View",
"[15] 2D Higher"
public static Dictionary<int, string> HGSSCameraDict = new Dictionary<int, string>() {
[00] = "3D Top View [00]",
[01] = "3D Front High",
[02] = "3D Lower",
[03] = "3D Front",
[04] = "2D Top View",
[05] = "Normal 3D",
[06] = "Normal 3D [06]",
[07] = "High 3D",
[08] = "3D Top View [08]",
[09] = "3D Top View [09]",
[10] = "3D High Wide",
[11] = "3D Front Wide",
[12] = "3D Lower Close",
[13] = "3D Full Front",
[14] = "3D Top View [14]",
[15] = "2D Higher",
[16] = "3D Top View [16]"
};
}
public abstract class MusicDB {
@@ -503,7 +486,7 @@ namespace DSPRE.Resources {
public static class EventEditor {
public static class Spawnables {
public static string[] orientationsArray = new string[] {
"Frontal Interaction",
"Front Interaction",
"Activated from the left",
"Activated from the right",
"Activated from behind",
@@ -4120,16 +4103,16 @@ namespace DSPRE.Resources {
}
public static class AreaPics {
public static Dictionary<int, string> hgssAreaPicDict = new Dictionary<int, string>() {
[0] = "hgsswood",
[1] = "hgssgray",
[2] = "hgsswall",
[3] = "empty",
[4] = "hgsstown",
[5] = "hgsscave",
[6] = "hgssfield",
[7] = "hgsslake",
[8] = "hgssforest",
[9] = "hgsswater",
[0] = "empty",
[1] = "hgsswall",
[2] = "hgsswood",
[3] = "hgsstown",
[4] = "hgsscave",
[5] = "hgssforest",
[6] = "hgsswater",
[7] = "hgssfield",
[8] = "hgsslake",
[9] = "hgssgray"
};
}
public static class WeatherPics {
@@ -4185,15 +4168,15 @@ namespace DSPRE.Resources {
};
public static Dictionary<byte[], string> hgssweatherImageDict = new Dictionary<byte[], string>() {
[new byte[] { 0, 1 }] = "hgssnormal",
[new byte[] { 2, 3, 4, 5, 6, 7, 8 }] = "hgssrain",
[new byte[] { 9, 10, 11, 12, 13, 15 }] = "hgsssnow",
[new byte[] { 14 }] = "hgssnormal", //sandstorm in battle only
[new byte[] { 16, 17 }] = "hgssdiamond",
[new byte[] { 18, 19, 20, 21 }] = "hgssfog",
[new byte[] { 22, 23 }] = "hgssdark",
[new byte[] { 24, 25 }] = "hgssdark2",
[new byte[] { 26 }] = "hgssArcade"
[new byte[] { 0}] = "hgssnormal",
[new byte[] { 1, 2, 3, 4 }] = "hgssrain",
[new byte[] { 5, 6 }] = "hgsssnow",
[new byte[] { 7 }] = "hgssnormal", //sandstorm in battle only
[new byte[] { 8 }] = "hgssdiamond",
[new byte[] { 9, 10 }] = "hgssfog",
[new byte[] { 11 }] = "hgssdark",
[new byte[] { 12 }] = "hgssdark2",
[new byte[] { 13 }] = "hgssArcade"
};
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

View File

@@ -2,6 +2,7 @@
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using static DSPRE.RomInfo;
namespace DSPRE {
public partial class SpawnEditor : Form {
@@ -107,7 +108,14 @@ namespace DSPRE {
private void spawnHeaderComboBox_IndexChanged(object sender, EventArgs e) {
ushort headerNumber = ushort.Parse(spawnHeaderComboBox.SelectedItem.ToString().Split()[0]);
MapHeader currentHeader = MapHeader.LoadFromARM9(headerNumber);
MapHeader currentHeader;
if (ROMToolboxDialog.flag_DynamicHeadersPatchApplied || ROMToolboxDialog.CheckFilesDynamicHeadersPatchApplied()) {
currentHeader = MapHeader.LoadFromFile(RomInfo.gameDirs[DirNames.dynamicHeaders].unpackedDir + "\\" + headerNumber.ToString("D4"), headerNumber, 0);
} else {
currentHeader = MapHeader.LoadFromARM9(headerNumber);
}
GameMatrix headerMatrix = new GameMatrix(currentHeader.matrixID);
matrixxUpDown.Maximum = headerMatrix.maps.GetLength(1) - 1;
matrixyUpDown.Maximum = headerMatrix.maps.GetLength(0) - 1;