diff --git a/client/Database/DbOpFilterDrops.cs b/client/Database/DbOpFilterDrops.cs index 9b95c55..c8fcebd 100644 --- a/client/Database/DbOpFilterDrops.cs +++ b/client/Database/DbOpFilterDrops.cs @@ -16,6 +16,7 @@ class DbOpFilterDrops : IDbRequest private SelectMultiParam mItemTypes; private SelectMultiParam mRarities; private SelectMultiParam mSynergies; + private SelectMultiParam mWorlds; private SelectMultiParam mDungeons; private SelectMultiParam mBattles; private SelectSingleParam mName; @@ -32,6 +33,7 @@ public DbOpFilterDrops(FFRKMySqlInstance Database) mItemTypes = new SelectMultiParam("item_type"); mRarities = new SelectMultiParam("item_rarity"); mSynergies = new SelectMultiParam("item_series", (x) => x.GameSeries); + mWorlds = new SelectMultiParam("world_id"); mDungeons = new SelectMultiParam("dungeon_id"); mBattles = new SelectMultiParam("battleid"); mName = new SelectSingleParam("item_name", SelectSingleParam.ParamOperator.Like); @@ -49,6 +51,7 @@ public bool RequiresTransaction public SelectMultiParam ItemTypes { get { return mItemTypes; } } public SelectMultiParam Rarities { get { return mRarities; } } public SelectMultiParam Synergies { get { return mSynergies; } } + public SelectMultiParam Worlds { get { return mWorlds; } } public SelectMultiParam Dungeons { get { return mDungeons; } } public SelectMultiParam Battles { get { return mBattles; } } public SelectSingleParam Name { get { return mName; } } @@ -66,6 +69,7 @@ public void Execute(MySqlConnection connection, MySqlTransaction transaction) builder.Parameters.Add(mItemTypes); builder.Parameters.Add(mRarities); builder.Parameters.Add(mSynergies); + builder.Parameters.Add(mWorlds); builder.Parameters.Add(mDungeons); builder.Parameters.Add(mBattles); builder.Parameters.Add(mName); diff --git a/client/FFRKInspector.csproj b/client/FFRKInspector.csproj index 4d12b8e..119f451 100644 --- a/client/FFRKInspector.csproj +++ b/client/FFRKInspector.csproj @@ -98,11 +98,15 @@ + + + + @@ -168,6 +172,12 @@ FFRKViewAbout.cs + + UserControl + + + FFRKViewActiveBattle.cs + UserControl @@ -274,6 +284,9 @@ FFRKViewAbout.cs + + FFRKViewActiveBattle.cs + FFRKViewBrowse.cs diff --git a/client/GameData/BasicEnemyInfo.cs b/client/GameData/BasicEnemyInfo.cs index 32431f0..46f8982 100644 --- a/client/GameData/BasicEnemyInfo.cs +++ b/client/GameData/BasicEnemyInfo.cs @@ -10,6 +10,13 @@ class BasicEnemyInfo { public uint EnemyId; public string EnemyName; + public uint EnemyMaxHp; + //public string EnemyElemWeakness; + public List EnemyElemWeakness; + public List EnemyElemResist; + public List EnemyElemAbsorb; + public List EnemyElemNull; + public List EnemyStatusImmunity; public override bool Equals(object obj) { diff --git a/client/GameData/BasicItemDropStats.cs b/client/GameData/BasicItemDropStats.cs index 7f9a39d..e8ee68c 100644 --- a/client/GameData/BasicItemDropStats.cs +++ b/client/GameData/BasicItemDropStats.cs @@ -35,6 +35,8 @@ public BasicItemDropStats() public uint TimesRunWithHistogram; public ushort BattleStamina; + public float DropsPerRunF; //This is only used in the filter to select the drops/run column. + public Utility.Histogram Histogram; public double DropsAverage diff --git a/client/GameData/DataActiveBattle.cs b/client/GameData/DataActiveBattle.cs index 79697a0..acd116b 100644 --- a/client/GameData/DataActiveBattle.cs +++ b/client/GameData/DataActiveBattle.cs @@ -44,10 +44,65 @@ public IEnumerable Enemies // Not sure what the deal is with child and params, or why an enemy can theoretically // have more than one name. I assume it has something to do with enemies that have // different body parts, but haven't figured it out yet. - if (child.Params.Count == 0) - continue; - infos.Add(new BasicEnemyInfo { EnemyId = child.EnemyId, EnemyName = child.Params[0].Name }); - break; + if (child.Params.Count == 0) { continue; } + else + { + foreach (DataEnemyParam param in child.Params) + { + List elemweakness = new List(); + List elemresist = new List(); + List elemnull = new List(); + List elemabsorb = new List(); + List statusimmune = new List(); + foreach (DataDefAttributes defattributes in param.DefAttributes) + { + if (defattributes.Id < 200) //If it's an elemental weakness. + { + if (defattributes.Factor == (int)SchemaConstants.ElementVulnerability.Vulnerable) + { + //elemweakness.Add(((SchemaConstants.ElementID)defattributes.Id).ToString()); + elemweakness.Add(Enum.GetName(typeof(SchemaConstants.ElementID), defattributes.Id)); + } + else if (defattributes.Factor == (int)SchemaConstants.ElementVulnerability.Absorb) + { + elemabsorb.Add(Enum.GetName(typeof(SchemaConstants.ElementID), defattributes.Id)); + } + else if (defattributes.Factor == (int)SchemaConstants.ElementVulnerability.Null) + { + elemnull.Add(Enum.GetName(typeof(SchemaConstants.ElementID), defattributes.Id)); + } + else if (defattributes.Factor == (int)SchemaConstants.ElementVulnerability.Resist) + { + elemresist.Add(Enum.GetName(typeof(SchemaConstants.ElementID), defattributes.Id)); + } + } + else if ((defattributes.Id >= 200) && (defattributes.Id < 216)) //If >=200 then it must be a status effect. + { + if (defattributes.Factor == (int)SchemaConstants.StatusVulnerability.Immune) + { + statusimmune.Add(Enum.GetName(typeof(SchemaConstants.StatusID), defattributes.Id)); + } + + } + } + //List elemweakness = new List(); + //elemweakness.Add(Enum.GetName(typeof(SchemaConstants.StatusID), param.DefAttributes[0].Id)); + //elemweakness.Add(Enum.GetName(typeof(SchemaConstants.StatusID), param.DefAttributes[1].Id)); + infos.Add(new BasicEnemyInfo + { + EnemyId = param.Id, + EnemyName = param.Name, + EnemyMaxHp = param.MaxHp, + //EnemyElemWeakness = elemweakness + EnemyElemResist = elemresist, + EnemyElemWeakness = elemweakness, + EnemyElemAbsorb = elemabsorb, + EnemyElemNull = elemnull, + EnemyStatusImmunity = statusimmune + }); + //break; + } + } } } } diff --git a/client/GameData/DataDefAttributes.cs b/client/GameData/DataDefAttributes.cs new file mode 100644 index 0000000..640f9cd --- /dev/null +++ b/client/GameData/DataDefAttributes.cs @@ -0,0 +1,22 @@ +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace FFRKInspector.GameData +{ + class DataDefAttributes + { + [JsonProperty("attribute_id")] + public uint Id; + + [JsonProperty("factor")] + public uint Factor; + + [JsonExtensionData] + public Dictionary UnknownValues; + } +} diff --git a/client/GameData/DataDungeonCaptures.cs b/client/GameData/DataDungeonCaptures.cs new file mode 100644 index 0000000..c6c9e06 --- /dev/null +++ b/client/GameData/DataDungeonCaptures.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; + +namespace FFRKInspector.GameData +{ + class DataDungeonCaptures + { + [JsonProperty("sp_scores")] + public List SpScore; + + [JsonExtensionData] + public Dictionary UnknownValues; + } +} diff --git a/client/GameData/DataDungeonSpScore.cs b/client/GameData/DataDungeonSpScore.cs new file mode 100644 index 0000000..2349b60 --- /dev/null +++ b/client/GameData/DataDungeonSpScore.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; + + +namespace FFRKInspector.GameData +{ + class DataDungeonSpScore + { + [JsonProperty("title")] + public string Title; + + [JsonProperty("battle_id")] + public uint BattleID; + + [JsonExtensionData] + public Dictionary UnknownValues; + } +} diff --git a/client/GameData/DataEnemyParam.cs b/client/GameData/DataEnemyParam.cs index 83b208a..ddcabef 100644 --- a/client/GameData/DataEnemyParam.cs +++ b/client/GameData/DataEnemyParam.cs @@ -16,7 +16,14 @@ class DataEnemyParam [JsonProperty("id")] public uint Id; + [JsonProperty("max_hp")] + public uint MaxHp; + + [JsonProperty("def_attributes")] + public List DefAttributes; + [JsonExtensionData] public Dictionary UnknownValues; + } } diff --git a/client/GameData/DataUserDungeon.cs b/client/GameData/DataUserDungeon.cs new file mode 100644 index 0000000..0ef183a --- /dev/null +++ b/client/GameData/DataUserDungeon.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; + +namespace FFRKInspector.GameData +{ + class DataUserDungeon + { + [JsonProperty("captures")] + public List Captures; + + [JsonExtensionData] + public Dictionary UnknownValues; + } +} diff --git a/client/GameData/EventListBattles.cs b/client/GameData/EventListBattles.cs index fa181cb..2d691d1 100644 --- a/client/GameData/EventListBattles.cs +++ b/client/GameData/EventListBattles.cs @@ -20,6 +20,9 @@ class EventListBattles [JsonProperty("user")] public DataUser User; + [JsonProperty("user_dungeon")] + public DataUserDungeon UserDungeon; + [JsonExtensionData] public Dictionary UnknownValues; } diff --git a/client/GameData/RealmSynergy.cs b/client/GameData/RealmSynergy.cs index 759e85b..cdd290f 100644 --- a/client/GameData/RealmSynergy.cs +++ b/client/GameData/RealmSynergy.cs @@ -25,6 +25,7 @@ public enum Value FF11 = 11, FF12 = 12, FF13 = 13, + FF14 = 14, } public class SynergyValue @@ -79,6 +80,7 @@ static RealmSynergy() new SynergyValue("XI", 111001, Value.FF11), new SynergyValue("XII", 112001, Value.FF12), new SynergyValue("XIII", 113001, Value.FF13), + new SynergyValue("XIV", 114001, Value.FF14), }; foreach (SynergyValue value in values) diff --git a/client/GameData/SchemaConstants.cs b/client/GameData/SchemaConstants.cs index 5d2313d..8eb23ac 100644 --- a/client/GameData/SchemaConstants.cs +++ b/client/GameData/SchemaConstants.cs @@ -52,7 +52,9 @@ public enum EquipmentCategory : byte Whip = 12, Thrown = 13, Book = 14, + Gun = 15, Ball = 30, + Hairpin = 31, Shield = 50, Hat = 51, Helm = 52, @@ -112,5 +114,62 @@ public enum DungeonType : byte Normal = 1, Elite = 2 } + + public enum ElementID : ushort + { + Fire = 100, + Ice = 101, + Lightning = 102, + Earth = 103, + Wind = 104, + Water = 105, + Holy = 106, + Dark = 107, + Poison = 108 + } + + public enum ElementVulnerability : ushort + { + Vulnerable = 1, + Resist = 6, + Null = 11, + Absorb = 21 + } + + public enum StatusID : ushort + { + Poison = 200, + Silence = 201, + Paralyze = 202, + Confuse = 203, + Haste = 204, + Slow = 205, + Stop = 206, + Protect = 207, + Shell = 208, + Reflect = 209, + Blind = 210, + Sleep = 211, + Petrify = 212, + Doom = 213, + Instant_KO = 214, + Beserk = 215, + Regen = 216, + Reraise = 217, + Float = 218, + Weak = 219, + Zombie = 220, + Mini = 221, + Toad = 222, + Curse = 223, + Slownumb = 224, + Blink = 225 + } + + public enum StatusVulnerability : ushort + { + Immune = 1 + } + } } diff --git a/client/UI/FFRKTabInspector.Designer.cs b/client/UI/FFRKTabInspector.Designer.cs index a5998c8..cdeef5a 100644 --- a/client/UI/FFRKTabInspector.Designer.cs +++ b/client/UI/FFRKTabInspector.Designer.cs @@ -29,8 +29,10 @@ protected override void Dispose(bool disposing) private void InitializeComponent() { this.tabControlFFRKInspector = new System.Windows.Forms.TabControl(); + this.tabPageDungeon = new System.Windows.Forms.TabPage(); + this.ffrkViewActiveDungeon = new FFRKInspector.UI.FFRKViewActiveDungeon(); this.tabPageBattle = new System.Windows.Forms.TabPage(); - this.ffrkViewActiveDungeon1 = new FFRKInspector.UI.FFRKViewActiveDungeon(); + this.ffrkViewActiveBattle = new FFRKInspector.UI.FFRKViewActiveBattle(); this.tabPageSearch = new System.Windows.Forms.TabPage(); this.ffrkViewItemSearch1 = new FFRKInspector.UI.FFRKViewItemSearch(); this.tabPageInventory = new System.Windows.Forms.TabPage(); @@ -47,6 +49,7 @@ private void InitializeComponent() this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel(); this.toolStripStatusLabelConnection = new System.Windows.Forms.ToolStripStatusLabel(); this.tabControlFFRKInspector.SuspendLayout(); + this.tabPageDungeon.SuspendLayout(); this.tabPageBattle.SuspendLayout(); this.tabPageSearch.SuspendLayout(); this.tabPageInventory.SuspendLayout(); @@ -59,6 +62,7 @@ private void InitializeComponent() // // tabControlFFRKInspector // + this.tabControlFFRKInspector.Controls.Add(this.tabPageDungeon); this.tabControlFFRKInspector.Controls.Add(this.tabPageBattle); this.tabControlFFRKInspector.Controls.Add(this.tabPageSearch); this.tabControlFFRKInspector.Controls.Add(this.tabPageInventory); @@ -73,24 +77,41 @@ private void InitializeComponent() this.tabControlFFRKInspector.Size = new System.Drawing.Size(991, 616); this.tabControlFFRKInspector.TabIndex = 0; // + // tabPageDungeon + // + this.tabPageDungeon.Controls.Add(this.ffrkViewActiveDungeon); + this.tabPageDungeon.Location = new System.Drawing.Point(4, 22); + this.tabPageDungeon.Name = "tabPageDungeon"; + this.tabPageDungeon.Padding = new System.Windows.Forms.Padding(3); + this.tabPageDungeon.Size = new System.Drawing.Size(983, 590); + this.tabPageDungeon.TabIndex = 1; + this.tabPageDungeon.Text = "Current Dungeon"; + this.tabPageDungeon.UseVisualStyleBackColor = true; + // + // ffrkViewActiveDungeon + // + this.ffrkViewActiveDungeon.Dock = System.Windows.Forms.DockStyle.Fill; + this.ffrkViewActiveDungeon.Location = new System.Drawing.Point(3, 3); + this.ffrkViewActiveDungeon.Name = "ffrkViewActiveDungeon"; + this.ffrkViewActiveDungeon.Size = new System.Drawing.Size(977, 584); + this.ffrkViewActiveDungeon.TabIndex = 0; + // // tabPageBattle // - this.tabPageBattle.Controls.Add(this.ffrkViewActiveDungeon1); + this.tabPageBattle.Controls.Add(this.ffrkViewActiveBattle); this.tabPageBattle.Location = new System.Drawing.Point(4, 22); this.tabPageBattle.Name = "tabPageBattle"; - this.tabPageBattle.Padding = new System.Windows.Forms.Padding(3); - this.tabPageBattle.Size = new System.Drawing.Size(983, 579); - this.tabPageBattle.TabIndex = 1; + this.tabPageBattle.Size = new System.Drawing.Size(983, 590); + this.tabPageBattle.TabIndex = 10; this.tabPageBattle.Text = "Current Battle"; this.tabPageBattle.UseVisualStyleBackColor = true; // - // ffrkViewActiveDungeon1 + // ffrkViewActiveBattle // - this.ffrkViewActiveDungeon1.Dock = System.Windows.Forms.DockStyle.Fill; - this.ffrkViewActiveDungeon1.Location = new System.Drawing.Point(3, 3); - this.ffrkViewActiveDungeon1.Name = "ffrkViewActiveDungeon1"; - this.ffrkViewActiveDungeon1.Size = new System.Drawing.Size(977, 573); - this.ffrkViewActiveDungeon1.TabIndex = 0; + this.ffrkViewActiveBattle.Location = new System.Drawing.Point(-4, 0); + this.ffrkViewActiveBattle.Name = "ffrkViewActiveBattle"; + this.ffrkViewActiveBattle.Size = new System.Drawing.Size(984, 594); + this.ffrkViewActiveBattle.TabIndex = 0; // // tabPageSearch // @@ -116,17 +137,20 @@ private void InitializeComponent() this.tabPageInventory.Controls.Add(this.ffrkViewInventory1); this.tabPageInventory.Location = new System.Drawing.Point(4, 22); this.tabPageInventory.Name = "tabPageInventory"; - this.tabPageInventory.Size = new System.Drawing.Size(983, 579); + this.tabPageInventory.Size = new System.Drawing.Size(983, 590); this.tabPageInventory.TabIndex = 2; this.tabPageInventory.Text = "Inventory"; this.tabPageInventory.UseVisualStyleBackColor = true; + this.tabPageInventory.Click += new System.EventHandler(this.tabPageInventory_Click); // // ffrkViewInventory1 // - this.ffrkViewInventory1.Dock = System.Windows.Forms.DockStyle.Fill; - this.ffrkViewInventory1.Location = new System.Drawing.Point(0, 0); + this.ffrkViewInventory1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.ffrkViewInventory1.Location = new System.Drawing.Point(-4, 0); this.ffrkViewInventory1.Name = "ffrkViewInventory1"; - this.ffrkViewInventory1.Size = new System.Drawing.Size(983, 579); + this.ffrkViewInventory1.Size = new System.Drawing.Size(984, 594); this.ffrkViewInventory1.TabIndex = 0; // // tabPageEditEquipment @@ -134,7 +158,7 @@ private void InitializeComponent() this.tabPageEditEquipment.Controls.Add(this.ffrkViewEditItemStats1); this.tabPageEditEquipment.Location = new System.Drawing.Point(4, 22); this.tabPageEditEquipment.Name = "tabPageEditEquipment"; - this.tabPageEditEquipment.Size = new System.Drawing.Size(983, 579); + this.tabPageEditEquipment.Size = new System.Drawing.Size(983, 590); this.tabPageEditEquipment.TabIndex = 9; this.tabPageEditEquipment.Text = "Edit Database"; this.tabPageEditEquipment.UseVisualStyleBackColor = true; @@ -145,7 +169,7 @@ private void InitializeComponent() this.ffrkViewEditItemStats1.Dock = System.Windows.Forms.DockStyle.Fill; this.ffrkViewEditItemStats1.Location = new System.Drawing.Point(0, 0); this.ffrkViewEditItemStats1.Name = "ffrkViewEditItemStats1"; - this.ffrkViewEditItemStats1.Size = new System.Drawing.Size(983, 579); + this.ffrkViewEditItemStats1.Size = new System.Drawing.Size(983, 590); this.ffrkViewEditItemStats1.TabIndex = 0; // // tabPageGacha @@ -153,7 +177,7 @@ private void InitializeComponent() this.tabPageGacha.Controls.Add(this.ffrkViewGacha1); this.tabPageGacha.Location = new System.Drawing.Point(4, 22); this.tabPageGacha.Name = "tabPageGacha"; - this.tabPageGacha.Size = new System.Drawing.Size(983, 579); + this.tabPageGacha.Size = new System.Drawing.Size(983, 590); this.tabPageGacha.TabIndex = 8; this.tabPageGacha.Text = "Gacha"; this.tabPageGacha.UseVisualStyleBackColor = true; @@ -163,7 +187,7 @@ private void InitializeComponent() this.ffrkViewGacha1.Dock = System.Windows.Forms.DockStyle.Fill; this.ffrkViewGacha1.Location = new System.Drawing.Point(0, 0); this.ffrkViewGacha1.Name = "ffrkViewGacha1"; - this.ffrkViewGacha1.Size = new System.Drawing.Size(983, 579); + this.ffrkViewGacha1.Size = new System.Drawing.Size(983, 590); this.ffrkViewGacha1.TabIndex = 0; // // tabPageAbout @@ -171,7 +195,7 @@ private void InitializeComponent() this.tabPageAbout.Controls.Add(this.ffrkViewAbout1); this.tabPageAbout.Location = new System.Drawing.Point(4, 22); this.tabPageAbout.Name = "tabPageAbout"; - this.tabPageAbout.Size = new System.Drawing.Size(983, 579); + this.tabPageAbout.Size = new System.Drawing.Size(983, 590); this.tabPageAbout.TabIndex = 5; this.tabPageAbout.Text = "About"; this.tabPageAbout.UseVisualStyleBackColor = true; @@ -181,7 +205,7 @@ private void InitializeComponent() this.ffrkViewAbout1.Dock = System.Windows.Forms.DockStyle.Fill; this.ffrkViewAbout1.Location = new System.Drawing.Point(0, 0); this.ffrkViewAbout1.Name = "ffrkViewAbout1"; - this.ffrkViewAbout1.Size = new System.Drawing.Size(983, 579); + this.ffrkViewAbout1.Size = new System.Drawing.Size(983, 590); this.ffrkViewAbout1.TabIndex = 0; // // tabPageDebug @@ -189,7 +213,7 @@ private void InitializeComponent() this.tabPageDebug.Controls.Add(this.ffrkViewDebugging1); this.tabPageDebug.Location = new System.Drawing.Point(4, 22); this.tabPageDebug.Name = "tabPageDebug"; - this.tabPageDebug.Size = new System.Drawing.Size(983, 579); + this.tabPageDebug.Size = new System.Drawing.Size(983, 590); this.tabPageDebug.TabIndex = 7; this.tabPageDebug.Text = "Debugging"; this.tabPageDebug.UseVisualStyleBackColor = true; @@ -199,7 +223,7 @@ private void InitializeComponent() this.ffrkViewDebugging1.Dock = System.Windows.Forms.DockStyle.Fill; this.ffrkViewDebugging1.Location = new System.Drawing.Point(0, 0); this.ffrkViewDebugging1.Name = "ffrkViewDebugging1"; - this.ffrkViewDebugging1.Size = new System.Drawing.Size(983, 579); + this.ffrkViewDebugging1.Size = new System.Drawing.Size(983, 590); this.ffrkViewDebugging1.TabIndex = 0; // // statusStrip1 @@ -235,6 +259,7 @@ private void InitializeComponent() this.Size = new System.Drawing.Size(991, 616); this.Load += new System.EventHandler(this.FFRKTabInspectorView_Load); this.tabControlFFRKInspector.ResumeLayout(false); + this.tabPageDungeon.ResumeLayout(false); this.tabPageBattle.ResumeLayout(false); this.tabPageSearch.ResumeLayout(false); this.tabPageInventory.ResumeLayout(false); @@ -253,7 +278,7 @@ private void InitializeComponent() private System.Windows.Forms.TabControl tabControlFFRKInspector; private System.Windows.Forms.TabPage tabPageSearch; - private System.Windows.Forms.TabPage tabPageBattle; + private System.Windows.Forms.TabPage tabPageDungeon; private System.Windows.Forms.TabPage tabPageInventory; private System.Windows.Forms.TabPage tabPageAbout; private System.Windows.Forms.StatusStrip statusStrip1; @@ -264,12 +289,12 @@ private void InitializeComponent() private System.Windows.Forms.TabPage tabPageGacha; private FFRKViewGacha ffrkViewGacha1; private FFRKViewAbout ffrkViewAbout1; - private FFRKViewActiveDungeon ffrkViewActiveDungeon1; + private FFRKViewActiveDungeon ffrkViewActiveDungeon; private FFRKViewItemSearch ffrkViewItemSearch1; - private FFRKViewInventory ffrkViewInventory1; private System.Windows.Forms.TabPage tabPageEditEquipment; private DatabaseUI.FFRKViewDatabase ffrkViewEditItemStats1; - - + private System.Windows.Forms.TabPage tabPageBattle; + private FFRKViewActiveBattle ffrkViewActiveBattle; + private FFRKViewInventory ffrkViewInventory1; } } diff --git a/client/UI/FFRKTabInspector.cs b/client/UI/FFRKTabInspector.cs index 0a248ae..550c5ad 100644 --- a/client/UI/FFRKTabInspector.cs +++ b/client/UI/FFRKTabInspector.cs @@ -19,7 +19,7 @@ internal partial class FFRKTabInspector : UserControl public enum InspectorPage { - None, + CurrentDungeon, CurrentBattle, ItemSearch, Inventory, @@ -33,7 +33,7 @@ public FFRKTabInspector() { InitializeComponent(); tabPageAbout.Tag = InspectorPage.About; - tabPageBattle.Tag = InspectorPage.CurrentBattle; + tabPageDungeon.Tag = InspectorPage.CurrentBattle; tabPageDebug.Tag = InspectorPage.Debugging; tabPageEditEquipment.Tag = InspectorPage.Database; tabPageGacha.Tag = InspectorPage.Gacha; @@ -69,7 +69,7 @@ public InspectorPage SelectedPage get { if (tabControlFFRKInspector.SelectedTab == null) - return InspectorPage.None; + return InspectorPage.CurrentDungeon; return (InspectorPage)tabControlFFRKInspector.SelectedTab.Tag; } set @@ -86,5 +86,10 @@ public FFRKViewDatabase DatabaseTab return (FFRKViewDatabase)tabPageEditEquipment.Controls[0]; } } + + private void tabPageInventory_Click(object sender, EventArgs e) + { + + } } } diff --git a/client/UI/FFRKViewActiveBattle.Designer.cs b/client/UI/FFRKViewActiveBattle.Designer.cs new file mode 100644 index 0000000..b3fa932 --- /dev/null +++ b/client/UI/FFRKViewActiveBattle.Designer.cs @@ -0,0 +1,223 @@ +namespace FFRKInspector.UI +{ + partial class FFRKViewActiveBattle + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.groupBoxEnemyInfo = new System.Windows.Forms.GroupBox(); + this.listViewEnemyInfo = new System.Windows.Forms.ListView(); + this.columnEnemy = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnMaxHP = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnStatusWeakness = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnElemWeak = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnElemResist = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnElemNull = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnElemAbsorb = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.listViewDropInfo = new System.Windows.Forms.ListView(); + this.columnDropItem = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnDropRarity = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnDropRound = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnDropEnemy = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.groupBox2 = new System.Windows.Forms.GroupBox(); + this.listViewPrevDrops = new FFRKInspector.UI.ListViewEx(); + this.groupBoxEnemyInfo.SuspendLayout(); + this.groupBox1.SuspendLayout(); + this.groupBox2.SuspendLayout(); + this.SuspendLayout(); + // + // groupBoxEnemyInfo + // + this.groupBoxEnemyInfo.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.groupBoxEnemyInfo.Controls.Add(this.listViewEnemyInfo); + this.groupBoxEnemyInfo.Location = new System.Drawing.Point(3, 8); + this.groupBoxEnemyInfo.Name = "groupBoxEnemyInfo"; + this.groupBoxEnemyInfo.Size = new System.Drawing.Size(1032, 205); + this.groupBoxEnemyInfo.TabIndex = 0; + this.groupBoxEnemyInfo.TabStop = false; + this.groupBoxEnemyInfo.Text = "Enemy Info"; + // + // listViewEnemyInfo + // + this.listViewEnemyInfo.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.columnEnemy, + this.columnMaxHP, + this.columnStatusWeakness, + this.columnElemWeak, + this.columnElemResist, + this.columnElemNull, + this.columnElemAbsorb}); + this.listViewEnemyInfo.Dock = System.Windows.Forms.DockStyle.Fill; + this.listViewEnemyInfo.Location = new System.Drawing.Point(3, 16); + this.listViewEnemyInfo.Name = "listViewEnemyInfo"; + this.listViewEnemyInfo.Size = new System.Drawing.Size(1026, 186); + this.listViewEnemyInfo.TabIndex = 0; + this.listViewEnemyInfo.UseCompatibleStateImageBehavior = false; + this.listViewEnemyInfo.View = System.Windows.Forms.View.Details; + // + // columnEnemy + // + this.columnEnemy.Text = "Enemy"; + this.columnEnemy.Width = 211; + // + // columnMaxHP + // + this.columnMaxHP.Text = "Max HP"; + // + // columnStatusWeakness + // + this.columnStatusWeakness.Text = "Status Weaknesses"; + this.columnStatusWeakness.Width = 112; + // + // columnElemWeak + // + this.columnElemWeak.Text = "Elemental Weakness"; + this.columnElemWeak.Width = 137; + // + // columnElemResist + // + this.columnElemResist.Text = "Resist"; + this.columnElemResist.Width = 121; + // + // columnElemNull + // + this.columnElemNull.Text = "Null"; + this.columnElemNull.Width = 104; + // + // columnElemAbsorb + // + this.columnElemAbsorb.Text = "Absorb"; + this.columnElemAbsorb.Width = 104; + // + // groupBox1 + // + this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.groupBox1.Controls.Add(this.listViewDropInfo); + this.groupBox1.Location = new System.Drawing.Point(6, 219); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(464, 221); + this.groupBox1.TabIndex = 1; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "Drop Info"; + this.groupBox1.Enter += new System.EventHandler(this.groupBox1_Enter); + // + // listViewDropInfo + // + this.listViewDropInfo.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.columnDropItem, + this.columnDropRarity, + this.columnDropRound, + this.columnDropEnemy}); + this.listViewDropInfo.Dock = System.Windows.Forms.DockStyle.Fill; + this.listViewDropInfo.Location = new System.Drawing.Point(3, 16); + this.listViewDropInfo.Name = "listViewDropInfo"; + this.listViewDropInfo.Size = new System.Drawing.Size(458, 202); + this.listViewDropInfo.TabIndex = 0; + this.listViewDropInfo.UseCompatibleStateImageBehavior = false; + this.listViewDropInfo.View = System.Windows.Forms.View.Details; + // + // columnDropItem + // + this.columnDropItem.Text = "Item"; + this.columnDropItem.Width = 120; + // + // columnDropRarity + // + this.columnDropRarity.Text = "Rarity"; + // + // columnDropRound + // + this.columnDropRound.Text = "Round"; + // + // columnDropEnemy + // + this.columnDropEnemy.Text = "Enemy"; + this.columnDropEnemy.Width = 120; + // + // groupBox2 + // + this.groupBox2.Controls.Add(this.listViewPrevDrops); + this.groupBox2.Location = new System.Drawing.Point(476, 219); + this.groupBox2.Name = "groupBox2"; + this.groupBox2.Size = new System.Drawing.Size(443, 221); + this.groupBox2.TabIndex = 2; + this.groupBox2.TabStop = false; + this.groupBox2.Text = "Previously Recorded Drops"; + // + // listViewPrevDrops + // + this.listViewPrevDrops.DataBinding = null; + this.listViewPrevDrops.Location = new System.Drawing.Point(3, 17); + this.listViewPrevDrops.Name = "listViewPrevDrops"; + this.listViewPrevDrops.SettingsKey = "FFRKViewActiveDungeon_AllDropsList"; + this.listViewPrevDrops.Size = new System.Drawing.Size(434, 203); + this.listViewPrevDrops.TabIndex = 0; + this.listViewPrevDrops.UseCompatibleStateImageBehavior = false; + this.listViewPrevDrops.View = System.Windows.Forms.View.Details; + this.listViewPrevDrops.VirtualMode = true; + // + // FFRKViewActiveBattle + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.groupBox2); + this.Controls.Add(this.groupBox1); + this.Controls.Add(this.groupBoxEnemyInfo); + this.Name = "FFRKViewActiveBattle"; + this.Size = new System.Drawing.Size(1038, 671); + this.Load += new System.EventHandler(this.FFRKViewCurrentBattle_Load); + this.groupBoxEnemyInfo.ResumeLayout(false); + this.groupBox1.ResumeLayout(false); + this.groupBox2.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.GroupBox groupBoxEnemyInfo; + private System.Windows.Forms.ListView listViewEnemyInfo; + private System.Windows.Forms.ColumnHeader columnEnemy; + private System.Windows.Forms.ColumnHeader columnMaxHP; + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.ListView listViewDropInfo; + private System.Windows.Forms.ColumnHeader columnDropItem; + private System.Windows.Forms.ColumnHeader columnDropRarity; + private System.Windows.Forms.ColumnHeader columnDropRound; + private System.Windows.Forms.ColumnHeader columnDropEnemy; + private System.Windows.Forms.ColumnHeader columnElemWeak; + private System.Windows.Forms.ColumnHeader columnStatusWeakness; + private System.Windows.Forms.ColumnHeader columnElemResist; + private System.Windows.Forms.ColumnHeader columnElemNull; + private System.Windows.Forms.ColumnHeader columnElemAbsorb; + private System.Windows.Forms.GroupBox groupBox2; + private ListViewEx listViewPrevDrops; + } +} diff --git a/client/UI/FFRKViewActiveBattle.cs b/client/UI/FFRKViewActiveBattle.cs new file mode 100644 index 0000000..008aff9 --- /dev/null +++ b/client/UI/FFRKViewActiveBattle.cs @@ -0,0 +1,289 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using FFRKInspector.GameData; +using FFRKInspector.Proxy; +using FFRKInspector.Database; +using FFRKInspector.DataCache; +using FFRKInspector.UI.ListViewFields; +using System.Globalization; + +namespace FFRKInspector.UI +{ + internal partial class FFRKViewActiveBattle : UserControl + { + private List mAllPrevItems; + private ListListViewBinding mFilteredPrevItems; + + public FFRKViewActiveBattle() + { + InitializeComponent(); + mAllPrevItems = new List(); + mFilteredPrevItems = new ListListViewBinding(); + + listViewPrevDrops.LoadSettings(); + + listViewPrevDrops.AddField(new ItemNameField("Item", FieldWidthStyle.Percent, 24)); + //listViewPrevDrops.AddField(new ItemBattleField("Battle", FieldWidthStyle.Percent, 24)); + listViewPrevDrops.AddField(new ItemDropsPerRunField("Drops/Run")); + listViewPrevDrops.AddField(new ItemTimesRunField("Times Run")); + listViewPrevDrops.AddField(new ItemTotalDropsField("Total Drops")); + //listViewPrevDrops.AddField(new ItemDropsPerRunField("Drops/Run")); + //listViewPrevDrops.AddField(new ItemStaminaPerDropField("Stamina/Drop", false)); + //listViewPrevDrops.AddField(new ItemStaminaToReachField("Stamina to Reach")); + //listViewPrevDrops.AddField(new ItemRepeatableField("Is Repeatable")); + foreach (ColumnHeader column in listViewPrevDrops.Columns) { column.Width = -2; } + listViewPrevDrops.DataBinding = mFilteredPrevItems; + } + + private void FFRKViewCurrentBattle_Load(object sender, EventArgs e) + { + if (DesignMode) + return; + + if (FFRKProxy.Instance != null) + { + FFRKProxy.Instance.OnBattleEngaged += FFRKProxy_OnBattleEngaged; + FFRKProxy.Instance.OnListBattles += FFRKProxy_OnListBattles; + FFRKProxy.Instance.OnListDungeons += FFRKProxy_OnListDungeons; + FFRKProxy.Instance.OnLeaveDungeon += FFRKProxy_OnLeaveDungeon; + FFRKProxy.Instance.OnCompleteBattle += FFRKProxy_OnCompleteBattle; + FFRKProxy.Instance.OnItemCacheRefreshed += FFRKProxy_OnItemCacheRefreshed; + + //PopulateActiveDungeonListView(FFRKProxy.Instance.GameState.ActiveDungeon); + //PopulateActiveBattleListView(FFRKProxy.Instance.GameState.ActiveBattle); + PopulateEnemyInfoListView(FFRKProxy.Instance.GameState.ActiveBattle); + PopulateDropInfoListView(FFRKProxy.Instance.GameState.ActiveBattle); + BeginPopulateAllDropsListView(FFRKProxy.Instance.GameState.ActiveBattle); + } + else + { + PopulateEnemyInfoListView(null); + PopulateDropInfoListView(null); + BeginPopulateAllDropsListView(null); + //PopulateActiveBattleListView(null); + //PopulateActiveDungeonListView(null); + } + } + + void BeginPopulateAllDropsListView(EventBattleInitiated battle) + { + if (battle != null) + { + DbOpFilterDrops op = new DbOpFilterDrops(FFRKProxy.Instance.Database); + op.Battles.AddValue(battle.Battle.BattleId); + op.OnRequestComplete += RequestBattleDrops_OnRequestComplete; + FFRKProxy.Instance.Database.BeginExecuteRequest(op); + } + else + { + listViewPrevDrops.VirtualListSize = 0; + mAllPrevItems.Clear(); + mFilteredPrevItems.Collection.Clear(); + } + } + + void RequestBattleDrops_OnRequestComplete(List items) + { + this.BeginInvoke((Action)(() => + { + mAllPrevItems = items; + RebuildFilteredDropListAndInvalidate(); + })); + } + + private void RebuildFilteredDropListAndInvalidate() + { + List result = mAllPrevItems.Select(i => new BasicItemDropStats() { + ItemName = i.ItemName, + DropsPerRunF = i.DropsPerRun, + TimesRun = i.TimesRun, + TotalDrops = i.TotalDrops + }).ToList(); + mFilteredPrevItems.Collection = result; + listViewPrevDrops.VirtualListSize = mFilteredPrevItems.Collection.Count; + listViewPrevDrops.Invalidate(); + foreach (ColumnHeader column in listViewPrevDrops.Columns) { column.Width = -2; } + } + + void FFRKProxy_OnItemCacheRefreshed() + { + // We don't need to do a full refresh here, just make sure the list invalidates so that it asks + // again for all of the virtual items. + listViewPrevDrops.Invalidate(); + } + + private void PopulateEnemyInfoListView(EventBattleInitiated battle) + { + + listViewEnemyInfo.Items.Clear(); + if (battle == null) { return; } + else + { + listViewEnemyInfo.View = View.Details; + + List enemies = battle.Battle.Enemies.ToList(); + if (enemies.Count == 0) { return; } + else + { + lock (FFRKProxy.Instance.Cache.SyncRoot) + { + foreach (BasicEnemyInfo enemy in battle.Battle.Enemies) + { + //The below is the "full" list of status effects, however I removed Haste, Shell, Protect, Reflect, and a few other + //positive buffs, and also the status effects not yet implemented such as Zombie, Toad, Mini. + List AllStatusEffects = new List() + { + "Poison","Silence","Paralyze","Confuse","Slow","Stop", + "Blind","Sleep","Petrify","Doom","Instant_KO","Beserk" + //,"Haste","Shell","Protect","Regen","Reflect" + }; + //Calculate difference between above set of status effects and the status immunities of enemy. + List EnemyStatusWeakness = AllStatusEffects.Except(enemy.EnemyStatusImmunity).ToList(); + string[] row = + { + enemy.EnemyName, + enemy.EnemyMaxHp.ToString("N0"), + //string.Join(", ",enemy.EnemyElemWeakness.ToArray()), + //"test2", + //"test3" + string.Join(", ",EnemyStatusWeakness.ToArray()), + string.Join(", ",enemy.EnemyElemWeakness.ToArray()), + string.Join(", ",enemy.EnemyElemResist.ToArray()), + string.Join(", ",enemy.EnemyElemNull.ToArray()), + string.Join(", ",enemy.EnemyElemAbsorb.ToArray()) + }; + listViewEnemyInfo.Items.Add(new ListViewItem(row)); + } + } + foreach (ColumnHeader column in listViewEnemyInfo.Columns) { column.Width = -2; } + } + } + } + + + private void PopulateDropInfoListView(EventBattleInitiated battle) + { + listViewDropInfo.Items.Clear(); + if (battle == null) { return; } + else + { + listViewDropInfo.View = View.Details; + List drops = battle.Battle.Drops.ToList(); + //labelActiveBattleNotice.Visible = false; + if (drops.Count == 0) { return; } + else + { + lock (FFRKProxy.Instance.Cache.SyncRoot) + { + foreach (DropEvent drop in battle.Battle.Drops) + { + string Item; + DataCache.Items.Key ItemKey = new DataCache.Items.Key { ItemId = drop.ItemId }; + DataCache.Items.Data ItemData = null; + if (drop.ItemType == DataEnemyDropItem.DropItemType.Gold) + Item = String.Format("{0} gold", drop.GoldAmount); + else if (drop.ItemType == DataEnemyDropItem.DropItemType.Materia) + Item = drop.MateriaName; + else if (drop.ItemType == DataEnemyDropItem.DropItemType.Potion) + Item = drop.PotionName; + else if (FFRKProxy.Instance.Cache.Items.TryGetValue(ItemKey, out ItemData)) + Item = ItemData.Name; + else + Item = drop.ItemId.ToString(); + + if (drop.NumberOfItems > 1) + Item += String.Format(" x{0}", drop.NumberOfItems); + string[] row = + { + Item, + drop.Rarity.ToString(), + drop.Round.ToString(), + drop.EnemyName + }; + listViewDropInfo.Items.Add(new ListViewItem(row)); + } + } + } + foreach (ColumnHeader column in listViewDropInfo.Columns) { column.Width = -2; } + } + } + + void FFRKProxy_OnCompleteBattle(EventBattleInitiated battle) + { + this.BeginInvoke((Action)(() => + { + PopulateEnemyInfoListView(null); + PopulateDropInfoListView(null); + BeginPopulateAllDropsListView(null); + //PopulateDropInfoListView(null); + //UpdateAllDropsForLastBattle(battle); + })); + } + + void FFRKProxy_OnLeaveDungeon() + { + this.BeginInvoke((Action)(() => + { + PopulateEnemyInfoListView(null); + PopulateDropInfoListView(null); + BeginPopulateAllDropsListView(null); + //PopulateActiveDungeonListView(null); + //UpdateAllDropsForLastBattle(null); + })); + } + + void FFRKProxy_OnListBattles(EventListBattles battles) + { + //BeginPopulateAllDropsListView(battles); + //this.BeginInvoke((Action)(() => + //{ + // PopulateActiveDungeonListView(battles); + // BeginPopulateAllDropsListView(battles); + //})); + } + + void FFRKProxy_OnListDungeons(EventListDungeons dungeons) + { + this.BeginInvoke((Action)(() => + { + //PopulateActiveBattleListView(null); + BeginPopulateAllDropsListView(null); + PopulateDropInfoListView(null); + PopulateEnemyInfoListView(null); + })); + } + + void FFRKProxy_OnBattleEngaged(EventBattleInitiated battle) + { + this.BeginInvoke((Action)(() => + { + //PopulateActiveBattleListView(battle); + BeginPopulateAllDropsListView(battle); + PopulateEnemyInfoListView(battle); + PopulateDropInfoListView(battle); + })); + } + + private void FFRKViewActiveDungeon2_Load(object sender, EventArgs e) + { + + } + + private void groupBox1_Enter(object sender, EventArgs e) + { + + } + + private void label2_Click(object sender, EventArgs e) + { + + } + } +} diff --git a/client/UI/FFRKViewActiveBattle.resx b/client/UI/FFRKViewActiveBattle.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/client/UI/FFRKViewActiveBattle.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/UI/FFRKViewActiveDungeon.Designer.cs b/client/UI/FFRKViewActiveDungeon.Designer.cs index 2462f14..1d3912d 100644 --- a/client/UI/FFRKViewActiveDungeon.Designer.cs +++ b/client/UI/FFRKViewActiveDungeon.Designer.cs @@ -35,28 +35,22 @@ private void InitializeComponent() this.columnHeaderBattleName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.columnHeaderBattleRounds = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.columnHeaderStamina = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.listViewActiveBattle = new System.Windows.Forms.ListView(); - this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader3 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader4 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader5 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader6 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.labelActiveBattleNotice = new System.Windows.Forms.Label(); - this.labelNoDrops = new System.Windows.Forms.Label(); this.groupBoxAllItems = new System.Windows.Forms.GroupBox(); + this.textBoxNameFilter = new System.Windows.Forms.TextBox(); + this.label2 = new System.Windows.Forms.Label(); this.checkBoxRepeatable = new System.Windows.Forms.CheckBox(); this.label1 = new System.Windows.Forms.Label(); this.numericUpDown1 = new System.Windows.Forms.NumericUpDown(); this.checkBoxFilterSamples = new System.Windows.Forms.CheckBox(); - this.groupBoxCurrentBattle = new System.Windows.Forms.GroupBox(); + this.groupBoxCurrentDungeon = new System.Windows.Forms.GroupBox(); + this.listViewMasteryCondition = new System.Windows.Forms.ListView(); + this.columnMasteryCond = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnCondBattle = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.listViewAllDrops = new FFRKInspector.UI.ListViewEx(); - this.label2 = new System.Windows.Forms.Label(); - this.textBoxNameFilter = new System.Windows.Forms.TextBox(); this.groupBoxDungeon.SuspendLayout(); this.groupBoxAllItems.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit(); - this.groupBoxCurrentBattle.SuspendLayout(); + this.groupBoxCurrentDungeon.SuspendLayout(); this.SuspendLayout(); // // groupBoxDungeon @@ -104,71 +98,6 @@ private void InitializeComponent() // this.columnHeaderStamina.Text = "Stamina"; // - // listViewActiveBattle - // - this.listViewActiveBattle.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.listViewActiveBattle.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { - this.columnHeader1, - this.columnHeader2, - this.columnHeader3, - this.columnHeader4, - this.columnHeader5, - this.columnHeader6}); - this.listViewActiveBattle.FullRowSelect = true; - this.listViewActiveBattle.Location = new System.Drawing.Point(6, 19); - this.listViewActiveBattle.Name = "listViewActiveBattle"; - this.listViewActiveBattle.Size = new System.Drawing.Size(576, 188); - this.listViewActiveBattle.TabIndex = 7; - this.listViewActiveBattle.UseCompatibleStateImageBehavior = false; - this.listViewActiveBattle.View = System.Windows.Forms.View.Details; - // - // columnHeader1 - // - this.columnHeader1.Text = "Item"; - this.columnHeader1.Width = 72; - // - // columnHeader2 - // - this.columnHeader2.Text = "Rarity"; - // - // columnHeader3 - // - this.columnHeader3.Text = "Round"; - // - // columnHeader4 - // - this.columnHeader4.Text = "Enemy"; - this.columnHeader4.Width = 104; - // - // columnHeader5 - // - this.columnHeader5.Text = "Drop Rate"; - this.columnHeader5.Width = 74; - // - // columnHeader6 - // - this.columnHeader6.Text = "Stamina/Drop"; - this.columnHeader6.Width = 126; - // - // labelActiveBattleNotice - // - this.labelActiveBattleNotice.AutoSize = true; - this.labelActiveBattleNotice.Location = new System.Drawing.Point(119, 100); - this.labelActiveBattleNotice.Name = "labelActiveBattleNotice"; - this.labelActiveBattleNotice.Size = new System.Drawing.Size(297, 13); - this.labelActiveBattleNotice.TabIndex = 8; - this.labelActiveBattleNotice.Text = "Enter a battle to populate this list with the drops for that battle."; - // - // labelNoDrops - // - this.labelNoDrops.AutoSize = true; - this.labelNoDrops.Location = new System.Drawing.Point(119, 123); - this.labelNoDrops.Name = "labelNoDrops"; - this.labelNoDrops.Size = new System.Drawing.Size(100, 13); - this.labelNoDrops.TabIndex = 9; - this.labelNoDrops.Text = "There are no drops!"; - // // groupBoxAllItems // this.groupBoxAllItems.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) @@ -188,6 +117,23 @@ private void InitializeComponent() this.groupBoxAllItems.TabStop = false; this.groupBoxAllItems.Text = "All items dropped in this dungeon"; // + // textBoxNameFilter + // + this.textBoxNameFilter.Location = new System.Drawing.Point(699, 21); + this.textBoxNameFilter.Name = "textBoxNameFilter"; + this.textBoxNameFilter.Size = new System.Drawing.Size(182, 20); + this.textBoxNameFilter.TabIndex = 9; + this.textBoxNameFilter.TextChanged += new System.EventHandler(this.textBoxNameFilter_TextChanged); + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(480, 24); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(213, 13); + this.label2.TabIndex = 8; + this.label2.Text = "Show only items with a name that contains: "; + // // checkBoxRepeatable // this.checkBoxRepeatable.AutoSize = true; @@ -229,19 +175,40 @@ private void InitializeComponent() this.checkBoxFilterSamples.UseVisualStyleBackColor = true; this.checkBoxFilterSamples.CheckedChanged += new System.EventHandler(this.checkBoxFilterSamples_CheckedChanged); // - // groupBoxCurrentBattle + // groupBoxCurrentDungeon // - this.groupBoxCurrentBattle.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.groupBoxCurrentDungeon.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.groupBoxCurrentBattle.Controls.Add(this.labelActiveBattleNotice); - this.groupBoxCurrentBattle.Controls.Add(this.labelNoDrops); - this.groupBoxCurrentBattle.Controls.Add(this.listViewActiveBattle); - this.groupBoxCurrentBattle.Location = new System.Drawing.Point(436, 3); - this.groupBoxCurrentBattle.Name = "groupBoxCurrentBattle"; - this.groupBoxCurrentBattle.Size = new System.Drawing.Size(588, 213); - this.groupBoxCurrentBattle.TabIndex = 11; - this.groupBoxCurrentBattle.TabStop = false; - this.groupBoxCurrentBattle.Text = "Current battle drop anticipation"; + this.groupBoxCurrentDungeon.Controls.Add(this.listViewMasteryCondition); + this.groupBoxCurrentDungeon.Location = new System.Drawing.Point(436, 3); + this.groupBoxCurrentDungeon.Name = "groupBoxCurrentDungeon"; + this.groupBoxCurrentDungeon.Size = new System.Drawing.Size(588, 213); + this.groupBoxCurrentDungeon.TabIndex = 11; + this.groupBoxCurrentDungeon.TabStop = false; + this.groupBoxCurrentDungeon.Text = "Dungeon Information"; + // + // listViewMasteryCondition + // + this.listViewMasteryCondition.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.columnCondBattle, + this.columnMasteryCond}); + this.listViewMasteryCondition.Dock = System.Windows.Forms.DockStyle.Fill; + this.listViewMasteryCondition.Location = new System.Drawing.Point(3, 16); + this.listViewMasteryCondition.Name = "listViewMasteryCondition"; + this.listViewMasteryCondition.Size = new System.Drawing.Size(582, 194); + this.listViewMasteryCondition.TabIndex = 0; + this.listViewMasteryCondition.UseCompatibleStateImageBehavior = false; + this.listViewMasteryCondition.View = System.Windows.Forms.View.Details; + // + // columnMasteryCond + // + this.columnMasteryCond.Text = "Mastery Condition"; + this.columnMasteryCond.Width = 296; + // + // columnCondBattle + // + this.columnCondBattle.Text = "Stage"; + this.columnCondBattle.Width = 136; // // listViewAllDrops // @@ -259,40 +226,21 @@ private void InitializeComponent() this.listViewAllDrops.View = System.Windows.Forms.View.Details; this.listViewAllDrops.VirtualMode = true; // - // label2 - // - this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(480, 24); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(213, 13); - this.label2.TabIndex = 8; - this.label2.Text = "Show only items with a name that contains: "; - // - // textBoxNameFilter - // - this.textBoxNameFilter.Location = new System.Drawing.Point(699, 21); - this.textBoxNameFilter.Name = "textBoxNameFilter"; - this.textBoxNameFilter.Size = new System.Drawing.Size(182, 20); - this.textBoxNameFilter.TabIndex = 9; - this.textBoxNameFilter.TextChanged += new System.EventHandler(this.textBoxNameFilter_TextChanged); - // // FFRKViewActiveDungeon // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Controls.Add(this.groupBoxCurrentBattle); + this.Controls.Add(this.groupBoxCurrentDungeon); this.Controls.Add(this.groupBoxAllItems); this.Controls.Add(this.groupBoxDungeon); this.Name = "FFRKViewActiveDungeon"; this.Size = new System.Drawing.Size(1038, 441); this.Load += new System.EventHandler(this.FFRKViewCurrentBattle_Load); - this.SizeChanged += new System.EventHandler(this.FFRKViewCurrentBattle_SizeChanged); this.groupBoxDungeon.ResumeLayout(false); this.groupBoxAllItems.ResumeLayout(false); this.groupBoxAllItems.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).EndInit(); - this.groupBoxCurrentBattle.ResumeLayout(false); - this.groupBoxCurrentBattle.PerformLayout(); + this.groupBoxCurrentDungeon.ResumeLayout(false); this.ResumeLayout(false); } @@ -306,22 +254,16 @@ private void InitializeComponent() private System.Windows.Forms.ColumnHeader columnHeaderBattleRounds; private System.Windows.Forms.ColumnHeader columnHeaderBattleBoss; private System.Windows.Forms.ColumnHeader columnHeaderStamina; - private System.Windows.Forms.ListView listViewActiveBattle; - private System.Windows.Forms.ColumnHeader columnHeader1; - private System.Windows.Forms.ColumnHeader columnHeader2; - private System.Windows.Forms.ColumnHeader columnHeader3; - private System.Windows.Forms.ColumnHeader columnHeader4; - private System.Windows.Forms.ColumnHeader columnHeader5; - private System.Windows.Forms.ColumnHeader columnHeader6; - private System.Windows.Forms.Label labelActiveBattleNotice; - private System.Windows.Forms.Label labelNoDrops; private System.Windows.Forms.GroupBox groupBoxAllItems; - private System.Windows.Forms.GroupBox groupBoxCurrentBattle; + private System.Windows.Forms.GroupBox groupBoxCurrentDungeon; private System.Windows.Forms.CheckBox checkBoxRepeatable; private System.Windows.Forms.Label label1; private System.Windows.Forms.NumericUpDown numericUpDown1; private System.Windows.Forms.CheckBox checkBoxFilterSamples; private System.Windows.Forms.TextBox textBoxNameFilter; private System.Windows.Forms.Label label2; + private System.Windows.Forms.ListView listViewMasteryCondition; + private System.Windows.Forms.ColumnHeader columnMasteryCond; + private System.Windows.Forms.ColumnHeader columnCondBattle; } } diff --git a/client/UI/FFRKViewActiveDungeon.cs b/client/UI/FFRKViewActiveDungeon.cs index b174e24..6a27cf9 100644 --- a/client/UI/FFRKViewActiveDungeon.cs +++ b/client/UI/FFRKViewActiveDungeon.cs @@ -46,8 +46,8 @@ private void FFRKViewCurrentBattle_Load(object sender, EventArgs e) if (DesignMode) return; - CenterControl(listViewActiveBattle, labelActiveBattleNotice); - CenterControl(listViewActiveBattle, labelNoDrops); + //CenterControl(listViewActiveBattle, labelActiveBattleNotice); + //CenterControl(listViewActiveBattle, labelNoDrops); if (FFRKProxy.Instance != null) @@ -60,15 +60,17 @@ private void FFRKViewCurrentBattle_Load(object sender, EventArgs e) FFRKProxy.Instance.OnItemCacheRefreshed += FFRKProxy_OnItemCacheRefreshed; PopulateActiveDungeonListView(FFRKProxy.Instance.GameState.ActiveDungeon); - PopulateActiveBattleListView(FFRKProxy.Instance.GameState.ActiveBattle); + PopulateMasteryConditionListView(FFRKProxy.Instance.GameState.ActiveDungeon); + //PopulateActiveBattleListView(FFRKProxy.Instance.GameState.ActiveBattle); listViewAllDrops.VirtualListSize = 0; BeginPopulateAllDropsListView(FFRKProxy.Instance.GameState.ActiveDungeon); } else { - PopulateActiveBattleListView(null); + //PopulateActiveBattleListView(null); PopulateActiveDungeonListView(null); + PopulateMasteryConditionListView(null); listViewAllDrops.VirtualListSize = 0; } } @@ -89,6 +91,12 @@ void BeginPopulateAllDropsListView(EventListBattles dungeon) op.OnRequestComplete += RequestDungeonDrops_OnRequestComplete; FFRKProxy.Instance.Database.BeginExecuteRequest(op); } + else + { + listViewAllDrops.VirtualListSize = 0; + mAllItems.Clear(); + mFilteredItems.Collection.Clear(); + } } void RequestDungeonDrops_OnRequestComplete(List items) @@ -119,7 +127,7 @@ void UpdateAllDropsForLastBattle(EventBattleInitiated battle) stats.TimesRunWithHistogram++; } - lock(FFRKProxy.Instance.Cache.SyncRoot) + lock (FFRKProxy.Instance.Cache.SyncRoot) { foreach (DropEvent drop in battle.Battle.Drops) { @@ -181,18 +189,19 @@ void UpdateAllDropsForLastBattle(EventBattleInitiated battle) void FFRKProxy_OnCompleteBattle(EventBattleInitiated battle) { - this.BeginInvoke((Action)(() => - { - PopulateActiveBattleListView(null); + this.BeginInvoke((Action)(() => + { + //PopulateActiveBattleListView(null); UpdateAllDropsForLastBattle(battle); })); } void FFRKProxy_OnLeaveDungeon() { - this.BeginInvoke((Action)(() => + this.BeginInvoke((Action)(() => { PopulateActiveDungeonListView(null); + PopulateMasteryConditionListView(null); UpdateAllDropsForLastBattle(null); })); } @@ -200,27 +209,32 @@ void FFRKProxy_OnLeaveDungeon() void FFRKProxy_OnListBattles(EventListBattles battles) { BeginPopulateAllDropsListView(battles); - this.BeginInvoke((Action)(() => - { + this.BeginInvoke((Action)(() => + { PopulateActiveDungeonListView(battles); + PopulateMasteryConditionListView(battles); BeginPopulateAllDropsListView(battles); })); } void FFRKProxy_OnListDungeons(EventListDungeons dungeons) { - this.BeginInvoke((Action)(() => { PopulateActiveBattleListView(null); })); + this.BeginInvoke((Action)(() => { + PopulateActiveDungeonListView(null); + PopulateMasteryConditionListView(null); + BeginPopulateAllDropsListView(null); + })); } void FFRKProxy_OnBattleEngaged(EventBattleInitiated battle) { - this.BeginInvoke((Action)(() => { PopulateActiveBattleListView(battle); })); + //this.BeginInvoke((Action)(() => { PopulateActiveBattleListView(battle); })); } private void PopulateActiveDungeonListView(EventListBattles dungeon) { listViewActiveDungeon.Items.Clear(); - PopulateActiveBattleListView(null); + //PopulateActiveBattleListView(null); if (dungeon == null) groupBoxDungeon.Text = "(No Active Dungeon)"; else @@ -239,59 +253,45 @@ private void PopulateActiveDungeonListView(EventListBattles dungeon) listViewActiveDungeon.Items.Add(new ListViewItem(row)); } + foreach (ColumnHeader column in listViewActiveDungeon.Columns) { column.Width = -2; } } } - private void PopulateActiveBattleListView(EventBattleInitiated battle) + private void PopulateMasteryConditionListView(EventListBattles dungeon) { - listViewActiveBattle.Items.Clear(); - if (battle == null) - { - labelActiveBattleNotice.Visible = true; - labelNoDrops.Visible = false; - return; - } - - listViewActiveBattle.View = View.Details; - List drops = battle.Battle.Drops.ToList(); - labelActiveBattleNotice.Visible = false; - if (drops.Count == 0) + listViewMasteryCondition.Items.Clear(); + //PopulateActiveBattleListView(null); + if (dungeon == null) { - labelNoDrops.Visible = true; + //groupBoxDungeon.Text = "(No Active Dungeon)"; return; } - - lock(FFRKProxy.Instance.Cache.SyncRoot) + else { - foreach (DropEvent drop in battle.Battle.Drops) + //groupBoxDungeon.Text = dungeon.DungeonSession.Name; + foreach (DataDungeonCaptures capture in dungeon.UserDungeon.Captures) { - string Item; - DataCache.Items.Key ItemKey = new DataCache.Items.Key { ItemId = drop.ItemId }; - DataCache.Items.Data ItemData = null; - if (drop.ItemType == DataEnemyDropItem.DropItemType.Gold) - Item = String.Format("{0} gold", drop.GoldAmount); - else if (drop.ItemType == DataEnemyDropItem.DropItemType.Materia) - Item = drop.MateriaName; - else if (drop.ItemType == DataEnemyDropItem.DropItemType.Potion) - Item = drop.PotionName; - else if (FFRKProxy.Instance.Cache.Items.TryGetValue(ItemKey, out ItemData)) - Item = ItemData.Name; - else - Item = drop.ItemId.ToString(); - - if (drop.NumberOfItems > 1) - Item += String.Format(" x{0}", drop.NumberOfItems); - string[] row = + foreach (DataDungeonSpScore spscore in capture.SpScore) { - Item, - drop.Rarity.ToString(), - drop.Round.ToString(), - drop.EnemyName, - "", - "" - }; - listViewActiveBattle.Items.Add(new ListViewItem(row)); + string battlename = null; + foreach (DataBattle battle in dungeon.Battles) + { + if (battle.Id == spscore.BattleID) + { + battlename = battle.Name; + break; + } + } + string[] row = + { + battlename, + spscore.Title + }; + listViewMasteryCondition.Items.Add(new ListViewItem(row)); + } } + + foreach (ColumnHeader column in listViewMasteryCondition.Columns) { column.Width = -2; } } } @@ -305,12 +305,6 @@ private void CenterControl(Control parent, Control child) child.Top = parent.Location.Y + (outerh - innerh) / 2; } - private void FFRKViewCurrentBattle_SizeChanged(object sender, EventArgs e) - { - CenterControl(listViewActiveBattle, labelActiveBattleNotice); - CenterControl(listViewActiveBattle, labelNoDrops); - } - private void checkBoxRepeatable_CheckedChanged(object sender, EventArgs e) { RebuildFilteredDropListAndInvalidate(); @@ -350,6 +344,7 @@ private void RebuildFilteredDropListAndInvalidate() }).ToList(); listViewAllDrops.VirtualListSize = mFilteredItems.Collection.Count; listViewAllDrops.Invalidate(); + foreach (ColumnHeader column in listViewAllDrops.Columns) { column.Width = -2; } } } } diff --git a/client/UI/FFRKViewInventory.Designer.cs b/client/UI/FFRKViewInventory.Designer.cs index 2d2a805..0bce263 100644 --- a/client/UI/FFRKViewInventory.Designer.cs +++ b/client/UI/FFRKViewInventory.Designer.cs @@ -28,33 +28,19 @@ protected override void Dispose(bool disposing) /// private void InitializeComponent() { + this.components = new System.ComponentModel.Container(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FFRKViewInventory)); this.dataGridViewEquipment = new System.Windows.Forms.DataGridView(); - this.dgcItemID = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.dgcItem = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.dgcCategory = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.dgcType = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.dgcRarity = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.dgcSynergy = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.dgcLevel = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.dgcATK = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.dgcMAG = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.dgcMND = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.dgcDEF = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.dgcRES = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.dgcScore = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.exportContext = new System.Windows.Forms.ContextMenuStrip(this.components); + this.exportCSVInventoryToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.exportJSONInventoryToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.comboBoxUpgradeMode = new System.Windows.Forms.ComboBox(); this.groupBox3 = new System.Windows.Forms.GroupBox(); - this.dataGridViewBuddies = new FFRKInspector.UI.DataGridViewEx(); - this.dgcCharacterName = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.dgcCharacterLevel = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.dgcCharacterMaxLevel = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.dgcCharacterOptimize = new System.Windows.Forms.DataGridViewCheckBoxColumn(); - this.dgcCharacterOffensiveStat = new System.Windows.Forms.DataGridViewComboBoxColumn(); - this.dgcCharacterDefensiveStat = new System.Windows.Forms.DataGridViewComboBoxColumn(); this.groupBox4 = new System.Windows.Forms.GroupBox(); + this.label6 = new System.Windows.Forms.Label(); + this.comboBoxFilterType = new System.Windows.Forms.ComboBox(); this.linkLabelAlgo = new System.Windows.Forms.LinkLabel(); this.label7 = new System.Windows.Forms.Label(); this.linkLabelMissing = new System.Windows.Forms.LinkLabel(); @@ -78,10 +64,32 @@ private void InitializeComponent() this.dataGridViewTextBoxColumn10 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewTextBoxColumn11 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewTextBoxColumn12 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.dataGridViewTextBoxColumn13 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.dataGridViewBuddies = new FFRKInspector.UI.DataGridViewEx(); + this.dgcCharacterName = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.dgcCharacterLevel = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.dgcCharacterMaxLevel = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.dgcCharacterOptimize = new System.Windows.Forms.DataGridViewCheckBoxColumn(); + this.dgcCharacterOffensiveStat = new System.Windows.Forms.DataGridViewComboBoxColumn(); + this.dgcCharacterDefensiveStat = new System.Windows.Forms.DataGridViewComboBoxColumn(); + this.dgcItemID = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.dgcItem = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.dgcCategory = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.dgcType = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.dgcRarity = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.dgcSynergy = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.dgcLevel = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.dgcATK = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.dgcMAG = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.dgcMND = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.dgcDEF = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.dgcRES = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.dgcScore = new System.Windows.Forms.DataGridViewTextBoxColumn(); ((System.ComponentModel.ISupportInitialize)(this.dataGridViewEquipment)).BeginInit(); + this.exportContext.SuspendLayout(); this.groupBox3.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.dataGridViewBuddies)).BeginInit(); this.groupBox4.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.dataGridViewBuddies)).BeginInit(); this.SuspendLayout(); // // dataGridViewEquipment @@ -109,6 +117,7 @@ private void InitializeComponent() this.dgcDEF, this.dgcRES, this.dgcScore}); + this.dataGridViewEquipment.ContextMenuStrip = this.exportContext; this.dataGridViewEquipment.Location = new System.Drawing.Point(13, 92); this.dataGridViewEquipment.MultiSelect = false; this.dataGridViewEquipment.Name = "dataGridViewEquipment"; @@ -119,102 +128,29 @@ private void InitializeComponent() this.dataGridViewEquipment.ShowEditingIcon = false; this.dataGridViewEquipment.Size = new System.Drawing.Size(748, 446); this.dataGridViewEquipment.TabIndex = 0; + this.dataGridViewEquipment.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridViewEquipment_CellContentClick); // - // dgcItemID - // - this.dgcItemID.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; - this.dgcItemID.HeaderText = "ID"; - this.dgcItemID.Name = "dgcItemID"; - this.dgcItemID.ReadOnly = true; - this.dgcItemID.Width = 43; - // - // dgcItem - // - this.dgcItem.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; - this.dgcItem.HeaderText = "Item"; - this.dgcItem.Name = "dgcItem"; - this.dgcItem.ReadOnly = true; - this.dgcItem.Width = 52; - // - // dgcCategory - // - this.dgcCategory.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; - this.dgcCategory.HeaderText = "Category"; - this.dgcCategory.Name = "dgcCategory"; - this.dgcCategory.ReadOnly = true; - this.dgcCategory.Width = 74; - // - // dgcType - // - this.dgcType.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; - this.dgcType.HeaderText = "Type"; - this.dgcType.Name = "dgcType"; - this.dgcType.ReadOnly = true; - this.dgcType.Width = 56; - // - // dgcRarity - // - this.dgcRarity.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - this.dgcRarity.HeaderText = "Rarity"; - this.dgcRarity.Name = "dgcRarity"; - this.dgcRarity.ReadOnly = true; - // - // dgcSynergy - // - this.dgcSynergy.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - this.dgcSynergy.HeaderText = "Synergy"; - this.dgcSynergy.Name = "dgcSynergy"; - this.dgcSynergy.ReadOnly = true; - // - // dgcLevel - // - this.dgcLevel.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - this.dgcLevel.HeaderText = "Level"; - this.dgcLevel.Name = "dgcLevel"; - this.dgcLevel.ReadOnly = true; - // - // dgcATK - // - this.dgcATK.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - this.dgcATK.HeaderText = "ATK"; - this.dgcATK.Name = "dgcATK"; - this.dgcATK.ReadOnly = true; - // - // dgcMAG + // exportContext // - this.dgcMAG.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - this.dgcMAG.HeaderText = "MAG"; - this.dgcMAG.Name = "dgcMAG"; - this.dgcMAG.ReadOnly = true; + this.exportContext.AccessibleName = ""; + this.exportContext.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.exportCSVInventoryToolStripMenuItem, this.exportJSONInventoryToolStripMenuItem}); + this.exportContext.Name = "exportContext"; + this.exportContext.Size = new System.Drawing.Size(161, 26); // - // dgcMND + // exportCSVInventoryToolStripMenuItem // - this.dgcMND.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - this.dgcMND.HeaderText = "MND"; - this.dgcMND.Name = "dgcMND"; - this.dgcMND.ReadOnly = true; + this.exportCSVInventoryToolStripMenuItem.Name = "exportCSVInventoryToolStripMenuItem"; + this.exportCSVInventoryToolStripMenuItem.Size = new System.Drawing.Size(160, 22); + this.exportCSVInventoryToolStripMenuItem.Text = "Export Inventory"; + this.exportCSVInventoryToolStripMenuItem.Click += new System.EventHandler(this.exportCSVInventoryToolStripMenuItem_Click); // - // dgcDEF + // exportJSONInventoryToolStripMenuItem // - this.dgcDEF.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - this.dgcDEF.HeaderText = "DEF"; - this.dgcDEF.Name = "dgcDEF"; - this.dgcDEF.ReadOnly = true; - // - // dgcRES - // - this.dgcRES.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - this.dgcRES.HeaderText = "RES"; - this.dgcRES.Name = "dgcRES"; - this.dgcRES.ReadOnly = true; - // - // dgcScore - // - this.dgcScore.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; - this.dgcScore.HeaderText = "Score"; - this.dgcScore.Name = "dgcScore"; - this.dgcScore.ReadOnly = true; - this.dgcScore.Width = 60; + this.exportJSONInventoryToolStripMenuItem.Name = "exportJSONInventoryToolStripMenuItem"; + this.exportJSONInventoryToolStripMenuItem.Size = new System.Drawing.Size(160, 22); + this.exportJSONInventoryToolStripMenuItem.Text = "Export names and levels to JSON"; + this.exportJSONInventoryToolStripMenuItem.Click += new System.EventHandler(this.exportJSONInventoryToolStripMenuItem_Click); // // comboBoxUpgradeMode // @@ -242,80 +178,14 @@ private void InitializeComponent() this.groupBox3.TabIndex = 6; this.groupBox3.TabStop = false; this.groupBox3.Text = "Available characters"; - // - // dataGridViewBuddies - // - this.dataGridViewBuddies.AllowUserToAddRows = false; - this.dataGridViewBuddies.AllowUserToDeleteRows = false; - this.dataGridViewBuddies.AllowUserToResizeRows = false; - this.dataGridViewBuddies.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; - this.dataGridViewBuddies.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { - this.dgcCharacterName, - this.dgcCharacterLevel, - this.dgcCharacterMaxLevel, - this.dgcCharacterOptimize, - this.dgcCharacterOffensiveStat, - this.dgcCharacterDefensiveStat}); - this.dataGridViewBuddies.Dock = System.Windows.Forms.DockStyle.Fill; - this.dataGridViewBuddies.Location = new System.Drawing.Point(3, 16); - this.dataGridViewBuddies.Name = "dataGridViewBuddies"; - this.dataGridViewBuddies.RowHeadersVisible = false; - this.dataGridViewBuddies.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; - this.dataGridViewBuddies.Size = new System.Drawing.Size(390, 587); - this.dataGridViewBuddies.TabIndex = 0; - this.dataGridViewBuddies.CellValueChanged += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridViewBuddies_CellValueChanged); - // - // dgcCharacterName - // - this.dgcCharacterName.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; - this.dgcCharacterName.HeaderText = "Name"; - this.dgcCharacterName.Name = "dgcCharacterName"; - this.dgcCharacterName.ReadOnly = true; - this.dgcCharacterName.Width = 60; - // - // dgcCharacterLevel - // - this.dgcCharacterLevel.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - this.dgcCharacterLevel.HeaderText = "Level"; - this.dgcCharacterLevel.Name = "dgcCharacterLevel"; - this.dgcCharacterLevel.ReadOnly = true; - // - // dgcCharacterMaxLevel - // - this.dgcCharacterMaxLevel.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - this.dgcCharacterMaxLevel.HeaderText = "Max"; - this.dgcCharacterMaxLevel.Name = "dgcCharacterMaxLevel"; - this.dgcCharacterMaxLevel.ReadOnly = true; - // - // dgcCharacterOptimize - // - this.dgcCharacterOptimize.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - this.dgcCharacterOptimize.HeaderText = "Score"; - this.dgcCharacterOptimize.Name = "dgcCharacterOptimize"; - this.dgcCharacterOptimize.ToolTipText = "When checked, this character will be considered when computing each piece of equi" + - "pment\'s score on the right-hand pane"; - // - // dgcCharacterOffensiveStat - // - this.dgcCharacterOffensiveStat.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - this.dgcCharacterOffensiveStat.HeaderText = "Off. Stat"; - this.dgcCharacterOffensiveStat.Name = "dgcCharacterOffensiveStat"; - this.dgcCharacterOffensiveStat.ToolTipText = "Determines what stat the scoring algorithm should prioritize for this character o" + - "n weapons"; - // - // dgcCharacterDefensiveStat - // - this.dgcCharacterDefensiveStat.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - this.dgcCharacterDefensiveStat.HeaderText = "Def. Stat"; - this.dgcCharacterDefensiveStat.Name = "dgcCharacterDefensiveStat"; - this.dgcCharacterDefensiveStat.ToolTipText = "Determine what stat the scoring algorithm should prioritize for this character on" + - " armor."; // // groupBox4 // this.groupBox4.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); + this.groupBox4.Controls.Add(this.label6); + this.groupBox4.Controls.Add(this.comboBoxFilterType); this.groupBox4.Controls.Add(this.linkLabelAlgo); this.groupBox4.Controls.Add(this.label7); this.groupBox4.Controls.Add(this.linkLabelMissing); @@ -336,6 +206,30 @@ private void InitializeComponent() this.groupBox4.TabStop = false; this.groupBox4.Text = "Equipment"; // + // label6 + // + this.label6.AutoSize = true; + this.label6.Location = new System.Drawing.Point(482, 68); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(73, 13); + this.label6.TabIndex = 14; + this.label6.Text = "Filter by Type:"; + // + // comboBoxFilterType + // + this.comboBoxFilterType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBoxFilterType.FormattingEnabled = true; + this.comboBoxFilterType.Items.AddRange(new object[] { + "All", + "Weapon", + "Armor", + "Accessory"}); + this.comboBoxFilterType.Location = new System.Drawing.Point(561, 65); + this.comboBoxFilterType.Name = "comboBoxFilterType"; + this.comboBoxFilterType.Size = new System.Drawing.Size(150, 21); + this.comboBoxFilterType.TabIndex = 13; + this.comboBoxFilterType.SelectedIndexChanged += new System.EventHandler(this.comboBoxFilterType_SelectedIndexChanged); + // // linkLabelAlgo // this.linkLabelAlgo.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); @@ -459,6 +353,7 @@ private void InitializeComponent() this.dataGridViewTextBoxColumn1.HeaderText = "Item"; this.dataGridViewTextBoxColumn1.Name = "dataGridViewTextBoxColumn1"; this.dataGridViewTextBoxColumn1.ReadOnly = true; + this.dataGridViewTextBoxColumn1.Width = 43; // // dataGridViewTextBoxColumn2 // @@ -466,6 +361,7 @@ private void InitializeComponent() this.dataGridViewTextBoxColumn2.HeaderText = "Category"; this.dataGridViewTextBoxColumn2.Name = "dataGridViewTextBoxColumn2"; this.dataGridViewTextBoxColumn2.ReadOnly = true; + this.dataGridViewTextBoxColumn2.Width = 52; // // dataGridViewTextBoxColumn3 // @@ -473,6 +369,7 @@ private void InitializeComponent() this.dataGridViewTextBoxColumn3.HeaderText = "Type"; this.dataGridViewTextBoxColumn3.Name = "dataGridViewTextBoxColumn3"; this.dataGridViewTextBoxColumn3.ReadOnly = true; + this.dataGridViewTextBoxColumn3.Width = 74; // // dataGridViewTextBoxColumn4 // @@ -515,6 +412,7 @@ private void InitializeComponent() this.dataGridViewTextBoxColumn9.HeaderText = "MND"; this.dataGridViewTextBoxColumn9.Name = "dataGridViewTextBoxColumn9"; this.dataGridViewTextBoxColumn9.ReadOnly = true; + this.dataGridViewTextBoxColumn9.Width = 58; // // dataGridViewTextBoxColumn10 // @@ -522,6 +420,7 @@ private void InitializeComponent() this.dataGridViewTextBoxColumn10.HeaderText = "DEF"; this.dataGridViewTextBoxColumn10.Name = "dataGridViewTextBoxColumn10"; this.dataGridViewTextBoxColumn10.ReadOnly = true; + this.dataGridViewTextBoxColumn10.Width = 57; // // dataGridViewTextBoxColumn11 // @@ -529,6 +428,7 @@ private void InitializeComponent() this.dataGridViewTextBoxColumn11.HeaderText = "RES"; this.dataGridViewTextBoxColumn11.Name = "dataGridViewTextBoxColumn11"; this.dataGridViewTextBoxColumn11.ReadOnly = true; + this.dataGridViewTextBoxColumn11.Width = 58; // // dataGridViewTextBoxColumn12 // @@ -536,6 +436,179 @@ private void InitializeComponent() this.dataGridViewTextBoxColumn12.HeaderText = "Score"; this.dataGridViewTextBoxColumn12.Name = "dataGridViewTextBoxColumn12"; this.dataGridViewTextBoxColumn12.ReadOnly = true; + this.dataGridViewTextBoxColumn12.Width = 57; + // + // dataGridViewTextBoxColumn13 + // + this.dataGridViewTextBoxColumn13.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; + this.dataGridViewTextBoxColumn13.HeaderText = "Score"; + this.dataGridViewTextBoxColumn13.Name = "dataGridViewTextBoxColumn13"; + this.dataGridViewTextBoxColumn13.ReadOnly = true; + this.dataGridViewTextBoxColumn13.Width = 60; + // + // dataGridViewBuddies + // + this.dataGridViewBuddies.AllowUserToAddRows = false; + this.dataGridViewBuddies.AllowUserToDeleteRows = false; + this.dataGridViewBuddies.AllowUserToResizeRows = false; + this.dataGridViewBuddies.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.dataGridViewBuddies.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { + this.dgcCharacterName, + this.dgcCharacterLevel, + this.dgcCharacterMaxLevel, + this.dgcCharacterOptimize, + this.dgcCharacterOffensiveStat, + this.dgcCharacterDefensiveStat}); + this.dataGridViewBuddies.Dock = System.Windows.Forms.DockStyle.Fill; + this.dataGridViewBuddies.Location = new System.Drawing.Point(3, 16); + this.dataGridViewBuddies.Name = "dataGridViewBuddies"; + this.dataGridViewBuddies.RowHeadersVisible = false; + this.dataGridViewBuddies.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; + this.dataGridViewBuddies.Size = new System.Drawing.Size(390, 587); + this.dataGridViewBuddies.TabIndex = 0; + this.dataGridViewBuddies.CellValueChanged += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridViewBuddies_CellValueChanged); + // + // dgcCharacterName + // + this.dgcCharacterName.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; + this.dgcCharacterName.HeaderText = "Name"; + this.dgcCharacterName.Name = "dgcCharacterName"; + this.dgcCharacterName.ReadOnly = true; + this.dgcCharacterName.Width = 60; + // + // dgcCharacterLevel + // + this.dgcCharacterLevel.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.dgcCharacterLevel.HeaderText = "Level"; + this.dgcCharacterLevel.Name = "dgcCharacterLevel"; + this.dgcCharacterLevel.ReadOnly = true; + // + // dgcCharacterMaxLevel + // + this.dgcCharacterMaxLevel.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.dgcCharacterMaxLevel.HeaderText = "Max"; + this.dgcCharacterMaxLevel.Name = "dgcCharacterMaxLevel"; + this.dgcCharacterMaxLevel.ReadOnly = true; + // + // dgcCharacterOptimize + // + this.dgcCharacterOptimize.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.dgcCharacterOptimize.HeaderText = "Score"; + this.dgcCharacterOptimize.Name = "dgcCharacterOptimize"; + this.dgcCharacterOptimize.ToolTipText = "When checked, this character will be considered when computing each piece of equi" + + "pment\'s score on the right-hand pane"; + // + // dgcCharacterOffensiveStat + // + this.dgcCharacterOffensiveStat.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.dgcCharacterOffensiveStat.HeaderText = "Off. Stat"; + this.dgcCharacterOffensiveStat.Name = "dgcCharacterOffensiveStat"; + this.dgcCharacterOffensiveStat.ToolTipText = "Determines what stat the scoring algorithm should prioritize for this character o" + + "n weapons"; + // + // dgcCharacterDefensiveStat + // + this.dgcCharacterDefensiveStat.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.dgcCharacterDefensiveStat.HeaderText = "Def. Stat"; + this.dgcCharacterDefensiveStat.Name = "dgcCharacterDefensiveStat"; + this.dgcCharacterDefensiveStat.ToolTipText = "Determine what stat the scoring algorithm should prioritize for this character on" + + " armor."; + // + // dgcItemID + // + this.dgcItemID.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; + this.dgcItemID.HeaderText = "ID"; + this.dgcItemID.Name = "dgcItemID"; + this.dgcItemID.ReadOnly = true; + this.dgcItemID.Width = 43; + // + // dgcItem + // + this.dgcItem.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; + this.dgcItem.HeaderText = "Item"; + this.dgcItem.Name = "dgcItem"; + this.dgcItem.ReadOnly = true; + this.dgcItem.Width = 52; + // + // dgcCategory + // + this.dgcCategory.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; + this.dgcCategory.HeaderText = "Category"; + this.dgcCategory.Name = "dgcCategory"; + this.dgcCategory.ReadOnly = true; + this.dgcCategory.Width = 74; + // + // dgcType + // + this.dgcType.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; + this.dgcType.HeaderText = "Type"; + this.dgcType.Name = "dgcType"; + this.dgcType.ReadOnly = true; + this.dgcType.Width = 56; + // + // dgcRarity + // + this.dgcRarity.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.dgcRarity.HeaderText = "Rarity"; + this.dgcRarity.Name = "dgcRarity"; + this.dgcRarity.ReadOnly = true; + // + // dgcSynergy + // + this.dgcSynergy.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.dgcSynergy.HeaderText = "Synergy"; + this.dgcSynergy.Name = "dgcSynergy"; + this.dgcSynergy.ReadOnly = true; + // + // dgcLevel + // + this.dgcLevel.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.dgcLevel.HeaderText = "Level"; + this.dgcLevel.Name = "dgcLevel"; + this.dgcLevel.ReadOnly = true; + // + // dgcATK + // + this.dgcATK.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.dgcATK.HeaderText = "ATK"; + this.dgcATK.Name = "dgcATK"; + this.dgcATK.ReadOnly = true; + // + // dgcMAG + // + this.dgcMAG.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.dgcMAG.HeaderText = "MAG"; + this.dgcMAG.Name = "dgcMAG"; + this.dgcMAG.ReadOnly = true; + // + // dgcMND + // + this.dgcMND.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.dgcMND.HeaderText = "MND"; + this.dgcMND.Name = "dgcMND"; + this.dgcMND.ReadOnly = true; + // + // dgcDEF + // + this.dgcDEF.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.dgcDEF.HeaderText = "DEF"; + this.dgcDEF.Name = "dgcDEF"; + this.dgcDEF.ReadOnly = true; + // + // dgcRES + // + this.dgcRES.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.dgcRES.HeaderText = "RES"; + this.dgcRES.Name = "dgcRES"; + this.dgcRES.ReadOnly = true; + // + // dgcScore + // + this.dgcScore.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; + this.dgcScore.HeaderText = "Score"; + this.dgcScore.Name = "dgcScore"; + this.dgcScore.ReadOnly = true; + this.dgcScore.Width = 60; // // FFRKViewInventory // @@ -547,14 +620,20 @@ private void InitializeComponent() this.Size = new System.Drawing.Size(1172, 631); this.Load += new System.EventHandler(this.FFRKViewInventory_Load); ((System.ComponentModel.ISupportInitialize)(this.dataGridViewEquipment)).EndInit(); + this.exportContext.ResumeLayout(false); this.groupBox3.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.dataGridViewBuddies)).EndInit(); this.groupBox4.ResumeLayout(false); this.groupBox4.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.dataGridViewBuddies)).EndInit(); this.ResumeLayout(false); } + private void ComboBoxFilterType_SelectedIndexChanged(object sender, System.EventArgs e) + { + throw new System.NotImplementedException(); + } + #endregion private System.Windows.Forms.DataGridView dataGridViewEquipment; @@ -591,6 +670,12 @@ private void InitializeComponent() private System.Windows.Forms.LinkLabel linkLabelAlgo; private System.Windows.Forms.Label label7; private System.Windows.Forms.LinkLabel linkLabelMissing; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.ComboBox comboBoxFilterType; + private System.Windows.Forms.ContextMenuStrip exportContext; + private System.Windows.Forms.ToolStripMenuItem exportCSVInventoryToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem exportJSONInventoryToolStripMenuItem; + private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn13; private System.Windows.Forms.DataGridViewTextBoxColumn dgcItemID; private System.Windows.Forms.DataGridViewTextBoxColumn dgcItem; private System.Windows.Forms.DataGridViewTextBoxColumn dgcCategory; diff --git a/client/UI/FFRKViewInventory.cs b/client/UI/FFRKViewInventory.cs index b622f49..4167197 100644 --- a/client/UI/FFRKViewInventory.cs +++ b/client/UI/FFRKViewInventory.cs @@ -14,6 +14,7 @@ using FFRKInspector.DataCache; using FFRKInspector.Analyzer; using System.Diagnostics; +using System.IO; namespace FFRKInspector.UI { @@ -34,6 +35,14 @@ private class GridEquipStats public byte MaxLevel; } + private enum ViewFilterTypeComboIndex + { + All = 0, + Weapon = 1, + Armor = 2, + Accessory = 3 + } + private enum ViewModeComboIndex { AvailableItems = 0, @@ -83,6 +92,7 @@ public FFRKViewInventory() comboBoxViewMode.SelectedIndex = 0; comboBoxUpgradeMode.SelectedIndex = (int)ViewUpgradeModeComboIndex.CurrentUpgradeCurrentLevel; comboBoxSynergy.SelectedIndex = 0; + comboBoxFilterType.SelectedIndex = (int)ViewFilterTypeComboIndex.All; comboBoxScoreSelection.SelectedIndex = (int)ScoreUpgradeModeComboIndex.MaxUpgradeMaxLevel; dgcCharacterDefensiveStat.CellTemplate = new EnumDataViewGridComboBoxCell(); dgcCharacterOffensiveStat.CellTemplate = new EnumDataViewGridComboBoxCell(); @@ -116,6 +126,15 @@ private void FFRKViewInventory_Load(object sender, EventArgs e) } } + private void RecalculateInventory() + { + if (FFRKProxy.Instance != null) + { + DataPartyDetails party = FFRKProxy.Instance.GameState.PartyDetails; + if (party != null) { UpdateEquipmentGrid(party.Equipments); } + } + } + private class SynergyColumnValue : IComparable { private RealmSynergy.SynergyValue mValue; @@ -123,7 +142,7 @@ public SynergyColumnValue(RealmSynergy.SynergyValue Value) { mValue = Value; } - + public int CompareTo(object obj) { return mValue.GameSeries.CompareTo(((SynergyColumnValue)obj).mValue.GameSeries); @@ -159,7 +178,7 @@ public LevelColumnValue(int Current, int Max) mCurrentLevel = Current; mMaxLevel = Max; } - + public int CompareTo(object obj) { LevelColumnValue other = (LevelColumnValue)obj; @@ -199,7 +218,7 @@ public RarityColumnValue(int BaseRarity, int Upgrades) mBaseRarity = BaseRarity; mUpgrades = Upgrades; } - + public int CompareTo(object obj) { RarityColumnValue other = (RarityColumnValue)obj; @@ -237,7 +256,7 @@ public ScoreColumnValue(double Score) { mScore = Score; } - + public int CompareTo(object obj) { ScoreColumnValue other = (ScoreColumnValue)obj; @@ -304,24 +323,40 @@ private void UpdatePartyGrid(List buddies) void UpdateEquipmentGrid(DataEquipmentInformation[] EquipList) { + int filterTypeLowerBound; + int filterTypeUpperBound; + if (comboBoxFilterType.SelectedIndex.Equals((int)ViewFilterTypeComboIndex.All)) { + filterTypeLowerBound = 0; //If "All" filter selected, select all item types (specifically those within index range 0-99). + filterTypeUpperBound = 99; + } + else { //If any other filter selected, set upper and lower bound of item types to that specific type. + filterTypeLowerBound = comboBoxFilterType.SelectedIndex; + filterTypeUpperBound = comboBoxFilterType.SelectedIndex; + } mEquipments = EquipList; dataGridViewEquipment.Rows.Clear(); foreach (DataEquipmentInformation equip in EquipList) { - int row_index = dataGridViewEquipment.Rows.Add(); - DataGridViewRow row = dataGridViewEquipment.Rows[row_index]; - row.Tag = equip; - row.Cells[dgcItemID.Name].Value = equip.EquipmentId; - row.Cells[dgcItem.Name].Value = equip.Name; - row.Cells[dgcCategory.Name].Value = equip.Category; - row.Cells[dgcType.Name].Value = equip.Type; - row.Cells[dgcRarity.Name].Value = new RarityColumnValue((int)equip.BaseRarity, (int)equip.EvolutionNumber); - row.Cells[dgcSynergy.Name].Value = new SynergyColumnValue(RealmSynergy.FromSeries(equip.SeriesId)); - row.Cells[dgcLevel.Name].Value = new LevelColumnValue(equip.Level, equip.LevelMax); - row.Cells[dgcScore.Name].Value = new ScoreColumnValue(mAnalyzer.GetScore(equip.InstanceId)); - - GridEquipStats stats = ComputeDisplayStats(equip); - SetStatsForRow(row, equip, stats); + //If "All" selected, chooses all item types from 0-99, if "Weapon" is selected, chooses item types in range 1-1 (i.e. =1). + if ( ((int)equip.Type>=filterTypeLowerBound) && ((int)equip.Type<=filterTypeUpperBound) + && (equip.Category != SchemaConstants.EquipmentCategory.ArmorUpgrade) //Exclude Armour upgrade mats from "Armour" filter. + && (equip.Category != SchemaConstants.EquipmentCategory.WeaponUpgrade)) //Exclude Weapon upgrade mats from "Weapon" filter. + { + int row_index = dataGridViewEquipment.Rows.Add(); + DataGridViewRow row = dataGridViewEquipment.Rows[row_index]; + row.Tag = equip; + row.Cells[dgcItemID.Name].Value = equip.EquipmentId; + row.Cells[dgcItem.Name].Value = equip.Name; + row.Cells[dgcCategory.Name].Value = equip.Category; + row.Cells[dgcType.Name].Value = equip.Type; + row.Cells[dgcRarity.Name].Value = new RarityColumnValue((int)equip.BaseRarity, (int)equip.EvolutionNumber); + row.Cells[dgcSynergy.Name].Value = new SynergyColumnValue(RealmSynergy.FromSeries(equip.SeriesId)); + row.Cells[dgcLevel.Name].Value = new LevelColumnValue(equip.Level, equip.LevelMax); + row.Cells[dgcScore.Name].Value = new ScoreColumnValue(mAnalyzer.GetScore(equip.InstanceId)); + + GridEquipStats stats = ComputeDisplayStats(equip); + SetStatsForRow(row, equip, stats); + } } } @@ -487,6 +522,11 @@ private void comboBoxSynergy_SelectedIndexChanged(object sender, EventArgs e) RecomputeAllItemStats(); } + private void comboBoxFilterType_SelectedIndexChanged(object sender, EventArgs e) + { + RecalculateInventory(); + } + private bool SetValueIfDirty(object source, ref T dest) { T new_value = (T)source; @@ -559,5 +599,124 @@ private void linkLabelAlgo_LinkClicked_1(object sender, LinkLabelLinkClickedEven { Process.Start("https://ffrki.wordpress.com/2015/05/30/about-the-inventory-analysis-algorithm/"); } + + private void exportCSVInventoryToolStripMenuItem_Click(object sender, EventArgs e) + { + try + { + SaveFileDialog dialog = new SaveFileDialog(); + dialog.Filter = "CSV files (*.csv)|*.csv"; + dialog.FilterIndex = 0; + dialog.RestoreDirectory = false; + if (dialog.ShowDialog() == DialogResult.OK) + { + using (Stream s = dialog.OpenFile()) + using (StreamWriter w = new StreamWriter(s)) + { + string value = ""; + DataGridViewRow dr = new DataGridViewRow(); + //write header rows to csv + for (int i = 0; i <= dataGridViewEquipment.Columns.Count - 1; i++) + { + if (i > 0) + { + w.Write(","); + } + w.Write('"' + dataGridViewEquipment.Columns[i].HeaderText + '"'); + } + + w.WriteLine(); + + //write DataGridView rows to csv + for (int j = 0; j <= dataGridViewEquipment.Rows.Count - 1; j++) + { + if (j > 0) + { + w.WriteLine(); + } + + dr = dataGridViewEquipment.Rows[j]; + + for (int i = 0; i <= dataGridViewEquipment.Columns.Count - 1; i++) + { + if (i > 0) + { + w.Write(","); + } + + value = dr.Cells[i].Value.ToString(); + //replace comma's with spaces + value = value.Replace(',', ' '); + value = value.Replace('+', '+'); + //replace embedded newlines with spaces + //value = value.Replace(Environment.NewLine, " "); + + w.Write(value); + } + } + } + } + MessageBox.Show(String.Format("Inventory successfully exported.")); + } + catch (Exception ex) + { + MessageBox.Show("FFRK Inspector encountered an error while exporting the data. " + ex.Message); + } + } + + private void exportJSONInventoryToolStripMenuItem_Click(object sender, EventArgs e) + { + try + { + SaveFileDialog dialog = new SaveFileDialog(); + dialog.Filter = "Text files (*.txt)|*.txt"; + dialog.FilterIndex = 0; + dialog.RestoreDirectory = false; + if (dialog.ShowDialog() == DialogResult.OK) + { + using (Stream s = dialog.OpenFile()) + using (StreamWriter w = new StreamWriter(s)) + { + string name = ""; + string level = ""; + string format = "{{\"n\":\"{0}\",\"l\":{1}}}"; + DataGridViewRow dr = new DataGridViewRow(); + //open brace + w.Write("["); + + for (int j = 0; j <= dataGridViewEquipment.Rows.Count - 1; j++) + { + if (j > 0) + { + w.WriteLine(','); + } + + //clean up the item name + name = dataGridViewEquipment.Rows[j].Cells["dgcItem"].Value.ToString() + .Replace('"', '\"').Replace('+', ' ').Replace('+', ' ').Trim(); + //take the first set of digits from the level value (leaving out the level cap segment /##) + level = new string(dataGridViewEquipment.Rows[j].Cells["dgcLevel"].Value.ToString() + .TakeWhile(val => char.IsNumber(val)).ToArray()); + + w.Write(string.Format(format, name, level)); + } + + //close brace + w.Write("]"); + + } + } + MessageBox.Show(String.Format("Names and levels successfully exported to JSON.")); + } + catch (Exception ex) + { + MessageBox.Show("FFRK Inspector encountered an error while exporting the data. " + ex.Message); + } + } + + private void dataGridViewEquipment_CellContentClick(object sender, DataGridViewCellEventArgs e) + { + + } } } diff --git a/client/UI/FFRKViewInventory.resx b/client/UI/FFRKViewInventory.resx index cf03260..88a8fb5 100644 --- a/client/UI/FFRKViewInventory.resx +++ b/client/UI/FFRKViewInventory.resx @@ -156,6 +156,9 @@ True + + 17, 17 + True diff --git a/client/UI/FFRKViewItemSearch.cs b/client/UI/FFRKViewItemSearch.cs index b681f73..052883e 100644 --- a/client/UI/FFRKViewItemSearch.cs +++ b/client/UI/FFRKViewItemSearch.cs @@ -195,6 +195,11 @@ private void DoSearch() request.Name.Value = textBoxNameFilter.Text; foreach (RealmSynergy.SynergyValue value in listBoxRealmSynergy.SelectedItems) request.Synergies.AddValue(value); + if (listBoxWorld.Enabled) + { + foreach (WorldListItem world in listBoxWorld.SelectedItems) + request.Worlds.AddValue(world.WorldId); + } if (listBoxBattle.Enabled) { foreach (BattleListItem battle in listBoxBattle.SelectedItems)