Added STW Heroes & Defenders icon creation

This commit is contained in:
Asval
2019-05-12 16:51:24 +02:00
parent faf44b8555
commit 9ec1b46b4c
8 changed files with 121 additions and 11 deletions

View File

@@ -115,6 +115,12 @@
<setting name="createIconForAmmo" serializeAs="String">
<value>True</value>
</setting>
<setting name="createIconForSTWDefenders" serializeAs="String">
<value>True</value>
</setting>
<setting name="createIconForSTWHeroes" serializeAs="String">
<value>True</value>
</setting>
</FModel.Properties.Settings>
</userSettings>
</configuration>

View File

@@ -40,6 +40,7 @@
this.label6 = new System.Windows.Forms.Label();
this.commitHash = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label();
this.label8 = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.SuspendLayout();
//
@@ -120,7 +121,7 @@
this.label5.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.label5.AutoSize = true;
this.label5.Font = new System.Drawing.Font("Microsoft Sans Serif", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label5.Location = new System.Drawing.Point(56, 124);
this.label5.Location = new System.Drawing.Point(127, 124);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(46, 12);
this.label5.TabIndex = 7;
@@ -132,7 +133,7 @@
this.label6.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.label6.AutoSize = true;
this.label6.Font = new System.Drawing.Font("Microsoft Sans Serif", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label6.Location = new System.Drawing.Point(108, 124);
this.label6.Location = new System.Drawing.Point(178, 124);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(61, 12);
this.label6.TabIndex = 8;
@@ -163,11 +164,24 @@
this.label7.Text = "Commit:";
this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// label8
//
this.label8.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.label8.AutoSize = true;
this.label8.Font = new System.Drawing.Font("Microsoft Sans Serif", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label8.Location = new System.Drawing.Point(53, 124);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(71, 12);
this.label8.TabIndex = 11;
this.label8.Text = "• Waddlesworth";
this.label8.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// About
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(467, 145);
this.Controls.Add(this.label8);
this.Controls.Add(this.label7);
this.Controls.Add(this.commitHash);
this.Controls.Add(this.label6);
@@ -205,5 +219,6 @@
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Label commitHash;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.Label label8;
}
}

View File

@@ -55,7 +55,9 @@
"Cosmetics",
"Traps",
"Variants",
"Ammo"});
"Ammo",
"STW Heroes",
"STW Defenders"});
this.checkedAssets.Location = new System.Drawing.Point(12, 12);
this.checkedAssets.Name = "checkedAssets";
this.checkedAssets.Size = new System.Drawing.Size(307, 274);

View File

@@ -21,6 +21,8 @@ namespace FModel.Forms
checkedAssets.SetItemChecked(3, Properties.Settings.Default.createIconForTraps);
checkedAssets.SetItemChecked(4, Properties.Settings.Default.createIconForVariants);
checkedAssets.SetItemChecked(5, Properties.Settings.Default.createIconForAmmo);
checkedAssets.SetItemChecked(6, Properties.Settings.Default.createIconForSTWHeroes);
checkedAssets.SetItemChecked(7, Properties.Settings.Default.createIconForSTWDefenders);
}
private void OKButton_Click(object sender, EventArgs e)
@@ -32,6 +34,8 @@ namespace FModel.Forms
Properties.Settings.Default.createIconForTraps = checkedAssets.GetItemChecked(3);
Properties.Settings.Default.createIconForVariants = checkedAssets.GetItemChecked(4);
Properties.Settings.Default.createIconForAmmo = checkedAssets.GetItemChecked(5);
Properties.Settings.Default.createIconForSTWHeroes = checkedAssets.GetItemChecked(6);
Properties.Settings.Default.createIconForSTWDefenders = checkedAssets.GetItemChecked(7);
Properties.Settings.Default.Save(); //SAVE
Close();

View File

