Join Avenue editor finished

This commit is contained in:
suloku 2016-06-17 20:55:49 +02:00
parent e2220dd2fd
commit 10d8b49422
2 changed files with 798 additions and 42 deletions

View File

@ -117,6 +117,32 @@ namespace BW_tool
private System.Windows.Forms.ComboBox shop_country;
private System.Windows.Forms.TextBox shop_name;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.TextBox shop_debug;
private System.Windows.Forms.Button visitor_import;
private System.Windows.Forms.Button visitor_export;
private System.Windows.Forms.CheckBox visitor_ishuman;
private System.Windows.Forms.Label label39;
private System.Windows.Forms.NumericUpDown visitor_recruit;
private System.Windows.Forms.Label label40;
private System.Windows.Forms.ComboBox visitor_gender;
private System.Windows.Forms.Label label41;
private System.Windows.Forms.DateTimePicker visitor_date;
private System.Windows.Forms.ComboBox visitor_subregion;
private System.Windows.Forms.Label label42;
private System.Windows.Forms.NumericUpDown visitor_sprite;
private System.Windows.Forms.Label label43;
private System.Windows.Forms.TextBox visitor_shout;
private System.Windows.Forms.Label label44;
private System.Windows.Forms.Button visitor_apply;
private System.Windows.Forms.Label label45;
private System.Windows.Forms.TextBox visitor_farewell;
private System.Windows.Forms.TextBox visitor_greeting;
private System.Windows.Forms.Label label46;
private System.Windows.Forms.Label label47;
private System.Windows.Forms.Label label48;
private System.Windows.Forms.Label label49;
private System.Windows.Forms.ComboBox visitor_country;
private System.Windows.Forms.TextBox visitor_name;
/// <summary>
/// Disposes resources used by the form.
@ -158,6 +184,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_debug = new System.Windows.Forms.TextBox();
this.shop_exp = new System.Windows.Forms.NumericUpDown();
this.label34 = new System.Windows.Forms.Label();
this.shop_inventory = new System.Windows.Forms.CheckBox();
@ -191,6 +218,31 @@ namespace BW_tool
this.shop_country = new System.Windows.Forms.ComboBox();
this.shop_name = new System.Windows.Forms.TextBox();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.visitor_import = new System.Windows.Forms.Button();
this.visitor_export = new System.Windows.Forms.Button();
this.visitor_ishuman = new System.Windows.Forms.CheckBox();
this.label39 = new System.Windows.Forms.Label();
this.visitor_recruit = new System.Windows.Forms.NumericUpDown();
this.label40 = new System.Windows.Forms.Label();
this.visitor_gender = new System.Windows.Forms.ComboBox();
this.label41 = new System.Windows.Forms.Label();
this.visitor_date = new System.Windows.Forms.DateTimePicker();
this.visitor_subregion = new System.Windows.Forms.ComboBox();
this.label42 = new System.Windows.Forms.Label();
this.visitor_sprite = new System.Windows.Forms.NumericUpDown();
this.label43 = new System.Windows.Forms.Label();
this.visitor_shout = new System.Windows.Forms.TextBox();
this.label44 = new System.Windows.Forms.Label();
this.visitor_apply = new System.Windows.Forms.Button();
this.label45 = new System.Windows.Forms.Label();
this.visitor_farewell = new System.Windows.Forms.TextBox();
this.visitor_greeting = new System.Windows.Forms.TextBox();
this.label46 = new System.Windows.Forms.Label();
this.label47 = new System.Windows.Forms.Label();
this.label48 = new System.Windows.Forms.Label();
this.label49 = new System.Windows.Forms.Label();
this.visitor_country = new System.Windows.Forms.ComboBox();
this.visitor_name = new System.Windows.Forms.TextBox();
this.tabPage3 = new System.Windows.Forms.TabPage();
this.npc_apply = new System.Windows.Forms.Button();
this.label12 = new System.Windows.Forms.Label();
@ -252,6 +304,8 @@ namespace BW_tool
((System.ComponentModel.ISupportInitialize)(this.shop_recruit)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.shop_sprite)).BeginInit();
this.tabPage2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.visitor_recruit)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.visitor_sprite)).BeginInit();
this.tabPage3.SuspendLayout();
this.tabPage4.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.helper_sprite)).BeginInit();
@ -407,7 +461,7 @@ namespace BW_tool
//
// visitor
//
this.visitor.Location = new System.Drawing.Point(55, 7);
this.visitor.Location = new System.Drawing.Point(77, 15);
this.visitor.Maximum = new decimal(new int[] {
7,
0,
@ -416,6 +470,7 @@ namespace BW_tool
this.visitor.Name = "visitor";
this.visitor.Size = new System.Drawing.Size(53, 20);
this.visitor.TabIndex = 32;
this.visitor.ValueChanged += new System.EventHandler(this.VisitorValueChanged);
//
// tabControl1
//
@ -431,6 +486,7 @@ namespace BW_tool
//
// tabPage1
//
this.tabPage1.Controls.Add(this.shop_debug);
this.tabPage1.Controls.Add(this.shop_exp);
this.tabPage1.Controls.Add(this.label34);
this.tabPage1.Controls.Add(this.shop_inventory);
@ -472,6 +528,14 @@ namespace BW_tool
this.tabPage1.Text = "Shop";
this.tabPage1.UseVisualStyleBackColor = true;
//
// shop_debug
//
this.shop_debug.Location = new System.Drawing.Point(77, 173);
this.shop_debug.Name = "shop_debug";
this.shop_debug.Size = new System.Drawing.Size(61, 20);
this.shop_debug.TabIndex = 114;
this.shop_debug.Visible = false;
//
// shop_exp
//
this.shop_exp.Location = new System.Drawing.Point(77, 281);
@ -635,7 +699,7 @@ namespace BW_tool
this.shop_date.Location = new System.Drawing.Point(293, 119);
this.shop_date.MinDate = new System.DateTime(2000, 1, 1, 0, 0, 0, 0);
this.shop_date.Name = "shop_date";
this.shop_date.Size = new System.Drawing.Size(200, 20);
this.shop_date.Size = new System.Drawing.Size(191, 20);
this.shop_date.TabIndex = 97;
//
// shop_subregion
@ -1011,6 +1075,31 @@ namespace BW_tool
//
// tabPage2
//
this.tabPage2.Controls.Add(this.visitor_import);
this.tabPage2.Controls.Add(this.visitor_export);
this.tabPage2.Controls.Add(this.visitor_ishuman);
this.tabPage2.Controls.Add(this.label39);
this.tabPage2.Controls.Add(this.visitor_recruit);
this.tabPage2.Controls.Add(this.label40);
this.tabPage2.Controls.Add(this.visitor_gender);
this.tabPage2.Controls.Add(this.label41);
this.tabPage2.Controls.Add(this.visitor_date);
this.tabPage2.Controls.Add(this.visitor_subregion);
this.tabPage2.Controls.Add(this.label42);
this.tabPage2.Controls.Add(this.visitor_sprite);
this.tabPage2.Controls.Add(this.label43);
this.tabPage2.Controls.Add(this.visitor_shout);
this.tabPage2.Controls.Add(this.label44);
this.tabPage2.Controls.Add(this.visitor_apply);
this.tabPage2.Controls.Add(this.label45);
this.tabPage2.Controls.Add(this.visitor_farewell);
this.tabPage2.Controls.Add(this.visitor_greeting);
this.tabPage2.Controls.Add(this.label46);
this.tabPage2.Controls.Add(this.label47);
this.tabPage2.Controls.Add(this.label48);
this.tabPage2.Controls.Add(this.label49);
this.tabPage2.Controls.Add(this.visitor_country);
this.tabPage2.Controls.Add(this.visitor_name);
this.tabPage2.Controls.Add(this.visitor);
this.tabPage2.Location = new System.Drawing.Point(4, 22);
this.tabPage2.Name = "tabPage2";
@ -1020,6 +1109,460 @@ namespace BW_tool
this.tabPage2.Text = "Visitor";
this.tabPage2.UseVisualStyleBackColor = true;
//
// visitor_import
//
this.visitor_import.Location = new System.Drawing.Point(293, 215);
this.visitor_import.Name = "visitor_import";
this.visitor_import.Size = new System.Drawing.Size(75, 23);
this.visitor_import.TabIndex = 150;
this.visitor_import.Text = "Import";
this.visitor_import.UseVisualStyleBackColor = true;
this.visitor_import.Click += new System.EventHandler(this.Visitor_importClick);
//
// visitor_export
//
this.visitor_export.Location = new System.Drawing.Point(374, 215);
this.visitor_export.Name = "visitor_export";
this.visitor_export.Size = new System.Drawing.Size(75, 23);
this.visitor_export.TabIndex = 149;
this.visitor_export.Text = "Export";
this.visitor_export.UseVisualStyleBackColor = true;
this.visitor_export.Click += new System.EventHandler(this.Visitor_exportClick);
//
// visitor_ishuman
//
this.visitor_ishuman.Location = new System.Drawing.Point(77, 172);
this.visitor_ishuman.Name = "visitor_ishuman";
this.visitor_ishuman.Size = new System.Drawing.Size(104, 24);
this.visitor_ishuman.TabIndex = 138;
this.visitor_ishuman.Text = "Is human";
this.visitor_ishuman.UseVisualStyleBackColor = true;
//
// label39
//
this.label39.Location = new System.Drawing.Point(222, 147);
this.label39.Name = "label39";
this.label39.Size = new System.Drawing.Size(65, 23);
this.label39.TabIndex = 137;
this.label39.Text = "Recruit Lvl";
//
// visitor_recruit
//
this.visitor_recruit.Location = new System.Drawing.Point(293, 145);
this.visitor_recruit.Maximum = new decimal(new int[] {
255,
0,
0,
0});
this.visitor_recruit.Name = "visitor_recruit";
this.visitor_recruit.Size = new System.Drawing.Size(47, 20);
this.visitor_recruit.TabIndex = 136;
//
// label40
//
this.label40.Location = new System.Drawing.Point(6, 148);
this.label40.Name = "label40";
this.label40.Size = new System.Drawing.Size(57, 23);
this.label40.TabIndex = 135;
this.label40.Text = "Gender";
//
// visitor_gender
//
this.visitor_gender.FormattingEnabled = true;
this.visitor_gender.Items.AddRange(new object[] {
"Male",
"Female"});
this.visitor_gender.Location = new System.Drawing.Point(77, 145);
this.visitor_gender.Name = "visitor_gender";
this.visitor_gender.Size = new System.Drawing.Size(135, 21);
this.visitor_gender.TabIndex = 134;
//
// label41
//
this.label41.Location = new System.Drawing.Point(222, 122);
this.label41.Name = "label41";
this.label41.Size = new System.Drawing.Size(57, 23);
this.label41.TabIndex = 133;
this.label41.Text = "Met Date";
//
// visitor_date
//
this.visitor_date.Location = new System.Drawing.Point(293, 119);
this.visitor_date.MinDate = new System.DateTime(2000, 1, 1, 0, 0, 0, 0);
this.visitor_date.Name = "visitor_date";
this.visitor_date.Size = new System.Drawing.Size(191, 20);
this.visitor_date.TabIndex = 132;
//
// visitor_subregion
//
this.visitor_subregion.FormattingEnabled = true;
this.visitor_subregion.Items.AddRange(new object[] {
"0 None"});
this.visitor_subregion.Location = new System.Drawing.Point(293, 68);
this.visitor_subregion.Name = "visitor_subregion";
this.visitor_subregion.Size = new System.Drawing.Size(191, 21);
this.visitor_subregion.TabIndex = 131;
//
// label42
//
this.label42.Location = new System.Drawing.Point(222, 97);
this.label42.Name = "label42";
this.label42.Size = new System.Drawing.Size(57, 23);
this.label42.TabIndex = 130;
this.label42.Text = "Sprite";
//
// visitor_sprite
//
this.visitor_sprite.Location = new System.Drawing.Point(293, 95);
this.visitor_sprite.Maximum = new decimal(new int[] {
255,
0,
0,
0});
this.visitor_sprite.Name = "visitor_sprite";
this.visitor_sprite.Size = new System.Drawing.Size(47, 20);
this.visitor_sprite.TabIndex = 129;
//
// label43
//
this.label43.Location = new System.Drawing.Point(222, 71);
this.label43.Name = "label43";
this.label43.Size = new System.Drawing.Size(57, 23);
this.label43.TabIndex = 128;
this.label43.Text = "Subregion";
//
// visitor_shout
//
this.visitor_shout.Location = new System.Drawing.Point(77, 67);
this.visitor_shout.MaxLength = 14;
this.visitor_shout.Name = "visitor_shout";
this.visitor_shout.Size = new System.Drawing.Size(135, 20);
this.visitor_shout.TabIndex = 127;
//
// label44
//
this.label44.Location = new System.Drawing.Point(6, 70);
this.label44.Name = "label44";
this.label44.Size = new System.Drawing.Size(57, 23);
this.label44.TabIndex = 126;
this.label44.Text = "Shout";
//
// visitor_apply
//
this.visitor_apply.Location = new System.Drawing.Point(77, 215);
this.visitor_apply.Name = "visitor_apply";
this.visitor_apply.Size = new System.Drawing.Size(67, 23);
this.visitor_apply.TabIndex = 125;
this.visitor_apply.Text = "Apply";
this.visitor_apply.UseVisualStyleBackColor = true;
//
// label45
//
this.label45.Location = new System.Drawing.Point(6, 17);
this.label45.Name = "label45";
this.label45.Size = new System.Drawing.Size(57, 23);
this.label45.TabIndex = 124;
this.label45.Text = "Slot";
//
// visitor_farewell
//
this.visitor_farewell.Location = new System.Drawing.Point(77, 119);
this.visitor_farewell.MaxLength = 14;
this.visitor_farewell.Name = "visitor_farewell";
this.visitor_farewell.Size = new System.Drawing.Size(135, 20);
this.visitor_farewell.TabIndex = 123;
//
// visitor_greeting
//
this.visitor_greeting.Location = new System.Drawing.Point(77, 93);
this.visitor_greeting.MaxLength = 14;
this.visitor_greeting.Name = "visitor_greeting";
this.visitor_greeting.Size = new System.Drawing.Size(135, 20);
this.visitor_greeting.TabIndex = 122;
//
// label46
//
this.label46.Location = new System.Drawing.Point(6, 122);
this.label46.Name = "label46";
this.label46.Size = new System.Drawing.Size(57, 23);
this.label46.TabIndex = 121;
this.label46.Text = "Farewell";
//
// label47
//
this.label47.Location = new System.Drawing.Point(6, 96);
this.label47.Name = "label47";
this.label47.Size = new System.Drawing.Size(57, 23);
this.label47.TabIndex = 120;
this.label47.Text = "Greeting";
//
// label48
//
this.label48.Location = new System.Drawing.Point(222, 44);
this.label48.Name = "label48";
this.label48.Size = new System.Drawing.Size(57, 23);
this.label48.TabIndex = 119;
this.label48.Text = "Country";
//
// label49
//
this.label49.Location = new System.Drawing.Point(6, 44);
this.label49.Name = "label49";
this.label49.Size = new System.Drawing.Size(57, 23);
this.label49.TabIndex = 118;
this.label49.Text = "Name";
//
// visitor_country
//
this.visitor_country.FormattingEnabled = true;
this.visitor_country.Items.AddRange(new object[] {
"0 None",
"1 Afghanistan",
"2 Albania",
"3 Algeria",
"4 American Samoa",
"5 Andorra",
"6 Angola",
"7 Anguilla",
"8 Antigua and Barbuda",
"9 Argentina",
"10 Armenia",
"11 Aruba",
"12 Australia",
"13 Austria",
"14 Azerbaijan",
"15 Bahamas",
"16 Bahrain",
"17 Bangladesh",
"18 Barbados",
"19 Belarus",
"20 Belgium",
"21 Belize",
"22 Benin",
"23 Bermuda",
"24 Bhutan",
"25 Bolivia",
"26 Bosnia and Herzegovina",
"27 Botswana",
"28 Brazil",
"29 British Virgin Islands",
"30 Brunei Darussalam",
"31 Bulgaria",
"32 Burkina Faso",
"33 Burundi",
"34 Cambodia",
"35 Cameroon",
"36 Canada",
"37 Cape Verde",
"38 Cayman Islands",
"39 Central African Republic",
"40 Chad",
"41 Channel Islands",
"42 Chile",
"43 China",
"44 Christmas Island",
"45 Colombia",
"46 Comoros",
"47 Congo",
"48 Cook Islands",
"49 Costa Rica",
"50 Cote d\'Ivoire",
"51 Croatia",
"52 Cuba",
"53 Cyprus",
"54 Czech Republic",
"55 North Korea",
"56 Democratic Republic of the Congo",
"57 Timor-Leste",
"58 Denmark",
"59 Djibouti",
"60 Dominica",
"61 Dominican Republic",
"62 Ecuador",
"63 Egypt",
"64 El Salvador",
"65 Equatorial Guinea",
"66 Eritrea",
"67 Estonia",
"68 Ethiopia",
"69 Falkland Islands",
"70 Faroe Islands",
"71 Fiji",
"72 Finland",
"73 France",
"74 French Guiana",
"75 French Polynesia",
"76 Gabon",
"77 Gambia",
"78 Georgia",
"79 Germany",
"80 Ghana",
"81 Gibraltar",
"82 Greece",
"83 Greenland",
"84 Grenada",
"85 Guadeloupe",
"86 Guam",
"87 Guatemala",
"88 Guinea",
"89 Guinea-Bissau",
"90 Guyana",
"91 Haiti",
"92 Honduras",
"93 Hungary",
"94 Iceland",
"95 India",
"96 Indonesia",
"97 Iran",
"98 Iraq",
"99 Ireland",
"100 Isle of Man",
"101 Israel",
"102 Italy",
"103 Jamaica",
"104 Jan Mayen Island",
"105 Japan",
"106 Jordan",
"107 Kashmir",
"108 Kazakhstan",
"109 Kenya",
"110 Kiribati",
"111 Kuwait",
"112 Kyrgyzstan",
"113 Laos",
"114 Latvia",
"115 Lebanon",
"116 Lesotho",
"117 Liberia",
"118 Libya",
"119 Liechtenstein",
"120 Lithuania",
"121 Luxembourg",
"122 Macedonia (FYROM)",
"123 Madagascar",
"124 Malawi",
"125 Malaysia",
"126 Maldives",
"127 Mali",
"128 Malta",
"129 Marshall Islands",
"130 Martinique",
"131 Mauritania",
"132 Mauritius",
"133 Mayotte",
"134 Mexico",
"135 Micronesia",
"136 Monaco",
"137 Mongolia",
"138 Montenegro",
"139 Morocco",
"140 Mozambique",
"141 Myanmar",
"142 Namibia",
"143 Nauru",
"144 Nepal",
"145 Netherlands",
"146 Netherlands Antilles",
"147 New Caledonia",
"148 New Zealand",
"149 Nicaragua",
"150 Niger",
"151 Nigeria",
"152 Niue",
"153 Norfolk Island",
"154 Northern Mariana Islands",
"155 Norway",
"156 Oman",
"157 Pakistan",
"158 Palau",
"159 Palestine",
"160 Panama",
"161 Papua New Guinea",
"162 Paraguay",
"163 Peru",
"164 Philippines",
"165 Pitcairn Islands",
"166 Poland",
"167 Portugal",
"168 Puerto Rico",
"169 Qatar",
"170 South Korea",
"171 Moldova",
"172 Reunion",
"173 Romania",
"174 Russian Federation",
"175 Rwanda",
"176 Saint Helena",
"177 Saint Kitts and Nevis",
"178 Saint Lucia",
"179 Saint Vincent and the Grenadines",
"180 Saint Pierre and Miquelon",
"181 Samoa",
"182 San Marino",
"183 Sao Tome and Principe",
"184 Saudi Arabia",
"185 Senegal",
"186 Serbia",
"187 Seychelles",
"188 Sierra Leone",
"189 Singapore",
"190 Slovakia",
"191 Slovenia",
"192 Solomon Islands",
"193 Somalia",
"194 South Africa",
"195 Spain",
"196 Sri Lanka",
"197 Sudan",
"198 Suriname",
"199 Swaziland",
"200 Sweden",
"201 Switzerland",
"202 Syria",
"203 Taiwan",
"204 Tajikistan",
"205 Thailand",
"206 Togo",
"207 Tokelau",
"208 Tonga",
"209 Trinidad and Tobago",
"210 Tunisia",
"211 Turkey",
"212 Turkmenistan",
"213 Turks and Caicos Islands",
"214 Tuvalu",
"215 Uganda",
"216 Ukraine",
"217 United Arab Emirates",
"218 United Kingdom",
"219 Tanzania",
"220 United States of America",
"221 United States Virgin Islands",
"222 Uruguay",
"223 Uzbekistan",
"224 Vanuatu",
"225 Holy See (Vatican City State)",
"226 Venezuela",
"227 Vietnam",
"228 Wallis and Futuna",
"229 Western Sahara",
"230 Yemen",
"231 Zambia",
"232 Zimbabwe"});
this.visitor_country.Location = new System.Drawing.Point(293, 41);
this.visitor_country.Name = "visitor_country";
this.visitor_country.Size = new System.Drawing.Size(191, 21);
this.visitor_country.TabIndex = 117;
this.visitor_country.SelectedIndexChanged += new System.EventHandler(this.Visitor_countrySelectedIndexChanged);
//
// visitor_name
//
this.visitor_name.Location = new System.Drawing.Point(77, 41);
this.visitor_name.MaxLength = 14;
this.visitor_name.Name = "visitor_name";
this.visitor_name.Size = new System.Drawing.Size(135, 20);
this.visitor_name.TabIndex = 116;
//
// tabPage3
//
this.tabPage3.Controls.Add(this.npc_apply);
@ -2227,6 +2770,9 @@ namespace BW_tool
((System.ComponentModel.ISupportInitialize)(this.shop_recruit)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.shop_sprite)).EndInit();
this.tabPage2.ResumeLayout(false);
this.tabPage2.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.visitor_recruit)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.visitor_sprite)).EndInit();
this.tabPage3.ResumeLayout(false);
this.tabPage3.PerformLayout();
this.tabPage4.ResumeLayout(false);

