Was missing a bunch of stuff

Co-authored-by: Kuha <corentinmace@users.noreply.github.com>
This commit is contained in:
Mixone-FinallyHere
2024-10-31 21:20:53 +01:00
parent a5138c39b1
commit 1cf7407516
9 changed files with 462 additions and 311 deletions

View File

@@ -34,8 +34,7 @@ namespace DSPRE
for (int i = 0; i < foundInOvl.Count; i++)
{
int ovl = foundInOvl[i];
Console.WriteLine(ovl);
addressesGrid.Rows.Add(ovl, getOffsetInOverlay(convertedAddress, ovl));
addressesGrid.Rows.Add("Overlay " + ovl, getOffsetInOverlay(convertedAddress, ovl));
}
@@ -52,7 +51,7 @@ namespace DSPRE
if (convertedAddress >= RomInfo.synthOverlayLoadAddress)
{
addressesGrid.Rows.Add("SynthOVL", "?");
addressesGrid.Rows.Add("SynthOVL", $"0x{convertedAddress - RomInfo.synthOverlayLoadAddress:X4}");
}
}
catch
@@ -71,7 +70,7 @@ namespace DSPRE
uint currentOvlAddress = OverlayUtils.OverlayTable.GetRAMAddress(i);
bool checkOverlayN = currentOvlAddress >= address;
bool checkOverlayN1 = address < (currentOvlAddress + OverlayUtils.OverlayTable.GetUncompressedSize(i));
Console.WriteLine(currentOvlAddress);
if (checkOverlayN && checkOverlayN1)
{
overlayNumbers.Add(i);

View File

@@ -687,6 +687,7 @@
<Content Include="Resources\Graphics\Program Icons\sortAscending.png" />
<Content Include="Resources\Graphics\Program Icons\sortDescending.png" />
<Content Include="Resources\Graphics\Program Icons\tableEditor.png" />
<None Include="Resources\Graphics\Program Icons\weather_editor.png" />
<Content Include="Resources\Graphics\Weather\DPPt\ptblueish.png" />
<Content Include="Resources\Graphics\Weather\DPPt\ptdarkfog.png" />
<Content Include="Resources\Graphics\Weather\DPPt\ptdim.png" />
@@ -700,6 +701,7 @@
<None Include="Resources\Graphics\Program Icons\sortAscending.png" />
<None Include="Resources\Graphics\Program Icons\sortDescending.png" />
<None Include="Resources\RenameIcon.png" />
<None Include="Resources\weather_editor.bmp" />
<Content Include="Tools\apicula.exe">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>

View File

@@ -272,7 +272,7 @@
//
// removeLastRow
//
this.removeLastRow.Image = global::DSPRE.Properties.Resources.deleteIcon1;
this.removeLastRow.Image = global::DSPRE.Properties.Resources.deleteIcon;
this.removeLastRow.Location = new System.Drawing.Point(501, 467);
this.removeLastRow.Name = "removeLastRow";
this.removeLastRow.Padding = new System.Windows.Forms.Padding(10, 0, 10, 0);
@@ -285,7 +285,7 @@
//
// removeFirstRow
//
this.removeFirstRow.Image = global::DSPRE.Properties.Resources.deleteIcon1;
this.removeFirstRow.Image = global::DSPRE.Properties.Resources.deleteIcon;
this.removeFirstRow.Location = new System.Drawing.Point(324, 467);
this.removeFirstRow.Name = "removeFirstRow";
this.removeFirstRow.Padding = new System.Windows.Forms.Padding(10, 0, 10, 0);

View File

@@ -255,6 +255,7 @@
this.zBuildUpDown = new System.Windows.Forms.NumericUpDown();
this.buildingsListBox = new System.Windows.Forms.ListBox();
this.permissionsTabPage = new System.Windows.Forms.TabPage();
this.transparencyBar = new System.Windows.Forms.TrackBar();
this.scanUnusedCollisionTypesButton = new System.Windows.Forms.Button();
this.clearCurrentButton = new System.Windows.Forms.Button();
this.typeLabel = new System.Windows.Forms.Label();
@@ -788,6 +789,7 @@
this.openROMToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.openFolderToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.saveROMToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.settingsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.romToolboxToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.headerSearchToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@@ -808,6 +810,7 @@
this.texturizeNSBMDToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.untexturizeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.extractNSBTXFromNSBMDToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.addressHelperToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.menuViewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.essentialToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.simpleToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@@ -835,6 +838,7 @@
this.listBasedBatchRenameToolStripButton = new System.Windows.Forms.ToolStripButton();
this.contentBasedBatchRenameToolStripButton = new System.Windows.Forms.ToolStripButton();
this.separator_afterRenameUtils = new System.Windows.Forms.ToolStripSeparator();
this.weatherMapEditor = new System.Windows.Forms.ToolStripButton();
this.enumBasedListBuilderToolStripButton = new System.Windows.Forms.ToolStripButton();
this.folderBasedListBuilderToolStriButton = new System.Windows.Forms.ToolStripButton();
this.separator_afterListUtils = new System.Windows.Forms.ToolStripSeparator();
@@ -916,6 +920,7 @@
((System.ComponentModel.ISupportInitialize)(this.xBuildUpDown)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.zBuildUpDown)).BeginInit();
this.permissionsTabPage.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.transparencyBar)).BeginInit();
this.typeGroupBox.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.typePainterUpDown)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.typePainterPictureBox)).BeginInit();
@@ -1090,6 +1095,7 @@
this.menuStrip1.SuspendLayout();
this.statusStrip1.SuspendLayout();
this.mainToolStrip.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.texturePictureBox)).BeginInit();
this.SuspendLayout();
//
// mainTabControl
@@ -2714,7 +2720,7 @@
//
this.labelMatrices.AutoSize = true;
this.labelMatrices.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.labelMatrices.Location = new System.Drawing.Point(9, 11);
this.labelMatrices.Location = new System.Drawing.Point(10, 11);
this.labelMatrices.Name = "labelMatrices";
this.labelMatrices.Size = new System.Drawing.Size(47, 13);
this.labelMatrices.TabIndex = 21;
@@ -3822,6 +3828,7 @@
//
// permissionsTabPage
//
this.permissionsTabPage.Controls.Add(this.transparencyBar);
this.permissionsTabPage.Controls.Add(this.scanUnusedCollisionTypesButton);
this.permissionsTabPage.Controls.Add(this.clearCurrentButton);
this.permissionsTabPage.Controls.Add(this.typeLabel);
@@ -3840,11 +3847,24 @@
this.permissionsTabPage.Text = "Move Permissions";
this.permissionsTabPage.UseVisualStyleBackColor = true;
//
// transparencyBar
//
this.transparencyBar.BackColor = System.Drawing.SystemColors.Menu;
this.transparencyBar.Location = new System.Drawing.Point(12, 391);
this.transparencyBar.Margin = new System.Windows.Forms.Padding(3, 3, 3, 0);
this.transparencyBar.Maximum = 255;
this.transparencyBar.Name = "transparencyBar";
this.transparencyBar.Size = new System.Drawing.Size(445, 45);
this.transparencyBar.TabIndex = 42;
this.transparencyBar.TickFrequency = 255;
this.transparencyBar.TickStyle = System.Windows.Forms.TickStyle.None;
this.transparencyBar.Scroll += new System.EventHandler(this.transparencyBar_Scroll);
//
// scanUnusedCollisionTypesButton
//
this.scanUnusedCollisionTypesButton.Image = global::DSPRE.Properties.Resources.SearchMiniIcon;
this.scanUnusedCollisionTypesButton.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.scanUnusedCollisionTypesButton.Location = new System.Drawing.Point(345, 110);
this.scanUnusedCollisionTypesButton.Location = new System.Drawing.Point(345, 108);
this.scanUnusedCollisionTypesButton.Name = "scanUnusedCollisionTypesButton";
this.scanUnusedCollisionTypesButton.Size = new System.Drawing.Size(111, 27);
this.scanUnusedCollisionTypesButton.TabIndex = 33;
@@ -3891,9 +3911,9 @@
this.typeGroupBox.Controls.Add(this.collisionTypePainterComboBox);
this.typeGroupBox.Controls.Add(this.typePainterPictureBox);
this.typeGroupBox.Enabled = false;
this.typeGroupBox.Location = new System.Drawing.Point(12, 301);
this.typeGroupBox.Location = new System.Drawing.Point(13, 272);
this.typeGroupBox.Name = "typeGroupBox";
this.typeGroupBox.Size = new System.Drawing.Size(444, 134);
this.typeGroupBox.Size = new System.Drawing.Size(444, 113);
this.typeGroupBox.TabIndex = 25;
this.typeGroupBox.TabStop = false;
this.typeGroupBox.Text = "Type Painter";
@@ -3914,7 +3934,7 @@
// valueTypeRadioButton
//
this.valueTypeRadioButton.AutoSize = true;
this.valueTypeRadioButton.Location = new System.Drawing.Point(135, 78);
this.valueTypeRadioButton.Location = new System.Drawing.Point(341, 19);
this.valueTypeRadioButton.Name = "valueTypeRadioButton";
this.valueTypeRadioButton.Size = new System.Drawing.Size(52, 17);
this.valueTypeRadioButton.TabIndex = 4;
@@ -3926,7 +3946,7 @@
//
this.typePainterUpDown.Enabled = false;
this.typePainterUpDown.Hexadecimal = true;
this.typePainterUpDown.Location = new System.Drawing.Point(134, 101);
this.typePainterUpDown.Location = new System.Drawing.Point(341, 45);
this.typePainterUpDown.Maximum = new decimal(new int[] {
255,
0,
@@ -3945,7 +3965,7 @@
this.collisionTypePainterComboBox.Location = new System.Drawing.Point(135, 44);
this.collisionTypePainterComboBox.MaxDropDownItems = 10;
this.collisionTypePainterComboBox.Name = "collisionTypePainterComboBox";
this.collisionTypePainterComboBox.Size = new System.Drawing.Size(283, 21);
this.collisionTypePainterComboBox.Size = new System.Drawing.Size(200, 21);
this.collisionTypePainterComboBox.TabIndex = 2;
this.collisionTypePainterComboBox.SelectedIndexChanged += new System.EventHandler(this.typePainterComboBox_SelectedIndexChanged);
//
@@ -3955,7 +3975,7 @@
this.typePainterPictureBox.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.typePainterPictureBox.Location = new System.Drawing.Point(18, 31);
this.typePainterPictureBox.Name = "typePainterPictureBox";
this.typePainterPictureBox.Size = new System.Drawing.Size(80, 80);
this.typePainterPictureBox.Size = new System.Drawing.Size(66, 64);
this.typePainterPictureBox.TabIndex = 1;
this.typePainterPictureBox.TabStop = false;
//
@@ -3965,7 +3985,7 @@
this.collisionGroupBox.Controls.Add(this.collisionPainterPictureBox);
this.collisionGroupBox.Location = new System.Drawing.Point(12, 167);
this.collisionGroupBox.Name = "collisionGroupBox";
this.collisionGroupBox.Size = new System.Drawing.Size(444, 118);
this.collisionGroupBox.Size = new System.Drawing.Size(444, 99);
this.collisionGroupBox.TabIndex = 24;
this.collisionGroupBox.TabStop = false;
this.collisionGroupBox.Text = "Collision Painter";
@@ -3974,7 +3994,7 @@
//
this.collisionPainterComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.collisionPainterComboBox.FormattingEnabled = true;
this.collisionPainterComboBox.Location = new System.Drawing.Point(134, 50);
this.collisionPainterComboBox.Location = new System.Drawing.Point(134, 23);
this.collisionPainterComboBox.Name = "collisionPainterComboBox";
this.collisionPainterComboBox.Size = new System.Drawing.Size(284, 21);
this.collisionPainterComboBox.TabIndex = 1;
@@ -3986,7 +4006,7 @@
this.collisionPainterPictureBox.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.collisionPainterPictureBox.Location = new System.Drawing.Point(18, 23);
this.collisionPainterPictureBox.Name = "collisionPainterPictureBox";
this.collisionPainterPictureBox.Size = new System.Drawing.Size(80, 80);
this.collisionPainterPictureBox.Size = new System.Drawing.Size(66, 64);
this.collisionPainterPictureBox.TabIndex = 0;
this.collisionPainterPictureBox.TabStop = false;
//
@@ -10193,7 +10213,8 @@
this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.openROMToolStripMenuItem,
this.openFolderToolStripMenuItem,
this.saveROMToolStripMenuItem});
this.saveROMToolStripMenuItem,
this.settingsToolStripMenuItem});
this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20);
this.fileToolStripMenuItem.Text = "File";
@@ -10226,11 +10247,22 @@
this.saveROMToolStripMenuItem.Text = "Save ROM";
this.saveROMToolStripMenuItem.Click += new System.EventHandler(this.saveRom_Click);
//
// settingsToolStripMenuItem
//
this.settingsToolStripMenuItem.Image = global::DSPRE.Properties.Resources.wrenchIcon;
this.settingsToolStripMenuItem.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;
this.settingsToolStripMenuItem.Name = "settingsToolStripMenuItem";
this.settingsToolStripMenuItem.RightToLeftAutoMirrorImage = true;
this.settingsToolStripMenuItem.Size = new System.Drawing.Size(155, 38);
this.settingsToolStripMenuItem.Text = "Settings";
this.settingsToolStripMenuItem.Click += new System.EventHandler(this.settingsToolStripMenuItem_Click);
//
// aboutToolStripMenuItem
//
this.aboutToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.romToolboxToolStripMenuItem,
this.headerSearchToolStripMenuItem,
this.addressHelperToolStripMenuItem,
this.scriptCommandsDatabaseToolStripMenuItem,
this.NarcUtilityToolStripMenuItem,
this.listBasedBatchRenameToolStripMenuItem,
@@ -10411,6 +10443,14 @@
this.extractNSBTXFromNSBMDToolStripMenuItem.Text = "Save textures from NSBMD";
this.extractNSBTXFromNSBMDToolStripMenuItem.Click += new System.EventHandler(this.nsbmdExportTexButton_Click);
//
// addressHelperToolStripMenuItem
//
this.addressHelperToolStripMenuItem.Enabled = false;
this.addressHelperToolStripMenuItem.Name = "addressHelperToolStripMenuItem";
this.addressHelperToolStripMenuItem.Size = new System.Drawing.Size(220, 22);
this.addressHelperToolStripMenuItem.Text = "Address Helper";
this.addressHelperToolStripMenuItem.Click += new System.EventHandler(this.addressHelperToolStripMenuItem_Click);
//
// menuViewToolStripMenuItem
//
this.menuViewToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
@@ -10425,14 +10465,14 @@
// essentialToolStripMenuItem
//
this.essentialToolStripMenuItem.Name = "essentialToolStripMenuItem";
this.essentialToolStripMenuItem.Size = new System.Drawing.Size(127, 22);
this.essentialToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.essentialToolStripMenuItem.Text = "Essential";
this.essentialToolStripMenuItem.MouseDown += new System.Windows.Forms.MouseEventHandler(this.simpleToolStripMenuItem_MouseDown);
//
// simpleToolStripMenuItem
//
this.simpleToolStripMenuItem.Name = "simpleToolStripMenuItem";
this.simpleToolStripMenuItem.Size = new System.Drawing.Size(127, 22);
this.simpleToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.simpleToolStripMenuItem.Text = "Simple";
this.simpleToolStripMenuItem.MouseDown += new System.Windows.Forms.MouseEventHandler(this.simpleToolStripMenuItem_MouseDown);
//
@@ -10441,14 +10481,14 @@
this.advancedStripMenuItem.Checked = true;
this.advancedStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
this.advancedStripMenuItem.Name = "advancedStripMenuItem";
this.advancedStripMenuItem.Size = new System.Drawing.Size(127, 22);
this.advancedStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.advancedStripMenuItem.Text = "Advanced";
this.advancedStripMenuItem.MouseDown += new System.Windows.Forms.MouseEventHandler(this.simpleToolStripMenuItem_MouseDown);
//
// fullViewToolStripMenuItem
//
this.fullViewToolStripMenuItem.Name = "fullViewToolStripMenuItem";
this.fullViewToolStripMenuItem.Size = new System.Drawing.Size(127, 22);
this.fullViewToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.fullViewToolStripMenuItem.Text = "Complete";
this.fullViewToolStripMenuItem.MouseDown += new System.Windows.Forms.MouseEventHandler(this.simpleToolStripMenuItem_MouseDown);
//
@@ -10762,6 +10802,19 @@
this.separator_afterNsbmdUtils.Name = "separator_afterNsbmdUtils";
this.separator_afterNsbmdUtils.Size = new System.Drawing.Size(6, 44);
//
// weatherMapEditor
//
this.weatherMapEditor.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.weatherMapEditor.Image = global::DSPRE.Properties.Resources.weather_editor;
this.weatherMapEditor.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;
this.weatherMapEditor.ImageTransparentColor = System.Drawing.Color.Magenta;
this.weatherMapEditor.Margin = new System.Windows.Forms.Padding(4, 6, 0, 2);
this.weatherMapEditor.Name = "weatherMapEditor";
this.weatherMapEditor.Size = new System.Drawing.Size(36, 36);
this.weatherMapEditor.Text = "Weather Map Editor";
this.weatherMapEditor.ToolTipText = "Weather Map Editor";
this.weatherMapEditor.Click += new System.EventHandler(this.weatherMapEditor_Click);
//
// buildingEditorButton
//
this.buildingEditorButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
@@ -12002,6 +12055,10 @@
private System.Windows.Forms.ToolStripMenuItem overlayEditorToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem spawnEditorToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem moveDataEditorToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem settingsToolStripMenuItem;
private System.Windows.Forms.ToolStripButton weatherMapEditor;
private System.Windows.Forms.TrackBar transparencyBar;
private System.Windows.Forms.ToolStripMenuItem addressHelperToolStripMenuItem;
}
}