@@ -672,7 +672,7 @@ namespace FModel
//ASK DIFFERENCE FILE AND COMPARE
OpenFileDialog theDialog = new OpenFileDialog();
theDialog.Title = @"Choose your Backup PAK File";
theDialog.InitialDirectory = DefaultOutputPath;
theDialog.InitialDirectory = DefaultOutputPath + "\\Backup";
theDialog.Multiselect = false;
theDialog.Filter = @"TXT Files (*.txt)|*.txt|All Files (*.*)|*.*";
Invoke(new Action(() =>
@@ -1418,14 +1418,18 @@ namespace FModel
{
if (Settings.Default.createIconForCosmetics && (itemId[i].ExportType.Contains("Athena") && itemId[i].ExportType.Contains("Item") && itemId[i].ExportType.Contains("Definition")))
CreateItemIcon(itemId[i], true);
else if (Settings.Default.createIconForConsumablesWeapons && (itemId[i].ExportType.Contains("FortWeaponRangedItemDefinition") || itemId[i].ExportType.Contains("FortWeaponMeleeItemDefinition")))
else if (Settings.Default.createIconForConsumablesWeapons && (itemId[i].ExportType == "FortWeaponRangedItemDefinition" || itemId[i].ExportType == "FortWeaponMeleeItemDefinition"))
CreateItemIcon(itemId[i], false, true);
else if (Settings.Default.createIconForTraps && (itemId[i].ExportType.Contains("FortTrapItemDefinition") || itemId[i].ExportType.Contains("FortContextTrapItemDefinition")))
else if (Settings.Default.createIconForTraps && (itemId[i].ExportType == "FortTrapItemDefinition" || itemId[i].ExportType == "FortContextTrapItemDefinition"))
CreateItemIcon(itemId[i]);
else if (Settings.Default.createIconForVariants && (itemId[i].ExportType == "FortVariantTokenType"))
CreateItemIcon(itemId[i], false, false, true);
else if (Settings.Default.createIconForAmmo && (itemId[i].ExportType == "FortAmmoItemDefinition"))
CreateItemIcon(itemId[i], false, false, false, "ammo");
else if (Settings.Default.createIconForSTWHeroes && (itemId[i].ExportType == "FortHeroType" && (questJson.Contains("ItemDefinition") || questJson.Contains("TestDefsSkydive") || questJson.Contains("GameplayPrototypes")))) //Contains x not to trigger HID from BR
CreateItemIcon(itemId[i], false, false, false, "stwHeroes");
else if (Settings.Default.createIconForSTWDefenders && (itemId[i].ExportType == "FortDefenderItemDefinition"))
CreateItemIcon(itemId[i], false, false, false, "stwDefenders");
else if (itemId[i].ExportType == "FortChallengeBundleItemDefinition")
CreateChallengesIcon(itemId[i], parsedJson, questJson);
else if (itemId[i].ExportType == "Texture2D")
@@ -1664,6 +1668,43 @@ namespace FModel
catch (Exception)
{
} //COSMETIC USER FACING FLAGS
if (SpecialMode == "stwHeroes")
{
try
{
g.DrawString(theItem.AttributeInitKey.AttributeInitCategory, new Font(_pfc.Families[0], 13), new SolidBrush(Color.White), new Point(522 - 5, 500), _rightString);
}
catch (NullReferenceException)
{
AppendText(CurrentUsedItem + " ", Color.Red);
AppendText("No ", Color.Black);
AppendText("AttributeInitCategory ", Color.SteelBlue);
AppendText("found", Color.Black, true);
} //CHARACTER TYPE
}
if (SpecialMode == "stwDefenders")
{
try
{
g.DrawString(theItem.GameplayTags.GameplayTagsGameplayTags[Array.FindIndex(theItem.GameplayTags.GameplayTagsGameplayTags, x => x.StartsWith("NPC.CharacterType.Survivor.Defender."))].Substring(36), new Font(_pfc.Families[0], 13), new SolidBrush(Color.White), new Point(522 - 5, 500), _rightString);
}
catch (NullReferenceException)
{
AppendText(CurrentUsedItem + " ", Color.Red);
AppendText("No ", Color.Black);
AppendText("GameplayTags ", Color.SteelBlue);
AppendText("found", Color.Black, true);
}
catch (IndexOutOfRangeException)
{
AppendText(CurrentUsedItem + " ", Color.Red);
AppendText("No ", Color.Black);
AppendText("GameplayTags ", Color.SteelBlue);
AppendText("as ", Color.Black);
AppendText("NPC.CharacterType.Survivor.Defender ", Color.SteelBlue);
AppendText("found", Color.Black, true);
} //CHARACTER TYPE
}
#endregion
pictureBox1.Image = bmp;

View File

@@ -50,6 +50,9 @@ namespace FModel.Parser.Items
[JsonProperty("AmmoData")]
public AmmoData AmmoData { get; set; }
[JsonProperty("AttributeInitKey")]
public AttributeInitKey AttributeInitKey { get; set; }
}
public class GameplayTags
@@ -85,6 +88,15 @@ namespace FModel.Parser.Items
public string SubPathString { get; set; }
}
public partial class AttributeInitKey
{
[JsonProperty("AttributeInitCategory")]
public string AttributeInitCategory { get; set; }
[JsonProperty("AttributeInitSubCategory")]
public string AttributeInitSubCategory { get; set; }
}
public partial class ItemsIdParser
{
public static ItemsIdParser[] FromJson(string json) => JsonConvert.DeserializeObject<ItemsIdParser[]>(json, Converter.Settings);

View File

@@ -1,10 +1,10 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
// Ce code a été généré par un outil.
// Version du runtime :4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// Les modifications apportées à ce fichier peuvent provoquer un comportement incorrect et seront perdues si
// le code est régénéré.
// </auto-generated>
//------------------------------------------------------------------------------
@@ -12,7 +12,7 @@ namespace FModel.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.9.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
@@ -442,5 +442,29 @@ namespace FModel.Properties {
this["createIconForAmmo"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool createIconForSTWDefenders {
get {
return ((bool)(this["createIconForSTWDefenders"]));
}
set {
this["createIconForSTWDefenders"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool createIconForSTWHeroes {
get {
return ((bool)(this["createIconForSTWHeroes"]));
}
set {
this["createIconForSTWHeroes"] = value;
}
}
}
}

View File

@@ -107,5 +107,11 @@
<Setting Name="createIconForAmmo" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="createIconForSTWDefenders" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="createIconForSTWHeroes" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
</Settings>
</SettingsFile>