Add playtime editing

This commit is contained in:
Kurt 2015-08-22 13:49:41 -07:00
parent d6f74fd0bb
commit 0af46da15f
2 changed files with 392 additions and 42 deletions

View File

@ -200,6 +200,8 @@ private void InitializeComponent()
this.CB_Villager2 = new System.Windows.Forms.ComboBox();
this.L_Villager1 = new System.Windows.Forms.Label();
this.CB_Villager1 = new System.Windows.Forms.ComboBox();
this.tabPage5 = new System.Windows.Forms.TabPage();
this.dataGridView1 = new System.Windows.Forms.DataGridView();
this.L_ItemHover = new System.Windows.Forms.Label();
this.PB_JPEG1 = new System.Windows.Forms.PictureBox();
this.PB_JPEG2 = new System.Windows.Forms.PictureBox();
@ -208,8 +210,26 @@ private void InitializeComponent()
this.TB_Flag1 = new System.Windows.Forms.TextBox();
this.TB_Flag2 = new System.Windows.Forms.TextBox();
this.L_CurrentItem = new System.Windows.Forms.Label();
this.tabPage5 = new System.Windows.Forms.TabPage();
this.dataGridView1 = new System.Windows.Forms.DataGridView();
this.TB_TownName = new System.Windows.Forms.TextBox();
this.L_TownName = new System.Windows.Forms.Label();
this.L_GrassShape = new System.Windows.Forms.Label();
this.CB_GrassShape = new System.Windows.Forms.ComboBox();
this.L_TownHallColor = new System.Windows.Forms.Label();
this.CB_TownHallColor = new System.Windows.Forms.ComboBox();
this.L_TrainStationColor = new System.Windows.Forms.Label();
this.CB_TrainStationColor = new System.Windows.Forms.ComboBox();
this.L_NativeFruit = new System.Windows.Forms.Label();
this.CB_NativeFruit = new System.Windows.Forms.ComboBox();
this.L_HoursPlayed = new System.Windows.Forms.Label();
this.L_MinutesPlayed = new System.Windows.Forms.Label();
this.L_SecondsPlayed = new System.Windows.Forms.Label();
this.L_OverallDays = new System.Windows.Forms.Label();
this.L_DaysPlayed = new System.Windows.Forms.Label();
this.NUD_Seconds = new System.Windows.Forms.NumericUpDown();
this.NUD_Minutes = new System.Windows.Forms.NumericUpDown();
this.NUD_Hours = new System.Windows.Forms.NumericUpDown();
this.NUD_Days = new System.Windows.Forms.NumericUpDown();
this.NUD_OverallDays = new System.Windows.Forms.NumericUpDown();
((System.ComponentModel.ISupportInitialize)(this.PB_JPEG0)).BeginInit();
this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout();
@ -279,11 +299,16 @@ private void InitializeComponent()
((System.ComponentModel.ISupportInitialize)(this.PB_P0Dresser2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.PB_P0Dresser1)).BeginInit();
this.tabPage4.SuspendLayout();
this.tabPage5.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.PB_JPEG1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.PB_JPEG2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.PB_JPEG3)).BeginInit();
this.tabPage5.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.NUD_Seconds)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.NUD_Minutes)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.NUD_Hours)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.NUD_Days)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.NUD_OverallDays)).BeginInit();
this.SuspendLayout();
//
// PB_JPEG0
@ -2229,6 +2254,60 @@ private void InitializeComponent()
this.CB_Villager1.TabIndex = 16;
this.CB_Villager1.SelectedIndexChanged += new System.EventHandler(this.changeVillager);
//
// tabPage5
//
this.tabPage5.Controls.Add(this.NUD_OverallDays);
this.tabPage5.Controls.Add(this.NUD_Days);
this.tabPage5.Controls.Add(this.NUD_Hours);
this.tabPage5.Controls.Add(this.NUD_Minutes);
this.tabPage5.Controls.Add(this.NUD_Seconds);
this.tabPage5.Controls.Add(this.L_DaysPlayed);
this.tabPage5.Controls.Add(this.L_OverallDays);
this.tabPage5.Controls.Add(this.L_SecondsPlayed);
this.tabPage5.Controls.Add(this.L_MinutesPlayed);
this.tabPage5.Controls.Add(this.L_HoursPlayed);
this.tabPage5.Controls.Add(this.L_NativeFruit);
this.tabPage5.Controls.Add(this.CB_NativeFruit);
this.tabPage5.Controls.Add(this.L_TrainStationColor);
this.tabPage5.Controls.Add(this.CB_TrainStationColor);
this.tabPage5.Controls.Add(this.L_TownHallColor);
this.tabPage5.Controls.Add(this.CB_TownHallColor);
this.tabPage5.Controls.Add(this.L_GrassShape);
this.tabPage5.Controls.Add(this.CB_GrassShape);
this.tabPage5.Controls.Add(this.L_TownName);
this.tabPage5.Controls.Add(this.TB_TownName);
this.tabPage5.Controls.Add(this.dataGridView1);
this.tabPage5.Location = new System.Drawing.Point(4, 22);
this.tabPage5.Name = "tabPage5";
this.tabPage5.Padding = new System.Windows.Forms.Padding(3);
this.tabPage5.Size = new System.Drawing.Size(652, 560);
this.tabPage5.TabIndex = 4;
this.tabPage5.Text = "Buildings/Town";
this.tabPage5.UseVisualStyleBackColor = true;
//
// dataGridView1
//
this.dataGridView1.AllowUserToAddRows = false;
this.dataGridView1.AllowUserToDeleteRows = false;
this.dataGridView1.AllowUserToResizeColumns = false;
this.dataGridView1.AllowUserToResizeRows = false;
this.dataGridView1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)));
this.dataGridView1.BackgroundColor = System.Drawing.SystemColors.ControlLightLight;
this.dataGridView1.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.None;
this.dataGridView1.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.Single;
this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dataGridView1.ColumnHeadersVisible = false;
this.dataGridView1.EditMode = System.Windows.Forms.DataGridViewEditMode.EditOnEnter;
this.dataGridView1.Location = new System.Drawing.Point(6, 6);
this.dataGridView1.MultiSelect = false;
this.dataGridView1.Name = "dataGridView1";
this.dataGridView1.RowHeadersVisible = false;
this.dataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.CellSelect;
this.dataGridView1.ShowEditingIcon = false;
this.dataGridView1.Size = new System.Drawing.Size(249, 548);
this.dataGridView1.TabIndex = 16;
this.dataGridView1.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dropclick);
//
// L_ItemHover
//
this.L_ItemHover.AutoSize = true;
@ -2320,39 +2399,250 @@ private void InitializeComponent()
this.L_CurrentItem.TabIndex = 15;
this.L_CurrentItem.Text = "Current Item:";
//
// tabPage5
// TB_TownName
//
this.tabPage5.Controls.Add(this.dataGridView1);
this.tabPage5.Location = new System.Drawing.Point(4, 22);
this.tabPage5.Name = "tabPage5";
this.tabPage5.Padding = new System.Windows.Forms.Padding(3);
this.tabPage5.Size = new System.Drawing.Size(652, 560);
this.tabPage5.TabIndex = 4;
this.tabPage5.Text = "Buildings";
this.tabPage5.UseVisualStyleBackColor = true;
this.TB_TownName.Location = new System.Drawing.Point(367, 12);
this.TB_TownName.MaxLength = 9;
this.TB_TownName.Name = "TB_TownName";
this.TB_TownName.Size = new System.Drawing.Size(121, 20);
this.TB_TownName.TabIndex = 17;
//
// dataGridView1
// L_TownName
//
this.dataGridView1.AllowUserToAddRows = false;
this.dataGridView1.AllowUserToDeleteRows = false;
this.dataGridView1.AllowUserToResizeColumns = false;
this.dataGridView1.AllowUserToResizeRows = false;
this.dataGridView1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)));
this.dataGridView1.BackgroundColor = System.Drawing.SystemColors.ControlLightLight;
this.dataGridView1.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.None;
this.dataGridView1.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.Single;
this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dataGridView1.ColumnHeadersVisible = false;
this.dataGridView1.EditMode = System.Windows.Forms.DataGridViewEditMode.EditOnEnter;
this.dataGridView1.Location = new System.Drawing.Point(6, 6);
this.dataGridView1.MultiSelect = false;
this.dataGridView1.Name = "dataGridView1";
this.dataGridView1.RowHeadersVisible = false;
this.dataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.CellSelect;
this.dataGridView1.ShowEditingIcon = false;
this.dataGridView1.Size = new System.Drawing.Size(249, 548);
this.dataGridView1.TabIndex = 16;
this.dataGridView1.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dropclick);
this.L_TownName.Location = new System.Drawing.Point(261, 9);
this.L_TownName.Name = "L_TownName";
this.L_TownName.Size = new System.Drawing.Size(100, 23);
this.L_TownName.TabIndex = 18;
this.L_TownName.Text = "Town Name:";
this.L_TownName.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// L_GrassShape
//
this.L_GrassShape.Location = new System.Drawing.Point(261, 63);
this.L_GrassShape.Name = "L_GrassShape";
this.L_GrassShape.Size = new System.Drawing.Size(100, 23);
this.L_GrassShape.TabIndex = 22;
this.L_GrassShape.Text = "Grass Shape:";
this.L_GrassShape.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// CB_GrassShape
//
this.CB_GrassShape.FormattingEnabled = true;
this.CB_GrassShape.Items.AddRange(new object[] {
"Triangle (Square)",
"Circle (Star)",
"Square (Circle)"});
this.CB_GrassShape.Location = new System.Drawing.Point(367, 65);
this.CB_GrassShape.Name = "CB_GrassShape";
this.CB_GrassShape.Size = new System.Drawing.Size(121, 21);
this.CB_GrassShape.TabIndex = 21;
//
// L_TownHallColor
//
this.L_TownHallColor.Location = new System.Drawing.Point(261, 90);
this.L_TownHallColor.Name = "L_TownHallColor";
this.L_TownHallColor.Size = new System.Drawing.Size(100, 23);
this.L_TownHallColor.TabIndex = 24;
this.L_TownHallColor.Text = "Town Hall Color:";
this.L_TownHallColor.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// CB_TownHallColor
//
this.CB_TownHallColor.Enabled = false;
this.CB_TownHallColor.FormattingEnabled = true;
this.CB_TownHallColor.Items.AddRange(new object[] {
"Gray",
"Brown",
"Green",
"Blue"});
this.CB_TownHallColor.Location = new System.Drawing.Point(367, 92);
this.CB_TownHallColor.Name = "CB_TownHallColor";
this.CB_TownHallColor.Size = new System.Drawing.Size(121, 21);
this.CB_TownHallColor.TabIndex = 23;
//
// L_TrainStationColor
//
this.L_TrainStationColor.Location = new System.Drawing.Point(261, 117);
this.L_TrainStationColor.Name = "L_TrainStationColor";
this.L_TrainStationColor.Size = new System.Drawing.Size(100, 23);
this.L_TrainStationColor.TabIndex = 26;
this.L_TrainStationColor.Text = "Train Station Color:";
this.L_TrainStationColor.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// CB_TrainStationColor
//
this.CB_TrainStationColor.Enabled = false;
this.CB_TrainStationColor.FormattingEnabled = true;
this.CB_TrainStationColor.Items.AddRange(new object[] {
"Red",
"Green",
"Blue",
"Brown"});
this.CB_TrainStationColor.Location = new System.Drawing.Point(367, 119);
this.CB_TrainStationColor.Name = "CB_TrainStationColor";
this.CB_TrainStationColor.Size = new System.Drawing.Size(121, 21);
this.CB_TrainStationColor.TabIndex = 25;
//
// L_NativeFruit
//
this.L_NativeFruit.Location = new System.Drawing.Point(261, 36);
this.L_NativeFruit.Name = "L_NativeFruit";
this.L_NativeFruit.Size = new System.Drawing.Size(100, 23);
this.L_NativeFruit.TabIndex = 28;
this.L_NativeFruit.Text = "Native Fruit:";
this.L_NativeFruit.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// CB_NativeFruit
//
this.CB_NativeFruit.FormattingEnabled = true;
this.CB_NativeFruit.Items.AddRange(new object[] {
"(None)",
"Apple",
"Orange",
"Pear",
"Peach",
"Cherry",
"Coconut*",
"Durian*",
"Lemon*",
"Lychee*",
"Mango*",
"Persimmon*",
"Banana*"});
this.CB_NativeFruit.Location = new System.Drawing.Point(367, 38);
this.CB_NativeFruit.Name = "CB_NativeFruit";
this.CB_NativeFruit.Size = new System.Drawing.Size(121, 21);
this.CB_NativeFruit.TabIndex = 27;
//
// L_HoursPlayed
//
this.L_HoursPlayed.Location = new System.Drawing.Point(261, 185);
this.L_HoursPlayed.Name = "L_HoursPlayed";
this.L_HoursPlayed.Size = new System.Drawing.Size(100, 23);
this.L_HoursPlayed.TabIndex = 32;
this.L_HoursPlayed.Text = "Hours:";
this.L_HoursPlayed.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// L_MinutesPlayed
//
this.L_MinutesPlayed.Location = new System.Drawing.Point(261, 211);
this.L_MinutesPlayed.Name = "L_MinutesPlayed";
this.L_MinutesPlayed.Size = new System.Drawing.Size(100, 23);
this.L_MinutesPlayed.TabIndex = 34;
this.L_MinutesPlayed.Text = "Minutes:";
this.L_MinutesPlayed.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// L_SecondsPlayed
//
this.L_SecondsPlayed.Location = new System.Drawing.Point(261, 237);
this.L_SecondsPlayed.Name = "L_SecondsPlayed";
this.L_SecondsPlayed.Size = new System.Drawing.Size(100, 23);
this.L_SecondsPlayed.TabIndex = 36;
this.L_SecondsPlayed.Text = "Seconds:";
this.L_SecondsPlayed.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// L_OverallDays
//
this.L_OverallDays.Location = new System.Drawing.Point(261, 279);
this.L_OverallDays.Name = "L_OverallDays";
this.L_OverallDays.Size = new System.Drawing.Size(100, 23);
this.L_OverallDays.TabIndex = 38;
this.L_OverallDays.Text = "Overall Days:";
this.L_OverallDays.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// L_DaysPlayed
//
this.L_DaysPlayed.Location = new System.Drawing.Point(261, 159);
this.L_DaysPlayed.Name = "L_DaysPlayed";
this.L_DaysPlayed.Size = new System.Drawing.Size(100, 23);
this.L_DaysPlayed.TabIndex = 40;
this.L_DaysPlayed.Text = "Days:";
this.L_DaysPlayed.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// NUD_Seconds
//
this.NUD_Seconds.Location = new System.Drawing.Point(367, 240);
this.NUD_Seconds.Maximum = new decimal(new int[] {
60,
0,
0,
0});
this.NUD_Seconds.Name = "NUD_Seconds";
this.NUD_Seconds.Size = new System.Drawing.Size(35, 20);
this.NUD_Seconds.TabIndex = 42;
this.NUD_Seconds.Value = new decimal(new int[] {
10,
0,
0,
0});
//
// NUD_Minutes
//
this.NUD_Minutes.Location = new System.Drawing.Point(367, 214);
this.NUD_Minutes.Maximum = new decimal(new int[] {
60,
0,
0,
0});
this.NUD_Minutes.Name = "NUD_Minutes";
this.NUD_Minutes.Size = new System.Drawing.Size(35, 20);
this.NUD_Minutes.TabIndex = 43;
this.NUD_Minutes.Value = new decimal(new int[] {
10,
0,
0,
0});
//
// NUD_Hours
//
this.NUD_Hours.Location = new System.Drawing.Point(367, 188);
this.NUD_Hours.Maximum = new decimal(new int[] {
24,
0,
0,
0});
this.NUD_Hours.Name = "NUD_Hours";
this.NUD_Hours.Size = new System.Drawing.Size(35, 20);
this.NUD_Hours.TabIndex = 44;
this.NUD_Hours.Value = new decimal(new int[] {
10,
0,
0,
0});
//
// NUD_Days
//
this.NUD_Days.Location = new System.Drawing.Point(367, 162);
this.NUD_Days.Maximum = new decimal(new int[] {
25000,
0,
0,
0});
this.NUD_Days.Name = "NUD_Days";
this.NUD_Days.Size = new System.Drawing.Size(52, 20);
this.NUD_Days.TabIndex = 45;
this.NUD_Days.Value = new decimal(new int[] {
1000,
0,
0,
0});
//
// NUD_OverallDays
//
this.NUD_OverallDays.Location = new System.Drawing.Point(367, 282);
this.NUD_OverallDays.Maximum = new decimal(new int[] {
25000,
0,
0,
0});
this.NUD_OverallDays.Name = "NUD_OverallDays";
this.NUD_OverallDays.Size = new System.Drawing.Size(52, 20);
this.NUD_OverallDays.TabIndex = 46;
this.NUD_OverallDays.Value = new decimal(new int[] {
1000,
0,
0,
0});
//
// Garden
//
@ -2451,11 +2741,17 @@ private void InitializeComponent()
((System.ComponentModel.ISupportInitialize)(this.PB_P0Dresser1)).EndInit();
this.tabPage4.ResumeLayout(false);
this.tabPage4.PerformLayout();
this.tabPage5.ResumeLayout(false);
this.tabPage5.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.PB_JPEG1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.PB_JPEG2)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.PB_JPEG3)).EndInit();
this.tabPage5.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.NUD_Seconds)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.NUD_Minutes)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.NUD_Hours)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.NUD_Days)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.NUD_OverallDays)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
@ -2644,5 +2940,25 @@ private void InitializeComponent()
private System.Windows.Forms.TextBox TB_VillagerCatch1;
private System.Windows.Forms.TabPage tabPage5;
private System.Windows.Forms.DataGridView dataGridView1;
private System.Windows.Forms.Label L_TownName;
private System.Windows.Forms.TextBox TB_TownName;
private System.Windows.Forms.Label L_TrainStationColor;
private System.Windows.Forms.ComboBox CB_TrainStationColor;
private System.Windows.Forms.Label L_TownHallColor;
private System.Windows.Forms.ComboBox CB_TownHallColor;
private System.Windows.Forms.Label L_GrassShape;
private System.Windows.Forms.ComboBox CB_GrassShape;
private System.Windows.Forms.Label L_NativeFruit;
private System.Windows.Forms.ComboBox CB_NativeFruit;
private System.Windows.Forms.Label L_OverallDays;
private System.Windows.Forms.Label L_SecondsPlayed;
private System.Windows.Forms.Label L_MinutesPlayed;
private System.Windows.Forms.Label L_HoursPlayed;
private System.Windows.Forms.Label L_DaysPlayed;
private System.Windows.Forms.NumericUpDown NUD_OverallDays;
private System.Windows.Forms.NumericUpDown NUD_Days;
private System.Windows.Forms.NumericUpDown NUD_Hours;
private System.Windows.Forms.NumericUpDown NUD_Minutes;
private System.Windows.Forms.NumericUpDown NUD_Seconds;
}
}