View File

@@ -703,7 +703,8 @@ namespace DSPRE {
private void saveRom_Click(object sender, EventArgs e) {
SaveFileDialog saveRom = new SaveFileDialog {
Filter = DSUtils.NDSRomFilter
Filter = DSUtils.NDSRomFilter,
InitialDirectory = Properties.Settings.Default.exportPath
};
if (saveRom.ShowDialog(this) != DialogResult.OK) {
return;
@@ -711,6 +712,7 @@ namespace DSPRE {
Helpers.statusLabelMessage("Repacking NARCS...");
Update();
var dateBegin = DateTime.Now;
// Repack NARCs
foreach (KeyValuePair<DirNames, (string packedDir, string unpackedDir)> kvp in RomInfo.gameDirs) {
@@ -772,6 +774,40 @@ namespace DSPRE {
Properties.Settings.Default.Save();
Helpers.statusLabelMessage();
var date = DateTime.Now;
var StringDate = formatTime(date.Hour) + ":" + formatTime(date.Minute) + ":" + formatTime(date.Second);
int timeSpent = CalculateTimeDifferenceInSeconds(dateBegin.Hour, dateBegin.Minute, dateBegin.Second, date.Hour, date.Minute, date.Second);
Helpers.statusLabelMessage("Ready - " + StringDate + " | Build time: " + timeSpent.ToString() + "s");
}
static int CalculateTimeDifferenceInSeconds(int startHour, int startMinute, int startSecond, int endHour, int endMinute, int endSecond)
{
// Convert start time and end time to seconds since midnight
int startTimeInSeconds = (startHour * 3600) + (startMinute * 60) + startSecond;
int endTimeInSeconds = (endHour * 3600) + (endMinute * 60) + endSecond;
// Calculate difference
int timeDifference = endTimeInSeconds - startTimeInSeconds;
// If time difference is negative (end time is past midnight), adjust
if (timeDifference < 0)
{
timeDifference += 24 * 3600; // Add 24 hours in seconds
}
return timeDifference;
}
private String formatTime(int time)
{
string stringTime = time.ToString();
if (time < 10)
{
stringTime = "0" + stringTime;
}
return stringTime;
}
private void unpackAllButton_Click(object sender, EventArgs e) {
Helpers.statusLabelMessage("Awaiting user response...");
@@ -3059,6 +3095,7 @@ namespace DSPRE {
/* Permission painters */
public Pen paintPen;
public int Transparency = 128;
public SolidBrush paintBrush;
public SolidBrush textBrush;
public byte paintByte;
@@ -4302,106 +4339,111 @@ namespace DSPRE {
typePainterUpDown_ValueChanged(null, null);
}
}
private void PrepareCollisionPainterGraphics(byte collisionValue) {
switch (collisionValue) {
private void PrepareCollisionPainterGraphics(byte collisionValue)
{
switch (collisionValue)
{
case 0x01: // Snow
paintPen = new Pen(Color.FromArgb(128, Color.Lavender));
paintBrush = new SolidBrush(Color.FromArgb(128, Color.Lavender));
paintPen = new Pen(Color.FromArgb(Transparency, Color.Lavender));
paintBrush = new SolidBrush(Color.FromArgb(Transparency, Color.Lavender));
break;
case 0x02: // Leaves
paintPen = new Pen(Color.FromArgb(128, Color.ForestGreen));
paintBrush = new SolidBrush(Color.FromArgb(128, Color.ForestGreen));
paintPen = new Pen(Color.FromArgb(Transparency, Color.ForestGreen));
paintBrush = new SolidBrush(Color.FromArgb(Transparency, Color.ForestGreen));
break;
case 0x04: // Grass
paintPen = new Pen(Color.FromArgb(128, Color.LimeGreen));
paintBrush = new SolidBrush(Color.FromArgb(128, Color.LimeGreen));
paintPen = new Pen(Color.FromArgb(Transparency, Color.LimeGreen));
paintBrush = new SolidBrush(Color.FromArgb(Transparency, Color.LimeGreen));
break;
case 0x06: // Stairs and ice
paintPen = new Pen(Color.FromArgb(128, Color.PowderBlue));
paintBrush = new SolidBrush(Color.FromArgb(128, Color.PowderBlue));
paintPen = new Pen(Color.FromArgb(Transparency, Color.PowderBlue));
paintBrush = new SolidBrush(Color.FromArgb(Transparency, Color.PowderBlue));
break;
case 0x07: // Metal
paintPen = new Pen(Color.FromArgb(128, Color.Silver));
paintBrush = new SolidBrush(Color.FromArgb(128, Color.Silver));
paintPen = new Pen(Color.FromArgb(Transparency, Color.Silver));
paintBrush = new SolidBrush(Color.FromArgb(Transparency, Color.Silver));
break;
case 0x0A: // Stone
paintPen = new Pen(Color.FromArgb(128, Color.DimGray));
paintBrush = new SolidBrush(Color.FromArgb(128, Color.DimGray));
paintPen = new Pen(Color.FromArgb(Transparency, Color.DimGray));
paintBrush = new SolidBrush(Color.FromArgb(Transparency, Color.DimGray));
break;
case 0x0D: // Wood
paintPen = new Pen(Color.FromArgb(128, Color.SaddleBrown));
paintBrush = new SolidBrush(Color.FromArgb(128, Color.SaddleBrown));
paintPen = new Pen(Color.FromArgb(Transparency, Color.SaddleBrown));
paintBrush = new SolidBrush(Color.FromArgb(Transparency, Color.SaddleBrown));
break;
case 0x80:
paintPen = new Pen(Color.FromArgb(128, Color.Red));
paintBrush = new SolidBrush(Color.FromArgb(128, Color.Red));
paintPen = new Pen(Color.FromArgb(Transparency, Color.Red));
paintBrush = new SolidBrush(Color.FromArgb(Transparency, Color.Red));
break;
default: // 0x00 - Walkeable
paintPen = new Pen(Color.FromArgb(128, Color.White));
paintBrush = new SolidBrush(Color.FromArgb(128, Color.White));
paintPen = new Pen(Color.FromArgb(32, Color.White));
paintBrush = new SolidBrush(Color.FromArgb(32, Color.White));
break;
}
}
private void PrepareTypePainterGraphics(byte typeValue) {
switch (typeValue) {
private void PrepareTypePainterGraphics(byte typeValue)
{
switch (typeValue)
{
case 0x0:
paintPen = new Pen(Color.FromArgb(128, Color.White));
paintBrush = new SolidBrush(Color.FromArgb(128, Color.White));
paintPen = new Pen(Color.FromArgb(32, Color.White));
paintBrush = new SolidBrush(Color.FromArgb(32, Color.White));
textBrush = new SolidBrush(Color.White);
textFont = new Font("Arial", 9.0f);
break;
case 0x2:
paintPen = new Pen(Color.FromArgb(128, Color.LimeGreen));
paintBrush = new SolidBrush(Color.FromArgb(128, Color.LimeGreen));
paintPen = new Pen(Color.FromArgb(Transparency, Color.LimeGreen));
paintBrush = new SolidBrush(Color.FromArgb(Transparency, Color.LimeGreen));
textBrush = new SolidBrush(Color.White);
textFont = new Font("Arial", 9.0f);
break;
case 0x3:
paintPen = new Pen(Color.FromArgb(128, Color.Green));
paintBrush = new SolidBrush(Color.FromArgb(128, Color.Green));
paintPen = new Pen(Color.FromArgb(Transparency, Color.Green));
paintBrush = new SolidBrush(Color.FromArgb(Transparency, Color.Green));
textBrush = new SolidBrush(Color.White);
textFont = new Font("Arial", 9.0f);
break;
case 0x8:
case 0xC:
paintPen = new Pen(Color.FromArgb(128, Color.BurlyWood));
paintBrush = new SolidBrush(Color.FromArgb(128, Color.BurlyWood));
paintPen = new Pen(Color.FromArgb(Transparency, Color.BurlyWood));
paintBrush = new SolidBrush(Color.FromArgb(Transparency, Color.BurlyWood));
textBrush = new SolidBrush(Color.White);
textFont = new Font("Arial", 8.65f);
break;
case 0x10:
paintPen = new Pen(Color.FromArgb(128, Color.SkyBlue));
paintBrush = new SolidBrush(Color.FromArgb(128, Color.SkyBlue));
paintPen = new Pen(Color.FromArgb(Transparency, Color.SkyBlue));
paintBrush = new SolidBrush(Color.FromArgb(Transparency, Color.SkyBlue));
textBrush = new SolidBrush(Color.White);
textFont = new Font("Arial", 9.0f);
break;
case 0x13:
paintPen = new Pen(Color.FromArgb(128, Color.SteelBlue));
paintBrush = new SolidBrush(Color.FromArgb(128, Color.SteelBlue));
paintPen = new Pen(Color.FromArgb(Transparency, Color.SteelBlue));
paintBrush = new SolidBrush(Color.FromArgb(Transparency, Color.SteelBlue));
textBrush = new SolidBrush(Color.White);
textFont = new Font("Arial", 9.0f);
break;
case 0x15:
paintPen = new Pen(Color.FromArgb(128, Color.RoyalBlue));
paintBrush = new SolidBrush(Color.FromArgb(128, Color.RoyalBlue));
paintPen = new Pen(Color.FromArgb(Transparency, Color.RoyalBlue));
paintBrush = new SolidBrush(Color.FromArgb(Transparency, Color.RoyalBlue));
textBrush = new SolidBrush(Color.White);
textFont = new Font("Arial", 9.0f);
break;
case 0x16:
paintPen = new Pen(Color.FromArgb(128, Color.LightSlateGray));
paintBrush = new SolidBrush(Color.FromArgb(128, Color.LightSlateGray));
paintPen = new Pen(Color.FromArgb(Transparency, Color.LightSlateGray));
paintBrush = new SolidBrush(Color.FromArgb(Transparency, Color.LightSlateGray));
textBrush = new SolidBrush(Color.White);
textFont = new Font("Arial", 9.0f);
break;
case 0x20:
paintPen = new Pen(Color.FromArgb(128, Color.Cyan));
paintBrush = new SolidBrush(Color.FromArgb(128, Color.Cyan));
paintPen = new Pen(Color.FromArgb(Transparency, Color.Cyan));
paintBrush = new SolidBrush(Color.FromArgb(Transparency, Color.Cyan));
textBrush = new SolidBrush(Color.Black);
textFont = new Font("Arial", 9.0f);
break;
case 0x21:
paintPen = new Pen(Color.FromArgb(128, Color.PeachPuff));
paintBrush = new SolidBrush(Color.FromArgb(128, Color.PeachPuff));
paintPen = new Pen(Color.FromArgb(Transparency, Color.PeachPuff));
paintBrush = new SolidBrush(Color.FromArgb(Transparency, Color.PeachPuff));
textBrush = new SolidBrush(Color.Black);
textFont = new Font("Arial", 9.0f);
break;
@@ -4409,8 +4451,8 @@ namespace DSPRE {
case 0x31:
case 0x32:
case 0x33:
paintPen = new Pen(Color.FromArgb(128, Color.Red));
paintBrush = new SolidBrush(Color.FromArgb(128, Color.Red));
paintPen = new Pen(Color.FromArgb(Transparency, Color.Red));
paintBrush = new SolidBrush(Color.FromArgb(Transparency, Color.Red));
textBrush = new SolidBrush(Color.White);
textFont = new Font("Arial", 9.0f);
break;
@@ -4426,8 +4468,8 @@ namespace DSPRE {
case 0x39:
case 0x3A:
case 0x3B:
paintPen = new Pen(Color.FromArgb(128, Color.Maroon));
paintBrush = new SolidBrush(Color.FromArgb(128, Color.Maroon));
paintPen = new Pen(Color.FromArgb(Transparency, Color.Maroon));
paintBrush = new SolidBrush(Color.FromArgb(Transparency, Color.Maroon));
textBrush = new SolidBrush(Color.White);
textFont = new Font("Arial", 8.65f);
break;
@@ -4435,21 +4477,21 @@ namespace DSPRE {
case 0x41:
case 0x42:
case 0x43:
paintPen = new Pen(Color.FromArgb(128, Color.Gold));
paintBrush = new SolidBrush(Color.FromArgb(128, Color.Gold));
paintPen = new Pen(Color.FromArgb(Transparency, Color.Gold));
paintBrush = new SolidBrush(Color.FromArgb(Transparency, Color.Gold));
textBrush = new SolidBrush(Color.Black);
textFont = new Font("Arial", 9.0f);
break;
case 0x4B:
case 0x4C:
paintPen = new Pen(Color.FromArgb(128, Color.Sienna));
paintBrush = new SolidBrush(Color.FromArgb(128, Color.Sienna));
paintPen = new Pen(Color.FromArgb(Transparency, Color.Sienna));
paintBrush = new SolidBrush(Color.FromArgb(Transparency, Color.Sienna));
textBrush = new SolidBrush(Color.White);
textFont = new Font("Arial", 9.0f);
break;
case 0x5E:
paintPen = new Pen(Color.FromArgb(128, Color.DarkOrchid));
paintBrush = new SolidBrush(Color.FromArgb(128, Color.DarkOrchid));
paintPen = new Pen(Color.FromArgb(Transparency, Color.DarkOrchid));
paintBrush = new SolidBrush(Color.FromArgb(Transparency, Color.DarkOrchid));
textBrush = new SolidBrush(Color.White);
textFont = new Font("Arial", 8.65f);
break;
@@ -4459,8 +4501,8 @@ namespace DSPRE {
case 0x64:
case 0x65:
case 0x69:
paintPen = new Pen(Color.FromArgb(128, Color.DarkOrchid));
paintBrush = new SolidBrush(Color.FromArgb(128, Color.DarkOrchid));
paintPen = new Pen(Color.FromArgb(Transparency, Color.DarkOrchid));
paintBrush = new SolidBrush(Color.FromArgb(Transparency, Color.DarkOrchid));
textBrush = new SolidBrush(Color.White);
textFont = new Font("Arial", 8.65f);
break;
@@ -4468,34 +4510,34 @@ namespace DSPRE {
case 0x6D:
case 0x6E:
case 0x6F:
paintPen = new Pen(Color.FromArgb(128, Color.DarkOrchid));
paintBrush = new SolidBrush(Color.FromArgb(128, Color.DarkOrchid));
paintPen = new Pen(Color.FromArgb(Transparency, Color.DarkOrchid));
paintBrush = new SolidBrush(Color.FromArgb(Transparency, Color.DarkOrchid));
textBrush = new SolidBrush(Color.White);
textFont = new Font("Arial", 8.65f);
break;
case 0xA1:
case 0xA2:
case 0xA3:
paintPen = new Pen(Color.FromArgb(128, Color.Honeydew));
paintBrush = new SolidBrush(Color.FromArgb(128, Color.Honeydew));
paintPen = new Pen(Color.FromArgb(Transparency, Color.Honeydew));
paintBrush = new SolidBrush(Color.FromArgb(Transparency, Color.Honeydew));
textBrush = new SolidBrush(Color.Black);
textFont = new Font("Arial", 8.65f);
break;
case 0xA4:
paintPen = new Pen(Color.FromArgb(128, Color.Peru));
paintBrush = new SolidBrush(Color.FromArgb(128, Color.Peru));
paintPen = new Pen(Color.FromArgb(Transparency, Color.Peru));
paintBrush = new SolidBrush(Color.FromArgb(Transparency, Color.Peru));
textBrush = new SolidBrush(Color.White);
textFont = new Font("Arial", 8.65f);
break;
case 0xA6:
paintPen = new Pen(Color.FromArgb(128, Color.SeaGreen));
paintBrush = new SolidBrush(Color.FromArgb(128, Color.SeaGreen));
paintPen = new Pen(Color.FromArgb(Transparency, Color.SeaGreen));
paintBrush = new SolidBrush(Color.FromArgb(Transparency, Color.SeaGreen));
textBrush = new SolidBrush(Color.White);
textFont = new Font("Arial", 8.65f);
break;
default:
paintPen = new Pen(Color.FromArgb(128, Color.White));
paintBrush = new SolidBrush(Color.FromArgb(128, Color.White));
paintPen = new Pen(Color.FromArgb(32, Color.White));
paintBrush = new SolidBrush(Color.FromArgb(32, Color.White));
textBrush = new SolidBrush(Color.Black);
textFont = new Font("Arial", 8.65f);
break;
@@ -4704,7 +4746,8 @@ namespace DSPRE {
private void importMapButton_Click(object sender, EventArgs e) {
OpenFileDialog im = new OpenFileDialog {
Filter = MapFile.NSBMDFilter
Filter = "NSBTX File (*.nsbtx)|*.nsbtx",
InitialDirectory = Properties.Settings.Default.mapImportStarterPoint
};
if (im.ShowDialog(this) != DialogResult.OK) {
return;
@@ -9914,5 +9957,42 @@ namespace DSPRE {
Helpers.statusLabelMessage();
Update();
}
private void settingsToolStripMenuItem_Click(object sender, EventArgs e)
{
using (SettingsWindow editor = new SettingsWindow())
editor.ShowDialog();
}
private void weatherMapEditor_Click(object sender, EventArgs e)
{
WeatherEditor form = new WeatherEditor();
form.Show();
}
private void MainProgram_Load(object sender, EventArgs e)
{
transparencyBar.Value = Transparency;
}
private void transparencyBar_Scroll(object sender, EventArgs e)
{
Transparency = transparencyBar.Value;
if (selectCollisionPanel.BackColor == Color.MidnightBlue)
{
DrawCollisionGrid();
}
else
{
DrawTypeGrid();
}
}
private void addressHelperToolStripMenuItem_Click(object sender, EventArgs e)
{
AddressHelper form = new AddressHelper();
form.Show();
}
}
}

View File

@@ -4,11 +4,11 @@ using System.Runtime.InteropServices;
// Le informazioni generali relative a un assembly sono controllate dal seguente
// set di attributi. Modificare i valori di questi attributi per modificare le informazioni
// associate a un assembly.
[assembly: AssemblyTitle("DSPRE Reloaded 1.12.5")]
[assembly: AssemblyTitle("DSPRE Reloaded 1.13")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("DSPRE Reloaded 1.12.5")]
[assembly: AssemblyProduct("DSPRE Reloaded 1.13")]
[assembly: AssemblyCopyright("Copyright © 2023")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
@@ -31,5 +31,5 @@ using System.Runtime.InteropServices;
// È possibile specificare tutti i valori oppure impostare valori predefiniti per i numeri relativi alla revisione e alla build
// usando l'asterisco '*' come illustrato di seguito:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.12.5")]
[assembly: AssemblyFileVersion("1.12.5")]
[assembly: AssemblyVersion("1.13")]
[assembly: AssemblyFileVersion("1.13")]

File diff suppressed because it is too large Load Diff

View File

@@ -739,4 +739,7 @@
<data name="RenameIcon" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\RenameIcon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="weather_editor" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Graphics\Program Icons\weather_editor.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB