From f3d291e68121f54189b370e02e0623caca96ebc1 Mon Sep 17 00:00:00 2001 From: Kurt Date: Thu, 2 Apr 2020 15:38:08 -0700 Subject: [PATCH] Merge flag2 back in to count ok sciresm u happy now --- NHSE.Core/Structures/Item/Item.cs | 11 +++--- NHSE.Sprites/ItemSprite.cs | 2 -- NHSE.WinForms/Controls/ItemEditor.Designer.cs | 34 ++----------------- NHSE.WinForms/Controls/ItemEditor.cs | 2 -- 4 files changed, 6 insertions(+), 43 deletions(-) diff --git a/NHSE.Core/Structures/Item/Item.cs b/NHSE.Core/Structures/Item/Item.cs index d5c5845..15ec58f 100644 --- a/NHSE.Core/Structures/Item/Item.cs +++ b/NHSE.Core/Structures/Item/Item.cs @@ -19,8 +19,7 @@ public class Item public ushort ItemId; public byte Flags0; public byte Flags1; - public byte Count; - public byte Flags2; + public ushort Count; public ushort UseCount; public ItemType Type => (ItemType) (Flags1 & 3); @@ -28,12 +27,11 @@ public class Item public Item() { } // marshalling - public Item(ushort itemId = NONE, byte flags0 = 0, byte flags1 = 0, byte count = 0, byte flags2 = 0, ushort useCount = 0) + public Item(ushort itemId = NONE, byte flags0 = 0, byte flags1 = 0, byte count = 0, ushort useCount = 0) { ItemId = itemId; Flags0 = flags0; Flags1 = flags1; - Flags2 = flags2; Count = count; UseCount = useCount; } @@ -41,8 +39,8 @@ public Item(ushort itemId = NONE, byte flags0 = 0, byte flags1 = 0, byte count = public void Delete() { ItemId = NONE; - Flags0 = Flags1 = Flags2 = Count = 0; - UseCount = 0; + Flags0 = Flags1 = 0; + Count = UseCount = 0; } public void CopyFrom(Item item) @@ -50,7 +48,6 @@ public void CopyFrom(Item item) ItemId = item.ItemId; Flags0 = item.Flags0; Flags1 = item.Flags1; - Flags2 = item.Flags2; Count = item.Count; UseCount = item.UseCount; } diff --git a/NHSE.Sprites/ItemSprite.cs b/NHSE.Sprites/ItemSprite.cs index d1b20e5..bf741b6 100644 --- a/NHSE.Sprites/ItemSprite.cs +++ b/NHSE.Sprites/ItemSprite.cs @@ -65,8 +65,6 @@ private static void DrawInfo(Graphics gfx, Font font, Item item, int x1, int y1, gfx.DrawString(item.Flags0.ToString(), font, brush, x1 + 20, y1 + 0); if (item.Flags1 != 0) gfx.DrawString(item.Flags1.ToString(), font, brush, x1 + 0, y1 + 20); - if (item.Flags2 != 0) - gfx.DrawString(item.Flags2.ToString(), font, brush, x1 + 20, y1 + 20); } private static Color GetItemColor(Item item) diff --git a/NHSE.WinForms/Controls/ItemEditor.Designer.cs b/NHSE.WinForms/Controls/ItemEditor.Designer.cs index 7849460..21da38c 100644 --- a/NHSE.WinForms/Controls/ItemEditor.Designer.cs +++ b/NHSE.WinForms/Controls/ItemEditor.Designer.cs @@ -38,8 +38,6 @@ private void InitializeComponent() this.NUD_Flag0 = new System.Windows.Forms.NumericUpDown(); this.L_Flag1 = new System.Windows.Forms.Label(); this.NUD_Flag1 = new System.Windows.Forms.NumericUpDown(); - this.L_Flag2 = new System.Windows.Forms.Label(); - this.NUD_Flag2 = new System.Windows.Forms.NumericUpDown(); this.CM_Hand = new System.Windows.Forms.ContextMenuStrip(this.components); this.Menu_View = new System.Windows.Forms.ToolStripMenuItem(); this.Menu_Set = new System.Windows.Forms.ToolStripMenuItem(); @@ -48,7 +46,6 @@ private void InitializeComponent() ((System.ComponentModel.ISupportInitialize)(this.NUD_Uses)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.NUD_Flag0)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.NUD_Flag1)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.NUD_Flag2)).BeginInit(); this.CM_Hand.SuspendLayout(); this.SuspendLayout(); // @@ -67,7 +64,7 @@ private void InitializeComponent() // this.NUD_Count.Location = new System.Drawing.Point(88, 28); this.NUD_Count.Maximum = new decimal(new int[] { - 255, + 65535, 0, 0, 0}); @@ -97,7 +94,7 @@ private void InitializeComponent() // this.NUD_Uses.Location = new System.Drawing.Point(88, 51); this.NUD_Uses.Maximum = new decimal(new int[] { - 255, + 65535, 0, 0, 0}); @@ -149,28 +146,6 @@ private void InitializeComponent() this.NUD_Flag1.Size = new System.Drawing.Size(56, 20); this.NUD_Flag1.TabIndex = 12; // - // L_Flag2 - // - this.L_Flag2.Location = new System.Drawing.Point(3, 119); - this.L_Flag2.Name = "L_Flag2"; - this.L_Flag2.Size = new System.Drawing.Size(79, 20); - this.L_Flag2.TabIndex = 15; - this.L_Flag2.Text = "Flag2:"; - this.L_Flag2.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // - // NUD_Flag2 - // - this.NUD_Flag2.Hexadecimal = true; - this.NUD_Flag2.Location = new System.Drawing.Point(88, 120); - this.NUD_Flag2.Maximum = new decimal(new int[] { - 255, - 0, - 0, - 0}); - this.NUD_Flag2.Name = "NUD_Flag2"; - this.NUD_Flag2.Size = new System.Drawing.Size(56, 20); - this.NUD_Flag2.TabIndex = 14; - // // CM_Hand // this.CM_Hand.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { @@ -202,8 +177,6 @@ private void InitializeComponent() // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Controls.Add(this.L_Flag2); - this.Controls.Add(this.NUD_Flag2); this.Controls.Add(this.L_Flag1); this.Controls.Add(this.NUD_Flag1); this.Controls.Add(this.L_Flag0); @@ -219,7 +192,6 @@ private void InitializeComponent() ((System.ComponentModel.ISupportInitialize)(this.NUD_Uses)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.NUD_Flag0)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.NUD_Flag1)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.NUD_Flag2)).EndInit(); this.CM_Hand.ResumeLayout(false); this.ResumeLayout(false); @@ -235,8 +207,6 @@ private void InitializeComponent() private System.Windows.Forms.NumericUpDown NUD_Flag0; private System.Windows.Forms.Label L_Flag1; private System.Windows.Forms.NumericUpDown NUD_Flag1; - private System.Windows.Forms.Label L_Flag2; - private System.Windows.Forms.NumericUpDown NUD_Flag2; private System.Windows.Forms.ContextMenuStrip CM_Hand; private System.Windows.Forms.ToolStripMenuItem Menu_View; private System.Windows.Forms.ToolStripMenuItem Menu_Set; diff --git a/NHSE.WinForms/Controls/ItemEditor.cs b/NHSE.WinForms/Controls/ItemEditor.cs index 4cf2e0f..37d7534 100644 --- a/NHSE.WinForms/Controls/ItemEditor.cs +++ b/NHSE.WinForms/Controls/ItemEditor.cs @@ -27,7 +27,6 @@ public Item LoadItem(Item item) NUD_Uses.Value = item.UseCount; NUD_Flag0.Value = item.Flags0; NUD_Flag1.Value = item.Flags1; - NUD_Flag2.Value = item.Flags2; return item; } @@ -39,7 +38,6 @@ public Item SetItem(Item item) item.UseCount = (ushort) NUD_Uses.Value; item.Flags0 = (byte) NUD_Flag0.Value; item.Flags1 = (byte) NUD_Flag1.Value; - item.Flags2 = (byte) NUD_Flag2.Value; return item; } }