diff --git a/PCK-Studio/Controls/Editor/PckEditor.Designer.cs b/PCK-Studio/Controls/Editor/PckEditor.Designer.cs index 71e9eef4..d3298fb7 100644 --- a/PCK-Studio/Controls/Editor/PckEditor.Designer.cs +++ b/PCK-Studio/Controls/Editor/PckEditor.Designer.cs @@ -522,7 +522,7 @@ namespace PckStudio.Controls // // skinToolStripMenuItem1 // - this.skinToolStripMenuItem1.Image = global::PckStudio.Properties.Resources.SKIN_ICON; + this.skinToolStripMenuItem1.Image = global::PckStudio.Properties.Resources.CLASSIC_SKIN_ICON; this.skinToolStripMenuItem1.Name = "skinToolStripMenuItem1"; resources.ApplyResources(this.skinToolStripMenuItem1, "skinToolStripMenuItem1"); // diff --git a/PCK-Studio/Controls/Editor/PckEditor.cs b/PCK-Studio/Controls/Editor/PckEditor.cs index 9efbfb15..0e9bc8d1 100644 --- a/PCK-Studio/Controls/Editor/PckEditor.cs +++ b/PCK-Studio/Controls/Editor/PckEditor.cs @@ -109,11 +109,13 @@ namespace PckStudio.Controls imageList.Images.Add(Resources.GRF_ICON); // Icon for Game Rule files (*.grf) imageList.Images.Add(Resources.GRH_ICON); // Icon for Game Rule Header files (*.grh) imageList.Images.Add(Resources.INFO_ICON); // Icon for Info files (0) - imageList.Images.Add(Resources.SKIN_ICON); // Icon for Skin files (*.png) + imageList.Images.Add(Resources.CLASSIC_SKIN_ICON); // Icon for Skin files (*.png) imageList.Images.Add(Resources.CAPE_ICON); // Icon for Cape files (*.png) imageList.Images.Add(Resources.TEXTURE_ICON); // Icon for Texture files (*.png;*.tga) imageList.Images.Add(Resources.BEHAVIOURS_ICON); // Icon for Behaviour files (behaviours.bin) imageList.Images.Add(Resources.ENTITY_MATERIALS_ICON); // Icon for Entity Material files (entityMaterials.bin) + imageList.Images.Add(Resources.MODERN_SKIN_ICON); // Icon for Skin files with Modern ANIM flag (*.png) + imageList.Images.Add(Resources.SLIM_SKIN_ICON); // Icon for Skin files with Slim ANIM flag (*.png) _pckAssetTypeHandler = new Dictionary>(15) { @@ -459,6 +461,7 @@ namespace PckStudio.Controls parameterValueTextBox.Text = ParameterTypeTextBox.Text = string.Empty; _wasModified = true; ReloadParameterTreeView(); + SetFileType(PckAssetType.SkinFile); // just a dirty way to get the right icon in case the anim was changed } } @@ -582,7 +585,7 @@ namespace PckStudio.Controls { TreeNode node = BuildNodeTreeBySeperator(root, asset.Filename, '/'); node.Tag = asset; - int nodeIconId = GetNodeIconId(asset.Type); + int nodeIconId = GetNodeIconId(asset); node.ImageIndex = nodeIconId; node.SelectedImageIndex = nodeIconId; } @@ -605,9 +608,26 @@ namespace PckStudio.Controls } } - private int GetNodeIconId(PckAssetType type) + private int GetSkinNodeIconId(int animValue) { - return type switch + SkinANIM anim = SkinANIM.FromValue(animValue); + + if (anim.GetFlag(SkinAnimFlag.SLIM_MODEL)) + return 18; // slim model icon + else if (anim.GetFlag(SkinAnimFlag.MODERN_WIDE_MODEL)) + return 17; // modern model; slim gets priority just like in game + + return 12; // classic skin model icon + } + + private int GetNodeIconId(PckAsset asset) + { + int anim = 0; + + if (asset.Type == PckAssetType.SkinFile) + anim = asset.GetSkin().Anim.ToValue(); + + return asset.Type switch { PckAssetType.AudioFile => 1, PckAssetType.LocalisationFile => 3, @@ -618,7 +638,7 @@ namespace PckStudio.Controls PckAssetType.GameRulesFile => 9, PckAssetType.GameRulesHeader => 10, PckAssetType.InfoFile => 11, - PckAssetType.SkinFile => 12, + PckAssetType.SkinFile => GetSkinNodeIconId(anim), PckAssetType.CapeFile => 13, PckAssetType.TextureFile => 14, PckAssetType.BehavioursFile => 15, @@ -874,7 +894,7 @@ namespace PckStudio.Controls { Debug.WriteLine($"Setting {asset.Type} to {type}"); asset.Type = type; - int nodeIconId = GetNodeIconId(type); + int nodeIconId = GetNodeIconId(asset); treeViewMain.SelectedNode.ImageIndex = nodeIconId; treeViewMain.SelectedNode.SelectedImageIndex = nodeIconId; } @@ -1867,6 +1887,7 @@ namespace PckStudio.Controls asset.AddParameter(new KeyValuePair("ANIM", gameFlags.ToString())); ReloadParameterTreeView(); + SetFileType(PckAssetType.SkinFile); // just a dirty way to get the right icon in case the anim was changed _wasModified = true; } diff --git a/PCK-Studio/Forms/Features/CemuPanel.cs b/PCK-Studio/Forms/Features/CemuPanel.cs index de85ef9b..261bc7ab 100644 --- a/PCK-Studio/Forms/Features/CemuPanel.cs +++ b/PCK-Studio/Forms/Features/CemuPanel.cs @@ -44,7 +44,7 @@ namespace PckStudio.Forms.Features var imgList = new ImageList(); imgList.ColorDepth = ColorDepth.Depth32Bit; imgList.ImageSize = new System.Drawing.Size(28, 28); - imgList.Images.Add(Resources.SKIN_ICON); + imgList.Images.Add(Resources.CLASSIC_SKIN_ICON); imgList.Images.Add(Resources.TEXTURE_ICON); DLCTreeView.ImageList = imgList; if (!TryApplyPermanentCemuConfig() && diff --git a/PCK-Studio/PckStudio.csproj b/PCK-Studio/PckStudio.csproj index db6d44d2..014aec0f 100644 --- a/PCK-Studio/PckStudio.csproj +++ b/PCK-Studio/PckStudio.csproj @@ -647,7 +647,7 @@ - + @@ -687,6 +687,8 @@ + + diff --git a/PCK-Studio/Properties/Resources.Designer.cs b/PCK-Studio/Properties/Resources.Designer.cs index 606924a2..2d31c501 100644 --- a/PCK-Studio/Properties/Resources.Designer.cs +++ b/PCK-Studio/Properties/Resources.Designer.cs @@ -192,6 +192,16 @@ namespace PckStudio.Properties { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + public static System.Drawing.Bitmap CLASSIC_SKIN_ICON { + get { + object obj = ResourceManager.GetObject("CLASSIC_SKIN_ICON", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -563,6 +573,16 @@ namespace PckStudio.Properties { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + public static System.Drawing.Bitmap MODERN_SKIN_ICON { + get { + object obj = ResourceManager.GetObject("MODERN SKIN ICON", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Byte[]. /// @@ -737,16 +757,6 @@ namespace PckStudio.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - public static System.Drawing.Bitmap SKIN_ICON { - get { - object obj = ResourceManager.GetObject("SKIN_ICON", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -980,6 +990,16 @@ namespace PckStudio.Properties { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + public static System.Drawing.Bitmap SLIM_SKIN_ICON { + get { + object obj = ResourceManager.GetObject("SLIM SKIN ICON", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// diff --git a/PCK-Studio/Properties/Resources.resx b/PCK-Studio/Properties/Resources.resx index f6598817..ce81f2a6 100644 --- a/PCK-Studio/Properties/Resources.resx +++ b/PCK-Studio/Properties/Resources.resx @@ -190,9 +190,6 @@ ..\Resources\fileTemplates\tu13colours.col;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - ..\Resources\iconImageList\SKIN ICON.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - ..\Resources\pckClosed.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -415,4 +412,13 @@ ..\Resources\anim_editor\wide_right_arm.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\iconImageList\CLASSIC SKIN ICON.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\iconImageList\MODERN SKIN ICON.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\iconImageList\SLIM SKIN ICON.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + \ No newline at end of file diff --git a/PCK-Studio/Resources/iconImageList/CLASSIC SKIN ICON.png b/PCK-Studio/Resources/iconImageList/CLASSIC SKIN ICON.png new file mode 100644 index 00000000..280f77a6 Binary files /dev/null and b/PCK-Studio/Resources/iconImageList/CLASSIC SKIN ICON.png differ diff --git a/PCK-Studio/Resources/iconImageList/SKIN ICON.png b/PCK-Studio/Resources/iconImageList/MODERN SKIN ICON.png similarity index 100% rename from PCK-Studio/Resources/iconImageList/SKIN ICON.png rename to PCK-Studio/Resources/iconImageList/MODERN SKIN ICON.png diff --git a/PCK-Studio/Resources/iconImageList/SLIM SKIN ICON.png b/PCK-Studio/Resources/iconImageList/SLIM SKIN ICON.png new file mode 100644 index 00000000..f7adff6c Binary files /dev/null and b/PCK-Studio/Resources/iconImageList/SLIM SKIN ICON.png differ