Merge DLCManager into 'JavaResourcePackImporter'

This commit is contained in:
miku-666
2025-12-14 05:00:02 +01:00
149 changed files with 25205 additions and 11201 deletions

View File

@@ -11,7 +11,6 @@ namespace PckStudio.Controls
public NamedTextureTreeNode(NamedData<Image> namedTexture)
: base(namedTexture.Name)
{
Tag = namedTexture;
_namedTexture = namedTexture;
}

824
PCK-Studio/Controls/PckEditor.Designer.cs generated Normal file
View File

@@ -0,0 +1,824 @@
using System.Windows.Forms;
namespace PckStudio.Controls
{
partial class PckEditor
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.Windows.Forms.PictureBox logoPictureBox;
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PckEditor));
this.pckFileLabel = new MetroFramework.Controls.MetroLabel();
this.labelImageSize = new MetroFramework.Controls.MetroLabel();
this.fileEntryCountLabel = new MetroFramework.Controls.MetroLabel();
this.PropertiesTabControl = new MetroFramework.Controls.MetroTabControl();
this.MetaTab = new MetroFramework.Controls.MetroTabPage();
this.metroLabel2 = new MetroFramework.Controls.MetroLabel();
this.entryTypeTextBox = new MetroFramework.Controls.MetroTextBox();
this.entryDataTextBox = new MetroFramework.Controls.MetroTextBox();
this.buttonEdit = new MetroFramework.Controls.MetroButton();
this.metroLabel1 = new MetroFramework.Controls.MetroLabel();
this.treeMeta = new System.Windows.Forms.TreeView();
this.contextMenuMetaTree = new System.Windows.Forms.ContextMenuStrip(this.components);
this.addEntryToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.addEntryToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.addBOXEntryToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.addANIMEntryToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.addMultipleEntriesToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.deleteEntryToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.editAllEntriesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.label11 = new MetroFramework.Controls.MetroLabel();
this.treeViewMain = new System.Windows.Forms.TreeView();
this.contextMenuPCKEntries = new System.Windows.Forms.ContextMenuStrip(this.components);
this.createToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.folderToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.skinToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.createAnimatedTextureToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.audiopckToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.colourscolToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.CreateSkinsPCKToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.behavioursbinToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.entityMaterialsbinToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.importSkinsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.importSkinToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.importExtractedSkinsFolderToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.addTextureToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.addFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.exportToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.as3DSTextureFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.setFileTypeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.skinToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.capeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.textureToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.languagesFileLOCToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.gameRulesFileGRFToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.audioPCKFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.coloursCOLFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.gameRulesHeaderGRHToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.skinsPCKToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.modelsFileBINToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.behavioursFileBINToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.entityMaterialsFileBINToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator();
this.miscFunctionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.generateMipMapTextureToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.viewFileInfoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.correctSkinDecimalsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.setSubPCKEndiannessToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.bigEndianXbox360PS3WiiUToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.littleEndianPS4PSVitaSwitchToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.setModelContainerFormatToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.version1ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.version2ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.version3114ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.extractToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator6 = new System.Windows.Forms.ToolStripSeparator();
this.cloneFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.renameFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.replaceToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.deleteFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.imageList = new System.Windows.Forms.ImageList(this.components);
this.addMultipleEntriesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.LittleEndianCheckBox = new MetroFramework.Controls.MetroCheckBox();
this.previewPictureBox = new PckStudio.ToolboxItems.InterpolationPictureBox();
logoPictureBox = new System.Windows.Forms.PictureBox();
((System.ComponentModel.ISupportInitialize)(logoPictureBox)).BeginInit();
this.PropertiesTabControl.SuspendLayout();
this.MetaTab.SuspendLayout();
this.contextMenuMetaTree.SuspendLayout();
this.contextMenuPCKEntries.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.previewPictureBox)).BeginInit();
this.SuspendLayout();
//
// logoPictureBox
//
resources.ApplyResources(logoPictureBox, "logoPictureBox");
logoPictureBox.Name = "logoPictureBox";
logoPictureBox.TabStop = false;
//
// pckFileLabel
//
this.pckFileLabel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
resources.ApplyResources(this.pckFileLabel, "pckFileLabel");
this.pckFileLabel.Name = "pckFileLabel";
this.pckFileLabel.Theme = MetroFramework.MetroThemeStyle.Dark;
//
// labelImageSize
//
resources.ApplyResources(this.labelImageSize, "labelImageSize");
this.labelImageSize.Name = "labelImageSize";
this.labelImageSize.Theme = MetroFramework.MetroThemeStyle.Dark;
//
// fileEntryCountLabel
//
resources.ApplyResources(this.fileEntryCountLabel, "fileEntryCountLabel");
this.fileEntryCountLabel.Name = "fileEntryCountLabel";
this.fileEntryCountLabel.Theme = MetroFramework.MetroThemeStyle.Dark;
//
// PropertiesTabControl
//
this.PropertiesTabControl.Controls.Add(this.MetaTab);
resources.ApplyResources(this.PropertiesTabControl, "PropertiesTabControl");
this.PropertiesTabControl.Name = "PropertiesTabControl";
this.PropertiesTabControl.SelectedIndex = 0;
this.PropertiesTabControl.Style = MetroFramework.MetroColorStyle.Silver;
this.PropertiesTabControl.Theme = MetroFramework.MetroThemeStyle.Dark;
this.PropertiesTabControl.UseSelectable = true;
//
// MetaTab
//
this.MetaTab.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.MetaTab.Controls.Add(this.metroLabel2);
this.MetaTab.Controls.Add(this.entryTypeTextBox);
this.MetaTab.Controls.Add(this.entryDataTextBox);
this.MetaTab.Controls.Add(this.buttonEdit);
this.MetaTab.Controls.Add(this.metroLabel1);
this.MetaTab.Controls.Add(this.treeMeta);
this.MetaTab.HorizontalScrollbarBarColor = true;
this.MetaTab.HorizontalScrollbarHighlightOnWheel = false;
this.MetaTab.HorizontalScrollbarSize = 10;
resources.ApplyResources(this.MetaTab, "MetaTab");
this.MetaTab.Name = "MetaTab";
this.MetaTab.Theme = MetroFramework.MetroThemeStyle.Dark;
this.MetaTab.VerticalScrollbarBarColor = true;
this.MetaTab.VerticalScrollbarHighlightOnWheel = false;
this.MetaTab.VerticalScrollbarSize = 10;
//
// metroLabel2
//
resources.ApplyResources(this.metroLabel2, "metroLabel2");
this.metroLabel2.Name = "metroLabel2";
this.metroLabel2.Theme = MetroFramework.MetroThemeStyle.Dark;
//
// entryTypeTextBox
//
resources.ApplyResources(this.entryTypeTextBox, "entryTypeTextBox");
//
//
//
this.entryTypeTextBox.CustomButton.Image = ((System.Drawing.Image)(resources.GetObject("resource.Image")));
this.entryTypeTextBox.CustomButton.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("resource.ImeMode")));
this.entryTypeTextBox.CustomButton.Location = ((System.Drawing.Point)(resources.GetObject("resource.Location")));
this.entryTypeTextBox.CustomButton.Name = "";
this.entryTypeTextBox.CustomButton.Size = ((System.Drawing.Size)(resources.GetObject("resource.Size")));
this.entryTypeTextBox.CustomButton.Style = MetroFramework.MetroColorStyle.Blue;
this.entryTypeTextBox.CustomButton.TabIndex = ((int)(resources.GetObject("resource.TabIndex")));
this.entryTypeTextBox.CustomButton.Theme = MetroFramework.MetroThemeStyle.Light;
this.entryTypeTextBox.CustomButton.UseSelectable = true;
this.entryTypeTextBox.CustomButton.Visible = ((bool)(resources.GetObject("resource.Visible")));
this.entryTypeTextBox.Lines = new string[0];
this.entryTypeTextBox.MaxLength = 32767;
this.entryTypeTextBox.Name = "entryTypeTextBox";
this.entryTypeTextBox.PasswordChar = '\0';
this.entryTypeTextBox.ScrollBars = System.Windows.Forms.ScrollBars.None;
this.entryTypeTextBox.SelectedText = "";
this.entryTypeTextBox.SelectionLength = 0;
this.entryTypeTextBox.SelectionStart = 0;
this.entryTypeTextBox.ShortcutsEnabled = true;
this.entryTypeTextBox.Theme = MetroFramework.MetroThemeStyle.Dark;
this.entryTypeTextBox.UseSelectable = true;
this.entryTypeTextBox.WaterMarkColor = System.Drawing.Color.FromArgb(((int)(((byte)(109)))), ((int)(((byte)(109)))), ((int)(((byte)(109)))));
this.entryTypeTextBox.WaterMarkFont = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Pixel);
//
// entryDataTextBox
//
resources.ApplyResources(this.entryDataTextBox, "entryDataTextBox");
//
//
//
this.entryDataTextBox.CustomButton.Image = ((System.Drawing.Image)(resources.GetObject("resource.Image1")));
this.entryDataTextBox.CustomButton.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("resource.ImeMode1")));
this.entryDataTextBox.CustomButton.Location = ((System.Drawing.Point)(resources.GetObject("resource.Location1")));
this.entryDataTextBox.CustomButton.Name = "";
this.entryDataTextBox.CustomButton.Size = ((System.Drawing.Size)(resources.GetObject("resource.Size1")));
this.entryDataTextBox.CustomButton.Style = MetroFramework.MetroColorStyle.Blue;
this.entryDataTextBox.CustomButton.TabIndex = ((int)(resources.GetObject("resource.TabIndex1")));
this.entryDataTextBox.CustomButton.Theme = MetroFramework.MetroThemeStyle.Light;
this.entryDataTextBox.CustomButton.UseSelectable = true;
this.entryDataTextBox.CustomButton.Visible = ((bool)(resources.GetObject("resource.Visible1")));
this.entryDataTextBox.Lines = new string[0];
this.entryDataTextBox.MaxLength = 32767;
this.entryDataTextBox.Name = "entryDataTextBox";
this.entryDataTextBox.PasswordChar = '\0';
this.entryDataTextBox.ScrollBars = System.Windows.Forms.ScrollBars.None;
this.entryDataTextBox.SelectedText = "";
this.entryDataTextBox.SelectionLength = 0;
this.entryDataTextBox.SelectionStart = 0;
this.entryDataTextBox.ShortcutsEnabled = true;
this.entryDataTextBox.Theme = MetroFramework.MetroThemeStyle.Dark;
this.entryDataTextBox.UseSelectable = true;
this.entryDataTextBox.WaterMarkColor = System.Drawing.Color.FromArgb(((int)(((byte)(109)))), ((int)(((byte)(109)))), ((int)(((byte)(109)))));
this.entryDataTextBox.WaterMarkFont = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Pixel);
//
// buttonEdit
//
resources.ApplyResources(this.buttonEdit, "buttonEdit");
this.buttonEdit.Name = "buttonEdit";
this.buttonEdit.Theme = MetroFramework.MetroThemeStyle.Dark;
this.buttonEdit.UseSelectable = true;
this.buttonEdit.Click += new System.EventHandler(this.buttonEdit_Click);
//
// metroLabel1
//
resources.ApplyResources(this.metroLabel1, "metroLabel1");
this.metroLabel1.Name = "metroLabel1";
this.metroLabel1.Theme = MetroFramework.MetroThemeStyle.Dark;
//
// treeMeta
//
this.treeMeta.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(13)))), ((int)(((byte)(13)))), ((int)(((byte)(13)))));
this.treeMeta.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.treeMeta.ContextMenuStrip = this.contextMenuMetaTree;
resources.ApplyResources(this.treeMeta, "treeMeta");
this.treeMeta.ForeColor = System.Drawing.SystemColors.Window;
this.treeMeta.Name = "treeMeta";
this.treeMeta.PathSeparator = "/";
this.treeMeta.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeMeta_AfterSelect);
this.treeMeta.DoubleClick += new System.EventHandler(this.treeMeta_DoubleClick);
this.treeMeta.KeyDown += new System.Windows.Forms.KeyEventHandler(this.treeMeta_KeyDown);
//
// contextMenuMetaTree
//
this.contextMenuMetaTree.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.addEntryToolStripMenuItem,
this.addMultipleEntriesToolStripMenuItem1,
this.deleteEntryToolStripMenuItem,
this.editAllEntriesToolStripMenuItem});
this.contextMenuMetaTree.Name = "contextMenuStrip1";
resources.ApplyResources(this.contextMenuMetaTree, "contextMenuMetaTree");
//
// addEntryToolStripMenuItem
//
this.addEntryToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.addEntryToolStripMenuItem1,
this.addBOXEntryToolStripMenuItem1,
this.addANIMEntryToolStripMenuItem1});
resources.ApplyResources(this.addEntryToolStripMenuItem, "addEntryToolStripMenuItem");
this.addEntryToolStripMenuItem.Name = "addEntryToolStripMenuItem";
//
// addEntryToolStripMenuItem1
//
this.addEntryToolStripMenuItem1.Name = "addEntryToolStripMenuItem1";
resources.ApplyResources(this.addEntryToolStripMenuItem1, "addEntryToolStripMenuItem1");
this.addEntryToolStripMenuItem1.Click += new System.EventHandler(this.addEntryToolStripMenuItem_Click);
//
// addBOXEntryToolStripMenuItem1
//
this.addBOXEntryToolStripMenuItem1.Name = "addBOXEntryToolStripMenuItem1";
resources.ApplyResources(this.addBOXEntryToolStripMenuItem1, "addBOXEntryToolStripMenuItem1");
this.addBOXEntryToolStripMenuItem1.Click += new System.EventHandler(this.addBOXEntryToolStripMenuItem1_Click);
//
// addANIMEntryToolStripMenuItem1
//
this.addANIMEntryToolStripMenuItem1.Name = "addANIMEntryToolStripMenuItem1";
resources.ApplyResources(this.addANIMEntryToolStripMenuItem1, "addANIMEntryToolStripMenuItem1");
this.addANIMEntryToolStripMenuItem1.Click += new System.EventHandler(this.addANIMEntryToolStripMenuItem1_Click);
//
// addMultipleEntriesToolStripMenuItem1
//
this.addMultipleEntriesToolStripMenuItem1.Name = "addMultipleEntriesToolStripMenuItem1";
resources.ApplyResources(this.addMultipleEntriesToolStripMenuItem1, "addMultipleEntriesToolStripMenuItem1");
this.addMultipleEntriesToolStripMenuItem1.Click += new System.EventHandler(this.addMultipleEntriesToolStripMenuItem1_Click);
//
// deleteEntryToolStripMenuItem
//
this.deleteEntryToolStripMenuItem.Image = global::PckStudio.Properties.Resources.file_delete;
this.deleteEntryToolStripMenuItem.Name = "deleteEntryToolStripMenuItem";
resources.ApplyResources(this.deleteEntryToolStripMenuItem, "deleteEntryToolStripMenuItem");
this.deleteEntryToolStripMenuItem.Click += new System.EventHandler(this.deleteEntryToolStripMenuItem_Click);
//
// editAllEntriesToolStripMenuItem
//
this.editAllEntriesToolStripMenuItem.Name = "editAllEntriesToolStripMenuItem";
resources.ApplyResources(this.editAllEntriesToolStripMenuItem, "editAllEntriesToolStripMenuItem");
this.editAllEntriesToolStripMenuItem.Click += new System.EventHandler(this.editAllEntriesToolStripMenuItem_Click);
//
// label11
//
resources.ApplyResources(this.label11, "label11");
this.label11.Name = "label11";
//
// treeViewMain
//
this.treeViewMain.AllowDrop = true;
this.treeViewMain.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(12)))), ((int)(((byte)(12)))), ((int)(((byte)(12)))));
this.treeViewMain.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.treeViewMain.ContextMenuStrip = this.contextMenuPCKEntries;
resources.ApplyResources(this.treeViewMain, "treeViewMain");
this.treeViewMain.ForeColor = System.Drawing.Color.White;
this.treeViewMain.ImageList = this.imageList;
this.treeViewMain.LabelEdit = true;
this.treeViewMain.Name = "treeViewMain";
this.treeViewMain.PathSeparator = "/";
this.treeViewMain.BeforeLabelEdit += new System.Windows.Forms.NodeLabelEditEventHandler(this.treeViewMain_BeforeLabelEdit);
this.treeViewMain.ItemDrag += new System.Windows.Forms.ItemDragEventHandler(this.treeViewMain_ItemDrag);
this.treeViewMain.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeViewMain_AfterSelect);
this.treeViewMain.NodeMouseClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.treeViewMain_NodeMouseClick);
this.treeViewMain.DragDrop += new System.Windows.Forms.DragEventHandler(this.treeViewMain_DragDrop);
this.treeViewMain.DragEnter += new System.Windows.Forms.DragEventHandler(this.treeViewMain_DragEnter);
this.treeViewMain.DragOver += new System.Windows.Forms.DragEventHandler(this.treeViewMain_DragOver);
this.treeViewMain.DoubleClick += new System.EventHandler(this.treeViewMain_DoubleClick);
this.treeViewMain.KeyDown += new System.Windows.Forms.KeyEventHandler(this.treeViewMain_KeyDown);
//
// contextMenuPCKEntries
//
this.contextMenuPCKEntries.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.createToolStripMenuItem,
this.importSkinsToolStripMenuItem,
this.exportToolStripMenuItem,
this.setFileTypeToolStripMenuItem,
this.toolStripSeparator5,
this.miscFunctionsToolStripMenuItem,
this.extractToolStripMenuItem,
this.toolStripSeparator6,
this.cloneFileToolStripMenuItem,
this.renameFileToolStripMenuItem,
this.replaceToolStripMenuItem,
this.deleteFileToolStripMenuItem});
this.contextMenuPCKEntries.Name = "contextMenuStrip1";
resources.ApplyResources(this.contextMenuPCKEntries, "contextMenuPCKEntries");
this.contextMenuPCKEntries.Opening += new System.ComponentModel.CancelEventHandler(this.contextMenuPCKEntries_Opening);
//
// createToolStripMenuItem
//
this.createToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.folderToolStripMenuItem,
this.skinToolStripMenuItem,
this.createAnimatedTextureToolStripMenuItem,
this.audiopckToolStripMenuItem,
this.colourscolToolStripMenuItem,
this.CreateSkinsPCKToolStripMenuItem1,
this.behavioursbinToolStripMenuItem,
this.entityMaterialsbinToolStripMenuItem});
resources.ApplyResources(this.createToolStripMenuItem, "createToolStripMenuItem");
this.createToolStripMenuItem.Name = "createToolStripMenuItem";
//
// folderToolStripMenuItem
//
resources.ApplyResources(this.folderToolStripMenuItem, "folderToolStripMenuItem");
this.folderToolStripMenuItem.Name = "folderToolStripMenuItem";
this.folderToolStripMenuItem.Click += new System.EventHandler(this.folderToolStripMenuItem_Click);
//
// skinToolStripMenuItem
//
resources.ApplyResources(this.skinToolStripMenuItem, "skinToolStripMenuItem");
this.skinToolStripMenuItem.Name = "skinToolStripMenuItem";
this.skinToolStripMenuItem.Click += new System.EventHandler(this.createSkinToolStripMenuItem_Click);
//
// createAnimatedTextureToolStripMenuItem
//
resources.ApplyResources(this.createAnimatedTextureToolStripMenuItem, "createAnimatedTextureToolStripMenuItem");
this.createAnimatedTextureToolStripMenuItem.Name = "createAnimatedTextureToolStripMenuItem";
this.createAnimatedTextureToolStripMenuItem.Click += new System.EventHandler(this.createAnimatedTextureToolStripMenuItem_Click);
//
// audiopckToolStripMenuItem
//
this.audiopckToolStripMenuItem.Image = global::PckStudio.Properties.Resources.BINKA_ICON;
this.audiopckToolStripMenuItem.Name = "audiopckToolStripMenuItem";
resources.ApplyResources(this.audiopckToolStripMenuItem, "audiopckToolStripMenuItem");
this.audiopckToolStripMenuItem.Click += new System.EventHandler(this.audiopckToolStripMenuItem_Click);
//
// colourscolToolStripMenuItem
//
this.colourscolToolStripMenuItem.Image = global::PckStudio.Properties.Resources.COL_ICON;
this.colourscolToolStripMenuItem.Name = "colourscolToolStripMenuItem";
resources.ApplyResources(this.colourscolToolStripMenuItem, "colourscolToolStripMenuItem");
this.colourscolToolStripMenuItem.Click += new System.EventHandler(this.colourscolToolStripMenuItem_Click);
//
// CreateSkinsPCKToolStripMenuItem1
//
this.CreateSkinsPCKToolStripMenuItem1.Image = global::PckStudio.Properties.Resources.SKINS_ICON;
this.CreateSkinsPCKToolStripMenuItem1.Name = "CreateSkinsPCKToolStripMenuItem1";
resources.ApplyResources(this.CreateSkinsPCKToolStripMenuItem1, "CreateSkinsPCKToolStripMenuItem1");
this.CreateSkinsPCKToolStripMenuItem1.Click += new System.EventHandler(this.CreateSkinsPCKToolStripMenuItem1_Click);
//
// behavioursbinToolStripMenuItem
//
this.behavioursbinToolStripMenuItem.Image = global::PckStudio.Properties.Resources.BEHAVIOURS_ICON;
this.behavioursbinToolStripMenuItem.Name = "behavioursbinToolStripMenuItem";
resources.ApplyResources(this.behavioursbinToolStripMenuItem, "behavioursbinToolStripMenuItem");
this.behavioursbinToolStripMenuItem.Click += new System.EventHandler(this.behavioursbinToolStripMenuItem_Click);
//
// entityMaterialsbinToolStripMenuItem
//
this.entityMaterialsbinToolStripMenuItem.Image = global::PckStudio.Properties.Resources.ENTITY_MATERIALS_ICON;
this.entityMaterialsbinToolStripMenuItem.Name = "entityMaterialsbinToolStripMenuItem";
resources.ApplyResources(this.entityMaterialsbinToolStripMenuItem, "entityMaterialsbinToolStripMenuItem");
this.entityMaterialsbinToolStripMenuItem.Click += new System.EventHandler(this.entityMaterialsbinToolStripMenuItem_Click);
//
// importSkinsToolStripMenuItem
//
this.importSkinsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.importSkinToolStripMenuItem,
this.importExtractedSkinsFolderToolStripMenuItem,
this.addTextureToolStripMenuItem,
this.addFileToolStripMenuItem});
resources.ApplyResources(this.importSkinsToolStripMenuItem, "importSkinsToolStripMenuItem");
this.importSkinsToolStripMenuItem.Name = "importSkinsToolStripMenuItem";
//
// importSkinToolStripMenuItem
//
resources.ApplyResources(this.importSkinToolStripMenuItem, "importSkinToolStripMenuItem");
this.importSkinToolStripMenuItem.Name = "importSkinToolStripMenuItem";
this.importSkinToolStripMenuItem.Click += new System.EventHandler(this.importSkinToolStripMenuItem_Click);
//
// importExtractedSkinsFolderToolStripMenuItem
//
resources.ApplyResources(this.importExtractedSkinsFolderToolStripMenuItem, "importExtractedSkinsFolderToolStripMenuItem");
this.importExtractedSkinsFolderToolStripMenuItem.Name = "importExtractedSkinsFolderToolStripMenuItem";
this.importExtractedSkinsFolderToolStripMenuItem.Click += new System.EventHandler(this.importExtractedSkinsFolder);
//
// addTextureToolStripMenuItem
//
this.addTextureToolStripMenuItem.Image = global::PckStudio.Properties.Resources.AddTexture;
this.addTextureToolStripMenuItem.Name = "addTextureToolStripMenuItem";
resources.ApplyResources(this.addTextureToolStripMenuItem, "addTextureToolStripMenuItem");
this.addTextureToolStripMenuItem.Click += new System.EventHandler(this.addTextureToolStripMenuItem_Click);
//
// addFileToolStripMenuItem
//
this.addFileToolStripMenuItem.Image = global::PckStudio.Properties.Resources.blank;
this.addFileToolStripMenuItem.Name = "addFileToolStripMenuItem";
resources.ApplyResources(this.addFileToolStripMenuItem, "addFileToolStripMenuItem");
this.addFileToolStripMenuItem.Click += new System.EventHandler(this.addFileToolStripMenuItem_Click);
//
// exportToolStripMenuItem
//
this.exportToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.as3DSTextureFileToolStripMenuItem});
this.exportToolStripMenuItem.Name = "exportToolStripMenuItem";
resources.ApplyResources(this.exportToolStripMenuItem, "exportToolStripMenuItem");
//
// as3DSTextureFileToolStripMenuItem
//
this.as3DSTextureFileToolStripMenuItem.Name = "as3DSTextureFileToolStripMenuItem";
resources.ApplyResources(this.as3DSTextureFileToolStripMenuItem, "as3DSTextureFileToolStripMenuItem");
this.as3DSTextureFileToolStripMenuItem.Click += new System.EventHandler(this.as3DSTextureFileToolStripMenuItem_Click);
//
// setFileTypeToolStripMenuItem
//
this.setFileTypeToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.skinToolStripMenuItem1,
this.capeToolStripMenuItem,
this.textureToolStripMenuItem,
this.languagesFileLOCToolStripMenuItem,
this.gameRulesFileGRFToolStripMenuItem,
this.audioPCKFileToolStripMenuItem,
this.coloursCOLFileToolStripMenuItem,
this.gameRulesHeaderGRHToolStripMenuItem,
this.skinsPCKToolStripMenuItem,
this.modelsFileBINToolStripMenuItem,
this.behavioursFileBINToolStripMenuItem,
this.entityMaterialsFileBINToolStripMenuItem});
this.setFileTypeToolStripMenuItem.Name = "setFileTypeToolStripMenuItem";
resources.ApplyResources(this.setFileTypeToolStripMenuItem, "setFileTypeToolStripMenuItem");
//
// skinToolStripMenuItem1
//
this.skinToolStripMenuItem1.Image = global::PckStudio.Properties.Resources.SKIN_ICON;
this.skinToolStripMenuItem1.Name = "skinToolStripMenuItem1";
resources.ApplyResources(this.skinToolStripMenuItem1, "skinToolStripMenuItem1");
//
// capeToolStripMenuItem
//
this.capeToolStripMenuItem.Image = global::PckStudio.Properties.Resources.CAPE_ICON;
this.capeToolStripMenuItem.Name = "capeToolStripMenuItem";
resources.ApplyResources(this.capeToolStripMenuItem, "capeToolStripMenuItem");
//
// textureToolStripMenuItem
//
this.textureToolStripMenuItem.Image = global::PckStudio.Properties.Resources.TEXTURE_ICON;
this.textureToolStripMenuItem.Name = "textureToolStripMenuItem";
resources.ApplyResources(this.textureToolStripMenuItem, "textureToolStripMenuItem");
//
// languagesFileLOCToolStripMenuItem
//
this.languagesFileLOCToolStripMenuItem.Image = global::PckStudio.Properties.Resources.LOC_ICON;
this.languagesFileLOCToolStripMenuItem.Name = "languagesFileLOCToolStripMenuItem";
resources.ApplyResources(this.languagesFileLOCToolStripMenuItem, "languagesFileLOCToolStripMenuItem");
//
// gameRulesFileGRFToolStripMenuItem
//
this.gameRulesFileGRFToolStripMenuItem.Image = global::PckStudio.Properties.Resources.GRF_ICON;
this.gameRulesFileGRFToolStripMenuItem.Name = "gameRulesFileGRFToolStripMenuItem";
resources.ApplyResources(this.gameRulesFileGRFToolStripMenuItem, "gameRulesFileGRFToolStripMenuItem");
//
// audioPCKFileToolStripMenuItem
//
this.audioPCKFileToolStripMenuItem.Image = global::PckStudio.Properties.Resources.BINKA_ICON;
this.audioPCKFileToolStripMenuItem.Name = "audioPCKFileToolStripMenuItem";
resources.ApplyResources(this.audioPCKFileToolStripMenuItem, "audioPCKFileToolStripMenuItem");
//
// coloursCOLFileToolStripMenuItem
//
this.coloursCOLFileToolStripMenuItem.Image = global::PckStudio.Properties.Resources.COL_ICON;
this.coloursCOLFileToolStripMenuItem.Name = "coloursCOLFileToolStripMenuItem";
resources.ApplyResources(this.coloursCOLFileToolStripMenuItem, "coloursCOLFileToolStripMenuItem");
//
// gameRulesHeaderGRHToolStripMenuItem
//
this.gameRulesHeaderGRHToolStripMenuItem.Image = global::PckStudio.Properties.Resources.GRH_ICON;
this.gameRulesHeaderGRHToolStripMenuItem.Name = "gameRulesHeaderGRHToolStripMenuItem";
resources.ApplyResources(this.gameRulesHeaderGRHToolStripMenuItem, "gameRulesHeaderGRHToolStripMenuItem");
//
// skinsPCKToolStripMenuItem
//
this.skinsPCKToolStripMenuItem.Image = global::PckStudio.Properties.Resources.SKINS_ICON;
this.skinsPCKToolStripMenuItem.Name = "skinsPCKToolStripMenuItem";
resources.ApplyResources(this.skinsPCKToolStripMenuItem, "skinsPCKToolStripMenuItem");
//
// modelsFileBINToolStripMenuItem
//
this.modelsFileBINToolStripMenuItem.Image = global::PckStudio.Properties.Resources.MODELS_ICON;
this.modelsFileBINToolStripMenuItem.Name = "modelsFileBINToolStripMenuItem";
resources.ApplyResources(this.modelsFileBINToolStripMenuItem, "modelsFileBINToolStripMenuItem");
//
// behavioursFileBINToolStripMenuItem
//
this.behavioursFileBINToolStripMenuItem.Image = global::PckStudio.Properties.Resources.BEHAVIOURS_ICON;
this.behavioursFileBINToolStripMenuItem.Name = "behavioursFileBINToolStripMenuItem";
resources.ApplyResources(this.behavioursFileBINToolStripMenuItem, "behavioursFileBINToolStripMenuItem");
//
// entityMaterialsFileBINToolStripMenuItem
//
this.entityMaterialsFileBINToolStripMenuItem.Image = global::PckStudio.Properties.Resources.ENTITY_MATERIALS_ICON;
this.entityMaterialsFileBINToolStripMenuItem.Name = "entityMaterialsFileBINToolStripMenuItem";
resources.ApplyResources(this.entityMaterialsFileBINToolStripMenuItem, "entityMaterialsFileBINToolStripMenuItem");
//
// toolStripSeparator5
//
this.toolStripSeparator5.Name = "toolStripSeparator5";
resources.ApplyResources(this.toolStripSeparator5, "toolStripSeparator5");
//
// miscFunctionsToolStripMenuItem
//
this.miscFunctionsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.generateMipMapTextureToolStripMenuItem1,
this.viewFileInfoToolStripMenuItem,
this.correctSkinDecimalsToolStripMenuItem,
this.setSubPCKEndiannessToolStripMenuItem,
this.setModelContainerFormatToolStripMenuItem});
this.miscFunctionsToolStripMenuItem.Name = "miscFunctionsToolStripMenuItem";
resources.ApplyResources(this.miscFunctionsToolStripMenuItem, "miscFunctionsToolStripMenuItem");
//
// generateMipMapTextureToolStripMenuItem1
//
this.generateMipMapTextureToolStripMenuItem1.Name = "generateMipMapTextureToolStripMenuItem1";
resources.ApplyResources(this.generateMipMapTextureToolStripMenuItem1, "generateMipMapTextureToolStripMenuItem1");
this.generateMipMapTextureToolStripMenuItem1.Click += new System.EventHandler(this.generateMipMapTextureToolStripMenuItem_Click);
//
// viewFileInfoToolStripMenuItem
//
this.viewFileInfoToolStripMenuItem.Name = "viewFileInfoToolStripMenuItem";
resources.ApplyResources(this.viewFileInfoToolStripMenuItem, "viewFileInfoToolStripMenuItem");
this.viewFileInfoToolStripMenuItem.Click += new System.EventHandler(this.viewFileInfoToolStripMenuItem_Click);
//
// correctSkinDecimalsToolStripMenuItem
//
this.correctSkinDecimalsToolStripMenuItem.Name = "correctSkinDecimalsToolStripMenuItem";
resources.ApplyResources(this.correctSkinDecimalsToolStripMenuItem, "correctSkinDecimalsToolStripMenuItem");
this.correctSkinDecimalsToolStripMenuItem.Click += new System.EventHandler(this.correctSkinDecimalsToolStripMenuItem_Click);
//
// setSubPCKEndiannessToolStripMenuItem
//
this.setSubPCKEndiannessToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.bigEndianXbox360PS3WiiUToolStripMenuItem,
this.littleEndianPS4PSVitaSwitchToolStripMenuItem});
this.setSubPCKEndiannessToolStripMenuItem.Name = "setSubPCKEndiannessToolStripMenuItem";
resources.ApplyResources(this.setSubPCKEndiannessToolStripMenuItem, "setSubPCKEndiannessToolStripMenuItem");
//
// bigEndianXbox360PS3WiiUToolStripMenuItem
//
this.bigEndianXbox360PS3WiiUToolStripMenuItem.Name = "bigEndianXbox360PS3WiiUToolStripMenuItem";
resources.ApplyResources(this.bigEndianXbox360PS3WiiUToolStripMenuItem, "bigEndianXbox360PS3WiiUToolStripMenuItem");
this.bigEndianXbox360PS3WiiUToolStripMenuItem.Click += new System.EventHandler(this.bigEndianToolStripMenuItem_Click);
//
// littleEndianPS4PSVitaSwitchToolStripMenuItem
//
this.littleEndianPS4PSVitaSwitchToolStripMenuItem.Name = "littleEndianPS4PSVitaSwitchToolStripMenuItem";
resources.ApplyResources(this.littleEndianPS4PSVitaSwitchToolStripMenuItem, "littleEndianPS4PSVitaSwitchToolStripMenuItem");
this.littleEndianPS4PSVitaSwitchToolStripMenuItem.Click += new System.EventHandler(this.littleEndianToolStripMenuItem_Click);
//
// setModelContainerFormatToolStripMenuItem
//
this.setModelContainerFormatToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.version1ToolStripMenuItem,
this.version2ToolStripMenuItem,
this.version3114ToolStripMenuItem});
this.setModelContainerFormatToolStripMenuItem.Name = "setModelContainerFormatToolStripMenuItem";
resources.ApplyResources(this.setModelContainerFormatToolStripMenuItem, "setModelContainerFormatToolStripMenuItem");
//
// version1ToolStripMenuItem
//
this.version1ToolStripMenuItem.Name = "version1ToolStripMenuItem";
resources.ApplyResources(this.version1ToolStripMenuItem, "version1ToolStripMenuItem");
this.version1ToolStripMenuItem.Click += new System.EventHandler(this.setModelVersion1ToolStripMenuItem_Click);
//
// version2ToolStripMenuItem
//
this.version2ToolStripMenuItem.Name = "version2ToolStripMenuItem";
resources.ApplyResources(this.version2ToolStripMenuItem, "version2ToolStripMenuItem");
this.version2ToolStripMenuItem.Click += new System.EventHandler(this.setModelVersion2ToolStripMenuItem_Click);
//
// version3114ToolStripMenuItem
//
this.version3114ToolStripMenuItem.Name = "version3114ToolStripMenuItem";
resources.ApplyResources(this.version3114ToolStripMenuItem, "version3114ToolStripMenuItem");
this.version3114ToolStripMenuItem.Click += new System.EventHandler(this.setModelVersion3ToolStripMenuItem_Click);
//
// extractToolStripMenuItem
//
resources.ApplyResources(this.extractToolStripMenuItem, "extractToolStripMenuItem");
this.extractToolStripMenuItem.Name = "extractToolStripMenuItem";
this.extractToolStripMenuItem.Click += new System.EventHandler(this.extractToolStripMenuItem_Click);
//
// toolStripSeparator6
//
this.toolStripSeparator6.Name = "toolStripSeparator6";
resources.ApplyResources(this.toolStripSeparator6, "toolStripSeparator6");
//
// cloneFileToolStripMenuItem
//
this.cloneFileToolStripMenuItem.Name = "cloneFileToolStripMenuItem";
resources.ApplyResources(this.cloneFileToolStripMenuItem, "cloneFileToolStripMenuItem");
this.cloneFileToolStripMenuItem.Click += new System.EventHandler(this.cloneFileToolStripMenuItem_Click);
//
// renameFileToolStripMenuItem
//
resources.ApplyResources(this.renameFileToolStripMenuItem, "renameFileToolStripMenuItem");
this.renameFileToolStripMenuItem.Name = "renameFileToolStripMenuItem";
this.renameFileToolStripMenuItem.Click += new System.EventHandler(this.renameFileToolStripMenuItem_Click);
//
// replaceToolStripMenuItem
//
resources.ApplyResources(this.replaceToolStripMenuItem, "replaceToolStripMenuItem");
this.replaceToolStripMenuItem.Name = "replaceToolStripMenuItem";
this.replaceToolStripMenuItem.Click += new System.EventHandler(this.replaceToolStripMenuItem_Click);
//
// deleteFileToolStripMenuItem
//
this.deleteFileToolStripMenuItem.Image = global::PckStudio.Properties.Resources.file_delete;
this.deleteFileToolStripMenuItem.Name = "deleteFileToolStripMenuItem";
resources.ApplyResources(this.deleteFileToolStripMenuItem, "deleteFileToolStripMenuItem");
this.deleteFileToolStripMenuItem.Click += new System.EventHandler(this.deleteFileToolStripMenuItem_Click);
//
// imageList
//
this.imageList.ColorDepth = System.Windows.Forms.ColorDepth.Depth32Bit;
resources.ApplyResources(this.imageList, "imageList");
this.imageList.TransparentColor = System.Drawing.Color.Transparent;
//
// addMultipleEntriesToolStripMenuItem
//
resources.ApplyResources(this.addMultipleEntriesToolStripMenuItem, "addMultipleEntriesToolStripMenuItem");
this.addMultipleEntriesToolStripMenuItem.Name = "addMultipleEntriesToolStripMenuItem";
//
// LittleEndianCheckBox
//
resources.ApplyResources(this.LittleEndianCheckBox, "LittleEndianCheckBox");
this.LittleEndianCheckBox.BackColor = System.Drawing.Color.Transparent;
this.LittleEndianCheckBox.Name = "LittleEndianCheckBox";
this.LittleEndianCheckBox.Style = MetroFramework.MetroColorStyle.White;
this.LittleEndianCheckBox.Theme = MetroFramework.MetroThemeStyle.Dark;
this.LittleEndianCheckBox.UseSelectable = true;
//
// previewPictureBox
//
resources.ApplyResources(this.previewPictureBox, "previewPictureBox");
this.previewPictureBox.BackColor = System.Drawing.Color.Transparent;
this.previewPictureBox.BackgroundInterpolationMode = System.Drawing.Drawing2D.InterpolationMode.Default;
this.previewPictureBox.Image = global::PckStudio.Properties.Resources.NoImageFound;
this.previewPictureBox.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.NearestNeighbor;
this.previewPictureBox.Name = "previewPictureBox";
this.previewPictureBox.TabStop = false;
//
// PckEditor
//
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(18)))), ((int)(((byte)(18)))), ((int)(((byte)(18)))));
resources.ApplyResources(this, "$this");
this.Controls.Add(this.previewPictureBox);
this.Controls.Add(this.LittleEndianCheckBox);
this.Controls.Add(this.pckFileLabel);
this.Controls.Add(this.labelImageSize);
this.Controls.Add(this.fileEntryCountLabel);
this.Controls.Add(this.PropertiesTabControl);
this.Controls.Add(this.label11);
this.Controls.Add(this.treeViewMain);
this.Controls.Add(logoPictureBox);
this.ForeColor = System.Drawing.Color.Transparent;
this.Name = "PckEditor";
this.Load += new System.EventHandler(this.PckEditor_Load);
((System.ComponentModel.ISupportInitialize)(logoPictureBox)).EndInit();
this.PropertiesTabControl.ResumeLayout(false);
this.MetaTab.ResumeLayout(false);
this.MetaTab.PerformLayout();
this.contextMenuMetaTree.ResumeLayout(false);
this.contextMenuPCKEntries.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.previewPictureBox)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private MetroFramework.Controls.MetroLabel pckFileLabel;
private MetroFramework.Controls.MetroLabel labelImageSize;
private MetroFramework.Controls.MetroLabel fileEntryCountLabel;
private MetroFramework.Controls.MetroTabControl PropertiesTabControl;
private MetroFramework.Controls.MetroTabPage MetaTab;
private System.Windows.Forms.TreeView treeMeta;
private MetroFramework.Controls.MetroLabel label11;
private System.Windows.Forms.TreeView treeViewMain;
private PckStudio.ToolboxItems.InterpolationPictureBox previewPictureBox;
private System.Windows.Forms.ContextMenuStrip contextMenuMetaTree;
private System.Windows.Forms.ToolStripMenuItem addEntryToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem addEntryToolStripMenuItem1;
private System.Windows.Forms.ToolStripMenuItem addBOXEntryToolStripMenuItem1;
private System.Windows.Forms.ToolStripMenuItem addANIMEntryToolStripMenuItem1;
private System.Windows.Forms.ToolStripMenuItem addMultipleEntriesToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem deleteEntryToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem editAllEntriesToolStripMenuItem;
private System.Windows.Forms.ContextMenuStrip contextMenuPCKEntries;
private System.Windows.Forms.ToolStripMenuItem createToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem folderToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem skinToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem createAnimatedTextureToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem audiopckToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem colourscolToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem CreateSkinsPCKToolStripMenuItem1;
private System.Windows.Forms.ToolStripMenuItem behavioursbinToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem entityMaterialsbinToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem importSkinsToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem importSkinToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem importExtractedSkinsFolderToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem addTextureToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem addFileToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem exportToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem as3DSTextureFileToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem setFileTypeToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem skinToolStripMenuItem1;
private System.Windows.Forms.ToolStripMenuItem capeToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem textureToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem languagesFileLOCToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem gameRulesFileGRFToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem audioPCKFileToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem coloursCOLFileToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem gameRulesHeaderGRHToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem skinsPCKToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem modelsFileBINToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem behavioursFileBINToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem entityMaterialsFileBINToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem miscFunctionsToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem generateMipMapTextureToolStripMenuItem1;
private System.Windows.Forms.ToolStripMenuItem viewFileInfoToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem correctSkinDecimalsToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem extractToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem cloneFileToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem renameFileToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem replaceToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem deleteFileToolStripMenuItem;
private System.Windows.Forms.ImageList imageList;
private System.Windows.Forms.ToolStripMenuItem addMultipleEntriesToolStripMenuItem1;
private MetroFramework.Controls.MetroLabel metroLabel2;
private MetroFramework.Controls.MetroTextBox entryTypeTextBox;
private MetroFramework.Controls.MetroTextBox entryDataTextBox;
private MetroFramework.Controls.MetroButton buttonEdit;
private MetroFramework.Controls.MetroLabel metroLabel1;
private MetroFramework.Controls.MetroCheckBox LittleEndianCheckBox;
private System.Windows.Forms.ToolStripMenuItem setSubPCKEndiannessToolStripMenuItem;
private ToolStripMenuItem bigEndianXbox360PS3WiiUToolStripMenuItem;
private ToolStripMenuItem littleEndianPS4PSVitaSwitchToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem setModelContainerFormatToolStripMenuItem;
private ToolStripMenuItem version1ToolStripMenuItem;
private ToolStripMenuItem version2ToolStripMenuItem;
private ToolStripMenuItem version3114ToolStripMenuItem;
private ToolStripSeparator toolStripSeparator5;
private ToolStripSeparator toolStripSeparator6;
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -2,7 +2,7 @@
namespace PckStudio.Controls
{
partial class PckAssetBrowserEditor
partial class RawAssetsEditor
{
/// <summary>
/// Required designer variable.
@@ -32,7 +32,7 @@ namespace PckStudio.Controls
{
this.components = new System.ComponentModel.Container();
System.Windows.Forms.PictureBox logoPictureBox;
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PckAssetBrowserEditor));
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(RawAssetsEditor));
this.pckFileLabel = new MetroFramework.Controls.MetroLabel();
this.fileEntryCountLabel = new MetroFramework.Controls.MetroLabel();
this.metroLabel2 = new MetroFramework.Controls.MetroLabel();

View File

@@ -48,10 +48,11 @@ using PckStudio.Core.IO.PckAudio;
using PckStudio.Core.IO._3DST;
using PckStudio.Core.Misc;
using PckStudio.Core.DLC;
using PckStudio.Core.Colors;
namespace PckStudio.Controls
{
internal partial class PckAssetBrowserEditor : EditorControl<PackInfo>
internal partial class RawAssetsEditor : EditorControl<RawAssetDLCPackage>
{
private string _location = string.Empty;
@@ -85,21 +86,21 @@ namespace PckStudio.Controls
private readonly IDictionary<PckAssetType, Action<PckAsset>> _pckAssetTypeHandler;
//private readonly IDictionary<PckAssetType, ViewPanel> _viewPanels;
public PckAssetBrowserEditor(PackInfo packInfo, ISaveContext<PackInfo> saveContext)
: base(packInfo, saveContext)
public RawAssetsEditor(RawAssetDLCPackage rawAssetDLCPackage, ISaveContext<RawAssetDLCPackage> saveContext)
: base(rawAssetDLCPackage, saveContext)
{
InitializeComponent();
_onModifiedChangeDelegate = OnModify;
_originalEndianness = packInfo.ByteOrder;
_currentEndianness = packInfo.ByteOrder;
_originalEndianness = rawAssetDLCPackage.ByteOrder;
_currentEndianness = rawAssetDLCPackage.ByteOrder;
//! InitializeViewPanels
{
_default = new DefaultPanel();
_models = new ModelsPanel(TryGet<string, Image>.FromDelegate((string path, out Image img) =>
{
bool found = EditorValue.File.TryGetAsset(path + ".png", PckAssetType.TextureFile, out PckAsset asset) ||
EditorValue.File.TryGetAsset(path + ".tga", PckAssetType.TextureFile, out asset);
bool found = EditorValue.PckFile.TryGetAsset(path + ".png", PckAssetType.TextureFile, out PckAsset asset) ||
EditorValue.PckFile.TryGetAsset(path + ".tga", PckAssetType.TextureFile, out asset);
img = found ? asset.GetTexture() : default;
return found;
}));
@@ -221,31 +222,28 @@ namespace PckStudio.Controls
if (asset.Type != PckAssetType.SkinDataFile && asset.Type != PckAssetType.TexturePackInfoFile || asset.Size <= 0 || !Settings.Default.LoadSubPcks)
return;
ISaveContext<PackInfo> saveContext = new DelegatedSaveContext<PackInfo>(false, (packInfo) =>
ISaveContext<RawAssetDLCPackage> saveContext = new DelegatedSaveContext<RawAssetDLCPackage>(false, (rawAssetDLCPackage) =>
{
if (packInfo.IsValid)
{
asset.SetData(new PckFileWriter(packInfo.File, _currentEndianness));
_wasModified = true;
}
asset.SetData(new PckFileWriter(rawAssetDLCPackage.PckFile, _currentEndianness));
_wasModified = true;
});
string caption = Path.GetFileName(asset.Filename);
string identifier = _location + Path.GetFileName(asset.Filename);
PckFile pckFile = asset.GetData(new PckFileReader(_originalEndianness));
PackInfo packInfo = PackInfo.Create(pckFile, _originalEndianness, false);
RawAssetDLCPackage rawAssetDLCPackage = new RawAssetDLCPackage(asset.Filename, pckFile, _originalEndianness);
// TODO: may change to use a new tab page that will be closed when the main pck is closed
//Program.MainInstance.OpenNewPckTab(caption, identifier, packInfo, saveContext);
//Program.MainInstance.OpenNewPckTab(caption, identifier, RawAssetDLCPackage, saveContext);
}
private void HandleTextureFile(PckAsset asset)
{
_ = asset.IsMipmappedFile() && EditorValue.File.TryGetAsset(asset.GetNormalPath(), PckAssetType.TextureFile, out asset);
_ = asset.IsMipmappedFile() && EditorValue.PckFile.TryGetAsset(asset.GetNormalPath(), PckAssetType.TextureFile, out asset);
if (asset.Size <= 0)
{
Trace.TraceInformation($"[{nameof(PckAssetBrowserEditor)}:{nameof(HandleTextureFile)}] '{asset.Filename}' size is 0.");
Trace.TraceInformation($"[{nameof(RawAssetsEditor)}:{nameof(HandleTextureFile)}] '{asset.Filename}' size is 0.");
return;
}
_currentViewPanel.LoadAsset(asset, () => _wasModified = true);
@@ -260,7 +258,7 @@ namespace PckStudio.Controls
break;
case ResourceCategory.Textures:
{
if ((resourceLocation.Category & ResourceCategory.ArmorTextures) != 0)
if ((resourceLocation.Category & ResourceCategory.ArmorTextures) == 0)
{
string assetName = Path.GetFileNameWithoutExtension(asset.Filename);
ArmorSetDescription armorSetDescription = ArmorSetDescription.GetFromAssetName(assetName);
@@ -268,7 +266,7 @@ namespace PckStudio.Controls
ITryGet<string, Image> tryGet = TryGet<string, Image>.FromDelegate((string path, out Image img) =>
{
img = null;
if (EditorValue.File.TryGetAsset(path + ".png", PckAssetType.TextureFile, out PckAsset armorAsset))
if (EditorValue.PckFile.TryGetAsset(path + ".png", PckAssetType.TextureFile, out PckAsset armorAsset))
{
img = armorAsset.GetTexture();
Debug.WriteLine($"Got texture for: {path}");
@@ -309,7 +307,7 @@ namespace PckStudio.Controls
bool hasCustomModel = false;
bool hasDefaultModel = TryGetDefaultEntityModel(modelName, out Model model);
if (EditorValue.File.TryGetAsset("models.bin", PckAssetType.ModelsFile, out PckAsset modelsAsset))
if (EditorValue.PckFile.TryGetAsset("models.bin", PckAssetType.ModelsFile, out PckAsset modelsAsset))
{
ModelContainer models = modelsAsset.GetData(new ModelFileReader());
hasCustomModel = models.ContainsModel(modelName);
@@ -354,13 +352,13 @@ namespace PckStudio.Controls
case ResourceCategory.Atlas:
Atlas atlas = asset.GetDeserializedData(new AtlasDeserializer(resourceLocation));
ColorContainer colorContainer = default;
if (EditorValue.File.TryGetAsset("colours.col", PckAssetType.ColourTableFile, out PckAsset colAsset))
if (EditorValue.PckFile.TryGetAsset("colours.col", PckAssetType.ColourTableFile, out PckAsset colAsset))
colorContainer = colAsset.GetData(new COLFileReader());
ITryGet<string, Animation> tryGetAnimation = TryGet<string, Animation>.FromDelegate((string key, out Animation animation) =>
{
bool found = EditorValue.File.TryGetAsset(key + ".png", PckAssetType.TextureFile, out PckAsset foundAsset) ||
EditorValue.File.TryGetAsset(key + ".tga", PckAssetType.TextureFile, out foundAsset);
bool found = EditorValue.PckFile.TryGetAsset(key + ".png", PckAssetType.TextureFile, out PckAsset foundAsset) ||
EditorValue.PckFile.TryGetAsset(key + ".tga", PckAssetType.TextureFile, out foundAsset);
if (found)
{
animation = foundAsset.GetDeserializedData(AnimationDeserializer.DefaultDeserializer);
@@ -373,8 +371,8 @@ namespace PckStudio.Controls
ITryGet<string, ISaveContext<Animation>> tryGetAnimationSaveContext = TryGet<string, ISaveContext<Animation>>
.FromDelegate((string key, out ISaveContext<Animation> animationSaveContext) =>
{
bool found = EditorValue.File.TryGetAsset(key + ".png", PckAssetType.TextureFile, out PckAsset foundAsset) ||
EditorValue.File.TryGetAsset(key + ".tga", PckAssetType.TextureFile, out foundAsset);
bool found = EditorValue.PckFile.TryGetAsset(key + ".png", PckAssetType.TextureFile, out PckAsset foundAsset) ||
EditorValue.PckFile.TryGetAsset(key + ".tga", PckAssetType.TextureFile, out foundAsset);
if (found)
{
@@ -391,7 +389,7 @@ namespace PckStudio.Controls
Debug.WriteLine("New animation has 0 frames. Aborting saving.");
return;
}
PckAsset newAnimationAsset = EditorValue.File.CreateNewAsset(key + ".png", PckAssetType.TextureFile);
PckAsset newAnimationAsset = EditorValue.PckFile.CreateNewAsset(key + ".png", PckAssetType.TextureFile);
newAnimationAsset.SetSerializedData(animation, AnimationSerializer.DefaultSerializer);
BuildMainTreeView();
});
@@ -487,12 +485,15 @@ namespace PckStudio.Controls
private void HandleColourFile(PckAsset asset)
{
ColorContainer colorContainer = asset.GetData(new COLFileReader());
ISaveContext<ColorContainer> saveContext = new DelegatedSaveContext<ColorContainer>(Settings.Default.AutoSaveChanges, (colorContainer) =>
AbstractColorContainer abstractColorContainer = AbstractColorContainer.FromColorContainer(asset.GetData(new COLFileReader()));
ISaveContext<AbstractColorContainer> saveContext = new DelegatedSaveContext<AbstractColorContainer>(Settings.Default.AutoSaveChanges, (newColorContainer) =>
{
ColorContainer colorContainer = new ColorContainer();
colorContainer.Colors.AddRange(newColorContainer.Colors.Select(kv => new ColorContainer.Color() { Name = kv.Key, ColorPallette = kv.Value }));
colorContainer.WaterColors.AddRange(newColorContainer.WaterColors.Select(kv => new ColorContainer.WaterColor() { Name = kv.Key, SurfaceColor = kv.Value.Surface, FogColor = kv.Value.Fog, UnderwaterColor = kv.Value.Underwater }));
asset.SetData(new COLFileWriter(colorContainer));
});
using COLEditor diag = new COLEditor(colorContainer, saveContext);
using COLEditor diag = new COLEditor(abstractColorContainer, saveContext);
_wasModified = diag.ShowDialog(this) == DialogResult.OK;
}
@@ -503,7 +504,7 @@ namespace PckStudio.Controls
if (asset.HasProperty("CAPEPATH"))
{
string capeAssetPath = asset.GetProperty("CAPEPATH");
if (EditorValue.File.TryGetAsset(capeAssetPath, PckAssetType.CapeFile, out PckAsset capeAsset))
if (EditorValue.PckFile.TryGetAsset(capeAssetPath, PckAssetType.CapeFile, out PckAsset capeAsset))
{
skin.CapeId = capeAsset.GetId();
cape = capeAsset.GetTexture();
@@ -517,7 +518,7 @@ namespace PckStudio.Controls
asset.SetSkin(customSkin, locFile);
});
using CustomSkinEditor skinEditor = new CustomSkinEditor(skin, cape, saveContext, EditorValue.File.HasVerionString);
using CustomSkinEditor skinEditor = new CustomSkinEditor(skin, cape, saveContext, EditorValue.PckFile.HasVerionString);
if (skinEditor.ShowDialog() == DialogResult.OK)
{
_wasModified = true;
@@ -536,22 +537,22 @@ namespace PckStudio.Controls
TryGetDelegate<string, Image> tryGetTexture = (string path, out Image img) =>
{
bool found = EditorValue.File.TryGetAsset(path + ".png", PckAssetType.TextureFile, out PckAsset asset) ||
EditorValue.File.TryGetAsset(path + ".tga", PckAssetType.TextureFile, out asset);
bool found = EditorValue.PckFile.TryGetAsset(path + ".png", PckAssetType.TextureFile, out PckAsset asset) ||
EditorValue.PckFile.TryGetAsset(path + ".tga", PckAssetType.TextureFile, out asset);
img = found ? asset.GetTexture() : default;
return found;
};
TrySetDelegate<string, Image> trySetTexture = (string path, Image img) =>
{
bool found = EditorValue.File.TryGetAsset(path + ".png", PckAssetType.TextureFile, out PckAsset foundAsset) ||
EditorValue.File.TryGetAsset(path + ".tga", PckAssetType.TextureFile, out foundAsset);
PckAsset asset = foundAsset ?? EditorValue.File.CreateNewAsset(path + ".png", PckAssetType.TextureFile);
bool found = EditorValue.PckFile.TryGetAsset(path + ".png", PckAssetType.TextureFile, out PckAsset foundAsset) ||
EditorValue.PckFile.TryGetAsset(path + ".tga", PckAssetType.TextureFile, out foundAsset);
PckAsset asset = foundAsset ?? EditorValue.PckFile.CreateNewAsset(path + ".png", PckAssetType.TextureFile);
asset.SetTexture(img);
return true;
};
bool hasMaterialAsset = EditorValue.File.TryGetAsset("entityMaterials.bin", PckAssetType.MaterialFile, out PckAsset entityMaterialAsset);
bool hasMaterialAsset = EditorValue.PckFile.TryGetAsset("entityMaterials.bin", PckAssetType.MaterialFile, out PckAsset entityMaterialAsset);
IReadOnlyDictionary<string, MaterialContainer.Material> entityMaterials =
hasMaterialAsset
? entityMaterialAsset?.GetData(new MaterialFileReader()).ToDictionary(mat => mat.Name)
@@ -595,7 +596,7 @@ namespace PckStudio.Controls
private void CheckForPasswordAndRemove()
{
if (EditorValue.File.TryGetAsset("0", PckAssetType.InfoFile, out PckAsset asset))
if (EditorValue.PckFile.TryGetAsset("0", PckAssetType.InfoFile, out PckAsset asset))
{
asset.RemoveProperties("LOCK");
}
@@ -619,7 +620,7 @@ namespace PckStudio.Controls
string selectedNodeText = treeViewMain.SelectedNode is TreeNode node ? node.FullPath : string.Empty;
_currentViewPanel.Reset();
treeViewMain.Nodes.Clear();
BuildPckTreeView(treeViewMain.Nodes, EditorValue.File);
BuildPckTreeView(treeViewMain.Nodes, EditorValue.PckFile);
treeViewMain.Sort();
TreeNode[] selectedNodes = treeViewMain.FindPath(selectedNodeText);
@@ -668,8 +669,8 @@ namespace PckStudio.Controls
private bool TryGetLocFile(out LOCFile locFile)
{
if (!EditorValue.File.TryGetAsset("localisation.loc", PckAssetType.LocalisationFile, out PckAsset locAsset) &&
!EditorValue.File.TryGetAsset("languages.loc", PckAssetType.LocalisationFile, out locAsset))
if (!EditorValue.PckFile.TryGetAsset("localisation.loc", PckAssetType.LocalisationFile, out PckAsset locAsset) &&
!EditorValue.PckFile.TryGetAsset("languages.loc", PckAssetType.LocalisationFile, out locAsset))
{
locFile = null;
return false;
@@ -690,8 +691,8 @@ namespace PckStudio.Controls
private bool TrySetLocFile(in LOCFile locFile)
{
if (!EditorValue.File.TryGetAsset("localisation.loc", PckAssetType.LocalisationFile, out PckAsset locAsset) &&
!EditorValue.File.TryGetAsset("languages.loc", PckAssetType.LocalisationFile, out locAsset))
if (!EditorValue.PckFile.TryGetAsset("localisation.loc", PckAssetType.LocalisationFile, out PckAsset locAsset) &&
!EditorValue.PckFile.TryGetAsset("languages.loc", PckAssetType.LocalisationFile, out locAsset))
{
return false;
}
@@ -710,14 +711,14 @@ namespace PckStudio.Controls
private void UpdateRichPresence()
{
if (EditorValue is not null &&
TryGetLocFile(out LOCFile locfile) &&
locfile.HasLocEntry("IDS_DISPLAY_NAME") &&
locfile.Languages.Contains(DLCManager.Default.PreferredLanguage))
{
RPC.SetPresence("Editing a Pack:", $" > {locfile.GetLocEntry("IDS_DISPLAY_NAME", DLCManager.Default.PreferredLanguage)}");
return;
}
//if (EditorValue is not null &&
// TryGetLocFile(out LOCFile locfile) &&
// locfile.HasLocEntry("IDS_DISPLAY_NAME") &&
// locfile.Languages.Contains(DLCManager.Default.PreferredLanguage))
//{
// RPC.SetPresence("Editing a Pack:", $" > {locfile.GetLocEntry("IDS_DISPLAY_NAME", DLCManager.Default.PreferredLanguage)}");
// return;
//}
// default
RPC.SetPresence("An Open Source .PCK File Editor");
}
@@ -732,9 +733,9 @@ namespace PckStudio.Controls
private static PckAudioFile CreateNewAudioFile()
{
PckAudioFile audioFile = new PckAudioFile();
audioFile.AddCategory(PckAudioFile.AudioCategory.EAudioType.Overworld);
audioFile.AddCategory(PckAudioFile.AudioCategory.EAudioType.Nether);
audioFile.AddCategory(PckAudioFile.AudioCategory.EAudioType.End);
audioFile.AddCategory(PckAudioFile.Category.Overworld);
audioFile.AddCategory(PckAudioFile.Category.Nether);
audioFile.AddCategory(PckAudioFile.Category.End);
return audioFile;
}
@@ -751,12 +752,12 @@ namespace PckStudio.Controls
using AddFilePrompt diag = new AddFilePrompt("res/" + Path.GetFileName(ofd.FileName));
if (diag.ShowDialog(this) == DialogResult.OK)
{
if (EditorValue.File.Contains(diag.Filepath, diag.Filetype))
if (EditorValue.PckFile.Contains(diag.Filepath, diag.Filetype))
{
MessageBox.Show(this, $"'{diag.Filepath}' of type {diag.Filetype} already exists.", "Import failed", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
PckAsset asset = EditorValue.File.CreateNewAsset(diag.Filepath, diag.Filetype, () => File.ReadAllBytes(ofd.FileName));
PckAsset asset = EditorValue.PckFile.CreateNewAsset(diag.Filepath, diag.Filetype, () => File.ReadAllBytes(ofd.FileName));
BuildMainTreeView();
_wasModified = true;
@@ -775,12 +776,12 @@ namespace PckStudio.Controls
renamePrompt.LabelText = "Path";
if (renamePrompt.ShowDialog(this) == DialogResult.OK && !string.IsNullOrEmpty(renamePrompt.NewText))
{
if (EditorValue.File.Contains(renamePrompt.NewText, PckAssetType.TextureFile))
if (EditorValue.PckFile.Contains(renamePrompt.NewText, PckAssetType.TextureFile))
{
MessageBox.Show(this, $"'{renamePrompt.NewText}' already exists.", "Import failed", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
PckAsset asset = EditorValue.File.CreateNewAsset(renamePrompt.NewText, PckAssetType.TextureFile, () => File.ReadAllBytes(fileDialog.FileName));
PckAsset asset = EditorValue.PckFile.CreateNewAsset(renamePrompt.NewText, PckAssetType.TextureFile, () => File.ReadAllBytes(fileDialog.FileName));
BuildMainTreeView();
_wasModified = true;
}
@@ -799,7 +800,7 @@ namespace PckStudio.Controls
{
string skinNameImport = Path.GetFileName(contents.FileName);
byte[] data = File.ReadAllBytes(contents.FileName);
PckAsset mfNew = EditorValue.File.CreateNewAsset(skinNameImport, PckAssetType.SkinFile);
PckAsset mfNew = EditorValue.PckFile.CreateNewAsset(skinNameImport, PckAssetType.SkinFile);
mfNew.SetData(data);
string propertyFile = Path.GetFileNameWithoutExtension(contents.FileName) + ".txt";
if (File.Exists(propertyFile))
@@ -941,7 +942,7 @@ namespace PckStudio.Controls
if (e.Button != MouseButtons.Left || e.Item is not TreeNode node)
return;
if ((node.TryGetTagData(out PckAsset asset) && EditorValue.File.Contains(asset.Filename, asset.Type)) || node.Parent is TreeNode)
if ((node.TryGetTagData(out PckAsset asset) && EditorValue.PckFile.Contains(asset.Filename, asset.Type)) || node.Parent is TreeNode)
{
// TODO: add (mouse) scrolling while dragging item(s)
treeViewMain.DoDragDrop(node, DragDropEffects.Scroll | DragDropEffects.Move);
@@ -1117,14 +1118,14 @@ namespace PckStudio.Controls
}
}
if (EditorValue.File.Contains(filepath, assetType))
if (EditorValue.PckFile.Contains(filepath, assetType))
{
if (askForAssetType)
MessageBox.Show(this, $"'{assetPath}' of type {assetType} already exists.\nSkiping file.", "File already exists", MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1);
Debug.WriteLine($"'{assetPath}' of type {assetType} already exists.\nSkiping file.");
continue;
}
PckAsset importedAsset = EditorValue.File.CreateNewAsset(assetPath, assetType, () => File.ReadAllBytes(filepath));
PckAsset importedAsset = EditorValue.PckFile.CreateNewAsset(assetPath, assetType, () => File.ReadAllBytes(filepath));
string propertyFile = filepath + ".txt";
if (File.Exists(propertyFile))
{
@@ -1165,12 +1166,12 @@ namespace PckStudio.Controls
if (addFile.ShowDialog(this) != DialogResult.OK)
continue;
if (EditorValue.File.Contains(addFile.Filepath, addFile.Filetype))
if (EditorValue.PckFile.Contains(addFile.Filepath, addFile.Filetype))
{
MessageBox.Show(this, $"'{addFile.Filepath}' of type {addFile.Filetype} already exists.", "Import failed", MessageBoxButtons.OK, MessageBoxIcon.Warning);
continue;
}
EditorValue.File.CreateNewAsset(addFile.Filepath, addFile.Filetype, () => File.ReadAllBytes(file));
EditorValue.PckFile.CreateNewAsset(addFile.Filepath, addFile.Filetype, () => File.ReadAllBytes(file));
addedCount++;
BuildMainTreeView();
@@ -1186,19 +1187,19 @@ namespace PckStudio.Controls
{
TryGetLocFile(out LOCFile locFile);
PckAsset skinAsset = addNewSkinDialog.NewSkin.CreateFile(locFile);
EditorValue.File.AddAsset(skinAsset);
EditorValue.PckFile.AddAsset(skinAsset);
bool hasSkinsFolder = treeViewMain.Nodes.ContainsKey("Skins");
if (hasSkinsFolder)
skinAsset.Filename = skinAsset.Filename.Insert(0, "Skins/"); // Then Skins folder
EditorValue.File.AddAsset(skinAsset);
EditorValue.PckFile.AddAsset(skinAsset);
if (addNewSkinDialog.HasCape)
{
PckAsset capeFile = addNewSkinDialog.NewSkin.CreateCapeFile(addNewSkinDialog.CapeTexture);
if (hasSkinsFolder)
capeFile.Filename = capeFile.Filename.Insert(0, "Skins/"); // Then Skins folder
EditorValue.File.AddAsset(capeFile);
EditorValue.PckFile.AddAsset(capeFile);
}
TrySetLocFile(locFile);
@@ -1215,7 +1216,7 @@ namespace PckStudio.Controls
string animationFilepath = $"{ResourceLocations.GetPathFromCategory(diag.Category)}/{diag.SelectedTile.InternalName}.png";
if (EditorValue.File.Contains(animationFilepath, PckAssetType.TextureFile))
if (EditorValue.PckFile.Contains(animationFilepath, PckAssetType.TextureFile))
{
MessageBox.Show(this, $"{diag.SelectedTile.DisplayName} is already present.", "File already present");
return;
@@ -1231,7 +1232,7 @@ namespace PckStudio.Controls
if (animationEditor.ShowDialog() == DialogResult.OK && newAnimation is not null)
{
_wasModified = true;
PckAsset asset = EditorValue.File.CreateNewAsset(animationFilepath, PckAssetType.TextureFile);
PckAsset asset = EditorValue.PckFile.CreateNewAsset(animationFilepath, PckAssetType.TextureFile);
asset.SetSerializedData(newAnimation, AnimationSerializer.DefaultSerializer);
BuildMainTreeView();
_currentViewPanel.LoadAsset(asset, () => _wasModified = true);
@@ -1240,7 +1241,7 @@ namespace PckStudio.Controls
private void audiopckToolStripMenuItem_Click(object sender, EventArgs e)
{
if (EditorValue.File.Contains(PckAssetType.AudioFile))
if (EditorValue.PckFile.Contains(PckAssetType.AudioFile))
{
// the chance of this happening is really really slim but just in case
MessageBox.Show(this, "There is already an audio file in this PCK!", "Can't create audio.pck");
@@ -1264,7 +1265,7 @@ namespace PckStudio.Controls
AudioEditor diag = new AudioEditor(newAudioFile, saveContext);
if (diag.ShowDialog(this) == DialogResult.OK)
{
EditorValue.File.AddAsset(newAudioAsset);
EditorValue.PckFile.AddAsset(newAudioAsset);
}
diag.Dispose();
BuildMainTreeView();
@@ -1272,51 +1273,51 @@ namespace PckStudio.Controls
private void colourscolToolStripMenuItem_Click(object sender, EventArgs e)
{
if (EditorValue.File.TryGetAsset("colours.col", PckAssetType.ColourTableFile, out _))
if (EditorValue.PckFile.TryGetAsset("colours.col", PckAssetType.ColourTableFile, out _))
{
MessageBox.Show(this, "A color table file already exists in this PCK and a new one cannot be created.", "Operation aborted");
return;
}
PckAsset newColorAsset = EditorValue.File.CreateNewAsset("colours.col", PckAssetType.ColourTableFile);
PckAsset newColorAsset = EditorValue.PckFile.CreateNewAsset("colours.col", PckAssetType.ColourTableFile);
newColorAsset.SetData(Resources.tu69colours);
BuildMainTreeView();
}
private void CreateSkinsPCKToolStripMenuItem1_Click(object sender, EventArgs e)
{
if (EditorValue.File.TryGetAsset("Skins.pck", PckAssetType.SkinDataFile, out _))
if (EditorValue.PckFile.TryGetAsset("Skins.pck", PckAssetType.SkinDataFile, out _))
{
MessageBox.Show(this, "A Skins.pck file already exists in this PCK and a new one cannot be created.", "Operation aborted");
return;
}
EditorValue.File.CreateNewAsset("Skins.pck", PckAssetType.SkinDataFile, new PckFileWriter(new PckFile(3, true), _currentEndianness));
EditorValue.PckFile.CreateNewAsset("Skins.pck", PckAssetType.SkinDataFile, new PckFileWriter(new PckFile(3, true), _currentEndianness));
BuildMainTreeView();
}
private void behavioursbinToolStripMenuItem_Click(object sender, EventArgs e)
{
if (EditorValue.File.TryGetAsset("behaviours.bin", PckAssetType.BehavioursFile, out _))
if (EditorValue.PckFile.TryGetAsset("behaviours.bin", PckAssetType.BehavioursFile, out _))
{
MessageBox.Show(this, "A behaviours file already exists in this PCK and a new one cannot be created.", "Operation aborted");
return;
}
EditorValue.File.CreateNewAsset("behaviours.bin", PckAssetType.BehavioursFile, new BehavioursWriter(new BehaviourFile()));
EditorValue.PckFile.CreateNewAsset("behaviours.bin", PckAssetType.BehavioursFile, new BehavioursWriter(new BehaviourFile()));
BuildMainTreeView();
}
private void entityMaterialsbinToolStripMenuItem_Click(object sender, EventArgs e)
{
if (EditorValue.File.TryGetAsset("entityMaterials.bin", PckAssetType.MaterialFile, out _))
if (EditorValue.PckFile.TryGetAsset("entityMaterials.bin", PckAssetType.MaterialFile, out _))
{
MessageBox.Show(this, "A behaviours file already exists in this PCK and a new one cannot be created.", "Operation aborted");
return;
}
var materialContainer = new MaterialContainer();
materialContainer.InitializeDefault();
EditorValue.File.CreateNewAsset("entityMaterials.bin", PckAssetType.MaterialFile, new MaterialFileWriter(materialContainer));
EditorValue.PckFile.CreateNewAsset("entityMaterials.bin", PckAssetType.MaterialFile, new MaterialFileWriter(materialContainer));
BuildMainTreeView();
}
@@ -1333,7 +1334,7 @@ namespace PckStudio.Controls
return;
}
// creates variable to indicate wether current pck skin structure is mashup or regular skin
bool hasSkinsPck = EditorValue.File.HasAsset("Skins.pck", PckAssetType.SkinDataFile);
bool hasSkinsPck = EditorValue.PckFile.HasAsset("Skins.pck", PckAssetType.SkinDataFile);
foreach (var fullfilename in Directory.GetFiles(contents.ResultPath, "*.png"))
{
@@ -1380,7 +1381,7 @@ namespace PckStudio.Controls
}
if (hasSkinsPck)
{
PckAsset skinsFileAsset = EditorValue.File.GetAsset("Skins.pck", PckAssetType.SkinDataFile);
PckAsset skinsFileAsset = EditorValue.PckFile.GetAsset("Skins.pck", PckAssetType.SkinDataFile);
using (var ms = new MemoryStream(skinsFileAsset.Data))
{
//var reader = new PckFileReader(LittleEndianCheckBox.Checked ? OMI.Endianness.LittleEndian : OMI.Endianness.BigEndian);
@@ -1393,7 +1394,7 @@ namespace PckStudio.Controls
}
continue;
}
EditorValue.File.AddAsset(newFile);
EditorValue.PckFile.AddAsset(newFile);
}
BuildMainTreeView();
_wasModified = true;
@@ -1442,8 +1443,8 @@ namespace PckStudio.Controls
{
string mippedPath = $"{textureDirectory}/{textureName}MipMapLevel{i}{textureExtension}";
Debug.WriteLine(mippedPath);
if (EditorValue.File.HasAsset(mippedPath, PckAssetType.TextureFile))
EditorValue.File.RemoveAsset(EditorValue.File.GetAsset(mippedPath, PckAssetType.TextureFile));
if (EditorValue.PckFile.HasAsset(mippedPath, PckAssetType.TextureFile))
EditorValue.PckFile.RemoveAsset(EditorValue.PckFile.GetAsset(mippedPath, PckAssetType.TextureFile));
PckAsset mipMappedAsset = new PckAsset(mippedPath, PckAssetType.TextureFile);
Image originalTexture = asset.GetTexture();
@@ -1451,7 +1452,7 @@ namespace PckStudio.Controls
mipMappedAsset.SetTexture(mippedTexture);
EditorValue.File.InsertAsset(EditorValue.File.IndexOfAsset(asset) + i - 1, mipMappedAsset);
EditorValue.PckFile.InsertAsset(EditorValue.PckFile.IndexOfAsset(asset) + i - 1, mipMappedAsset);
}
BuildMainTreeView();
}
@@ -1532,7 +1533,7 @@ namespace PckStudio.Controls
string selectedFolder = node.FullPath;
foreach (PckAsset asset in EditorValue.File.GetAssets().Where(asset => asset.Filename.StartsWith(selectedFolder)))
foreach (PckAsset asset in EditorValue.PckFile.GetAssets().Where(asset => asset.Filename.StartsWith(selectedFolder)))
{
extractFolderFile(outPath, asset);
}
@@ -1604,7 +1605,7 @@ namespace PckStudio.Controls
TreeNodeCollection nodeCollection = node.Parent?.Nodes ?? treeViewMain.Nodes;
nodeCollection.Insert(node.Index + 1, newNode);
EditorValue.File.InsertAsset(node.Index + 1, newFile);
EditorValue.PckFile.InsertAsset(node.Index + 1, newFile);
BuildMainTreeView();
_wasModified = true;
}
@@ -1626,7 +1627,7 @@ namespace PckStudio.Controls
{
if (isFile)
{
if (EditorValue.File.Contains(diag.NewText, asset.Type))
if (EditorValue.PckFile.Contains(diag.NewText, asset.Type))
{
MessageBox.Show(this, $"{diag.NewText} already exists", "File already exists");
return;
@@ -1729,7 +1730,7 @@ namespace PckStudio.Controls
if (node.TryGetTagData(out PckAsset asset))
{
if (!BeforeFileRemove(asset) && EditorValue.File.RemoveAsset(asset))
if (!BeforeFileRemove(asset) && EditorValue.PckFile.RemoveAsset(asset))
{
_currentViewPanel.Reset();
node.Remove();
@@ -1740,7 +1741,7 @@ namespace PckStudio.Controls
MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
{
string pckFolderDir = node.FullPath;
EditorValue.File.RemoveAll(file => file.Filename.StartsWith(pckFolderDir) && !BeforeFileRemove(file));
EditorValue.PckFile.RemoveAll(file => file.Filename.StartsWith(pckFolderDir) && !BeforeFileRemove(file));
node.Remove();
_wasModified = true;
}

View File

@@ -7,6 +7,7 @@ using PckStudio.Json;
using PckStudio.Core.Extensions;
using System.Drawing;
using System.Linq;
using PckStudio.Controls;
namespace PckStudio.Forms.Additional_Popups.Animation
{
@@ -36,7 +37,11 @@ namespace PckStudio.Forms.Additional_Popups.Animation
public DialogResult ShowDialog(IWin32Window owner)
{
return filterPrompt.ShowDialog(owner);
var f = new ImmersiveForm();
filterPrompt.Dock = DockStyle.Fill;
filterPrompt.Update();
f.Controls.Add(filterPrompt);
return f.ShowDialog(owner);
}
private void filterPrompt_OnSelectedItemChanged(object sender, EventArgs e)
@@ -68,7 +73,6 @@ namespace PckStudio.Forms.Additional_Popups.Animation
Tag = tileData
};
view.Nodes.Add(tileNode);
(view.Tag as List<TreeNode>).Add(tileNode);
}
}

View File

@@ -34,7 +34,6 @@
this.InputTextBox = new MetroFramework.Controls.MetroTextBox();
this.resolutionComboBox = new MetroFramework.Controls.MetroComboBox();
this.label1 = new MetroFramework.Controls.MetroLabel();
this.createSkinsPckCheckBox = new MetroFramework.Controls.MetroCheckBox();
this.SuspendLayout();
//
// TextLabel
@@ -99,20 +98,11 @@
this.label1.Name = "label1";
this.label1.Theme = MetroFramework.MetroThemeStyle.Dark;
//
// createSkinsPckCheckBox
//
resources.ApplyResources(this.createSkinsPckCheckBox, "createSkinsPckCheckBox");
this.createSkinsPckCheckBox.Name = "createSkinsPckCheckBox";
this.createSkinsPckCheckBox.Style = MetroFramework.MetroColorStyle.White;
this.createSkinsPckCheckBox.Theme = MetroFramework.MetroThemeStyle.Dark;
this.createSkinsPckCheckBox.UseSelectable = true;
//
// CreateTexturePackPrompt
//
this.AcceptButton = this.OKButton;
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.createSkinsPckCheckBox);
this.Controls.Add(this.label1);
this.Controls.Add(this.resolutionComboBox);
this.Controls.Add(this.InputTextBox);
@@ -132,6 +122,5 @@
private MetroFramework.Controls.MetroTextBox InputTextBox;
private MetroFramework.Controls.MetroComboBox resolutionComboBox;
public MetroFramework.Controls.MetroLabel label1;
private MetroFramework.Controls.MetroCheckBox createSkinsPckCheckBox;
}
}

View File

@@ -10,7 +10,6 @@ namespace PckStudio
/// <summary>
/// Text entered <c>only access when DialogResult == DialogResult.OK</c>
/// </summary>
public bool CreateSkinsPck => createSkinsPckCheckBox.Checked;
public string PackName => InputTextBox.Text;
public string PackRes => resolutionComboBox.Text;

View File

@@ -147,7 +147,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;TextLabel.ZOrder" xml:space="preserve">
<value>5</value>
<value>4</value>
</data>
<data name="OKButton.Location" type="System.Drawing.Point, System.Drawing">
<value>166, 74</value>
@@ -171,7 +171,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;OKButton.ZOrder" xml:space="preserve">
<value>4</value>
<value>3</value>
</data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="resource.Image" type="System.Resources.ResXNullRef, System.Windows.Forms">
@@ -208,7 +208,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;InputTextBox.ZOrder" xml:space="preserve">
<value>3</value>
<value>2</value>
</data>
<data name="resolutionComboBox.ItemHeight" type="System.Int32, mscorlib">
<value>23</value>
@@ -232,7 +232,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;resolutionComboBox.ZOrder" xml:space="preserve">
<value>2</value>
<value>1</value>
</data>
<data name="label1.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@@ -262,33 +262,6 @@
<value>$this</value>
</data>
<data name="&gt;&gt;label1.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="createSkinsPckCheckBox.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="createSkinsPckCheckBox.Location" type="System.Drawing.Point, System.Drawing">
<value>19, 77</value>
</data>
<data name="createSkinsPckCheckBox.Size" type="System.Drawing.Size, System.Drawing">
<value>109, 15</value>
</data>
<data name="createSkinsPckCheckBox.TabIndex" type="System.Int32, mscorlib">
<value>8</value>
</data>
<data name="createSkinsPckCheckBox.Text" xml:space="preserve">
<value>Create Skins.pck</value>
</data>
<data name="&gt;&gt;createSkinsPckCheckBox.Name" xml:space="preserve">
<value>createSkinsPckCheckBox</value>
</data>
<data name="&gt;&gt;createSkinsPckCheckBox.Type" xml:space="preserve">
<value>MetroFramework.Controls.MetroCheckBox, MetroFramework, Version=1.4.0.0, Culture=neutral, PublicKeyToken=5f91a84759bf584a</value>
</data>
<data name="&gt;&gt;createSkinsPckCheckBox.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;createSkinsPckCheckBox.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
@@ -2813,6 +2786,6 @@
<value>CreateTexturePackPrompt</value>
</data>
<data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>ImmersiveForm, MetroFramework, Version=1.4.0.0, Culture=neutral, PublicKeyToken=5f91a84759bf584a</value>
<value>PckStudio.Controls.ImmersiveForm, PCK-Studio, Version=7.0.0.2, Culture=neutral, PublicKeyToken=null</value>
</data>
</root>

View File

@@ -1,8 +1,9 @@
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using PckStudio.Forms.Additional_Popups.Animation;
using PckStudio.Controls;
using PckStudio.Core.Json;
using PckStudio.Forms.Additional_Popups.Animation;
using PckStudio.Json;
@@ -63,8 +64,12 @@ namespace PckStudio.Forms.Additional_Popups.EntityForms
public DialogResult ShowDialog(IWin32Window owner)
{
return filterPrompt.ShowDialog(owner);
}
var f = new ImmersiveForm();
filterPrompt.Dock = DockStyle.Fill;
filterPrompt.Update();
f.Controls.Add(filterPrompt);
return f.ShowDialog(owner);
}
private void treeViews_AfterSelect(object sender, TreeViewEventArgs e)
{

View File

@@ -29,9 +29,6 @@
private void InitializeComponent()
{
MetroFramework.Controls.MetroLabel metroLabel2;
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FilterPrompt));
this.acceptButton = new System.Windows.Forms.Button();
this.cancelButton = new System.Windows.Forms.Button();
this.filterTextBox = new MetroFramework.Controls.MetroTextBox();
this.tabController = new MetroFramework.Controls.MetroTabControl();
metroLabel2 = new MetroFramework.Controls.MetroLabel();
@@ -40,41 +37,13 @@
// metroLabel2
//
metroLabel2.AutoSize = true;
metroLabel2.Location = new System.Drawing.Point(133, 19);
metroLabel2.Location = new System.Drawing.Point(2, 6);
metroLabel2.Name = "metroLabel2";
metroLabel2.Size = new System.Drawing.Size(46, 19);
metroLabel2.TabIndex = 16;
metroLabel2.Text = "Filter: ";
metroLabel2.Theme = MetroFramework.MetroThemeStyle.Dark;
//
// acceptButton
//
this.acceptButton.DialogResult = System.Windows.Forms.DialogResult.OK;
this.acceptButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.acceptButton.ForeColor = System.Drawing.Color.White;
this.acceptButton.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.acceptButton.Location = new System.Drawing.Point(92, 196);
this.acceptButton.Name = "acceptButton";
this.acceptButton.Size = new System.Drawing.Size(75, 23);
this.acceptButton.TabIndex = 7;
this.acceptButton.Text = "Save";
this.acceptButton.UseVisualStyleBackColor = true;
this.acceptButton.Click += new System.EventHandler(this.AcceptBtn_Click);
//
// cancelButton
//
this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.cancelButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.cancelButton.ForeColor = System.Drawing.Color.White;
this.cancelButton.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.cancelButton.Location = new System.Drawing.Point(172, 196);
this.cancelButton.Name = "cancelButton";
this.cancelButton.Size = new System.Drawing.Size(75, 23);
this.cancelButton.TabIndex = 13;
this.cancelButton.Text = "Cancel";
this.cancelButton.UseVisualStyleBackColor = true;
this.cancelButton.Click += new System.EventHandler(this.CancelBtn_Click);
//
// filterTextBox
//
//
@@ -90,7 +59,7 @@
this.filterTextBox.CustomButton.UseSelectable = true;
this.filterTextBox.CustomButton.Visible = false;
this.filterTextBox.Lines = new string[0];
this.filterTextBox.Location = new System.Drawing.Point(173, 18);
this.filterTextBox.Location = new System.Drawing.Point(42, 5);
this.filterTextBox.MaxLength = 32767;
this.filterTextBox.Name = "filterTextBox";
this.filterTextBox.PasswordChar = '\0';
@@ -100,7 +69,7 @@
this.filterTextBox.SelectionStart = 0;
this.filterTextBox.ShortcutsEnabled = true;
this.filterTextBox.Size = new System.Drawing.Size(156, 23);
this.filterTextBox.TabIndex = 17;
this.filterTextBox.TabIndex = 0;
this.filterTextBox.Theme = MetroFramework.MetroThemeStyle.Dark;
this.filterTextBox.UseSelectable = true;
this.filterTextBox.WaterMarkColor = System.Drawing.Color.FromArgb(((int)(((byte)(109)))), ((int)(((byte)(109)))), ((int)(((byte)(109)))));
@@ -109,48 +78,34 @@
//
// tabController
//
this.tabController.Location = new System.Drawing.Point(6, 8);
this.tabController.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.tabController.Location = new System.Drawing.Point(0, 34);
this.tabController.Name = "tabController";
this.tabController.Size = new System.Drawing.Size(326, 184);
this.tabController.Style = MetroFramework.MetroColorStyle.White;
this.tabController.Size = new System.Drawing.Size(360, 408);
this.tabController.Style = MetroFramework.MetroColorStyle.Silver;
this.tabController.TabIndex = 18;
this.tabController.Theme = MetroFramework.MetroThemeStyle.Dark;
this.tabController.UseSelectable = true;
//
// FilterPromtp
// FilterPrompt
//
this.AcceptButton = this.acceptButton;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.cancelButton;
this.ClientSize = new System.Drawing.Size(338, 228);
this.ControlBox = false;
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(18)))), ((int)(((byte)(18)))), ((int)(((byte)(18)))));
this.Controls.Add(this.filterTextBox);
this.Controls.Add(metroLabel2);
this.Controls.Add(this.tabController);
this.Controls.Add(this.cancelButton);
this.Controls.Add(this.acceptButton);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "FilterPromtp";
this.Resizable = false;
this.Style = MetroFramework.MetroColorStyle.Silver;
this.Theme = MetroFramework.MetroThemeStyle.Dark;
this.Name = "FilterPrompt";
this.Size = new System.Drawing.Size(360, 442);
this.ResumeLayout(false);
this.PerformLayout();
}
private void MetroTextBox1_TextChanged(object sender, System.EventArgs e)
{
throw new System.NotImplementedException();
}
#endregion
#endregion
private System.Windows.Forms.Button acceptButton;
private System.Windows.Forms.Button cancelButton;
private MetroFramework.Controls.MetroTextBox filterTextBox;
private MetroFramework.Controls.MetroTabControl tabController;
}

View File

@@ -16,20 +16,15 @@
* 3. This notice may not be removed or altered from any source distribution.
**/
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Reflection;
using System.Windows.Forms;
using MetroFramework.Forms;
using PckStudio.Core.Extensions;
namespace PckStudio.Forms.Additional_Popups.Animation
{
internal partial class FilterPrompt : MetroForm
internal partial class FilterPrompt : UserControl
{
public string AcceptButtonText { get => acceptButton.Text; set => acceptButton.Text = value; }
public string CancelButtonText { get => cancelButton.Text; set => cancelButton.Text = value; }
public Color PageBackColor { get; set; } = Color.FromArgb(64, 64, 64);
private object _selectedItem;
public object SelectedItem => _selectedItem;
@@ -48,26 +43,64 @@ namespace PckStudio.Forms.Additional_Popups.Animation
InitializeComponent();
}
public TreeView AddFilterPage(string categoryName, string key, FilterPredicate filterPredicate)
public new void Update()
{
base.Update();
foreach (TabPage tabpage in tabController.TabPages)
{
if (tabpage.Controls[0] is not TreeView pageView || pageView.Tag is not TreeView backingView)
continue;
pageView.BeginUpdate();
pageView.ContextMenuStrip = backingView.ContextMenuStrip;
pageView.ImageList = backingView.ImageList;
pageView.Nodes.Clear();
pageView.Show();
FilterPredicate filerPredicate = tabpage.Tag as FilterPredicate;
foreach (TreeNode node in backingView.Nodes.GetLeafNodes())
{
if (string.IsNullOrEmpty(filterTextBox.Text) ||
node.FullPath.ToLower().Contains(filterTextBox.Text.ToLower()) ||
(filerPredicate?.Invoke(filterTextBox.Text, node.Tag) ?? false))
{
TreeNode n = pageView.Nodes.BuildNodeTreeBySeperator(node.FullPath, backingView.PathSeparator);
n.Tag = node.Tag;
n.ImageIndex = node.ImageIndex;
n.SelectedImageIndex = node.SelectedImageIndex;
}
}
pageView.EndUpdate();
}
}
public TreeView AddFilterPage(string categoryName, string key, FilterPredicate filterPredicate)
{
_ = categoryName ?? throw new ArgumentNullException(nameof(categoryName));
TabPage page = new TabPage(categoryName);
page.BorderStyle = BorderStyle.None;
page.Name = key ?? categoryName;
page.Tag = filterPredicate;
var pageView = new TreeView()
{
Dock = DockStyle.Fill,
BackColor = PageBackColor,
};
BackColor = BackColor,
ForeColor = ForeColor,
};
pageView.AfterSelect += (sender, e) =>
{
_selectedItem = e.Node.Tag;
Events[nameof(OnSelectedItemChanged)]?.DynamicInvoke(this, EventArgs.Empty);
};
pageView.Tag = new List<TreeNode>(4);
var backingView = new TreeView()
{
Dock = DockStyle.Fill,
BackColor = BackColor,
ForeColor = ForeColor,
};
pageView.Tag = backingView;
page.Controls.Add(pageView);
tabController.TabPages.Add(page);
return pageView;
return backingView;
}
public TreeView GetByKey(string key)
@@ -77,43 +110,7 @@ namespace PckStudio.Forms.Additional_Popups.Animation
private void filter_TextChanged(object sender, EventArgs e)
{
// Some code in this function is modified code from this StackOverflow answer - MattNL
// https://stackoverflow.com/questions/8260322/filter-a-treeview-with-a-textbox-in-a-c-sharp-winforms-app
// block re-painting control until all objects are loaded
foreach (TabPage tabpage in tabController.TabPages)
{
if (tabpage.Tag is not FilterPredicate filerPredicate || tabpage.Controls[0] is not TreeView pageView || pageView.Tag is not List<TreeNode> pageCache)
continue;
if (string.IsNullOrEmpty(filterTextBox.Text))
{
pageView.Nodes.Clear();
pageView.Nodes.AddRange(pageCache.ToArray());
continue;
}
pageView.BeginUpdate();
pageView.Nodes.Clear();
foreach (TreeNode _node in pageCache)
{
if (_node.Text.ToLower().Contains(filterTextBox.Text.ToLower()) || filerPredicate(filterTextBox.Text, _node.Tag))
{
pageView.Nodes.Add((TreeNode)_node.Clone());
}
}
pageView.EndUpdate();
}
}
private void CancelBtn_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.Cancel;
}
private void AcceptBtn_Click(object sender, EventArgs e)
{
DialogResult = _selectedItem is null ? DialogResult.Cancel : DialogResult.OK;
Update();
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -269,7 +269,7 @@ namespace PckStudio.Forms.Editor
// playOverworldInCreative
//
resources.ApplyResources(this.playOverworldInCreative, "playOverworldInCreative");
this.playOverworldInCreative.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.playOverworldInCreative.BackColor = System.Drawing.Color.Transparent;
this.playOverworldInCreative.ForeColor = System.Drawing.SystemColors.Window;
this.playOverworldInCreative.Name = "playOverworldInCreative";
this.playOverworldInCreative.Theme = MetroFramework.MetroThemeStyle.Dark;
@@ -281,6 +281,7 @@ namespace PckStudio.Forms.Editor
//
resources.ApplyResources(this.compressionUpDown, "compressionUpDown");
this.compressionUpDown.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.compressionUpDown.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.compressionUpDown.ForeColor = System.Drawing.SystemColors.Window;
this.compressionUpDown.Maximum = new decimal(new int[] {
9,
@@ -319,7 +320,6 @@ namespace PckStudio.Forms.Editor
this.MinimizeBox = false;
this.Name = "AudioEditor";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.AudioEditor_FormClosing);
this.Shown += new System.EventHandler(this.AudioEditor_Shown);
this.contextMenuStrip1.ResumeLayout(false);
this.menuStrip.ResumeLayout(false);
this.menuStrip.PerformLayout();

View File

@@ -24,7 +24,6 @@ namespace PckStudio.Forms.Editor
public partial class AudioEditor : EditorForm<PckAudioFile>
{
public string defaultType = "yes";
MainForm parent = null;
private static readonly List<string> Categories = new List<string>
{
@@ -53,15 +52,14 @@ namespace PckStudio.Forms.Editor
SetUpTree();
}
private string GetCategoryFromId(PckAudioFile.AudioCategory.EAudioType categoryId)
=> categoryId >= PckAudioFile.AudioCategory.EAudioType.Overworld &&
categoryId <= PckAudioFile.AudioCategory.EAudioType.BuildOff
private string GetCategoryFromId(PckAudioFile.Category categoryId)
=> Enum.IsDefined(typeof(PckAudioFile.Category), categoryId)
? Categories[(int)categoryId]
: "Not valid";
private PckAudioFile.AudioCategory.EAudioType GetCategoryId(string category)
private PckAudioFile.Category GetCategoryId(string category)
{
return (PckAudioFile.AudioCategory.EAudioType)Categories.IndexOf(category);
return (PckAudioFile.Category)Categories.IndexOf(category);
}
public void SetUpTree()
@@ -76,10 +74,10 @@ namespace PckStudio.Forms.Editor
foreach (string songname in category.SongNames.FindAll(s => s.Contains('\\')))
category.SongNames[category.SongNames.IndexOf(songname)] = songname.Replace('\\', '/');
if (category.AudioType == PckAudioFile.AudioCategory.EAudioType.Creative)
if (category.AudioType == PckAudioFile.Category.Creative)
{
if (category.Name == "include_overworld" &&
EditorValue.TryGetCategory(PckAudioFile.AudioCategory.EAudioType.Overworld, out PckAudioFile.AudioCategory overworldCategory))
EditorValue.TryGetCategory(PckAudioFile.Category.Overworld, out PckAudioFile.AudioCategory overworldCategory))
{
foreach (var name in category.SongNames.ToList())
{
@@ -95,7 +93,7 @@ namespace PckStudio.Forms.Editor
treeNode.Tag = category;
treeView1.Nodes.Add(treeNode);
}
playOverworldInCreative.Enabled = EditorValue.HasCategory(PckAudioFile.AudioCategory.EAudioType.Creative);
playOverworldInCreative.Enabled = EditorValue.HasCategory(PckAudioFile.Category.Creative);
treeView1.EndUpdate();
}
@@ -105,9 +103,7 @@ namespace PckStudio.Forms.Editor
return;
TreeNode entry = treeView2.SelectedNode;
if (!parent.CreateDataFolder())
return;
string fileName = Path.Combine(parent.GetDataPath(), entry.Text + ".binka");
string fileName = Path.Combine(entry.Text + ".binka");
if (File.Exists(fileName))
MessageBox.Show(this, $"\"{entry.Text}.binka\" exists in the \"Data\" folder", "File found");
@@ -144,7 +140,7 @@ namespace PckStudio.Forms.Editor
EditorValue.AddCategory(GetCategoryId(add.SelectedItem));
PckAudioFile.AudioCategory category = EditorValue.GetCategory(GetCategoryId(add.SelectedItem));
if (GetCategoryId(add.SelectedItem) == PckAudioFile.AudioCategory.EAudioType.Creative)
if (GetCategoryId(add.SelectedItem) == PckAudioFile.Category.Creative)
{
playOverworldInCreative.Visible = true;
playOverworldInCreative.Checked = false;
@@ -161,9 +157,6 @@ namespace PckStudio.Forms.Editor
{
if (treeView1.SelectedNode is TreeNode t && t.Tag is PckAudioFile.AudioCategory)
{
if (!parent.CreateDataFolder())
return;
OpenFileDialog ofn = new OpenFileDialog();
ofn.Multiselect = true;
ofn.Filter = "Supported audio files (*.binka,*.wav)|*.binka;*.wav";
@@ -183,7 +176,7 @@ namespace PckStudio.Forms.Editor
if (treeView1.SelectedNode is TreeNode main &&
EditorValue.RemoveCategory(GetCategoryId(treeView1.SelectedNode.Text)))
{
if(GetCategoryId(treeView1.SelectedNode.Text) == PckAudioFile.AudioCategory.EAudioType.Creative)
if(GetCategoryId(treeView1.SelectedNode.Text) == PckAudioFile.Category.Creative)
{
playOverworldInCreative.Visible = false;
playOverworldInCreative.Checked = false;
@@ -236,7 +229,7 @@ namespace PckStudio.Forms.Editor
if (File.Exists(cacheSongFile))
File.Delete(cacheSongFile);
string new_loc = Path.Combine(parent.GetDataPath(), songName + ".binka");
string new_loc = Path.Combine(songName + ".binka");
bool is_duplicate_file = false; // To handle if a file already in the pack is dropped back in
bool loc_is_occupied = File.Exists(new_loc);
if (loc_is_occupied)
@@ -348,24 +341,21 @@ namespace PckStudio.Forms.Editor
// Gets the MainForm so we can access the Save Location
if (treeView1.SelectedNode != null)
{
if (!parent.CreateDataFolder())
return;
ProcessEntries((string[])e.Data.GetData(DataFormats.FileDrop, false));
}
}
private void saveToolStripMenuItem1_Click(object sender, EventArgs e)
{
if (!EditorValue.HasCategory(PckAudioFile.AudioCategory.EAudioType.Overworld) ||
!EditorValue.HasCategory(PckAudioFile.AudioCategory.EAudioType.Nether) ||
!EditorValue.HasCategory(PckAudioFile.AudioCategory.EAudioType.End))
if (!EditorValue.HasCategory(PckAudioFile.Category.Overworld) ||
!EditorValue.HasCategory(PckAudioFile.Category.Nether) ||
!EditorValue.HasCategory(PckAudioFile.Category.End))
{
MessageBox.Show(this, "Your changes were not saved. The game will crash when loading your pack if the Overworld, Nether and End categories don't all exist with at least one valid song.", "Mandatory Categories Missing");
return;
}
PckAudioFile.AudioCategory overworldCategory = EditorValue.GetCategory(PckAudioFile.AudioCategory.EAudioType.Overworld);
PckAudioFile.AudioCategory overworldCategory = EditorValue.GetCategory(PckAudioFile.Category.Overworld);
bool songs_missing = false;
foreach (PckAudioFile.AudioCategory category in EditorValue.Categories)
@@ -378,7 +368,7 @@ namespace PckStudio.Forms.Editor
foreach(var song in category.SongNames)
{
string fileName = Path.Combine(parent.GetDataPath(), song + ".binka");
string fileName = Path.Combine(song + ".binka");
if (!File.Exists(fileName))
{
songs_missing = true;
@@ -387,7 +377,7 @@ namespace PckStudio.Forms.Editor
}
category.Name = "";
if (playOverworldInCreative.Checked && category.AudioType == PckAudioFile.AudioCategory.EAudioType.Creative)
if (playOverworldInCreative.Checked && category.AudioType == PckAudioFile.Category.Creative)
{
foreach (var name in overworldCategory.SongNames)
{
@@ -437,10 +427,8 @@ namespace PckStudio.Forms.Editor
totalSongList.Add(song);
}
if (!parent.CreateDataFolder())
return;
int totalDeleted = 0;
foreach (string song in Directory.GetFiles(parent.GetDataPath(), "*.binka"))
foreach (string song in Directory.GetFiles("*.binka"))
{
if (!totalSongList.Contains(Path.GetFileNameWithoutExtension(song)))
{
@@ -498,24 +486,11 @@ namespace PckStudio.Forms.Editor
private void openDataFolderToolStripMenuItem_Click(object sender, EventArgs e)
{
if (!parent.CreateDataFolder())
return;
Process.Start("explorer.exe", parent.GetDataPath());
}
private void AudioEditor_Shown(object sender, EventArgs e)
{
if (Owner.Owner is MainForm p)
parent = p;
else
Close();
//Process.Start("explorer.exe", parent.GetDataPath());
}
private async void bulkReplaceExistingFilesToolStripMenuItem_Click(object sender, EventArgs e)
{
if (!parent.CreateDataFolder())
return;
int exitCode = 0;
@@ -540,7 +515,7 @@ namespace PckStudio.Forms.Editor
{
string song_name = Path.GetFileNameWithoutExtension(file);
string file_ext = Path.GetExtension(file).ToLower();
string new_loc = Path.Combine(parent.GetDataPath(), Path.GetFileNameWithoutExtension(file) + ".binka");
string new_loc = Path.Combine(Path.GetFileNameWithoutExtension(file) + ".binka");
if (!totalSongList.Contains(song_name) || file == new_loc)
continue;
@@ -566,7 +541,7 @@ namespace PckStudio.Forms.Editor
continue;
}
else if(file_ext == ".binka")
File.Copy(file, Path.Combine(parent.GetDataPath(), Path.GetFileName(file)));
File.Copy(file, Path.Combine(Path.GetFileName(file)));
}
}
@@ -574,7 +549,7 @@ namespace PckStudio.Forms.Editor
{
if (treeView2.SelectedNode != null && treeView1.SelectedNode.Tag is PckAudioFile.AudioCategory)
{
Binka.ToWav(Path.Combine(parent.GetDataPath(), treeView2.SelectedNode.Text + ".binka"), Path.Combine(parent.GetDataPath()));
//Binka.ToWav(Path.Combine(treeView2.SelectedNode.Text + ".binka"), Path.Combine(parent.GetDataPath()));
}
}
@@ -593,7 +568,7 @@ namespace PckStudio.Forms.Editor
EditorValue.RemoveCategory(category.AudioType);
EditorValue.AddCategory(category.AudioType == PckAudioFile.AudioCategory.EAudioType.Overworld && playOverworldInCreative.Checked ? "include_overworld" : "", GetCategoryId(add.SelectedItem), category.ParameterType);
EditorValue.AddCategory(category.AudioType == PckAudioFile.Category.Overworld && playOverworldInCreative.Checked ? "include_overworld" : "", GetCategoryId(add.SelectedItem), category.ParameterType);
PckAudioFile.AudioCategory newCategory = EditorValue.GetCategory(GetCategoryId(add.SelectedItem));
@@ -611,16 +586,16 @@ namespace PckStudio.Forms.Editor
{
if(MessageBox.Show(this, "This function will move all binka files in the \"Data\" folder into a \"Music\" folder, to keep your data better organized. Would you like to continue?", "Move tracks?", MessageBoxButtons.YesNo) == DialogResult.Yes)
{
if (treeView1.Nodes.Count < 1 || !parent.CreateDataFolder())
if (treeView1.Nodes.Count < 1)
return;
string musicdir = Path.Combine(parent.GetDataPath(), "Music");
string musicdir = Path.Combine("Music");
Directory.CreateDirectory(musicdir);
foreach (PckAudioFile.AudioCategory category in EditorValue.Categories)
{
for (var i = 0; i < category.SongNames.Count; i++) // using standard for loop so the list can be modified
{
string song = category.SongNames[i];
string songpath = Path.Combine(parent.GetDataPath(), song + ".binka");
string songpath = Path.Combine(song + ".binka");
string new_path = Path.Combine(musicdir, Path.GetFileName(song) + ".binka");
if (File.Exists(songpath) && !File.Exists(new_path))
{

View File

@@ -125,32 +125,6 @@
<value>127, 8</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="addCategoryStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
vAAADrwBlbxySQAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xMkMEa+wAAABSSURBVDhP5c0x
DsAgDENRxt7/wmkNSpRGf0CCCZAegxNMM7MlGMp3dIU6dxhKf/QMNxRogeQC8ivw5Vn7C0heJlFA+kL5
jWAohxRkde4wnGftBS90axNmphIGAAAAAElFTkSuQmCC
</value>
</data>
<data name="addCategoryStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>168, 22</value>
</data>
<data name="addCategoryStripMenuItem.Text" xml:space="preserve">
<value>Add Category</value>
</data>
<data name="removeCategoryStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>168, 22</value>
</data>
<data name="removeCategoryStripMenuItem.Text" xml:space="preserve">
<value>Remove Category</value>
</data>
<data name="changeCategoryToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>168, 22</value>
</data>
<data name="changeCategoryToolStripMenuItem.Text" xml:space="preserve">
<value>Set Category</value>
</data>
<data name="contextMenuStrip1.Size" type="System.Drawing.Size, System.Drawing">
<value>169, 70</value>
</data>
@@ -172,7 +146,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAACK
NAAAAk1TRnQBSQFMAgEBCQEAAegBAAHoAQABEAEAARABAAT/ASEBAAj/AUIBTQE2BwABNgMAASgDAAFA
NAAAAk1TRnQBSQFMAgEBCQEAAfABAAHwAQABEAEAARABAAT/ASEBAAj/AUIBTQE2BwABNgMAASgDAAFA
AwABMAMAAQEBAAEgBgABMBIAATkBXgFzAf8BOQFeAXMB/wE5AV4BcwH/AT4BYgF8Af8BMwFUAWkB/wEz
AVQBaQH/AT4BYgF8Af8BMwFUAWkB/wE5AV4BcwH/ATkBXgFzAf8BOQFeAXMB/wEzAVQBaQH/ASYBPQFM
Af8BMwFUAWkB/wEzAVQBaQH/ATkBXgFzAf/AAAFiAZgBvAH/AWIBmAG8Af8BTQGEAZ8B/wFNAYQBnwH/
@@ -426,12 +400,68 @@
<data name="&gt;&gt;treeView1.ZOrder" xml:space="preserve">
<value>5</value>
</data>
<data name="addCategoryStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
vAAADrwBlbxySQAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xMkMEa+wAAABSSURBVDhP5c0x
DsAgDENRxt7/wmkNSpRGf0CCCZAegxNMM7MlGMp3dIU6dxhKf/QMNxRogeQC8ivw5Vn7C0heJlFA+kL5
jWAohxRkde4wnGftBS90axNmphIGAAAAAElFTkSuQmCC
</value>
</data>
<data name="addCategoryStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>168, 22</value>
</data>
<data name="addCategoryStripMenuItem.Text" xml:space="preserve">
<value>Add Category</value>
</data>
<data name="removeCategoryStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>168, 22</value>
</data>
<data name="removeCategoryStripMenuItem.Text" xml:space="preserve">
<value>Remove Category</value>
</data>
<data name="changeCategoryToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>168, 22</value>
</data>
<data name="changeCategoryToolStripMenuItem.Text" xml:space="preserve">
<value>Set Category</value>
</data>
<metadata name="menuStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>19, 8</value>
</metadata>
<data name="menuStrip.AutoSize" type="System.Boolean, mscorlib">
<value>False</value>
</data>
<data name="menuStrip.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value>
</data>
<data name="menuStrip.Size" type="System.Drawing.Size, System.Drawing">
<value>450, 24</value>
</data>
<data name="menuStrip.TabIndex" type="System.Int32, mscorlib">
<value>11</value>
</data>
<data name="menuStrip.Text" xml:space="preserve">
<value>menuStrip1</value>
</data>
<data name="&gt;&gt;menuStrip.Name" xml:space="preserve">
<value>menuStrip</value>
</data>
<data name="&gt;&gt;menuStrip.Type" xml:space="preserve">
<value>System.Windows.Forms.MenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;menuStrip.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;menuStrip.ZOrder" xml:space="preserve">
<value>7</value>
</data>
<data name="fileToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>37, 20</value>
</data>
<data name="fileToolStripMenuItem.Text" xml:space="preserve">
<value>File</value>
</data>
<data name="saveToolStripMenuItem1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
@@ -448,11 +478,11 @@
<data name="saveToolStripMenuItem1.Text" xml:space="preserve">
<value>Save</value>
</data>
<data name="fileToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>37, 20</value>
<data name="toolsToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>46, 20</value>
</data>
<data name="fileToolStripMenuItem.Text" xml:space="preserve">
<value>File</value>
<data name="toolsToolStripMenuItem.Text" xml:space="preserve">
<value>Tools</value>
</data>
<data name="deleteUnusedBINKAsToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>220, 22</value>
@@ -478,11 +508,11 @@
<data name="organizeTracksToolStripMenuItem.Text" xml:space="preserve">
<value>Organize Tracks</value>
</data>
<data name="toolsToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>46, 20</value>
<data name="helpToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>44, 20</value>
</data>
<data name="toolsToolStripMenuItem.Text" xml:space="preserve">
<value>Tools</value>
<data name="helpToolStripMenuItem.Text" xml:space="preserve">
<value>Help</value>
</data>
<data name="howToAddSongsToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>243, 22</value>
@@ -514,42 +544,42 @@
<data name="bINKACompressionToolStripMenuItem.Text" xml:space="preserve">
<value>BINKA Compression</value>
</data>
<data name="helpToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>44, 20</value>
</data>
<data name="helpToolStripMenuItem.Text" xml:space="preserve">
<value>Help</value>
</data>
<data name="menuStrip.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value>
</data>
<data name="menuStrip.Size" type="System.Drawing.Size, System.Drawing">
<value>450, 24</value>
</data>
<data name="menuStrip.TabIndex" type="System.Int32, mscorlib">
<value>11</value>
</data>
<data name="menuStrip.Text" xml:space="preserve">
<value>menuStrip1</value>
</data>
<data name="&gt;&gt;menuStrip.Name" xml:space="preserve">
<value>menuStrip</value>
</data>
<data name="&gt;&gt;menuStrip.Type" xml:space="preserve">
<value>System.Windows.Forms.MenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;menuStrip.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;menuStrip.ZOrder" xml:space="preserve">
<value>7</value>
</data>
<data name="treeView2.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Top, Bottom, Left, Right</value>
</data>
<metadata name="contextMenuStrip2.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>282, 8</value>
</metadata>
<data name="contextMenuStrip2.Size" type="System.Drawing.Size, System.Drawing">
<value>174, 92</value>
</data>
<data name="&gt;&gt;contextMenuStrip2.Name" xml:space="preserve">
<value>contextMenuStrip2</value>
</data>
<data name="&gt;&gt;contextMenuStrip2.Type" xml:space="preserve">
<value>System.Windows.Forms.ContextMenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="treeView2.Location" type="System.Drawing.Point, System.Drawing">
<value>151, 84</value>
</data>
<data name="treeView2.Size" type="System.Drawing.Size, System.Drawing">
<value>279, 208</value>
</data>
<data name="treeView2.TabIndex" type="System.Int32, mscorlib">
<value>13</value>
</data>
<data name="&gt;&gt;treeView2.Name" xml:space="preserve">
<value>treeView2</value>
</data>
<data name="&gt;&gt;treeView2.Type" xml:space="preserve">
<value>System.Windows.Forms.TreeView, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;treeView2.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;treeView2.ZOrder" xml:space="preserve">
<value>6</value>
</data>
<data name="addEntryMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
@@ -582,36 +612,6 @@
<data name="convertToWAVToolStripMenuItem.Text" xml:space="preserve">
<value>Convert To WAV</value>
</data>
<data name="contextMenuStrip2.Size" type="System.Drawing.Size, System.Drawing">
<value>174, 92</value>
</data>
<data name="&gt;&gt;contextMenuStrip2.Name" xml:space="preserve">
<value>contextMenuStrip2</value>
</data>
<data name="&gt;&gt;contextMenuStrip2.Type" xml:space="preserve">
<value>System.Windows.Forms.ContextMenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="treeView2.Location" type="System.Drawing.Point, System.Drawing">
<value>151, 84</value>
</data>
<data name="treeView2.Size" type="System.Drawing.Size, System.Drawing">
<value>279, 208</value>
</data>
<data name="treeView2.TabIndex" type="System.Int32, mscorlib">
<value>13</value>
</data>
<data name="&gt;&gt;treeView2.Name" xml:space="preserve">
<value>treeView2</value>
</data>
<data name="&gt;&gt;treeView2.Type" xml:space="preserve">
<value>System.Windows.Forms.TreeView, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;treeView2.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;treeView2.ZOrder" xml:space="preserve">
<value>6</value>
</data>
<data name="playOverworldInCreative.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
@@ -649,7 +649,7 @@
<value>310, 298</value>
</data>
<data name="compressionUpDown.Size" type="System.Drawing.Size, System.Drawing">
<value>120, 20</value>
<value>120, 16</value>
</data>
<data name="compressionUpDown.TabIndex" type="System.Int32, mscorlib">
<value>15</value>

View File

@@ -32,22 +32,22 @@ namespace PckStudio.Forms.Editor
inflationUpDown.Enabled = hasInflation;
parentComboBox.SelectedIndex = parentComboBox.Items.IndexOf(box.Type);
PosXUpDown.Value = (decimal)box.Pos.X;
PosYUpDown.Value = (decimal)box.Pos.Y;
PosZUpDown.Value = (decimal)box.Pos.Z;
PosXUpDown.Value = (decimal)box.Position.X;
PosYUpDown.Value = (decimal)box.Position.Y;
PosZUpDown.Value = (decimal)box.Position.Z;
SizeXUpDown.Value = (decimal)box.Size.X;
SizeYUpDown.Value = (decimal)box.Size.Y;
SizeZUpDown.Value = (decimal)box.Size.Z;
uvXUpDown.Value = (decimal)box.UV.X;
uvYUpDown.Value = (decimal)box.UV.Y;
uvXUpDown.Value = (decimal)box.Uv.X;
uvYUpDown.Value = (decimal)box.Uv.Y;
boxVisibilityComboBox.SelectedItem = Enum.GetName(typeof(SkinBOX.BoxVisibility), box.Visibility);
mirrorCheckBox.Checked = box.Mirror;
inflationUpDown.Value = (decimal)box.Scale;
inflationUpDown.Value = (decimal)box.Inflate;
}
private void saveButton_Click(object sender, EventArgs e)
{
SkinBOX.BoxVisibility visibility = Enum.TryParse(boxVisibilityComboBox.SelectedItem.ToString(), out SkinBOX.BoxVisibility v) ? v : default;
SkinBOX.BoxVisibility visibility = Enum.TryParse(boxVisibilityComboBox.SelectedItem?.ToString(), out SkinBOX.BoxVisibility v) ? v : default;
Vector3 pos = new Vector3((float)PosXUpDown.Value, (float)PosYUpDown.Value, (float)PosZUpDown.Value);
Vector3 size = new Vector3((float)SizeXUpDown.Value, (float)SizeYUpDown.Value, (float)SizeZUpDown.Value);
Vector2 uv = new Vector2((int)uvXUpDown.Value, (int)uvYUpDown.Value);

View File

@@ -34,8 +34,7 @@ namespace PckStudio.Forms.Editor
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(COLEditor));
this.metroPanel1 = new MetroFramework.Controls.MetroPanel();
this.metroTextBox1 = new MetroFramework.Controls.MetroTextBox();
this.metroLabel2 = new MetroFramework.Controls.MetroLabel();
this.filterPrompt = new PckStudio.Forms.Additional_Popups.Animation.FilterPrompt();
this.setColorBtn = new MetroFramework.Controls.MetroButton();
this.blueUpDown = new System.Windows.Forms.NumericUpDown();
this.greenUpDown = new System.Windows.Forms.NumericUpDown();
@@ -67,21 +66,14 @@ namespace PckStudio.Forms.Editor
this.TU54ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.TU69ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this._1_9_1ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.waterTab = new System.Windows.Forms.TabPage();
this.waterTreeView = new System.Windows.Forms.TreeView();
this.viewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.compactViewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.ColorContextMenu = new MetroFramework.Controls.MetroContextMenu(this.components);
this.copyColorToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.pasteColorToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.restoreOriginalColorToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.addColorToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.removeColorToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.underwaterTreeView = new System.Windows.Forms.TreeView();
this.fogTreeView = new System.Windows.Forms.TreeView();
this.colorsTab = new System.Windows.Forms.TabPage();
this.colorTreeView = new System.Windows.Forms.TreeView();
this.tabControl = new MetroFramework.Controls.MetroTabControl();
this.underwaterTab = new System.Windows.Forms.TabPage();
this.fogTab = new System.Windows.Forms.TabPage();
this.metroPanel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.blueUpDown)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.greenUpDown)).BeginInit();
@@ -89,18 +81,12 @@ namespace PckStudio.Forms.Editor
((System.ComponentModel.ISupportInitialize)(this.alphaUpDown)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.menuStrip.SuspendLayout();
this.waterTab.SuspendLayout();
this.ColorContextMenu.SuspendLayout();
this.colorsTab.SuspendLayout();
this.tabControl.SuspendLayout();
this.underwaterTab.SuspendLayout();
this.fogTab.SuspendLayout();
this.SuspendLayout();
//
// metroPanel1
//
this.metroPanel1.Controls.Add(this.metroTextBox1);
this.metroPanel1.Controls.Add(this.metroLabel2);
this.metroPanel1.Controls.Add(this.filterPrompt);
this.metroPanel1.Controls.Add(this.setColorBtn);
this.metroPanel1.Controls.Add(this.blueUpDown);
this.metroPanel1.Controls.Add(this.greenUpDown);
@@ -124,41 +110,13 @@ namespace PckStudio.Forms.Editor
this.metroPanel1.VerticalScrollbarHighlightOnWheel = false;
this.metroPanel1.VerticalScrollbarSize = 10;
//
// metroTextBox1
// filterPrompt
//
//
//
//
this.metroTextBox1.CustomButton.Image = ((System.Drawing.Image)(resources.GetObject("resource.Image")));
this.metroTextBox1.CustomButton.Location = ((System.Drawing.Point)(resources.GetObject("resource.Location")));
this.metroTextBox1.CustomButton.Name = "";
this.metroTextBox1.CustomButton.Size = ((System.Drawing.Size)(resources.GetObject("resource.Size")));
this.metroTextBox1.CustomButton.Style = MetroFramework.MetroColorStyle.Blue;
this.metroTextBox1.CustomButton.TabIndex = ((int)(resources.GetObject("resource.TabIndex")));
this.metroTextBox1.CustomButton.Theme = MetroFramework.MetroThemeStyle.Light;
this.metroTextBox1.CustomButton.UseSelectable = true;
this.metroTextBox1.CustomButton.Visible = ((bool)(resources.GetObject("resource.Visible")));
this.metroTextBox1.Lines = new string[0];
resources.ApplyResources(this.metroTextBox1, "metroTextBox1");
this.metroTextBox1.MaxLength = 32767;
this.metroTextBox1.Name = "metroTextBox1";
this.metroTextBox1.PasswordChar = '\0';
this.metroTextBox1.ScrollBars = System.Windows.Forms.ScrollBars.None;
this.metroTextBox1.SelectedText = "";
this.metroTextBox1.SelectionLength = 0;
this.metroTextBox1.SelectionStart = 0;
this.metroTextBox1.ShortcutsEnabled = true;
this.metroTextBox1.Theme = MetroFramework.MetroThemeStyle.Dark;
this.metroTextBox1.UseSelectable = true;
this.metroTextBox1.WaterMarkColor = System.Drawing.Color.FromArgb(((int)(((byte)(109)))), ((int)(((byte)(109)))), ((int)(((byte)(109)))));
this.metroTextBox1.WaterMarkFont = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Pixel);
this.metroTextBox1.TextChanged += new System.EventHandler(this.metroTextBox1_TextChanged);
//
// metroLabel2
//
resources.ApplyResources(this.metroLabel2, "metroLabel2");
this.metroLabel2.Name = "metroLabel2";
this.metroLabel2.Theme = MetroFramework.MetroThemeStyle.Dark;
this.filterPrompt.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(18)))), ((int)(((byte)(18)))), ((int)(((byte)(18)))));
this.filterPrompt.ForeColor = System.Drawing.SystemColors.Control;
resources.ApplyResources(this.filterPrompt, "filterPrompt");
this.filterPrompt.Name = "filterPrompt";
this.filterPrompt.OnSelectedItemChanged += new System.EventHandler(this.filterPrompt_OnSelectedItemChanged);
//
// setColorBtn
//
@@ -247,16 +205,16 @@ namespace PckStudio.Forms.Editor
//
//
//
this.colorTextbox.CustomButton.Image = ((System.Drawing.Image)(resources.GetObject("resource.Image1")));
this.colorTextbox.CustomButton.Image = ((System.Drawing.Image)(resources.GetObject("resource.Image")));
this.colorTextbox.CustomButton.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("resource.ImeMode")));
this.colorTextbox.CustomButton.Location = ((System.Drawing.Point)(resources.GetObject("resource.Location1")));
this.colorTextbox.CustomButton.Location = ((System.Drawing.Point)(resources.GetObject("resource.Location")));
this.colorTextbox.CustomButton.Name = "";
this.colorTextbox.CustomButton.Size = ((System.Drawing.Size)(resources.GetObject("resource.Size1")));
this.colorTextbox.CustomButton.Size = ((System.Drawing.Size)(resources.GetObject("resource.Size")));
this.colorTextbox.CustomButton.Style = MetroFramework.MetroColorStyle.Blue;
this.colorTextbox.CustomButton.TabIndex = ((int)(resources.GetObject("resource.TabIndex1")));
this.colorTextbox.CustomButton.TabIndex = ((int)(resources.GetObject("resource.TabIndex")));
this.colorTextbox.CustomButton.Theme = MetroFramework.MetroThemeStyle.Light;
this.colorTextbox.CustomButton.UseSelectable = true;
this.colorTextbox.CustomButton.Visible = ((bool)(resources.GetObject("resource.Visible1")));
this.colorTextbox.CustomButton.Visible = ((bool)(resources.GetObject("resource.Visible")));
this.colorTextbox.Lines = new string[0];
resources.ApplyResources(this.colorTextbox, "colorTextbox");
this.colorTextbox.MaxLength = 6;
@@ -293,7 +251,8 @@ namespace PckStudio.Forms.Editor
this.menuStrip.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.menuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.fileToolStripMenuItem,
this.toolsToolStripMenuItem});
this.toolsToolStripMenuItem,
this.viewToolStripMenuItem});
this.menuStrip.Name = "menuStrip";
//
// fileToolStripMenuItem
@@ -409,22 +368,21 @@ namespace PckStudio.Forms.Editor
this._1_9_1ToolStripMenuItem.Name = "_1_9_1ToolStripMenuItem";
resources.ApplyResources(this._1_9_1ToolStripMenuItem, "_1_9_1ToolStripMenuItem");
//
// waterTab
// viewToolStripMenuItem
//
this.waterTab.BackColor = System.Drawing.SystemColors.WindowFrame;
this.waterTab.Controls.Add(this.waterTreeView);
resources.ApplyResources(this.waterTab, "waterTab");
this.waterTab.Name = "waterTab";
this.viewToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.compactViewToolStripMenuItem});
this.viewToolStripMenuItem.ForeColor = System.Drawing.Color.White;
this.viewToolStripMenuItem.Name = "viewToolStripMenuItem";
resources.ApplyResources(this.viewToolStripMenuItem, "viewToolStripMenuItem");
//
// waterTreeView
// compactViewToolStripMenuItem
//
this.waterTreeView.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.waterTreeView.ContextMenuStrip = this.ColorContextMenu;
resources.ApplyResources(this.waterTreeView, "waterTreeView");
this.waterTreeView.ForeColor = System.Drawing.Color.White;
this.waterTreeView.Name = "waterTreeView";
this.waterTreeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeView2_AfterSelect);
this.waterTreeView.KeyDown += new System.Windows.Forms.KeyEventHandler(this.treeView2_KeyDown);
this.compactViewToolStripMenuItem.BackColor = System.Drawing.SystemColors.Control;
this.compactViewToolStripMenuItem.CheckOnClick = true;
this.compactViewToolStripMenuItem.Name = "compactViewToolStripMenuItem";
resources.ApplyResources(this.compactViewToolStripMenuItem, "compactViewToolStripMenuItem");
this.compactViewToolStripMenuItem.CheckStateChanged += new System.EventHandler(this.compactViewToolStripMenuItem_CheckStateChanged);
//
// ColorContextMenu
//
@@ -472,76 +430,11 @@ namespace PckStudio.Forms.Editor
resources.ApplyResources(this.removeColorToolStripMenuItem, "removeColorToolStripMenuItem");
this.removeColorToolStripMenuItem.Click += new System.EventHandler(this.removeColorToolStripMenuItem_Click);
//
// underwaterTreeView
//
this.underwaterTreeView.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.underwaterTreeView.ContextMenuStrip = this.ColorContextMenu;
this.underwaterTreeView.ForeColor = System.Drawing.Color.White;
resources.ApplyResources(this.underwaterTreeView, "underwaterTreeView");
this.underwaterTreeView.Name = "underwaterTreeView";
this.underwaterTreeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeView3_AfterSelect);
this.underwaterTreeView.KeyDown += new System.Windows.Forms.KeyEventHandler(this.treeView3_KeyDown);
//
// fogTreeView
//
this.fogTreeView.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.fogTreeView.ContextMenuStrip = this.ColorContextMenu;
this.fogTreeView.ForeColor = System.Drawing.Color.White;
resources.ApplyResources(this.fogTreeView, "fogTreeView");
this.fogTreeView.Name = "fogTreeView";
this.fogTreeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeView4_AfterSelect);
this.fogTreeView.KeyDown += new System.Windows.Forms.KeyEventHandler(this.treeView4_KeyDown);
//
// colorsTab
//
this.colorsTab.BackColor = System.Drawing.SystemColors.WindowFrame;
this.colorsTab.Controls.Add(this.colorTreeView);
resources.ApplyResources(this.colorsTab, "colorsTab");
this.colorsTab.Name = "colorsTab";
//
// colorTreeView
//
this.colorTreeView.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.colorTreeView.ContextMenuStrip = this.ColorContextMenu;
resources.ApplyResources(this.colorTreeView, "colorTreeView");
this.colorTreeView.ForeColor = System.Drawing.Color.White;
this.colorTreeView.Name = "colorTreeView";
this.colorTreeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeView1_AfterSelect);
this.colorTreeView.KeyDown += new System.Windows.Forms.KeyEventHandler(this.treeView1_KeyDown);
//
// tabControl
//
resources.ApplyResources(this.tabControl, "tabControl");
this.tabControl.Controls.Add(this.colorsTab);
this.tabControl.Controls.Add(this.waterTab);
this.tabControl.Controls.Add(this.underwaterTab);
this.tabControl.Controls.Add(this.fogTab);
this.tabControl.Name = "tabControl";
this.tabControl.SelectedIndex = 0;
this.tabControl.Style = MetroFramework.MetroColorStyle.White;
this.tabControl.Theme = MetroFramework.MetroThemeStyle.Dark;
this.tabControl.UseSelectable = true;
//
// underwaterTab
//
this.underwaterTab.BackColor = System.Drawing.SystemColors.WindowFrame;
this.underwaterTab.Controls.Add(this.underwaterTreeView);
resources.ApplyResources(this.underwaterTab, "underwaterTab");
this.underwaterTab.Name = "underwaterTab";
//
// fogTab
//
this.fogTab.BackColor = System.Drawing.SystemColors.WindowFrame;
this.fogTab.Controls.Add(this.fogTreeView);
resources.ApplyResources(this.fogTab, "fogTab");
this.fogTab.Name = "fogTab";
//
// COLEditor
//
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.menuStrip);
this.Controls.Add(this.tabControl);
this.Controls.Add(this.metroPanel1);
this.ForeColor = System.Drawing.SystemColors.ControlText;
this.Name = "COLEditor";
@@ -554,12 +447,7 @@ namespace PckStudio.Forms.Editor
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.menuStrip.ResumeLayout(false);
this.menuStrip.PerformLayout();
this.waterTab.ResumeLayout(false);
this.ColorContextMenu.ResumeLayout(false);
this.colorsTab.ResumeLayout(false);
this.tabControl.ResumeLayout(false);
this.underwaterTab.ResumeLayout(false);
this.fogTab.ResumeLayout(false);
this.ResumeLayout(false);
}
@@ -567,10 +455,6 @@ namespace PckStudio.Forms.Editor
#endregion
private MetroFramework.Controls.MetroPanel metroPanel1;
private TreeView colorTreeView;
private TreeView waterTreeView;
private TreeView fogTreeView;
private TreeView underwaterTreeView;
private System.Windows.Forms.PictureBox pictureBox1;
private System.Windows.Forms.MenuStrip menuStrip;
private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem;
@@ -580,12 +464,7 @@ namespace PckStudio.Forms.Editor
private MetroFramework.Controls.MetroLabel redLabel;
private MetroFramework.Controls.MetroLabel alphaLabel;
private System.Windows.Forms.NumericUpDown alphaUpDown;
private TabPage waterTab;
private TabPage colorsTab;
private MetroFramework.Controls.MetroTabControl tabControl;
private MetroFramework.Controls.MetroButton setColorBtn;
private TabPage underwaterTab;
private TabPage fogTab;
private NumericUpDown blueUpDown;
private NumericUpDown greenUpDown;
private NumericUpDown redUpDown;
@@ -593,8 +472,6 @@ namespace PckStudio.Forms.Editor
private MetroFramework.Controls.MetroLabel metroLabel1;
private MetroFramework.Controls.MetroContextMenu ColorContextMenu;
private ToolStripMenuItem restoreOriginalColorToolStripMenuItem;
private MetroFramework.Controls.MetroTextBox metroTextBox1;
private MetroFramework.Controls.MetroLabel metroLabel2;
private ToolStripMenuItem copyColorToolStripMenuItem;
private ToolStripMenuItem pasteColorToolStripMenuItem;
private ToolStripMenuItem toolsToolStripMenuItem;
@@ -615,5 +492,8 @@ namespace PckStudio.Forms.Editor
private ToolStripMenuItem stripPS4BiomesToolStripMenuItem;
private ToolStripMenuItem addColorToolStripMenuItem;
private ToolStripMenuItem removeColorToolStripMenuItem;
private Additional_Popups.Animation.FilterPrompt filterPrompt;
private ToolStripMenuItem viewToolStripMenuItem;
private ToolStripMenuItem compactViewToolStripMenuItem;
}
}

View File

@@ -4,29 +4,28 @@ using System.Drawing;
using System.IO;
using System.Linq;
using System.Windows.Forms;
using MetroFramework.Forms;
using OMI.Formats.Color;
using OMI.Formats.Pck;
using OMI.Workers.Color;
using PckStudio.Core.Extensions;
using PckStudio.Core.Colors;
using PckStudio.Properties;
using PckStudio.Controls;
using PckStudio.Interfaces;
using System.Collections.ObjectModel;
namespace PckStudio.Forms.Editor
{
public partial class COLEditor : EditorForm<ColorContainer>
{
ColorContainer _defaultColourfile;
public partial class COLEditor : EditorForm<AbstractColorContainer>
{
AbstractColorContainer _defaultColourfile;
string _clipboard_color = "#FFFFFF";
List<TreeNode> colorCache = new List<TreeNode>();
List<TreeNode> waterCache = new List<TreeNode>();
List<TreeNode> underwaterCache = new List<TreeNode>();
List<TreeNode> fogCache = new List<TreeNode>();
TreeView colorTreeView;
TreeView waterTreeView;
TreeView underwaterTreeView;
TreeView fogTreeView;
private static readonly ICollection<string> PS4Biomes = new List<string>
private static readonly ICollection<string> PS4BiomeColors = new List<string>
{
"bamboo_jungle",
"bamboo_jungle_hills",
@@ -35,624 +34,372 @@ namespace PckStudio.Forms.Editor
"mega_taiga_mutated"
};
public COLEditor(ColorContainer colorContainer, ISaveContext<ColorContainer> saveContext)
: base(colorContainer, saveContext)
{
InitializeComponent();
saveToolStripMenuItem1.Visible = !saveContext.AutoSave;
TU12ToolStripMenuItem.Click += (sender, e) => SetUpDefaultFile(sender, e, 0);
TU13ToolStripMenuItem.Click += (sender, e) => SetUpDefaultFile(sender, e, 1);
TU14ToolStripMenuItem.Click += (sender, e) => SetUpDefaultFile(sender, e, 2);
TU19ToolStripMenuItem.Click += (sender, e) => SetUpDefaultFile(sender, e, 3);
TU31ToolStripMenuItem.Click += (sender, e) => SetUpDefaultFile(sender, e, 4);
TU32ToolStripMenuItem.Click += (sender, e) => SetUpDefaultFile(sender, e, 5);
TU43ToolStripMenuItem.Click += (sender, e) => SetUpDefaultFile(sender, e, 6);
TU46ToolStripMenuItem.Click += (sender, e) => SetUpDefaultFile(sender, e, 7);
TU51ToolStripMenuItem.Click += (sender, e) => SetUpDefaultFile(sender, e, 8);
TU53ToolStripMenuItem.Click += (sender, e) => SetUpDefaultFile(sender, e, 9);
TU54ToolStripMenuItem.Click += (sender, e) => SetUpDefaultFile(sender, e, 10);
TU69ToolStripMenuItem.Click += (sender, e) => SetUpDefaultFile(sender, e, 11);
_1_9_1ToolStripMenuItem.Click += (sender, e) => SetUpDefaultFile(sender, e, 12);
SetUpDefaultFile(null, EventArgs.Empty, 11, false);
colorTreeView.Select();
colorTreeView.SelectedNode = colorTreeView.Nodes[0];
}
private void SetUpDefaultFile(object sender, EventArgs e, int id, bool showMessageBox = true)
{
if (showMessageBox)
{
DialogResult result = MessageBox.Show(this, "This function will set up your colour table to match that of the chosen version. You may lose some entries in the table. Are you sure you would like to continue?", "Target update version?", MessageBoxButtons.YesNo);
if (result == DialogResult.No)
return;
}
byte[] colorData = id switch
{
0 => Resources.tu12colours,
1 => Resources.tu13colours,
2 => Resources.tu14colours,
3 => Resources.tu19colours,
4 => Resources.tu31colours,
5 => Resources.tu32colours,
6 => Resources.tu43colours,
7 => Resources.tu46colours,
8 => Resources.tu51colours,
9 => Resources.tu53colours,
10 => Resources.tu54colours,
11 => Resources.tu69colours,
12 => Resources._1_91_colours,
_ => throw new ArgumentOutOfRangeException(nameof(id)),
};
var reader = new COLFileReader();
using (var stream = new MemoryStream(colorData))
{
_defaultColourfile = reader.FromStream(stream);
}
SetUpTable(showMessageBox);
}
void AddEntry(TreeView treeView, List<TreeNode> cache, string name, object tag)
public COLEditor(AbstractColorContainer colorContainer, ISaveContext<AbstractColorContainer> saveContext)
: base(colorContainer, saveContext)
{
TreeNode tn = new TreeNode(name);
tn.Tag = tag;
treeView.Nodes.Add(tn);
cache.Add(tn);
}
InitializeComponent();
void RemoveEntry(TreeNode entry, List<TreeNode> cache)
{
cache.Remove(entry);
entry.Remove();
saveToolStripMenuItem1.Visible = !saveContext.AutoSave;
TU12ToolStripMenuItem.Click += (sender, e) => SetUpDefaultFile(sender, e, 0);
TU13ToolStripMenuItem.Click += (sender, e) => SetUpDefaultFile(sender, e, 1);
TU14ToolStripMenuItem.Click += (sender, e) => SetUpDefaultFile(sender, e, 2);
TU19ToolStripMenuItem.Click += (sender, e) => SetUpDefaultFile(sender, e, 3);
TU31ToolStripMenuItem.Click += (sender, e) => SetUpDefaultFile(sender, e, 4);
TU32ToolStripMenuItem.Click += (sender, e) => SetUpDefaultFile(sender, e, 5);
TU43ToolStripMenuItem.Click += (sender, e) => SetUpDefaultFile(sender, e, 6);
TU46ToolStripMenuItem.Click += (sender, e) => SetUpDefaultFile(sender, e, 7);
TU51ToolStripMenuItem.Click += (sender, e) => SetUpDefaultFile(sender, e, 8);
TU53ToolStripMenuItem.Click += (sender, e) => SetUpDefaultFile(sender, e, 9);
TU54ToolStripMenuItem.Click += (sender, e) => SetUpDefaultFile(sender, e, 10);
TU69ToolStripMenuItem.Click += (sender, e) => SetUpDefaultFile(sender, e, 11);
_1_9_1ToolStripMenuItem.Click += (sender, e) => SetUpDefaultFile(sender, e, 12);
colorTreeView = filterPrompt.AddFilterPage("All", null, null);
waterTreeView = filterPrompt.AddFilterPage("Water", null, null);
underwaterTreeView = filterPrompt.AddFilterPage("Underwater", null, null);
fogTreeView = filterPrompt.AddFilterPage("Fog", null, null);
colorTreeView.KeyDown += treeView1_KeyDown;
waterTreeView.KeyDown += treeView1_KeyDown;
underwaterTreeView.KeyDown += treeView1_KeyDown;
fogTreeView.KeyDown += treeView1_KeyDown;
colorTreeView.ContextMenuStrip = ColorContextMenu;
waterTreeView.ContextMenuStrip = ColorContextMenu;
underwaterTreeView.ContextMenuStrip = ColorContextMenu;
fogTreeView.ContextMenuStrip = ColorContextMenu;
BuildTreeViews(EditorValue);
}
void SetUpTable(bool targetVersion)
{
colorTreeView.Nodes.Clear();
waterTreeView.Nodes.Clear();
underwaterTreeView.Nodes.Clear();
fogTreeView.Nodes.Clear();
private void BuildTreeViews(AbstractColorContainer c)
{
colorTreeView.Nodes.Clear();
waterTreeView.Nodes.Clear();
underwaterTreeView.Nodes.Clear();
fogTreeView.Nodes.Clear();
int nodeDepth = Convert.ToInt32(compactViewToolStripMenuItem.Checked);
ColorContainer temp = targetVersion ? _defaultColourfile : EditorValue;
List<string> currentEntries = new List<string>();
colorCache.Clear();
fogCache.Clear();
underwaterCache.Clear();
waterCache.Clear();
// fixes the duplicate entry bug
if (targetVersion)
foreach (KeyValuePair<string, Color> col in c.Colors)
{
foreach(ColorContainer.Color col in EditorValue.Colors)
{
if (_defaultColourfile.Colors.Find(c => c.Name == col.Name) == null)
continue;
currentEntries.Add(col.Name);
AddEntry(colorTreeView, colorCache, col.Name, col);
}
TreeNode n = colorTreeView.Nodes.BuildNodeTreeBySeperator(col.Key, '_', nodeDepth);
n.Tag = col;
}
foreach (ColorContainer.Color col in temp.Colors)
{
ColorContainer.Color entry = EditorValue.Colors.Find(color => color.Name == col.Name);
if (currentEntries.Contains(col.Name))
continue;
ColorContainer.Color color = entry ?? col;
AddEntry(colorTreeView, colorCache, color.Name, color);
}
currentEntries.Clear();
foreach (KeyValuePair<string, (Color surface, Color underwater, Color fog)> col in c.WaterColors)
{
waterTreeView.Nodes.BuildNodeTreeBySeperator(col.Key, '_', 0).Tag = col;
underwaterTreeView.Nodes.BuildNodeTreeBySeperator(col.Key, '_', 0).Tag = col;
fogTreeView.Nodes.BuildNodeTreeBySeperator(col.Key, '_', 0).Tag = col;
}
// fixes the duplicate entry bug
if (targetVersion)
{
foreach (ColorContainer.WaterColor col in EditorValue.WaterColors)
{
if (_defaultColourfile.WaterColors.Find(c => c.Name == col.Name) == null)
continue;
ColorContainer.WaterColor entry = EditorValue.WaterColors.Find(color => color.Name == col.Name);
ColorContainer.WaterColor color = entry ?? col;
AddEntry(waterTreeView, waterCache, color.Name, color);
AddEntry(underwaterTreeView, underwaterCache, color.Name, color);
AddEntry(fogTreeView, fogCache, color.Name, color);
}
}
filterPrompt.Update();
}
foreach (ColorContainer.WaterColor col in temp.WaterColors)
{
ColorContainer.WaterColor entry = EditorValue.WaterColors.Find(color => color.Name == col.Name);
if (currentEntries.Contains(col.Name))
continue;
ColorContainer.WaterColor color = entry ?? col;
AddEntry(waterTreeView, waterCache, color.Name, color);
AddEntry(underwaterTreeView, underwaterCache, color.Name, color);
AddEntry(fogTreeView, fogCache, color.Name, color);
}
// force the filter function to run to carry filter over and fix treeview size
metroTextBox1_TextChanged(null, null);
}
void SetUpValueChanged(bool add)
{
if(add)
{
redUpDown.ValueChanged += color_ValueChanged;
greenUpDown.ValueChanged += color_ValueChanged;
blueUpDown.ValueChanged += color_ValueChanged;
}
else
{
redUpDown.ValueChanged -= color_ValueChanged;
greenUpDown.ValueChanged -= color_ValueChanged;
blueUpDown.ValueChanged -= color_ValueChanged;
}
}
private void treeView1_AfterSelect(object sender, TreeViewEventArgs e)
{
if (colorTreeView.SelectedNode.Tag == null)
return;
addColorToolStripMenuItem.Visible = true;
removeColorToolStripMenuItem.Visible = true;
waterTreeView.SelectedNode = null;
underwaterTreeView.SelectedNode = null;
fogTreeView.SelectedNode = null;
var colorEntry = (ColorContainer.Color)colorTreeView.SelectedNode.Tag;
Color color = colorEntry.ColorPallette;
SetUpValueChanged(false);
alphaUpDown.Visible = false;
alphaLabel.Visible = false;
redUpDown.Value = color.R;
greenUpDown.Value = color.G;
blueUpDown.Value = color.B;
pictureBox1.BackColor = Color.FromArgb(0xff, color);
colorTextbox.Text = ColorTranslator.ToHtml(colorEntry.ColorPallette).TrimStart('#');
SetUpValueChanged(true);
}
private void treeView2_AfterSelect(object sender, TreeViewEventArgs e)
private void SetUpDefaultFile(object sender, EventArgs e, int id, bool showMessageBox = true)
{
if (waterTreeView.SelectedNode.Tag == null)
return;
if (showMessageBox)
{
DialogResult result = MessageBox.Show(this, "This function will set up your colour table to match that of the chosen version. You may lose some entries in the table. Are you sure you would like to continue?", "Target update version?", MessageBoxButtons.YesNo);
if (result == DialogResult.No)
return;
}
addColorToolStripMenuItem.Visible = false;
removeColorToolStripMenuItem.Visible = false;
byte[] colorData = id switch
{
0 => Resources.tu12colours,
1 => Resources.tu13colours,
2 => Resources.tu14colours,
3 => Resources.tu19colours,
4 => Resources.tu31colours,
5 => Resources.tu32colours,
6 => Resources.tu43colours,
7 => Resources.tu46colours,
8 => Resources.tu51colours,
9 => Resources.tu53colours,
10 => Resources.tu54colours,
11 => Resources.tu69colours,
12 => Resources._1_91_colours,
_ => throw new ArgumentOutOfRangeException(nameof(id)),
};
var reader = new COLFileReader();
using (var stream = new MemoryStream(colorData))
{
_defaultColourfile = AbstractColorContainer.FromColorContainer(reader.FromStream(stream));
}
colorTreeView.SelectedNode = null;
underwaterTreeView.SelectedNode = null;
fogTreeView.SelectedNode = null;
BuildTreeViews(_defaultColourfile);
}
var colorEntry = (ColorContainer.WaterColor)waterTreeView.SelectedNode.Tag;
Color color = colorEntry.SurfaceColor;
SetUpValueChanged(false);
alphaUpDown.Value = color.A;
redUpDown.Value = color.R;
greenUpDown.Value = color.G;
blueUpDown.Value = color.B;
void SetUpValueChanged(bool add)
{
if (add)
{
redUpDown.ValueChanged += color_ValueChanged;
greenUpDown.ValueChanged += color_ValueChanged;
blueUpDown.ValueChanged += color_ValueChanged;
}
else
{
redUpDown.ValueChanged -= color_ValueChanged;
greenUpDown.ValueChanged -= color_ValueChanged;
blueUpDown.ValueChanged -= color_ValueChanged;
}
}
alphaUpDown.Enabled = true;
alphaUpDown.Visible = true;
alphaLabel.Visible = true;
pictureBox1.BackColor = colorEntry.SurfaceColor;
colorTextbox.Text = ColorTranslator.ToHtml(colorEntry.SurfaceColor).TrimStart('#');
SetUpValueChanged(true);
}
private void treeView3_AfterSelect(object sender, TreeViewEventArgs e)
{
if (underwaterTreeView.SelectedNode.Tag == null)
return;
addColorToolStripMenuItem.Visible = false;
removeColorToolStripMenuItem.Visible = false;
colorTreeView.SelectedNode = null;
waterTreeView.SelectedNode = null;
fogTreeView.SelectedNode = null;
var colorEntry = (ColorContainer.WaterColor)underwaterTreeView.SelectedNode.Tag;
Color color = colorEntry.UnderwaterColor;
SetUpValueChanged(false);
alphaUpDown.Visible = false;
alphaLabel.Visible = false;
redUpDown.Value = color.R;
greenUpDown.Value = color.G;
blueUpDown.Value = color.B;
pictureBox1.BackColor = Color.FromArgb(0xff, color);
colorTextbox.Text = ColorTranslator.ToHtml(colorEntry.UnderwaterColor).TrimStart('#');
SetUpValueChanged(true);
}
private void treeView4_AfterSelect(object sender, TreeViewEventArgs e)
{
if (fogTreeView.SelectedNode.Tag == null)
return;
addColorToolStripMenuItem.Visible = false;
removeColorToolStripMenuItem.Visible = false;
colorTreeView.SelectedNode = null;
waterTreeView.SelectedNode = null;
underwaterTreeView.SelectedNode = null;
var colorEntry = (ColorContainer.WaterColor)fogTreeView.SelectedNode.Tag;
Color color = colorEntry.FogColor;
SetUpValueChanged(false);
alphaUpDown.Visible = false;
alphaLabel.Visible = false;
redUpDown.Value = color.R;
greenUpDown.Value = color.G;
blueUpDown.Value = color.B;
pictureBox1.BackColor = Color.FromArgb(0xff, color);
colorTextbox.Text = ColorTranslator.ToHtml(colorEntry.FogColor).TrimStart('#');
SetUpValueChanged(true);
}
private void saveToolStripMenuItem1_Click(object sender, EventArgs e)
{
Save();
private void saveToolStripMenuItem1_Click(object sender, EventArgs e)
{
Save();
DialogResult = DialogResult.OK;
}
public void treeView1_KeyDown(object sender, KeyEventArgs e)
{
TreeNode node = colorTreeView.SelectedNode;
if (e.KeyCode == Keys.Delete && node.Tag is ColorContainer.Color)
{
restoreOriginalColorToolStripMenuItem_Click(sender, e);
}
else if (e.Control && e.KeyCode == Keys.C && node.Tag is ColorContainer.Color)
{
copyColorToolStripMenuItem_Click(sender, e);
}
else if (e.Control && e.KeyCode == Keys.V && node.Tag is ColorContainer.Color)
{
pasteColorToolStripMenuItem_Click(sender, e);
}
}
private void treeView2_KeyDown(object sender, KeyEventArgs e)
public void treeView1_KeyDown(object sender, KeyEventArgs e)
{
TreeNode node = waterTreeView.SelectedNode;
if (e.KeyCode == Keys.Delete && node.Tag is ColorContainer.WaterColor)
{
restoreOriginalColorToolStripMenuItem_Click(sender, e);
}
else if (e.Control && e.KeyCode == Keys.C && node.Tag is ColorContainer.WaterColor)
{
copyColorToolStripMenuItem_Click(sender, e);
}
else if (e.Control && e.KeyCode == Keys.V && node.Tag is ColorContainer.WaterColor)
{
pasteColorToolStripMenuItem_Click(sender, e);
}
}
private void treeView3_KeyDown(object sender, KeyEventArgs e)
{
TreeNode node = underwaterTreeView.SelectedNode;
if (e.KeyCode == Keys.Delete && node.Tag is ColorContainer.WaterColor)
{
restoreOriginalColorToolStripMenuItem_Click(sender, e);
}
else if (e.Control && e.KeyCode == Keys.C && node.Tag is ColorContainer.WaterColor)
{
copyColorToolStripMenuItem_Click(sender, e);
}
else if (e.Control && e.KeyCode == Keys.V && node.Tag is ColorContainer.WaterColor)
{
pasteColorToolStripMenuItem_Click(sender, e);
}
}
private void treeView4_KeyDown(object sender, KeyEventArgs e)
{
TreeNode node = fogTreeView.SelectedNode;
if (e.KeyCode == Keys.Delete && node.Tag is ColorContainer.WaterColor)
{
restoreOriginalColorToolStripMenuItem_Click(sender, e);
}
else if (e.Control && e.KeyCode == Keys.C && node.Tag is ColorContainer.WaterColor)
{
copyColorToolStripMenuItem_Click(sender, e);
}
else if (e.Control && e.KeyCode == Keys.V && node.Tag is ColorContainer.WaterColor)
{
pasteColorToolStripMenuItem_Click(sender, e);
}
}
public bool IsValidHexString(string value)
{
return System.Text.RegularExpressions.Regex.IsMatch(value, @"\A\b[0-9a-fA-F]+\b\Z") && value.Length == 6;
}
private void colorBox_TextChanged(object sender, EventArgs e)
{
if(IsValidHexString(colorTextbox.Text))
if (sender is not TreeView treeView)
return;
TreeNode node = treeView.SelectedNode;
switch (e.KeyCode)
{
Color color = ColorTranslator.FromHtml("#" + colorTextbox.Text);
redUpDown.Value = color.R;
greenUpDown.Value = color.G;
blueUpDown.Value = color.B;
case Keys.Delete:
restoreOriginalColorToolStripMenuItem_Click(sender, e);
break;
case Keys.C when e.Control:
copyColorToolStripMenuItem_Click(sender, e);
break;
case Keys.V when e.Control:
pasteColorToolStripMenuItem_Click(sender, e);
break;
default:
break;
}
}
private void color_ValueChanged(object sender, EventArgs e)
{
Color color = Color.FromArgb(tabControl.SelectedTab == waterTab ? (int)alphaUpDown.Value : 255, (int)redUpDown.Value, (int)greenUpDown.Value, (int)blueUpDown.Value);
if (tabControl.SelectedTab == colorsTab)
{
var colorEntry = (ColorContainer.Color)colorTreeView.SelectedNode.Tag;
colorEntry.ColorPallette = color;
}
else
{
var waterColorEntry = (tabControl.SelectedTab.Controls[0] as TreeView).SelectedNode.Tag as ColorContainer.WaterColor;
if (tabControl.SelectedTab == waterTab)
waterColorEntry.SurfaceColor = color;
else if (tabControl.SelectedTab == underwaterTab)
waterColorEntry.UnderwaterColor = color;
else
waterColorEntry.FogColor = color;
}
pictureBox1.BackColor = color;
colorTextbox.Text = ColorTranslator.ToHtml(color).TrimStart('#');
}
private void setColorBtn_Click(object sender, EventArgs e)
{
ColorDialog colorPick = new ColorDialog();
colorPick.AllowFullOpen = true;
colorPick.AnyColor = true;
colorPick.SolidColorOnly = tabControl.SelectedTab == colorsTab;
if (colorPick.ShowDialog(this) != DialogResult.OK)
return;
pictureBox1.BackColor = colorPick.Color;
if (tabControl.SelectedTab == waterTab && waterTreeView.SelectedNode != null &&
waterTreeView.SelectedNode.Tag != null && waterTreeView.SelectedNode.Tag is ColorContainer.WaterColor)
{
var colorEntry = (ColorContainer.WaterColor)waterTreeView.SelectedNode.Tag;
// preserves the alpha so the user can handle it since the color picker doesn't support alpha
pictureBox1.BackColor = colorEntry.SurfaceColor = Color.FromArgb(colorEntry.SurfaceColor.A, colorPick.Color);
redUpDown.Value = colorPick.Color.R;
greenUpDown.Value = colorPick.Color.G;
blueUpDown.Value = colorPick.Color.B;
}
else if (tabControl.SelectedTab == underwaterTab && underwaterTreeView.SelectedNode != null &&
underwaterTreeView.SelectedNode.Tag != null && underwaterTreeView.SelectedNode.Tag is ColorContainer.WaterColor)
{
var colorEntry = (ColorContainer.WaterColor)underwaterTreeView.SelectedNode.Tag;
// the game doesn't care about the alpha value for underwater colors
colorEntry.UnderwaterColor = Color.FromArgb(0, colorPick.Color);
redUpDown.Value = colorPick.Color.R;
greenUpDown.Value = colorPick.Color.G;
blueUpDown.Value = colorPick.Color.B;
}
else if (tabControl.SelectedTab == fogTab && fogTreeView.SelectedNode != null &&
fogTreeView.SelectedNode.Tag != null && fogTreeView.SelectedNode.Tag is ColorContainer.WaterColor)
{
var colorEntry = (ColorContainer.WaterColor)fogTreeView.SelectedNode.Tag;
// the game doesn't care about the alpha value for fog colors
colorEntry.FogColor = Color.FromArgb(0, colorPick.Color);
redUpDown.Value = colorPick.Color.R;
greenUpDown.Value = colorPick.Color.G;
blueUpDown.Value = colorPick.Color.B;
}
else if (tabControl.SelectedTab == colorsTab && colorTreeView.SelectedNode != null &&
colorTreeView.SelectedNode.Tag != null && colorTreeView.SelectedNode.Tag is ColorContainer.Color)
{
var colorEntry = (ColorContainer.Color)colorTreeView.SelectedNode.Tag;
colorEntry.ColorPallette = colorPick.Color;
redUpDown.Value = colorPick.Color.R;
greenUpDown.Value = colorPick.Color.G;
blueUpDown.Value = colorPick.Color.B;
}
colorPick.Dispose();
}
private void alpha_ValueChanged(object sender, EventArgs e)
{
var colorEntry = (ColorContainer.WaterColor)waterTreeView.SelectedNode.Tag;
pictureBox1.BackColor = colorEntry.SurfaceColor = Color.FromArgb((int)alphaUpDown.Value, colorEntry.SurfaceColor);
}
private void restoreOriginalColorToolStripMenuItem_Click(object sender, EventArgs e)
{
if(tabControl.SelectedTab is var tab && tab != null)
private void colorBox_TextChanged(object sender, EventArgs e)
{
if (IsValidHexColor(colorTextbox.Text) && int.TryParse(colorTextbox.Text, System.Globalization.NumberStyles.HexNumber, null, out int argbColor))
{
TreeNode node = (tabControl.SelectedTab.Controls[0] as TreeView).SelectedNode;
SetColor(Color.FromArgb(argbColor));
}
}
Color color = Color.Empty;
private void color_ValueChanged(object sender, EventArgs e)
{
Color color = Color.FromArgb(filterPrompt.SelectedTabIndex == 1 ? (int)alphaUpDown.Value : 255, (int)redUpDown.Value, (int)greenUpDown.Value, (int)blueUpDown.Value);
if (tab == colorsTab)
if (filterPrompt.SelectedTabIndex == 0 && filterPrompt.SelectedItem is KeyValuePair<string, Color> colorEntry)
{
EditorValue.Colors[colorEntry.Key] = color;
}
else if (filterPrompt.SelectedItem is KeyValuePair<string, (Color Surface,Color Underwater, Color Fog)> waterColorEntry)
{
if (filterPrompt.SelectedTabIndex == 1)
EditorValue.WaterColors[waterColorEntry.Key] = (color, waterColorEntry.Value.Underwater, waterColorEntry.Value.Fog);
else if (filterPrompt.SelectedTabIndex == 2)
EditorValue.WaterColors[waterColorEntry.Key] = (waterColorEntry.Value.Surface, color, waterColorEntry.Value.Fog);
else
EditorValue.WaterColors[waterColorEntry.Key] = (waterColorEntry.Value.Surface, waterColorEntry.Value.Underwater, color);
}
pictureBox1.BackColor = color;
colorTextbox.Text = color.ToArgb().ToString("X06");
}
private void setColorBtn_Click(object sender, EventArgs e)
{
using ColorDialog colorPick = new ColorDialog();
colorPick.AllowFullOpen = true;
colorPick.AnyColor = true;
colorPick.SolidColorOnly = filterPrompt.SelectedTabIndex == 0;
if (colorPick.ShowDialog(this) != DialogResult.OK)
return;
if (filterPrompt.SelectedTabIndex == 0 && filterPrompt.SelectedItem is ColorContainer.Color color)
{
color.ColorPallette = colorPick.Color;
SetColor(color.ColorPallette);
return;
}
if (filterPrompt.SelectedItem is KeyValuePair<string, (Color Surface,Color Underwater, Color Fog)> waterColorEntry)
{
Color wColor =
filterPrompt.SelectedTabIndex == 1 ? waterColorEntry.Value.Surface :
filterPrompt.SelectedTabIndex == 2 ? waterColorEntry.Value.Underwater : waterColorEntry.Value.Fog;
if (filterPrompt.SelectedTabIndex == 1)
EditorValue.WaterColors[waterColorEntry.Key] = (wColor, waterColorEntry.Value.Underwater, waterColorEntry.Value.Fog);
else if (filterPrompt.SelectedTabIndex == 2)
EditorValue.WaterColors[waterColorEntry.Key] = (waterColorEntry.Value.Surface, wColor, waterColorEntry.Value.Fog);
else
EditorValue.WaterColors[waterColorEntry.Key] = (waterColorEntry.Value.Surface, waterColorEntry.Value.Underwater, wColor);
}
}
private void alpha_ValueChanged(object sender, EventArgs e)
{
var colorEntry = (KeyValuePair<string, (Color Surface,Color Underwater, Color Fog)>)waterTreeView.SelectedNode.Tag;
EditorValue.WaterColors[colorEntry.Key] = colorEntry.Value;
pictureBox1.BackColor = Color.FromArgb((int)alphaUpDown.Value, colorEntry.Value.Surface);
}
private void restoreOriginalColorToolStripMenuItem_Click(object sender, EventArgs e)
{
if (filterPrompt.SelectedItem is KeyValuePair<string, Color> color)
{
if (!_defaultColourfile.Colors.TryGetValue(color.Key, out Color col_entry))
{
ColorContainer.Color col_entry = _defaultColourfile.Colors.Find(color => color.Name == node.Text);
if (col_entry == null)
return;
color = col_entry.ColorPallette;
colorTextbox.Text = ColorTranslator.ToHtml(color).TrimStart('#');
}
else
HideColorEdit();
return;
}
EditorValue.Colors[color.Key] = col_entry;
SetColor(col_entry);
}
if (filterPrompt.SelectedItem is KeyValuePair<string, (Color Surface, Color Underwater, Color Fog)> waterColor)
{
if (_defaultColourfile.WaterColors.TryGetValue(waterColor.Key, out (Color Surface, Color Underwater, Color Fog) waterColorEntry))
{
ColorContainer.WaterColor waterEntry = _defaultColourfile.WaterColors.Find(color => color.Name == node.Text);
HideColorEdit();
return;
}
if (waterEntry == null)
return;
Color wColor =
filterPrompt.SelectedTabIndex == 1 ? waterColorEntry.Surface :
filterPrompt.SelectedTabIndex == 2 ? waterColorEntry.Underwater: waterColorEntry.Fog;
if (filterPrompt.SelectedTabIndex == 1)
EditorValue.WaterColors[waterColor.Key] = (wColor, waterColorEntry.Underwater, waterColorEntry.Fog);
else if (filterPrompt.SelectedTabIndex == 2)
EditorValue.WaterColors[waterColor.Key] = (waterColorEntry.Surface, wColor, waterColorEntry.Fog);
else
EditorValue.WaterColors[waterColor.Key] = (waterColorEntry.Surface, waterColorEntry.Underwater, wColor);
SetColor(wColor);
}
}
color =
tab == waterTab ? waterEntry.SurfaceColor :
tab == underwaterTab ? waterEntry.UnderwaterColor : waterEntry.FogColor;
private void copyColorToolStripMenuItem_Click(object sender, EventArgs e)
{
_clipboard_color = colorTextbox.Text;
Clipboard.SetText(_clipboard_color);
}
if (tab == waterTab)
{
alphaUpDown.Value = color.A;
}
redUpDown.Value = color.R;
greenUpDown.Value = color.G;
blueUpDown.Value = color.B;
}
pictureBox1.BackColor = Color.FromArgb(tab == colorsTab ? 0xFF : color.A, color);
}
}
private void metroTextBox1_TextChanged(object sender, EventArgs e)
{
// Some code in this function is modified code from this StackOverflow answer - MattNL
//https://stackoverflow.com/questions/8260322/filter-a-treeview-with-a-textbox-in-a-c-sharp-winforms-app
//blocks repainting tree until all objects loaded
colorTreeView.BeginUpdate();
colorTreeView.Nodes.Clear();
waterTreeView.BeginUpdate();
waterTreeView.Nodes.Clear();
underwaterTreeView.BeginUpdate();
underwaterTreeView.Nodes.Clear();
fogTreeView.BeginUpdate();
fogTreeView.Nodes.Clear();
if (!string.IsNullOrEmpty(metroTextBox1.Text))
{
foreach (TreeNode node in colorCache)
{
if (node.Text.ToLower().Contains(metroTextBox1.Text.ToLower()))
{
colorTreeView.Nodes.Add((TreeNode)node.Clone());
}
}
foreach (TreeNode node in waterCache)
{
if (node.Text.ToLower().Contains(metroTextBox1.Text.ToLower()))
{
waterTreeView.Nodes.Add((TreeNode)node.Clone());
}
}
foreach (TreeNode node in underwaterCache)
{
if (node.Text.ToLower().Contains(metroTextBox1.Text.ToLower()))
{
underwaterTreeView.Nodes.Add((TreeNode)node.Clone());
}
}
foreach (TreeNode node in fogCache)
{
if (node.Text.ToLower().Contains(metroTextBox1.Text.ToLower()))
{
fogTreeView.Nodes.Add((TreeNode)node.Clone());
}
}
}
else
{
foreach (TreeNode node in colorCache)
{
colorTreeView.Nodes.Add((TreeNode)node.Clone());
}
foreach (TreeNode node in waterCache)
{
waterTreeView.Nodes.Add((TreeNode)node.Clone());
}
foreach (TreeNode node in underwaterCache)
{
underwaterTreeView.Nodes.Add((TreeNode)node.Clone());
}
foreach (TreeNode node in fogCache)
{
fogTreeView.Nodes.Add((TreeNode)node.Clone());
}
}
//enables redrawing tree after all objects have been added
colorTreeView.EndUpdate();
waterTreeView.EndUpdate();
underwaterTreeView.EndUpdate();
fogTreeView.EndUpdate();
}
private void copyColorToolStripMenuItem_Click(object sender, EventArgs e)
{
_clipboard_color = colorTextbox.Text;
}
private void pasteColorToolStripMenuItem_Click(object sender, EventArgs e)
{
colorTextbox.Text = _clipboard_color;
}
private void pasteColorToolStripMenuItem_Click(object sender, EventArgs e)
{
colorTextbox.Text = _clipboard_color;
}
private void colorTextbox_KeyPress(object sender, KeyPressEventArgs e)
{
string hexCheck = "0123456789abcdefABCDEF\b";
e.Handled = !IsHexChar(e.KeyChar);
}
e.Handled = !hexCheck.Contains(e.KeyChar);
}
enum ColorSpace
{
RGB8,
ARGB8,
}
private static int GetCharCountForColorSpace(ColorSpace colorSpace)
{
return colorSpace switch
{
ColorSpace.RGB8 => 6,
ColorSpace.ARGB8 => 8,
_ => 0,
};
}
private static bool IsHexChar(char c) => char.IsDigit(c) || c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z';
private static bool IsValidHexColor(string value, ColorSpace colorSpace = ColorSpace.RGB8) => value.All(IsHexChar) && value.Length == GetCharCountForColorSpace(colorSpace);
private void stripPS4BiomesToolStripMenuItem_Click(object sender, EventArgs e)
{
if(EditorValue.WaterColors.Count > 0)
foreach (string ps4BiomeColor in PS4BiomeColors)
{
foreach (ColorContainer.WaterColor col in EditorValue.WaterColors.ToList())
{
if (PS4Biomes.Contains(col.Name))
EditorValue.WaterColors.Remove(col);
}
SetUpTable(false);
}
}
if (EditorValue.WaterColors.ContainsKey(ps4BiomeColor))
EditorValue.WaterColors.Remove(ps4BiomeColor);
}
BuildTreeViews(EditorValue);
}
private void addColorToolStripMenuItem_Click(object sender, EventArgs e)
{
if(tabControl.SelectedTab == colorsTab)
{
using (TextPrompt prompt = new TextPrompt())
{
prompt.OKButtonText = "Add";
prompt.contextLabel.Text = "Insert the name of the color you would like to add";
if(prompt.ShowDialog(this) == DialogResult.OK)
{
ColorContainer.Color entry = new ColorContainer.Color();
entry.Name = prompt.NewText;
entry.ColorPallette = Color.FromArgb(0xFFFFFF);
if (filterPrompt.SelectedTabIndex == 0)
{
using (TextPrompt prompt = new TextPrompt())
{
prompt.OKButtonText = "Add";
prompt.contextLabel.Text = "Insert the name of the color you would like to add";
if (prompt.ShowDialog(this) == DialogResult.OK)
{
if (EditorValue.Colors.ContainsKey(prompt.Name))
{
MessageBox.Show(this, $"\"{prompt.Name}\" already exists in this color table", "Color not added");
}
if(EditorValue.Colors.Find(c => c.Name == entry.Name) != null)
{
MessageBox.Show(this, $"\"{entry.Name}\" already exists in this color table", "Color not added");
}
EditorValue.Colors.Add(entry);
AddEntry(colorTreeView, colorCache, entry.Name, entry);
EditorValue.Colors.Add(prompt.Name, Color.White);
BuildTreeViews(EditorValue);
}
}
}
}
}
}
private void removeColorToolStripMenuItem_Click(object sender, EventArgs e)
{
if (tabControl.SelectedTab == colorsTab
&& colorTreeView.SelectedNode is TreeNode entry
&& entry != null
&& entry.Tag is ColorContainer.Color color)
if (filterPrompt.SelectedItem is ColorContainer.Color color)
{
EditorValue.Colors.Remove(color);
RemoveEntry(entry, colorCache);
EditorValue.Colors.Remove(color.Name);
}
}
private void SetColor(Color color)
{
redUpDown.Value = color.R;
greenUpDown.Value = color.G;
blueUpDown.Value = color.B;
pictureBox1.BackColor = Color.FromArgb(color.A == 0 ? 0xff : color.A, color);
colorTextbox.Text = color.ToArgb().ToString("X06");
ShowColorEdit();
alphaUpDown.Visible = color.A != 0;
}
private void filterPrompt_OnSelectedItemChanged(object sender, EventArgs e)
{
if (filterPrompt.SelectedItem is KeyValuePair<string, Color> col)
{
SetColor(col.Value);
return;
}
if (filterPrompt.SelectedItem is KeyValuePair<string, (Color Surface,Color Underwater, Color Fog)> waterColor)
{
SetColor(waterColor.Value.Surface);
return;
}
HideColorEdit();
}
private void HideColorEdit()
{
redUpDown.Visible = false;
greenUpDown.Visible = false;
blueUpDown.Visible = false;
alphaUpDown.Visible = false;
pictureBox1.Visible = false;
colorTextbox.Visible = false;
}
private void ShowColorEdit()
{
redUpDown.Visible = true;
greenUpDown.Visible = true;
blueUpDown.Visible = true;
alphaUpDown.Visible = true;
pictureBox1.Visible = true;
colorTextbox.Visible = true;
}
private void compactViewToolStripMenuItem_CheckStateChanged(object sender, EventArgs e)
{
BuildTreeViews(EditorValue);
}
}
}

View File

@@ -117,71 +117,28 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="resource.Image" type="System.Resources.ResXNullRef, System.Windows.Forms">
<value />
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="resource.Location" type="System.Drawing.Point, System.Drawing">
<value>113, 1</value>
<data name="filterPrompt.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 34</value>
</data>
<data name="resource.Size" type="System.Drawing.Size, System.Drawing">
<value>21, 21</value>
<data name="filterPrompt.Size" type="System.Drawing.Size, System.Drawing">
<value>323, 557</value>
</data>
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="resource.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="resource.Visible" type="System.Boolean, mscorlib">
<value>False</value>
</data>
<data name="metroTextBox1.Location" type="System.Drawing.Point, System.Drawing">
<value>101, 27</value>
</data>
<data name="metroTextBox1.Size" type="System.Drawing.Size, System.Drawing">
<value>135, 23</value>
</data>
<data name="metroTextBox1.TabIndex" type="System.Int32, mscorlib">
<value>24</value>
</data>
<data name="&gt;&gt;metroTextBox1.Name" xml:space="preserve">
<value>metroTextBox1</value>
</data>
<data name="&gt;&gt;metroTextBox1.Type" xml:space="preserve">
<value>MetroFramework.Controls.MetroTextBox, MetroFramework, Version=1.4.0.0, Culture=neutral, PublicKeyToken=5f91a84759bf584a</value>
</data>
<data name="&gt;&gt;metroTextBox1.Parent" xml:space="preserve">
<value>metroPanel1</value>
</data>
<data name="&gt;&gt;metroTextBox1.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="metroLabel2.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="metroLabel2.Location" type="System.Drawing.Point, System.Drawing">
<value>62, 27</value>
</data>
<data name="metroLabel2.Size" type="System.Drawing.Size, System.Drawing">
<value>46, 19</value>
</data>
<data name="metroLabel2.TabIndex" type="System.Int32, mscorlib">
<data name="filterPrompt.TabIndex" type="System.Int32, mscorlib">
<value>23</value>
</data>
<data name="metroLabel2.Text" xml:space="preserve">
<value>Filter: </value>
<data name="&gt;&gt;filterPrompt.Name" xml:space="preserve">
<value>filterPrompt</value>
</data>
<data name="&gt;&gt;metroLabel2.Name" xml:space="preserve">
<value>metroLabel2</value>
<data name="&gt;&gt;filterPrompt.Type" xml:space="preserve">
<value>PckStudio.Forms.Additional_Popups.Animation.FilterPrompt, PCK-Studio, Version=7.0.0.2, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;metroLabel2.Type" xml:space="preserve">
<value>MetroFramework.Controls.MetroLabel, MetroFramework, Version=1.4.0.0, Culture=neutral, PublicKeyToken=5f91a84759bf584a</value>
</data>
<data name="&gt;&gt;metroLabel2.Parent" xml:space="preserve">
<data name="&gt;&gt;filterPrompt.Parent" xml:space="preserve">
<value>metroPanel1</value>
</data>
<data name="&gt;&gt;metroLabel2.ZOrder" xml:space="preserve">
<value>3</value>
<data name="&gt;&gt;filterPrompt.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="setColorBtn.Location" type="System.Drawing.Point, System.Drawing">
<value>400, 290</value>
@@ -205,7 +162,7 @@
<value>metroPanel1</value>
</data>
<data name="&gt;&gt;setColorBtn.ZOrder" xml:space="preserve">
<value>4</value>
<value>3</value>
</data>
<data name="blueUpDown.Location" type="System.Drawing.Point, System.Drawing">
<value>400, 397</value>
@@ -226,7 +183,7 @@
<value>metroPanel1</value>
</data>
<data name="&gt;&gt;blueUpDown.ZOrder" xml:space="preserve">
<value>5</value>
<value>4</value>
</data>
<data name="greenUpDown.Location" type="System.Drawing.Point, System.Drawing">
<value>400, 371</value>
@@ -247,7 +204,7 @@
<value>metroPanel1</value>
</data>
<data name="&gt;&gt;greenUpDown.ZOrder" xml:space="preserve">
<value>6</value>
<value>5</value>
</data>
<data name="redUpDown.Location" type="System.Drawing.Point, System.Drawing">
<value>400, 345</value>
@@ -268,7 +225,7 @@
<value>metroPanel1</value>
</data>
<data name="&gt;&gt;redUpDown.ZOrder" xml:space="preserve">
<value>7</value>
<value>6</value>
</data>
<data name="alphaUpDown.Location" type="System.Drawing.Point, System.Drawing">
<value>400, 319</value>
@@ -292,7 +249,7 @@
<value>metroPanel1</value>
</data>
<data name="&gt;&gt;alphaUpDown.ZOrder" xml:space="preserve">
<value>8</value>
<value>7</value>
</data>
<data name="alphaLabel.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@@ -322,7 +279,7 @@
<value>metroPanel1</value>
</data>
<data name="&gt;&gt;alphaLabel.ZOrder" xml:space="preserve">
<value>9</value>
<value>8</value>
</data>
<data name="blueLabel.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@@ -349,7 +306,7 @@
<value>metroPanel1</value>
</data>
<data name="&gt;&gt;blueLabel.ZOrder" xml:space="preserve">
<value>10</value>
<value>9</value>
</data>
<data name="greenLabel.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@@ -376,7 +333,7 @@
<value>metroPanel1</value>
</data>
<data name="&gt;&gt;greenLabel.ZOrder" xml:space="preserve">
<value>11</value>
<value>10</value>
</data>
<data name="redLabel.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@@ -403,24 +360,25 @@
<value>metroPanel1</value>
</data>
<data name="&gt;&gt;redLabel.ZOrder" xml:space="preserve">
<value>12</value>
<value>11</value>
</data>
<data name="resource.Image1" type="System.Resources.ResXNullRef, System.Windows.Forms">
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="resource.Image" type="System.Resources.ResXNullRef, System.Windows.Forms">
<value />
</data>
<data name="resource.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="resource.Location1" type="System.Drawing.Point, System.Drawing">
<data name="resource.Location" type="System.Drawing.Point, System.Drawing">
<value>103, 1</value>
</data>
<data name="resource.Size1" type="System.Drawing.Size, System.Drawing">
<data name="resource.Size" type="System.Drawing.Size, System.Drawing">
<value>21, 21</value>
</data>
<data name="resource.TabIndex1" type="System.Int32, mscorlib">
<data name="resource.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="resource.Visible1" type="System.Boolean, mscorlib">
<data name="resource.Visible" type="System.Boolean, mscorlib">
<value>False</value>
</data>
<data name="colorTextbox.Location" type="System.Drawing.Point, System.Drawing">
@@ -442,7 +400,7 @@
<value>metroPanel1</value>
</data>
<data name="&gt;&gt;colorTextbox.ZOrder" xml:space="preserve">
<value>13</value>
<value>12</value>
</data>
<data name="metroLabel1.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@@ -469,7 +427,7 @@
<value>metroPanel1</value>
</data>
<data name="&gt;&gt;metroLabel1.ZOrder" xml:space="preserve">
<value>14</value>
<value>13</value>
</data>
<data name="pictureBox1.Location" type="System.Drawing.Point, System.Drawing">
<value>378, 92</value>
@@ -490,16 +448,16 @@
<value>metroPanel1</value>
</data>
<data name="&gt;&gt;pictureBox1.ZOrder" xml:space="preserve">
<value>15</value>
<value>14</value>
</data>
<data name="metroPanel1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="metroPanel1.Location" type="System.Drawing.Point, System.Drawing">
<value>20, 60</value>
<value>0, 0</value>
</data>
<data name="metroPanel1.Size" type="System.Drawing.Size, System.Drawing">
<value>612, 523</value>
<value>652, 603</value>
</data>
<data name="metroPanel1.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
@@ -514,7 +472,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;metroPanel1.ZOrder" xml:space="preserve">
<value>3</value>
<value>2</value>
</data>
<metadata name="menuStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
@@ -525,11 +483,11 @@
<data name="saveToolStripMenuItem1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
vAAADrwBlbxySQAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4yMfEgaZUAAADdSURBVDhPzZJB
CoJQEIa9jy0iPFAnCDpAtG3ZooUE4b6oVtIuClpJIAgqZEVlKpqEHUAm5pGPmhTbRA18G//5P5iHgvA3
I7ZniiQ7aVM9QZzcOKYbwVDbw8I6A2YAICBvg2VJdtjSs2Cse1Dt6tCYbliGO0UCFlLBxAj590yA0D4X
1Ec7CK8JF9j+lUmWzoVlpYJaz4JKZ5ULZqWCT6F9Jhhowcv9eeBOoQBvPXoBrA0zF8yyR6V9LvCjGLYH
NxfMvipIMaQ3Ux6ClPYFsaUq/bmd0rspuIO/Pe3/bu5p+sr3gTvFEQAAAABJRU5ErkJggg==
vAAADrwBlbxySQAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4yMfEgaZUAAADfSURBVDhPYxg8
QLt++3yTGbf/Fm599P/Nh49wfPXxq/+rTt37f+Dak/8gOSBgAGEMANIMxGBFyAasPf/0v8GE8//z1t8C
y4HU4DIALIluwLpLL+HiMANAGKoNAWASCavv/n/57gPcgOvP3oENOXj7NViOoAFGU6791+k4ghWD5Aga
QCyGakMAkODcU89R/I8Ng9TgNADk14dPn/8/c+kqVgySgwUqVBsCwAx49urN/zsPHmPFIDmaGvAXJInN
38gYasBfqDYE0K7dOn/Wvut/sfkdGYPUgJI9VNuAAwYGAGn6yvdevWgPAAAAAElFTkSuQmCC
</value>
</data>
<data name="saveToolStripMenuItem1.Size" type="System.Drawing.Size, System.Drawing">
@@ -551,79 +509,79 @@
<value>Remove PS4 Biome Colors</value>
</data>
<data name="TU12ToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>416, 22</value>
<value>414, 22</value>
</data>
<data name="TU12ToolStripMenuItem.Text" xml:space="preserve">
<value>TU12 (360)</value>
</data>
<data name="TU13ToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>416, 22</value>
<value>414, 22</value>
</data>
<data name="TU13ToolStripMenuItem.Text" xml:space="preserve">
<value>TU13/1.00 (360/PS3)</value>
</data>
<data name="TU14ToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>416, 22</value>
<value>414, 22</value>
</data>
<data name="TU14ToolStripMenuItem.Text" xml:space="preserve">
<value>TU14/1.04 (360/PS3)</value>
</data>
<data name="TU19ToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>416, 22</value>
<value>414, 22</value>
</data>
<data name="TU19ToolStripMenuItem.Text" xml:space="preserve">
<value>TU19/1.12/CU7 (360/PS3-4-Vita/XONE)</value>
</data>
<data name="TU31ToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>416, 22</value>
<value>414, 22</value>
</data>
<data name="TU31ToolStripMenuItem.Text" xml:space="preserve">
<value>TU31/1.22/CU19 (360/PS3-4-Vita/XONE)</value>
</data>
<data name="TU32ToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>416, 22</value>
<value>414, 22</value>
</data>
<data name="TU32ToolStripMenuItem.Text" xml:space="preserve">
<value>TU32/1.24/CU20/P3 (360/PS3-4-Vita/XONE/WIIU)</value>
</data>
<data name="TU43ToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>416, 22</value>
<value>414, 22</value>
</data>
<data name="TU43ToolStripMenuItem.Text" xml:space="preserve">
<value>TU43/1.35/CU32/P12 (360/PS3-4-Vita/XONE/WIIU)</value>
</data>
<data name="TU46ToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>416, 22</value>
<value>414, 22</value>
</data>
<data name="TU46ToolStripMenuItem.Text" xml:space="preserve">
<value>TU46/1.38/CU36/P15 (360/PS3-4-Vita/XONE/WIIU)</value>
</data>
<data name="TU51ToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>416, 22</value>
<value>414, 22</value>
</data>
<data name="TU51ToolStripMenuItem.Text" xml:space="preserve">
<value>TU51/1.44/CU41/P20 (360/PS3-4-Vita/XONE/WIIU)</value>
</data>
<data name="TU53ToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>416, 22</value>
<value>414, 22</value>
</data>
<data name="TU53ToolStripMenuItem.Text" xml:space="preserve">
<value>TU53/1.49/CU43/P23/1.0.3 (360/PS3-4-Vita/XONE/WIIU/SWITCH)</value>
</data>
<data name="TU54ToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>416, 22</value>
<value>414, 22</value>
</data>
<data name="TU54ToolStripMenuItem.Text" xml:space="preserve">
<value>TU54/1.52/CU44/P24/1.0.4 (360/PS3-4-Vita/XONE/WIIU/SWITCH)</value>
</data>
<data name="TU69ToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>416, 22</value>
<value>414, 22</value>
</data>
<data name="TU69ToolStripMenuItem.Text" xml:space="preserve">
<value>TU69/1.76/P38 (360/PS3-4-Vita/WIIU)</value>
</data>
<data name="_1_9_1ToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>416, 22</value>
<value>414, 22</value>
</data>
<data name="_1_9_1ToolStripMenuItem.Text" xml:space="preserve">
<value>1.91 (PS4)</value>
@@ -635,16 +593,28 @@
<value>Target Update</value>
</data>
<data name="toolsToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>47, 20</value>
<value>46, 20</value>
</data>
<data name="toolsToolStripMenuItem.Text" xml:space="preserve">
<value>Tools</value>
</data>
<data name="compactViewToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>180, 22</value>
</data>
<data name="compactViewToolStripMenuItem.Text" xml:space="preserve">
<value>Compact View</value>
</data>
<data name="viewToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>44, 20</value>
</data>
<data name="viewToolStripMenuItem.Text" xml:space="preserve">
<value>View</value>
</data>
<data name="menuStrip.Location" type="System.Drawing.Point, System.Drawing">
<value>20, 60</value>
<value>0, 0</value>
</data>
<data name="menuStrip.Size" type="System.Drawing.Size, System.Drawing">
<value>612, 24</value>
<value>652, 24</value>
</data>
<data name="menuStrip.TabIndex" type="System.Int32, mscorlib">
<value>3</value>
@@ -706,219 +676,6 @@
<data name="&gt;&gt;ColorContextMenu.Type" xml:space="preserve">
<value>MetroFramework.Controls.MetroContextMenu, MetroFramework, Version=1.4.0.0, Culture=neutral, PublicKeyToken=5f91a84759bf584a</value>
</data>
<data name="waterTreeView.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="waterTreeView.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value>
</data>
<data name="waterTreeView.RightToLeft" type="System.Windows.Forms.RightToLeft, System.Windows.Forms">
<value>No</value>
</data>
<data name="waterTreeView.Size" type="System.Drawing.Size, System.Drawing">
<value>320, 424</value>
</data>
<data name="waterTreeView.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="&gt;&gt;waterTreeView.Name" xml:space="preserve">
<value>waterTreeView</value>
</data>
<data name="&gt;&gt;waterTreeView.Type" xml:space="preserve">
<value>System.Windows.Forms.TreeView, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;waterTreeView.Parent" xml:space="preserve">
<value>waterTab</value>
</data>
<data name="&gt;&gt;waterTreeView.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="waterTab.Location" type="System.Drawing.Point, System.Drawing">
<value>4, 38</value>
</data>
<data name="waterTab.Size" type="System.Drawing.Size, System.Drawing">
<value>320, 424</value>
</data>
<data name="waterTab.TabIndex" type="System.Int32, mscorlib">
<value>1</value>
</data>
<data name="waterTab.Text" xml:space="preserve">
<value>Water</value>
</data>
<data name="&gt;&gt;waterTab.Name" xml:space="preserve">
<value>waterTab</value>
</data>
<data name="&gt;&gt;waterTab.Type" xml:space="preserve">
<value>System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;waterTab.Parent" xml:space="preserve">
<value>tabControl</value>
</data>
<data name="&gt;&gt;waterTab.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="underwaterTreeView.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value>
</data>
<data name="underwaterTreeView.Size" type="System.Drawing.Size, System.Drawing">
<value>320, 424</value>
</data>
<data name="underwaterTreeView.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="&gt;&gt;underwaterTreeView.Name" xml:space="preserve">
<value>underwaterTreeView</value>
</data>
<data name="&gt;&gt;underwaterTreeView.Type" xml:space="preserve">
<value>System.Windows.Forms.TreeView, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;underwaterTreeView.Parent" xml:space="preserve">
<value>underwaterTab</value>
</data>
<data name="&gt;&gt;underwaterTreeView.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="fogTreeView.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value>
</data>
<data name="fogTreeView.Size" type="System.Drawing.Size, System.Drawing">
<value>320, 424</value>
</data>
<data name="fogTreeView.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="&gt;&gt;fogTreeView.Name" xml:space="preserve">
<value>fogTreeView</value>
</data>
<data name="&gt;&gt;fogTreeView.Type" xml:space="preserve">
<value>System.Windows.Forms.TreeView, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;fogTreeView.Parent" xml:space="preserve">
<value>fogTab</value>
</data>
<data name="&gt;&gt;fogTreeView.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="colorTreeView.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="colorTreeView.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value>
</data>
<data name="colorTreeView.Size" type="System.Drawing.Size, System.Drawing">
<value>320, 424</value>
</data>
<data name="colorTreeView.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="&gt;&gt;colorTreeView.Name" xml:space="preserve">
<value>colorTreeView</value>
</data>
<data name="&gt;&gt;colorTreeView.Type" xml:space="preserve">
<value>System.Windows.Forms.TreeView, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;colorTreeView.Parent" xml:space="preserve">
<value>colorsTab</value>
</data>
<data name="&gt;&gt;colorTreeView.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="colorsTab.Location" type="System.Drawing.Point, System.Drawing">
<value>4, 38</value>
</data>
<data name="colorsTab.Size" type="System.Drawing.Size, System.Drawing">
<value>320, 424</value>
</data>
<data name="colorsTab.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="colorsTab.Text" xml:space="preserve">
<value>Everything</value>
</data>
<data name="&gt;&gt;colorsTab.Name" xml:space="preserve">
<value>colorsTab</value>
</data>
<data name="&gt;&gt;colorsTab.Type" xml:space="preserve">
<value>System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;colorsTab.Parent" xml:space="preserve">
<value>tabControl</value>
</data>
<data name="&gt;&gt;colorsTab.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="tabControl.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Top, Bottom, Left</value>
</data>
<data name="underwaterTab.Location" type="System.Drawing.Point, System.Drawing">
<value>4, 38</value>
</data>
<data name="underwaterTab.Size" type="System.Drawing.Size, System.Drawing">
<value>320, 424</value>
</data>
<data name="underwaterTab.TabIndex" type="System.Int32, mscorlib">
<value>2</value>
</data>
<data name="underwaterTab.Text" xml:space="preserve">
<value>Underwater</value>
</data>
<data name="&gt;&gt;underwaterTab.Name" xml:space="preserve">
<value>underwaterTab</value>
</data>
<data name="&gt;&gt;underwaterTab.Type" xml:space="preserve">
<value>System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;underwaterTab.Parent" xml:space="preserve">
<value>tabControl</value>
</data>
<data name="&gt;&gt;underwaterTab.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="fogTab.Location" type="System.Drawing.Point, System.Drawing">
<value>4, 38</value>
</data>
<data name="fogTab.Size" type="System.Drawing.Size, System.Drawing">
<value>320, 424</value>
</data>
<data name="fogTab.TabIndex" type="System.Int32, mscorlib">
<value>3</value>
</data>
<data name="fogTab.Text" xml:space="preserve">
<value>Underwater Fog</value>
</data>
<data name="&gt;&gt;fogTab.Name" xml:space="preserve">
<value>fogTab</value>
</data>
<data name="&gt;&gt;fogTab.Type" xml:space="preserve">
<value>System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;fogTab.Parent" xml:space="preserve">
<value>tabControl</value>
</data>
<data name="&gt;&gt;fogTab.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="tabControl.Location" type="System.Drawing.Point, System.Drawing">
<value>23, 114</value>
</data>
<data name="tabControl.Size" type="System.Drawing.Size, System.Drawing">
<value>328, 466</value>
</data>
<data name="tabControl.TabIndex" type="System.Int32, mscorlib">
<value>22</value>
</data>
<data name="&gt;&gt;tabControl.Name" xml:space="preserve">
<value>tabControl</value>
</data>
<data name="&gt;&gt;tabControl.Type" xml:space="preserve">
<value>MetroFramework.Controls.MetroTabControl, MetroFramework, Version=1.4.0.0, Culture=neutral, PublicKeyToken=5f91a84759bf584a</value>
</data>
<data name="&gt;&gt;tabControl.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;tabControl.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
@@ -3551,6 +3308,18 @@
<data name="&gt;&gt;_1_9_1ToolStripMenuItem.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;viewToolStripMenuItem.Name" xml:space="preserve">
<value>viewToolStripMenuItem</value>
</data>
<data name="&gt;&gt;viewToolStripMenuItem.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;compactViewToolStripMenuItem.Name" xml:space="preserve">
<value>compactViewToolStripMenuItem</value>
</data>
<data name="&gt;&gt;compactViewToolStripMenuItem.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;copyColorToolStripMenuItem.Name" xml:space="preserve">
<value>copyColorToolStripMenuItem</value>
</data>
@@ -3585,6 +3354,6 @@
<value>COLEditor</value>
</data>
<data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>ImmersiveForm, MetroFramework, Version=1.4.0.0, Culture=neutral, PublicKeyToken=5f91a84759bf584a</value>
<value>PckStudio.Controls.EditorForm`1[[OMI.Formats.Color.ColorContainer, OMI Filetypes, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]], PCK-Studio, Version=7.0.0.2, Culture=neutral, PublicKeyToken=null</value>
</data>
</root>

View File

@@ -282,11 +282,11 @@ namespace PckStudio.Forms.Editor
StringBuilder pos_sb = new StringBuilder();
foreach (SkinBOX b in skinPartListBox.SelectedItems.Cast<SkinBOX>())
{
uv_sb.Append(b.UV);
uv_sb.Append(b.Uv);
uv_sb.Append(", ");
size_sb.Append(b.Size);
size_sb.Append(", ");
pos_sb.Append(b.Pos);
pos_sb.Append(b.Position);
pos_sb.Append(", ");
}
@@ -298,7 +298,7 @@ namespace PckStudio.Forms.Editor
if (skinPartListBox.SelectedItem is SkinBOX box)
{
Image uvArea = EditorValue.Texture.GetArea(Rectangle.Truncate(new RectangleF(box.UV.X, box.UV.Y, box.Size.X * 2 + box.Size.Z * 2, box.Size.Z + box.Size.Y)));
Image uvArea = EditorValue.Texture.GetArea(Rectangle.Truncate(new RectangleF(box.Uv.X, box.Uv.Y, box.Size.X * 2 + box.Size.Z * 2, box.Size.Z + box.Size.Y)));
Bitmap refImg = new Bitmap(1, 1);

View File

@@ -117,16 +117,122 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="modelContextMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>178, 17</value>
</metadata>
<metadata name="textureImageList.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>293, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="label2.Location" type="System.Drawing.Point, System.Drawing">
<value>15, 41</value>
</data>
<data name="label2.Size" type="System.Drawing.Size, System.Drawing">
<value>35, 13</value>
</data>
<data name="label2.TabIndex" type="System.Int32, mscorlib">
<value>3</value>
</data>
<data name="label2.Text" xml:space="preserve">
<value>Items:</value>
</data>
<data name="&gt;&gt;label2.Name" xml:space="preserve">
<value>label2</value>
</data>
<data name="&gt;&gt;label2.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label2.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;label2.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="okBtn.FlatStyle" type="System.Windows.Forms.FlatStyle, System.Windows.Forms">
<value>Flat</value>
</data>
<data name="okBtn.Location" type="System.Drawing.Point, System.Drawing">
<value>54, 76</value>
</data>
<data name="okBtn.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
</data>
<data name="okBtn.TabIndex" type="System.Int32, mscorlib">
<value>4</value>
</data>
<data name="okBtn.Text" xml:space="preserve">
<value>Add</value>
</data>
<data name="&gt;&gt;okBtn.Name" xml:space="preserve">
<value>okBtn</value>
</data>
<data name="&gt;&gt;okBtn.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;okBtn.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;okBtn.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="cancelButton.FlatStyle" type="System.Windows.Forms.FlatStyle, System.Windows.Forms">
<value>Flat</value>
</data>
<data name="cancelButton.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="cancelButton.Location" type="System.Drawing.Point, System.Drawing">
<value>135, 76</value>
</data>
<data name="cancelButton.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
</data>
<data name="cancelButton.TabIndex" type="System.Int32, mscorlib">
<value>6</value>
</data>
<data name="cancelButton.Text" xml:space="preserve">
<value>Cancel</value>
</data>
<data name="&gt;&gt;cancelButton.Name" xml:space="preserve">
<value>cancelButton</value>
</data>
<data name="&gt;&gt;cancelButton.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;cancelButton.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;cancelButton.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="ComboBox.ItemHeight" type="System.Int32, mscorlib">
<value>23</value>
</data>
<data name="ComboBox.Location" type="System.Drawing.Point, System.Drawing">
<value>60, 34</value>
</data>
<data name="ComboBox.Size" type="System.Drawing.Size, System.Drawing">
<value>192, 29</value>
</data>
<data name="ComboBox.TabIndex" type="System.Int32, mscorlib">
<value>7</value>
</data>
<data name="&gt;&gt;ComboBox.Name" xml:space="preserve">
<value>ComboBox</value>
</data>
<data name="&gt;&gt;ComboBox.Type" xml:space="preserve">
<value>MetroFramework.Controls.MetroComboBox, MetroFramework, Version=1.4.0.0, Culture=neutral, PublicKeyToken=5f91a84759bf584a</value>
</data>
<data name="&gt;&gt;ComboBox.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;ComboBox.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
<value>6, 13</value>
</data>
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
<value>264, 105</value>
</data>
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAA0AAAAAAAEAIAD7NAAA1gAAAICAAAABACAAKAgBANE1AACAgAAAAQAIAChMAAD5PQEAQEAAAAEA
@@ -2633,4 +2739,13 @@
AP//AAA=
</value>
</data>
<data name="$this.StartPosition" type="System.Windows.Forms.FormStartPosition, System.Windows.Forms">
<value>CenterParent</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>ItemSelectionPopUp</value>
</data>
<data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>MetroFramework.Forms.MetroForm, MetroFramework, Version=1.4.0.0, Culture=neutral, PublicKeyToken=5f91a84759bf584a</value>
</data>
</root>

View File

@@ -16,10 +16,8 @@
* 3. This notice may not be removed or altered from any source distribution.
**/
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Imaging;
using System.IO;
using System.Linq;
@@ -34,6 +32,7 @@ using PckStudio.Core.IO;
using PckStudio.Core.Json;
using PckStudio.Interfaces;
using PckStudio.Internal;
using PckStudio.Json;
using PckStudio.Properties;
namespace PckStudio.Forms.Editor
@@ -43,7 +42,7 @@ namespace PckStudio.Forms.Editor
private readonly ITryGet<string, Animation> _tryGetAnimation;
private readonly ITryGet<string, ISaveContext<Animation>> _tryGetAnimationSaveContext;
private readonly AtlasResource _atlasResource;
private readonly ColorContainer _colourTable;
private readonly ColorContainer _colorTable;
private readonly ResourceCategory _resourceLocationCategory;
private readonly Atlas _atlas;
@@ -70,7 +69,7 @@ namespace PckStudio.Forms.Editor
Text += _atlas.Name;
originalPictureBox.Image = atlas;
_colourTable = colorContainer ?? AppResourceManager.Default.GetData(Resources.tu69colours, new COLFileReader());
_colorTable = colorContainer ?? AppResourceManager.Default.GetData(Resources.tu69colours, new COLFileReader());
_tryGetAnimation = tryGetAnimation;
_tryGetAnimationSaveContext = tryGetAnimationSaveContext;
_atlasResource = resourceLocation as AtlasResource;
@@ -115,15 +114,22 @@ namespace PckStudio.Forms.Editor
private void UpdateAtlasDisplay()
{
using (var g = Graphics.FromImage(originalPictureBox.Image))
{
g.ApplyConfig(_graphicsConfig);
g.Clear(Color.Transparent);
Image image = EditorValue;
g.DrawImage(image, 0, 0, image.Width, image.Height);
using Graphics g = Graphics.FromImage(originalPictureBox.Image);
g.ApplyConfig(_graphicsConfig);
g.Clear(Color.Transparent);
Image image = EditorValue;
g.DrawImage(image, 0, 0, image.Width, image.Height);
SolidBrush brush = new SolidBrush(Color.FromArgb(127, Color.White));
g.FillRectangle(brush, allowGroupsToolStripMenuItem.Checked ? _atlas.GetTileArea(_selectedTile) : _selectedTile.GetArea(_atlas.TileSize));
SolidBrush brush = new SolidBrush(Color.FromArgb(127, Color.White));
if (!allowGroupsToolStripMenuItem.Checked)
{
g.FillRectangle(brush, _selectedTile.GetArea(_atlas.TileSize));
originalPictureBox.Invalidate();
return;
}
foreach (Rectangle area in _atlas.GetTileArea(_selectedTile))
{
g.FillRectangle(brush, area);
}
originalPictureBox.Invalidate();
}
@@ -146,13 +152,13 @@ namespace PckStudio.Forms.Editor
tileNameLabel.Text = $"{tileInfo?.DisplayName}";
internalTileNameLabel.Text = $"{tileInfo?.InternalName}";
setColorButton.Enabled = tileInfo.AllowCustomColour;
variantComboBox.Enabled = variantComboBox.Visible = tileInfo.HasColourEntry && tileInfo.ColourEntry?.Variants?.Length > 1;
variantComboBox.Enabled = Tiles.ColorEntries.TryGetValue(tileInfo.ColorKey, out JsonColorEntry colorEntry) && colorEntry?.Variants?.Length > 1 || _colorTable.Colors.Any(c => c.Name == tileInfo.ColorKey);
if (variantComboBox.Enabled)
{
if (tileInfo.ColourEntry.IsWaterColour)
if (colorEntry?.IsWaterColour ?? default)
{
foreach (ColorContainer.WaterColor col in _colourTable.WaterColors)
foreach (ColorContainer.WaterColor col in _colorTable.WaterColors)
{
if (!variantComboBox.Items.Contains(col.Name))
variantComboBox.Items.Add(col.Name);
@@ -160,10 +166,22 @@ namespace PckStudio.Forms.Editor
}
// TODO: only add variants that are available in the color table
variantComboBox.Items.AddRange(tileInfo.ColourEntry.Variants.Where(colorName => _colourTable.Colors.Any(c => c.Name == colorName) || _colourTable.WaterColors.Any(c => c.Name == colorName)).ToArray());
if (_colorTable.Colors.Where(c => c.Name == tileInfo.ColorKey).FirstOrDefault() is ColorContainer.Color c)
variantComboBox.Items.Add(c.Name);
if (_colorTable.WaterColors.Where(c => c.Name == tileInfo.ColorKey).FirstOrDefault() is ColorContainer.WaterColor wc)
variantComboBox.Items.Add(wc.Name);
if (tileInfo.HasColourEntry)
{
if (!string.IsNullOrWhiteSpace(colorEntry.DefaultName))
variantComboBox.Items.Add(colorEntry.DefaultName);
variantComboBox.Items.AddRange(colorEntry.Variants.Where(colorName => _colorTable.Colors.Any(c => c.Name == colorName) || _colorTable.WaterColors.Any(c => c.Name == colorName)).ToArray());
}
if (variantComboBox.Items.Count > 0)
{
variantComboBox.Visible = variantComboBox.Items.Count > 1;
variantComboBox.SelectedIndex = 0;
}
}
CheckForAnimation();
@@ -187,6 +205,7 @@ namespace PckStudio.Forms.Editor
if (playAnimationsToolStripMenuItem.Checked && hasAnimation)
{
selectTilePictureBox.UseBlendColor = false;
selectTilePictureBox.Image = animation.CreateAnimationImage(selectTilePictureBox.BlendColor);
selectTilePictureBox.Start();
return;
@@ -196,7 +215,8 @@ namespace PckStudio.Forms.Editor
if (_selectedTile.IsPartOfGroup && allowGroupsToolStripMenuItem.Checked)
{
AtlasGroup group = _selectedTile.GetGroup();
tileNameLabel.Text = $"{group.Name}";
if (!string.IsNullOrWhiteSpace(group.Name))
tileNameLabel.Text = group.Name;
internalTileNameLabel.Text = string.Empty;
if (group.IsAnimation())
{
@@ -210,13 +230,32 @@ namespace PckStudio.Forms.Editor
return;
}
}
if (group.IsLargeTile())
{
selectTilePictureBox.Image = _atlas.GetTileTexture(_selectedTile);
}
selectTilePictureBox.UseBlendColor = false;
setColorButton.Enabled |= group.AllowCustomColor;
selectTilePictureBox.Image = _atlas.GetTileTexture(_selectedTile, selectTilePictureBox.BlendColor);
}
}
private void ResetView()
{
tileNameLabel.Text = string.Empty;
internalTileNameLabel.Text = string.Empty;
colorSlider.Visible = false;
colorSliderLabel.Visible = false;
variantComboBox.Visible = false;
variantComboBox.SelectedItem = null;
variantComboBox.Enabled = false;
variantComboBox.Items.Clear();
clearColorButton.Enabled = false;
if (selectTilePictureBox.IsPlaying)
selectTilePictureBox.Stop();
selectTilePictureBox.UseBlendColor = true;
selectTilePictureBox.Image = null;
}
private void ResetView()
{
tileNameLabel.Text = string.Empty;
@@ -323,11 +362,11 @@ namespace PckStudio.Forms.Editor
private void SetTile(Image texture)
{
if (_selectedTile.IsPartOfGroup)
if (_selectedTile.IsPartOfGroup && allowGroupsToolStripMenuItem.Checked)
{
AtlasGroup group = _selectedTile.GetGroup();
_atlas.SetGroup(group, texture);
selectTilePictureBox.Image = _atlas.GetTileTexture(_selectedTile);
selectTilePictureBox.Image = _atlas.GetTileTexture(_selectedTile, selectTilePictureBox.BlendColor);
UpdateAtlasDisplay();
return;
}
@@ -342,36 +381,38 @@ namespace PckStudio.Forms.Editor
private Color GetBlendColor()
{
if (_selectedTile.TryGetUserDataOfType(out JsonTileInfo tileInfo) && tileInfo.HasColourEntry)
if (_selectedTile.TryGetUserDataOfType(out JsonTileInfo tileInfo))
{
return FindBlendColorByKey(tileInfo.ColourEntry.DefaultName);
string colorKey = tileInfo.InternalName;
colorSlider.Visible = colorSliderLabel.Visible = true;
// Simply, Experience orbs red value is just sliding between 255 and 0
if (colorKey.StartsWith("experience_orb"))
return Color.FromArgb(colorSlider.Value, 255, 0);
// Similar story for critical hits, but for all values
if (colorKey == "critical_hit")
return Color.FromArgb(colorSlider.Value, colorSlider.Value, colorSlider.Value);
// Enchanted hits are modified critical hit particles
if (colorKey == "enchanted_hit")
{
// This is directly based on Java's source code for handling enchanted hits
// it just multiplies the red by 0.3 and green by .8 of the color assigned to the critical hit particle
var c = Color.FromArgb(colorSlider.Value, colorSlider.Value, colorSlider.Value);
return Color.FromArgb((byte)(c.R * 0.3f), (byte)(c.G * 0.8f), c.B);
}
colorSlider.Visible = colorSliderLabel.Visible = false;
if (tileInfo.HasColourEntry)
return FindBlendColorByKey(tileInfo.ColorEntry.DefaultName);
}
return Color.White;
}
private Color GetSpecificBlendColor(string colorKey)
private Color FindBlendColorByKey(string colorKey, bool isWaterColour = default)
{
colorSlider.Visible = colorSliderLabel.Visible = true;
// Simply, Experience orbs red value is just sliding between 255 and 0
if (colorKey == "experience_orb")
return Color.FromArgb(colorSlider.Value, 255, 0);
// Similar story for critical hits, but for all values
return Color.FromArgb(colorSlider.Value, colorSlider.Value, colorSlider.Value);
}
private Color FindBlendColorByKey(string colorKey)
{
// The following tiles are hardcoded within a range and do not have color table entries
if (colorKey == "experience_orb" || colorKey == "critical_hit")
return GetSpecificBlendColor(colorKey);
if (!_selectedTile.TryGetUserDataOfType(out JsonTileInfo tileInfo) || !tileInfo.HasColourEntry)
{
Debug.WriteLine("Could not find: " + colorKey);
if (string.IsNullOrWhiteSpace(colorKey))
return Color.White;
}
// Enchanted hits are modified critical hit particles
if (tileInfo.InternalName == "enchanted_hit")
@@ -383,14 +424,11 @@ namespace PckStudio.Forms.Editor
}
// basic way to check for classic water colors
if (!tileInfo.ColourEntry.IsWaterColour || colorKey.StartsWith("Water_"))
if (!isWaterColour && !colorKey.StartsWith("Water_") && _colorTable.Colors.FirstOrDefault(entry => entry.Name == colorKey) is ColorContainer.Color color)
{
if (_colourTable.Colors.FirstOrDefault(entry => entry.Name == colorKey) is ColorContainer.Color color)
{
return color.ColorPallette;
}
return color.ColorPallette;
}
else if (_colourTable.WaterColors.FirstOrDefault(entry => entry.Name == colorKey) is ColorContainer.WaterColor waterColor)
if (_colorTable.WaterColors.FirstOrDefault(entry => entry.Name == colorKey) is ColorContainer.WaterColor waterColor)
{
return waterColor.SurfaceColor;
}
@@ -406,6 +444,18 @@ namespace PckStudio.Forms.Editor
int down = _atlas.Rows;
int left = -1;
int right = 1;
if (_selectedTile.IsPartOfGroup)
{
AtlasGroup group = _selectedTile.GetGroup();
if (!group.IsComposedOfMultipleTiles())
{
Size s = group.GetSize(new Size(1, 1));
up = -_atlas.Rows * (group.Column - _selectedTile.Column + 1);
down = _atlas.Rows * (group.Column - _selectedTile.Column + s.Height);
left = group.Row - _selectedTile.Row - 1;
right = group.Row - _selectedTile.Row + s.Width;
}
}
switch (keyData)
{
case Keys.R:
@@ -512,14 +562,14 @@ namespace PckStudio.Forms.Editor
};
if (saveFileDialog.ShowDialog(this) == DialogResult.OK)
{
_atlas.GetTileTexture(_selectedTile).Save(saveFileDialog.FileName, ImageFormat.Png);
_atlas.GetTileTexture(_selectedTile, selectTilePictureBox.BlendColor).Save(saveFileDialog.FileName, ImageFormat.Png);
Action<AtlasTile, FileInfo> onChange = new Action<AtlasTile, FileInfo>((tile, fileInfo) =>
{
Image img = Image.FromFile(fileInfo.FullName).ReleaseFromFile();
bool success = _atlas.SetTile(tile, img);
if (!success)
{
Size s = _atlas.GetTileArea(tile).Size;
Size s = _atlas.GetTileArea(tile).FirstOrDefault().Size;
new ToastContentBuilder()
.AddText("Invalid Image Dimensions")
.AddText($"Required: {s.Width}x{s.Height} Recived: {img.Width}x{img.Height}")
@@ -554,13 +604,8 @@ namespace PckStudio.Forms.Editor
{
string colorKey = variantComboBox.SelectedItem.ToString();
Color blendColor = FindBlendColorByKey(colorKey);
if (_selectedTile.IsPartOfGroup && _selectedTile.GetGroup().IsAnimation())
{
selectTilePictureBox.Image = _atlas.GetAnimationFromGroup(_selectedTile.GetGroup()).CreateAnimationImage(blendColor);
selectTilePictureBox.Start();
return;
}
selectTilePictureBox.BlendColor = blendColor;
CheckForAnimation();
}
}
@@ -589,6 +634,7 @@ namespace PckStudio.Forms.Editor
selectTilePictureBox.BlendColor = _colorPick.Color;
variantComboBox.Enabled = false;
clearColorButton.Enabled = true;
CheckForAnimation();
}
private void clearColorButton_Click(object sender, EventArgs e)
@@ -598,6 +644,7 @@ namespace PckStudio.Forms.Editor
selectTilePictureBox.BlendColor = Color.White;
clearColorButton.Enabled = false;
CheckForAnimation();
}
private void colorSlider_ValueChanged(object sender, EventArgs e)

View File

@@ -31,24 +31,29 @@ using PckStudio.Properties;
namespace PckStudio
{
public partial class MainForm : ImmersiveForm
{
private PckManager PckManager = null;
public partial class MainForm : ImmersiveForm
{
private PckManager PckManager = null;
private Dictionary<string, TabPage> openTabPages = new Dictionary<string, TabPage>();
private DLCManager _dlcManager;
public MainForm()
{
InitializeComponent();
{
InitializeComponent();
Text = Application.ProductName;
labelVersion.Text = $"{Application.ProductName}: {ApplicationScope.CurrentVersion}";
ChangelogRichTextBox.Text = Resources.CHANGELOG;
pckOpen.AllowDrop = true;
}
labelVersion.Text = $"{Application.ProductName}: {ApplicationScope.CurrentVersion}";
ChangelogRichTextBox.Text = Resources.CHANGELOG;
pckOpen.AllowDrop = true;
_dlcManager = new DLCManager(Settings.Default.Platform, Settings.Default.UserLanguage);
Internal.SettingsManager.Default.RegisterPropertyChangedCallback<AppLanguage>(nameof(Settings.Default.UserLanguage), _dlcManager.SetPreferredLanguage);
Internal.SettingsManager.Default.RegisterPropertyChangedCallback<ConsolePlatform>(nameof(Settings.Default.Platform), _dlcManager.SetPlatform);
}
public void LoadPckFromFile(IEnumerable<string> filepaths)
{
@@ -60,44 +65,65 @@ namespace PckStudio
public void LoadPckFromFile(string filepath)
{
IDLCPackage dlcPackage = DLCManager.Default.OpenDLCPackage(filepath);
IDLCPackage dlcPackage = _dlcManager.OpenDLCPackage(filepath);
Debug.WriteLine(dlcPackage?.GetDLCPackageType());
if (dlcPackage is null)
{
MessageBox.Show($"Failed to open '{Path.GetFileName(filepath)}'");
return;
}
SaveToRecentFiles(filepath);
if (dlcPackage.GetDLCPackageType() == DLCPackageType.Unknown)
AddEditorPage(dlcPackage);
AddEditorPage(dlcPackage);
}
internal void OpenNewPckTab(string caption, string identifier, PackInfo packInfo, ISaveContext<PackInfo> saveContext)
{
internal void OpenNewPckTab(string caption, string identifier, RawAssetDLCPackage packInfo, ISaveContext<RawAssetDLCPackage> saveContext)
{
if (openTabPages.ContainsKey(identifier))
{
tabControl.SelectTab(openTabPages[identifier]);
return;
}
var editor = new PckAssetBrowserEditor(packInfo, saveContext);
var editor = new RawAssetsEditor(packInfo, saveContext);
AddPage(caption, identifier, editor);
}
private void AddEditorPage(string caption, string identifier, PackInfo packInfo, ISaveContext<PackInfo> saveContext = null)
private void AddEditorPage(string caption, string identifier, RawAssetDLCPackage packInfo, ISaveContext<RawAssetDLCPackage> saveContext = null)
{
saveContext ??= GetDefaultSaveContext("./new.pck", "PCK (Minecraft Console Package)");
var editor = new PckAssetBrowserEditor(packInfo, saveContext);
var editor = new RawAssetsEditor(packInfo, saveContext);
AddPage(caption, identifier, editor);
}
private void AddEditorPage(IDLCPackage dlcPackage)
{
PackInfo packInfo = PackInfo.Create((dlcPackage as UnknownDLCPackage).PckFile, default, false);
ISaveContext<PackInfo> saveContext = GetDefaultSaveContext("", "PCK (Minecraft Console Package)");
var editor = new PckAssetBrowserEditor(packInfo, saveContext);
TabPage page = AddPage(dlcPackage.Name, dlcPackage.Name, editor);
}
switch (dlcPackage.GetDLCPackageType())
{
case DLCPackageType.RawAssets:
ISaveContext<RawAssetDLCPackage> saveContext = GetDefaultSaveContext("", "PCK (Minecraft Console Package)");
var editor = new RawAssetsEditor(dlcPackage as RawAssetDLCPackage, saveContext);
TabPage page = AddPage(dlcPackage.Name, dlcPackage.Name, editor);
break;
case DLCPackageType.SkinPack:
break;
case DLCPackageType.TexturePack:
break;
case DLCPackageType.MashUpPack:
break;
case DLCPackageType.MG01:
case DLCPackageType.MG02:
case DLCPackageType.MG03:
MessageBox.Show("Not Implemented...");
break;
default:
Trace.TraceError("Invalid Package Type");
break;
private static ISaveContext<PackInfo> GetDefaultSaveContext(string filepath, string description)
}
}
private static ISaveContext<RawAssetDLCPackage> GetDefaultSaveContext(string filepath, string description)
{
return new DelegatedFileSaveContext<PackInfo>(filepath, false, new FileDialogFilter(description, "*"+Path.GetExtension(filepath)),(packInfo, stream) => new PckFileWriter(packInfo.File, packInfo.ByteOrder).WriteToStream(stream));
return new DelegatedFileSaveContext<RawAssetDLCPackage>(filepath, false, new FileDialogFilter(description, "*" + Path.GetExtension(filepath)), (packInfo, stream) => new PckFileWriter(packInfo.PckFile, packInfo.ByteOrder).WriteToStream(stream));
}
private TabPage AddPage(string caption, string identifier, Control control)
@@ -114,9 +140,9 @@ namespace PckStudio
return page;
}
private bool TryGetEditor(TabPage page, out IEditor<PackInfo> editor)
private bool TryGetEditor(TabPage page, out IEditor<RawAssetDLCPackage> editor)
{
if (page.Controls[0] is IEditor<PackInfo> outEditor)
if (page.Controls[0] is IEditor<RawAssetDLCPackage> outEditor)
{
editor = outEditor;
return true;
@@ -125,12 +151,12 @@ namespace PckStudio
return false;
}
private bool TryGetCurrentEditor(out IEditor<PackInfo> editor) => TryGetEditor(tabControl.SelectedTab, out editor);
private bool TryGetCurrentEditor(out IEditor<RawAssetDLCPackage> editor) => TryGetEditor(tabControl.SelectedTab, out editor);
private void MainForm_Load(object sender, EventArgs e)
{
LoadRecentFileList();
}
{
LoadRecentFileList();
}
private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
{
@@ -149,7 +175,7 @@ namespace PckStudio
private void CloseTab(TabControl.TabPageCollection collection, TabPage page)
{
if (TryGetEditor(page, out IEditor<PackInfo> editor))
if (TryGetEditor(page, out IEditor<RawAssetDLCPackage> editor))
{
editor.Close();
RemoveOpenFile(page);
@@ -174,55 +200,55 @@ namespace PckStudio
{
Settings.Default.RecentFiles ??= new System.Collections.Specialized.StringCollection();
recentlyOpenToolStripMenuItem.DropDownItems.Clear();
for (int i = 0; i < Settings.Default.RecentFiles.Count && i < 5; i++)
{
string filepath = Settings.Default.RecentFiles[i];
if (!string.IsNullOrWhiteSpace(filepath) && File.Exists(filepath))
{
string displayFilepath = Regex.Replace(filepath, @"([A-Z]{1}\:\\[Uu]sers\\)([^\\]*\\)(.*)", "~\\$3");
for (int i = 0; i < Settings.Default.RecentFiles.Count && i < 5; i++)
{
string filepath = Settings.Default.RecentFiles[i];
if (!string.IsNullOrWhiteSpace(filepath) && File.Exists(filepath))
{
string displayFilepath = Regex.Replace(filepath, @"([A-Z]{1}\:\\[Uu]sers\\)([^\\]*\\)(.*)", "~\\$3");
ToolStripItem item = recentlyOpenToolStripMenuItem.DropDownItems.Add(displayFilepath, null, HandleOpenFile);
item.Tag = filepath;
}
}
if (recentlyOpenToolStripMenuItem.DropDownItems.Count > 0)
{
void clearRecentFileList(object sender, EventArgs e)
{
Settings.Default.RecentFiles.Clear();
LoadRecentFileList();
item.Tag = filepath;
}
recentlyOpenToolStripMenuItem.DropDownItems.Add(new ToolStripSeparator());
recentlyOpenToolStripMenuItem.DropDownItems.Add("Clear", null, clearRecentFileList);
}
}
if (recentlyOpenToolStripMenuItem.DropDownItems.Count > 0)
{
void clearRecentFileList(object sender, EventArgs e)
{
Settings.Default.RecentFiles.Clear();
LoadRecentFileList();
}
recentlyOpenToolStripMenuItem.DropDownItems.Add(new ToolStripSeparator());
recentlyOpenToolStripMenuItem.DropDownItems.Add("Clear", null, clearRecentFileList);
}
}
private void HandleOpenFile(object sender, EventArgs e)
{
if (sender is ToolStripItem menuItem && menuItem.Tag is string filepath)
{
if (!File.Exists(filepath))
{
menuItem.Available = false;
return;
}
LoadPckFromFile(filepath);
}
private void HandleOpenFile(object sender, EventArgs e)
{
if (sender is ToolStripItem menuItem && menuItem.Tag is string filepath)
{
if (!File.Exists(filepath))
{
menuItem.Available = false;
return;
}
LoadPckFromFile(filepath);
}
}
private void SaveToRecentFiles(string filepath)
{
if (filepath is null || string.IsNullOrWhiteSpace(filepath))
return;
private void SaveToRecentFiles(string filepath)
{
if (filepath is null || string.IsNullOrWhiteSpace(filepath))
return;
if (Settings.Default.RecentFiles.Contains(filepath))
Settings.Default.RecentFiles.Remove(filepath);
Settings.Default.RecentFiles.Insert(0, filepath);
Settings.Default.RecentFiles.Insert(0, filepath);
for (int i = Settings.Default.RecentFiles.Count - 1; i >= 5; i--)
{
for (int i = Settings.Default.RecentFiles.Count - 1; i >= 5; i--)
{
Settings.Default.RecentFiles.RemoveAt(i);
}
Settings.Default.Save();
LoadRecentFileList();
Settings.Default.Save();
LoadRecentFileList();
}
private void openPckManagerToolStripMenuItem_Click(object sender, EventArgs e)
@@ -239,7 +265,7 @@ namespace PckStudio
}
private void openToolStripMenuItem_Click(object sender, EventArgs e)
{
{
using var ofd = new OpenFileDialog();
ofd.CheckFileExists = true;
ofd.Filter = "PCK (Minecraft Console Package)|*.pck";
@@ -251,9 +277,10 @@ namespace PckStudio
private void tabControl_PageClosing(object sender, PageClosingEventArgs e)
{
if (TryGetEditor(e.Page, out IEditor<PackInfo> editor))
if (TryGetEditor(e.Page, out IEditor<RawAssetDLCPackage> editor))
{
editor.Close();
_dlcManager.CloseDLCPackage(editor.EditorValue.Identifier);
RemoveOpenFile();
}
}
@@ -271,70 +298,67 @@ namespace PckStudio
}
}
private static PckFile InitializePack(int packId, int packVersion, string packName, bool createSkinsPCK)
{
var pack = new PckFile(3);
private static PckFile InitializePack(int packId, int packVersion, string packName)
{
var pack = new PckFile(3);
PckAsset zeroAsset = pack.CreateNewAsset("0", PckAssetType.InfoFile);
zeroAsset.AddProperty("PACKID", packId);
zeroAsset.AddProperty("PACKVERSION", packVersion);
zeroAsset.AddProperty("PACKID", packId);
zeroAsset.AddProperty("PACKVERSION", packVersion);
var locFile = new LOCFile();
locFile.InitializeDefault(packName);
pack.CreateNewAsset("localisation.loc", PckAssetType.LocalisationFile, new LOCFileWriter(locFile, 2));
var locFile = new LOCFile();
locFile.InitializeDefault(packName);
pack.CreateNewAsset("localisation.loc", PckAssetType.LocalisationFile, new LOCFileWriter(locFile, 2));
return pack;
}
pack.CreateNewAssetIf(createSkinsPCK, "Skins.pck", PckAssetType.SkinDataFile, new PckFileWriter(new PckFile(3, true), OMI.ByteOrder.BigEndian));
private static PckFile InitializeTexturePack(int packId, int packVersion, string packName, string res)
{
PckFile pack = InitializePack(packId, packVersion, packName);
return pack;
}
private static PckFile InitializeTexturePack(int packId, int packVersion, string packName, string res, bool createSkinsPCK)
{
PckFile pack = InitializePack(packId, packVersion, packName, createSkinsPCK);
PckFile infoPCK = new PckFile(3);
PckFile infoPCK = new PckFile(3);
pack.GetAsset("localisation.loc", PckAssetType.LocalisationFile).Filename = "languages.loc";
PckAsset iconAsset = infoPCK.CreateNewAsset("icon.png", PckAssetType.TextureFile);
iconAsset.SetTexture(Core.Properties.Resources.TexturePackIcon);
iconAsset.SetTexture(Core.Properties.Resources.TexturePackIcon);
PckAsset comparisonAsset = infoPCK.CreateNewAsset("comparison.png", PckAssetType.TextureFile);
comparisonAsset.SetTexture(Core.Properties.Resources.Comparison);
comparisonAsset.SetTexture(Core.Properties.Resources.Comparison);
PckAsset texturepackInfoAsset = pack.CreateNewAsset($"{res}/{res}Info.pck", PckAssetType.TexturePackInfoFile);
texturepackInfoAsset.AddProperty("PACKID", "0");
texturepackInfoAsset.AddProperty("DATAPATH", $"{res}Data.pck");
texturepackInfoAsset.AddProperty("PACKID", "0");
texturepackInfoAsset.AddProperty("DATAPATH", $"{res}Data.pck");
texturepackInfoAsset.SetData(new PckFileWriter(infoPCK, OMI.ByteOrder.BigEndian));
texturepackInfoAsset.SetData(new PckFileWriter(infoPCK, OMI.ByteOrder.BigEndian));
return pack;
}
return pack;
}
private static PckFile InitializeMashUpPack(int packId, int packVersion, string packName, string res)
{
PckFile pack = InitializeTexturePack(packId, packVersion, packName, res, true);
private static PckFile InitializeMashUpPack(int packId, int packVersion, string packName, string res)
{
PckFile pack = InitializeTexturePack(packId, packVersion, packName, res);
PckAsset gameRuleAsset = pack.CreateNewAsset("GameRules.grf", PckAssetType.GameRulesFile);
GameRuleFile grfFile = new GameRuleFile();
grfFile.AddRule("MapOptions",
new KeyValuePair<string, string>("seed", "0"),
new KeyValuePair<string, string>("baseSaveName", string.Empty),
new KeyValuePair<string, string>("flatworld", "false"),
new KeyValuePair<string, string>("texturePackId", packId.ToString())
);
grfFile.AddRule("LevelRules")
.AddRule("UpdatePlayer",
new KeyValuePair<string, string>("yRot", "0"),
new KeyValuePair<string, string>("xRot", "0"),
new KeyValuePair<string, string>("spawnX", "0"),
new KeyValuePair<string, string>("spawnY", "0"),
new KeyValuePair<string, string>("spawnZ", "0")
);
grfFile.AddRule("MapOptions",
new KeyValuePair<string, string>("seed", "0"),
new KeyValuePair<string, string>("baseSaveName", string.Empty),
new KeyValuePair<string, string>("flatworld", "false"),
new KeyValuePair<string, string>("texturePackId", packId.ToString())
);
grfFile.AddRule("LevelRules")
.AddRule("UpdatePlayer",
new KeyValuePair<string, string>("yRot", "0"),
new KeyValuePair<string, string>("xRot", "0"),
new KeyValuePair<string, string>("spawnX", "0"),
new KeyValuePair<string, string>("spawnY", "0"),
new KeyValuePair<string, string>("spawnZ", "0")
);
gameRuleAsset.SetData(new GameRuleFileWriter(grfFile));
gameRuleAsset.SetData(new GameRuleFileWriter(grfFile));
return pack;
}
return pack;
}
private void skinPackToolStripMenuItem_Click(object sender, EventArgs e)
{
@@ -342,9 +366,9 @@ namespace PckStudio
namePrompt.OKButtonText = "Ok";
if (namePrompt.ShowDialog(this) == DialogResult.OK)
{
PckFile skinPck = InitializePack(new Random().Next(8000, GameConstants.MAX_PACK_ID), 0, namePrompt.NewText, true);
PackInfo packInfo = PackInfo.Create(skinPck, OMI.ByteOrder.BigEndian, true);
AddEditorPage("Unsaved skin pack", "Unsaved skin pack", packInfo);
PckFile skinPck = InitializePack(new Random().Next(8000, GameConstants.MAX_PACK_ID), 0, namePrompt.NewText);
RawAssetDLCPackage newRawAssetDLCPackage = new RawAssetDLCPackage("New pack", skinPck, OMI.ByteOrder.BigEndian);
AddEditorPage(newRawAssetDLCPackage.Name, "Unsaved texture pack", newRawAssetDLCPackage);
}
}
@@ -353,9 +377,9 @@ namespace PckStudio
var packPrompt = new CreateTexturePackPrompt();
if (packPrompt.ShowDialog() == DialogResult.OK)
{
PckFile texturePackPck = InitializeTexturePack(new Random().Next(8000, GameConstants.MAX_PACK_ID), 0, packPrompt.PackName, packPrompt.PackRes, packPrompt.CreateSkinsPck);
PackInfo packInfo = PackInfo.Create(texturePackPck, OMI.ByteOrder.BigEndian, true);
AddEditorPage("Unsaved texture pack", "Unsaved texture pack", packInfo);
PckFile texturePackPck = InitializeTexturePack(new Random().Next(8000, GameConstants.MAX_PACK_ID), 0, packPrompt.PackName, packPrompt.PackRes);
RawAssetDLCPackage newRawAssetDLCPackage = new RawAssetDLCPackage("New pack", texturePackPck, OMI.ByteOrder.BigEndian);
AddEditorPage(newRawAssetDLCPackage.Name, "Unsaved texture pack", newRawAssetDLCPackage);
}
}
@@ -365,16 +389,16 @@ namespace PckStudio
if (packPrompt.ShowDialog() == DialogResult.OK)
{
PckFile mashUpPck = InitializeMashUpPack(new Random().Next(8000, GameConstants.MAX_PACK_ID), 0, packPrompt.PackName, packPrompt.PackRes);
PackInfo packInfo = PackInfo.Create(mashUpPck, OMI.ByteOrder.BigEndian, true);
AddEditorPage("Unsaved mash-up pack", "Unsaved mash-up pack", packInfo);
RawAssetDLCPackage newRawAssetDLCPackage = new RawAssetDLCPackage("New pack", mashUpPck, OMI.ByteOrder.BigEndian);
AddEditorPage(newRawAssetDLCPackage.Name, "Unsaved texture pack", newRawAssetDLCPackage);
}
}
private void quickChangeToolStripMenuItem_Click(object sender, EventArgs e)
{
if (TryGetCurrentEditor(out IEditor<PackInfo> editor))
private void quickChangeToolStripMenuItem_Click(object sender, EventArgs e)
{
if (TryGetCurrentEditor(out IEditor<RawAssetDLCPackage> editor))
{
using AdvancedOptions advanced = new AdvancedOptions(editor.EditorValue.File);
using AdvancedOptions advanced = new AdvancedOptions(editor.EditorValue.PckFile);
advanced.IsLittleEndian = editor.EditorValue.ByteOrder == OMI.ByteOrder.LittleEndian;
if (advanced.ShowDialog() == DialogResult.OK)
{
@@ -383,42 +407,16 @@ namespace PckStudio
}
}
private void closeToolStripMenuItem_Click(object sender, EventArgs e)
{
private void closeToolStripMenuItem_Click(object sender, EventArgs e)
{
CloseTab(tabControl.TabPages, tabControl.SelectedTab);
}
private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
{
using ContributorsForm info = new ContributorsForm();
info.ShowDialog(this);
}
[Obsolete("ReMove this")]
public string GetDataPath()
{
return "";
}
[Obsolete("Move this")]
public bool HasDataFolder()
{
return Directory.Exists(GetDataPath());
}
[Obsolete("Move this")]
public bool CreateDataFolder()
{
if (!HasDataFolder())
{
DialogResult result = MessageBox.Show(this, "There is not a \"Data\" folder present in the pack folder. Would you like to create one?", "Folder missing", MessageBoxButtons.YesNo);
if (result == DialogResult.No)
return false;
else
Directory.CreateDirectory(GetDataPath());
}
return true;
}
private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
{
using ContributorsForm info = new ContributorsForm();
info.ShowDialog(this);
}
private void howToMakeABasicSkinPackToolStripMenuItem_Click(object sender, EventArgs e) => Process.Start("https://www.youtube.com/watch?v=A43aHRHkKxk");
@@ -445,113 +443,113 @@ namespace PckStudio
private void trelloBoardToolStripMenuItem_Click(object sender, EventArgs e) => Process.Start("https://trello.com/b/0XLNOEbe/pck-studio");
private void OpenPck_MouseEnter(object sender, EventArgs e)
{
pckOpen.Image = Resources.pckOpen;
}
{
pckOpen.Image = Resources.pckOpen;
}
private void OpenPck_MouseLeave(object sender, EventArgs e)
{
pckOpen.Image = Resources.pckClosed;
}
private void OpenPck_MouseLeave(object sender, EventArgs e)
{
pckOpen.Image = Resources.pckClosed;
}
private void OpenPck_DragEnter(object sender, DragEventArgs e)
{
pckOpen.Image = Resources.pckDrop;
private void OpenPck_DragEnter(object sender, DragEventArgs e)
{
pckOpen.Image = Resources.pckDrop;
string[] files = (string[])e.Data.GetData(DataFormats.FileDrop) ?? Array.Empty<string>();
e.Effect = files.Any(file => Path.GetExtension(file).Equals(".pck", StringComparison.CurrentCultureIgnoreCase))
? DragDropEffects.Copy
: DragDropEffects.None;
}
e.Effect = files.Any(file => Path.GetExtension(file).Equals(".pck", StringComparison.CurrentCultureIgnoreCase))
? DragDropEffects.Copy
: DragDropEffects.None;
}
private void OpenPck_DragDrop(object sender, DragEventArgs e)
{
if (e.Data.GetData(DataFormats.FileDrop, false) is string[] filepaths)
LoadPckFromFile(filepaths);
}
private void OpenPck_DragDrop(object sender, DragEventArgs e)
{
if (e.Data.GetData(DataFormats.FileDrop, false) is string[] filepaths)
LoadPckFromFile(filepaths);
}
private void OpenPck_DragLeave(object sender, EventArgs e)
{
pckOpen.Image = Resources.pckClosed;
}
private void OpenPck_DragLeave(object sender, EventArgs e)
{
pckOpen.Image = Resources.pckClosed;
}
private void OpenPck_Click(object sender, EventArgs e)
{
openToolStripMenuItem_Click(sender, e);
}
private void OpenPck_Click(object sender, EventArgs e)
{
openToolStripMenuItem_Click(sender, e);
}
private void saveToolStripMenuItem_Click(object sender, EventArgs e)
{
if (TryGetCurrentEditor(out IEditor<PackInfo> editor))
private void saveToolStripMenuItem_Click(object sender, EventArgs e)
{
if (TryGetCurrentEditor(out IEditor<RawAssetDLCPackage> editor))
{
editor.Save();
}
}
private void saveAsToolStripMenuItem_Click(object sender, EventArgs e)
{
if (TryGetCurrentEditor(out IEditor<PackInfo> editor))
private void saveAsToolStripMenuItem_Click(object sender, EventArgs e)
{
if (TryGetCurrentEditor(out IEditor<RawAssetDLCPackage> editor))
{
editor.SaveAs();
}
}
private void wavBinkaToolStripMenuItem_Click(object sender, EventArgs e)
{
using OpenFileDialog fileDialog = new OpenFileDialog
{
Multiselect = true,
Filter = "WAV files (*.wav)|*.wav",
Title = "Please choose WAV files to convert to BINKA"
};
if (fileDialog.ShowDialog(this) == DialogResult.OK)
{
using ItemSelectionPopUp dialog = new ItemSelectionPopUp(
"Level 1 (Best Quality)", "Level 2", "Level 3", "Level 4", "Level 5",
"Level 6", "Level 7", "Level 8", "Level 9 (Worst Quality)")
{
LabelText = "Compression",
ButtonText = "OK"
};
if (dialog.ShowDialog(this) == DialogResult.OK)
private void wavBinkaToolStripMenuItem_Click(object sender, EventArgs e)
{
using OpenFileDialog fileDialog = new OpenFileDialog
{
Multiselect = true,
Filter = "WAV files (*.wav)|*.wav",
Title = "Please choose WAV files to convert to BINKA"
};
if (fileDialog.ShowDialog(this) == DialogResult.OK)
{
using ItemSelectionPopUp dialog = new ItemSelectionPopUp(
"Level 1 (Best Quality)", "Level 2", "Level 3", "Level 4", "Level 5",
"Level 6", "Level 7", "Level 8", "Level 9 (Worst Quality)")
{
BinkaConverter.ToBinka(
fileDialog.FileNames,
new DirectoryInfo(Path.GetDirectoryName(fileDialog.FileName)),
dialog.SelectedIndex + 1 // compression level
);
}
}
}
LabelText = "Compression",
ButtonText = "OK"
};
private void binkaWavToolStripMenuItem_Click(object sender, EventArgs e)
{
using OpenFileDialog fileDialog = new OpenFileDialog
{
Multiselect = true,
Filter = "BINKA files (*.binka)|*.binka",
Title = "Please choose BINKA files to convert to WAV"
};
if (fileDialog.ShowDialog(this) == DialogResult.OK)
{
BinkaConverter.ToWav(fileDialog.FileNames, new DirectoryInfo(Path.GetDirectoryName(fileDialog.FileName)));
}
}
if (dialog.ShowDialog(this) == DialogResult.OK)
{
BinkaConverter.ToBinka(
fileDialog.FileNames,
new DirectoryInfo(Path.GetDirectoryName(fileDialog.FileName)),
dialog.SelectedIndex + 1 // compression level
);
}
}
}
private void settingsToolStripMenuItem_Click(object sender, EventArgs e)
{
var appSettings = new AppSettingsForm();
appSettings.ShowDialog(this);
}
private void binkaWavToolStripMenuItem_Click(object sender, EventArgs e)
{
using OpenFileDialog fileDialog = new OpenFileDialog
{
Multiselect = true,
Filter = "BINKA files (*.binka)|*.binka",
Title = "Please choose BINKA files to convert to WAV"
};
if (fileDialog.ShowDialog(this) == DialogResult.OK)
{
BinkaConverter.ToWav(fileDialog.FileNames, new DirectoryInfo(Path.GetDirectoryName(fileDialog.FileName)));
}
}
private void checkForUpdatesToolStripMenuItem_Click(object sender, EventArgs e)
{
Updater.UpdateToLatest();
}
private void settingsToolStripMenuItem_Click(object sender, EventArgs e)
{
var appSettings = new AppSettingsForm();
appSettings.ShowDialog(this);
}
private void checkForUpdatesToolStripMenuItem_Click(object sender, EventArgs e)
{
Updater.UpdateToLatest();
}
private void exitToolStripMenuItem_Click(object sender, EventArgs e)
{
PckManager?.Close();
PckManager?.Close();
Application.Exit();
}

View File

@@ -181,14 +181,14 @@
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Controls\PageClosingEventArgs.cs" />
<Compile Include="Controls\PckAssetBrowserEditor.cs">
<Compile Include="Controls\RawAssetsEditor.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Controls\PckAssetBrowserEditor.Designer.cs">
<DependentUpon>PckAssetBrowserEditor.cs</DependentUpon>
<Compile Include="Controls\RawAssetsEditor.Designer.cs">
<DependentUpon>RawAssetsEditor.cs</DependentUpon>
</Compile>
<Compile Include="Forms\Additional-Popups\FilterPrompt.cs">
<SubType>Form</SubType>
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Forms\Additional-Popups\FilterPrompt.Designer.cs">
<DependentUpon>FilterPrompt.cs</DependentUpon>
@@ -439,8 +439,8 @@
<EmbeddedResource Include="Controls\ModelsPanel.resx">
<DependentUpon>ModelsPanel.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Controls\PckAssetBrowserEditor.resx">
<DependentUpon>PckAssetBrowserEditor.cs</DependentUpon>
<EmbeddedResource Include="Controls\RawAssetsEditor.resx">
<DependentUpon>RawAssetsEditor.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Controls\SkinsPanel.resx">
<DependentUpon>SkinsPanel.cs</DependentUpon>
@@ -453,6 +453,7 @@
</EmbeddedResource>
<EmbeddedResource Include="Forms\Editor\ModelEditor.resx">
<DependentUpon>ModelEditor.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Forms\Features\CemuPanel.resx">
<DependentUpon>CemuPanel.cs</DependentUpon>

View File

@@ -38,18 +38,15 @@ namespace PckStudio
if (Settings.Default.Platform == Core.ConsolePlatform.Unknown)
{
MessageBox.Show("Please choose on which console you're playing on.", "Select Platform", MessageBoxButtons.OK, MessageBoxIcon.Question);
var platformChooser = new ItemSelectionPopUp(Enum.GetNames(typeof(Core.ConsolePlatform)));
var platformChooser = new ItemSelectionPopUp(Enum.GetNames(typeof(Core.ConsolePlatform)).Skip(1).ToArray());
if (platformChooser.ShowDialog() == DialogResult.OK && Enum.IsDefined(typeof(ConsolePlatform), platformChooser.SelectedItem))
Settings.Default.Platform = (Core.ConsolePlatform)Enum.Parse(typeof(ConsolePlatform), platformChooser.SelectedItem);
}
ApplicationScope.Initialize();
DLCManager.Default.SetPlatform(Settings.Default.Platform);
Trace.TraceInformation("Startup");
RPC.Initialize();
MainInstance = new MainForm();
Internal.SettingsManager.Default.RegisterPropertyChangedCallback<AppLanguage>(nameof(Settings.Default.UserLanguage), DLCManager.Default.SetPreferredLanguage);
Internal.SettingsManager.Default.RegisterPropertyChangedCallback<ConsolePlatform>(nameof(Settings.Default.Platform), DLCManager.Default.SetPlatform);
Updater.SetOwner(MainInstance);
if (args.Length > 0)
{

View File

@@ -132,7 +132,7 @@ namespace PckStudio.Rendering
return;
}
for (int i = -1; i < modelMetaData.UvOffsets.Length; i++)
foreach (JsonModelMetaLayer layer in modelMetaData.Layers)
{
bool tryGetPart(string name, out ModelPart modelPart)
{
@@ -141,13 +141,8 @@ namespace PckStudio.Rendering
modelPart = default;
return false;
}
if (i == -1 || !modelMetaData.UvOffsets.IndexInRange(i))
{
modelPart = originalModelPart;
return true;
}
System.Numerics.Vector2 uvoffset = modelMetaData.UvOffsets[i];
modelPart = new ModelPart(originalModelPart.Name, originalModelPart.ParentName, originalModelPart.Translation, originalModelPart.Rotation, originalModelPart.AdditionalRotation);
System.Numerics.Vector2 uvoffset = layer.Uv;
modelPart = new ModelPart(layer.Name ?? originalModelPart.Name, originalModelPart.ParentName, originalModelPart.Translation, originalModelPart.Rotation, originalModelPart.AdditionalRotation);
modelPart.AddBoxes(originalModelPart.GetBoxes().Select(box => new ModelBox(box.Position, box.Size, box.Uv + uvoffset, box.Inflate, box.Mirror)));
return true;
}

View File

@@ -267,7 +267,6 @@ namespace PckStudio.Rendering
private float animationMaxAngleInDegrees = 5f;
private bool showWireFrame = false;
private bool autoInflateOverlayParts;
private const float DEFAULT_ARM_ROTATION = 5f;
@@ -750,7 +749,7 @@ namespace PckStudio.Rendering
}
CubeMeshCollection cubeMesh = meshStorage[skinBox.Type];
cubeMesh.AddSkinBox(skinBox, autoInflateOverlayParts && skinBox.IsOverlayPart() ? skinBox.Type == "HEADWEAR" ? OVERLAY_SCALE * 2 : OVERLAY_SCALE : 0f);
cubeMesh.AddSkinBox(skinBox, skinBox.IsOverlayPart() ? skinBox.Type == "HEADWEAR" ? OVERLAY_SCALE * 2 : OVERLAY_SCALE : 0f);
}
private void OnANIMUpdate()
@@ -1105,7 +1104,7 @@ namespace PckStudio.Rendering
if (!meshStorage.ContainsKey(box.Type))
continue;
float inflate = autoInflateOverlayParts && box.IsOverlayPart() ? box.Type == "HEADWEAR" ? OVERLAY_SCALE * 2 : OVERLAY_SCALE : 0f;
float inflate = box.IsOverlayPart() ? box.Type == "HEADWEAR" ? OVERLAY_SCALE * 2 : OVERLAY_SCALE : 0f;
Cube cube = box.ToCube(inflate);
CubeMeshCollection cubeMesh = meshStorage[box.Type];
yield return cube.GetBoundingBox(cubeMesh.GetTransform());

View File

@@ -114,11 +114,11 @@ namespace PckStudio.Core
return new ReadOnlyCollection<Frame>(_frames);
}
public IReadOnlyCollection<Frame> GetInterpolatedFrames()
public IEnumerable<Frame> GetInterpolatedFrames()
{
if (Interpolate)
{
return new ReadOnlyCollection<Frame>(InternalGetInterpolatedFrames().ToList());
return InternalGetInterpolatedFrames();
}
return GetFrames();
}
@@ -133,7 +133,7 @@ namespace PckStudio.Core
nextFrame = _frames[i + 1];
for (int tick = 0; tick < currentFrame.Ticks; tick++)
{
double delta = 1.0f - tick / (double)currentFrame.Ticks;
float delta = 1.0f - tick / (float)currentFrame.Ticks;
yield return new Frame(currentFrame.Texture.Interpolate(nextFrame.Texture, delta));
}
}

View File

@@ -164,19 +164,19 @@ namespace PckStudio.Core
{
if (!group.IsAnimation())
return Animation.CreateEmpty();
if (group is AtlasGroupLargeTileAnimation largeTileAnimation)
if (group is AtlasLargeTileAnimation largeTileAnimation)
return GetLargeAnimation(largeTileAnimation);
return GetAnimation(group as AtlasGroupAnimation);
return GetAnimation(group as AtlasAnimation);
}
private Animation GetLargeAnimation(AtlasGroupLargeTileAnimation group)
private Animation GetLargeAnimation(AtlasLargeTileAnimation group)
{
return new Animation(GetLargeAnimationTiles(group).Select(largeTileParts => largeTileParts.Select(t => t.Texture).Combine(group.RowSpan, group.ColumnSpan, _layoutDirection)), true, group.FrameTime);
}
private IEnumerable<IEnumerable<AtlasTile>> GetLargeAnimationTiles(AtlasGroupLargeTileAnimation group) => group.GetLargeTiles().Select(GetLargeTile);
private IEnumerable<IEnumerable<AtlasTile>> GetLargeAnimationTiles(AtlasLargeTileAnimation group) => group.GetLargeTiles().Select(GetLargeTile);
private Animation GetAnimation(AtlasGroupAnimation groupAnimation) => new Animation(GetRange(groupAnimation.Row, groupAnimation.Column, groupAnimation.Direction == ImageLayoutDirection.Horizontal ? groupAnimation.Count : 1, groupAnimation.Direction == ImageLayoutDirection.Vertical ? groupAnimation.Count : 1).Select(t => t.Texture), true, groupAnimation.FrameTime);
private Animation GetAnimation(AtlasAnimation groupAnimation) => new Animation(GetRange(groupAnimation.Row, groupAnimation.Column, groupAnimation.Direction == ImageLayoutDirection.Horizontal ? groupAnimation.Count : 1, groupAnimation.Direction == ImageLayoutDirection.Vertical ? groupAnimation.Count : 1).Select(t => t.Texture), true, groupAnimation.FrameTime);
private Image BuildFinalImage()
{
@@ -204,30 +204,50 @@ namespace PckStudio.Core
SetRange(group.Row, group.Column, group.Count, group.Direction, animation.GetFrames().Select(f => f.Texture));
}
private IEnumerable<AtlasTile> GetLargeTile(AtlasGroupLargeTile group) => GetRange(group.Row, group.Column, group.RowSpan, group.ColumnSpan);
private IEnumerable<AtlasTile> GetLargeTile(AtlasLargeTile group) => GetRange(group.Row, group.Column, group.RowSpan, group.ColumnSpan);
public Image GetTileTexture(AtlasTile tile)
public Image GetTileTexture(AtlasTile tile, Color blendColor)
{
if (!tile.IsPartOfGroup)
return tile;
AtlasGroup atlasGroup = tile.GetGroup();
if (atlasGroup.IsComposedOfMultipleTiles())
return ComposeTileTexture(atlasGroup, blendColor);
if (!atlasGroup.IsLargeTile())
return tile;
AtlasGroupLargeTile largeTile = atlasGroup is AtlasGroupLargeTileAnimation largeTileAnimation ? largeTileAnimation.GetTile(tile.Row, tile.Column) : atlasGroup as AtlasGroupLargeTile;
return GetLargeTile(largeTile).Select(t => t.Texture).Combine(largeTile.RowSpan, largeTile.ColumnSpan, _layoutDirection);
AtlasLargeTile largeTile = atlasGroup is AtlasLargeTileAnimation largeTileAnimation ? largeTileAnimation.GetTile(tile.Row, tile.Column) : atlasGroup as AtlasLargeTile;
Image tileTexture = GetLargeTile(largeTile).Select(t => t.Texture).Combine(largeTile.RowSpan, largeTile.ColumnSpan, _layoutDirection);
return atlasGroup.AllowCustomColor ? tileTexture.Blend(BlendOption.Multiply(blendColor)) : tileTexture;
}
private Image ComposeTileTexture(AtlasGroup atlasGroup, Color blendColor)
{
Image result = new Bitmap(TileSize.Width, TileSize.Height);
using Graphics g = Graphics.FromImage(result);
g.ApplyConfig(GraphicsConfig.PixelPerfect());
AtlasTile[] textures = atlasGroup.GetTileArea(new Size(1, 1)).Select(r => this[r.X, r.Y]).ToArray();
if (textures.Length > 1)
{
g.DrawImage(textures[0].Texture.Blend(BlendOption.Multiply(blendColor)), Point.Empty);
g.DrawImage(textures[1], Point.Empty);
}
return result;
}
private IEnumerable<AtlasTile> InternalGetTilesFromGroup(AtlasGroup atlasGroup, out int rowSpan, out int columnSpan)
{
if (atlasGroup is AtlasGroupLargeTileAnimation largeTileAnimation)
if (atlasGroup is AtlasLargeTileAnimation largeTileAnimation)
{
rowSpan = largeTileAnimation.RowSpan;
columnSpan = largeTileAnimation.ColumnSpan;
return largeTileAnimation.GetLargeTiles().SelectMany(GetLargeTile);
}
if (atlasGroup is AtlasGroupLargeTile largeTile)
if (atlasGroup is AtlasLargeTile largeTile)
{
rowSpan = largeTile.RowSpan;
columnSpan = largeTile.ColumnSpan;
@@ -235,15 +255,17 @@ namespace PckStudio.Core
}
rowSpan = 1;
columnSpan = 1;
if (atlasGroup is AtlasOverlayGroup multipleTiles)
return multipleTiles.GetTileArea(new Size(1, 1)).Select(r => this[r.X, r.Y]);
return GetRange(atlasGroup.Row, atlasGroup.Column, atlasGroup.Count, atlasGroup.Direction);
}
public Rectangle GetTileArea(AtlasTile tile)
public Rectangle[] GetTileArea(AtlasTile tile)
{
if (!tile.IsPartOfGroup)
return tile.GetArea(TileSize);
return [tile.GetArea(TileSize)];
AtlasGroup group = tile.GetGroup();
return new Rectangle(new Point(group.Row * TileSize.Width, group.Column * TileSize.Height), group.GetSize(TileSize));
return group.GetTileArea(TileSize);
}
public bool SetGroup(AtlasGroup group, Image texture)

View File

@@ -16,25 +16,38 @@
* 3. This notice may not be removed or altered from any source distribution.
**/
using System.Drawing;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
namespace PckStudio.Core
{
internal sealed class AtlasGroupAnimation : AtlasGroup
internal sealed class AtlasAnimation : AtlasGroup
{
public int FrameTime { get; }
public override int Count { get; }
[JsonProperty("frameCount", Required = Required.Always)]
private int _frameCount;
[JsonProperty("frameTime")]
public int FrameTime { get; } = Animation.MINIMUM_FRAME_TIME;
public override int Count => _frameCount;
[JsonProperty("direction")]
public override ImageLayoutDirection Direction { get; }
[JsonIgnore]
protected override bool isAnimation => true;
[JsonIgnore]
protected override bool isLargeTile => false;
protected override bool isComposedOfMultipleTiles => false;
public override Size GetSize(Size tileSize) => new Size(tileSize.Width * (Direction == ImageLayoutDirection.Horizontal ? Count : 1), tileSize.Height * (Direction == ImageLayoutDirection.Vertical ? Count : 1));
public AtlasGroupAnimation(string name, int row, int column, int frameCount, ImageLayoutDirection direction, int frameTime = Animation.MINIMUM_FRAME_TIME)
: base(name, row, column)
public AtlasAnimation(string name, int row, int column, int frameCount, ImageLayoutDirection direction, int frameTime = Animation.MINIMUM_FRAME_TIME, bool allowCustomColor = default)
: base(name, row, column, allowCustomColor)
{
Count = frameCount;
_frameCount = frameCount;
Direction = direction;
FrameTime = frameTime;
}

View File

@@ -17,32 +17,50 @@
**/
using System;
using System.Drawing;
using Newtonsoft.Json;
namespace PckStudio.Core
{
public abstract class AtlasGroup
{
[JsonProperty("name", Required = Required.Always, Order = 0)]
public string Name { get; set; }
[JsonProperty("row", Required = Required.Always, Order = 1)]
public int Row { get; }
[JsonProperty("column", Required = Required.Always, Order = 2)]
public int Column { get; }
[JsonProperty("allowCustomColor", DefaultValueHandling = DefaultValueHandling.Populate)]
public bool AllowCustomColor { get; }
[JsonIgnore]
public virtual int Count => 1;
[JsonIgnore]
protected abstract bool isAnimation { get; }
[JsonIgnore]
protected abstract bool isLargeTile { get; }
[JsonIgnore]
protected abstract bool isComposedOfMultipleTiles { get; }
[JsonProperty("direction")]
public virtual ImageLayoutDirection Direction => Column > Row ? ImageLayoutDirection.Vertical : ImageLayoutDirection.Horizontal;
public AtlasGroup(string name, int row, int column)
public AtlasGroup(string name, int row, int column, bool allowCustomColor)
{
Name = name;
Row = Math.Max(0, row);
Column = Math.Max(0, column);
AllowCustomColor = allowCustomColor;
}
public bool IsAnimation() => isAnimation;
public bool IsLargeTile() => isLargeTile;
public bool IsComposedOfMultipleTiles() => isComposedOfMultipleTiles;
public abstract Size GetSize(Size tileSize);
internal virtual Rectangle[] GetTileArea(Size tileSize)
{
return [new Rectangle(new Point(Row * tileSize.Width, Column * tileSize.Height), GetSize(tileSize))];
}
}
}

View File

@@ -0,0 +1,60 @@
/* Copyright (c) 2025-present miku-666
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1.The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
**/
using System;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using PckStudio.Core.Extensions;
using PckStudio.Core.Json;
namespace PckStudio.Core
{
public class AtlasGroupJsonConverter : JsonConverter<AtlasGroup>
{
public override AtlasGroup ReadJson(JsonReader reader, Type objectType, AtlasGroup existingValue, bool hasExistingValue, JsonSerializer serializer)
{
JObject jObject = JObject.Load(reader);
if (!jObject.TryGetValue("name", out string name) || !jObject.TryGetValue("row", out int row) || !jObject.TryGetValue("column", out int column))
return default;
bool allowCustomColor = default;
jObject.TryGetValue("allowCustomColor", out allowCustomColor);
if (jObject.TryGetValue("overlay", out JsonRowAndColumn rowsAndColumns))
return new AtlasOverlayGroup(name, row, column, rowsAndColumns, allowCustomColor);
int frameTime = Animation.MINIMUM_FRAME_TIME;
int frameCount = default;
int rowSpan = default;
int columnSpan = default;
ImageLayoutDirection direction = default;
bool isAnimation = jObject.TryGetValue("frameTime", out frameTime) &&
jObject.TryGetValue("frameCount", out frameCount) &&
jObject.TryGetValue("direction", out direction);
bool isLargeTile = jObject.TryGetValue("rowSpan", out rowSpan) && jObject.TryGetValue("columnSpan", out columnSpan);
if (isAnimation && isLargeTile)
return new AtlasLargeTileAnimation(name, row, column, rowSpan, columnSpan, frameCount, direction, frameTime, allowCustomColor);
if (isAnimation)
return new AtlasAnimation(name, row, column, frameCount, direction, frameTime, allowCustomColor);
if (isLargeTile)
return new AtlasLargeTile(name, row, column, rowSpan, columnSpan, allowCustomColor);
return default;
}
public override void WriteJson(JsonWriter writer, AtlasGroup value, JsonSerializer serializer) => serializer.Serialize(writer, value);
}
}

View File

@@ -17,24 +17,32 @@
**/
using System;
using System.Drawing;
using Newtonsoft.Json;
namespace PckStudio.Core
{
internal sealed class AtlasGroupLargeTile : AtlasGroup
internal sealed class AtlasLargeTile : AtlasGroup
{
[JsonProperty("rowSpan")]
public int RowSpan { get; }
[JsonProperty("columnSpan")]
public int ColumnSpan { get; }
[JsonIgnore]
public override int Count => RowSpan * ColumnSpan;
[JsonIgnore]
protected override bool isAnimation => false;
[JsonIgnore]
protected override bool isLargeTile => true;
protected override bool isComposedOfMultipleTiles => false;
public override Size GetSize(Size tileSize) => new Size(RowSpan * tileSize.Width, ColumnSpan * tileSize.Height);
public AtlasGroupLargeTile(string name, int row, int column, int rowSpan, int columnSpan)
: base(name, row, column)
public AtlasLargeTile(string name, int row, int column, int rowSpan, int columnSpan, bool allowCustomColor)
: base(name, row, column, allowCustomColor)
{
RowSpan = Math.Max(1, rowSpan);
ColumnSpan = Math.Max(1, columnSpan);

View File

@@ -19,30 +19,43 @@ using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using Newtonsoft.Json;
namespace PckStudio.Core
{
internal sealed class AtlasGroupLargeTileAnimation : AtlasGroup
internal sealed class AtlasLargeTileAnimation : AtlasGroup
{
private AtlasGroupLargeTile[] _largeTiles;
[JsonIgnore]
private AtlasLargeTile[] _largeTiles;
[JsonProperty("frameCount")]
private int _frameCount;
[JsonProperty("rowSpan")]
public int RowSpan { get; }
[JsonProperty("columnSpan")]
public int ColumnSpan { get; }
[JsonProperty("frameTime")]
public int FrameTime { get; }
[JsonIgnore]
public override int Count => RowSpan * ColumnSpan * _frameCount;
[JsonProperty("direction")]
public override ImageLayoutDirection Direction { get; }
[JsonIgnore]
protected override bool isAnimation => true;
[JsonIgnore]
protected override bool isLargeTile => true;
protected override bool isComposedOfMultipleTiles => false;
public override Size GetSize(Size tileSize) => new Size(RowSpan * tileSize.Width * (Direction == ImageLayoutDirection.Horizontal ? _frameCount : 1), ColumnSpan * tileSize.Height * (Direction == ImageLayoutDirection.Vertical ? _frameCount : 1));
public AtlasGroupLargeTileAnimation(string name, int row, int column, int rowSpan, int columnSpan, int frameCount, ImageLayoutDirection direction, int frameTime = Animation.MINIMUM_FRAME_TIME)
: base(name, row, column)
public AtlasLargeTileAnimation(string name, int row, int column, int rowSpan, int columnSpan, int frameCount, ImageLayoutDirection direction, int frameTime = Animation.MINIMUM_FRAME_TIME, bool allowCustomColor = default)
: base(name, row, column, allowCustomColor)
{
_frameCount = Math.Abs(frameCount);
RowSpan = Math.Max(1, rowSpan);
@@ -52,16 +65,16 @@ namespace PckStudio.Core
_largeTiles = InternalGetLargeTiles().ToArray();
}
private IEnumerable<AtlasGroupLargeTile> InternalGetLargeTiles()
private IEnumerable<AtlasLargeTile> InternalGetLargeTiles()
{
for (int i = 0; i < _frameCount; i++)
{
yield return new AtlasGroupLargeTile($"{Name}_{i}", Row + (Direction == ImageLayoutDirection.Horizontal ? i * RowSpan : 0), Column + (Direction == ImageLayoutDirection.Vertical ? i * ColumnSpan : 0), RowSpan, ColumnSpan);
yield return new AtlasLargeTile($"{Name}_{i}", Row + (Direction == ImageLayoutDirection.Horizontal ? i * RowSpan : 0), Column + (Direction == ImageLayoutDirection.Vertical ? i * ColumnSpan : 0), RowSpan, ColumnSpan, AllowCustomColor);
}
yield break;
}
internal AtlasGroupLargeTile GetTile(int row, int col)
internal AtlasLargeTile GetTile(int row, int col)
{
if (!IsInRange(row, col))
return default;
@@ -74,6 +87,6 @@ namespace PckStudio.Core
return Row <= row && row < (Row + (RowSpan * (Direction == ImageLayoutDirection.Horizontal ? _frameCount : 1))) && Column <= col && col < (Column + (ColumnSpan * (Direction == ImageLayoutDirection.Horizontal ? _frameCount : 1)));
}
internal IEnumerable<AtlasGroupLargeTile> GetLargeTiles() => _largeTiles;
internal IEnumerable<AtlasLargeTile> GetLargeTiles() => _largeTiles;
}
}

View File

@@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using PckStudio.Core.Json;
namespace PckStudio.Core
{
internal class AtlasOverlayGroup : AtlasGroup
{
private JsonRowAndColumn _overlayAtlasLocation;
public AtlasOverlayGroup(string name, int row, int column, JsonRowAndColumn overlayAtlasLocation, bool allowCustomColor)
: base(name, row, column, allowCustomColor)
{
_overlayAtlasLocation = overlayAtlasLocation;
}
protected override bool isAnimation => false;
protected override bool isLargeTile => false;
protected override bool isComposedOfMultipleTiles => true;
public override Size GetSize(Size tileSize) => tileSize;
internal override Rectangle[] GetTileArea(Size tileSize) => [new Rectangle(new Point(Row * tileSize.Width, Column * tileSize.Height), tileSize), new Rectangle(new Point(_overlayAtlasLocation.Row * tileSize.Width, _overlayAtlasLocation.Column * tileSize.Height), tileSize)];
}
}

View File

@@ -16,6 +16,7 @@
* 3. This notice may not be removed or altered from any source distribution.
**/
using System;
using System.Diagnostics;
using System.Drawing;
namespace PckStudio.Core
@@ -44,6 +45,7 @@ namespace PckStudio.Core
internal void SetGroup(AtlasGroup group)
{
Debug.Assert(_group is null, $"Tile is already part of group:'{_group?.Name}'");
_group = group;
}

24
PckStudio.Core/Box.cs Normal file
View File

@@ -0,0 +1,24 @@
using System.Numerics;
using Newtonsoft.Json;
namespace PckStudio.Core
{
public class Box(Vector3 position, Vector3 size, Vector2 uv, float inflate, bool mirror)
{
[JsonProperty("pos", Required = Required.Always)]
public Vector3 Position { get; } = position;
[JsonProperty("size", Required = Required.Always)]
public Vector3 Size { get; } = size;
[JsonProperty("uv", Required = Required.Always)]
public Vector2 Uv { get; } = uv;
[JsonProperty("mirror", NullValueHandling = NullValueHandling.Ignore)]
public float Inflate { get; } = inflate;
[JsonProperty("inflate", NullValueHandling = NullValueHandling.Ignore)]
public bool Mirror { get; } = mirror;
}
}

View File

@@ -0,0 +1,37 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using OMI.Formats.Color;
namespace PckStudio.Core.Colors
{
public class AbstractColorContainer
{
public AbstractColorContainer(IDictionary<string, Color> colors, IDictionary<string, (Color Surface, Color Underwater, Color Fog)> waterColors)
{
Colors = colors;
WaterColors = waterColors;
}
public bool HasColor(string colorName) => Colors.ContainsKey(colorName) || WaterColors.ContainsKey(colorName);
public static AbstractColorContainer FromColorContainer(ColorContainer colorContainer)
{
IDictionary<string, Color> colors = colorContainer.Colors
.GroupBy(c => c.Name)
.Select(grp => grp.FirstOrDefault())
.ToDictionary(c => c.Name, c => c.ColorPallette);
IDictionary<string, (Color, Color, Color)> waterColors = colorContainer.WaterColors
.GroupBy(c => c.Name)
.Select(grp => grp.FirstOrDefault())
.ToDictionary(c => c.Name, c => (c.SurfaceColor, c.UnderwaterColor, c.FogColor));
return new AbstractColorContainer(colors, waterColors);
}
public IDictionary<string, Color> Colors { get; }
public IDictionary<string, (Color Surface, Color Underwater, Color Fog)> WaterColors { get; }
}
}

View File

@@ -5,40 +5,47 @@ using System.Drawing;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Windows.Documents;
using OMI;
using OMI.Formats.Color;
using OMI.Formats.GameRule;
using OMI.Formats.Languages;
using OMI.Formats.Model;
using OMI.Formats.Pck;
using OMI.Workers.Color;
using OMI.Workers.GameRule;
using OMI.Workers.Language;
using OMI.Workers.Material;
using OMI.Workers.Model;
using OMI.Workers.Pck;
using PckStudio.Core.App;
using PckStudio.Core.Colors;
using PckStudio.Core.Deserializer;
using PckStudio.Core.Extensions;
using PckStudio.Core.FileFormats;
using PckStudio.Core.Interfaces;
using PckStudio.Core.IO.PckAudio;
using PckStudio.Core.Properties;
using PckStudio.Core.Model;
using PckStudio.Interfaces;
namespace PckStudio.Core.DLC
{
public sealed class DLCManager
public class DLCManager
{
public static DLCManager Default { get; } = new DLCManager(default, AppLanguage.SystemDefault);
internal const string DEFAULT_TEXTURE_PACK_FILENAME = "TexturePack.pck";
internal const string DEFAULT_MINIGAME_PACK_FILENAME = "WorldPack.pck";
internal const string DATA_DIRECTORY_NAME = "Data";
internal const string PACKAGE_DISPLAYNAME_ID = "IDS_DISPLAY_NAME";
private const string BASE_SAVE_NAME_GRF_PARAMETER_KEY = "baseSaveName";
private const string GRF_MAP_OPTIONS_NAME = "MapOptions";
private const string TEXTURE_PACK_DATA_PATH_KEY = "DATAPATH";
private const string CAPE_PATH_KEY = "CAPEPATH";
public ByteOrder ByteOrder => _byteOrder;
public ConsolePlatform Platform => _platform;
public DLCPackageContentSerilasationType ContentSerilasationType { get; set; } = DLCPackageContentSerilasationType.Local;
/// <summary>
/// See <see cref="AvailableLanguages"/> for details.
/// </summary>
@@ -48,6 +55,7 @@ namespace PckStudio.Core.DLC
private readonly Random _rng = new Random();
private ByteOrder _byteOrder;
private ConsolePlatform _platform;
private PckFileCompiler _pckFileCompiler;
/// <param name="byteOrder"></param>
@@ -57,6 +65,7 @@ namespace PckStudio.Core.DLC
{
_platform = platform;
_byteOrder = GetByteOrderForPlatform(Platform);
_pckFileCompiler = new PckFileCompiler(_byteOrder, GetPlatformCompressionType(), GameRuleFile.CompressionLevel.None);
SetPreferredLanguage(preferredLanguage);
}
@@ -82,7 +91,7 @@ namespace PckStudio.Core.DLC
DLCPackageType.MG01 => new DLCBattlePackage(name, identifier),
DLCPackageType.MG02 => new DLCMiniGamePackage(name, identifier, packageType, MiniGameId.Tumble),
DLCPackageType.MG03 => new DLCMiniGamePackage(name, identifier, packageType, MiniGameId.Glide),
DLCPackageType.Invalid => InvalidDLCPackage.Instance,
DLCPackageType.Invalid => DLCPackage.Invalid,
_ => throw new ArgumentException("Unable to create DLC Package of 'Unknown' type."),
};
@@ -90,7 +99,7 @@ namespace PckStudio.Core.DLC
localisation.AddLanguage(PreferredLanguage);
localisation.AddLocKey(PACKAGE_DISPLAYNAME_ID, name);
_packageRegistry.RegisterPackage(identifier, package, localisation);
return package;
}
@@ -102,7 +111,7 @@ namespace PckStudio.Core.DLC
throw new Exception($"{nameof(Platform)} is Unknown.");
if (!IsValidPckFile(fileInfo))
return InvalidDLCPackage.Instance;
return DLCPackage.Invalid;
using Stream stream = fileInfo.OpenRead();
@@ -113,14 +122,14 @@ namespace PckStudio.Core.DLC
if (!pckFile.TryGetAsset("0", PckAssetType.InfoFile, out PckAsset zeroAsset))
{
Trace.TraceError("Could not find asset named:'0'.");
return new UnknownDLCPackage(fileInfo.Name, pckFile);
return new RawAssetDLCPackage(fileInfo.Name, pckFile, ByteOrder);
}
int identifier = (zeroAsset?.HasProperty("PACKID") ?? default) ? zeroAsset.GetProperty("PACKID", int.Parse) : -1;
if (identifier <= 0 || identifier > GameConstants.MAX_PACK_ID)
int identifier = zeroAsset.HasProperty("PACKID") ? zeroAsset.GetProperty("PACKID", int.Parse) : -1;
if (!identifier.IsWithinRangeOf(1, GameConstants.MAX_PACK_ID))
{
Trace.TraceError($"{nameof(identifier)}({identifier}) was out of range!");
return new UnknownDLCPackage(fileInfo.Name, pckFile);
return new RawAssetDLCPackage(fileInfo.Name, pckFile, ByteOrder);
}
if (_packageRegistry.ContainsPackage(identifier))
@@ -128,16 +137,21 @@ namespace PckStudio.Core.DLC
LOCFile localisation = pckFile.GetAssetsByType(PckAssetType.LocalisationFile).FirstOrDefault()?.GetData(new LOCFileReader());
if (localisation is null)
return new UnknownDLCPackage(fileInfo.Name, pckFile);
{
Trace.TraceError("No localisation asset found.");
return new RawAssetDLCPackage(fileInfo.Name, pckFile, ByteOrder);
}
IDLCPackage package = ScanForPackageType(fileInfo, identifier, pckFile, localisation, fileReader);
IDLCPackage package = LoadDLCPackage(fileInfo, identifier, pckFile, localisation, fileReader);
if (package.GetDLCPackageType() != DLCPackageType.Invalid)
{
_packageRegistry.RegisterPackage(identifier, package, localisation);
}
return package;
return new RawAssetDLCPackage(fileInfo.Name, pckFile, ByteOrder);
}
public bool CloseDLCPackage(int identifier) => _packageRegistry.UnregisterPackage(identifier);
internal LOCFile GetLocalisation(int identifier)
{
return _packageRegistry.ContainsPackage(identifier) ? _packageRegistry.GetLocalisation(identifier) : default;
@@ -156,7 +170,7 @@ namespace PckStudio.Core.DLC
return true;
}
private IDLCPackage ScanForPackageType(FileInfo fileInfo, int identifier, PckFile pckFile, LOCFile localisation, PckFileReader fileReader)
private IDLCPackage LoadDLCPackage(FileInfo fileInfo, int identifier, PckFile pckFile, LOCFile localisation, PckFileReader fileReader)
{
bool hasLanguage = localisation?.Languages?.Contains(PreferredLanguage) ?? default;
@@ -170,52 +184,61 @@ namespace PckStudio.Core.DLC
bool couldBeMiniGamePack = fileInfo.Name == DEFAULT_MINIGAME_PACK_FILENAME;
bool hasSkins = TryGetDLCSkinPackage(name, identifier, pckFile, fileReader, out IDLCPackage skinPackage);
DLCPackageType dlcPackageType = hasSkins ? DLCPackageType.SkinPack : DLCPackageType.Unknown;
DirectoryInfo dataDirectoryInfo = fileInfo.Directory.EnumerateDirectories().Where(dirInfo => dirInfo.Name == DATA_DIRECTORY_NAME).FirstOrDefault();
if (dataDirectoryInfo is null)
return hasSkins ? skinPackage : InvalidDLCPackage.Instance;
bool hasTexturePack = TryGetTexturePack(name, description, identifier, dataDirectoryInfo, pckFile, fileReader, out IDLCPackage texturePackage);
if (hasTexturePack)
{
dlcPackageType = DLCPackageType.TexturePack;
}
Dictionary<string, IDictionary<string, byte[]>> mapData = GetMapData(pckFile, dataDirectoryInfo);
if (mapData.Count == 1)
{
dlcPackageType = DLCPackageType.MashUpPack;
}
Debug.WriteLine(dlcPackageType);
return new UnknownDLCPackage(name, pckFile);
}
private Dictionary<string, IDictionary<string, byte[]>> GetMapData(PckFile pck, DirectoryInfo dataDirectory)
{
GameRuleFile.CompressionType compressionType = GetPlatformCompressionType();
var reader = new GameRuleFileReader(compressionType);
IEnumerable<string> values = pck.GetAssetsByType(PckAssetType.GameRulesFile)
.Concat(pck.GetAssetsByType(PckAssetType.GameRulesHeader))
.Select(asset => asset.GetData(reader))
.SelectMany(grf => grf.Root.GetRules().Where(rule => rule.Name == "MapOptions" && rule.ContainsParameter("baseSaveName")))
.Select(rule => rule.GetRule("MapOptions").GetParameterValue("baseSaveName"));
Dictionary<string, IDictionary<string, byte[]>> saves = new Dictionary<string, IDictionary<string, byte[]>>();
foreach (FileInfo worldFile in dataDirectory.EnumerateFiles("*.mcs").Where(file => values.Contains(file.Name)))
{
IDictionary<string, byte[]> save = MapReader.OpenSave(worldFile.OpenRead());
saves.Add(worldFile.Name, save);
Trace.TraceInformation("No data directory found.");
return skinPackage ?? new RawAssetDLCPackage(name, pckFile, ByteOrder);
}
return saves;
bool hasTexturePack = TryGetTexturePack(name, description, identifier, dataDirectoryInfo, pckFile, fileReader, out IDLCPackage texturePackage);
if (!hasTexturePack)
{
Trace.TraceWarning("Couldn't parse texturepack.");
return skinPackage ?? new RawAssetDLCPackage(name, pckFile, ByteOrder);
}
PckAudioFile pckAudioFile = pckFile.GetAssetsByType(PckAssetType.AudioFile).FirstOrDefault()?.GetData(new PckAudioFileReader(ByteOrder));
IDictionary<string, byte[]> audios = default;
if (pckAudioFile != null)
{
var songs = pckAudioFile.Categories.SelectMany(audioCategory => audioCategory.SongNames).ToList();
audios = dataDirectoryInfo.EnumerateFiles("*.binka")
.Where(audioFile => songs.Contains(Path.GetFileNameWithoutExtension(audioFile.Name)))
.ToDictionary(audioFile => audioFile.Name, audioFile => File.ReadAllBytes(audioFile.FullName));
}
GameRuleFile.CompressionType compressionType = GetPlatformCompressionType();
var reader = new GameRuleFileReader(compressionType);
IEnumerable<GameRuleFile> gameRules = pckFile.GetAssetsByType(PckAssetType.GameRulesFile)
.Concat(pckFile.GetAssetsByType(PckAssetType.GameRulesHeader))
.Select(asset => asset.GetData(reader));
Dictionary<string, SaveData> mapData = GetMapData(gameRules, dataDirectoryInfo);
if (mapData.Count == 0)
return texturePackage ?? skinPackage ?? new RawAssetDLCPackage(name, pckFile, ByteOrder);
if (mapData.Count == 1)
return new DLCMashUpPackage(name, description, identifier, null, null, pckAudioFile, audios, parentPackage: null, skinPackage: skinPackage, texturePackage: texturePackage);
return new RawAssetDLCPackage(name, pckFile, ByteOrder);
}
private Dictionary<string, SaveData> GetMapData(IEnumerable<GameRuleFile> gameRuleFiles, DirectoryInfo dataDirectory)
{
IEnumerable<string> values = gameRuleFiles
.SelectMany(grf => grf.Root.GetRules().Where(rule => rule.Name == GRF_MAP_OPTIONS_NAME && rule.ContainsParameter(BASE_SAVE_NAME_GRF_PARAMETER_KEY)))
.Select(rule => rule.GetParameterValue(BASE_SAVE_NAME_GRF_PARAMETER_KEY));
return dataDirectory.EnumerateFiles("*.mcs")
.Where(file => values.Contains(file.Name))
.ToDictionary(worldFile => worldFile.Name, worldFile => MapReader.OpenSaveData(worldFile.OpenRead()));
}
private bool TryGetTexturePack(string name, string description, int identifier, DirectoryInfo dataDirectoryInfo, PckFile pckFile, PckFileReader pckFormatReader, out IDLCPackage texturePackage)
{
{
if (dataDirectoryInfo is null)
{
texturePackage = default;
@@ -229,19 +252,19 @@ namespace PckStudio.Core.DLC
}
DLCTexturePackage.TextureResolution resolution = DLCTexturePackage.GetTextureResolutionFromString(texturePackInfo.Filename);
string dataPath = texturePackInfo.GetProperty("DATAPATH");
string dataPath = texturePackInfo.GetProperty(TEXTURE_PACK_DATA_PATH_KEY);
if (string.IsNullOrWhiteSpace(dataPath))
{
texturePackage = default;
return false;
}
}
PckFile infoPck = texturePackInfo.GetData(pckFormatReader);
FileInfo texturePackFileInfo = dataDirectoryInfo.EnumerateFiles().Where(fileInfo => fileInfo.Name == dataPath).FirstOrDefault();
if (!IsValidPckFile(texturePackFileInfo))
{
{
texturePackage = null;
return false;
}
@@ -250,16 +273,8 @@ namespace PckStudio.Core.DLC
PckFile texturePackPck = pckFormatReader.FromStream(texturePackFileStream);
texturePackage = GetTexturePackageFromPckFile(name, description, identifier, infoPck, texturePackPck, resolution);
IEnumerable<FileInfo> audioFiles = dataDirectoryInfo.EnumerateFiles("*.binka");
IDictionary<string, byte[]> audios = new Dictionary<string, byte[]>();
foreach (FileInfo audioFile in audioFiles)
{
byte[] data = File.ReadAllBytes(audioFile.FullName);
audios.Add(audioFile.Name, data);
}
return texturePackage is not null;
}
}
private IDLCPackage GetTexturePackageFromPckFile(string name, string description, int identifier, PckFile infoPck, PckFile dataPck, DLCTexturePackage.TextureResolution resolution)
{
@@ -267,68 +282,103 @@ namespace PckStudio.Core.DLC
return null;
if (!infoPck.TryGetAsset("comparison.png", PckAssetType.TextureFile, out PckAsset comparisonAsset))
{
Trace.TraceError($"Could not find 'comparison.png'.");
}
Trace.TraceWarning($"Could not find 'comparison.png'.");
if (!infoPck.TryGetAsset("icon.png", PckAssetType.TextureFile, out PckAsset iconnAsset))
{
Trace.TraceError($"Could not find 'icon.png'.");
}
Trace.TraceWarning($"Could not find 'icon.png'.");
Image comparisonImg = comparisonAsset?.GetTexture();
Image iconImg = iconnAsset?.GetTexture() ?? Resources.unknown_pack;
DLCTexturePackage.MetaData metaData = new DLCTexturePackage.MetaData(comparisonImg, iconImg);
DLCTexturePackage.MetaData metaData = new DLCTexturePackage.MetaData(comparisonAsset?.GetTexture(), iconnAsset?.GetTexture());
bool hasTerrainAtlas = TryGetAtlasFromResourceCategory(dataPck, ResourceCategory.BlockAtlas, out Atlas terrainAtlas);
bool hasItemAtlas = TryGetAtlasFromResourceCategory(dataPck, ResourceCategory.ItemAtlas, out Atlas itemAtlas);
bool hasParticleAtlas = TryGetAtlasFromResourceCategory(dataPck, ResourceCategory.ParticleAtlas, out Atlas particleAtlas);
bool hasPaintingAtlas = TryGetAtlasFromResourceCategory(dataPck, ResourceCategory.PaintingAtlas, out Atlas paintingAtlas);
TryGetAtlasFromResourceCategory(dataPck, AtlasResource.AtlasType.BlockAtlas, out Atlas terrainAtlas);
TryGetAtlasFromResourceCategory(dataPck, AtlasResource.AtlasType.ItemAtlas, out Atlas itemAtlas);
TryGetAtlasFromResourceCategory(dataPck, AtlasResource.AtlasType.ParticleAtlas, out Atlas particleAtlas);
TryGetAtlasFromResourceCategory(dataPck, AtlasResource.AtlasType.PaintingAtlas, out Atlas paintingAtlas);
TryGetAtlasFromResourceCategory(dataPck, AtlasResource.AtlasType.MoonPhaseAtlas, out Atlas moonPhaseAtlas);
TryGetAtlasFromResourceCategory(dataPck, AtlasResource.AtlasType.MapIconAtlas, out Atlas mapIconsAtlas);
TryGetAtlasFromResourceCategory(dataPck, AtlasResource.AtlasType.AdditionalMapIconsAtlas, out Atlas additionalMapIconsAtlas);
string itemAnimationAssetPath = ResourceLocation.GetPathFromCategory(ResourceCategory.ItemAnimation);
string blockAnimationAssetPath = ResourceLocation.GetPathFromCategory(ResourceCategory.BlockAnimation);
IPckAssetDeserializer<Animation> deserializer = AnimationDeserializer.DefaultDeserializer;
Animation compassAnimation = dataPck.TryGetAsset(itemAnimationAssetPath + "/compass.png", PckAssetType.TextureFile, out PckAsset compassAsset) ? comparisonAsset.GetDeserializedData(deserializer) : Animation.CreateEmpty();
Animation clockAnimation = dataPck.TryGetAsset(itemAnimationAssetPath + "/clock.png", PckAssetType.TextureFile, out PckAsset clockAsset) ? clockAsset.GetDeserializedData(deserializer) : Animation.CreateEmpty();
if (compassAnimation.FrameCount == 0)
IDictionary<string, Animation> itemAnimations = dataPck.GetDirectoryContent(itemAnimationAssetPath, PckAssetType.TextureFile)
.Where(asset => !asset.IsMipmappedFile())
.ToDictionary(asset => Path.GetFileNameWithoutExtension(asset.Filename), deserializer.Deserialize);
IDictionary<string, Animation> blockAnimations = dataPck.GetDirectoryContent(blockAnimationAssetPath, PckAssetType.TextureFile)
.Where(asset => !asset.IsMipmappedFile())
.ToDictionary(asset => Path.GetFileNameWithoutExtension(asset.Filename), deserializer.Deserialize);
if (!itemAnimations.ContainsKey("compass"))
Trace.TraceError("No compass animation found!");
if (clockAnimation.FrameCount == 0)
if (!itemAnimations.ContainsKey("clock"))
Trace.TraceError("No clock animation found!");
ITryGet<string, Image> tryGet = TryGet<string, Image>.FromDelegate((string path, out Image image) =>
ITryGet<string, Image> tryGetTexture = TryGet<string, Image>.FromDelegate((string path, out Image image) =>
{
bool success = dataPck.TryGetAsset(path, PckAssetType.TextureFile, out PckAsset asset);
image = asset?.GetTexture();
return success;
});
Image[] blockEntityBreakingAnimation = new Image[10];
for (int i = 0; i < blockEntityBreakingAnimation.Length; i++)
ImageDeserializer defaultDeserializer = ImageDeserializer.DefaultDeserializer;
IEnumerable<Image> blockEntityBreakingFrames = dataPck.GetDirectoryContent("res/textures/", PckAssetType.TextureFile)
.Select(defaultDeserializer.Deserialize);
Animation blockEntityBreakAnimation = new Animation(blockEntityBreakingFrames);
ColorContainer colorContainer = dataPck.GetAssetsByType(PckAssetType.ColourTableFile).FirstOrDefault()?.GetData(new COLFileReader()) ?? new ColorContainer();
IDictionary<string, Image> environmentTextures = dataPck.GetDirectoryContent("res/environment/", PckAssetType.TextureFile)
.ToDictionary(a => Path.GetFileNameWithoutExtension(a.Filename), defaultDeserializer.Deserialize);
environmentTextures.TryGetValue("clouds", out Image clouds);
environmentTextures.TryGetValue("rain", out Image rain);
environmentTextures.TryGetValue("snow", out Image snow);
DLCTexturePackage.EnvironmentData environmentData = new DLCTexturePackage.EnvironmentData(clouds, rain, snow);
IDictionary<string, Image> terrainTextures = dataPck.GetDirectoryContent("res/terrain/", PckAssetType.TextureFile)
.ToDictionary(a => Path.GetFileNameWithoutExtension(a.Filename), defaultDeserializer.Deserialize);
terrainTextures.TryGetValue("sun", out Image sun);
terrainTextures.TryGetValue("moon", out Image moon);
AbstractModelContainer customModels = null;
if (dataPck.TryGetAsset("models.bin", PckAssetType.ModelsFile, out PckAsset modelsAsset))
{
if (dataPck.TryGetAsset("", PckAssetType.TextureFile, out PckAsset asset))
blockEntityBreakingAnimation[i] = asset.GetTexture();
ModelContainer models = modelsAsset.GetData(new ModelFileReader());
customModels = AbstractModelContainer.FromModelContainer(models, null);
}
ArmorSet[] armorSets = new ArmorSet[6]
{
ArmorSetDescription.Leather.GetArmorSet(tryGet),
ArmorSetDescription.Chain.GetArmorSet(tryGet),
ArmorSetDescription.Iron.GetArmorSet(tryGet),
ArmorSetDescription.Gold.GetArmorSet(tryGet),
ArmorSetDescription.Diamond.GetArmorSet(tryGet),
ArmorSetDescription.Turtle.GetArmorSet(tryGet)
};
return new DLCTexturePackage(name, description, identifier, metaData, resolution, terrainAtlas, itemAtlas, particleAtlas, paintingAtlas,
armorSets, null, null, null, null, null, null, null, null);
IDictionary<string, string> materials = dataPck.GetAssetsByType(PckAssetType.MaterialFile).FirstOrDefault()?.GetData(new MaterialFileReader())
.ToDictionary(mat => mat.Name, mat => mat.Type);
return new DLCTexturePackage(name, description, identifier, metaData, resolution,
terrainAtlas, itemAtlas, particleAtlas, paintingAtlas, moonPhaseAtlas, mapIconsAtlas, additionalMapIconsAtlas,
ArmorSetDescription.Leather.GetArmorSet(tryGetTexture),
ArmorSetDescription.Chain.GetArmorSet(tryGetTexture),
ArmorSetDescription.Iron.GetArmorSet(tryGetTexture),
ArmorSetDescription.Gold.GetArmorSet(tryGetTexture),
ArmorSetDescription.Diamond.GetArmorSet(tryGetTexture),
ArmorSetDescription.Turtle.GetArmorSet(tryGetTexture),
environmentData,
AbstractColorContainer.FromColorContainer(colorContainer),
customModels,
materials,
blockEntityBreakAnimation,
itemAnimations,
blockAnimations,
sun, moon,
parentPackage: null);
}
private bool TryGetAtlasFromResourceCategory(PckFile pck, ResourceCategory resourceCategory, out Atlas atlas)
private bool TryGetAtlasFromResourceCategory(PckFile pck, AtlasResource.AtlasType atlasType, out Atlas atlas)
{
ResourceLocation resourceLocation = ResourceLocation.GetFromCategory(resourceCategory);
if (!pck.TryGetAsset(resourceLocation.ToString(), PckAssetType.TextureFile, out PckAsset asset))
ResourceLocation resourceLocation = ResourceLocation.GetFromCategory(AtlasResource.GetId(atlasType));
if (!pck.TryGetAsset(resourceLocation.FullPath, PckAssetType.TextureFile, out PckAsset asset))
{
Trace.TraceWarning($"Could not find '{resourceLocation}'.");
Trace.TraceWarning($"Could not find '{resourceLocation.FullPath}'.");
atlas = null;
return false;
}
@@ -351,7 +401,7 @@ namespace PckStudio.Core.DLC
Skin.Skin GetSkinWithCape(PckAsset skinAsset)
{
Skin.Skin skin = skinAsset.GetSkin();
if (skinAsset.TryGetProperty("CAPEPATH", out string capeAssetPath) && pck.TryGetAsset(capeAssetPath, PckAssetType.CapeFile, out PckAsset capeAsset))
if (skinAsset.TryGetProperty(CAPE_PATH_KEY, out string capeAssetPath) && pck.TryGetAsset(capeAssetPath, PckAssetType.CapeFile, out PckAsset capeAsset))
skin.CapeId = capeAsset.GetId();
return skin;
}
@@ -367,8 +417,32 @@ namespace PckStudio.Core.DLC
skinPackage = new DLCSkinPackage(name, identifier, skins, capes, parentPackage);
return true;
}
public static GameRuleFile.CompressionType GetCompressionTypeForPlatform(ConsolePlatform platform)
{
switch (platform)
{
case ConsolePlatform.Xbox360:
return GameRuleFile.CompressionType.XMem;
case ConsolePlatform.PS3:
return GameRuleFile.CompressionType.Deflate;
case ConsolePlatform.XboxOne:
case ConsolePlatform.PS4:
case ConsolePlatform.PSVita:
case ConsolePlatform.WiiU:
case ConsolePlatform.Switch:
return GameRuleFile.CompressionType.Zlib;
case ConsolePlatform.Unknown:
default:
throw new ArgumentException("Platform was not set");
}
}
private GameRuleFile.CompressionType GetPlatformCompressionType() => GetCompressionTypeForPlatform(Platform);
private static string GetPreferredLanguage(AppLanguage appLanguage)
{
return appLanguage switch
@@ -424,5 +498,26 @@ namespace PckStudio.Core.DLC
_platform = platform;
_byteOrder = GetByteOrderForPlatform(platform);
}
public DLCPackageContent CompilePackage(IDLCPackage package)
{
LOCFile localisation = GetLocalisation(package.Identifier);
switch (package.GetDLCPackageType())
{
case DLCPackageType.Invalid:
break;
case DLCPackageType.RawAssets: return _pckFileCompiler.CompileRawAssets(package);
case DLCPackageType.SkinPack: return _pckFileCompiler.CompileSkinPackage(package, localisation);
case DLCPackageType.TexturePack: return _pckFileCompiler.CompileTexturePackage(package, localisation);
case DLCPackageType.MashUpPack: return _pckFileCompiler.CompileMashUpPackage(package, localisation);
case DLCPackageType.MG01:
break;
case DLCPackageType.MG02:
break;
case DLCPackageType.MG03:
break;
}
return DLCPackageContent.Empty;
}
}
}

View File

@@ -15,7 +15,7 @@ namespace PckStudio.Core.DLC
public sealed class DLCMashUpPackage : DLCPackage
{
public override string Description { get; }
private AbstractGameRule _gameRule { get; }
private AbstractGameRule _gameRule;
public bool HasAudioData => _pckAudio is not null && _audioData.Count > 0;
private IDLCPackage _skinPackage;
@@ -24,30 +24,45 @@ namespace PckStudio.Core.DLC
private IDictionary<string, byte[]> _audioData;
private PckAudioFile _pckAudio;
internal DLCMashUpPackage(string name, string description, int identifier, AbstractGameRule gameRule, IDLCPackage parentPackage, IDLCPackage skinPackage = null, IDLCPackage texturePackage = null)
internal DLCMashUpPackage(string name, string description, int identifier, AbstractGameRule gameRule, MapData mapData, PckAudioFile pckAudio, IDictionary<string, byte[]> audioData, IDLCPackage parentPackage, IDLCPackage skinPackage = null, IDLCPackage texturePackage = null)
: base(name, identifier, parentPackage)
{
Description = description;
_gameRule = gameRule;
_skinPackage = skinPackage;
_texturePackage = texturePackage;
_mapData = mapData;
_audioData = new Dictionary<string, byte[]>();
_pckAudio = pckAudio;
_audioData = audioData;
}
internal DLCMashUpPackage(string name, string description, int identifier)
: this(name, description, identifier, new RootGameRule(), null)
: this(name, description, identifier, new RootGameRule(), null, new PckAudioFile(), null, null)
{
_skinPackage = DLCSkinPackage.CreateEmpty(this);
_texturePackage = DLCTexturePackage.CreateDefaultPackage(this);
_audioData = new Dictionary<string, byte[]>();
_pckAudio = new PckAudioFile();
}
public override DLCPackageType GetDLCPackageType() => DLCPackageType.MashUpPack;
public IDLCPackage GetSkinPackage() => _skinPackage;
public IDLCPackage GetTexturePackage() => _texturePackage;
public AbstractGameRule GetGameRule() => _gameRule;
public PckAudioFile GetAudioPack() => _pckAudio;
public override DLCPackageType GetDLCPackageType() => DLCPackageType.MashUpPack;
public bool AddAudio(string name, byte[] audioData, PckAudioFile.Category category)
{
if (_audioData.ContainsKey(name) || !_pckAudio.HasCategory(category))
return false;
if (_pckAudio.TryGetCategory(category, out PckAudioFile.AudioCategory audioCategory))
{
audioCategory.SongNames.Add(name);
return true;
}
return false;
}
public AbstractGameRule GetGameRule() => _gameRule;
internal PckAudioFile GetAudioPack() => _pckAudio;
internal NamedData<byte[]>[] GetAudioFiles() => _audioData.Select(kv => new NamedData<byte[]>(kv.Key, kv.Value)).ToArray();
}

View File

@@ -10,6 +10,7 @@ namespace PckStudio.Core.DLC
{
public abstract class DLCPackage : IDLCPackage
{
public static IDLCPackage Invalid = new InvalidDLCPackage();
protected DLCPackage(string name, int identifier, IDLCPackage parentPackage)
{
Name = name;
@@ -17,6 +18,13 @@ namespace PckStudio.Core.DLC
ParentPackage = parentPackage;
}
private sealed class InvalidDLCPackage : DLCPackage
{
internal InvalidDLCPackage() : base(nameof(InvalidDLCPackage), -1, null) { }
public override DLCPackageType GetDLCPackageType() => DLCPackageType.Invalid;
}
public int Identifier { get; }
public string Name { get; } = string.Empty;

View File

@@ -0,0 +1,47 @@
using System;
using System.Collections.Generic;
using OMI.Formats.Pck;
namespace PckStudio.Core.DLC
{
public class DLCPackageContent
{
public static DLCPackageContent Empty => new DLCPackageContent(default);
internal bool IsEmpty { get; }
internal PckFile MainPck { get; }
internal DLCDataFolderContent DataFolder { get; }
public record DLCDataFolderContent
{
public NamedData<PckFile> TexturePck { get; }
public List<NamedData<byte[]>> Files { get; }
public DLCDataFolderContent(NamedData<PckFile> texturePck, NamedData<byte[]>[] files)
{
TexturePck = texturePck;
Files = new List<NamedData<byte[]>>(files);
}
public void AddFile(NamedData<byte[]> namedData) => Files.Add(namedData);
public void AddFiles(NamedData<byte[]>[] namedData) => Files.AddRange(namedData);
public void AddFile(string name, byte[] data) => AddFile(new NamedData<byte[]>(name, data));
}
public DLCPackageContent(PckFile mainPck, NamedData<PckFile> texturePck, NamedData<byte[]>[] dataFiles)
: this(mainPck, new(texturePck, dataFiles ?? Array.Empty<NamedData<byte[]>>()))
{
}
public DLCPackageContent(PckFile mainPck, DLCDataFolderContent dataFolderContent)
{
MainPck = mainPck;
DataFolder = dataFolderContent;
IsEmpty = mainPck is null;
}
public DLCPackageContent(PckFile mainPck) : this(mainPck, default) { }
}
}

View File

@@ -0,0 +1,8 @@
namespace PckStudio.Core.DLC
{
public enum DLCPackageContentSerilasationType : int
{
Local, //! create local folder with the value of: ('IDS_DISPLAY_NAME') and write all content into it.
Share //! zip file if texture or mashup pack, else just the pck file.
}
}

View File

@@ -29,5 +29,10 @@ namespace PckStudio.Core.DLC
internal bool ContainsPackage(int identifier) => _openPackages.ContainsKey(identifier) && _localisationFiles.ContainsKey(identifier);
internal LOCFile GetLocalisation(int identifier) => _localisationFiles[identifier];
internal bool UnregisterPackage(int identifier)
{
return _openPackages.Remove(identifier) && _localisationFiles.Remove(identifier);
}
}
}

View File

@@ -2,8 +2,8 @@
{
public enum DLCPackageType : int
{
Unknown = -1,
Invalid,
Invalid = -1,
RawAssets,
SkinPack,
TexturePack,
MashUpPack,

View File

@@ -11,13 +11,12 @@ namespace PckStudio.Core.DLC
public enum DLCSkinPackageOrder
{
ById,
CapesFirst,
SkinsFirst
ByName,
}
public sealed class DLCSkinPackage : DLCPackage
{
public DLCSkinPackageOrder SkinPackageOrder { get; set; } = DLCSkinPackageOrder.CapesFirst;
public DLCSkinPackageOrder SkinPackageOrder { get; set; } = DLCSkinPackageOrder.ById;
private readonly IDictionary<int, Image> _capes;
private readonly IDictionary<SkinIdentifier, Skin.Skin> _skins;
@@ -38,6 +37,7 @@ namespace PckStudio.Core.DLC
internal static IDLCPackage CreateEmpty(IDLCPackage parentPackage) => CreateEmpty(parentPackage.Name, parentPackage.Identifier, parentPackage);
public bool TryGetSkin(SkinIdentifier skinIdentifier, out Skin.Skin skin) => _skins.TryGetValue(skinIdentifier, out skin);
public bool TryGetCape(int capeId, out Image cape) => _capes.TryGetValue(capeId, out cape);
public bool ContainsSkin(SkinIdentifier skinIdentifier) => _skins.ContainsKey(skinIdentifier);

View File

@@ -7,12 +7,10 @@ using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using OMI.Formats.Color;
using OMI.Formats.Material;
using OMI.Formats.Model;
using OMI.Formats.Pck;
using OMI.Workers.Color;
using PckStudio.Core.Colors;
using PckStudio.Core.Extensions;
using PckStudio.Core.Interfaces;
using PckStudio.Core.Model;
using PckStudio.Core.Properties;
namespace PckStudio.Core.DLC
@@ -43,33 +41,44 @@ namespace PckStudio.Core.DLC
public Image IconImg { get; } = iconImg;
}
public sealed class EnvironmentData
public sealed class EnvironmentData(Image clouds, Image rain, Image snow)
{
public Image Clouds;
public Image Rain;
public Image Snow;
public Image Clouds = clouds;
public Image Rain = rain;
public Image Snow = snow;
}
public MetaData Info { get; }
//! Data for x{16}Data.pck
//! => colours.col
private IDictionary<string, Color> _colors;
private IDictionary<string, (Color surface, Color underwater, Color fog)> _waterColors;
private ModelContainer _customModels; //! can be null.. => models.bin
private MaterialContainer _materials; //! can be null..
private AbstractColorContainer _colorContainter;
private AbstractModelContainer _customModels; //! can be null.. => models.bin
private IDictionary<string, string> _materials; //! can be null..
//! terrain mipmaps will be generated automatically. Add mipmap option to settings menu ? -null
private Atlas _terrainAtlas;
private Atlas _itemsAtlas;
private Atlas _particlesAtlas;
private Atlas _paintingAtlas;
private ArmorSet[] _armorSets = new ArmorSet[6];
private Atlas _moonPhaseAtlas;
private ArmorSet _leatherArmorSet;
private ArmorSet _chainArmorSet;
private ArmorSet _ironArmorSet;
private ArmorSet _goldArmorSet;
private ArmorSet _diamondArmorSet;
private ArmorSet _turtleArmorSet;
private Atlas _mapIconsAtlas;
private Atlas _additionalMapIconsAtlas;
private EnvironmentData _environmentData;
private Animation _blockEntityBreakAnimation;
private IDictionary<string, Animation> _itemAnimations;
private IDictionary<string, Animation> _blockAnimations;
private Image _sun;
private Image _moon;
//! TODO: add resources from "res/misc/"
internal DLCTexturePackage(
string name,
@@ -81,14 +90,24 @@ namespace PckStudio.Core.DLC
Atlas itemsAtlas,
Atlas particlesAtlas,
Atlas paintingAtlas,
ArmorSet[] armorSets,
IDictionary<string, Color> colors,
IDictionary<string, (Color surface, Color underwater, Color fog)> waterColors,
ModelContainer customModels,
MaterialContainer materials,
Atlas moonPhaseAtlas,
Atlas mapIconsAtlas,
Atlas additionalMapIconsAtlas,
ArmorSet leatherArmorSet,
ArmorSet chainArmorSet,
ArmorSet ironArmorSet,
ArmorSet goldArmorSet,
ArmorSet diamondArmorSet,
ArmorSet turtleArmorSet,
EnvironmentData environmentData,
AbstractColorContainer colorContainter,
AbstractModelContainer customModels,
IDictionary<string, string> materials,
Animation blockEntityBreakAnimation,
IDictionary<string, Animation> itemAnimations,
IDictionary<string, Animation> blockAnimations,
Image sun,
Image moon,
IDLCPackage parentPackage
)
: base(name, identifier, parentPackage)
@@ -100,14 +119,24 @@ namespace PckStudio.Core.DLC
_itemsAtlas = itemsAtlas;
_particlesAtlas = particlesAtlas;
_paintingAtlas = paintingAtlas;
_armorSets = armorSets;
_colors = colors;
_waterColors = waterColors;
_moonPhaseAtlas = moonPhaseAtlas;
_mapIconsAtlas = mapIconsAtlas;
_additionalMapIconsAtlas = additionalMapIconsAtlas;
_leatherArmorSet = leatherArmorSet;
_chainArmorSet = chainArmorSet;
_ironArmorSet = ironArmorSet;
_goldArmorSet = goldArmorSet;
_diamondArmorSet = diamondArmorSet;
_turtleArmorSet = turtleArmorSet;
_environmentData = environmentData;
_colorContainter = colorContainter;
_customModels = customModels;
_materials = materials;
_blockEntityBreakAnimation = blockEntityBreakAnimation;
_itemAnimations = itemAnimations;
_blockAnimations = blockAnimations;
_itemAnimations = itemAnimations ?? new Dictionary<string, Animation>();
_blockAnimations = blockAnimations ?? new Dictionary<string, Animation>();
_sun = sun;
_moon = moon;
}
public TextureResolution GetResolution() => _resolution;
@@ -162,32 +191,40 @@ namespace PckStudio.Core.DLC
MetaData metadata = new MetaData(Resources.Comparison, Resources.TexturePackIcon);
Atlas terrain = Atlas.FromResourceLocation(Resources.terrain_atlas, ResourceLocation.GetFromCategory(ResourceCategory.BlockAtlas));
Atlas items = Atlas.FromResourceLocation(Resources.items_atlas, ResourceLocation.GetFromCategory(ResourceCategory.ItemAtlas));
Atlas particles = Atlas.FromResourceLocation(Resources.particles_atlas, ResourceLocation.GetFromCategory(ResourceCategory.ParticleAtlas));
Atlas painting = Atlas.FromResourceLocation(Resources.paintings_atlas, ResourceLocation.GetFromCategory(ResourceCategory.PaintingAtlas));
Atlas terrain = Atlas.FromResourceLocation(Resources.terrain_atlas, ResourceLocation.GetFromCategory(AtlasResource.GetId(AtlasResource.AtlasType.BlockAtlas)));
Atlas items = Atlas.FromResourceLocation(Resources.items_atlas, ResourceLocation.GetFromCategory(AtlasResource.GetId(AtlasResource.AtlasType.ItemAtlas)));
Atlas particles = Atlas.FromResourceLocation(Resources.particles_atlas, ResourceLocation.GetFromCategory(AtlasResource.GetId(AtlasResource.AtlasType.ParticleAtlas)));
Atlas painting = Atlas.FromResourceLocation(Resources.paintings_atlas, ResourceLocation.GetFromCategory(AtlasResource.GetId(AtlasResource.AtlasType.PaintingAtlas)));
Atlas moonPhases = Atlas.FromResourceLocation(Resources.moon_phases_atlas, ResourceLocation.GetFromCategory(AtlasResource.GetId(AtlasResource.AtlasType.MoonPhaseAtlas)));
Atlas mapIconsAtlas = Atlas.FromResourceLocation(Resources.map_icons_atlas, ResourceLocation.GetFromCategory(AtlasResource.GetId(AtlasResource.AtlasType.MapIconAtlas)));
Atlas additionalMapIconsAtlas = Atlas.FromResourceLocation(Resources.additional_map_icons_atlas, ResourceLocation.GetFromCategory(AtlasResource.GetId(AtlasResource.AtlasType.AdditionalMapIconsAtlas)));
//ColorContainer colors = new COLFileReader().FromStream(new MemoryStream());
IDictionary<string, Color> colors = null;
IDictionary<string, (Color, Color, Color)> waterColors = null;
Animation blockEntityBreakAnimation = new Animation(terrain.GetRange(0, 15, 10, ImageLayoutDirection.Horizontal).Select(t => t.Texture).ToArray(), true, 3);
ArmorSet[] armorSets = GetArmorSets();
IDictionary<string, Animation> itemAnimations = GetItemAnimations();
IDictionary<string, Animation> blockAnimations = GetBlockAnimations();
return new DLCTexturePackage(
name, description, identifier, metadata, resolution,
terrain, items, particles, painting,
armorSets,
colors, waterColors,
new ModelContainer(),
new MaterialContainer(),
terrain, items, particles, painting, moonPhases, mapIconsAtlas, additionalMapIconsAtlas,
new ArmorSet(ArmorSetDescription.CLOTH, Resources.cloth, Resources.cloth_b),
new ArmorSet(ArmorSetDescription.CHAIN, Resources.chain, default),
new ArmorSet(ArmorSetDescription.IRON, Resources.iron, default),
new ArmorSet(ArmorSetDescription.GOLD, Resources.gold, default),
new ArmorSet(ArmorSetDescription.DIAMOND, Resources.diamond, default),
new ArmorSet(ArmorSetDescription.TURTLE, Resources.turtle, default),
new EnvironmentData(Resources.clouds, Resources.rain, Resources.snow),
new AbstractColorContainer(colors, waterColors),
new AbstractModelContainer(),
new Dictionary<string, string>(),
blockEntityBreakAnimation,
itemAnimations,
blockAnimations,
sun: null,
moon: null,
parentPackage
);
}
@@ -200,19 +237,6 @@ namespace PckStudio.Core.DLC
internal Atlas GetPaintingAtlas() => _paintingAtlas;
private static ArmorSet[] GetArmorSets()
{
return new ArmorSet[6]
{
new ArmorSet(ArmorSetDescription.CLOTH, Resources.cloth, Resources.cloth_b),
new ArmorSet(ArmorSetDescription.CHAIN, Resources.chain, default),
new ArmorSet(ArmorSetDescription.IRON, Resources.iron, default),
new ArmorSet(ArmorSetDescription.GOLD, Resources.gold, default),
new ArmorSet(ArmorSetDescription.DIAMOND, Resources.diamond, default),
new ArmorSet(ArmorSetDescription.TURTLE, Resources.turtle, default)
};
}
private static IDictionary<string, Animation> GetItemAnimations()
{
return new Dictionary<string, Animation>()

View File

@@ -1,28 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using PckStudio.Core.Interfaces;
namespace PckStudio.Core.DLC
{
// Dummy class
internal sealed class InvalidDLCPackage : DLCPackage
{
internal static IDLCPackage Instance { get; } = new InvalidDLCPackage();
private InvalidDLCPackage(string name, int identifier, IDLCPackage parentPackage)
: base(name, identifier, parentPackage)
{
}
private InvalidDLCPackage()
: this(nameof(InvalidDLCPackage), -1, null)
{
}
public override DLCPackageType GetDLCPackageType() => DLCPackageType.Invalid;
}
}

View File

@@ -0,0 +1,139 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using OMI;
using OMI.Formats.GameRule;
using OMI.Formats.Languages;
using OMI.Formats.Pck;
using OMI.Workers.GameRule;
using OMI.Workers.Language;
using OMI.Workers.Pck;
using PckStudio.Core.Extensions;
using PckStudio.Core.Interfaces;
using PckStudio.Core.IO.PckAudio;
namespace PckStudio.Core.DLC
{
internal sealed class PckFileCompiler
{
private ByteOrder _byteOrder;
private GameRuleFile.CompressionType _compressionType;
private GameRuleFile.CompressionLevel _compressionLevel;
internal PckFileCompiler(ByteOrder byteOrder, GameRuleFile.CompressionType compressionType, GameRuleFile.CompressionLevel compressionLevel)
{
_byteOrder = byteOrder;
_compressionType = compressionType;
_compressionLevel = compressionLevel;
}
private PckFile CreateRootPckFile(int packId, int packVerison, LOCFile localisation)
{
PckFile mainPck = new PckFile();
PckAsset meta = mainPck.CreateNewAsset("0", PckAssetType.InfoFile);
meta.AddProperty("PACKID", packId);
meta.AddProperty("PACKVERSION", packVerison);
mainPck.CreateNewAsset("localisation.loc", PckAssetType.LocalisationFile, new LOCFileWriter(localisation, 2));
return mainPck;
}
internal DLCPackageContent CompileSkinPackage(IDLCPackage package, LOCFile localisation)
{
if (package is not DLCSkinPackage skinPackage)
return DLCPackageContent.Empty;
PckFile skinsPck = skinPackage.IsRootPackage ? CreateRootPckFile(package.Identifier, 0, localisation) : new PckFile();
foreach (KeyValuePair<int, Image> kv in skinPackage.GetCapes())
{
PckAsset capeAsset = skinsPck.CreateNewAsset($"dlccape{kv.Key:08}.png", PckAssetType.CapeFile);
capeAsset.SetTexture(kv.Value);
}
foreach (Skin.Skin skin in skinPackage.GetSkins())
{
skinsPck.AddSkin("", skin, localisation);
}
return new DLCPackageContent(skinsPck);
}
internal DLCPackageContent CompileTexturePackage(IDLCPackage package, LOCFile localisation)
{
if (package is not DLCTexturePackage texturePackage)
return DLCPackageContent.Empty;
PckFile texturePackInfoPck = new PckFile();
{
texturePackInfoPck.AddTexture("comparison.png", texturePackage.Info.ComparisonImg);
texturePackInfoPck.AddTexture("icon.png", texturePackage.Info.IconImg);
}
PckFile texturePck = new PckFile();
{
texturePck.AddTexture(ResourceLocations.GetPathFromCategory(AtlasResource.GetId(AtlasResource.AtlasType.ParticleAtlas)), texturePackage.GetParticleAtlas());
texturePck.AddTexture(ResourceLocations.GetPathFromCategory(AtlasResource.GetId(AtlasResource.AtlasType.ItemAtlas)), texturePackage.GetItemsAtlas());
texturePck.AddTexture(ResourceLocations.GetPathFromCategory(AtlasResource.GetId(AtlasResource.AtlasType.BlockAtlas)), texturePackage.GetTerrainAtlas());
texturePck.AddTexture(ResourceLocations.GetPathFromCategory(AtlasResource.GetId(AtlasResource.AtlasType.PaintingAtlas)), texturePackage.GetPaintingAtlas());
}
if (package.IsRootPackage)
{
PckFile mainPck = CreateRootPckFile(package.Identifier, 0, localisation);
DLCTexturePackage.TextureResolution res = texturePackage.GetResolution();
PckAsset textureInfoAsset = mainPck.CreateNewAsset($"{res}/{res}Info.pck", PckAssetType.TexturePackInfoFile, new PckFileWriter(texturePackInfoPck, _byteOrder));
textureInfoAsset.AddProperty("PACKID", "0");
textureInfoAsset.AddProperty("DATAPATH", $"{res}Data.pck");
return new DLCPackageContent(mainPck, new NamedData<PckFile>($"{res}Data.pck", texturePck), default);
}
return new DLCPackageContent(texturePackInfoPck);
}
internal DLCPackageContent CompileMashUpPackage(IDLCPackage package, LOCFile localisation)
{
if (package is not DLCMashUpPackage mashUpPackage)
return DLCPackageContent.Empty;
PckFile skinsPck = CompileSkinPackage(mashUpPackage.GetSkinPackage(), localisation).MainPck;
DLCTexturePackage texturePackage = mashUpPackage.GetTexturePackage() as DLCTexturePackage;
DLCPackageContent texturePackContent = CompileTexturePackage(texturePackage, localisation);
DLCTexturePackage.TextureResolution res = texturePackage.GetResolution();
PckFile texturePackInfoPck = texturePackContent.MainPck;
PckFile texturePck = texturePackContent.DataFolder.TexturePck.Value;
PckFile mainPck = CreateRootPckFile(package.Identifier, 0, localisation);
_ = mainPck.CreateNewAssetIf(skinsPck is PckFile && skinsPck.AssetCount > 0, "Skins.pck", PckAssetType.SkinDataFile, new PckFileWriter(skinsPck, _byteOrder));
if (texturePackInfoPck is PckFile && texturePackInfoPck.AssetCount > 0)
{
PckAsset textureInfoAsset = mainPck.CreateNewAsset($"{res}/{res}Info.pck", PckAssetType.TexturePackInfoFile, new PckFileWriter(texturePackInfoPck, _byteOrder));
textureInfoAsset.AddProperty("PACKID", "0");
textureInfoAsset.AddProperty("DATAPATH", texturePackContent.DataFolder.TexturePck.Name);
}
{
GameRuleFile grf = mashUpPackage.GetGameRule();
grf.Header.CompressionType = _compressionType;
grf.Header.CompressionLevel = _compressionLevel;
mainPck.CreateNewAsset("GameRule.grf", PckAssetType.GameRulesFile, new GameRuleFileWriter(grf));
}
if (mashUpPackage.HasAudioData)
{
mainPck.CreateNewAsset("audio.pck", PckAssetType.AudioFile, new PckAudioFileWriter(mashUpPackage.GetAudioPack(), _byteOrder));
texturePackContent.DataFolder.AddFiles(mashUpPackage.GetAudioFiles());
}
return new DLCPackageContent(mainPck, texturePackContent.DataFolder);
}
internal DLCPackageContent CompileRawAssets(IDLCPackage package)
{
return package is RawAssetDLCPackage rawAssetDLCPackage ? new DLCPackageContent(rawAssetDLCPackage.PckFile) : DLCPackageContent.Empty;
}
}
}

View File

@@ -3,21 +3,23 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using OMI;
using OMI.Formats.Pck;
using PckStudio.Core.Interfaces;
namespace PckStudio.Core.DLC
{
public sealed class UnknownDLCPackage : DLCPackage
public sealed class RawAssetDLCPackage : DLCPackage
{
public PckFile PckFile { get; }
public ByteOrder ByteOrder { get; }
public UnknownDLCPackage(string name, PckFile pckFile)
: base(name ?? nameof(UnknownDLCPackage), -1, default)
public RawAssetDLCPackage(string name, PckFile pckFile, ByteOrder byteOrder)
: base(name ?? nameof(RawAssetDLCPackage), -1, default)
{
PckFile = pckFile;
ByteOrder = byteOrder;
}
public override DLCPackageType GetDLCPackageType() => DLCPackageType.Unknown;
public override DLCPackageType GetDLCPackageType() => DLCPackageType.RawAssets;
}
}

View File

@@ -1,4 +1,7 @@
using System.Drawing;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Threading.Tasks;
using AnimatedGif;
namespace PckStudio.Core.Extensions
@@ -23,5 +26,26 @@ namespace PckStudio.Core.Extensions
ms.Position = 0;
return Image.FromStream(ms);
}
public static Animation Combine(this Animation first, Animation second, ImageLayoutDirection layoutDirection)
{
if (first == null)
return second;
if (second == null)
return first;
if (first.TextureCount != second.TextureCount)
return first;
if (first.FrameCount != second.FrameCount)
return first;
Image[] secondTextures = second.GetTextures().ToArray();
Animation animation = new Animation(first.GetTextures().enumerate().Select(ift => ift.value.Combine(secondTextures[ift.index], layoutDirection)));
foreach ((int texId, int frameTime) item in first.GetFrames().Select(f => (texId: first.GetTextureIndex(f.Texture), frameTime: f.Ticks)))
{
animation.AddFrame(item.texId, item.frameTime);
}
return animation;
}
}
}

View File

@@ -54,15 +54,15 @@ namespace PckStudio.Core.Extensions
return MathExtensions.Clamp(resultValue, 0.0f, 1.0f);
}
public static byte Mix(double ratio, byte val1, byte val2)
public static byte Mix(float ratio, byte val1, byte val2)
{
ratio = MathExtensions.Clamp(ratio, 0.0, 1.0);
ratio = MathExtensions.Clamp(ratio, 0.0f, 1.0f);
return (byte)(ratio * val1 + (1.0 - ratio) * val2);
}
public static Color Mix(this Color c1, Color c2, double ratio)
public static Color Mix(this Color c1, Color c2, float ratio)
{
ratio = MathExtensions.Clamp(ratio, 0.0, 1.0);
ratio = MathExtensions.Clamp(ratio, 0.0f, 1.0f);
return Color.FromArgb(c1.A,
Mix(ratio, c1.R, c2.R),
Mix(ratio, c1.G, c2.G),

View File

@@ -274,9 +274,9 @@ namespace PckStudio.Core.Extensions
return bitmapResult;
}
public static Image Interpolate(this Image source, Image target, double delta)
public static Image Interpolate(this Image source, Image target, float delta)
{
delta = MathExtensions.Clamp(delta, 0.0, 1.0);
delta = MathExtensions.Clamp(delta, 0.0f, 1.0f);
if (source is not Bitmap baseImage || target is not Bitmap overlayImage ||
source.Width != target.Width || source.Height != target.Height)
return source;

View File

@@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json.Linq;
namespace PckStudio.Core.Extensions
{
internal static class JObjectExtensions
{
public static bool TryGetValue<T>(this JObject jObject, string propertyName, out T value)
{
if (!jObject.TryGetValue(propertyName, out JToken token))
{
value = default;
return false;
}
value = token.ToObject<T>() ?? default;
return value is T;
}
}
}

View File

@@ -2,7 +2,7 @@
namespace PckStudio.Core.Extensions
{
public class MathExtensions
public static class MathExtensions
{
public static T Clamp<T>(T value, T min, T max) where T : IComparable<T>
{
@@ -12,5 +12,10 @@ namespace PckStudio.Core.Extensions
return max;
return value;
}
public static bool IsWithinRangeOf<T>(this T value, T min, T max) where T : IComparable<T>
{
return value.CompareTo(min) >= 0 && value.CompareTo(max) <= 0;
}
}
}

View File

@@ -55,7 +55,7 @@ namespace PckStudio.Core.Extensions
if (skin.HasCape)
{
asset.AddProperty("CAPEPATH", $"dlccape{skinId}.png");
asset.AddProperty("CAPEPATH", $"dlccape{skin.CapeId}.png");
}
asset.AddProperty("ANIM", skin.Anim);
@@ -91,5 +91,23 @@ namespace PckStudio.Core.Extensions
return asset;
}
public static bool HasDirectory(this PckFile pck, string directoryPath)
{
string sanitisedDirectoryPath = directoryPath.Replace('\\', '/');
return pck.GetAssets().Any(asset => asset.Filename.StartsWith(sanitisedDirectoryPath));
}
public static IEnumerable<PckAsset> GetDirectoryContent(this PckFile pck, string directoryPath, PckAssetType assetType, bool includeSubDirectories = false)
=> GetDirectoryContent(pck, directoryPath, includeSubDirectories).Where(asset => asset.Type == assetType);
public static IEnumerable<PckAsset> GetDirectoryContent(this PckFile pck, string directoryPath, bool includeSubDirectories = false)
{
string sanitisedDirectoryPath = directoryPath.Replace('\\', '/');
if (!sanitisedDirectoryPath.EndsWith("/"))
sanitisedDirectoryPath += "/";
return pck.GetAssets()
.Where(asset => asset.Filename.StartsWith(sanitisedDirectoryPath))
.Where(asset => includeSubDirectories || !asset.Filename.Substring(sanitisedDirectoryPath.Length).Contains('/'));
}
}
}

View File

@@ -19,7 +19,7 @@ namespace PckStudio.Core.Extensions
var path = new GraphicsPath(FillMode.Winding);
Vector2 uv = skinBOX.UV;
Vector2 uv = skinBOX.Uv;
Vector3 size = skinBOX.Size;
path.AddRectangle(new RectangleF(new PointF((uv.X ) * tillingFactor.X, (uv.Y + size.Z) * tillingFactor.Y), new SizeF(size.Z * tillingFactor.X, size.Y * tillingFactor.Y)));
@@ -94,12 +94,12 @@ namespace PckStudio.Core.Extensions
{
return Point.Truncate((face) switch
{
SkinBoxFace.Front => new PointF(skinBox.UV.X + skinBox.Size.Z , skinBox.UV.Y + skinBox.Size.Z),
SkinBoxFace.Back => new PointF(skinBox.UV.X + skinBox.Size.Z * 2 + skinBox.Size.X, skinBox.UV.Y + skinBox.Size.Z),
SkinBoxFace.Top => new PointF(skinBox.UV.X + skinBox.Size.X , skinBox.UV.Y),
SkinBoxFace.Bottom => new PointF(skinBox.UV.X + skinBox.Size.X * 2 , skinBox.UV.Y),
SkinBoxFace.Left => new PointF(skinBox.UV.X + skinBox.Size.Z + skinBox.Size.X , skinBox.UV.Y + skinBox.Size.Z),
SkinBoxFace.Right => new PointF(skinBox.UV.X + skinBox.Size.Z , skinBox.UV.Y + skinBox.Size.Z),
SkinBoxFace.Front => new PointF(skinBox.Uv.X + skinBox.Size.Z , skinBox.Uv.Y + skinBox.Size.Z),
SkinBoxFace.Back => new PointF(skinBox.Uv.X + skinBox.Size.Z * 2 + skinBox.Size.X, skinBox.Uv.Y + skinBox.Size.Z),
SkinBoxFace.Top => new PointF(skinBox.Uv.X + skinBox.Size.X , skinBox.Uv.Y),
SkinBoxFace.Bottom => new PointF(skinBox.Uv.X + skinBox.Size.X * 2 , skinBox.Uv.Y),
SkinBoxFace.Left => new PointF(skinBox.Uv.X + skinBox.Size.Z + skinBox.Size.X , skinBox.Uv.Y + skinBox.Size.Z),
SkinBoxFace.Right => new PointF(skinBox.Uv.X + skinBox.Size.Z , skinBox.Uv.Y + skinBox.Size.Z),
_ => PointF.Empty,
});
}

View File

@@ -88,7 +88,7 @@ namespace PckStudio.Core.Extensions
}
else
{
Rectangle area = skin.Model.AdditionalBoxes.Where(sb => sb.Type == "HEAD" || sb.Type == "HEADWEAR").OrderBy(sb=> sb.Pos.Z - sb.Scale).FirstOrDefault()?.GetFaceArea(SkinBOXExtensions.SkinBoxFace.Front) ?? Rectangle.Empty;
Rectangle area = skin.Model.AdditionalBoxes.Where(sb => sb.Type == "HEAD" || sb.Type == "HEADWEAR").OrderBy(sb=> sb.Position.Z - sb.Inflate).FirstOrDefault()?.GetFaceArea(SkinBOXExtensions.SkinBoxFace.Front) ?? Rectangle.Empty;
Image img = skin.Texture.GetArea(area);
g.DrawImage(img, 0, 0, width, height);
}

View File

@@ -25,23 +25,35 @@ namespace PckStudio.Core.Extensions
return node;
}
public static TreeNode BuildNodeTreeBySeperator(this TreeNodeCollection root, string path, char seperator)
private static (string, string) Slice(this string s, int i)
=> (s.Substring(0, i), s.Substring(i + 1));
public static TreeNode BuildNodeTreeBySeperator(this TreeNodeCollection root, string path, char seperator, int maxDepth = -1)
=> root.BuildNodeTreeBySeperator(path, seperator.ToString(), maxDepth);
public static TreeNode BuildNodeTreeBySeperator(this TreeNodeCollection root, string path, string seperator, int maxDepth = -1)
{
_ = root ?? throw new ArgumentNullException(nameof(root));
if (!path.Contains(seperator))
{
if (maxDepth == 0 || !path.Contains(seperator))
return root.CreateNode(path);
}
string nodeText = path.Substring(0, path.IndexOf(seperator));
string subPath = path.Substring(path.IndexOf(seperator) + 1);
(string nodeText, string subPath) = path.Slice(path.IndexOf(seperator));
if (string.IsNullOrWhiteSpace(nodeText))
{
return BuildNodeTreeBySeperator(root, subPath, seperator);
}
return BuildNodeTreeBySeperator(root, subPath, seperator, maxDepth - 1);
TreeNode subNode = root.ContainsKey(nodeText) ? root[nodeText] : root.CreateNode(nodeText);
return BuildNodeTreeBySeperator(subNode.Nodes, subPath, seperator);
return BuildNodeTreeBySeperator(subNode.Nodes, subPath, seperator, maxDepth - 1);
}
public static IEnumerable<TreeNode> GetLeafNodes(this TreeNodeCollection root)
{
foreach (TreeNode node in root)
{
if (node.Nodes.Count == 0)
yield return node;
foreach (TreeNode ln in node.Nodes.GetLeafNodes())
yield return ln;
}
}
}
}

View File

@@ -15,34 +15,33 @@ namespace PckStudio.Core.FileFormats
private AudioCategory[] _categories { get; } = new AudioCategory[9];
public Dictionary<string, string> Credits { get; } = new Dictionary<string, string>();
public enum Category : int
{
Overworld,
Nether,
End,
Creative,
Menu,
Battle,
Tumble,
Glide,
BuildOff,
}
public enum EAudioParameterType : int
{
Unk0, // dimension music
Unk1, // unused music ?
}
public sealed class AudioCategory
{
public enum EAudioType : int
{
Overworld,
Nether,
End,
Creative,
Menu,
Battle,
Tumble,
Glide,
BuildOff,
}
public enum EAudioParameterType : int
{
Unk0, // dimension music
Unk1, // unused music ?
}
public string Name { get; set; } = string.Empty;
public EAudioType AudioType { get; }
public Category AudioType { get; }
public List<string> SongNames { get; } = new List<string>();
public EAudioParameterType ParameterType { get; }
public AudioCategory(string name, EAudioParameterType parameterType, EAudioType audioType)
public AudioCategory(string name, EAudioParameterType parameterType, Category audioType)
{
Name = name;
ParameterType = parameterType;
@@ -98,17 +97,17 @@ namespace PckStudio.Core.FileFormats
/// <exception cref="InvalidCategoryException"></exception>
public bool HasCategory(AudioCategory.EAudioType category) => GetCategory(category) is AudioCategory;
public bool HasCategory(Category category) => GetCategory(category) is AudioCategory;
/// <exception cref="InvalidCategoryException"></exception>
public AudioCategory GetCategory(AudioCategory.EAudioType category)
public AudioCategory GetCategory(Category category)
{
if (!Enum.IsDefined(typeof(AudioCategory.EAudioType), category))
if (!Enum.IsDefined(typeof(Category), category))
throw new InvalidCategoryException(nameof(category));
return _categories[(int)category];
}
public bool TryGetCategory(AudioCategory.EAudioType category, out AudioCategory audioCategory)
public bool TryGetCategory(Category category, out AudioCategory audioCategory)
{
if (GetCategory(category) is AudioCategory audioCat)
{
@@ -121,9 +120,9 @@ namespace PckStudio.Core.FileFormats
/// <returns>True when category was created, otherwise false</returns>
/// <exception cref="InvalidCategoryException"></exception>
public bool AddCategory(string name, AudioCategory.EAudioType category, AudioCategory.EAudioParameterType parameterType)
public bool AddCategory(string name, Category category, EAudioParameterType parameterType)
{
if (!Enum.IsDefined(typeof(AudioCategory.EAudioType), category))
if (!Enum.IsDefined(typeof(Category), category))
throw new InvalidCategoryException(nameof(category));
bool exists = HasCategory(category);
if (!exists)
@@ -133,11 +132,11 @@ namespace PckStudio.Core.FileFormats
/// <returns>True when category was created, otherwise false</returns>
/// <exception cref="InvalidCategoryException"></exception>
public bool AddCategory(AudioCategory.EAudioType category) => AddCategory("", category, AudioCategory.EAudioParameterType.Unk0);
public bool AddCategory(Category category) => AddCategory("", category, EAudioParameterType.Unk0);
/// <returns>True when category was removed, otherwise false</returns>
/// <exception cref="InvalidCategoryException"></exception>
public bool RemoveCategory(AudioCategory.EAudioType category)
public bool RemoveCategory(Category category)
{
bool exists = HasCategory(category);
if (exists)

View File

@@ -16,7 +16,7 @@ namespace PckStudio.Core.IO.PckAudio
private PckAudioFile _file;
private ByteOrder _endianness;
private List<string> LUT = new List<string>();
private List<PckAudioFile.AudioCategory.EAudioType> _OriginalAudioTypeOrder = new List<PckAudioFile.AudioCategory.EAudioType>();
private List<PckAudioFile.Category> _OriginalAudioTypeOrder = new List<PckAudioFile.Category>();
public PckAudioFileReader(ByteOrder endianness)
{
@@ -75,8 +75,8 @@ namespace PckStudio.Core.IO.PckAudio
int categoryEntryCount = reader.ReadInt32();
for (; 0 < categoryEntryCount; categoryEntryCount--)
{
var parameterType = (PckAudioFile.AudioCategory.EAudioParameterType)reader.ReadInt32();
var audioType = (PckAudioFile.AudioCategory.EAudioType)reader.ReadInt32();
var parameterType = (PckAudioFile.EAudioParameterType)reader.ReadInt32();
var audioType = (PckAudioFile.Category)reader.ReadInt32();
string name = ReadString(reader);
// AddCategory puts the file's categories out of order and causes some songs to be put in the wrong categories
// This is my simple fix for the issue.
@@ -89,7 +89,7 @@ namespace PckStudio.Core.IO.PckAudio
{
List<string> credits = new List<string>();
List<string> creditIds = new List<string>();
foreach (PckAudioFile.AudioCategory.EAudioType c in _OriginalAudioTypeOrder)
foreach (PckAudioFile.Category c in _OriginalAudioTypeOrder)
{
int audioCount = reader.ReadInt32();
for (; 0 < audioCount; audioCount--)

View File

@@ -9,13 +9,13 @@ namespace PckStudio.Core.Json
{
public class JsonColorEntry
{
[JsonProperty("defaultName", Required = Required.Always)]
[JsonProperty("defaultName", DefaultValueHandling = DefaultValueHandling.Populate)]
public string DefaultName { get; set; }
[JsonProperty("isWaterColour", DefaultValueHandling = DefaultValueHandling.Populate)]
public bool IsWaterColour { get; set; }
[JsonProperty("variants", DefaultValueHandling = DefaultValueHandling.Populate)]
public string[] Variants { get; set; }
[JsonProperty("variants", NullValueHandling = NullValueHandling.Ignore)]
public string[] Variants { get; set; } = Array.Empty<string>();
}
}

View File

@@ -0,0 +1,30 @@
using System;
using System.Numerics;
using Newtonsoft.Json;
namespace PckStudio.Core.Json
{
public class DefaultModel
{
[JsonProperty("textureSize", Required = Required.Always)]
public Vector2 TextureSize { get; set; }
[JsonProperty("parts", Required = Required.Always)]
public DefaultPart[] Parts { get; set; } = Array.Empty<DefaultPart>();
}
public class DefaultPart
{
[JsonProperty("name", Required = Required.Always)]
public string Name { get; set; }
[JsonProperty("translation")]
public Vector3 Translation { get; set; } = Vector3.Zero;
[JsonProperty("rotation")]
public Vector3 Rotation { get; set; } = Vector3.Zero;
[JsonProperty("boxes")]
public Box[] Boxes { get; set; }
}
}

View File

@@ -0,0 +1,61 @@
using System;
using System.Numerics;
using Newtonsoft.Json;
namespace PckStudio.Core.Json
{
public class ModelMetaDataPart
{
[JsonProperty("name", Required = Required.Always)]
public string Name { get; set; }
[JsonProperty("children", NullValueHandling = NullValueHandling.Ignore, DefaultValueHandling = DefaultValueHandling.Ignore)]
public ModelMetaDataPart[] Children { get; set; } = Array.Empty<ModelMetaDataPart>();
[JsonProperty("required")]
public bool Reqired { get; set; } = default;
[JsonConstructor]
public ModelMetaDataPart()
{
}
public ModelMetaDataPart(string name)
: this(name, Array.Empty<ModelMetaDataPart>())
{
}
public ModelMetaDataPart(string name, params ModelMetaDataPart[] children)
{
Name = name;
Children = children;
}
}
public class JsonModelMetaLayer
{
[JsonProperty("name")]
public string Name { get; set; }
[JsonProperty("uv")]
public Vector2 Uv { get; set; }
[JsonProperty("allowedColors", NullValueHandling = NullValueHandling.Ignore)]
public string[] AllowedColors { get; set; } = Array.Empty<string>();
}
public class JsonModelMetaData
{
[JsonProperty("textureLocations", Required = Required.Always)]
public string[] TextureLocations { get; set; }
[JsonProperty("materialName", NullValueHandling = NullValueHandling.Ignore)]
public string MaterialName { get; set; } = string.Empty;
[JsonProperty("layers", NullValueHandling = NullValueHandling.Ignore)]
public JsonModelMetaLayer[] Layers { get; set; } = [new JsonModelMetaLayer() { Name = "base", Uv = Vector2.Zero}];
[JsonProperty("parts", NullValueHandling = NullValueHandling.Ignore)]
public ModelMetaDataPart[] RootParts { get; set; } = Array.Empty<ModelMetaDataPart>();
}
}

View File

@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
namespace PckStudio.Core.Json
{
internal class JsonRowAndColumn
{
[JsonProperty("row", Required = Required.Always)]
public int Row { get; set; }
[JsonProperty("column", Required = Required.Always)]
public int Column { get; set; }
}
}

View File

@@ -4,6 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
using PckStudio.Json;
namespace PckStudio.Core.Json
{
@@ -15,21 +16,18 @@ namespace PckStudio.Core.Json
[JsonProperty("internalName")]
public string InternalName { get; set; }
[JsonProperty("width")]
public int TileWidth { get; set; } = 1;
[JsonProperty("height")]
public int TileHeight { get; set; } = 1;
[JsonIgnore]
public bool HasColourEntry => ColourEntry != null;
[JsonProperty("colourEntry", DefaultValueHandling = DefaultValueHandling.Ignore)]
public JsonColorEntry ColourEntry { get; set; }
[JsonProperty("allowCustomColour", DefaultValueHandling = DefaultValueHandling.Populate)]
public bool AllowCustomColour { get; set; }
[JsonProperty("colorKey", DefaultValueHandling = DefaultValueHandling.Ignore)]
public string ColorKey { get; set; } = string.Empty;
[JsonIgnore]
public bool HasColourEntry => Tiles.ColorEntries.ContainsKey(ColorKey);
[JsonIgnore]
public JsonColorEntry ColorEntry => Tiles.ColorEntries[ColorKey];
public JsonTileInfo(string displayName, string internalName)
{
DisplayName = displayName;

View File

@@ -39,8 +39,8 @@ namespace PckStudio.Core
Thumbnail = thumbnail;
World = world;
var levelData = MapReader.OpenSave(new MemoryStream(world.Value))["level.dat"];
TagCompound? levelDat = NbtDocument.LoadDocument(new MemoryStream(levelData))!.DocumentRoot?["Data"] as TagCompound;
SaveData saveData = MapReader.OpenSaveData(new MemoryStream(world.Value));
TagCompound? levelDat = saveData.LevelData.DocumentRoot?["Data"] as TagCompound;
_ = levelDat ?? throw new NullReferenceException(nameof(levelDat));
Vector3 spawn = levelDat.GetVector3("Spawn");

View File

@@ -1,13 +1,42 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Cyotek.Data.Nbt;
using ICSharpCode.SharpZipLib.Zip.Compression.Streams;
using OMI;
using PckStudio.Core.Extensions;
namespace PckStudio.Core
{
public class SaveData
{
public NbtDocument LevelData { get; }
public IDictionary<Guid, NbtDocument> Players { get; }
private IDictionary<string, byte[]> _worldArchive;
public SaveData(IDictionary<string, byte[]> worldArchive)
{
_worldArchive = worldArchive;
if (_worldArchive.TryGetValue("levels.dat", out byte[] levelData))
{
Stream stream = new MemoryStream(levelData);
LevelData = NbtDocument.LoadDocument(stream);
}
Players = _worldArchive
.Where(kv => kv.Key.StartsWith("players/"))
.ToDictionary(
kv => Guid.Parse(Path.GetFileNameWithoutExtension(kv.Key)),
kv => NbtDocument.LoadDocument(new MemoryStream(kv.Value)));
}
}
public class MapReader
{
public static IDictionary<string, byte[]> OpenSave(Stream stream)
public static SaveData OpenSaveData(Stream stream)
{
EndiannessAwareBinaryReader reader = new EndiannessAwareBinaryReader(stream, ByteOrder.BigEndian);
_ = reader.ReadInt32();
@@ -35,7 +64,7 @@ namespace PckStudio.Core
res.Add(path, data);
}
return res;
return new SaveData(res);
}
}
}

View File

@@ -0,0 +1,46 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DiscordRPC;
namespace PckStudio.Core.Model
{
public class AbstractModel
{
public string Name { get; }
public Size TextureSize { get; }
public NamedData<Image> DefaultTexture { get; }
public IReadOnlyDictionary<string, Image> Textures { get; }
private IDictionary<string, AbstractModelPart> _parts;
public AbstractModel(string name, Size textureSize, NamedData<Image> defaultTexture, IReadOnlyDictionary<string, Image> textures)
{
Name = name;
TextureSize = textureSize;
DefaultTexture = defaultTexture;
Textures = textures;
}
internal bool AddPart(AbstractModelPart abstractModelPart)
{
if (abstractModelPart is null || _parts.ContainsKey(abstractModelPart.Name))
return false;
_parts.Add(abstractModelPart.Name, abstractModelPart);
return true;
}
internal void AddParts(IEnumerable<AbstractModelPart> abstractModelParts)
{
foreach (AbstractModelPart abstractModelPart in abstractModelParts)
{
AddPart(abstractModelPart);
}
}
}
}

View File

@@ -0,0 +1,74 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
using OMI.Formats.Model;
using PckStudio.Core.Extensions;
using PckStudio.Core.Json;
using PckStudio.Core.Properties;
using PckStudio.Interfaces;
namespace PckStudio.Core.Model
{
public class AbstractModelContainer
{
static Dictionary<string, JsonModelMetaData> _metaData = JsonConvert.DeserializeObject<Dictionary<string, JsonModelMetaData>>(Resources.modelMetaData);
private IDictionary<string, AbstractModel> _models = new Dictionary<string, AbstractModel>();
public AbstractModel GetModelByName(string name) => _models[name];
public bool AddModel(AbstractModel model)
{
if (model == null || _models.ContainsKey(model.Name))
return false;
_models.Add(model.Name, model);
return true;
}
public bool RemoveModel(AbstractModel model) => model is not null && _models.Remove(model.Name);
public static AbstractModelContainer FromModelContainer(OMI.Formats.Model.ModelContainer models, ITryGet<string, Image> texture)
{
var abstractModelContainer = new AbstractModelContainer();
if (models is null)
return abstractModelContainer;
foreach (OMI.Formats.Model.Model model in models.GetModels().Where(m => _metaData.ContainsKey(m.Name) && m.Name.EqualsAny(_metaData[m.Name].RootParts.Select(mdp => mdp.Name).ToArray())))
{
if (!_metaData.TryGetValue(model.Name, out JsonModelMetaData modelMetaData))
{
Trace.TraceWarning($"No model meta data found for: '{model.Name}'.");
continue;
}
IDictionary<string, ModelPart> parts = model.GetParts().ToDictionary(part => part.Name);
IReadOnlyDictionary<string, Image> textures = modelMetaData.TextureLocations.Where(s => texture.TryGet(s, out _)).ToDictionary(Path.GetFileNameWithoutExtension, s =>
{
texture.TryGet(s, out Image img);
return img;
});
AbstractModel abstractModel = new AbstractModel(model.Name, model.TextureSize, textures.FirstOrDefault(), textures);
abstractModel.AddParts(GetRootAbstractModelPart(modelMetaData.RootParts, parts, null));
abstractModelContainer.AddModel(abstractModel);
}
return abstractModelContainer;
}
private static IEnumerable<AbstractModelPart> GetRootAbstractModelPart(ModelMetaDataPart[] dataParts, IDictionary<string, ModelPart> parts, AbstractModelPart parent)
{
foreach (ModelMetaDataPart rootPart in dataParts)
{
if (!parts.TryGetValue(rootPart.Name, out ModelPart part))
continue;
var abstractModelPart = new AbstractModelPart(part.Name, parent, part.Translation, part.Rotation + part.AdditionalRotation, part.GetBoxes().Select(mb => new Box(mb.Position, mb.Size, mb.Uv, mb.Inflate, mb.Mirror)));
abstractModelPart.AddParts(GetRootAbstractModelPart(rootPart.Children, parts, abstractModelPart));
yield return abstractModelPart;
}
}
}
}

View File

@@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
using System.Numerics;
namespace PckStudio.Core.Model
{
public class AbstractModelPart
{
public string Name { get; }
public AbstractModelPart Parent { get; }
public Vector3 Translation { get; }
public Vector3 Rotation { get; }
private IList<Box> _boxes;
private List<AbstractModelPart> _subParts;
public AbstractModelPart(string name, AbstractModelPart parent, Vector3 translation, Vector3 rotation, IEnumerable<Box> boxes)
{
Name = name;
Parent = parent;
Translation = translation;
Rotation = rotation;
_boxes = new List<Box>(boxes);
_subParts = new List<AbstractModelPart>();
}
public void AddBox(Box box) => _boxes.Add(box);
internal void AddParts(IEnumerable<AbstractModelPart> parts) => _subParts.AddRange(parts);
}
}

View File

@@ -10,5 +10,7 @@ namespace PckStudio.Core
{
public readonly string Name = name;
public readonly T Value = value;
public static implicit operator NamedData<T>(KeyValuePair<string , T> kvp) => new NamedData<T>(kvp.Key, kvp.Value);
}
}

View File

@@ -1,28 +0,0 @@
using System;
using OMI.Formats.Pck;
namespace PckStudio.Core
{
public sealed class PackInfo
{
public static readonly PackInfo Empty = new PackInfo(default, default, default);
public bool IsValid { get; }
public PckFile File { get; }
public OMI.ByteOrder ByteOrder { get; }
public bool AllowByteOrderSwap { get; }
public static PackInfo Create(PckFile file, OMI.ByteOrder byteOrder, bool allowByteOrderSwap)
{
return new PackInfo(file, byteOrder, allowByteOrderSwap);
}
private PackInfo(PckFile file, OMI.ByteOrder byteOrder, bool allowByteOrderSwap)
{
File = file;
ByteOrder = byteOrder;
AllowByteOrderSwap = allowByteOrderSwap;
IsValid = file is not null && Enum.IsDefined(typeof(OMI.ByteOrder), byteOrder);
}
}
}

View File

@@ -66,14 +66,17 @@
<Compile Include="ArmorPiece.cs" />
<Compile Include="ArmorSet.cs" />
<Compile Include="ArmorSetDescription.cs" />
<Compile Include="Atlas.cs" />
<Compile Include="AtlasGroup.cs" />
<Compile Include="AtlasGroupAnimation.cs" />
<Compile Include="AtlasGroupLargeTile.cs" />
<Compile Include="AtlasGroupLargeTileAnimation.cs" />
<Compile Include="Atlas\Atlas.cs" />
<Compile Include="Atlas\AtlasGroup.cs" />
<Compile Include="Atlas\AtlasAnimation.cs" />
<Compile Include="Atlas\AtlasGroupJsonConverter.cs" />
<Compile Include="Atlas\AtlasLargeTile.cs" />
<Compile Include="Atlas\AtlasLargeTileAnimation.cs" />
<Compile Include="AtlasResource.cs" />
<Compile Include="AtlasTile.cs" />
<Compile Include="Atlas\AtlasOverlayGroup.cs" />
<Compile Include="Atlas\AtlasTile.cs" />
<Compile Include="BoundingBox.cs" />
<Compile Include="Colors\AbstractColorContainer.cs" />
<Compile Include="ConsolePlatform.cs" />
<Compile Include="DelegatedFileSaveContext.cs" />
<Compile Include="DelegatedSaveContext.cs" />
@@ -85,10 +88,13 @@
<Compile Include="DLC\DLCMashUpPackage.cs" />
<Compile Include="DLC\DLCMiniGamePackage.cs" />
<Compile Include="DLC\DLCPackage.cs" />
<Compile Include="DLC\DLCPackageContent.cs" />
<Compile Include="DLC\DLCPackageContentSerilasationType.cs" />
<Compile Include="DLC\DLCPackageRegistry.cs" />
<Compile Include="DLC\DLCSkinPackage.cs" />
<Compile Include="DLC\DLCTexturePackage.cs" />
<Compile Include="DLC\UnknownDLCPackage.cs" />
<Compile Include="DLC\PckFileCompiler.cs" />
<Compile Include="DLC\RawAssetDLCPackage.cs" />
<Compile Include="Extensions\AnimationExtensions.cs" />
<Compile Include="Extensions\BlendMode.cs" />
<Compile Include="Extensions\BlendOption.cs" />
@@ -100,6 +106,7 @@
<Compile Include="Extensions\ImageExtensions.cs" />
<Compile Include="Extensions\ImageLayoutDirection.cs" />
<Compile Include="Extensions\ImageSection.cs" />
<Compile Include="Extensions\JObjectExtensions.cs" />
<Compile Include="Extensions\ListExtensions.cs" />
<Compile Include="Extensions\LocFileExtensions.cs" />
<Compile Include="Extensions\MaterialContainerExtensions.cs" />
@@ -139,7 +146,6 @@
<Compile Include="Interfaces\IPckAssetSerializer.cs" />
<Compile Include="Interfaces\ISaveContext.cs" />
<Compile Include="Interfaces\ITryGetSet.cs" />
<Compile Include="DLC\InvalidDLCPackage.cs" />
<Compile Include="IO\3DST\3DSTextureReader.cs" />
<Compile Include="IO\3DST\3DSTextureWriter.cs" />
<Compile Include="IO\3DST\TextureCodec.cs" />
@@ -162,14 +168,20 @@
<Compile Include="ItemSelectionPopUp.Designer.cs" />
<Compile Include="Json\ColorEntry.cs" />
<Compile Include="Json\EntityInfo.cs" />
<Compile Include="Json\JsonDefaultModel.cs" />
<Compile Include="Json\JsonModelMetaData.cs" />
<Compile Include="Json\JsonRowAndColumn.cs" />
<Compile Include="Json\TileInfo.cs" />
<Compile Include="Json\UpdateInformation.cs" />
<Compile Include="MapData.cs" />
<Compile Include="MapReader.cs" />
<Compile Include="Misc\FileCacher.cs" />
<Compile Include="Misc\OpenFolderDialog.cs" />
<Compile Include="Model\AbstractModel.cs" />
<Compile Include="Model\AbstractModelContainer.cs" />
<Compile Include="Box.cs" />
<Compile Include="Model\AbstractModelPart.cs" />
<Compile Include="NamedData.cs" />
<Compile Include="PackInfo.cs" />
<Compile Include="DLC\DLCPackageType.cs" />
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
@@ -225,8 +237,13 @@
<None Include="Resources\atlas\additionalMapiconsData.json" />
<None Include="Resources\atlas\bannerData.json" />
<None Include="Resources\atlas\blockData.json" />
<None Include="Resources\atlas\colorEntries.json" />
<None Include="Resources\atlas\experienceOrbData.json" />
<None Include="Resources\atlas\explosionData.json" />
<None Include="Resources\atlas\groups\item_groups.json" />
<None Include="Resources\atlas\groups\painting_groups.json" />
<None Include="Resources\atlas\groups\particles_groups.json" />
<None Include="Resources\atlas\groups\terrain_groups.json" />
<None Include="Resources\atlas\itemData.json" />
<None Include="Resources\atlas\mapIconData.json" />
<None Include="Resources\atlas\moonPhaseData.json" />
@@ -235,9 +252,11 @@
<None Include="Resources\Comparison.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\defaultModels.json" />
<None Include="Resources\entityBehavioursData.json" />
<None Include="Resources\entityMaterialsData.json" />
<None Include="Resources\entityModelsData.json" />
<None Include="Resources\modelMetaData.json" />
<None Include="Resources\java\blocks_1.6.1.json" />
<None Include="Resources\java\latest2lce_items.json" />
<None Include="Resources\java\latest2lce_blocks.json" />
@@ -288,7 +307,11 @@
<Content Include="Resources\atlas\paintings.png" />
<Content Include="Resources\atlas\particles.png" />
<Content Include="Resources\atlas\terrain.png" />
<Content Include="Resources\clouds.png" />
<Content Include="Resources\rain.png" />
<Content Include="Resources\snow.png" />
<None Include="Resources\unknown_pack.png" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

File diff suppressed because it is too large Load Diff

View File

@@ -145,12 +145,18 @@
<data name="cloth_b" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\armor\cloth_b.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="clouds" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\clouds.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Comparison" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Comparison.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="compass" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\compass.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="defaultModels" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\defaultModels.json;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
</data>
<data name="diamond" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\armor\diamond.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
@@ -181,14 +187,14 @@
<data name="itemData" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\atlas\itemData.json;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;iso-8859-1</value>
</data>
<data name="items_groups" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\atlas\groups\item_groups.json;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
</data>
<data name="items_atlas" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\atlas\items.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="latest2lce_blocks" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\java\latest2lce_blocks.json;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
</data>
<data name="latest2lce_items" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\java\latest2lce_items.json;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
<data name="painting_groups" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\atlas\groups\painting_groups.json;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
</data>
<data name="mapIconData" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\atlas\mapIconData.json;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;iso-8859-1</value>
@@ -196,6 +202,9 @@
<data name="map_icons_atlas" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\atlas\map_icons.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="modelMetaData" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\modelMetaData.json;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
</data>
<data name="moonPhaseData" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\atlas\moonPhaseData.json;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;iso-8859-1</value>
</data>
@@ -211,11 +220,20 @@
<data name="particleData" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\atlas\particleData.json;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;iso-8859-1</value>
</data>
<data name="particles_groups" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\atlas\groups\particles_groups.json;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
</data>
<data name="particles_atlas" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\atlas\particles.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="resourceFormat_6" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\java\resourceFormat_6.json;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
<data name="rain" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\rain.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="snow" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\snow.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="terrain_groups" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\atlas\groups\terrain_groups.json;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
</data>
<data name="terrain_atlas" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\atlas\terrain.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
@@ -229,4 +247,7 @@
<data name="unknown_pack" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\unknown_pack.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="colorEntries" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\atlas\colorEntries.json;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
</data>
</root>

View File

@@ -15,7 +15,11 @@
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
**/
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Linq;
using Newtonsoft.Json;
using PckStudio.Core.Properties;
using PckStudio.Json;
@@ -23,6 +27,10 @@ namespace PckStudio.Core
{
public static class ResourceLocations
{
static JsonSerializerSettings _serializerSettings = new JsonSerializerSettings()
{
Converters = [new AtlasGroupJsonConverter()]
};
static ResourceLocations()
{
_all = new ResourceLocation[] {
@@ -50,77 +58,14 @@ namespace PckStudio.Core
public static string GetPathFromCategory(ResourceCategory category) => ResourceLocation.GetPathFromCategory(category);
private static readonly AtlasGroup[] _particaleAtlasGroups =
{
new AtlasGroupAnimation("generic" , row: 0, column: 0, frameCount: 8, ImageLayoutDirection.Horizontal, 2),
new AtlasGroupAnimation("splash" , row: 3, column: 1, frameCount: 4, ImageLayoutDirection.Horizontal, 2),
new AtlasGroupAnimation("drip" , row: 0, column: 7, frameCount: 3, ImageLayoutDirection.Horizontal, 4),
new AtlasGroupAnimation("effect" , row: 0, column: 8, frameCount: 8, ImageLayoutDirection.Horizontal, 2),
new AtlasGroupAnimation("splash_effect" , row: 0, column: 9, frameCount: 8, ImageLayoutDirection.Horizontal, 2),
new AtlasGroupAnimation("firework_spark" , row: 0, column: 10, frameCount: 8, ImageLayoutDirection.Horizontal, 2),
new AtlasGroupAnimation("glitter" , row: 0, column: 11, frameCount: 8, ImageLayoutDirection.Horizontal, 2),
new AtlasGroupAnimation("BE_explosion" , row: 0, column: 12, frameCount: 16, ImageLayoutDirection.Horizontal),
new AtlasGroupLargeTile("flash" , row: 4, column: 2, rowSpan: 4, columnSpan: 4),
new AtlasGroupLargeTileAnimation("bubble_pop", row: 6, column: 6, rowSpan: 2, columnSpan: 2, frameCount: 5, ImageLayoutDirection.Horizontal, 2),
};
private static readonly AtlasGroup[] _particaleAtlasGroups = JsonConvert.DeserializeObject<AtlasGroup[]>(Resources.particles_groups, _serializerSettings);
private static readonly AtlasGroup[] _terrainAtlasGroups =
{
new AtlasGroupLargeTile("Oak Door" , row: 1, column: 5, rowSpan: 1, columnSpan: 2),
new AtlasGroupLargeTile("Iron Door" , row: 2, column: 5, rowSpan: 1, columnSpan: 2),
new AtlasGroupLargeTile("Acacia Door" , row: 0, column: 23, rowSpan: 1, columnSpan: 2),
new AtlasGroupLargeTile("Birch Door" , row: 1, column: 23, rowSpan: 1, columnSpan: 2),
new AtlasGroupLargeTile("Dark Oak Door", row: 2, column: 23, rowSpan: 1, columnSpan: 2),
new AtlasGroupLargeTile("Jungle Door" , row: 3, column: 23, rowSpan: 1, columnSpan: 2),
new AtlasGroupLargeTile("Spruce Door" , row: 4, column: 23, rowSpan: 1, columnSpan: 2),
private static readonly AtlasGroup[] _terrainAtlasGroups = JsonConvert.DeserializeObject<AtlasGroup[]>(Resources.terrain_groups, _serializerSettings);
new AtlasGroupLargeTile("Large Fern" , row: 0, column: 20, rowSpan: 1, columnSpan: 2),
new AtlasGroupLargeTile("Double Tall Grass", row: 1, column: 20, rowSpan: 1, columnSpan: 2),
new AtlasGroupLargeTile("Poeny" , row: 2, column: 20, rowSpan: 1, columnSpan: 2),
new AtlasGroupLargeTile("Rose Bush" , row: 3, column: 20, rowSpan: 1, columnSpan: 2),
new AtlasGroupLargeTile("Lilac" , row: 4, column: 20, rowSpan: 1, columnSpan: 2),
private static readonly AtlasGroup[] _itemsAtlasGroups = JsonConvert.DeserializeObject<AtlasGroup[]>(Resources.items_groups, _serializerSettings);
new AtlasGroupAnimation("Wheat" , row: 8, column: 5, frameCount: 8, ImageLayoutDirection.Horizontal, 5),
new AtlasGroupAnimation("Potatoes" , row: 9, column: 16, frameCount: 4, ImageLayoutDirection.Horizontal, 5),
new AtlasGroupAnimation("Carrots" , row: 8, column: 12, frameCount: 4, ImageLayoutDirection.Horizontal, 5),
new AtlasGroupAnimation("Beetroots" , row: 0, column: 25, frameCount: 4, ImageLayoutDirection.Horizontal, 5),
new AtlasGroupAnimation("Nether Wart", row: 2, column: 14, frameCount: 3, ImageLayoutDirection.Horizontal, 5),
new AtlasGroupAnimation("Destroy" , row: 0, column: 15, frameCount: 10, ImageLayoutDirection.Horizontal, 3),
};
private static readonly AtlasGroup[] _itemsAtlasGroups =
{
new AtlasGroupAnimation("Bow Pulling", row: 5, column: 6, frameCount: 3, ImageLayoutDirection.Vertical, 6),
};
private static readonly AtlasGroup[] _paintingAtlasGroups =
{
new AtlasGroupLargeTile("The Pool" , row: 0, column: 2, rowSpan: 2, columnSpan: 1),
new AtlasGroupLargeTile("Bonjour Monsiuer Courbet", row: 2, column: 2, rowSpan: 2, columnSpan: 1),
new AtlasGroupLargeTile("Seaside" , row: 4, column: 2, rowSpan: 2, columnSpan: 1),
new AtlasGroupLargeTile("sunset_dense" , row: 6, column: 2, rowSpan: 2, columnSpan: 1),
new AtlasGroupLargeTile("Creebet" , row: 8, column: 2, rowSpan: 2, columnSpan: 1),
new AtlasGroupLargeTile("Wanderer" , row: 0, column: 4, rowSpan: 1, columnSpan: 2),
new AtlasGroupLargeTile("Graham" , row: 1, column: 4, rowSpan: 1, columnSpan: 2),
new AtlasGroupLargeTile("Fighters" , row: 0, column: 6, rowSpan: 4, columnSpan: 2),
new AtlasGroupLargeTile("Match" , row: 0, column: 8, rowSpan: 2, columnSpan: 2),
new AtlasGroupLargeTile("Bust" , row: 2, column: 8, rowSpan: 2, columnSpan: 2),
new AtlasGroupLargeTile("The stage is set" , row: 4, column: 8, rowSpan: 2, columnSpan: 2),
new AtlasGroupLargeTile("The Void" , row: 6, column: 8, rowSpan: 2, columnSpan: 2),
new AtlasGroupLargeTile("Skull and Roses" , row: 8, column: 8, rowSpan: 2, columnSpan: 2),
new AtlasGroupLargeTile("Wither" , row: 10, column: 8, rowSpan: 2, columnSpan: 2),
new AtlasGroupLargeTile("Mortal Coil" , row: 12, column: 4, rowSpan: 4, columnSpan: 3),
new AtlasGroupLargeTile("Kong" , row: 12, column: 7, rowSpan: 4, columnSpan: 3),
new AtlasGroupLargeTile("Back Texture" , row: 12, column: 0, rowSpan: 4, columnSpan: 4),
new AtlasGroupLargeTile("Pointer" , row: 0, column: 12, rowSpan: 4, columnSpan: 4),
new AtlasGroupLargeTile("Pigscene" , row: 4, column: 12, rowSpan: 4, columnSpan: 4),
new AtlasGroupLargeTile("Skull On Fire" , row: 8, column: 12, rowSpan: 4, columnSpan: 4),
};
private static readonly AtlasGroup[] _paintingAtlasGroups = JsonConvert.DeserializeObject<AtlasGroup[]>(Resources.painting_groups, _serializerSettings);
private static readonly ResourceLocation[] _all;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,376 @@
{
"Grass": {
"variants": [
"Grass_Common",
"Grass_Mesa",
"Grass_Swamp1",
"Grass_Swamp2"
]
},
"Foliage": {
"variants": [
"Foliage_Default",
"Foliage_Evergreen",
"Foliage_Birch",
"Foliage_Mesa",
"Foliage_Swampland"
]
},
"RedstoneDust": {
"variants": [
"Tile_RedstoneDust",
"Tile_RedstoneDustUnlit",
"Tile_RedstoneDustLitMin",
"Tile_RedstoneDustLitMax"
]
},
"Particle": {
"variants": [
"Particle_Smoke",
"Particle_NetherPortal",
"Particle_EnderPortal",
"Particle_Ender",
"Particle_DragonBreathMin",
"Particle_DragonBreathMax"
]
},
"Particle_ScoreRing": {
"variants": [
"Particle_ScoreRing_Small",
"Particle_ScoreRing_Medium",
"Particle_ScoreRing_Large"
]
},
"Potion_Effect": {
"variants": [
"Potion_BaseColour",
"Effect_MovementSpeed",
"Effect_MovementSlowDown",
"Effect_DigSpeed",
"Effect_DigSlowdown",
"Effect_DamageBoost",
"Effect_Heal",
"Effect_Harm",
"Effect_Jump",
"Effect_Confusion",
"Effect_Regeneration",
"Effect_DamageResistance",
"Effect_FireResistance",
"Effect_WaterBreathing",
"Effect_Invisibility",
"Effect_Blindness",
"Effect_NightVision",
"Effect_Hunger",
"Effect_Weakness",
"Effect_Poison",
"Effect_Wither",
"Effect_HealthBoost",
"Effect_Absorption",
"Effect_Saturation",
"Effect_Levitation",
"Effect_Luck",
"Effect_BadLuck",
"Effect_TurtleMaster",
"Effect_SlowFall"
]
},
"Particle_Drip": {
"variants": [
"Particle_DripWater",
"Particle_DripLavaStart",
"Particle_DripLavaEnd"
]
},
"Particle_Note": {
"variants": [
"Particle_Note_00",
"Particle_Note_01",
"Particle_Note_02",
"Particle_Note_03",
"Particle_Note_04",
"Particle_Note_05",
"Particle_Note_06",
"Particle_Note_07",
"Particle_Note_08",
"Particle_Note_09",
"Particle_Note_10",
"Particle_Note_11",
"Particle_Note_12",
"Particle_Note_13",
"Particle_Note_14",
"Particle_Note_15",
"Particle_Note_16",
"Particle_Note_17",
"Particle_Note_18",
"Particle_Note_19",
"Particle_Note_20",
"Particle_Note_21",
"Particle_Note_22",
"Particle_Note_23",
"Particle_Note_24"
]
},
"Water": {
"isWaterColour": true,
"variants": [
"Water_Plains",
"Water_Ocean",
"Water_Desert",
"Water_ExtremeHills",
"Water_Forest",
"Water_Taiga",
"Water_Swampland",
"Water_River",
"Water_Hell",
"Water_Sky",
"Water_FrozenOcean",
"Water_FrozenRiver",
"Water_IcePlains",
"Water_IceMountains",
"Water_MushroomIsland",
"Water_MushroomIslandShore",
"Water_Beach",
"Water_DesertHills",
"Water_ForestHills",
"Water_TaigaHills",
"Water_ExtremeHillsEdge",
"Water_Jungle",
"Water_JungleHills",
"Water_JungleEdge",
"Water_DeepOcean",
"Water_StoneBeach",
"Water_ColdBeach",
"Water_BirchForest",
"Water_BirchForestHills",
"Water_RoofedForest",
"Water_ColdTaiga",
"Water_ColdTaigaHills",
"Water_MegaTaiga",
"Water_MegaTaigaHills",
"Water_ExtremeHillsPlus",
"Water_Savanna",
"Water_SavannaPlateau",
"Water_Mesa",
"Water_MesaPlateauF",
"Water_MesaPlateau"
]
},
"SpawnEggBaseColor": {
"variants": [
"Mob_Creeper_Colour1",
"Mob_Skeleton_Colour1",
"Mob_Spider_Colour1",
"Mob_Zombie_Colour1",
"Mob_Slime_Colour1",
"Mob_Ghast_Colour1",
"Mob_PigZombie_Colour1",
"Mob_Enderman_Colour1",
"Mob_CaveSpider_Colour1",
"Mob_Silverfish_Colour1",
"Mob_Blaze_Colour1",
"Mob_LavaSlime_Colour1",
"Mob_Pig_Colour1",
"Mob_Sheep_Colour1",
"Mob_Cow_Colour1",
"Mob_Chicken_Colour1",
"Mob_Squid_Colour1",
"Mob_Wolf_Colour1",
"Mob_MushroomCow_Colour1",
"Mob_Ocelot_Colour1",
"Mob_Villager_Colour1",
"Mob_Bat_Colour1",
"Mob_Witch_Colour1",
"Mob_Horse_Colour1",
"Mob_Endermite_Color1",
"Mob_Guardian_Color1",
"Mob_Rabbit_Colour1",
"Mob_PolarBear_Colour1",
"Mob_Shulker_Colour1",
"Mob_Elder_Guardian_Colour1",
"Mob_Evocation_Illager_Colour1",
"Mob_Llama_Colour1",
"Mob_Donkey_Colour1",
"Mob_Skeleton_Horse_Colour1",
"Mob_Zombie_Horse_Colour1",
"Mob_Mule_Colour1",
"Mob_Stray_Colour1",
"Mob_Husk_Colour1",
"Mob_Vex_Colour1",
"Mob_Vindication_Illager_Colour1",
"Mob_Zombie_Villager_Colour1",
"Mob_Parrot_Colour1",
"Mob_Wither_Skeleton_Colour1",
"Mob_Turtle_Colour1",
"Mob_Tropical_Colour1",
"Mob_Cod_Colour1",
"Mob_Pufferfish_Colour1",
"Mob_Salmon_Colour1",
"Mob_Drowned_Colour1",
"Mob_Dolphin_Colour1",
"Mob_Phantom_Colour1"
]
},
"SpawnEggOverlayColor": {
"variants": [
"Mob_Creeper_Colour2",
"Mob_Skeleton_Colour2",
"Mob_Spider_Colour2",
"Mob_Zombie_Colour2",
"Mob_Slime_Colour2",
"Mob_Ghast_Colour2",
"Mob_PigZombie_Colour2",
"Mob_Enderman_Colour2",
"Mob_CaveSpider_Colour2",
"Mob_Silverfish_Colour2",
"Mob_Blaze_Colour2",
"Mob_LavaSlime_Colour2",
"Mob_Pig_Colour2",
"Mob_Sheep_Colour2",
"Mob_Cow_Colour2",
"Mob_Chicken_Colour2",
"Mob_Squid_Colour2",
"Mob_Wolf_Colour2",
"Mob_MushroomCow_Colour2",
"Mob_Ocelot_Colour2",
"Mob_Villager_Colour2",
"Mob_Bat_Colour2",
"Mob_Witch_Colour2",
"Mob_Horse_Colour2",
"Mob_Endermite_Color2",
"Mob_Guardian_Color2",
"Mob_Rabbit_Colour2",
"Mob_PolarBear_Colour2",
"Mob_Shulker_Colour2",
"Mob_Elder_Guardian_Colour2",
"Mob_Evocation_Illager_Colour2",
"Mob_Llama_Colour2",
"Mob_Donkey_Colour2",
"Mob_Skeleton_Horse_Colour2",
"Mob_Zombie_Horse_Colour2",
"Mob_Mule_Colour2",
"Mob_Stray_Colour2",
"Mob_Husk_Colour2",
"Mob_Vex_Colour2",
"Mob_Vindication_Illager_Colour2",
"Mob_Zombie_Villager_Colour2",
"Mob_Parrot_Colour2",
"Mob_Wither_Skeleton_Colour2",
"Mob_Turtle_Colour2",
"Mob_Tropical_Colour2",
"Mob_Cod_Colour2",
"Mob_Pufferfish_Colour2",
"Mob_Salmon_Colour2",
"Mob_Drowned_Colour2",
"Mob_Dolphin_Colour2",
"Mob_Phantom_Colour2"
]
},
"Bed_Color": {
"defaultName": "Bed_White",
"variants": [
"Bed_Black",
"Bed_Blue",
"Bed_Brown",
"Bed_Cyan",
"Bed_Grey",
"Bed_Green",
"Bed_Light_Blue",
"Bed_Lime",
"Bed_Magenta",
"Bed_Orange",
"Bed_Pink",
"Bed_Purple",
"Bed_Red",
"Bed_Silver",
"Bed_White",
"Bed_Yellow"
]
},
"Particle_Explode": {
"variants": [
"Particle_Explode",
"Particle_HugeExplosion"
]
},
"Banner_Color": {
"defaultName": "Banner_White",
"variants": [
"Banner_Black",
"Banner_Blue",
"Banner_Brown",
"Banner_Cyan",
"Banner_Gray",
"Banner_Green",
"Banner_Light_Blue",
"Banner_Lime",
"Banner_Magenta",
"Banner_Orange",
"Banner_Pink",
"Banner_Purple",
"Banner_Red",
"Banner_Silver",
"Banner_White",
"Banner_Yellow"
]
},
"Cauldron_Water_Effect": {
"variants": [
"Cauldron_Water",
"Effect_MovementSpeed",
"Effect_MovementSlowDown",
"Effect_DigSpeed",
"Effect_DigSlowdown",
"Effect_DamageBoost",
"Effect_Heal",
"Effect_Harm",
"Effect_Jump",
"Effect_Confusion",
"Effect_Regeneration",
"Effect_DamageResistance",
"Effect_FireResistance",
"Effect_WaterBreathing",
"Effect_Invisibility",
"Effect_Blindness",
"Effect_NightVision",
"Effect_Hunger",
"Effect_Weakness",
"Effect_Poison",
"Effect_Wither",
"Effect_HealthBoost",
"Effect_Absorption",
"Effect_Saturation",
"Effect_Levitation",
"Effect_Luck",
"Effect_BadLuck",
"Effect_TurtleMaster",
"Effect_SlowFall"
]
},
"Shulker_Box_Color": {
"defaultName": "Shulker_Box_Purple",
"variants": [
"Shulker_Box_Black",
"Shulker_Box_Blue",
"Shulker_Box_Brown",
"Shulker_Box_Cyan",
"Shulker_Box_Grey",
"Shulker_Box_Green",
"Shulker_Box_Light_Blue",
"Shulker_Box_Light_Green",
"Shulker_Box_Magenta",
"Shulker_Box_Orange",
"Shulker_Box_Pink",
"Shulker_Box_Purple",
"Shulker_Box_Red",
"Shulker_Box_Silver",
"Shulker_Box_White",
"Shulker_Box_Yellow"
]
},
"Stem_Color": {
"variants": [
"Tile_StemMin",
"Tile_StemMax"
]
}
}

View File

@@ -3,102 +3,47 @@
"entries": [
{
"internalName": "experience_orb_0",
"displayName": "Experience Orb (Size 1)",
"hasColourEntry": true,
"colourEntry": {
"defaultName": "experience_orb",
"variants": ["experience_orb"]
}
"displayName": "Experience Orb (Size 1)"
},
{
"internalName": "experience_orb_1",
"displayName": "Experience Orb (Size 2)",
"hasColourEntry": true,
"colourEntry": {
"defaultName": "experience_orb",
"variants": ["experience_orb"]
}
"displayName": "Experience Orb (Size 2)"
},
{
"internalName": "experience_orb_2",
"displayName": "Experience Orb (Size 3)",
"hasColourEntry": true,
"colourEntry": {
"defaultName": "experience_orb",
"variants": ["experience_orb"]
}
"displayName": "Experience Orb (Size 3)"
},
{
"internalName": "experience_orb_3",
"displayName": "Experience Orb (Size 4)",
"hasColourEntry": true,
"colourEntry": {
"defaultName": "experience_orb",
"variants": ["experience_orb"]
}
"displayName": "Experience Orb (Size 4)"
},
{
"internalName": "experience_orb_4",
"displayName": "Experience Orb (Size 5)",
"hasColourEntry": true,
"colourEntry": {
"defaultName": "experience_orb",
"variants": ["experience_orb"]
}
"displayName": "Experience Orb (Size 5)"
},
{
"internalName": "experience_orb_5",
"displayName": "Experience Orb (Size 6)",
"hasColourEntry": true,
"colourEntry": {
"defaultName": "experience_orb",
"variants": ["experience_orb"]
}
"displayName": "Experience Orb (Size 6)"
},
{
"internalName": "experience_orb_6",
"displayName": "Experience Orb (Size 7)",
"hasColourEntry": true,
"colourEntry": {
"defaultName": "experience_orb",
"variants": ["experience_orb"]
}
"displayName": "Experience Orb (Size 7)"
},
{
"internalName": "experience_orb_7",
"displayName": "Experience Orb (Size 8)",
"hasColourEntry": true,
"colourEntry": {
"defaultName": "experience_orb",
"variants": ["experience_orb"]
}
"displayName": "Experience Orb (Size 8)"
},
{
"internalName": "experience_orb_8",
"displayName": "Experience Orb (Size 9)",
"hasColourEntry": true,
"colourEntry": {
"defaultName": "experience_orb",
"variants": ["experience_orb"]
}
"displayName": "Experience Orb (Size 9)"
},
{
"internalName": "experience_orb_9",
"displayName": "Experience Orb (Size 10)",
"hasColourEntry": true,
"colourEntry": {
"defaultName": "experience_orb",
"variants": ["experience_orb"]
}
"displayName": "Experience Orb (Size 10)"
},
{
"internalName": "experience_orb_10",
"displayName": "Experience Orb (Size 11)",
"hasColourEntry": true,
"colourEntry": {
"defaultName": "experience_orb",
"variants": ["experience_orb"]
}
"displayName": "Experience Orb (Size 11)"
},
{
"internalName": "",

View File

@@ -1,197 +1,85 @@
{
"COMMENT_1": "JSON by MattNL",
"entries": [
{
"internalName": "explosion_0",
"displayName": "Explosion (Stage 1)",
"hasColourEntry": true,
"colourEntry": {
"defaultName": "Particle_Explode",
"variants": [
"Particle_Explode",
"Particle_HugeExplosion"
]
}
},
{
"internalName": "explosion_1",
"displayName": "Explosion (Stage 2)",
"hasColourEntry": true,
"colourEntry": {
"defaultName": "Particle_Explode",
"variants": [
"Particle_Explode",
"Particle_HugeExplosion"
]
}
},
{
"internalName": "explosion_2",
"displayName": "Explosion (Stage 3)",
"hasColourEntry": true,
"colourEntry": {
"defaultName": "Particle_Explode",
"variants": [
"Particle_Explode",
"Particle_HugeExplosion"
]
}
},
{
"internalName": "explosion_3",
"displayName": "Explosion (Stage 4)",
"hasColourEntry": true,
"colourEntry": {
"defaultName": "Particle_Explode",
"variants": [
"Particle_Explode",
"Particle_HugeExplosion"
]
}
},
{
"internalName": "explosion_4",
"displayName": "Explosion (Stage 5)",
"hasColourEntry": true,
"colourEntry": {
"defaultName": "Particle_Explode",
"variants": [
"Particle_Explode",
"Particle_HugeExplosion"
]
}
},
{
"internalName": "explosion_5",
"displayName": "Explosion (Stage 6)",
"hasColourEntry": true,
"colourEntry": {
"defaultName": "Particle_Explode",
"variants": [
"Particle_Explode",
"Particle_HugeExplosion"
]
}
},
{
"internalName": "explosion_6",
"displayName": "Explosion (Stage 7)",
"hasColourEntry": true,
"colourEntry": {
"defaultName": "Particle_Explode",
"variants": [
"Particle_Explode",
"Particle_HugeExplosion"
]
}
},
{
"internalName": "explosion_7",
"displayName": "Explosion (Stage 8)",
"hasColourEntry": true,
"colourEntry": {
"defaultName": "Particle_Explode",
"variants": [
"Particle_Explode",
"Particle_HugeExplosion"
]
}
},
{
"internalName": "explosion_8",
"displayName": "Explosion (Stage 9)",
"hasColourEntry": true,
"colourEntry": {
"defaultName": "Particle_Explode",
"variants": [
"Particle_Explode",
"Particle_HugeExplosion"
]
}
},
{
"internalName": "explosion_9",
"displayName": "Explosion (Stage 10)",
"hasColourEntry": true,
"colourEntry": {
"defaultName": "Particle_Explode",
"variants": [
"Particle_Explode",
"Particle_HugeExplosion"
]
}
},
{
"internalName": "explosion_10",
"displayName": "Explosion (Stage 11)",
"hasColourEntry": true,
"colourEntry": {
"defaultName": "Particle_Explode",
"variants": [
"Particle_Explode",
"Particle_HugeExplosion"
]
}
},
{
"internalName": "explosion_11",
"displayName": "Explosion (Stage 12)",
"hasColourEntry": true,
"colourEntry": {
"defaultName": "Particle_Explode",
"variants": [
"Particle_Explode",
"Particle_HugeExplosion"
]
}
},
{
"internalName": "explosion_12",
"displayName": "Explosion (Stage 13)",
"hasColourEntry": true,
"colourEntry": {
"defaultName": "Particle_Explode",
"variants": [
"Particle_Explode",
"Particle_HugeExplosion"
]
}
},
{
"internalName": "explosion_13",
"displayName": "Explosion (Stage 14)",
"hasColourEntry": true,
"colourEntry": {
"defaultName": "Particle_Explode",
"variants": [
"Particle_Explode",
"Particle_HugeExplosion"
]
}
},
{
"internalName": "explosion_14",
"displayName": "Explosion (Stage 15)",
"hasColourEntry": true,
"colourEntry": {
"defaultName": "Particle_Explode",
"variants": [
"Particle_Explode",
"Particle_HugeExplosion"
]
}
},
{
"internalName": "explosion_15",
"displayName": "Explosion (Stage 16)",
"hasColourEntry": true,
"colourEntry": {
"defaultName": "Particle_Explode",
"variants": [
"Particle_Explode",
"Particle_HugeExplosion"
]
}
}
]
"COMMENT_1": "JSON by MattNL",
"entries": [
{
"internalName": "explosion_0",
"displayName": "Explosion (Stage 1)",
"colorKey": "Particle_Explode"
},
{
"internalName": "explosion_1",
"displayName": "Explosion (Stage 2)",
"colorKey": "Particle_Explode"
},
{
"internalName": "explosion_2",
"displayName": "Explosion (Stage 3)",
"colorKey": "Particle_Explode"
},
{
"internalName": "explosion_3",
"displayName": "Explosion (Stage 4)",
"colorKey": "Particle_Explode"
},
{
"internalName": "explosion_4",
"displayName": "Explosion (Stage 5)",
"colorKey": "Particle_Explode"
},
{
"internalName": "explosion_5",
"displayName": "Explosion (Stage 6)",
"colorKey": "Particle_Explode"
},
{
"internalName": "explosion_6",
"displayName": "Explosion (Stage 7)",
"colorKey": "Particle_Explode"
},
{
"internalName": "explosion_7",
"displayName": "Explosion (Stage 8)",
"colorKey": "Particle_Explode"
},
{
"internalName": "explosion_8",
"displayName": "Explosion (Stage 9)",
"colorKey": "Particle_Explode"
},
{
"internalName": "explosion_9",
"displayName": "Explosion (Stage 10)",
"colorKey": "Particle_Explode"
},
{
"internalName": "explosion_10",
"displayName": "Explosion (Stage 11)",
"colorKey": "Particle_Explode"
},
{
"internalName": "explosion_11",
"displayName": "Explosion (Stage 12)",
"colorKey": "Particle_Explode"
},
{
"internalName": "explosion_12",
"displayName": "Explosion (Stage 13)",
"colorKey": "Particle_Explode"
},
{
"internalName": "explosion_13",
"displayName": "Explosion (Stage 14)",
"colorKey": "Particle_Explode"
},
{
"internalName": "explosion_14",
"displayName": "Explosion (Stage 15)",
"colorKey": "Particle_Explode"
},
{
"internalName": "explosion_15",
"displayName": "Explosion (Stage 16)",
"colorKey": "Particle_Explode"
}
]
}

View File

@@ -0,0 +1,40 @@
[
{
"name": "Bow Pulling",
"row": 5,
"column": 6,
"frameCount": 3,
"frameTime": 6,
"direction": 1
},
{
"name": "Leather Cap",
"row": 0,
"column": 0,
"overlay": { "row": 0, "column": 9 }
},
{
"name": "Leather Tunic",
"row": 0,
"column": 1,
"overlay": { "row": 0, "column": 10 }
},
{
"name": "Leather Pants",
"row": 0,
"column": 2,
"overlay": { "row": 0, "column": 11 }
},
{
"name": "Leather Boots",
"row": 0,
"column": 3,
"overlay": { "row": 0, "column": 12 }
},
{
"name": "Leather Horse Armor",
"row": 15,
"column": 13,
"overlay": { "row": 0, "column": 16 }
}
]

View File

@@ -0,0 +1,162 @@
[
{
"name": "The Pool",
"row": 0,
"column": 2,
"rowSpan": 2,
"columnSpan": 1,
"direction": 1
},
{
"name": "Bonjour Monsiuer Courbet",
"row": 2,
"column": 2,
"rowSpan": 2,
"columnSpan": 1,
"direction": 0
},
{
"name": "Seaside",
"row": 4,
"column": 2,
"rowSpan": 2,
"columnSpan": 1,
"direction": 0
},
{
"name": "sunset_dense",
"row": 6,
"column": 2,
"rowSpan": 2,
"columnSpan": 1,
"direction": 0
},
{
"name": "Creebet",
"row": 8,
"column": 2,
"rowSpan": 2,
"columnSpan": 1,
"direction": 0
},
{
"name": "Wanderer",
"row": 0,
"column": 4,
"rowSpan": 1,
"columnSpan": 2,
"direction": 1
},
{
"name": "Graham",
"row": 1,
"column": 4,
"rowSpan": 1,
"columnSpan": 2,
"direction": 1
},
{
"name": "Fighters",
"row": 0,
"column": 6,
"rowSpan": 4,
"columnSpan": 2,
"direction": 1
},
{
"name": "Match",
"row": 0,
"column": 8,
"rowSpan": 2,
"columnSpan": 2,
"direction": 1
},
{
"name": "Bust",
"row": 2,
"column": 8,
"rowSpan": 2,
"columnSpan": 2,
"direction": 1
},
{
"name": "The stage is set",
"row": 4,
"column": 8,
"rowSpan": 2,
"columnSpan": 2,
"direction": 1
},
{
"name": "The Void",
"row": 6,
"column": 8,
"rowSpan": 2,
"columnSpan": 2,
"direction": 1
},
{
"name": "Skull and Roses",
"row": 8,
"column": 8,
"rowSpan": 2,
"columnSpan": 2,
"direction": 0
},
{
"name": "Wither",
"row": 10,
"column": 8,
"rowSpan": 2,
"columnSpan": 2,
"direction": 0
},
{
"name": "Mortal Coil",
"row": 12,
"column": 4,
"rowSpan": 4,
"columnSpan": 3,
"direction": 0
},
{
"name": "Kong",
"row": 12,
"column": 7,
"rowSpan": 4,
"columnSpan": 3,
"direction": 0
},
{
"name": "Back Texture",
"row": 12,
"column": 0,
"rowSpan": 4,
"columnSpan": 4,
"direction": 0
},
{
"name": "Pointer",
"row": 0,
"column": 12,
"rowSpan": 4,
"columnSpan": 4,
"direction": 1
},
{
"name": "Pigscene",
"row": 4,
"column": 12,
"rowSpan": 4,
"columnSpan": 4,
"direction": 1
},
{
"name": "Skull On Fire",
"row": 8,
"column": 12,
"rowSpan": 4,
"columnSpan": 4,
"direction": 1
}
]

View File

@@ -0,0 +1,85 @@
[
{
"name": "Generic",
"row": 0,
"column": 0,
"frameCount": 8,
"frameTime": 2,
"direction": 0
},
{
"name": "Splash",
"row": 3,
"column": 1,
"frameCount": 4,
"frameTime": 2,
"direction": 0
},
{
"name": "Drip",
"row": 0,
"column": 7,
"frameCount": 3,
"frameTime": 4,
"direction": 0
},
{
"name": "Effect",
"row": 0,
"column": 8,
"frameCount": 8,
"frameTime": 2,
"direction": 0
},
{
"name": "Splash Effect",
"row": 0,
"column": 9,
"frameCount": 8,
"frameTime": 2,
"direction": 0
},
{
"name": "Firework Spark",
"row": 0,
"column": 10,
"frameCount": 8,
"frameTime": 2,
"direction": 0
},
{
"name": "Shulker/End Rod Glitter",
"row": 0,
"column": 11,
"frameCount": 8,
"frameTime": 2,
"direction": 0
},
{
"name": "Bedrock Edition Explosion (Unused)",
"row": 0,
"column": 12,
"frameCount": 16,
"frameTime": 1,
"direction": 0
},
{
"name": "Firework Flash",
"row": 4,
"column": 2,
"rowSpan": 4,
"columnSpan": 4,
"direction": 0,
"allowCustomColor": true
},
{
"name": "Bubble Pop (Unused)",
"row": 6,
"column": 6,
"frameCount": 5,
"rowSpan": 2,
"columnSpan": 2,
"frameTime": 2,
"direction": 0
}
]

View File

@@ -0,0 +1,146 @@
[
{
"name": "Oak Door",
"row": 1,
"column": 5,
"rowSpan": 1,
"columnSpan": 2,
"direction": 1
},
{
"name": "Iron Door",
"row": 2,
"column": 5,
"rowSpan": 1,
"columnSpan": 2,
"direction": 1
},
{
"name": "Acacia Door",
"row": 0,
"column": 23,
"rowSpan": 1,
"columnSpan": 2,
"direction": 1
},
{
"name": "Birch Door",
"row": 1,
"column": 23,
"rowSpan": 1,
"columnSpan": 2,
"direction": 1
},
{
"name": "Dark Oak Door",
"row": 2,
"column": 23,
"rowSpan": 1,
"columnSpan": 2,
"direction": 1
},
{
"name": "Jungle Door",
"row": 3,
"column": 23,
"rowSpan": 1,
"columnSpan": 2,
"direction": 1
},
{
"name": "Spruce Door",
"row": 4,
"column": 23,
"rowSpan": 1,
"columnSpan": 2,
"direction": 1
},
{
"name": "Large Fern",
"row": 0,
"column": 20,
"rowSpan": 1,
"columnSpan": 2,
"direction": 1
},
{
"name": "Double Tall Grass",
"row": 1,
"column": 20,
"rowSpan": 1,
"columnSpan": 2,
"direction": 1
},
{
"name": "Poeny",
"row": 2,
"column": 20,
"rowSpan": 1,
"columnSpan": 2,
"direction": 1
},
{
"name": "Rose Bush",
"row": 3,
"column": 20,
"rowSpan": 1,
"columnSpan": 2,
"direction": 1
},
{
"name": "Lilac",
"row": 4,
"column": 20,
"rowSpan": 1,
"columnSpan": 2,
"direction": 1
},
{
"name": "Wheat",
"row": 8,
"column": 5,
"frameCount": 8,
"frameTime": 5,
"direction": 0
},
{
"name": "Potatoes",
"row": 9,
"column": 16,
"frameCount": 4,
"frameTime": 9,
"direction": 0
},
{
"name": "Carrots",
"row": 8,
"column": 12,
"frameCount": 4,
"frameTime": 9,
"direction": 0
},
{
"name": "Beetroots",
"row": 0,
"column": 25,
"frameCount": 4,
"frameTime": 9,
"direction": 0
},
{
"name": "Nether Wart",
"row": 2,
"column": 14,
"frameCount": 3,
"frameTime": 10,
"direction": 0
},
{
"name": "Destroy",
"row": 0,
"column": 15,
"frameCount": 10,
"frameTime": 3,
"direction": 0
}
]

View File

@@ -6,11 +6,7 @@
"internalName": "helmetCloth",
"displayName": "Leather Cap",
"allowCustomColour": true,
"hasColourEntry": true,
"colourEntry": {
"defaultName": "Armour_Default_Leather_Colour",
"variants": [ "Armour_Default_Leather_Colour" ]
}
"colorKey": "Armour_Default_Leather_Colour"
},
{
"internalName": "helmetChain",
@@ -76,11 +72,7 @@
"internalName": "chestplateCloth",
"displayName": "Leather Tunic",
"allowCustomColour": true,
"hasColourEntry": true,
"colourEntry": {
"defaultName": "Armour_Default_Leather_Colour",
"variants": [ "Armour_Default_Leather_Colour" ]
}
"colorKey": "Armour_Default_Leather_Colour"
},
{
"internalName": "chestplateChain",
@@ -146,11 +138,7 @@
"internalName": "leggingsCloth",
"displayName": "Leather Pants",
"allowCustomColour": true,
"hasColourEntry": true,
"colourEntry": {
"defaultName": "Armour_Default_Leather_Colour",
"variants": [ "Armour_Default_Leather_Colour" ]
}
"colorKey": "Armour_Default_Leather_Colour"
},
{
"internalName": "leggingsChain",
@@ -216,11 +204,7 @@
"internalName": "bootsCloth",
"displayName": "Leather Boots",
"allowCustomColour": true,
"hasColourEntry": true,
"colourEntry": {
"defaultName": "Armour_Default_Leather_Colour",
"variants": [ "Armour_Default_Leather_Colour" ]
}
"colorKey": "Armour_Default_Leather_Colour"
},
{
"internalName": "bootsChain",
@@ -594,41 +578,7 @@
"internalName": "potion_contents",
"displayName": "Potion (Overlay)",
"allowCustomColour": true,
"hasColourEntry": true,
"colourEntry": {
"defaultName": "Potion_BaseColour",
"variants": [
"Potion_BaseColour",
"Effect_MovementSpeed",
"Effect_MovementSlowDown",
"Effect_DigSpeed",
"Effect_DigSlowdown",
"Effect_DamageBoost",
"Effect_Heal",
"Effect_Harm",
"Effect_Jump",
"Effect_Confusion",
"Effect_Regeneration",
"Effect_DamageResistance",
"Effect_FireResistance",
"Effect_WaterBreathing",
"Effect_Invisibility",
"Effect_Blindness",
"Effect_NightVision",
"Effect_Hunger",
"Effect_Weakness",
"Effect_Poison",
"Effect_Wither",
"Effect_HealthBoost",
"Effect_Absorption",
"Effect_Saturation",
"Effect_Levitation",
"Effect_Luck",
"Effect_BadLuck",
"Effect_TurtleMaster",
"Effect_SlowFall"
]
}
"colorKey": "Potion_Effect"
},
{
"internalName": "dyePowder_blue",
@@ -677,63 +627,7 @@
{
"internalName": "monsterPlacer",
"displayName": "Spawn Egg",
"hasColourEntry": true,
"colourEntry": {
"defaultName": "Mob_Creeper_Colour1",
"variants": [
"Mob_Creeper_Colour1",
"Mob_Skeleton_Colour1",
"Mob_Spider_Colour1",
"Mob_Zombie_Colour1",
"Mob_Slime_Colour1",
"Mob_Ghast_Colour1",
"Mob_PigZombie_Colour1",
"Mob_Enderman_Colour1",
"Mob_CaveSpider_Colour1",
"Mob_Silverfish_Colour1",
"Mob_Blaze_Colour1",
"Mob_LavaSlime_Colour1",
"Mob_Pig_Colour1",
"Mob_Sheep_Colour1",
"Mob_Cow_Colour1",
"Mob_Chicken_Colour1",
"Mob_Squid_Colour1",
"Mob_Wolf_Colour1",
"Mob_MushroomCow_Colour1",
"Mob_Ocelot_Colour1",
"Mob_Villager_Colour1",
"Mob_Bat_Colour1",
"Mob_Witch_Colour1",
"Mob_Horse_Colour1",
"Mob_Endermite_Color1",
"Mob_Guardian_Color1",
"Mob_Rabbit_Colour1",
"Mob_PolarBear_Colour1",
"Mob_Shulker_Colour1",
"Mob_Elder_Guardian_Colour1",
"Mob_Evocation_Illager_Colour1",
"Mob_Llama_Colour1",
"Mob_Donkey_Colour1",
"Mob_Skeleton_Horse_Colour1",
"Mob_Zombie_Horse_Colour1",
"Mob_Mule_Colour1",
"Mob_Stray_Colour1",
"Mob_Husk_Colour1",
"Mob_Vex_Colour1",
"Mob_Vindication_Illager_Colour1",
"Mob_Zombie_Villager_Colour1",
"Mob_Parrot_Colour1",
"Mob_Wither_Skeleton_Colour1",
"Mob_Turtle_Colour1",
"Mob_Tropical_Colour1",
"Mob_Cod_Colour1",
"Mob_Pufferfish_Colour1",
"Mob_Salmon_Colour1",
"Mob_Drowned_Colour1",
"Mob_Dolphin_Colour1",
"Mob_Phantom_Colour1"
]
}
"colorKey": "SpawnEggBaseColor"
},
{
"internalName": "potion_splash",
@@ -798,89 +692,12 @@
{
"internalName": "monsterPlacer_overlay",
"displayName": "Spawn Egg (Overlay)",
"hasColourEntry": true,
"colourEntry": {
"defaultName": "Mob_Creeper_Colour2",
"variants": [
"Mob_Creeper_Colour2",
"Mob_Skeleton_Colour2",
"Mob_Spider_Colour2",
"Mob_Zombie_Colour2",
"Mob_Slime_Colour2",
"Mob_Ghast_Colour2",
"Mob_PigZombie_Colour2",
"Mob_Enderman_Colour2",
"Mob_CaveSpider_Colour2",
"Mob_Silverfish_Colour2",
"Mob_Blaze_Colour2",
"Mob_LavaSlime_Colour2",
"Mob_Pig_Colour2",
"Mob_Sheep_Colour2",
"Mob_Cow_Colour2",
"Mob_Chicken_Colour2",
"Mob_Squid_Colour2",
"Mob_Wolf_Colour2",
"Mob_MushroomCow_Colour2",
"Mob_Ocelot_Colour2",
"Mob_Villager_Colour2",
"Mob_Bat_Colour2",
"Mob_Witch_Colour2",
"Mob_Horse_Colour2",
"Mob_Endermite_Color2",
"Mob_Guardian_Color2",
"Mob_Rabbit_Colour2",
"Mob_PolarBear_Colour2",
"Mob_Shulker_Colour2",
"Mob_Elder_Guardian_Colour2",
"Mob_Evocation_Illager_Colour2",
"Mob_Llama_Colour2",
"Mob_Donkey_Colour2",
"Mob_Skeleton_Horse_Colour2",
"Mob_Zombie_Horse_Colour2",
"Mob_Mule_Colour2",
"Mob_Stray_Colour2",
"Mob_Husk_Colour2",
"Mob_Vex_Colour2",
"Mob_Vindication_Illager_Colour2",
"Mob_Zombie_Villager_Colour2",
"Mob_Parrot_Colour2",
"Mob_Wither_Skeleton_Colour2",
"Mob_Turtle_Colour2",
"Mob_Tropical_Colour2",
"Mob_Cod_Colour2",
"Mob_Pufferfish_Colour2",
"Mob_Salmon_Colour2",
"Mob_Drowned_Colour2",
"Mob_Dolphin_Colour2",
"Mob_Phantom_Colour2"
]
}
"colorKey": "SpawnEggOverlayColor"
},
{
"internalName": "bed_overlay",
"displayName": "Bed (Overlay)",
"hasColourEntry": true,
"colourEntry": {
"defaultName": "Bed_White",
"variants": [
"Bed_Black",
"Bed_Blue",
"Bed_Brown",
"Bed_Cyan",
"Bed_Grey",
"Bed_Green",
"Bed_Light_Blue",
"Bed_Lime",
"Bed_Magenta",
"Bed_Orange",
"Bed_Pink",
"Bed_Purple",
"Bed_Red",
"Bed_Silver",
"Bed_White",
"Bed_Yellow"
]
}
"colorKey": "Bed_Color"
},
{
"internalName": "expBottle",
@@ -1095,11 +912,7 @@
"internalName": "leather_horse_armor_base",
"displayName": "Leather Horse Armor",
"allowCustomColour": true,
"hasColourEntry": true,
"colourEntry": {
"defaultName": "Armour_Default_Leather_Colour",
"variants": [ "Armour_Default_Leather_Colour" ]
}
"colorKey": "Armour_Default_Leather_Colour"
},
{
"internalName": "structure_void",

View File

@@ -51,21 +51,19 @@
},
{
"internalName": "Back",
"displayName": "Back Texture",
"width": 4,
"height": 4
"displayName": "Back Texture"
},
{
"internalName": "Back",
"displayName": "",
"displayName": ""
},
{
"internalName": "Back",
"displayName": "",
"displayName": ""
},
{
"internalName": "Back",
"displayName": "",
"displayName": ""
},
{
"internalName": "1x1E1",
@@ -121,20 +119,19 @@
},
{
"internalName": "Back",
"displayName": "",
"displayName": ""
},
{
"internalName": "Back",
"displayName": "",
"displayName": ""
},
{
"internalName": "Back",
"displayName": "",
"displayName": ""
},
{
"internalName": "Pool",
"displayName": "\"The Pool\" by Kristoffer Zetterstrand",
"width": 2
"displayName": "\"The Pool\" by Kristoffer Zetterstrand"
},
{
"internalName": "Pool",
@@ -142,8 +139,7 @@
},
{
"internalName": "Courbet",
"displayName": "\"Bonjour Monsieur Courbet\" by Kristoffer Zetterstrand",
"width": 2
"displayName": "\"Bonjour Monsieur Courbet\" by Kristoffer Zetterstrand"
},
{
"internalName": "Courbet",
@@ -151,8 +147,7 @@
},
{
"internalName": "Sea",
"displayName": "\"Seaside\" by Kristoffer Zetterstrand",
"width": 2
"displayName": "\"Seaside\" by Kristoffer Zetterstrand"
},
{
"internalName": "Sea",
@@ -160,8 +155,7 @@
},
{
"internalName": "Sunset",
"displayName": "\"sunset_dense\" by Kristoffer Zetterstrand",
"width": 2
"displayName": "\"sunset_dense\" by Kristoffer Zetterstrand"
},
{
"internalName": "Sunset",
@@ -169,8 +163,7 @@
},
{
"internalName": "Creebet",
"displayName": "\"Creebet\" by Kristoffer Zetterstrand",
"width": 2
"displayName": "\"Creebet\" by Kristoffer Zetterstrand"
},
{
"internalName": "Creebet",
@@ -190,15 +183,15 @@
},
{
"internalName": "Back",
"displayName": "",
"displayName": ""
},
{
"internalName": "Back",
"displayName": "",
"displayName": ""
},
{
"internalName": "Back",
"displayName": "",
"displayName": ""
},
{
"internalName": "",
@@ -254,25 +247,23 @@
},
{
"internalName": "Back",
"displayName": "",
"displayName": ""
},
{
"internalName": "Back",
"displayName": "",
"displayName": ""
},
{
"internalName": "Back",
"displayName": "",
"displayName": ""
},
{
"internalName": "Wanderer",
"displayName": "\"Wanderer\" by Kristoffer Zetterstrand",
"height": 2
"displayName": "\"Wanderer\" by Kristoffer Zetterstrand"
},
{
"internalName": "Graham",
"displayName": "\"Graham\" by Kristoffer Zetterstrand",
"height": 2
"displayName": "\"Graham\" by Kristoffer Zetterstrand"
},
{
"internalName": "",
@@ -316,21 +307,19 @@
},
{
"internalName": "Skeleton",
"displayName": "\"Mortal Coil\" by Kristoffer Zetterstrand",
"width": 4,
"height": 3
"displayName": "\"Mortal Coil\" by Kristoffer Zetterstrand"
},
{
"internalName": "Skeleton",
"displayName": "",
"displayName": ""
},
{
"internalName": "Skeleton",
"displayName": "",
"displayName": ""
},
{
"internalName": "Skeleton",
"displayName": "",
"displayName": ""
},
{
"internalName": "Wanderer",
@@ -382,25 +371,23 @@
},
{
"internalName": "Skeleton",
"displayName": "",
"displayName": ""
},
{
"internalName": "Skeleton",
"displayName": "",
"displayName": ""
},
{
"internalName": "Skeleton",
"displayName": "",
"displayName": ""
},
{
"internalName": "Skeleton",
"displayName": "",
"displayName": ""
},
{
"internalName": "Fighters",
"displayName": "\"Fighters\" by Kristoffer Zetterstrand",
"width": 4,
"height": 2
"displayName": "\"Fighters\" by Kristoffer Zetterstrand"
},
{
"internalName": "Fighters",
@@ -512,9 +499,7 @@
},
{
"internalName": "DonkeyKong",
"displayName": "\"Kong\" by Kristoffer Zetterstrand",
"width": 4,
"height": 3
"displayName": "\"Kong\" by Kristoffer Zetterstrand"
},
{
"internalName": "DonkeyKong",
@@ -530,9 +515,7 @@
},
{
"internalName": "Match",
"displayName": "\"Match\" by Kristoffer Zetterstrand",
"width": 2,
"height": 2
"displayName": "\"Match\" by Kristoffer Zetterstrand"
},
{
"internalName": "Match",
@@ -540,9 +523,7 @@
},
{
"internalName": "Bust",
"displayName": "\"Bust\" by Kristoffer Zetterstrand",
"width": 2,
"height": 2
"displayName": "\"Bust\" by Kristoffer Zetterstrand"
},
{
"internalName": "Bust",
@@ -550,9 +531,7 @@
},
{
"internalName": "Stage",
"displayName": "\"The stage is set\" by Kristoffer Zetterstrand",
"width": 2,
"height": 2
"displayName": "\"The stage is set\" by Kristoffer Zetterstrand"
},
{
"internalName": "Stage",
@@ -560,9 +539,7 @@
},
{
"internalName": "Void",
"displayName": "\"The Void\" by Kristoffer Zetterstrand",
"width": 2,
"height": 2
"displayName": "\"The Void\" by Kristoffer Zetterstrand"
},
{
"internalName": "Void",
@@ -570,9 +547,7 @@
},
{
"internalName": "SkullAndRoses",
"displayName": "\"Skull and Roses\" by Kristoffer Zetterstrand",
"width": 2,
"height": 2
"displayName": "\"Skull and Roses\" by Kristoffer Zetterstrand"
},
{
"internalName": "SkullAndRoses",
@@ -580,9 +555,7 @@
},
{
"internalName": "Wither",
"displayName": "\"Wither\" by Jens Bergensten",
"width": 2,
"height": 2
"displayName": "\"Wither\" by Jens Bergensten"
},
{
"internalName": "Wither",
@@ -654,19 +627,19 @@
},
{
"internalName": "DonkeyKong",
"displayName": "",
"displayName": ""
},
{
"internalName": "DonkeyKong",
"displayName": "",
"displayName": ""
},
{
"internalName": "DonkeyKong",
"displayName": "",
"displayName": ""
},
{
"internalName": "DonkeyKong",
"displayName": "",
"displayName": ""
},
{
"internalName": "",
@@ -798,9 +771,7 @@
},
{
"internalName": "Pointer",
"displayName": "\"Pointer\" by Kristoffer Zetterstrand",
"width": 4,
"height": 4
"displayName": "\"Pointer\" by Kristoffer Zetterstrand"
},
{
"internalName": "Pointer",
@@ -816,9 +787,7 @@
},
{
"internalName": "Pigscene",
"displayName": "\"Pigscene\" by Kristoffer Zetterstrand",
"width": 4,
"height": 4
"displayName": "\"Pigscene\" by Kristoffer Zetterstrand"
},
{
"internalName": "Pigscene",
@@ -834,9 +803,7 @@
},
{
"internalName": "BurningSkull",
"displayName": "\"Skull On Fire\" by Kristoffer Zetterstrand",
"width": 4,
"height": 4
"displayName": "\"Skull On Fire\" by Kristoffer Zetterstrand"
},
{
"internalName": "BurningSkull",
@@ -852,83 +819,19 @@
},
{
"internalName": "",
"displayName": "",
},
{
"internalName": "",
"displayName": "",
},
{
"internalName": "",
"displayName": "",
},
{
"internalName": "",
"displayName": "",
},
{
"internalName": "Pointer",
"displayName": "",
},
{
"internalName": "Pointer",
"displayName": ""
},
{
"internalName": "Pointer",
"displayName": ""
},
{
"internalName": "Pointer",
"displayName": ""
},
{
"internalName": "Pigscene",
"displayName": ""
},
{
"internalName": "Pigscene",
"displayName": ""
},
{
"internalName": "Pigscene",
"displayName": ""
},
{
"internalName": "Pigscene",
"displayName": ""
},
{
"internalName": "BurningSkull",
"displayName": ""
},
{
"internalName": "BurningSkull",
"displayName": ""
},
{
"internalName": "BurningSkull",
"displayName": ""
},
{
"internalName": "BurningSkull",
"displayName": ""
},
{
"internalName": "",
"displayName": "",
"displayName": ""
},
{
"internalName": "",
"displayName": "",
"displayName": ""
},
{
"internalName": "",
"displayName": "",
},
{
"internalName": "",
"displayName": "",
"displayName": ""
},
{
"internalName": "Pointer",
@@ -948,7 +851,7 @@
},
{
"internalName": "Pigscene",
"displayName": "",
"displayName": ""
},
{
"internalName": "Pigscene",
@@ -964,7 +867,7 @@
},
{
"internalName": "BurningSkull",
"displayName": "",
"displayName": ""
},
{
"internalName": "BurningSkull",
@@ -980,23 +883,23 @@
},
{
"internalName": "",
"displayName": "",
"displayName": ""
},
{
"internalName": "",
"displayName": "",
"displayName": ""
},
{
"internalName": "",
"displayName": "",
"displayName": ""
},
{
"internalName": "",
"displayName": "",
"displayName": ""
},
{
"internalName": "Pointer",
"displayName": "",
"displayName": ""
},
{
"internalName": "Pointer",
@@ -1012,7 +915,7 @@
},
{
"internalName": "Pigscene",
"displayName": "",
"displayName": ""
},
{
"internalName": "Pigscene",
@@ -1028,7 +931,7 @@
},
{
"internalName": "BurningSkull",
"displayName": "",
"displayName": ""
},
{
"internalName": "BurningSkull",
@@ -1044,19 +947,83 @@
},
{
"internalName": "",
"displayName": "",
"displayName": ""
},
{
"internalName": "",
"displayName": "",
"displayName": ""
},
{
"internalName": "",
"displayName": "",
"displayName": ""
},
{
"internalName": "",
"displayName": "",
"displayName": ""
},
{
"internalName": "Pointer",
"displayName": ""
},
{
"internalName": "Pointer",
"displayName": ""
},
{
"internalName": "Pointer",
"displayName": ""
},
{
"internalName": "Pointer",
"displayName": ""
},
{
"internalName": "Pigscene",
"displayName": ""
},
{
"internalName": "Pigscene",
"displayName": ""
},
{
"internalName": "Pigscene",
"displayName": ""
},
{
"internalName": "Pigscene",
"displayName": ""
},
{
"internalName": "BurningSkull",
"displayName": ""
},
{
"internalName": "BurningSkull",
"displayName": ""
},
{
"internalName": "BurningSkull",
"displayName": ""
},
{
"internalName": "BurningSkull",
"displayName": ""
},
{
"internalName": "",
"displayName": ""
},
{
"internalName": "",
"displayName": ""
},
{
"internalName": "",
"displayName": ""
},
{
"internalName": "",
"displayName": ""
}
]
}

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 222 KiB

After

Width:  |  Height:  |  Size: 222 KiB

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

@@ -0,0 +1,124 @@
{
"COMMENT_1": "JSON by MattNL",
"entries": [
{
"internalName": "experience_orb_0",
"displayName": "Experience Orb (Size 1)",
"hasColourEntry": true,
"colourEntry": {
"defaultName": "experience_orb",
"variants": ["experience_orb"]
}
},
{
"internalName": "experience_orb_1",
"displayName": "Experience Orb (Size 2)",
"hasColourEntry": true,
"colourEntry": {
"defaultName": "experience_orb",
"variants": ["experience_orb"]
}
},
{
"internalName": "experience_orb_2",
"displayName": "Experience Orb (Size 3)",
"hasColourEntry": true,
"colourEntry": {
"defaultName": "experience_orb",
"variants": ["experience_orb"]
}
},
{
"internalName": "experience_orb_3",
"displayName": "Experience Orb (Size 4)",
"hasColourEntry": true,
"colourEntry": {
"defaultName": "experience_orb",
"variants": ["experience_orb"]
}
},
{
"internalName": "experience_orb_4",
"displayName": "Experience Orb (Size 5)",
"hasColourEntry": true,
"colourEntry": {
"defaultName": "experience_orb",
"variants": ["experience_orb"]
}
},
{
"internalName": "experience_orb_5",
"displayName": "Experience Orb (Size 6)",
"hasColourEntry": true,
"colourEntry": {
"defaultName": "experience_orb",
"variants": ["experience_orb"]
}
},
{
"internalName": "experience_orb_6",
"displayName": "Experience Orb (Size 7)",
"hasColourEntry": true,
"colourEntry": {
"defaultName": "experience_orb",
"variants": ["experience_orb"]
}
},
{
"internalName": "experience_orb_7",
"displayName": "Experience Orb (Size 8)",
"hasColourEntry": true,
"colourEntry": {
"defaultName": "experience_orb",
"variants": ["experience_orb"]
}
},
{
"internalName": "experience_orb_8",
"displayName": "Experience Orb (Size 9)",
"hasColourEntry": true,
"colourEntry": {
"defaultName": "experience_orb",
"variants": ["experience_orb"]
}
},
{
"internalName": "experience_orb_9",
"displayName": "Experience Orb (Size 10)",
"hasColourEntry": true,
"colourEntry": {
"defaultName": "experience_orb",
"variants": ["experience_orb"]
}
},
{
"internalName": "experience_orb_10",
"displayName": "Experience Orb (Size 11)",
"hasColourEntry": true,
"colourEntry": {
"defaultName": "experience_orb",
"variants": ["experience_orb"]
}
},
{
"internalName": "",
"displayName": ""
},
{
"internalName": "",
"displayName": ""
},
{
"internalName": "",
"displayName": ""
},
{
"internalName": "",
"displayName": ""
},
{
"internalName": "",
"displayName": ""
}
]
}

Some files were not shown because too many files have changed in this diff Show More