View File

@ -75,10 +75,12 @@ namespace BW_tool
name.Text = ja.name;
load_shop();
load_visitor();
load_npc();
load_helper();
shop.Value = 0;
visitor.Value = 0;
npc.Value = 0;
helper.SelectedIndex = 0;
}
@ -231,6 +233,7 @@ namespace BW_tool
void Helper_applyClick(object sender, EventArgs e)
{
set_helper();
load_helper();
}
int helper_value = 0;
void HelperSelectedIndexChanged(object sender, EventArgs e)
@ -242,7 +245,10 @@ namespace BW_tool
//SHOP
void Shop_countrySelectedIndexChanged(object sender, EventArgs e)
{
shop_handleCountry();
}
void shop_handleCountry()
{
shop_subregion.SelectedIndex = 0;
shop_subregion.Items.Clear();
object[] a;
@ -353,6 +359,13 @@ namespace BW_tool
shop_gender.SelectedIndex = ja.shop[(int)shop.Value].gender;
shop_country.SelectedIndex = ja.shop[(int)shop.Value].country;
shop_handleCountry();
int i = 0;
for (i=0; i<country_subbed.Length; i++)
{
if (ja.shop[(int)shop.Value].country == country_subbed[i])
shop_subregion.SelectedIndex = ja.shop[(int)shop.Value].subregion;
}
shop_subregion.SelectedIndex = ja.shop[(int)shop.Value].subregion;
shop_sprite.Value = ja.shop[(int)shop.Value].sprite;
shop_date.Value = ja.shop[(int)shop.Value].met;
@ -365,6 +378,8 @@ namespace BW_tool
shop_ishuman.Checked = ja.shop[(int)shop.Value].isplayer;
shop_inventory.Checked = ja.shop[(int)shop.Value].inventory;
shop_debug.Text = ja.shop[(int)shop.Value].ShopBytes().ToString("X");
}
void set_shop()
{
@ -387,6 +402,8 @@ namespace BW_tool
ja.shop[(int)shop.Value].shop_exp = (int)shop_exp.Value;
ja.shop[(int)shop.Value].isplayer = shop_ishuman.Checked;
ja.shop[(int)shop.Value].inventory = shop_inventory.Checked;
ja.shop[(int)shop.Value].set_ShopBytes();
}
void Shop_applyClick(object sender, EventArgs e)
{
@ -396,6 +413,191 @@ namespace BW_tool
{
load_shop();
}
//VISITOR
void Visitor_countrySelectedIndexChanged(object sender, EventArgs e)
{
visitor_handleCountry();
}
void visitor_handleCountry()
{
visitor_subregion.SelectedIndex = 0;
visitor_subregion.Items.Clear();
object[] a;
switch (visitor_country.SelectedIndex)
{
case 9:
a= new object[helper_subregion_argentina.Items.Count];
helper_subregion_argentina.Items.CopyTo(a,0);
visitor_subregion.Items.AddRange(a);
break;
case 12:
a = new object[helper_subregion_australia.Items.Count];
helper_subregion_australia.Items.CopyTo(a,0);
visitor_subregion.Items.AddRange(a);
break;
case 28:
a = new object[helper_subregion_brazil.Items.Count];
helper_subregion_brazil.Items.CopyTo(a,0);
visitor_subregion.Items.AddRange(a);
break;
case 36:
a = new object[helper_subregion_canada.Items.Count];
helper_subregion_canada.Items.CopyTo(a,0);
visitor_subregion.Items.AddRange(a);
break;
case 43:
a = new object[helper_subregion_china.Items.Count];
helper_subregion_china.Items.CopyTo(a,0);
visitor_subregion.Items.AddRange(a);
break;
case 72:
a = new object[helper_subregion_finland.Items.Count];
helper_subregion_finland.Items.CopyTo(a,0);
visitor_subregion.Items.AddRange(a);
break;
case 73:
a = new object[helper_subregion_france.Items.Count];
helper_subregion_france.Items.CopyTo(a,0);
visitor_subregion.Items.AddRange(a);
break;
case 79:
a = new object[helper_subregion_germany.Items.Count];
helper_subregion_germany.Items.CopyTo(a,0);
visitor_subregion.Items.AddRange(a);
break;
case 95:
a = new object[helper_subregion_india.Items.Count];
helper_subregion_india.Items.CopyTo(a,0);
visitor_subregion.Items.AddRange(a);
break;
case 102:
a = new object[helper_subregion_italy.Items.Count];
helper_subregion_italy.Items.CopyTo(a,0);
visitor_subregion.Items.AddRange(a);
break;
case 105:
a = new object[helper_subregion_japan.Items.Count];
helper_subregion_japan.Items.CopyTo(a,0);
visitor_subregion.Items.AddRange(a);
break;
case 155:
a = new object[helper_subregion_norway.Items.Count];
helper_subregion_norway.Items.CopyTo(a,0);
visitor_subregion.Items.AddRange(a);
break;
case 166:
a = new object[helper_subregion_poland.Items.Count];
helper_subregion_poland.Items.CopyTo(a,0);
visitor_subregion.Items.AddRange(a);
break;
case 174:
a = new object[helper_subregion_russia.Items.Count];
helper_subregion_russia.Items.CopyTo(a,0);
visitor_subregion.Items.AddRange(a);
break;
case 195:
a = new object[helper_subregion_spain.Items.Count];
helper_subregion_spain.Items.CopyTo(a,0);
visitor_subregion.Items.AddRange(a);
break;
case 200:
a = new object[helper_subregion_sweeden.Items.Count];
helper_subregion_sweeden.Items.CopyTo(a,0);
visitor_subregion.Items.AddRange(a);
break;
case 218:
a = new object[helper_subregion_england.Items.Count];
helper_subregion_england.Items.CopyTo(a,0);
visitor_subregion.Items.AddRange(a);
break;
case 220:
a = new object[helper_subregion_USA.Items.Count];
helper_subregion_USA.Items.CopyTo(a,0);
visitor_subregion.Items.AddRange(a);
break;
default:
visitor_subregion.Items.Add("0 None");
break;
}
}
int[] country_subbed = new int[]
{
009, 012, 028, 036, 043, 072, 073, 079, 095, 102,
105, 155, 166, 174, 195, 200, 218, 220
};
void load_visitor()
{
visitor_name.Text = ja.visitor[(int)visitor.Value].name;
visitor_shout.Text = ja.visitor[(int)visitor.Value].shout;
visitor_greeting.Text = ja.visitor[(int)visitor.Value].greeting;
visitor_farewell.Text = ja.visitor[(int)visitor.Value].farewell;
visitor_gender.SelectedIndex = ja.visitor[(int)visitor.Value].gender;
visitor_country.SelectedIndex = ja.visitor[(int)visitor.Value].country;
visitor_handleCountry();
int i = 0;
for (i=0; i<country_subbed.Length; i++)
{
if (ja.visitor[(int)visitor.Value].country == country_subbed[i]){
visitor_subregion.SelectedIndex = ja.visitor[(int)visitor.Value].subregion;
break;
}
}
visitor_sprite.Value = ja.visitor[(int)visitor.Value].sprite;
visitor_date.Value = ja.visitor[(int)visitor.Value].met;
visitor_recruit.Value = ja.visitor[(int)visitor.Value].recruitlvl;
visitor_ishuman.Checked = ja.visitor[(int)visitor.Value].isplayer;
}
void set_visitor()
{
ja.visitor[(int)visitor.Value].name = visitor_name.Text;
ja.visitor[(int)visitor.Value].shout = visitor_shout.Text;
ja.visitor[(int)visitor.Value].greeting = visitor_greeting.Text;
ja.visitor[(int)visitor.Value].farewell = visitor_farewell.Text;
ja.visitor[(int)visitor.Value].gender = visitor_gender.SelectedIndex;
ja.visitor[(int)visitor.Value].country = visitor_country.SelectedIndex;
ja.visitor[(int)visitor.Value].subregion = visitor_subregion.SelectedIndex;
ja.visitor[(int)visitor.Value].sprite = (int)visitor_sprite.Value;
ja.visitor[(int)visitor.Value].met = visitor_date.Value;
ja.visitor[(int)visitor.Value].recruitlvl = (int)visitor_recruit.Value;
ja.visitor[(int)visitor.Value].isplayer = visitor_ishuman.Checked;
}
void Visitor_applyClick(object sender, EventArgs e)
{
set_visitor();
}
void VisitorValueChanged(object sender, EventArgs e)
{
load_visitor();
}
void Visitor_importClick(object sender, EventArgs e)
{
AV_OCCUPANT import = new AV_OCCUPANT();
string path = null;
int filesize = FileIO.load_file(ref import.Data, ref path, "Poke JoinAvenue Visitor|*.pjv|All Files (*.*)|*.*");
if( filesize == 0xC4)
{
ja.set_visitor(import, (int)visitor.Value);
ja.load_people();
load_visitor();
}
else
{
MessageBox.Show("Invalid file.");
}
}
void Visitor_exportClick(object sender, EventArgs e)
{
FileIO.save_file(ja.visitor[(int)visitor.Value].Data, "Poke JoinAvenue Visitor|*.pjv|All Files (*.*)|*.*");
}
public class AVENUE
{
@ -420,7 +622,7 @@ namespace BW_tool
//Variables
public AV_VISITOR[] visitor = new AV_VISITOR[8];
public AV_OCCUPANT[] visitor = new AV_OCCUPANT[8];
public AV_OCCUPANT[] shop = new AV_OCCUPANT[8];
public AV_NPC[] npc = new AV_NPC[12];
public AV_HELPER[] helper = new AV_HELPER[4];
@ -429,12 +631,12 @@ namespace BW_tool
int VISITOR_SIZE = 0xC4;
int VISITOR_OFFSET = 0x08;
int VISITOR_TOTAL = 8-1;
public AV_VISITOR get_visitor (int index)
public AV_OCCUPANT get_visitor (int index)
{
if (index > VISITOR_TOTAL) index = VISITOR_TOTAL;
return new AV_VISITOR(getData(VISITOR_OFFSET+(VISITOR_SIZE*index), VISITOR_SIZE));
return new AV_OCCUPANT(getData(VISITOR_OFFSET+(VISITOR_SIZE*index), VISITOR_SIZE));
}
public void set_visitor(AV_VISITOR visitant, int index)
public void set_visitor(AV_OCCUPANT visitant, int index)
{
if (index > VISITOR_TOTAL) index = VISITOR_TOTAL;
setData(visitant.Data, VISITOR_OFFSET+(VISITOR_SIZE*index));
@ -1106,7 +1308,8 @@ START OFFSET: 23C00
Data[0xA5] = (byte) value.Day;
}
}
public int av_rank
public int av_occupant_rank //Rank of player's own avenue, visitors use it. Disabled since not used in gui
{
get
{
@ -1165,47 +1368,77 @@ START OFFSET: 23C00
}
}
//Note: 0xB4 = FF when there's no shop
public UInt16 ShopBytes()
{
return BitConverter.ToUInt16(getData(0xB4, 2), 0);
}
public void set_ShopBytes()
{
UInt16 bytes = (UInt16)(1 + Shop_version*0x50 + Shop_type*0xA + Shop_level);
setData(BitConverter.GetBytes(bytes), 0xB4);
}
private int Shop_version;
public int shop_version //0 black, 1 white, 2 black2, 3 white3
{
get
{
return Data[0xB4]/0x50;
return ShopBytes()/0x50;
}
set
{
if(value > 0x3)
Data[0xB4] = (byte)(3*0x50 + shop_type*0xA + shop_level);
if(value > 3){
Shop_version = 3;
}
else
Data[0xB4] = (byte)(value*0x50 + shop_type*0xA + shop_level);
{
Shop_version = value;
}
}
}
private int Shop_level;
public int shop_level // 0-9 (1-10)
{
get
{
MessageBox.Show(Data[0xB4].ToString("X")+"-"+(((Data[0xB4] % 0x50) -1) % 0xA).ToString());
return ((Data[0xB4] % 0x50) -1) % 0xA;
if (ShopBytes()%0x50 == 0) //Last shop, level 10, remainder of negative number not correctly behaving...
return 9;
else
return (((ShopBytes() % 0x50) -1) % 0xA);
}
set
{
if(value > 0x9)
Data[0xB4] = (byte)(shop_version*0x50 + shop_type*0xA + 0x9);
Shop_level = 0x9;
else
Data[0xB4] = (byte)(shop_version*0x50 + shop_type*0xA + value);
Shop_level = value;
}
}
private int Shop_type;
public int shop_type // 0=raffle, 1=salon, 2 = market, 3=florist, 4 = dojo, 5=nurse, 6=antique, 7=cafe
{
get
{
return (Data[0xB4] % 0x50) / 0xA;
if (shop_level == 9)
{ //Level 10 gives problems... just consider it a level 9 shop for type return
//MessageBox.Show((ShopBytes() % 0x50).ToString() + " -"+((ShopBytes() % 0x50)/0xA).ToString());
return (((ShopBytes()-1) % 0x50) / 0xA);
}else
{
return ((ShopBytes() % 0x50) / 0xA);
}
//
// return ((ShopBytes() % 0x50) / 0xA);
}
set
{
if(value > 0x7)
Data[0xB4] = (byte)(shop_version*0x50 + 0x7*0xA + shop_level);
Shop_type = 0x7;
else
Data[0xB4] = (byte)(shop_version*0x50 + value*0xA + shop_level);
Shop_type = value;
}
}
@ -1216,28 +1449,5 @@ START OFFSET: 23C00
return index < 0 ? input : input.Substring(0, index);
}
}
public class AV_VISITOR
{
public byte[] Data;
public AV_VISITOR(byte[] data = null)
{
Data = data ?? new byte[0xC4];
}
public byte[] getData(int Offset, int Length)
{
return Data.Skip(Offset).Take(Length).ToArray();
}
public void setData(byte[] input, int Offset)
{
input.CopyTo(Data, Offset);
}
//Helper functions from pkhex
internal static string TrimFromFFFF(string input)
{
int index = input.IndexOf((char)0xFFFF);
return index < 0 ? input : input.Substring(0, index);
}
}
}
}