mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/PCK-Studio.git
synced 2026-05-29 10:24:34 +00:00
Move COLEditor and LOCEditor to Forms/Editor/
This commit is contained in:
334
MinecraftUSkinEditor/Forms/Editor/COLEditor.Designer.cs
generated
Normal file
334
MinecraftUSkinEditor/Forms/Editor/COLEditor.Designer.cs
generated
Normal file
@@ -0,0 +1,334 @@
|
||||
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace PckStudio.Forms.Editor
|
||||
{
|
||||
partial class COLEditor
|
||||
{
|
||||
/// <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 Windows Form 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()
|
||||
{
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(COLEditor));
|
||||
this.metroPanel1 = new MetroFramework.Controls.MetroPanel();
|
||||
this.setColorBtn = new MetroFramework.Controls.MetroButton();
|
||||
this.blueUpDown = new System.Windows.Forms.NumericUpDown();
|
||||
this.greenUpDown = new System.Windows.Forms.NumericUpDown();
|
||||
this.redUpDown = new System.Windows.Forms.NumericUpDown();
|
||||
this.alphaUpDown = new System.Windows.Forms.NumericUpDown();
|
||||
this.alphaLabel = new MetroFramework.Controls.MetroLabel();
|
||||
this.blueLabel = new MetroFramework.Controls.MetroLabel();
|
||||
this.greenLabel = new MetroFramework.Controls.MetroLabel();
|
||||
this.redLabel = new MetroFramework.Controls.MetroLabel();
|
||||
this.colorTextbox = new MetroFramework.Controls.MetroTextBox();
|
||||
this.metroLabel1 = new MetroFramework.Controls.MetroLabel();
|
||||
this.pictureBox1 = new System.Windows.Forms.PictureBox();
|
||||
this.menuStrip = new System.Windows.Forms.MenuStrip();
|
||||
this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.saveToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.waterTab = new System.Windows.Forms.TabPage();
|
||||
this.treeView2 = new System.Windows.Forms.TreeView();
|
||||
this.colorsTab = new System.Windows.Forms.TabPage();
|
||||
this.treeView1 = new System.Windows.Forms.TreeView();
|
||||
this.tabControl = new MetroFramework.Controls.MetroTabControl();
|
||||
this.metroPanel1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.blueUpDown)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.greenUpDown)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.redUpDown)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.alphaUpDown)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
|
||||
this.menuStrip.SuspendLayout();
|
||||
this.waterTab.SuspendLayout();
|
||||
this.colorsTab.SuspendLayout();
|
||||
this.tabControl.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// metroPanel1
|
||||
//
|
||||
this.metroPanel1.Controls.Add(this.setColorBtn);
|
||||
this.metroPanel1.Controls.Add(this.blueUpDown);
|
||||
this.metroPanel1.Controls.Add(this.greenUpDown);
|
||||
this.metroPanel1.Controls.Add(this.redUpDown);
|
||||
this.metroPanel1.Controls.Add(this.alphaUpDown);
|
||||
this.metroPanel1.Controls.Add(this.alphaLabel);
|
||||
this.metroPanel1.Controls.Add(this.blueLabel);
|
||||
this.metroPanel1.Controls.Add(this.greenLabel);
|
||||
this.metroPanel1.Controls.Add(this.redLabel);
|
||||
this.metroPanel1.Controls.Add(this.colorTextbox);
|
||||
this.metroPanel1.Controls.Add(this.metroLabel1);
|
||||
this.metroPanel1.Controls.Add(this.pictureBox1);
|
||||
resources.ApplyResources(this.metroPanel1, "metroPanel1");
|
||||
this.metroPanel1.HorizontalScrollbarBarColor = true;
|
||||
this.metroPanel1.HorizontalScrollbarHighlightOnWheel = false;
|
||||
this.metroPanel1.HorizontalScrollbarSize = 10;
|
||||
this.metroPanel1.Name = "metroPanel1";
|
||||
this.metroPanel1.Style = MetroFramework.MetroColorStyle.Silver;
|
||||
this.metroPanel1.Theme = MetroFramework.MetroThemeStyle.Dark;
|
||||
this.metroPanel1.VerticalScrollbarBarColor = true;
|
||||
this.metroPanel1.VerticalScrollbarHighlightOnWheel = false;
|
||||
this.metroPanel1.VerticalScrollbarSize = 10;
|
||||
//
|
||||
// setColorBtn
|
||||
//
|
||||
resources.ApplyResources(this.setColorBtn, "setColorBtn");
|
||||
this.setColorBtn.Name = "setColorBtn";
|
||||
this.setColorBtn.Theme = MetroFramework.MetroThemeStyle.Dark;
|
||||
this.setColorBtn.UseSelectable = true;
|
||||
this.setColorBtn.Click += new System.EventHandler(this.setColorBtn_Click);
|
||||
//
|
||||
// blueUpDown
|
||||
//
|
||||
this.blueUpDown.BackColor = System.Drawing.SystemColors.Desktop;
|
||||
this.blueUpDown.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204)))));
|
||||
resources.ApplyResources(this.blueUpDown, "blueUpDown");
|
||||
this.blueUpDown.Maximum = new decimal(new int[] {
|
||||
255,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.blueUpDown.Name = "blueUpDown";
|
||||
this.blueUpDown.ValueChanged += new System.EventHandler(this.color_ValueChanged);
|
||||
//
|
||||
// greenUpDown
|
||||
//
|
||||
this.greenUpDown.BackColor = System.Drawing.SystemColors.Desktop;
|
||||
this.greenUpDown.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204)))));
|
||||
resources.ApplyResources(this.greenUpDown, "greenUpDown");
|
||||
this.greenUpDown.Maximum = new decimal(new int[] {
|
||||
255,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.greenUpDown.Name = "greenUpDown";
|
||||
this.greenUpDown.ValueChanged += new System.EventHandler(this.color_ValueChanged);
|
||||
//
|
||||
// redUpDown
|
||||
//
|
||||
this.redUpDown.BackColor = System.Drawing.SystemColors.Desktop;
|
||||
this.redUpDown.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204)))));
|
||||
resources.ApplyResources(this.redUpDown, "redUpDown");
|
||||
this.redUpDown.Maximum = new decimal(new int[] {
|
||||
255,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.redUpDown.Name = "redUpDown";
|
||||
this.redUpDown.ValueChanged += new System.EventHandler(this.color_ValueChanged);
|
||||
//
|
||||
// alphaUpDown
|
||||
//
|
||||
this.alphaUpDown.BackColor = System.Drawing.SystemColors.Desktop;
|
||||
this.alphaUpDown.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204)))));
|
||||
resources.ApplyResources(this.alphaUpDown, "alphaUpDown");
|
||||
this.alphaUpDown.Maximum = new decimal(new int[] {
|
||||
255,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.alphaUpDown.Name = "alphaUpDown";
|
||||
this.alphaUpDown.ValueChanged += new System.EventHandler(this.color_ValueChanged);
|
||||
//
|
||||
// alphaLabel
|
||||
//
|
||||
resources.ApplyResources(this.alphaLabel, "alphaLabel");
|
||||
this.alphaLabel.Name = "alphaLabel";
|
||||
this.alphaLabel.Theme = MetroFramework.MetroThemeStyle.Dark;
|
||||
//
|
||||
// blueLabel
|
||||
//
|
||||
resources.ApplyResources(this.blueLabel, "blueLabel");
|
||||
this.blueLabel.Name = "blueLabel";
|
||||
this.blueLabel.Theme = MetroFramework.MetroThemeStyle.Dark;
|
||||
//
|
||||
// greenLabel
|
||||
//
|
||||
resources.ApplyResources(this.greenLabel, "greenLabel");
|
||||
this.greenLabel.Name = "greenLabel";
|
||||
this.greenLabel.Theme = MetroFramework.MetroThemeStyle.Dark;
|
||||
//
|
||||
// redLabel
|
||||
//
|
||||
resources.ApplyResources(this.redLabel, "redLabel");
|
||||
this.redLabel.Name = "redLabel";
|
||||
this.redLabel.Theme = MetroFramework.MetroThemeStyle.Dark;
|
||||
//
|
||||
// colorTextbox
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
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.Location")));
|
||||
this.colorTextbox.CustomButton.Name = "";
|
||||
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.TabIndex")));
|
||||
this.colorTextbox.CustomButton.Theme = MetroFramework.MetroThemeStyle.Light;
|
||||
this.colorTextbox.CustomButton.UseSelectable = true;
|
||||
this.colorTextbox.CustomButton.Visible = ((bool)(resources.GetObject("resource.Visible")));
|
||||
this.colorTextbox.Lines = new string[0];
|
||||
resources.ApplyResources(this.colorTextbox, "colorTextbox");
|
||||
this.colorTextbox.MaxLength = 32767;
|
||||
this.colorTextbox.Name = "colorTextbox";
|
||||
this.colorTextbox.PasswordChar = '\0';
|
||||
this.colorTextbox.ScrollBars = System.Windows.Forms.ScrollBars.None;
|
||||
this.colorTextbox.SelectedText = "";
|
||||
this.colorTextbox.SelectionLength = 0;
|
||||
this.colorTextbox.SelectionStart = 0;
|
||||
this.colorTextbox.ShortcutsEnabled = true;
|
||||
this.colorTextbox.Theme = MetroFramework.MetroThemeStyle.Dark;
|
||||
this.colorTextbox.UseSelectable = true;
|
||||
this.colorTextbox.WaterMarkColor = System.Drawing.Color.FromArgb(((int)(((byte)(109)))), ((int)(((byte)(109)))), ((int)(((byte)(109)))));
|
||||
this.colorTextbox.WaterMarkFont = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Pixel);
|
||||
this.colorTextbox.TextChanged += new System.EventHandler(this.colorBox_TextChanged);
|
||||
//
|
||||
// metroLabel1
|
||||
//
|
||||
resources.ApplyResources(this.metroLabel1, "metroLabel1");
|
||||
this.metroLabel1.Name = "metroLabel1";
|
||||
this.metroLabel1.Theme = MetroFramework.MetroThemeStyle.Dark;
|
||||
//
|
||||
// pictureBox1
|
||||
//
|
||||
this.pictureBox1.BackColor = System.Drawing.Color.Gray;
|
||||
resources.ApplyResources(this.pictureBox1, "pictureBox1");
|
||||
this.pictureBox1.Name = "pictureBox1";
|
||||
this.pictureBox1.TabStop = false;
|
||||
//
|
||||
// menuStrip
|
||||
//
|
||||
resources.ApplyResources(this.menuStrip, "menuStrip");
|
||||
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.menuStrip.Name = "menuStrip";
|
||||
//
|
||||
// fileToolStripMenuItem
|
||||
//
|
||||
this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.saveToolStripMenuItem1});
|
||||
this.fileToolStripMenuItem.ForeColor = System.Drawing.Color.White;
|
||||
this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
|
||||
resources.ApplyResources(this.fileToolStripMenuItem, "fileToolStripMenuItem");
|
||||
//
|
||||
// saveToolStripMenuItem1
|
||||
//
|
||||
resources.ApplyResources(this.saveToolStripMenuItem1, "saveToolStripMenuItem1");
|
||||
this.saveToolStripMenuItem1.Name = "saveToolStripMenuItem1";
|
||||
this.saveToolStripMenuItem1.Click += new System.EventHandler(this.saveToolStripMenuItem1_Click);
|
||||
//
|
||||
// waterTab
|
||||
//
|
||||
this.waterTab.BackColor = System.Drawing.SystemColors.WindowFrame;
|
||||
this.waterTab.Controls.Add(this.treeView2);
|
||||
resources.ApplyResources(this.waterTab, "waterTab");
|
||||
this.waterTab.Name = "waterTab";
|
||||
//
|
||||
// treeView2
|
||||
//
|
||||
resources.ApplyResources(this.treeView2, "treeView2");
|
||||
this.treeView2.Name = "treeView2";
|
||||
this.treeView2.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeView2_AfterSelect);
|
||||
this.treeView2.KeyDown += new System.Windows.Forms.KeyEventHandler(this.treeView2_KeyDown);
|
||||
//
|
||||
// colorsTab
|
||||
//
|
||||
this.colorsTab.BackColor = System.Drawing.SystemColors.WindowFrame;
|
||||
this.colorsTab.Controls.Add(this.treeView1);
|
||||
resources.ApplyResources(this.colorsTab, "colorsTab");
|
||||
this.colorsTab.Name = "colorsTab";
|
||||
//
|
||||
// treeView1
|
||||
//
|
||||
resources.ApplyResources(this.treeView1, "treeView1");
|
||||
this.treeView1.Name = "treeView1";
|
||||
this.treeView1.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeView1_AfterSelect);
|
||||
this.treeView1.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.Name = "tabControl";
|
||||
this.tabControl.SelectedIndex = 0;
|
||||
this.tabControl.Style = MetroFramework.MetroColorStyle.White;
|
||||
this.tabControl.Theme = MetroFramework.MetroThemeStyle.Dark;
|
||||
this.tabControl.UseSelectable = true;
|
||||
//
|
||||
// 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";
|
||||
this.Style = MetroFramework.MetroColorStyle.Silver;
|
||||
this.Theme = MetroFramework.MetroThemeStyle.Dark;
|
||||
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.COLEditor_FormClosing);
|
||||
this.metroPanel1.ResumeLayout(false);
|
||||
this.metroPanel1.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.blueUpDown)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.greenUpDown)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.redUpDown)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.alphaUpDown)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
|
||||
this.menuStrip.ResumeLayout(false);
|
||||
this.menuStrip.PerformLayout();
|
||||
this.waterTab.ResumeLayout(false);
|
||||
this.colorsTab.ResumeLayout(false);
|
||||
this.tabControl.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private MetroFramework.Controls.MetroPanel metroPanel1;
|
||||
private MetroFramework.Controls.MetroTextBox colorTextbox;
|
||||
private TreeView treeView1;
|
||||
private TreeView treeView2;
|
||||
private MetroFramework.Controls.MetroLabel metroLabel1;
|
||||
private System.Windows.Forms.PictureBox pictureBox1;
|
||||
private System.Windows.Forms.MenuStrip menuStrip;
|
||||
private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem saveToolStripMenuItem1;
|
||||
private MetroFramework.Controls.MetroLabel blueLabel;
|
||||
private MetroFramework.Controls.MetroLabel greenLabel;
|
||||
private MetroFramework.Controls.MetroLabel redLabel;
|
||||
private MetroFramework.Controls.MetroLabel alphaLabel;
|
||||
private System.Windows.Forms.NumericUpDown blueUpDown;
|
||||
private System.Windows.Forms.NumericUpDown greenUpDown;
|
||||
private System.Windows.Forms.NumericUpDown redUpDown;
|
||||
private System.Windows.Forms.NumericUpDown alphaUpDown;
|
||||
private TabPage waterTab;
|
||||
private TabPage colorsTab;
|
||||
private MetroFramework.Controls.MetroTabControl tabControl;
|
||||
private MetroFramework.Controls.MetroButton setColorBtn;
|
||||
}
|
||||
}
|
||||
220
MinecraftUSkinEditor/Forms/Editor/COLEditor.cs
Normal file
220
MinecraftUSkinEditor/Forms/Editor/COLEditor.cs
Normal file
@@ -0,0 +1,220 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using MetroFramework.Forms;
|
||||
using PckStudio.Classes.FileTypes;
|
||||
|
||||
namespace PckStudio.Forms.Editor
|
||||
{
|
||||
public partial class COLEditor : MetroForm
|
||||
{
|
||||
COLFile cf = new COLFile();
|
||||
public byte[] data { get; private set; } = new byte[0];
|
||||
|
||||
public COLEditor(COLFile colFile)
|
||||
{
|
||||
InitializeComponent();
|
||||
cf = colFile;
|
||||
foreach (var obj in cf.entries)
|
||||
{
|
||||
TreeNode tn = new TreeNode(obj.name);
|
||||
tn.Tag = obj;
|
||||
treeView1.Nodes.Add(tn);
|
||||
}
|
||||
foreach (var obj in cf.waterEntries)
|
||||
{
|
||||
TreeNode tn = new TreeNode(obj.name);
|
||||
tn.Tag = obj;
|
||||
treeView2.Nodes.Add(tn);
|
||||
}
|
||||
}
|
||||
|
||||
private void treeView1_AfterSelect(object sender, TreeViewEventArgs e)
|
||||
{
|
||||
if (treeView1.SelectedNode.Tag == null)
|
||||
return;
|
||||
|
||||
var colorEntry = (COLFile.ColorEntry)treeView1.SelectedNode.Tag;
|
||||
alphaUpDown.Visible = false;
|
||||
alphaLabel.Visible = false;
|
||||
var color = colorEntry.color;
|
||||
redUpDown.Value = color >> 16 & 0xff;
|
||||
greenUpDown.Value = color >> 8 & 0xff;
|
||||
blueUpDown.Value = color & 0xff;
|
||||
pictureBox1.BackColor = Color.FromArgb(0xff << 24 | (int)color);
|
||||
|
||||
}
|
||||
|
||||
private void treeView2_AfterSelect(object sender, TreeViewEventArgs e)
|
||||
{
|
||||
if (treeView2.SelectedNode.Tag == null)
|
||||
return;
|
||||
var colorEntry = (COLFile.ExtendedColorEntry)treeView2.SelectedNode.Tag;
|
||||
int color = (int)colorEntry.color;
|
||||
alphaUpDown.Enabled = true;
|
||||
alphaUpDown.Visible = true;
|
||||
alphaLabel.Visible = true;
|
||||
alphaUpDown.Value = color >> 24 & 0xff;
|
||||
redUpDown.Value = color >> 16 & 0xff;
|
||||
greenUpDown.Value = color >> 8 & 0xff;
|
||||
blueUpDown.Value = color & 0xff;
|
||||
pictureBox1.BackColor = Color.FromArgb(color);
|
||||
}
|
||||
private void saveToolStripMenuItem1_Click(object sender, EventArgs e)
|
||||
{
|
||||
using (var stream = new MemoryStream())
|
||||
{
|
||||
cf.Save(stream);
|
||||
data = stream.ToArray();
|
||||
}
|
||||
}
|
||||
|
||||
static byte[] StringToByteArrayFastest(string hex)
|
||||
{
|
||||
if (hex.Length % 2 == 1)
|
||||
throw new Exception("The binary key cannot have an odd number of digits");
|
||||
|
||||
byte[] arr = new byte[hex.Length >> 1];
|
||||
|
||||
for (int i = 0; i < hex.Length >> 1; ++i)
|
||||
{
|
||||
arr[i] = (byte)((GetHexVal(hex[i << 1]) << 4) + (GetHexVal(hex[(i << 1) + 1])));
|
||||
}
|
||||
|
||||
return arr;
|
||||
}
|
||||
|
||||
static int GetHexVal(char hex)
|
||||
{
|
||||
int val = (int)hex;
|
||||
return val - (val < 58 ? 48 : (val < 97 ? 55 : 87));
|
||||
}
|
||||
|
||||
public void treeView1_KeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
var node = treeView1.SelectedNode;
|
||||
if (e.KeyCode == Keys.Delete && node.Tag is COLFile.ColorEntry)
|
||||
{
|
||||
cf.entries.Remove((COLFile.ColorEntry)node.Tag);
|
||||
if (treeView1.Nodes.Count > 0) treeView1.Nodes.Remove(node);
|
||||
}
|
||||
}
|
||||
|
||||
private void treeView2_KeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
var node = treeView2.SelectedNode;
|
||||
if (e.KeyCode == Keys.Delete && node.Tag is COLFile.ExtendedColorEntry)
|
||||
{
|
||||
cf.waterEntries.Remove((COLFile.ExtendedColorEntry)node.Tag);
|
||||
if (treeView2.Nodes.Count > 0) treeView2.Nodes.Remove(node);
|
||||
}
|
||||
}
|
||||
|
||||
private void colorBox_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
//TreeView tv = (TreeView)tabControl.SelectedTab.Controls[0];
|
||||
//if (tv.SelectedNode == null || tv.SelectedNode.Tag == null)
|
||||
// return;
|
||||
//bool hasAlpha = tabControl.SelectedTab == waterTab;
|
||||
//alphaUpDown.Enabled = hasAlpha;
|
||||
//redUpDown.Value = StringToByteArrayFastest(colorTextbox.Text)[!hasAlpha ? 0 : 1];
|
||||
//greenUpDown.Value = StringToByteArrayFastest(colorTextbox.Text)[!hasAlpha ? 1 : 2];
|
||||
//blueUpDown.Value = StringToByteArrayFastest(colorTextbox.Text)[!hasAlpha ? 2 : 3];
|
||||
//int color = 0; /*colorEntry.color*/;
|
||||
// int argb = (int)((0xff000000u) | (color >> 24));
|
||||
//colorTextbox.MaxLength = hasAlpha ? 8 : 6;
|
||||
//alphaLabel.Visible = false;
|
||||
//alphaUpDown.Visible = false;
|
||||
//if (hasAlpha)
|
||||
//{
|
||||
// alphaLabel.Visible = true;
|
||||
// alphaUpDown.Visible = true;
|
||||
// alphaUpDown.Value = StringToByteArrayFastest(colorTextbox.Text)[0];
|
||||
// argb = color >> 24 | color << 8;
|
||||
//}
|
||||
//pictureBox1.BackColor = Color.FromArgb(argb);
|
||||
}
|
||||
|
||||
private void color_ValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
//TreeView tv = (TreeView)tabControl.SelectedTab.Controls[0];
|
||||
//if (tv.SelectedNode == null) return;
|
||||
//byte[] origHex = StringToByteArrayFastest(tv.SelectedNode.Tag.ToString());
|
||||
//bool hasAlpha = tabControl.SelectedTab == waterTab;
|
||||
//string hex = "";
|
||||
//if (((NumericUpDown)sender).Name == "numericUpDown2")
|
||||
//{
|
||||
// hex += ((int)alphaUpDown.Value).ToString("X2");
|
||||
// hex += origHex[1].ToString("X2");
|
||||
// hex += origHex[2].ToString("X2");
|
||||
// hex += origHex[3].ToString("X2");
|
||||
//}
|
||||
//else if (((NumericUpDown)sender).Name == "numericUpDown3")
|
||||
//{
|
||||
// if (hasAlpha) hex += origHex[0].ToString("X2");
|
||||
// hex += ((int)redUpDown.Value).ToString("X2");
|
||||
// hex += origHex[hasAlpha ? 2 : 1].ToString("X2");
|
||||
// hex += origHex[hasAlpha ? 3 : 2].ToString("X2");
|
||||
//}
|
||||
//else if (((NumericUpDown)sender).Name == "numericUpDown4")
|
||||
//{
|
||||
// if (hasAlpha) hex += origHex[0].ToString("X2");
|
||||
// hex += origHex[hasAlpha ? 1 : 0].ToString("X2");
|
||||
// hex += ((int)greenUpDown.Value).ToString("X2");
|
||||
// hex += origHex[hasAlpha ? 3 : 2].ToString("X2");
|
||||
//}
|
||||
//else if (((NumericUpDown)sender).Name == "numericUpDown5")
|
||||
//{
|
||||
// if (hasAlpha) hex += origHex[0].ToString("X2");
|
||||
// hex += origHex[hasAlpha ? 1 : 0].ToString("X2");
|
||||
// hex += origHex[hasAlpha ? 2 : 1].ToString("X2");
|
||||
// hex += ((int)blueUpDown.Value).ToString("X2");
|
||||
//}
|
||||
//else // just in case some weird thing happens i dunno - matt
|
||||
//{
|
||||
// if (hasAlpha) hex += origHex[0].ToString("X2");
|
||||
// hex += origHex[hasAlpha ? 1 : 0].ToString("X2");
|
||||
// hex += origHex[hasAlpha ? 2 : 1].ToString("X2");
|
||||
// hex += origHex[hasAlpha ? 3 : 2].ToString("X2");
|
||||
//}
|
||||
|
||||
//Console.WriteLine(hex);
|
||||
//colorTextbox.Text = hex;
|
||||
}
|
||||
|
||||
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() != DialogResult.OK) return;
|
||||
pictureBox1.BackColor = colorPick.Color;
|
||||
if (tabControl.SelectedTab == waterTab && treeView2.SelectedNode != null &&
|
||||
treeView2.SelectedNode.Tag != null && treeView2.SelectedNode.Tag is COLFile.ExtendedColorEntry)
|
||||
{
|
||||
var colorEntry = ((COLFile.ExtendedColorEntry)treeView2.SelectedNode.Tag);
|
||||
colorEntry.color = (uint)colorPick.Color.ToArgb();
|
||||
}
|
||||
else if (tabControl.SelectedTab == colorsTab && treeView1.SelectedNode != null &&
|
||||
treeView1.SelectedNode.Tag != null && treeView1.SelectedNode.Tag is COLFile.ColorEntry)
|
||||
{
|
||||
var colorEntry = ((COLFile.ColorEntry)treeView1.SelectedNode.Tag);
|
||||
colorEntry.color = (uint)colorPick.Color.ToArgb() & 0xffffff;
|
||||
}
|
||||
colorPick.Dispose();
|
||||
}
|
||||
|
||||
private void COLEditor_FormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
DialogResult = DialogResult.OK;
|
||||
}
|
||||
}
|
||||
}
|
||||
171
MinecraftUSkinEditor/Forms/Editor/COLEditor.ja.resx
Normal file
171
MinecraftUSkinEditor/Forms/Editor/COLEditor.ja.resx
Normal file
@@ -0,0 +1,171 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="metroCheckBox1.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>115, 15</value>
|
||||
</data>
|
||||
<data name="metroCheckBox1.Text" xml:space="preserve">
|
||||
<value>RGB値を使用する</value>
|
||||
</data>
|
||||
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<data name="resource.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
|
||||
<value>NoControl</value>
|
||||
</data>
|
||||
<data name="metroLabel2.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>51, 19</value>
|
||||
</data>
|
||||
<data name="metroLabel2.Text" xml:space="preserve">
|
||||
<value>名前:</value>
|
||||
</data>
|
||||
<data name="resource.ImeMode1" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
|
||||
<value>NoControl</value>
|
||||
</data>
|
||||
<data name="metroLabel1.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>37, 19</value>
|
||||
</data>
|
||||
<data name="metroLabel1.Text" xml:space="preserve">
|
||||
<value>色:</value>
|
||||
</data>
|
||||
<data name="saveToolStripMenuItem1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
|
||||
wwAADsMBx2+oZAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4yMfEgaZUAAADfSURBVDhPYxg8
|
||||
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">
|
||||
<value>180, 22</value>
|
||||
</data>
|
||||
<data name="saveToolStripMenuItem1.Text" xml:space="preserve">
|
||||
<value>セーブ</value>
|
||||
</data>
|
||||
<data name="fileToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>56, 20</value>
|
||||
</data>
|
||||
<data name="fileToolStripMenuItem.Text" xml:space="preserve">
|
||||
<value>ファイル</value>
|
||||
</data>
|
||||
<data name="$this.Text" xml:space="preserve">
|
||||
<value>COLエディター</value>
|
||||
</data>
|
||||
</root>
|
||||
3341
MinecraftUSkinEditor/Forms/Editor/COLEditor.resx
Normal file
3341
MinecraftUSkinEditor/Forms/Editor/COLEditor.resx
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,4 @@
|
||||
namespace PckStudio.Forms.Utilities
|
||||
namespace PckStudio.Forms.Editor
|
||||
{
|
||||
partial class GRFEditor
|
||||
{
|
||||
|
||||
@@ -10,7 +10,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace PckStudio.Forms.Utilities
|
||||
namespace PckStudio.Forms.Editor
|
||||
{
|
||||
public partial class GRFEditor : MetroFramework.Forms.MetroForm
|
||||
{
|
||||
|
||||
187
MinecraftUSkinEditor/Forms/Editor/LOCEditor.Designer.cs
generated
Normal file
187
MinecraftUSkinEditor/Forms/Editor/LOCEditor.Designer.cs
generated
Normal file
@@ -0,0 +1,187 @@
|
||||
namespace PckStudio.Forms.Editor
|
||||
{
|
||||
partial class LOCEditor
|
||||
{
|
||||
/// <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 Windows Form 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.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(LOCEditor));
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
|
||||
this.addDisplayIDToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.renameDisplayIDToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.deleteDisplayIDToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.GridContextMenu = new MetroFramework.Controls.MetroContextMenu(this.components);
|
||||
this.addLanguageToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.removeLanguageToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.locSort = new PckStudio.Forms.MyTablePanel();
|
||||
this.buttonReplaceAll = new System.Windows.Forms.Button();
|
||||
this.dataGridViewLocEntryData = new System.Windows.Forms.DataGridView();
|
||||
this.textBoxReplaceAll = new System.Windows.Forms.TextBox();
|
||||
this.treeViewLocKeys = new System.Windows.Forms.TreeView();
|
||||
this.contextMenuStrip1.SuspendLayout();
|
||||
this.GridContextMenu.SuspendLayout();
|
||||
this.locSort.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.dataGridViewLocEntryData)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// contextMenuStrip1
|
||||
//
|
||||
this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.addDisplayIDToolStripMenuItem,
|
||||
this.renameDisplayIDToolStripMenuItem,
|
||||
this.deleteDisplayIDToolStripMenuItem});
|
||||
this.contextMenuStrip1.Name = "contextMenuStrip1";
|
||||
resources.ApplyResources(this.contextMenuStrip1, "contextMenuStrip1");
|
||||
//
|
||||
// addDisplayIDToolStripMenuItem
|
||||
//
|
||||
this.addDisplayIDToolStripMenuItem.Name = "addDisplayIDToolStripMenuItem";
|
||||
resources.ApplyResources(this.addDisplayIDToolStripMenuItem, "addDisplayIDToolStripMenuItem");
|
||||
this.addDisplayIDToolStripMenuItem.Click += new System.EventHandler(this.addDisplayIDToolStripMenuItem_Click);
|
||||
//
|
||||
// renameDisplayIDToolStripMenuItem
|
||||
//
|
||||
resources.ApplyResources(this.renameDisplayIDToolStripMenuItem, "renameDisplayIDToolStripMenuItem");
|
||||
this.renameDisplayIDToolStripMenuItem.Name = "renameDisplayIDToolStripMenuItem";
|
||||
this.renameDisplayIDToolStripMenuItem.Click += new System.EventHandler(this.renameDisplayIDToolStripMenuItem_Click);
|
||||
//
|
||||
// deleteDisplayIDToolStripMenuItem
|
||||
//
|
||||
this.deleteDisplayIDToolStripMenuItem.Name = "deleteDisplayIDToolStripMenuItem";
|
||||
resources.ApplyResources(this.deleteDisplayIDToolStripMenuItem, "deleteDisplayIDToolStripMenuItem");
|
||||
this.deleteDisplayIDToolStripMenuItem.Click += new System.EventHandler(this.deleteDisplayIDToolStripMenuItem_Click);
|
||||
//
|
||||
// GridContextMenu
|
||||
//
|
||||
this.GridContextMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.addLanguageToolStripMenuItem,
|
||||
this.removeLanguageToolStripMenuItem});
|
||||
this.GridContextMenu.Name = "GridContextMenu";
|
||||
resources.ApplyResources(this.GridContextMenu, "GridContextMenu");
|
||||
this.GridContextMenu.Theme = MetroFramework.MetroThemeStyle.Dark;
|
||||
//
|
||||
// addLanguageToolStripMenuItem
|
||||
//
|
||||
this.addLanguageToolStripMenuItem.Name = "addLanguageToolStripMenuItem";
|
||||
resources.ApplyResources(this.addLanguageToolStripMenuItem, "addLanguageToolStripMenuItem");
|
||||
this.addLanguageToolStripMenuItem.Click += new System.EventHandler(this.addLanguageToolStripMenuItem_Click);
|
||||
//
|
||||
// removeLanguageToolStripMenuItem
|
||||
//
|
||||
this.removeLanguageToolStripMenuItem.Name = "removeLanguageToolStripMenuItem";
|
||||
resources.ApplyResources(this.removeLanguageToolStripMenuItem, "removeLanguageToolStripMenuItem");
|
||||
//
|
||||
// locSort
|
||||
//
|
||||
this.locSort.AccessibleRole = System.Windows.Forms.AccessibleRole.Table;
|
||||
resources.ApplyResources(this.locSort, "locSort");
|
||||
this.locSort.Controls.Add(this.buttonReplaceAll, 2, 0);
|
||||
this.locSort.Controls.Add(this.dataGridViewLocEntryData, 1, 1);
|
||||
this.locSort.Controls.Add(this.textBoxReplaceAll, 1, 0);
|
||||
this.locSort.Controls.Add(this.treeViewLocKeys, 0, 0);
|
||||
this.locSort.Name = "locSort";
|
||||
//
|
||||
// buttonReplaceAll
|
||||
//
|
||||
resources.ApplyResources(this.buttonReplaceAll, "buttonReplaceAll");
|
||||
this.buttonReplaceAll.ForeColor = System.Drawing.Color.White;
|
||||
this.buttonReplaceAll.Name = "buttonReplaceAll";
|
||||
this.buttonReplaceAll.UseVisualStyleBackColor = true;
|
||||
this.buttonReplaceAll.Click += new System.EventHandler(this.buttonReplaceAll_Click);
|
||||
//
|
||||
// dataGridViewLocEntryData
|
||||
//
|
||||
this.dataGridViewLocEntryData.AllowUserToAddRows = false;
|
||||
this.dataGridViewLocEntryData.AllowUserToDeleteRows = false;
|
||||
this.dataGridViewLocEntryData.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.None;
|
||||
dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control;
|
||||
dataGridViewCellStyle1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText;
|
||||
dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight;
|
||||
dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
|
||||
dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
|
||||
this.dataGridViewLocEntryData.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1;
|
||||
this.dataGridViewLocEntryData.ColumnHeadersVisible = false;
|
||||
this.locSort.SetColumnSpan(this.dataGridViewLocEntryData, 2);
|
||||
this.dataGridViewLocEntryData.ContextMenuStrip = this.GridContextMenu;
|
||||
resources.ApplyResources(this.dataGridViewLocEntryData, "dataGridViewLocEntryData");
|
||||
this.dataGridViewLocEntryData.Name = "dataGridViewLocEntryData";
|
||||
this.dataGridViewLocEntryData.RowHeadersVisible = false;
|
||||
this.dataGridViewLocEntryData.CellEndEdit += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellEndEdit);
|
||||
//
|
||||
// textBoxReplaceAll
|
||||
//
|
||||
resources.ApplyResources(this.textBoxReplaceAll, "textBoxReplaceAll");
|
||||
this.textBoxReplaceAll.Name = "textBoxReplaceAll";
|
||||
//
|
||||
// treeViewLocKeys
|
||||
//
|
||||
this.treeViewLocKeys.ContextMenuStrip = this.contextMenuStrip1;
|
||||
resources.ApplyResources(this.treeViewLocKeys, "treeViewLocKeys");
|
||||
this.treeViewLocKeys.LabelEdit = true;
|
||||
this.treeViewLocKeys.Name = "treeViewLocKeys";
|
||||
this.locSort.SetRowSpan(this.treeViewLocKeys, 2);
|
||||
this.treeViewLocKeys.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeViewLocKeys_AfterSelect);
|
||||
this.treeViewLocKeys.KeyDown += new System.Windows.Forms.KeyEventHandler(this.treeView1_KeyDown);
|
||||
//
|
||||
// LOCEditor
|
||||
//
|
||||
resources.ApplyResources(this, "$this");
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.locSort);
|
||||
this.Name = "LOCEditor";
|
||||
this.Style = MetroFramework.MetroColorStyle.Silver;
|
||||
this.Theme = MetroFramework.MetroThemeStyle.Dark;
|
||||
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.LOCEditor_FormClosing);
|
||||
this.Load += new System.EventHandler(this.LOCEditor_Load);
|
||||
this.Resize += new System.EventHandler(this.LOCEditor_Resize);
|
||||
this.contextMenuStrip1.ResumeLayout(false);
|
||||
this.GridContextMenu.ResumeLayout(false);
|
||||
this.locSort.ResumeLayout(false);
|
||||
this.locSort.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.dataGridViewLocEntryData)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.TreeView treeViewLocKeys;
|
||||
private System.Windows.Forms.DataGridView dataGridViewLocEntryData;
|
||||
private System.Windows.Forms.ContextMenuStrip contextMenuStrip1;
|
||||
private System.Windows.Forms.ToolStripMenuItem addDisplayIDToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem deleteDisplayIDToolStripMenuItem;
|
||||
private System.Windows.Forms.TextBox textBoxReplaceAll;
|
||||
private PckStudio.Forms.MyTablePanel locSort;
|
||||
private System.Windows.Forms.Button buttonReplaceAll;
|
||||
private System.Windows.Forms.ToolStripMenuItem renameDisplayIDToolStripMenuItem;
|
||||
private MetroFramework.Controls.MetroContextMenu GridContextMenu;
|
||||
private System.Windows.Forms.ToolStripMenuItem addLanguageToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem removeLanguageToolStripMenuItem;
|
||||
}
|
||||
}
|
||||
141
MinecraftUSkinEditor/Forms/Editor/LOCEditor.cs
Normal file
141
MinecraftUSkinEditor/Forms/Editor/LOCEditor.cs
Normal file
@@ -0,0 +1,141 @@
|
||||
using PckStudio.Classes.FileTypes;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using MetroFramework.Forms;
|
||||
using RichPresenceClient;
|
||||
|
||||
namespace PckStudio.Forms.Editor
|
||||
{
|
||||
public partial class LOCEditor : MetroForm
|
||||
{
|
||||
DataTable tbl;
|
||||
LOCFile currentLoc;
|
||||
bool wasModified = false;
|
||||
public bool WasModified => wasModified;
|
||||
|
||||
public LOCEditor(LOCFile loc)
|
||||
{
|
||||
InitializeComponent();
|
||||
currentLoc = loc;
|
||||
tbl = new DataTable();
|
||||
tbl.Columns.Add(new DataColumn("Language") { ReadOnly = true });
|
||||
tbl.Columns.Add("Display Name");
|
||||
dataGridViewLocEntryData.DataSource = tbl;
|
||||
DataGridViewColumn column = dataGridViewLocEntryData.Columns[1];
|
||||
column.Width = dataGridViewLocEntryData.Width;
|
||||
}
|
||||
|
||||
private void LOCEditor_Load(object sender, EventArgs e)
|
||||
{
|
||||
RPC.SetPresence("LOC Editor", "Editing loc File.");
|
||||
foreach(string locKey in currentLoc.keys.Keys)
|
||||
treeViewLocKeys.Nodes.Add(locKey);
|
||||
}
|
||||
|
||||
private void LOCEditor_FormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
RPC.SetPresence("Sitting alone", "Program by PhoenixARC");
|
||||
}
|
||||
|
||||
private void treeViewLocKeys_AfterSelect(object sender, TreeViewEventArgs e)
|
||||
{
|
||||
var node = e.Node;
|
||||
if (node == null ||
|
||||
!currentLoc.keys.ContainsKey(node.Text))
|
||||
{
|
||||
MessageBox.Show("Selected Node does not seem to be in the loc file");
|
||||
return;
|
||||
}
|
||||
tbl.Rows.Clear();
|
||||
buttonReplaceAll.Enabled = true;
|
||||
foreach (var l in currentLoc.keys[node.Text])
|
||||
tbl.Rows.Add(l.Key, l.Value);
|
||||
}
|
||||
|
||||
private void renameDisplayIDToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
// broken...
|
||||
TreeNode node = treeViewLocKeys.SelectedNode;
|
||||
using (RenamePrompt diag = new RenamePrompt(node.Text))
|
||||
{
|
||||
if (diag.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
currentLoc.ChangeEntry(node.Text, diag.NewText);
|
||||
wasModified = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void addDisplayIDToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (treeViewLocKeys.SelectedNode != null &&
|
||||
!currentLoc.keys.ContainsKey(treeViewLocKeys.SelectedNode.Text))
|
||||
using (RenamePrompt prompt = new RenamePrompt(""))
|
||||
{
|
||||
prompt.OKButton.Text = "Add";
|
||||
if (prompt.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
currentLoc.AddLocKey(prompt.NewText, "");
|
||||
wasModified = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void deleteDisplayIDToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
if(treeViewLocKeys.SelectedNode != null &&
|
||||
currentLoc.keys.ContainsKey(treeViewLocKeys.SelectedNode.Text) &&
|
||||
currentLoc.keys.Remove(treeViewLocKeys.SelectedNode.Text))
|
||||
{
|
||||
treeViewLocKeys.SelectedNode.Remove();
|
||||
wasModified = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void dataGridView1_CellEndEdit(object sender, DataGridViewCellEventArgs e)
|
||||
{
|
||||
if (e.ColumnIndex != 1 ||
|
||||
treeViewLocKeys.SelectedNode == null)
|
||||
{
|
||||
MessageBox.Show("something went wrong");
|
||||
return;
|
||||
}
|
||||
currentLoc.ChangeSingleEntry(treeViewLocKeys.SelectedNode.Text, tbl.Rows[e.RowIndex][0].ToString(), tbl.Rows[e.RowIndex][1].ToString());
|
||||
wasModified = true;
|
||||
}
|
||||
|
||||
private void treeView1_KeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
if (e.KeyData == Keys.Delete)
|
||||
deleteDisplayIDToolStripMenuItem_Click(sender, e);
|
||||
}
|
||||
|
||||
private void buttonReplaceAll_Click(object sender, EventArgs e)
|
||||
{
|
||||
for (int i = 0; i < tbl.Rows.Count; i++)
|
||||
{
|
||||
tbl.Rows[i][1] = textBoxReplaceAll.Text;
|
||||
}
|
||||
currentLoc.ChangeEntry(treeViewLocKeys.SelectedNode.Text, textBoxReplaceAll.Text);
|
||||
wasModified = true;
|
||||
}
|
||||
|
||||
private void LOCEditor_Resize(object sender, EventArgs e)
|
||||
{
|
||||
DataGridViewColumn column = dataGridViewLocEntryData.Columns[1];
|
||||
column.Width = dataGridViewLocEntryData.Width - dataGridViewLocEntryData.Columns[0].Width - 1;
|
||||
}
|
||||
|
||||
private void addLanguageToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
1867
MinecraftUSkinEditor/Forms/Editor/LOCEditor.ja.resx
Normal file
1867
MinecraftUSkinEditor/Forms/Editor/LOCEditor.ja.resx
Normal file
File diff suppressed because it is too large
Load Diff
2094
MinecraftUSkinEditor/Forms/Editor/LOCEditor.resx
Normal file
2094
MinecraftUSkinEditor/Forms/Editor/LOCEditor.resx
Normal file
File diff suppressed because it is too large
Load Diff
@@ -17,6 +17,7 @@ using PckStudio.Classes.IO.LOC;
|
||||
using PckStudio.Forms.Utilities;
|
||||
using PckStudio.Classes.IO.GRF;
|
||||
using PckStudio.Classes.Utils;
|
||||
using PckStudio.Forms.Editor;
|
||||
|
||||
namespace PckStudio
|
||||
{
|
||||
@@ -2608,7 +2609,7 @@ namespace PckStudio
|
||||
|
||||
private void convertPCTextrurePackToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
Forms.Utilities.TextureConverterUtility tex = new Forms.Utilities.TextureConverterUtility(treeViewMain, currentPCK);
|
||||
TextureConverterUtility tex = new TextureConverterUtility(treeViewMain, currentPCK);
|
||||
tex.ShowDialog();
|
||||
}
|
||||
|
||||
@@ -2658,7 +2659,7 @@ namespace PckStudio
|
||||
{
|
||||
if (!TryGetLocFile(out LOCFile locFile))
|
||||
throw new Exception("No .loc File found.");
|
||||
Forms.Utilities.AudioEditor diag = new Forms.Utilities.AudioEditor(file, locFile, LittleEndianCheckBox.Checked);
|
||||
AudioEditor diag = new AudioEditor(file, locFile, LittleEndianCheckBox.Checked);
|
||||
diag.ShowDialog(this);
|
||||
diag.Dispose();
|
||||
}
|
||||
@@ -2694,10 +2695,9 @@ namespace PckStudio
|
||||
{
|
||||
colFile.Open(stream);
|
||||
}
|
||||
Forms.Utilities.COLEditor diag = new Forms.Utilities.COLEditor(colFile);
|
||||
if (diag.ShowDialog(this) == DialogResult.OK && diag.data.Length > 0)
|
||||
file.SetData(diag.data);
|
||||
diag.Dispose();
|
||||
using (COLEditor diag = new COLEditor(colFile))
|
||||
if (diag.ShowDialog(this) == DialogResult.OK && diag.data.Length > 0)
|
||||
file.SetData(diag.data);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user