mirror of
https://github.com/suloku/BW_tool.git
synced 2026-09-07 08:36:19 -05:00
- Drag and drop save file
- Finished trainer info editor - Actually set data for join avenue - Show sprite in join avenue visitor/shop, but sprite sheet is probably wrong
This commit is contained in:
27
BW_tool/Editors/Join_avenue.Designer.cs
generated
27
BW_tool/Editors/Join_avenue.Designer.cs
generated
@@ -143,6 +143,8 @@ namespace BW_tool
|
||||
private System.Windows.Forms.Label label49;
|
||||
private System.Windows.Forms.ComboBox visitor_country;
|
||||
private System.Windows.Forms.TextBox visitor_name;
|
||||
private System.Windows.Forms.PictureBox shop_pic;
|
||||
private System.Windows.Forms.PictureBox visitor_pic;
|
||||
|
||||
/// <summary>
|
||||
/// Disposes resources used by the form.
|
||||
@@ -184,6 +186,7 @@ namespace BW_tool
|
||||
this.visitor = new System.Windows.Forms.NumericUpDown();
|
||||
this.tabControl1 = new System.Windows.Forms.TabControl();
|
||||
this.tabPage1 = new System.Windows.Forms.TabPage();
|
||||
this.shop_pic = new System.Windows.Forms.PictureBox();
|
||||
this.shop_debug = new System.Windows.Forms.TextBox();
|
||||
this.shop_exp = new System.Windows.Forms.NumericUpDown();
|
||||
this.label34 = new System.Windows.Forms.Label();
|
||||
@@ -294,12 +297,14 @@ namespace BW_tool
|
||||
this.helper_country = new System.Windows.Forms.ComboBox();
|
||||
this.helper_name = new System.Windows.Forms.TextBox();
|
||||
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
||||
this.visitor_pic = new System.Windows.Forms.PictureBox();
|
||||
((System.ComponentModel.ISupportInitialize)(this.rank)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.npc)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.shop)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.visitor)).BeginInit();
|
||||
this.tabControl1.SuspendLayout();
|
||||
this.tabPage1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.shop_pic)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.shop_exp)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.shop_recruit)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.shop_sprite)).BeginInit();
|
||||
@@ -310,6 +315,7 @@ namespace BW_tool
|
||||
this.tabPage4.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.helper_sprite)).BeginInit();
|
||||
this.groupBox1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.visitor_pic)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// Exit_but
|
||||
@@ -486,6 +492,7 @@ namespace BW_tool
|
||||
//
|
||||
// tabPage1
|
||||
//
|
||||
this.tabPage1.Controls.Add(this.shop_pic);
|
||||
this.tabPage1.Controls.Add(this.shop_debug);
|
||||
this.tabPage1.Controls.Add(this.shop_exp);
|
||||
this.tabPage1.Controls.Add(this.label34);
|
||||
@@ -528,6 +535,14 @@ namespace BW_tool
|
||||
this.tabPage1.Text = "Shop";
|
||||
this.tabPage1.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// shop_pic
|
||||
//
|
||||
this.shop_pic.Location = new System.Drawing.Point(346, 88);
|
||||
this.shop_pic.Name = "shop_pic";
|
||||
this.shop_pic.Size = new System.Drawing.Size(32, 32);
|
||||
this.shop_pic.TabIndex = 115;
|
||||
this.shop_pic.TabStop = false;
|
||||
//
|
||||
// shop_debug
|
||||
//
|
||||
this.shop_debug.Location = new System.Drawing.Point(77, 173);
|
||||
@@ -731,6 +746,7 @@ namespace BW_tool
|
||||
this.shop_sprite.Name = "shop_sprite";
|
||||
this.shop_sprite.Size = new System.Drawing.Size(47, 20);
|
||||
this.shop_sprite.TabIndex = 94;
|
||||
this.shop_sprite.ValueChanged += new System.EventHandler(this.Shop_spriteValueChanged);
|
||||
//
|
||||
// label23
|
||||
//
|
||||
@@ -1075,6 +1091,7 @@ namespace BW_tool
|
||||
//
|
||||
// tabPage2
|
||||
//
|
||||
this.tabPage2.Controls.Add(this.visitor_pic);
|
||||
this.tabPage2.Controls.Add(this.visitor_import);
|
||||
this.tabPage2.Controls.Add(this.visitor_export);
|
||||
this.tabPage2.Controls.Add(this.visitor_ishuman);
|
||||
@@ -2748,6 +2765,14 @@ namespace BW_tool
|
||||
this.groupBox1.TabStop = false;
|
||||
this.groupBox1.Text = "Join Avenue";
|
||||
//
|
||||
// visitor_pic
|
||||
//
|
||||
this.visitor_pic.Location = new System.Drawing.Point(346, 88);
|
||||
this.visitor_pic.Name = "visitor_pic";
|
||||
this.visitor_pic.Size = new System.Drawing.Size(32, 32);
|
||||
this.visitor_pic.TabIndex = 151;
|
||||
this.visitor_pic.TabStop = false;
|
||||
//
|
||||
// Join_avenue
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
@@ -2766,6 +2791,7 @@ namespace BW_tool
|
||||
this.tabControl1.ResumeLayout(false);
|
||||
this.tabPage1.ResumeLayout(false);
|
||||
this.tabPage1.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.shop_pic)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.shop_exp)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.shop_recruit)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.shop_sprite)).EndInit();
|
||||
@@ -2780,6 +2806,7 @@ namespace BW_tool
|
||||
((System.ComponentModel.ISupportInitialize)(this.helper_sprite)).EndInit();
|
||||
this.groupBox1.ResumeLayout(false);
|
||||
this.groupBox1.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.visitor_pic)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
@@ -13,6 +13,8 @@ using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using System.Resources;
|
||||
|
||||
namespace BW_tool
|
||||
{
|
||||
@@ -22,7 +24,13 @@ namespace BW_tool
|
||||
public partial class Join_avenue : Form
|
||||
{
|
||||
AVENUE ja;
|
||||
int avenue_block = 67;
|
||||
int avenue_block = 67;
|
||||
|
||||
ResourceManager resources = new ResourceManager("BW_tool.Join_avenue", Assembly.GetExecutingAssembly());
|
||||
Bitmap sprites_data;
|
||||
Rectangle cloneRect;
|
||||
Bitmap cloneBitmap;
|
||||
|
||||
public Join_avenue()
|
||||
{
|
||||
//
|
||||
@@ -101,6 +109,7 @@ namespace BW_tool
|
||||
}
|
||||
void Saveexit_butClick(object sender, EventArgs e)
|
||||
{
|
||||
set_data();
|
||||
MainForm.save.setBlock(ja.Data, avenue_block);
|
||||
this.Close();
|
||||
}
|
||||
@@ -368,6 +377,9 @@ namespace BW_tool
|
||||
}
|
||||
shop_subregion.SelectedIndex = ja.shop[(int)shop.Value].subregion;
|
||||
shop_sprite.Value = ja.shop[(int)shop.Value].sprite;
|
||||
|
||||
load_shop_sprite();
|
||||
|
||||
shop_date.Value = ja.shop[(int)shop.Value].met;
|
||||
shop_recruit.Value = ja.shop[(int)shop.Value].recruitlvl;
|
||||
|
||||
@@ -413,6 +425,51 @@ namespace BW_tool
|
||||
{
|
||||
load_shop();
|
||||
}
|
||||
void load_shop_sprite()
|
||||
{
|
||||
// Create a Bitmap object from a file.
|
||||
sprites_data = (Bitmap)resources.GetObject("sprites");
|
||||
if (((int)shop_sprite.Value) < 32 )
|
||||
{
|
||||
cloneRect = new Rectangle((int)((shop_sprite.Value)*32), 0, 32, 32 );
|
||||
}
|
||||
else if (((int)shop_sprite.Value) < 64 )
|
||||
{
|
||||
cloneRect = new Rectangle((int)((shop_sprite.Value-32)*32), 32, 32, 32 );
|
||||
}
|
||||
else if (((int)shop_sprite.Value) < 96)
|
||||
{
|
||||
cloneRect = new Rectangle((int)((shop_sprite.Value-64)*32), 64, 32, 32 );
|
||||
}
|
||||
else if (((int)shop_sprite.Value) < 128)
|
||||
{
|
||||
cloneRect = new Rectangle((int)((shop_sprite.Value-96)*32), 96, 32, 32 );
|
||||
}
|
||||
else if (((int)shop_sprite.Value) < 160)
|
||||
{
|
||||
cloneRect = new Rectangle((int)((shop_sprite.Value-128)*32), 128, 32, 32 );
|
||||
}
|
||||
else if (((int)shop_sprite.Value) < 192)
|
||||
{
|
||||
cloneRect = new Rectangle((int)((shop_sprite.Value-160)*32), 160, 32, 32 );
|
||||
}
|
||||
else if (((int)shop_sprite.Value) < 224)
|
||||
{
|
||||
cloneRect = new Rectangle((int)((shop_sprite.Value-192)*32), 192, 32, 32 );
|
||||
}
|
||||
else if (((int)shop_sprite.Value) < 256)
|
||||
{
|
||||
cloneRect = new Rectangle((int)((shop_sprite.Value-224)*32), 224, 32, 32 );
|
||||
}
|
||||
|
||||
|
||||
cloneBitmap = sprites_data.Clone(cloneRect, sprites_data.PixelFormat);
|
||||
shop_pic.Image = cloneBitmap;
|
||||
}
|
||||
void Shop_spriteValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
load_shop_sprite();
|
||||
}
|
||||
|
||||
//VISITOR
|
||||
void Visitor_countrySelectedIndexChanged(object sender, EventArgs e)
|
||||
@@ -547,6 +604,8 @@ namespace BW_tool
|
||||
}
|
||||
}
|
||||
visitor_sprite.Value = ja.visitor[(int)visitor.Value].sprite;
|
||||
load_visitor_sprite();
|
||||
|
||||
visitor_date.Value = ja.visitor[(int)visitor.Value].met;
|
||||
visitor_recruit.Value = ja.visitor[(int)visitor.Value].recruitlvl;
|
||||
|
||||
@@ -598,6 +657,47 @@ namespace BW_tool
|
||||
{
|
||||
FileIO.save_file(ja.visitor[(int)visitor.Value].Data, "Poke JoinAvenue Visitor|*.pjv|All Files (*.*)|*.*");
|
||||
}
|
||||
void load_visitor_sprite()
|
||||
{
|
||||
// Create a Bitmap object from a file.
|
||||
sprites_data = (Bitmap)resources.GetObject("sprites");
|
||||
if (((int)visitor_sprite.Value) < 32 )
|
||||
{
|
||||
cloneRect = new Rectangle((int)((visitor_sprite.Value)*32), 0, 32, 32 );
|
||||
}
|
||||
else if (((int)visitor_sprite.Value) < 64 )
|
||||
{
|
||||
cloneRect = new Rectangle((int)((visitor_sprite.Value-32)*32), 32, 32, 32 );
|
||||
}
|
||||
else if (((int)visitor_sprite.Value) < 96)
|
||||
{
|
||||
cloneRect = new Rectangle((int)((visitor_sprite.Value-64)*32), 64, 32, 32 );
|
||||
}
|
||||
else if (((int)visitor_sprite.Value) < 128)
|
||||
{
|
||||
cloneRect = new Rectangle((int)((visitor_sprite.Value-96)*32), 96, 32, 32 );
|
||||
}
|
||||
else if (((int)visitor_sprite.Value) < 160)
|
||||
{
|
||||
cloneRect = new Rectangle((int)((visitor_sprite.Value-128)*32), 128, 32, 32 );
|
||||
}
|
||||
else if (((int)visitor_sprite.Value) < 192)
|
||||
{
|
||||
cloneRect = new Rectangle((int)((visitor_sprite.Value-160)*32), 160, 32, 32 );
|
||||
}
|
||||
else if (((int)visitor_sprite.Value) < 224)
|
||||
{
|
||||
cloneRect = new Rectangle((int)((visitor_sprite.Value-192)*32), 192, 32, 32 );
|
||||
}
|
||||
else if (((int)visitor_sprite.Value) < 256)
|
||||
{
|
||||
cloneRect = new Rectangle((int)((visitor_sprite.Value-224)*32), 224, 32, 32 );
|
||||
}
|
||||
|
||||
|
||||
cloneBitmap = sprites_data.Clone(cloneRect, sprites_data.PixelFormat);
|
||||
visitor_pic.Image = cloneBitmap;
|
||||
}
|
||||
|
||||
public class AVENUE
|
||||
{
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
270
BW_tool/Editors/TrainerInfo.Designer.cs
generated
270
BW_tool/Editors/TrainerInfo.Designer.cs
generated
@@ -17,7 +17,7 @@ namespace BW_tool
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.Label label4;
|
||||
private System.Windows.Forms.Label rival_label;
|
||||
private System.Windows.Forms.Label label5;
|
||||
private System.Windows.Forms.Label label6;
|
||||
private System.Windows.Forms.Label label7;
|
||||
@@ -43,20 +43,20 @@ namespace BW_tool
|
||||
private System.Windows.Forms.Button Saveexit_but;
|
||||
private System.Windows.Forms.CheckBox badge1;
|
||||
private System.Windows.Forms.DateTimePicker badge1_date;
|
||||
private System.Windows.Forms.DateTimePicker dateTimePicker1;
|
||||
private System.Windows.Forms.CheckBox checkBox1;
|
||||
private System.Windows.Forms.DateTimePicker dateTimePicker2;
|
||||
private System.Windows.Forms.CheckBox checkBox2;
|
||||
private System.Windows.Forms.DateTimePicker dateTimePicker3;
|
||||
private System.Windows.Forms.CheckBox checkBox3;
|
||||
private System.Windows.Forms.DateTimePicker dateTimePicker4;
|
||||
private System.Windows.Forms.CheckBox checkBox4;
|
||||
private System.Windows.Forms.DateTimePicker dateTimePicker5;
|
||||
private System.Windows.Forms.CheckBox checkBox5;
|
||||
private System.Windows.Forms.DateTimePicker dateTimePicker6;
|
||||
private System.Windows.Forms.CheckBox checkBox6;
|
||||
private System.Windows.Forms.DateTimePicker dateTimePicker7;
|
||||
private System.Windows.Forms.CheckBox checkBox7;
|
||||
private System.Windows.Forms.DateTimePicker badge2_date;
|
||||
private System.Windows.Forms.CheckBox badge2;
|
||||
private System.Windows.Forms.DateTimePicker badge3_date;
|
||||
private System.Windows.Forms.CheckBox badge3;
|
||||
private System.Windows.Forms.DateTimePicker badge4_date;
|
||||
private System.Windows.Forms.CheckBox badge4;
|
||||
private System.Windows.Forms.DateTimePicker badge5_date;
|
||||
private System.Windows.Forms.CheckBox badge5;
|
||||
private System.Windows.Forms.DateTimePicker badge6_date;
|
||||
private System.Windows.Forms.CheckBox badge6;
|
||||
private System.Windows.Forms.DateTimePicker badge7_date;
|
||||
private System.Windows.Forms.CheckBox badge7;
|
||||
private System.Windows.Forms.DateTimePicker badge8_date;
|
||||
private System.Windows.Forms.CheckBox badge8;
|
||||
|
||||
/// <summary>
|
||||
/// Disposes resources used by the form.
|
||||
@@ -82,7 +82,7 @@ namespace BW_tool
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.rival_label = new System.Windows.Forms.Label();
|
||||
this.label5 = new System.Windows.Forms.Label();
|
||||
this.label6 = new System.Windows.Forms.Label();
|
||||
this.label7 = new System.Windows.Forms.Label();
|
||||
@@ -108,20 +108,20 @@ namespace BW_tool
|
||||
this.Saveexit_but = new System.Windows.Forms.Button();
|
||||
this.badge1 = new System.Windows.Forms.CheckBox();
|
||||
this.badge1_date = new System.Windows.Forms.DateTimePicker();
|
||||
this.dateTimePicker1 = new System.Windows.Forms.DateTimePicker();
|
||||
this.checkBox1 = new System.Windows.Forms.CheckBox();
|
||||
this.dateTimePicker2 = new System.Windows.Forms.DateTimePicker();
|
||||
this.checkBox2 = new System.Windows.Forms.CheckBox();
|
||||
this.dateTimePicker3 = new System.Windows.Forms.DateTimePicker();
|
||||
this.checkBox3 = new System.Windows.Forms.CheckBox();
|
||||
this.dateTimePicker4 = new System.Windows.Forms.DateTimePicker();
|
||||
this.checkBox4 = new System.Windows.Forms.CheckBox();
|
||||
this.dateTimePicker5 = new System.Windows.Forms.DateTimePicker();
|
||||
this.checkBox5 = new System.Windows.Forms.CheckBox();
|
||||
this.dateTimePicker6 = new System.Windows.Forms.DateTimePicker();
|
||||
this.checkBox6 = new System.Windows.Forms.CheckBox();
|
||||
this.dateTimePicker7 = new System.Windows.Forms.DateTimePicker();
|
||||
this.checkBox7 = new System.Windows.Forms.CheckBox();
|
||||
this.badge2_date = new System.Windows.Forms.DateTimePicker();
|
||||
this.badge2 = new System.Windows.Forms.CheckBox();
|
||||
this.badge3_date = new System.Windows.Forms.DateTimePicker();
|
||||
this.badge3 = new System.Windows.Forms.CheckBox();
|
||||
this.badge4_date = new System.Windows.Forms.DateTimePicker();
|
||||
this.badge4 = new System.Windows.Forms.CheckBox();
|
||||
this.badge5_date = new System.Windows.Forms.DateTimePicker();
|
||||
this.badge5 = new System.Windows.Forms.CheckBox();
|
||||
this.badge6_date = new System.Windows.Forms.DateTimePicker();
|
||||
this.badge6 = new System.Windows.Forms.CheckBox();
|
||||
this.badge7_date = new System.Windows.Forms.DateTimePicker();
|
||||
this.badge7 = new System.Windows.Forms.CheckBox();
|
||||
this.badge8_date = new System.Windows.Forms.DateTimePicker();
|
||||
this.badge8 = new System.Windows.Forms.CheckBox();
|
||||
this.groupBox1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.seconds)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.minutes)).BeginInit();
|
||||
@@ -156,13 +156,13 @@ namespace BW_tool
|
||||
this.label3.TabIndex = 2;
|
||||
this.label3.Text = "SID";
|
||||
//
|
||||
// label4
|
||||
// rival_label
|
||||
//
|
||||
this.label4.Location = new System.Drawing.Point(14, 268);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(51, 23);
|
||||
this.label4.TabIndex = 3;
|
||||
this.label4.Text = "Rival";
|
||||
this.rival_label.Location = new System.Drawing.Point(14, 268);
|
||||
this.rival_label.Name = "rival_label";
|
||||
this.rival_label.Size = new System.Drawing.Size(51, 23);
|
||||
this.rival_label.TabIndex = 3;
|
||||
this.rival_label.Text = "Rival";
|
||||
//
|
||||
// label5
|
||||
//
|
||||
@@ -441,137 +441,137 @@ namespace BW_tool
|
||||
this.badge1_date.Size = new System.Drawing.Size(200, 20);
|
||||
this.badge1_date.TabIndex = 21;
|
||||
//
|
||||
// dateTimePicker1
|
||||
// badge2_date
|
||||
//
|
||||
this.dateTimePicker1.Location = new System.Drawing.Point(317, 153);
|
||||
this.dateTimePicker1.Name = "dateTimePicker1";
|
||||
this.dateTimePicker1.Size = new System.Drawing.Size(200, 20);
|
||||
this.dateTimePicker1.TabIndex = 23;
|
||||
this.badge2_date.Location = new System.Drawing.Point(317, 153);
|
||||
this.badge2_date.Name = "badge2_date";
|
||||
this.badge2_date.Size = new System.Drawing.Size(200, 20);
|
||||
this.badge2_date.TabIndex = 23;
|
||||
//
|
||||
// checkBox1
|
||||
// badge2
|
||||
//
|
||||
this.checkBox1.Location = new System.Drawing.Point(250, 152);
|
||||
this.checkBox1.Name = "checkBox1";
|
||||
this.checkBox1.Size = new System.Drawing.Size(125, 29);
|
||||
this.checkBox1.TabIndex = 22;
|
||||
this.checkBox1.Text = "Badge 1";
|
||||
this.checkBox1.UseVisualStyleBackColor = true;
|
||||
this.badge2.Location = new System.Drawing.Point(250, 152);
|
||||
this.badge2.Name = "badge2";
|
||||
this.badge2.Size = new System.Drawing.Size(125, 29);
|
||||
this.badge2.TabIndex = 22;
|
||||
this.badge2.Text = "Badge 2";
|
||||
this.badge2.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// dateTimePicker2
|
||||
// badge3_date
|
||||
//
|
||||
this.dateTimePicker2.Location = new System.Drawing.Point(317, 179);
|
||||
this.dateTimePicker2.Name = "dateTimePicker2";
|
||||
this.dateTimePicker2.Size = new System.Drawing.Size(200, 20);
|
||||
this.dateTimePicker2.TabIndex = 25;
|
||||
this.badge3_date.Location = new System.Drawing.Point(317, 179);
|
||||
this.badge3_date.Name = "badge3_date";
|
||||
this.badge3_date.Size = new System.Drawing.Size(200, 20);
|
||||
this.badge3_date.TabIndex = 25;
|
||||
//
|
||||
// checkBox2
|
||||
// badge3
|
||||
//
|
||||
this.checkBox2.Location = new System.Drawing.Point(250, 178);
|
||||
this.checkBox2.Name = "checkBox2";
|
||||
this.checkBox2.Size = new System.Drawing.Size(125, 29);
|
||||
this.checkBox2.TabIndex = 24;
|
||||
this.checkBox2.Text = "Badge 1";
|
||||
this.checkBox2.UseVisualStyleBackColor = true;
|
||||
this.badge3.Location = new System.Drawing.Point(250, 178);
|
||||
this.badge3.Name = "badge3";
|
||||
this.badge3.Size = new System.Drawing.Size(125, 29);
|
||||
this.badge3.TabIndex = 24;
|
||||
this.badge3.Text = "Badge 3";
|
||||
this.badge3.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// dateTimePicker3
|
||||
// badge4_date
|
||||
//
|
||||
this.dateTimePicker3.Location = new System.Drawing.Point(317, 205);
|
||||
this.dateTimePicker3.Name = "dateTimePicker3";
|
||||
this.dateTimePicker3.Size = new System.Drawing.Size(200, 20);
|
||||
this.dateTimePicker3.TabIndex = 27;
|
||||
this.badge4_date.Location = new System.Drawing.Point(317, 205);
|
||||
this.badge4_date.Name = "badge4_date";
|
||||
this.badge4_date.Size = new System.Drawing.Size(200, 20);
|
||||
this.badge4_date.TabIndex = 27;
|
||||
//
|
||||
// checkBox3
|
||||
// badge4
|
||||
//
|
||||
this.checkBox3.Location = new System.Drawing.Point(250, 204);
|
||||
this.checkBox3.Name = "checkBox3";
|
||||
this.checkBox3.Size = new System.Drawing.Size(125, 29);
|
||||
this.checkBox3.TabIndex = 26;
|
||||
this.checkBox3.Text = "Badge 1";
|
||||
this.checkBox3.UseVisualStyleBackColor = true;
|
||||
this.badge4.Location = new System.Drawing.Point(250, 204);
|
||||
this.badge4.Name = "badge4";
|
||||
this.badge4.Size = new System.Drawing.Size(125, 29);
|
||||
this.badge4.TabIndex = 26;
|
||||
this.badge4.Text = "Badge 4";
|
||||
this.badge4.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// dateTimePicker4
|
||||
// badge5_date
|
||||
//
|
||||
this.dateTimePicker4.Location = new System.Drawing.Point(317, 231);
|
||||
this.dateTimePicker4.Name = "dateTimePicker4";
|
||||
this.dateTimePicker4.Size = new System.Drawing.Size(200, 20);
|
||||
this.dateTimePicker4.TabIndex = 29;
|
||||
this.badge5_date.Location = new System.Drawing.Point(317, 231);
|
||||
this.badge5_date.Name = "badge5_date";
|
||||
this.badge5_date.Size = new System.Drawing.Size(200, 20);
|
||||
this.badge5_date.TabIndex = 29;
|
||||
//
|
||||
// checkBox4
|
||||
// badge5
|
||||
//
|
||||
this.checkBox4.Location = new System.Drawing.Point(250, 230);
|
||||
this.checkBox4.Name = "checkBox4";
|
||||
this.checkBox4.Size = new System.Drawing.Size(125, 29);
|
||||
this.checkBox4.TabIndex = 28;
|
||||
this.checkBox4.Text = "Badge 1";
|
||||
this.checkBox4.UseVisualStyleBackColor = true;
|
||||
this.badge5.Location = new System.Drawing.Point(250, 230);
|
||||
this.badge5.Name = "badge5";
|
||||
this.badge5.Size = new System.Drawing.Size(125, 29);
|
||||
this.badge5.TabIndex = 28;
|
||||
this.badge5.Text = "Badge 5";
|
||||
this.badge5.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// dateTimePicker5
|
||||
// badge6_date
|
||||
//
|
||||
this.dateTimePicker5.Location = new System.Drawing.Point(317, 257);
|
||||
this.dateTimePicker5.Name = "dateTimePicker5";
|
||||
this.dateTimePicker5.Size = new System.Drawing.Size(200, 20);
|
||||
this.dateTimePicker5.TabIndex = 31;
|
||||
this.badge6_date.Location = new System.Drawing.Point(317, 257);
|
||||
this.badge6_date.Name = "badge6_date";
|
||||
this.badge6_date.Size = new System.Drawing.Size(200, 20);
|
||||
this.badge6_date.TabIndex = 31;
|
||||
//
|
||||
// checkBox5
|
||||
// badge6
|
||||
//
|
||||
this.checkBox5.Location = new System.Drawing.Point(250, 256);
|
||||
this.checkBox5.Name = "checkBox5";
|
||||
this.checkBox5.Size = new System.Drawing.Size(125, 29);
|
||||
this.checkBox5.TabIndex = 30;
|
||||
this.checkBox5.Text = "Badge 1";
|
||||
this.checkBox5.UseVisualStyleBackColor = true;
|
||||
this.badge6.Location = new System.Drawing.Point(250, 256);
|
||||
this.badge6.Name = "badge6";
|
||||
this.badge6.Size = new System.Drawing.Size(125, 29);
|
||||
this.badge6.TabIndex = 30;
|
||||
this.badge6.Text = "Badge 6";
|
||||
this.badge6.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// dateTimePicker6
|
||||
// badge7_date
|
||||
//
|
||||
this.dateTimePicker6.Location = new System.Drawing.Point(317, 283);
|
||||
this.dateTimePicker6.Name = "dateTimePicker6";
|
||||
this.dateTimePicker6.Size = new System.Drawing.Size(200, 20);
|
||||
this.dateTimePicker6.TabIndex = 33;
|
||||
this.badge7_date.Location = new System.Drawing.Point(317, 283);
|
||||
this.badge7_date.Name = "badge7_date";
|
||||
this.badge7_date.Size = new System.Drawing.Size(200, 20);
|
||||
this.badge7_date.TabIndex = 33;
|
||||
//
|
||||
// checkBox6
|
||||
// badge7
|
||||
//
|
||||
this.checkBox6.Location = new System.Drawing.Point(250, 282);
|
||||
this.checkBox6.Name = "checkBox6";
|
||||
this.checkBox6.Size = new System.Drawing.Size(125, 29);
|
||||
this.checkBox6.TabIndex = 32;
|
||||
this.checkBox6.Text = "Badge 1";
|
||||
this.checkBox6.UseVisualStyleBackColor = true;
|
||||
this.badge7.Location = new System.Drawing.Point(250, 282);
|
||||
this.badge7.Name = "badge7";
|
||||
this.badge7.Size = new System.Drawing.Size(125, 29);
|
||||
this.badge7.TabIndex = 32;
|
||||
this.badge7.Text = "Badge 7";
|
||||
this.badge7.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// dateTimePicker7
|
||||
// badge8_date
|
||||
//
|
||||
this.dateTimePicker7.Location = new System.Drawing.Point(317, 309);
|
||||
this.dateTimePicker7.Name = "dateTimePicker7";
|
||||
this.dateTimePicker7.Size = new System.Drawing.Size(200, 20);
|
||||
this.dateTimePicker7.TabIndex = 35;
|
||||
this.badge8_date.Location = new System.Drawing.Point(317, 309);
|
||||
this.badge8_date.Name = "badge8_date";
|
||||
this.badge8_date.Size = new System.Drawing.Size(200, 20);
|
||||
this.badge8_date.TabIndex = 35;
|
||||
//
|
||||
// checkBox7
|
||||
// badge8
|
||||
//
|
||||
this.checkBox7.Location = new System.Drawing.Point(250, 308);
|
||||
this.checkBox7.Name = "checkBox7";
|
||||
this.checkBox7.Size = new System.Drawing.Size(125, 29);
|
||||
this.checkBox7.TabIndex = 34;
|
||||
this.checkBox7.Text = "Badge 1";
|
||||
this.checkBox7.UseVisualStyleBackColor = true;
|
||||
this.badge8.Location = new System.Drawing.Point(250, 308);
|
||||
this.badge8.Name = "badge8";
|
||||
this.badge8.Size = new System.Drawing.Size(125, 29);
|
||||
this.badge8.TabIndex = 34;
|
||||
this.badge8.Text = "Badge 8";
|
||||
this.badge8.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// TrainerInfo
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(529, 348);
|
||||
this.Controls.Add(this.dateTimePicker7);
|
||||
this.Controls.Add(this.checkBox7);
|
||||
this.Controls.Add(this.dateTimePicker6);
|
||||
this.Controls.Add(this.checkBox6);
|
||||
this.Controls.Add(this.dateTimePicker5);
|
||||
this.Controls.Add(this.checkBox5);
|
||||
this.Controls.Add(this.dateTimePicker4);
|
||||
this.Controls.Add(this.checkBox4);
|
||||
this.Controls.Add(this.dateTimePicker3);
|
||||
this.Controls.Add(this.checkBox3);
|
||||
this.Controls.Add(this.dateTimePicker2);
|
||||
this.Controls.Add(this.checkBox2);
|
||||
this.Controls.Add(this.dateTimePicker1);
|
||||
this.Controls.Add(this.checkBox1);
|
||||
this.Controls.Add(this.badge8_date);
|
||||
this.Controls.Add(this.badge8);
|
||||
this.Controls.Add(this.badge7_date);
|
||||
this.Controls.Add(this.badge7);
|
||||
this.Controls.Add(this.badge6_date);
|
||||
this.Controls.Add(this.badge6);
|
||||
this.Controls.Add(this.badge5_date);
|
||||
this.Controls.Add(this.badge5);
|
||||
this.Controls.Add(this.badge4_date);
|
||||
this.Controls.Add(this.badge4);
|
||||
this.Controls.Add(this.badge3_date);
|
||||
this.Controls.Add(this.badge3);
|
||||
this.Controls.Add(this.badge2_date);
|
||||
this.Controls.Add(this.badge2);
|
||||
this.Controls.Add(this.badge1_date);
|
||||
this.Controls.Add(this.badge1);
|
||||
this.Controls.Add(this.Exit_but);
|
||||
@@ -591,7 +591,7 @@ namespace BW_tool
|
||||
this.Controls.Add(this.label7);
|
||||
this.Controls.Add(this.label6);
|
||||
this.Controls.Add(this.label5);
|
||||
this.Controls.Add(this.label4);
|
||||
this.Controls.Add(this.rival_label);
|
||||
this.Controls.Add(this.label3);
|
||||
this.Controls.Add(this.label2);
|
||||
this.Controls.Add(this.label1);
|
||||
|
||||
@@ -39,12 +39,24 @@ namespace BW_tool
|
||||
money.Maximum = 9999999;
|
||||
bp.Maximum = 9999;
|
||||
|
||||
if (MainForm.save.B2W2 == false) //BW1 battle points are in another block
|
||||
{
|
||||
battle_block = 58;
|
||||
battle = new BATTLE(MainForm.save.getBlock(battle_block), 1);
|
||||
rival_name.Visible = false;
|
||||
rival_label.Visible = false;
|
||||
}
|
||||
else //B2W2
|
||||
{
|
||||
battle = new BATTLE(MainForm.save.getBlock(battle_block));
|
||||
gary = new RIVAL(MainForm.save.getBlock(rival_block));
|
||||
}
|
||||
|
||||
//Common data
|
||||
ash = new TRAINER(MainForm.save.getBlock(trainer_block));
|
||||
gary = new RIVAL(MainForm.save.getBlock(rival_block));
|
||||
badge = new BADGES(MainForm.save.getBlock(badges_block));
|
||||
battle = new BATTLE(MainForm.save.getBlock(battle_block));
|
||||
card = new CARDSIG(MainForm.save.getBlock(cardsig_block));
|
||||
|
||||
|
||||
load_data();
|
||||
|
||||
//
|
||||
@@ -55,7 +67,10 @@ namespace BW_tool
|
||||
void load_data()
|
||||
{
|
||||
name.Text = ash.name;
|
||||
rival_name.Text = gary.name;
|
||||
if (MainForm.save.B2W2 == true)
|
||||
{
|
||||
rival_name.Text = gary.name;
|
||||
}
|
||||
|
||||
tid.Value = ash.TID;
|
||||
sid.Value = ash.SID;
|
||||
@@ -102,14 +117,34 @@ namespace BW_tool
|
||||
tnr_nature.SelectedIndex = card.nature;
|
||||
|
||||
badge1.Checked = badge.badge1;
|
||||
badge1_date.Value = card.badge1;
|
||||
badge2.Checked = badge.badge2;
|
||||
badge3.Checked = badge.badge3;
|
||||
badge4.Checked = badge.badge4;
|
||||
badge5.Checked = badge.badge5;
|
||||
badge6.Checked = badge.badge6;
|
||||
badge7.Checked = badge.badge7;
|
||||
badge8.Checked = badge.badge8;
|
||||
|
||||
badge1_date.Value = card.get_badge(0);
|
||||
badge2_date.Value = card.get_badge(1);
|
||||
badge3_date.Value = card.get_badge(2);
|
||||
badge4_date.Value = card.get_badge(3);
|
||||
badge5_date.Value = card.get_badge(4);
|
||||
badge6_date.Value = card.get_badge(5);
|
||||
badge7_date.Value = card.get_badge(6);
|
||||
badge8_date.Value = card.get_badge(7);
|
||||
|
||||
|
||||
}
|
||||
|
||||
void set_data()
|
||||
{
|
||||
ash.name = name.Text;
|
||||
gary.name = rival_name.Text;
|
||||
|
||||
if (MainForm.save.B2W2 == true)
|
||||
{
|
||||
gary.name = rival_name.Text;
|
||||
}
|
||||
|
||||
ash.TID = (UInt16)tid.Value;
|
||||
ash.SID = (UInt16)sid.Value;
|
||||
@@ -133,7 +168,23 @@ namespace BW_tool
|
||||
card.nature = (byte)tnr_nature.SelectedIndex;
|
||||
|
||||
|
||||
badge.badge1 = badge1.Checked;
|
||||
badge.badge2 = badge2.Checked;
|
||||
badge.badge3 = badge3.Checked;
|
||||
badge.badge4 = badge4.Checked;
|
||||
badge.badge5 = badge5.Checked;
|
||||
badge.badge6 = badge6.Checked;
|
||||
badge.badge7 = badge7.Checked;
|
||||
badge.badge8 = badge8.Checked;
|
||||
|
||||
card.set_badge(badge1_date.Value, 0);
|
||||
card.set_badge(badge2_date.Value, 1);
|
||||
card.set_badge(badge3_date.Value, 2);
|
||||
card.set_badge(badge4_date.Value, 3);
|
||||
card.set_badge(badge5_date.Value, 4);
|
||||
card.set_badge(badge6_date.Value, 5);
|
||||
card.set_badge(badge7_date.Value, 6);
|
||||
card.set_badge(badge8_date.Value, 7);
|
||||
}
|
||||
void Exit_butClick(object sender, EventArgs e)
|
||||
{
|
||||
@@ -142,7 +193,10 @@ namespace BW_tool
|
||||
void Saveexit_butClick(object sender, EventArgs e)
|
||||
{
|
||||
MainForm.save.setBlock(ash.Data, trainer_block);
|
||||
MainForm.save.setBlock(gary.Data, rival_block);
|
||||
if (MainForm.save.B2W2 == true)
|
||||
{
|
||||
MainForm.save.setBlock(gary.Data, rival_block);
|
||||
}
|
||||
MainForm.save.setBlock(badge.Data, badges_block);
|
||||
MainForm.save.setBlock(battle.Data, badges_block);
|
||||
MainForm.save.setBlock(card.Data, badges_block);
|
||||
@@ -381,15 +435,140 @@ namespace BW_tool
|
||||
Data[0x4] =(byte)(Data[0x4]|~0x1);
|
||||
}
|
||||
}
|
||||
public bool badge2
|
||||
{
|
||||
get
|
||||
{
|
||||
if ((Data[0x4] & 0x2) != 0)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value == true)
|
||||
Data[0x4] = (byte)(Data[0x4]|0x2);
|
||||
else
|
||||
Data[0x4] =(byte)(Data[0x4]|~0x2);
|
||||
}
|
||||
}
|
||||
public bool badge3
|
||||
{
|
||||
get
|
||||
{
|
||||
if ((Data[0x4] & 0x4) != 0)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value == true)
|
||||
Data[0x4] = (byte)(Data[0x4]|0x4);
|
||||
else
|
||||
Data[0x4] =(byte)(Data[0x4]|~0x4);
|
||||
}
|
||||
}
|
||||
public bool badge4
|
||||
{
|
||||
get
|
||||
{
|
||||
if ((Data[0x4] & 0x8) != 0)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value == true)
|
||||
Data[0x4] = (byte)(Data[0x4]|0x8);
|
||||
else
|
||||
Data[0x4] =(byte)(Data[0x4]|~0x8);
|
||||
}
|
||||
}
|
||||
public bool badge5
|
||||
{
|
||||
get
|
||||
{
|
||||
if ((Data[0x4] & 0x10) != 0)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value == true)
|
||||
Data[0x4] = (byte)(Data[0x4]|0x10);
|
||||
else
|
||||
Data[0x4] =(byte)(Data[0x4]|~0x10);
|
||||
}
|
||||
}
|
||||
public bool badge6
|
||||
{
|
||||
get
|
||||
{
|
||||
if ((Data[0x4] & 0x20) != 0)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value == true)
|
||||
Data[0x4] = (byte)(Data[0x4]|0x20);
|
||||
else
|
||||
Data[0x4] =(byte)(Data[0x4]|~0x20);
|
||||
}
|
||||
}
|
||||
public bool badge7
|
||||
{
|
||||
get
|
||||
{
|
||||
if ((Data[0x4] & 0x40) != 0)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value == true)
|
||||
Data[0x4] = (byte)(Data[0x4]|0x40);
|
||||
else
|
||||
Data[0x4] =(byte)(Data[0x4]|~0x40);
|
||||
}
|
||||
}
|
||||
public bool badge8
|
||||
{
|
||||
get
|
||||
{
|
||||
if ((Data[0x4] & 0x80) != 0)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value == true)
|
||||
Data[0x4] = (byte)(Data[0x4]|0x80);
|
||||
else
|
||||
Data[0x4] =(byte)(Data[0x4]|~0x80);
|
||||
}
|
||||
}
|
||||
}
|
||||
public class BATTLE
|
||||
{
|
||||
internal int Size = MainForm.save.getBlockLength(57);//Block 57 BW2
|
||||
internal int SizeBW2 = MainForm.save.getBlockLength(57);//Block 57 BW2
|
||||
internal int SizeBW = MainForm.save.getBlockLength(58);//Block 58 BW
|
||||
|
||||
public byte[] Data;
|
||||
public BATTLE(byte[] data = null)
|
||||
{
|
||||
Data = data ?? new byte[Size];
|
||||
Data = data ?? new byte[SizeBW2];
|
||||
|
||||
}
|
||||
public BATTLE(byte[] data = null, int bw = 1)
|
||||
{
|
||||
Data = data ?? new byte[SizeBW];
|
||||
|
||||
}
|
||||
public byte[] getData(int Offset, int Length)
|
||||
@@ -420,8 +599,7 @@ namespace BW_tool
|
||||
public byte[] Data;
|
||||
public CARDSIG(byte[] data = null)
|
||||
{
|
||||
Data = data ?? new byte[Size];
|
||||
|
||||
Data = data ?? new byte[Size];
|
||||
}
|
||||
public byte[] getData(int Offset, int Length)
|
||||
{
|
||||
@@ -443,29 +621,24 @@ namespace BW_tool
|
||||
Data[0x600] = (byte) value;
|
||||
}
|
||||
}
|
||||
|
||||
public DateTime badge1
|
||||
public DateTime get_badge(int index)
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Data[0x604] != 0 && Data[0x605] != 0 && Data[0x606] != 0)
|
||||
return new DateTime(2000+Data[0x604], Data[0x605], Data[0x606]);
|
||||
if (Data[0x604 + (4*index)] != 0 && Data[0x605 + (4*index)] != 0 && Data[0x606 + (4*index)] != 0)
|
||||
return new DateTime(2000+Data[0x604 + (4*index)], Data[0x605 + (4*index)], Data[0x606 + (4*index)]);
|
||||
else
|
||||
return new DateTime(2000, 1, 1);
|
||||
}
|
||||
set
|
||||
{
|
||||
if(value == new DateTime(2000, 1, 1))
|
||||
{
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
Data[0x604] = (byte) (value.Year-2000);
|
||||
Data[0x605] = (byte) value.Month;
|
||||
Data[0x606] = (byte) value.Day;
|
||||
}
|
||||
}
|
||||
}
|
||||
public void set_badge(DateTime date, int index)
|
||||
{
|
||||
Data[0x604 + (4*index)] = (byte) (date.Year-2000);
|
||||
Data[0x605 + (4*index)] = (byte) date.Month;
|
||||
Data[0x606 + (4*index)] = (byte) date.Day;
|
||||
}
|
||||
public void del_badge(int index)
|
||||
{
|
||||
Data[0x604 + (4*index)] = 0;
|
||||
Data[0x605 + (4*index)] = 0;
|
||||
Data[0x606 + (4*index)] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
3
BW_tool/MainForm.Designer.cs
generated
3
BW_tool/MainForm.Designer.cs
generated
@@ -214,6 +214,7 @@ namespace BW_tool
|
||||
//
|
||||
// MainForm
|
||||
//
|
||||
this.AllowDrop = true;
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(503, 192);
|
||||
@@ -233,6 +234,8 @@ namespace BW_tool
|
||||
this.Controls.Add(this.loadsave_but);
|
||||
this.Name = "MainForm";
|
||||
this.Text = "Gen V save tool";
|
||||
this.DragDrop += new System.Windows.Forms.DragEventHandler(this.MainScreenDragDrop);
|
||||
this.DragEnter += new System.Windows.Forms.DragEventHandler(this.MainScreenDragEnter);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
|
||||
@@ -38,12 +38,25 @@ namespace BW_tool
|
||||
public byte[] savebuffer;
|
||||
public static SAV5 save;
|
||||
|
||||
|
||||
void MainScreenDragEnter(object sender, DragEventArgs e)
|
||||
{
|
||||
e.Effect = DragDropEffects.All;
|
||||
}
|
||||
void MainScreenDragDrop(object sender, DragEventArgs e)
|
||||
{
|
||||
string[] files = (string[])e.Data.GetData(DataFormats.FileDrop, false);
|
||||
load_savegame(files[0]);
|
||||
}
|
||||
void Loadsave_butClick(object sender, EventArgs e)
|
||||
{
|
||||
versiontext.Text = "";
|
||||
string path = null;
|
||||
load_savegame(null);
|
||||
}
|
||||
void load_savegame(string filepath)
|
||||
{
|
||||
string path = filepath;
|
||||
int filesize = FileIO.load_file(ref savebuffer, ref path, dsfilter);
|
||||
versiontext.Text = "";
|
||||
|
||||
if( filesize == SAV5.SIZERAW || filesize == SAV5.SIZERAW+122 )
|
||||
{
|
||||
//Convert DSV to SAV
|
||||
|
||||
@@ -62,21 +62,30 @@ namespace BW_tool
|
||||
}
|
||||
public static int load_file(ref byte[] buffer, ref string path, string filter)
|
||||
{
|
||||
OpenFileDialog openFD = new OpenFileDialog();
|
||||
//openFD.InitialDirectory = "c:\\";
|
||||
openFD.Filter = filter;
|
||||
if (openFD.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
#region filename
|
||||
path = openFD.FileName;
|
||||
//MessageBox.Show(path.ToString());
|
||||
#endregion
|
||||
_read_data(ref buffer, path);
|
||||
//MessageBox.Show(buffer.Length.ToString());
|
||||
return buffer.Length;
|
||||
}else{
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (path == null)
|
||||
{
|
||||
OpenFileDialog openFD = new OpenFileDialog();
|
||||
//openFD.InitialDirectory = "c:\\";
|
||||
openFD.Filter = filter;
|
||||
if (openFD.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
#region filename
|
||||
path = openFD.FileName;
|
||||
//MessageBox.Show(path.ToString());
|
||||
#endregion
|
||||
_read_data(ref buffer, path);
|
||||
//MessageBox.Show(buffer.Length.ToString());
|
||||
return buffer.Length;
|
||||
}else{
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_read_data(ref buffer, path);
|
||||
return buffer.Length;
|
||||
}
|
||||
|
||||
}
|
||||
public static void save_data(byte[] buffer)
|
||||
|
||||
Reference in New Issue
Block a user