View File

@ -220,19 +220,24 @@ private void B_Export_Click(object sender, EventArgs e)
private GardenData Save;
class GardenData
{
public DataRef TownName = new DataRef(0x5C7BA, 0x12);
public string TownName;
public int TownHallColor;
public int TrainStationColor;
public int GrassType;
public int NativeFruit;
public uint SecondsPlayed;
public ushort PlayDays;
public byte[] Data;
public GardenData(byte[] data)
{
Data = data;
TownName = Encoding.Unicode.GetString(Data.Skip(0x5C7BA).Take(0x12).ToArray()).Trim('\0');
GrassType = Data[0x4DA81];
TownHallColor = Data[0x5C7B8] & 3;
TrainStationColor = Data[0x5C7B9] & 3;
NativeFruit = Data[0x5C836];
SecondsPlayed = BitConverter.ToUInt32(Data, 0x5C7B0);
PlayDays = BitConverter.ToUInt16(Data, 0x5C83A);
}
public byte[] Write()
{
@ -240,6 +245,9 @@ public byte[] Write()
Data[0x5C7B8] = (byte)((Data[0x5C7B8] & 0xFC) | TownHallColor);
Data[0x5C7B9] = (byte)((Data[0x5C7B9] & 0xFC) | TrainStationColor);
Data[0x5C836] = (byte)NativeFruit;
Array.Copy(BitConverter.GetBytes(SecondsPlayed), 0, Data, 0x5C7B0, 4);
Array.Copy(BitConverter.GetBytes(PlayDays), 0, Data, 0x5C83A, 2);
return Data;
}
}
@ -441,11 +449,23 @@ private void loadData()
loadVillager(i);
// Load Overall
string Town = Save.TownName.getString(Save.Data);
L_Info.Text = String.Format("{1}{0}{0}Inhabitants:{0}{2}{0}{3}{0}{4}{0}{5}", Environment.NewLine,
Town,
Players[0].Name, Players[1].Name, Players[2].Name, Players[3].Name);
{
TB_TownName.Text = Save.TownName;
CB_GrassShape.SelectedIndex = Save.GrassType;
CB_NativeFruit.SelectedIndex = Save.NativeFruit;
CB_TownHallColor.SelectedIndex = Save.TownHallColor;
CB_TrainStationColor.SelectedIndex = Save.TrainStationColor;
NUD_Seconds.Value = Save.SecondsPlayed % 60;
NUD_Minutes.Value = (Save.SecondsPlayed / 60) % 60;
NUD_Hours.Value = (Save.SecondsPlayed / 3600) % 24;
NUD_Days.Value = (Save.SecondsPlayed / 86400) % 25000;
NUD_OverallDays.Value = Save.PlayDays;
}
L_Info.Text = String.Format("{1}{0}{0}Inhabitants:{0}{2}{0}{3}{0}{4}{0}{5}", Environment.NewLine,
Save.TownName,
Players[0].Name, Players[1].Name, Players[2].Name, Players[3].Name);
loaded = true;
}
private void saveData()
@ -479,7 +499,21 @@ private void saveData()
saveVillager(i);
// Write Overall
{
Save.TownName = TB_TownName.Text;
Save.GrassType = CB_GrassShape.SelectedIndex;
Save.NativeFruit = CB_NativeFruit.SelectedIndex;
Save.TownHallColor = CB_TownHallColor.SelectedIndex;
Save.TrainStationColor = CB_TrainStationColor.SelectedIndex;
Save.SecondsPlayed = 0;
Save.SecondsPlayed += (uint)NUD_Seconds.Value;
Save.SecondsPlayed += (uint)NUD_Minutes.Value * 60;
Save.SecondsPlayed += (uint)NUD_Hours.Value * 3600;
Save.SecondsPlayed += (uint)NUD_Days.Value * 86400;
Save.PlayDays = (ushort)NUD_OverallDays.Value;
}
// Finish
Main.SaveData = Save.Write();
}
@ -969,7 +1003,7 @@ private void changeItemID(object sender, EventArgs e)
currentItem.Flag1.ToString("X2"),
currentItem.ID.ToString("X4"));
}
private void EnterKey(Object sender, KeyPressEventArgs e)
private void EnterKey(object sender, KeyPressEventArgs e)
{
// this will only allow valid hex values [0-9][a-f][A-F] to be entered. See ASCII table
char c = e.KeyChar;