diff --git a/Core.cs b/Core.cs index 9f19a39..250bf5f 100644 --- a/Core.cs +++ b/Core.cs @@ -191,12 +191,12 @@ public string FormatKey(string key) return value; return errReturn; - case "shake": - string shake_type = this.GetValue("type"); + case "spread": + string spread_type = this.GetValue("type"); - if (shake_type == "Grip" || - shake_type == "Barrel" || - shake_type == "Tactical") + if (spread_type == "Grip" || + spread_type == "Barrel" || + spread_type == "Tactical") return value; return errReturn; @@ -240,8 +240,10 @@ public enum CompareModes VehicleHealth, StructureCapacity, BuildingHealth, - Shake, - BarrelDamage, + Spread, + Recoil_X, + Recoil_Y, + BarrelDamage, BarrelVolume, AmmoAmount } @@ -265,13 +267,25 @@ public static int CompareTo(this Item a, Item val, CompareModes mode) case CompareModes.VehicleHealth: return (val.GetValue("type") == "Vehicle" ? val.GetValue("health", "0").ToFloat() : 0) .CompareTo(a.GetValue("type") == "Vehicle" ? a.GetValue("health", "0").ToFloat() : 0); - case CompareModes.Shake: - string shake_type_a = a.GetValue("type"), - shake_type_val = val.GetValue("type"); - - return (shake_type_a == "Grip" || shake_type_a == "Barrel" || shake_type_a == "Tactical" ? a.GetValue("shake", "1").ToFloat() : 1) - .CompareTo(shake_type_val == "Grip" || shake_type_val == "Barrel" || shake_type_val == "Tactical" ? val.GetValue("shake", "1").ToFloat() : 1); - case CompareModes.BarrelDamage: + case CompareModes.Spread: + string spread_type_a = a.GetValue("type"), + spread_type_val = val.GetValue("type"); + + return (spread_type_a == "Grip" || spread_type_a == "Barrel" || spread_type_a == "Tactical" ? a.GetValue("spread", "1").ToFloat() : 1) + .CompareTo(spread_type_val == "Grip" || spread_type_val == "Barrel" || spread_type_val == "Tactical" ? val.GetValue("spread", "1").ToFloat() : 1); + case CompareModes.Recoil_X: + string recoil_x_type_a = a.GetValue("type"), + recoil_x_type_val = val.GetValue("type"); + + return (recoil_x_type_a == "Grip" || recoil_x_type_a == "Barrel" || recoil_x_type_a == "Tactical" ? a.GetValue("recoil_x", "1").ToFloat() : 1) + .CompareTo(recoil_x_type_val == "Grip" || recoil_x_type_val == "Barrel" || recoil_x_type_val == "Tactical" ? val.GetValue("recoil_x", "1").ToFloat() : 1); + case CompareModes.Recoil_Y: + string recoil_y_type_a = a.GetValue("type"), + recoil_y_type_val = val.GetValue("type"); + + return (recoil_y_type_a == "Grip" || recoil_y_type_a == "Barrel" || recoil_y_type_a == "Tactical" ? a.GetValue("recoil_y", "1").ToFloat() : 1) + .CompareTo(recoil_y_type_val == "Grip" || recoil_y_type_val == "Barrel" || recoil_y_type_val == "Tactical" ? val.GetValue("recoil_y", "1").ToFloat() : 1); + case CompareModes.BarrelDamage: return (a.GetValue("type") == "Barrel" ? a.GetValue("damage", "0").ToFloat() : 0) .CompareTo(val.GetValue("type") == "Barrel" ? val.GetValue("damage", "0").ToFloat() : 0); case CompareModes.BarrelVolume: diff --git a/ItemList.Designer.cs b/ItemList.Designer.cs index 48591b8..e06fb86 100644 --- a/ItemList.Designer.cs +++ b/ItemList.Designer.cs @@ -53,7 +53,9 @@ private void InitializeComponent() this.AmmoAmountLabel = new System.Windows.Forms.Label(); this.damage = new System.Windows.Forms.TextBox(); this.volume = new System.Windows.Forms.TextBox(); - this.shake = new System.Windows.Forms.TextBox(); + this.recoil_y = new System.Windows.Forms.TextBox(); + this.recoil_x = new System.Windows.Forms.TextBox(); + this.spread = new System.Windows.Forms.TextBox(); this.health = new System.Windows.Forms.TextBox(); this.engine = new System.Windows.Forms.TextBox(); this.type = new System.Windows.Forms.TextBox(); @@ -65,8 +67,9 @@ private void InitializeComponent() this.player_skull_damage = new System.Windows.Forms.TextBox(); this.armor = new System.Windows.Forms.TextBox(); this.BarrelDamageLabel = new System.Windows.Forms.Label(); + this.Recoil_XYLabel = new System.Windows.Forms.Label(); this.VolumeLabel = new System.Windows.Forms.Label(); - this.ShakeLabel = new System.Windows.Forms.Label(); + this.SpreadLabel = new System.Windows.Forms.Label(); this.ItemHealthLabel = new System.Windows.Forms.Label(); this.EngineLabel = new System.Windows.Forms.Label(); this.RangeLabel = new System.Windows.Forms.Label(); @@ -83,17 +86,19 @@ private void InitializeComponent() this.SortCapacityBtn = new System.Windows.Forms.Button(); this.SortProtectionBtn = new System.Windows.Forms.Button(); this.SortingGroupBox = new System.Windows.Forms.GroupBox(); + this.SortByRecoilYBtn = new System.Windows.Forms.Button(); this.SortByPelletsBtn = new System.Windows.Forms.Button(); this.SortByAmmoAmountBtn = new System.Windows.Forms.Button(); this.SortByLabel = new System.Windows.Forms.Label(); this.SortByBarrelDamageBtn = new System.Windows.Forms.Button(); this.SortByVolumeBtn = new System.Windows.Forms.Button(); - this.SortByShakeBtn = new System.Windows.Forms.Button(); + this.SortBySpreadBtn = new System.Windows.Forms.Button(); this.SortByBuildingHealthBtn = new System.Windows.Forms.Button(); this.SortBarricadeCapacityBtn = new System.Windows.Forms.Button(); this.SortVehicleHealthBtn = new System.Windows.Forms.Button(); this.SortDamageBuildingsBtn = new System.Windows.Forms.Button(); this.MixBtn = new System.Windows.Forms.Button(); + this.SortByRecoilXBtn = new System.Windows.Forms.Button(); this.InfoGroupBox.SuspendLayout(); this.ItemStatsGroupBox.SuspendLayout(); this.SortingGroupBox.SuspendLayout(); @@ -114,7 +119,7 @@ private void InitializeComponent() this.ResultsListBox.FormattingEnabled = true; this.ResultsListBox.Location = new System.Drawing.Point(12, 29); this.ResultsListBox.Name = "ResultsListBox"; - this.ResultsListBox.Size = new System.Drawing.Size(167, 550); + this.ResultsListBox.Size = new System.Drawing.Size(167, 563); this.ResultsListBox.TabIndex = 6; this.ResultsListBox.TabStop = false; this.ResultsListBox.SelectedIndexChanged += new System.EventHandler(this.ResultsListBox_SelectedIndexChanged); @@ -235,7 +240,9 @@ private void InitializeComponent() this.ItemStatsGroupBox.Controls.Add(this.AmmoAmountLabel); this.ItemStatsGroupBox.Controls.Add(this.damage); this.ItemStatsGroupBox.Controls.Add(this.volume); - this.ItemStatsGroupBox.Controls.Add(this.shake); + this.ItemStatsGroupBox.Controls.Add(this.recoil_y); + this.ItemStatsGroupBox.Controls.Add(this.recoil_x); + this.ItemStatsGroupBox.Controls.Add(this.spread); this.ItemStatsGroupBox.Controls.Add(this.health); this.ItemStatsGroupBox.Controls.Add(this.engine); this.ItemStatsGroupBox.Controls.Add(this.type); @@ -247,8 +254,9 @@ private void InitializeComponent() this.ItemStatsGroupBox.Controls.Add(this.player_skull_damage); this.ItemStatsGroupBox.Controls.Add(this.armor); this.ItemStatsGroupBox.Controls.Add(this.BarrelDamageLabel); + this.ItemStatsGroupBox.Controls.Add(this.Recoil_XYLabel); this.ItemStatsGroupBox.Controls.Add(this.VolumeLabel); - this.ItemStatsGroupBox.Controls.Add(this.ShakeLabel); + this.ItemStatsGroupBox.Controls.Add(this.SpreadLabel); this.ItemStatsGroupBox.Controls.Add(this.ItemHealthLabel); this.ItemStatsGroupBox.Controls.Add(this.EngineLabel); this.ItemStatsGroupBox.Controls.Add(this.RangeLabel); @@ -263,14 +271,14 @@ private void InitializeComponent() this.ItemStatsGroupBox.Controls.Add(this.item_capacity); this.ItemStatsGroupBox.Location = new System.Drawing.Point(185, 164); this.ItemStatsGroupBox.Name = "ItemStatsGroupBox"; - this.ItemStatsGroupBox.Size = new System.Drawing.Size(344, 414); + this.ItemStatsGroupBox.Size = new System.Drawing.Size(344, 434); this.ItemStatsGroupBox.TabIndex = 4; this.ItemStatsGroupBox.TabStop = false; this.ItemStatsGroupBox.Text = "Item Stats"; // // LinkedGunsBtn // - this.LinkedGunsBtn.Location = new System.Drawing.Point(258, 384); + this.LinkedGunsBtn.Location = new System.Drawing.Point(258, 404); this.LinkedGunsBtn.Name = "LinkedGunsBtn"; this.LinkedGunsBtn.Size = new System.Drawing.Size(80, 23); this.LinkedGunsBtn.TabIndex = 34; @@ -280,7 +288,7 @@ private void InitializeComponent() // // LinkedModulesBtn // - this.LinkedModulesBtn.Location = new System.Drawing.Point(258, 362); + this.LinkedModulesBtn.Location = new System.Drawing.Point(258, 382); this.LinkedModulesBtn.Name = "LinkedModulesBtn"; this.LinkedModulesBtn.Size = new System.Drawing.Size(80, 23); this.LinkedModulesBtn.TabIndex = 36; @@ -290,7 +298,7 @@ private void InitializeComponent() // // LinkedAmmoBtn // - this.LinkedAmmoBtn.Location = new System.Drawing.Point(258, 340); + this.LinkedAmmoBtn.Location = new System.Drawing.Point(258, 360); this.LinkedAmmoBtn.Name = "LinkedAmmoBtn"; this.LinkedAmmoBtn.Size = new System.Drawing.Size(80, 23); this.LinkedAmmoBtn.TabIndex = 32; @@ -323,7 +331,7 @@ private void InitializeComponent() // this.LinkedModulesLabel.AutoSize = true; this.LinkedModulesLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); - this.LinkedModulesLabel.Location = new System.Drawing.Point(6, 356); + this.LinkedModulesLabel.Location = new System.Drawing.Point(6, 376); this.LinkedModulesLabel.Name = "LinkedModulesLabel"; this.LinkedModulesLabel.Size = new System.Drawing.Size(124, 20); this.LinkedModulesLabel.TabIndex = 35; @@ -333,7 +341,7 @@ private void InitializeComponent() // this.LinkedGunsLabel.AutoSize = true; this.LinkedGunsLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); - this.LinkedGunsLabel.Location = new System.Drawing.Point(6, 376); + this.LinkedGunsLabel.Location = new System.Drawing.Point(6, 396); this.LinkedGunsLabel.Name = "LinkedGunsLabel"; this.LinkedGunsLabel.Size = new System.Drawing.Size(99, 20); this.LinkedGunsLabel.TabIndex = 33; @@ -343,7 +351,7 @@ private void InitializeComponent() // this.LinkedAmmoLabel.AutoSize = true; this.LinkedAmmoLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); - this.LinkedAmmoLabel.Location = new System.Drawing.Point(6, 336); + this.LinkedAmmoLabel.Location = new System.Drawing.Point(6, 356); this.LinkedAmmoLabel.Name = "LinkedAmmoLabel"; this.LinkedAmmoLabel.Size = new System.Drawing.Size(108, 20); this.LinkedAmmoLabel.TabIndex = 31; @@ -392,16 +400,38 @@ private void InitializeComponent() this.volume.TabStop = false; this.volume.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; // - // shake - // - this.shake.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); - this.shake.Location = new System.Drawing.Point(259, 238); - this.shake.Name = "shake"; - this.shake.ReadOnly = true; - this.shake.Size = new System.Drawing.Size(79, 22); - this.shake.TabIndex = 22; - this.shake.TabStop = false; - this.shake.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + // recoil_y + // + this.recoil_y.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.recoil_y.Location = new System.Drawing.Point(298, 338); + this.recoil_y.Name = "recoil_y"; + this.recoil_y.ReadOnly = true; + this.recoil_y.Size = new System.Drawing.Size(40, 22); + this.recoil_y.TabIndex = 22; + this.recoil_y.TabStop = false; + this.recoil_y.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + // + // recoil_x + // + this.recoil_x.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.recoil_x.Location = new System.Drawing.Point(259, 338); + this.recoil_x.Name = "recoil_x"; + this.recoil_x.ReadOnly = true; + this.recoil_x.Size = new System.Drawing.Size(40, 22); + this.recoil_x.TabIndex = 22; + this.recoil_x.TabStop = false; + this.recoil_x.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + // + // spread + // + this.spread.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.spread.Location = new System.Drawing.Point(259, 238); + this.spread.Name = "spread"; + this.spread.ReadOnly = true; + this.spread.Size = new System.Drawing.Size(79, 22); + this.spread.TabIndex = 22; + this.spread.TabStop = false; + this.spread.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; // // health // @@ -523,6 +553,16 @@ private void InitializeComponent() this.BarrelDamageLabel.TabIndex = 27; this.BarrelDamageLabel.Text = "Barrel damage multiplier:"; // + // Recoil_XYLabel + // + this.Recoil_XYLabel.AutoSize = true; + this.Recoil_XYLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.Recoil_XYLabel.Location = new System.Drawing.Point(6, 336); + this.Recoil_XYLabel.Name = "Recoil_XYLabel"; + this.Recoil_XYLabel.Size = new System.Drawing.Size(87, 20); + this.Recoil_XYLabel.TabIndex = 23; + this.Recoil_XYLabel.Text = "Recoil X/Y:"; + // // VolumeLabel // this.VolumeLabel.AutoSize = true; @@ -533,15 +573,15 @@ private void InitializeComponent() this.VolumeLabel.TabIndex = 25; this.VolumeLabel.Text = "Suppressor volume multiplier:"; // - // ShakeLabel + // SpreadLabel // - this.ShakeLabel.AutoSize = true; - this.ShakeLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); - this.ShakeLabel.Location = new System.Drawing.Point(6, 236); - this.ShakeLabel.Name = "ShakeLabel"; - this.ShakeLabel.Size = new System.Drawing.Size(202, 20); - this.ShakeLabel.TabIndex = 23; - this.ShakeLabel.Text = "Grip/Barrel shake multiplier:"; + this.SpreadLabel.AutoSize = true; + this.SpreadLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.SpreadLabel.Location = new System.Drawing.Point(6, 236); + this.SpreadLabel.Name = "SpreadLabel"; + this.SpreadLabel.Size = new System.Drawing.Size(131, 20); + this.SpreadLabel.TabIndex = 23; + this.SpreadLabel.Text = "Spread multiplier:"; // // ItemHealthLabel // @@ -699,12 +739,14 @@ private void InitializeComponent() // // SortingGroupBox // + this.SortingGroupBox.Controls.Add(this.SortByRecoilXBtn); + this.SortingGroupBox.Controls.Add(this.SortByRecoilYBtn); this.SortingGroupBox.Controls.Add(this.SortByPelletsBtn); this.SortingGroupBox.Controls.Add(this.SortByAmmoAmountBtn); this.SortingGroupBox.Controls.Add(this.SortByLabel); this.SortingGroupBox.Controls.Add(this.SortByBarrelDamageBtn); this.SortingGroupBox.Controls.Add(this.SortByVolumeBtn); - this.SortingGroupBox.Controls.Add(this.SortByShakeBtn); + this.SortingGroupBox.Controls.Add(this.SortBySpreadBtn); this.SortingGroupBox.Controls.Add(this.SortByBuildingHealthBtn); this.SortingGroupBox.Controls.Add(this.SortBarricadeCapacityBtn); this.SortingGroupBox.Controls.Add(this.SortVehicleHealthBtn); @@ -715,11 +757,22 @@ private void InitializeComponent() this.SortingGroupBox.Controls.Add(this.SortDamagePlayersBtn); this.SortingGroupBox.Location = new System.Drawing.Point(536, 29); this.SortingGroupBox.Name = "SortingGroupBox"; - this.SortingGroupBox.Size = new System.Drawing.Size(191, 549); + this.SortingGroupBox.Size = new System.Drawing.Size(191, 560); this.SortingGroupBox.TabIndex = 0; this.SortingGroupBox.TabStop = false; this.SortingGroupBox.Text = "Sorting"; // + // SortByRecoilYBtn + // + this.SortByRecoilYBtn.Location = new System.Drawing.Point(9, 427); + this.SortByRecoilYBtn.Name = "SortByRecoilYBtn"; + this.SortByRecoilYBtn.Size = new System.Drawing.Size(173, 23); + this.SortByRecoilYBtn.TabIndex = 14; + this.SortByRecoilYBtn.TabStop = false; + this.SortByRecoilYBtn.Text = "Recoil Y"; + this.SortByRecoilYBtn.UseVisualStyleBackColor = true; + this.SortByRecoilYBtn.Click += new System.EventHandler(this.SortByRecoilYBtn_Click); + // // SortByPelletsBtn // this.SortByPelletsBtn.Location = new System.Drawing.Point(9, 369); @@ -774,16 +827,16 @@ private void InitializeComponent() this.SortByVolumeBtn.UseVisualStyleBackColor = true; this.SortByVolumeBtn.Click += new System.EventHandler(this.SortByVolumeBtn_Click); // - // SortByShakeBtn + // SortBySpreadBtn // - this.SortByShakeBtn.Location = new System.Drawing.Point(9, 252); - this.SortByShakeBtn.Name = "SortByShakeBtn"; - this.SortByShakeBtn.Size = new System.Drawing.Size(173, 23); - this.SortByShakeBtn.TabIndex = 8; - this.SortByShakeBtn.TabStop = false; - this.SortByShakeBtn.Text = "Shake"; - this.SortByShakeBtn.UseVisualStyleBackColor = true; - this.SortByShakeBtn.Click += new System.EventHandler(this.SortByShakeBtn_Click); + this.SortBySpreadBtn.Location = new System.Drawing.Point(9, 252); + this.SortBySpreadBtn.Name = "SortBySpreadBtn"; + this.SortBySpreadBtn.Size = new System.Drawing.Size(173, 23); + this.SortBySpreadBtn.TabIndex = 8; + this.SortBySpreadBtn.TabStop = false; + this.SortBySpreadBtn.Text = "Spread"; + this.SortBySpreadBtn.UseVisualStyleBackColor = true; + this.SortBySpreadBtn.Click += new System.EventHandler(this.SortBySpreadBtn_Click); // // SortByBuildingHealthBtn // @@ -831,7 +884,7 @@ private void InitializeComponent() // // MixBtn // - this.MixBtn.Location = new System.Drawing.Point(13, 520); + this.MixBtn.Location = new System.Drawing.Point(9, 531); this.MixBtn.Name = "MixBtn"; this.MixBtn.Size = new System.Drawing.Size(173, 23); this.MixBtn.TabIndex = 1; @@ -840,11 +893,22 @@ private void InitializeComponent() this.MixBtn.UseVisualStyleBackColor = true; this.MixBtn.Click += new System.EventHandler(this.MixBtn_Click); // + // SortByRecoilXBtn + // + this.SortByRecoilXBtn.Location = new System.Drawing.Point(9, 398); + this.SortByRecoilXBtn.Name = "SortByRecoilXBtn"; + this.SortByRecoilXBtn.Size = new System.Drawing.Size(173, 23); + this.SortByRecoilXBtn.TabIndex = 15; + this.SortByRecoilXBtn.TabStop = false; + this.SortByRecoilXBtn.Text = "Recoil X"; + this.SortByRecoilXBtn.UseVisualStyleBackColor = true; + this.SortByRecoilXBtn.Click += new System.EventHandler(this.SortByRecoilXBtn_Click); + // // ItemList // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(734, 583); + this.ClientSize = new System.Drawing.Size(734, 601); this.Controls.Add(this.SortingGroupBox); this.Controls.Add(this.ItemStatsGroupBox); this.Controls.Add(this.InfoGroupBox); @@ -906,9 +970,8 @@ private void InitializeComponent() private System.Windows.Forms.Button SortVehicleHealthBtn; private System.Windows.Forms.Button SortBarricadeCapacityBtn; private System.Windows.Forms.Button SortByBuildingHealthBtn; - private System.Windows.Forms.Button SortByShakeBtn; - private System.Windows.Forms.TextBox shake; - private System.Windows.Forms.Label ShakeLabel; + private System.Windows.Forms.Button SortBySpreadBtn; + private System.Windows.Forms.Label SpreadLabel; private System.Windows.Forms.TextBox volume; private System.Windows.Forms.Label VolumeLabel; private System.Windows.Forms.Button SortByVolumeBtn; @@ -932,5 +995,11 @@ private void InitializeComponent() private System.Windows.Forms.Label PelletsLabel; private System.Windows.Forms.Button SortByPelletsBtn; private System.Windows.Forms.Button MixBtn; + private System.Windows.Forms.TextBox spread; + private System.Windows.Forms.TextBox recoil_y; + private System.Windows.Forms.TextBox recoil_x; + private System.Windows.Forms.Label Recoil_XYLabel; + private System.Windows.Forms.Button SortByRecoilYBtn; + private System.Windows.Forms.Button SortByRecoilXBtn; } } \ No newline at end of file diff --git a/ItemList.cs b/ItemList.cs index 6316d7a..788f101 100644 --- a/ItemList.cs +++ b/ItemList.cs @@ -176,15 +176,15 @@ private void SortByBuildingHealthBtn_Click(object sender, EventArgs e) UpdateItemList(); } + + private void SortBySpreadBtn_Click(object sender, EventArgs e) + { + items.Sort((a, b) => a.CompareTo(b, Core.CompareModes.Spread)); - private void SortByShakeBtn_Click(object sender, EventArgs e) - { - items.Sort((a, b) => a.CompareTo(b, Core.CompareModes.Shake)); - - UpdateItemList(); - } + UpdateItemList(); + } - private void SortByBarrelDamageBtn_Click(object sender, EventArgs e) + private void SortByBarrelDamageBtn_Click(object sender, EventArgs e) { items.Sort((a, b) => a.CompareTo(b, Core.CompareModes.BarrelDamage)); @@ -245,7 +245,21 @@ private void SortByPelletsBtn_Click(object sender, EventArgs e) UpdateItemList(); } - private void SortByVolumeBtn_Click(object sender, EventArgs e) + private void SortByRecoilYBtn_Click(object sender, EventArgs e) + { + items.Sort((a, b) => a.CompareTo(b, Core.CompareModes.Recoil_Y)); + + UpdateItemList(); + } + + private void SortByRecoilXBtn_Click(object sender, EventArgs e) + { + items.Sort((a, b) => a.CompareTo(b, Core.CompareModes.Recoil_X)); + + UpdateItemList(); + } + + private void SortByVolumeBtn_Click(object sender, EventArgs e) { items.Sort((a, b) => a.CompareTo(b, Core.CompareModes.BarrelVolume)); diff --git a/ItemsCategories.Designer.cs b/ItemsCategories.Designer.cs index dd66aa3..520f7fd 100644 --- a/ItemsCategories.Designer.cs +++ b/ItemsCategories.Designer.cs @@ -32,11 +32,15 @@ private void InitializeComponent() this.HelmetsBtn = new System.Windows.Forms.Button(); this.ShirtsBtn = new System.Windows.Forms.Button(); this.ArmorGroupBox = new System.Windows.Forms.GroupBox(); + this.GlassesBtn = new System.Windows.Forms.Button(); + this.MasksBtn = new System.Windows.Forms.Button(); this.AllArmorBtn = new System.Windows.Forms.Button(); this.VestsBtn = new System.Windows.Forms.Button(); this.BackpacksBtn = new System.Windows.Forms.Button(); this.PantsBtn = new System.Windows.Forms.Button(); this.OtherGroupBox = new System.Windows.Forms.GroupBox(); + this.DetonatorsBtn = new System.Windows.Forms.Button(); + this.ChargesBtn = new System.Windows.Forms.Button(); this.SupplyBtn = new System.Windows.Forms.Button(); this.GrenadesBtn = new System.Windows.Forms.Button(); this.StructuresAndBarricadesBtn = new System.Windows.Forms.Button(); @@ -50,6 +54,7 @@ private void InitializeComponent() this.PlanesBtn = new System.Windows.Forms.Button(); this.HelicoptersBtn = new System.Windows.Forms.Button(); this.GunsGroupBox = new System.Windows.Forms.GroupBox(); + this.MeleeBtn = new System.Windows.Forms.Button(); this.AmmoBtn = new System.Windows.Forms.Button(); this.RaidItemsBtn = new System.Windows.Forms.Button(); this.TacticsBtn = new System.Windows.Forms.Button(); @@ -61,7 +66,7 @@ private void InitializeComponent() this.SemiGunsBtn = new System.Windows.Forms.Button(); this.SecondaryItemsBtn = new System.Windows.Forms.Button(); this.AutomaticWeaponsBtn = new System.Windows.Forms.Button(); - this.MeleeBtn = new System.Windows.Forms.Button(); + this.TrapsBtn = new System.Windows.Forms.Button(); this.ArmorGroupBox.SuspendLayout(); this.OtherGroupBox.SuspendLayout(); this.VehiclesGroup.SuspendLayout(); @@ -81,7 +86,7 @@ private void InitializeComponent() // // ShirtsBtn // - this.ShirtsBtn.Location = new System.Drawing.Point(6, 48); + this.ShirtsBtn.Location = new System.Drawing.Point(6, 106); this.ShirtsBtn.Name = "ShirtsBtn"; this.ShirtsBtn.Size = new System.Drawing.Size(132, 23); this.ShirtsBtn.TabIndex = 4; @@ -92,6 +97,8 @@ private void InitializeComponent() // // ArmorGroupBox // + this.ArmorGroupBox.Controls.Add(this.GlassesBtn); + this.ArmorGroupBox.Controls.Add(this.MasksBtn); this.ArmorGroupBox.Controls.Add(this.AllArmorBtn); this.ArmorGroupBox.Controls.Add(this.VestsBtn); this.ArmorGroupBox.Controls.Add(this.HelmetsBtn); @@ -100,14 +107,36 @@ private void InitializeComponent() this.ArmorGroupBox.Controls.Add(this.PantsBtn); this.ArmorGroupBox.Location = new System.Drawing.Point(170, 50); this.ArmorGroupBox.Name = "ArmorGroupBox"; - this.ArmorGroupBox.Size = new System.Drawing.Size(144, 193); + this.ArmorGroupBox.Size = new System.Drawing.Size(144, 254); this.ArmorGroupBox.TabIndex = 3; this.ArmorGroupBox.TabStop = false; this.ArmorGroupBox.Text = "Armor"; // + // GlassesBtn + // + this.GlassesBtn.Location = new System.Drawing.Point(6, 48); + this.GlassesBtn.Name = "GlassesBtn"; + this.GlassesBtn.Size = new System.Drawing.Size(132, 23); + this.GlassesBtn.TabIndex = 7; + this.GlassesBtn.TabStop = false; + this.GlassesBtn.Text = "Glasses"; + this.GlassesBtn.UseVisualStyleBackColor = true; + this.GlassesBtn.Click += new System.EventHandler(this.GlassesBtn_Click); + // + // MasksBtn + // + this.MasksBtn.Location = new System.Drawing.Point(6, 77); + this.MasksBtn.Name = "MasksBtn"; + this.MasksBtn.Size = new System.Drawing.Size(132, 23); + this.MasksBtn.TabIndex = 6; + this.MasksBtn.TabStop = false; + this.MasksBtn.Text = "Masks"; + this.MasksBtn.UseVisualStyleBackColor = true; + this.MasksBtn.Click += new System.EventHandler(this.MasksBtn_Click); + // // AllArmorBtn // - this.AllArmorBtn.Location = new System.Drawing.Point(6, 164); + this.AllArmorBtn.Location = new System.Drawing.Point(6, 222); this.AllArmorBtn.Name = "AllArmorBtn"; this.AllArmorBtn.Size = new System.Drawing.Size(132, 23); this.AllArmorBtn.TabIndex = 0; @@ -118,7 +147,7 @@ private void InitializeComponent() // // VestsBtn // - this.VestsBtn.Location = new System.Drawing.Point(6, 77); + this.VestsBtn.Location = new System.Drawing.Point(6, 135); this.VestsBtn.Name = "VestsBtn"; this.VestsBtn.Size = new System.Drawing.Size(132, 23); this.VestsBtn.TabIndex = 1; @@ -129,7 +158,7 @@ private void InitializeComponent() // // BackpacksBtn // - this.BackpacksBtn.Location = new System.Drawing.Point(6, 135); + this.BackpacksBtn.Location = new System.Drawing.Point(6, 193); this.BackpacksBtn.Name = "BackpacksBtn"; this.BackpacksBtn.Size = new System.Drawing.Size(132, 23); this.BackpacksBtn.TabIndex = 3; @@ -140,7 +169,7 @@ private void InitializeComponent() // // PantsBtn // - this.PantsBtn.Location = new System.Drawing.Point(6, 106); + this.PantsBtn.Location = new System.Drawing.Point(6, 164); this.PantsBtn.Name = "PantsBtn"; this.PantsBtn.Size = new System.Drawing.Size(132, 23); this.PantsBtn.TabIndex = 5; @@ -151,6 +180,9 @@ private void InitializeComponent() // // OtherGroupBox // + this.OtherGroupBox.Controls.Add(this.TrapsBtn); + this.OtherGroupBox.Controls.Add(this.DetonatorsBtn); + this.OtherGroupBox.Controls.Add(this.ChargesBtn); this.OtherGroupBox.Controls.Add(this.SupplyBtn); this.OtherGroupBox.Controls.Add(this.GrenadesBtn); this.OtherGroupBox.Controls.Add(this.StructuresAndBarricadesBtn); @@ -158,14 +190,36 @@ private void InitializeComponent() this.OtherGroupBox.Controls.Add(this.AllItemsBtn); this.OtherGroupBox.Location = new System.Drawing.Point(12, 50); this.OtherGroupBox.Name = "OtherGroupBox"; - this.OtherGroupBox.Size = new System.Drawing.Size(152, 193); + this.OtherGroupBox.Size = new System.Drawing.Size(152, 254); this.OtherGroupBox.TabIndex = 1; this.OtherGroupBox.TabStop = false; this.OtherGroupBox.Text = "Other"; // + // DetonatorsBtn + // + this.DetonatorsBtn.Location = new System.Drawing.Point(6, 135); + this.DetonatorsBtn.Name = "DetonatorsBtn"; + this.DetonatorsBtn.Size = new System.Drawing.Size(139, 23); + this.DetonatorsBtn.TabIndex = 13; + this.DetonatorsBtn.TabStop = false; + this.DetonatorsBtn.Text = "Detonators"; + this.DetonatorsBtn.UseVisualStyleBackColor = true; + this.DetonatorsBtn.Click += new System.EventHandler(this.DetonatorsBtn_Click); + // + // ChargesBtn + // + this.ChargesBtn.Location = new System.Drawing.Point(7, 106); + this.ChargesBtn.Name = "ChargesBtn"; + this.ChargesBtn.Size = new System.Drawing.Size(139, 23); + this.ChargesBtn.TabIndex = 12; + this.ChargesBtn.TabStop = false; + this.ChargesBtn.Text = "Charges"; + this.ChargesBtn.UseVisualStyleBackColor = true; + this.ChargesBtn.Click += new System.EventHandler(this.ChargesBtn_Click); + // // SupplyBtn // - this.SupplyBtn.Location = new System.Drawing.Point(6, 106); + this.SupplyBtn.Location = new System.Drawing.Point(7, 193); this.SupplyBtn.Name = "SupplyBtn"; this.SupplyBtn.Size = new System.Drawing.Size(139, 23); this.SupplyBtn.TabIndex = 11; @@ -209,7 +263,7 @@ private void InitializeComponent() // // AllItemsBtn // - this.AllItemsBtn.Location = new System.Drawing.Point(6, 164); + this.AllItemsBtn.Location = new System.Drawing.Point(6, 222); this.AllItemsBtn.Name = "AllItemsBtn"; this.AllItemsBtn.Size = new System.Drawing.Size(139, 23); this.AllItemsBtn.TabIndex = 3; @@ -237,7 +291,7 @@ private void InitializeComponent() this.VehiclesGroup.Controls.Add(this.HelicoptersBtn); this.VehiclesGroup.Location = new System.Drawing.Point(320, 50); this.VehiclesGroup.Name = "VehiclesGroup"; - this.VehiclesGroup.Size = new System.Drawing.Size(177, 193); + this.VehiclesGroup.Size = new System.Drawing.Size(177, 254); this.VehiclesGroup.TabIndex = 4; this.VehiclesGroup.TabStop = false; this.VehiclesGroup.Text = "Vehicles"; @@ -266,7 +320,7 @@ private void InitializeComponent() // // AllVehiclesBtn // - this.AllVehiclesBtn.Location = new System.Drawing.Point(6, 164); + this.AllVehiclesBtn.Location = new System.Drawing.Point(6, 222); this.AllVehiclesBtn.Name = "AllVehiclesBtn"; this.AllVehiclesBtn.Size = new System.Drawing.Size(165, 23); this.AllVehiclesBtn.TabIndex = 2; @@ -313,11 +367,21 @@ private void InitializeComponent() this.GunsGroupBox.Controls.Add(this.AutomaticWeaponsBtn); this.GunsGroupBox.Location = new System.Drawing.Point(503, 50); this.GunsGroupBox.Name = "GunsGroupBox"; - this.GunsGroupBox.Size = new System.Drawing.Size(274, 193); + this.GunsGroupBox.Size = new System.Drawing.Size(274, 254); this.GunsGroupBox.TabIndex = 5; this.GunsGroupBox.TabStop = false; this.GunsGroupBox.Text = "Guns"; // + // MeleeBtn + // + this.MeleeBtn.Location = new System.Drawing.Point(141, 135); + this.MeleeBtn.Name = "MeleeBtn"; + this.MeleeBtn.Size = new System.Drawing.Size(129, 23); + this.MeleeBtn.TabIndex = 11; + this.MeleeBtn.Text = "Melee"; + this.MeleeBtn.UseVisualStyleBackColor = true; + this.MeleeBtn.Click += new System.EventHandler(this.MeleeBtn_Click); + // // AmmoBtn // this.AmmoBtn.Location = new System.Drawing.Point(6, 135); @@ -364,7 +428,7 @@ private void InitializeComponent() // // AllCustomizeBtn // - this.AllCustomizeBtn.Location = new System.Drawing.Point(141, 164); + this.AllCustomizeBtn.Location = new System.Drawing.Point(139, 222); this.AllCustomizeBtn.Name = "AllCustomizeBtn"; this.AllCustomizeBtn.Size = new System.Drawing.Size(129, 23); this.AllCustomizeBtn.TabIndex = 3; @@ -397,7 +461,7 @@ private void InitializeComponent() // // AllGunsBtn // - this.AllGunsBtn.Location = new System.Drawing.Point(6, 164); + this.AllGunsBtn.Location = new System.Drawing.Point(4, 222); this.AllGunsBtn.Name = "AllGunsBtn"; this.AllGunsBtn.Size = new System.Drawing.Size(129, 23); this.AllGunsBtn.TabIndex = 6; @@ -439,21 +503,22 @@ private void InitializeComponent() this.AutomaticWeaponsBtn.UseVisualStyleBackColor = true; this.AutomaticWeaponsBtn.Click += new System.EventHandler(this.AutomaticWeaponsBtn_Click); // - // MeleeBtn + // TrapsBtn // - this.MeleeBtn.Location = new System.Drawing.Point(141, 135); - this.MeleeBtn.Name = "MeleeBtn"; - this.MeleeBtn.Size = new System.Drawing.Size(129, 23); - this.MeleeBtn.TabIndex = 11; - this.MeleeBtn.Text = "Melee"; - this.MeleeBtn.UseVisualStyleBackColor = true; - this.MeleeBtn.Click += new System.EventHandler(this.MeleeBtn_Click); + this.TrapsBtn.Location = new System.Drawing.Point(7, 164); + this.TrapsBtn.Name = "TrapsBtn"; + this.TrapsBtn.Size = new System.Drawing.Size(139, 23); + this.TrapsBtn.TabIndex = 14; + this.TrapsBtn.TabStop = false; + this.TrapsBtn.Text = "Traps"; + this.TrapsBtn.UseVisualStyleBackColor = true; + this.TrapsBtn.Click += new System.EventHandler(this.TrapsBtn_Click); // // ItemsCategories // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(788, 251); + this.ClientSize = new System.Drawing.Size(788, 309); this.Controls.Add(this.GunsGroupBox); this.Controls.Add(this.VehiclesGroup); this.Controls.Add(this.ItemsCategoriesLabel); @@ -506,5 +571,10 @@ private void InitializeComponent() private System.Windows.Forms.Button AmmoBtn; private System.Windows.Forms.Button SupplyBtn; private System.Windows.Forms.Button MeleeBtn; + private System.Windows.Forms.Button MasksBtn; + private System.Windows.Forms.Button GlassesBtn; + private System.Windows.Forms.Button DetonatorsBtn; + private System.Windows.Forms.Button ChargesBtn; + private System.Windows.Forms.Button TrapsBtn; } } \ No newline at end of file diff --git a/ItemsCategories.cs b/ItemsCategories.cs index d388792..35fc40f 100644 --- a/ItemsCategories.cs +++ b/ItemsCategories.cs @@ -48,7 +48,7 @@ private void BackpacksBtn_Click(object sender, EventArgs e) private void PantsBtn_Click(object sender, EventArgs e) { var items = Core.ParseAll(Folders.CheckedFolders, i => i.GetValue("type") == "Pants"); - items.Sort((a, b) => b.CompareTo(a, Core.CompareModes.ClothingProtection)); + items.Sort((a, b) => a.CompareTo(b, Core.CompareModes.ClothingProtection)); new ItemList(items).ShowDialog(); } @@ -146,14 +146,18 @@ private void GripsBtn_Click(object sender, EventArgs e) { var items = Core.ParseAll(Folders.CheckedFolders, i => i.GetValue("type") == "Grip"); - new ItemList(items).ShowDialog(); + items.Sort((a, b) => a.CompareTo(b, Core.CompareModes.Spread)); + + new ItemList(items).ShowDialog(); } private void SuppressorsBtn_Click(object sender, EventArgs e) { var items = Core.ParseAll(Folders.CheckedFolders, i => i.GetValue("type") == "Barrel"); - new ItemList(items).ShowDialog(); + items.Sort((a, b) => a.CompareTo(b, Core.CompareModes.Spread)); + + new ItemList(items).ShowDialog(); } private void AllCustomizeBtn_Click(object sender, EventArgs e) @@ -190,9 +194,9 @@ private void SecondaryItemsBtn_Click(object sender, EventArgs e) private void TacticalsBtn_Click(object sender, EventArgs e) { var items = Core.ParseAll(Folders.CheckedFolders, i => i.GetValue("type") == "Tactical"); - items.Sort((a, b) => a.CompareTo(b, Core.CompareModes.Damage)); + items.Sort((a, b) => a.CompareTo(b, Core.CompareModes.Spread)); - new ItemList(items).ShowDialog(); + new ItemList(items).ShowDialog(); } private void SightsBtn_Click(object sender, EventArgs e) @@ -233,7 +237,46 @@ private void MeleeBtn_Click(object sender, EventArgs e) new ItemList(items).ShowDialog(); } - private void RaidItemsBtn_Click(object sender, EventArgs e) + private void MasksBtn_Click(object sender, EventArgs e) + { + var items = Core.ParseAll(Folders.CheckedFolders, i => i.GetValue("type") == "Mask"); + items.Sort((a, b) => a.CompareTo(b, Core.CompareModes.ClothingProtection)); + + new ItemList(items).ShowDialog(); + } + + private void GlassesBtn_Click(object sender, EventArgs e) + { + var items = Core.ParseAll(Folders.CheckedFolders, i => i.GetValue("type") == "Glasses"); + items.Sort((a, b) => a.CompareTo(b, Core.CompareModes.ClothingProtection)); + + new ItemList(items).ShowDialog(); + } + + private void ChargesBtn_Click(object sender, EventArgs e) + { + var items = Core.ParseAll(Folders.CheckedFolders, i => i.GetValue("type") == "Charge"); + items.Sort((a, b) => a.CompareTo(b, Core.CompareModes.StructureDamage)); + + new ItemList(items).ShowDialog(); + } + + private void DetonatorsBtn_Click(object sender, EventArgs e) + { + var items = Core.ParseAll(Folders.CheckedFolders, i => i.GetValue("type") == "Detonator"); + + new ItemList(items).ShowDialog(); + } + + private void TrapsBtn_Click(object sender, EventArgs e) + { + var items = Core.ParseAll(Folders.CheckedFolders, i => i.GetValue("type") == "Trap"); + items.Sort((a, b) => a.CompareTo(b, Core.CompareModes.BuildingHealth)); + + new ItemList(items).ShowDialog(); + } + + private void RaidItemsBtn_Click(object sender, EventArgs e) { var items = Core.ParseAll(Folders.CheckedFolders, i => ( i.GetValue("useable") == "Gun" && i.ContainsKey("invulnerable") && i.GetValue("structure_damage", "0").ToFloat() != 0) || // Guns diff --git a/Properties/Additional.ru-RU.resx b/Properties/Additional.ru-RU.resx index 6defd3e..69b2e2d 100644 --- a/Properties/Additional.ru-RU.resx +++ b/Properties/Additional.ru-RU.resx @@ -118,8 +118,7 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - -Обратитесь с этой ошибкой на дискорд сервер. + Обратитесь с этой ошибкой на дискорд сервер. Указанная папка больше не существует. diff --git a/Properties/ItemList.ru-RU.resx b/Properties/ItemList.ru-RU.resx index 508d000..e0472ac 100644 --- a/Properties/ItemList.ru-RU.resx +++ b/Properties/ItemList.ru-RU.resx @@ -198,8 +198,8 @@ Результаты поиска: - - Множитель разброса (обвесы): + + Разброс (обвесы): Вместительности баррикад @@ -211,15 +211,15 @@ Множитель урона (обвесы) - Хп построек + HP построек - Сортировать + Сортировка Количеству дробинок - + По разбросу (обвесы) @@ -252,4 +252,13 @@ Множитель звука (обвесы): + + Отдача X/Y: + + + Отдача X + + + Отдача Y + \ No newline at end of file diff --git a/Properties/ItemsCategories.ru-RU.resx b/Properties/ItemsCategories.ru-RU.resx index 679e580..5e42f73 100644 --- a/Properties/ItemsCategories.ru-RU.resx +++ b/Properties/ItemsCategories.ru-RU.resx @@ -150,6 +150,15 @@ Машины + + Взрывчатка + + + Детонаторы + + + Очки + Гранаты @@ -171,6 +180,9 @@ Категории предметров + + Маски + Холодное оружие @@ -210,6 +222,9 @@ Тактические (лазеры) + + Ловушки + Транспорт diff --git a/UIF.csproj b/UIF.csproj index 9fce594..68d5ce6 100644 --- a/UIF.csproj +++ b/UIF.csproj @@ -13,6 +13,7 @@ true true + false publish\ true Disk @@ -25,7 +26,6 @@ true 0 1.0.0.%2a - false false true @@ -111,14 +111,19 @@ ItemList.cs - + + Designer + - + + Designer + ResXFileCodeGenerator ItemsCategories.ru-RU.Designer.cs + Designer Designer diff --git a/UIF.csproj.user b/UIF.csproj.user new file mode 100644 index 0000000..729e852 --- /dev/null +++ b/UIF.csproj.user @@ -0,0 +1,13 @@ + + + + publish\ + + + + + + ru-RU + false + + \ No newline at end of file