mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/PCK-Studio.git
synced 2026-05-22 01:06:35 +00:00
Merge branch 'main' into https://github.com/PhoenixARC/-PCK-Studio
This commit is contained in:
@@ -49,7 +49,7 @@ namespace PckStudio.IO.TGA
|
||||
extensionData.JobTime = new TimeSpan(extensionData.TimeStamp.Hour, extensionData.TimeStamp.Minute, extensionData.TimeStamp.Second);
|
||||
extensionData.SoftwareID = Application.ProductName;
|
||||
Version.TryParse(Application.ProductVersion, out Version currentVersion);
|
||||
extensionData.SoftwareVersion = [(byte)currentVersion.Major, (byte)currentVersion.Minor, (byte)currentVersion.Build];
|
||||
extensionData.SoftwareVersion = new byte[] { (byte)currentVersion.Major, (byte)currentVersion.Minor, (byte)currentVersion.Build };
|
||||
extensionData.KeyColor = 0;
|
||||
extensionData.PixelAspectRatio = 0;
|
||||
extensionData.GammaValue = 0;
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace PckStudio.Classes.Utils
|
||||
{
|
||||
int convertedCount = 0;
|
||||
InProgressPrompt waitDiag = new InProgressPrompt();
|
||||
waitDiag.Show();
|
||||
waitDiag.Show(Program.MainInstance);
|
||||
foreach (string file in filenames)
|
||||
{
|
||||
Binka.ToWav(file, Path.Combine(destination.FullName, Path.GetFileNameWithoutExtension(file) + ".binka"));
|
||||
@@ -27,16 +27,16 @@ namespace PckStudio.Classes.Utils
|
||||
|
||||
waitDiag.Close();
|
||||
waitDiag.Dispose();
|
||||
MessageBox.Show($"Successfully converted {convertedCount}/{filenames.Length} file{(filenames.Length > 1 ? "s" : "")}", "Done!");
|
||||
MessageBox.Show(Program.MainInstance, $"Successfully converted {convertedCount}/{filenames.Length} file{(filenames.Length > 1 ? "s" : "")}", "Done!");
|
||||
}
|
||||
|
||||
public static void ToBinka(string[] filenames, DirectoryInfo destination)
|
||||
public static void ToBinka(string[] filenames, DirectoryInfo destination, int compressionLevel = 4)
|
||||
{
|
||||
int convertedCount = 0;
|
||||
Directory.CreateDirectory(ApplicationScope.DataCacher.CacheDirectory);
|
||||
|
||||
InProgressPrompt waitDiag = new InProgressPrompt();
|
||||
waitDiag.Show();
|
||||
waitDiag.Show(Program.MainInstance);
|
||||
|
||||
foreach (string file in filenames)
|
||||
{
|
||||
@@ -56,14 +56,14 @@ namespace PckStudio.Classes.Utils
|
||||
}
|
||||
|
||||
Cursor.Current = Cursors.WaitCursor;
|
||||
int exitCode = Binka.ToBinka(cacheSongFilepath, Path.Combine(destination.FullName, Path.GetFileNameWithoutExtension(file) + ".binka"), 4);
|
||||
int exitCode = Binka.ToBinka(cacheSongFilepath, Path.Combine(destination.FullName, Path.GetFileNameWithoutExtension(file) + ".binka"), compressionLevel);
|
||||
if (exitCode == 0)
|
||||
convertedCount++;
|
||||
}
|
||||
|
||||
waitDiag.Close();
|
||||
waitDiag.Dispose();
|
||||
MessageBox.Show($"Successfully converted {convertedCount}/{filenames.Length} file{(filenames.Length > 1 ? "s" : "")}", "Done!");
|
||||
MessageBox.Show(Program.MainInstance, $"Successfully converted {convertedCount}/{filenames.Length} file{(filenames.Length > 1 ? "s" : "")}", "Done!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace PckStudio.Features
|
||||
{
|
||||
InitializeComponent();
|
||||
if (!TryApplyPermanentCemuConfig() &&
|
||||
MessageBox.Show("Failed to get Cemu perma settings\nDo you want to open your local settings.xml file?",
|
||||
MessageBox.Show(this, "Failed to get Cemu perma settings\nDo you want to open your local settings.xml file?",
|
||||
"Cemu mlc path not found",
|
||||
MessageBoxButtons.YesNo,
|
||||
MessageBoxIcon.Warning) == DialogResult.Yes
|
||||
@@ -197,14 +197,14 @@ namespace PckStudio.Features
|
||||
DLCTreeView.Nodes.Clear();
|
||||
if (!IsValidInstallDirectory())
|
||||
{
|
||||
MessageBox.Show("Please select a valid Game Directory!", "Invalid Directory Specified",
|
||||
MessageBox.Show(this, "Please select a valid Game Directory!", "Invalid Directory Specified",
|
||||
MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!IsValidGameDirectory())
|
||||
{
|
||||
MessageBox.Show($"Could not find '{GetGameContentPath()}'!", "Not Found",
|
||||
MessageBox.Show(this, $"Could not find '{GetGameContentPath()}'!", "Not Found",
|
||||
MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
return;
|
||||
}
|
||||
@@ -214,7 +214,7 @@ namespace PckStudio.Features
|
||||
|
||||
if (!dlcDirectory.Exists)
|
||||
{
|
||||
MessageBox.Show($"'{dirPath}' does not exist!", "Not Found",
|
||||
MessageBox.Show(this, $"'{dirPath}' does not exist!", "Not Found",
|
||||
MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
return;
|
||||
}
|
||||
@@ -276,7 +276,7 @@ namespace PckStudio.Features
|
||||
|
||||
if (prompt.NewText.ContainsAny(Path.GetInvalidPathChars()))
|
||||
{
|
||||
MessageBox.Show("Invalid Folder name entered!", "Invalid Folder Name", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
MessageBox.Show(this, "Invalid Folder name entered!", "Invalid Folder Name", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -284,7 +284,7 @@ namespace PckStudio.Features
|
||||
|
||||
if (Directory.Exists(directoryPath))
|
||||
{
|
||||
MessageBox.Show("A Folder with the same name already exists!", "Folder Name taken", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
MessageBox.Show(this, "A Folder with the same name already exists!", "Folder Name taken", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
return;
|
||||
}
|
||||
Directory.CreateDirectory(directoryPath);
|
||||
@@ -302,7 +302,7 @@ namespace PckStudio.Features
|
||||
private void removePckToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
string pckName = DLCTreeView.SelectedNode.Text;
|
||||
var result = MessageBox.Show($"Are you sure you want to permanently delete '{pckName}'?", "Hold up!", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);
|
||||
var result = MessageBox.Show(this, $"Are you sure you want to permanently delete '{pckName}'?", "Hold up!", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);
|
||||
if (result == DialogResult.Yes)
|
||||
{
|
||||
string directoryPath = GetContentSubDirectory("WiiU", "DLC", pckName);
|
||||
|
||||
@@ -73,7 +73,7 @@ namespace PckStudio.Features
|
||||
}
|
||||
catch (NotImplementedException ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Not Implemented");
|
||||
MessageBox.Show(this, ex.Message, "Not Implemented");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace PckStudio.Features
|
||||
[Obsolete("Prompt user to use Aroma instead!")]
|
||||
private void buttonSelect_Click(object sender, EventArgs e)
|
||||
{
|
||||
MessageBox.Show("Please use Aroma's ftp Plugin!");
|
||||
MessageBox.Show(this, "Please use Aroma's ftp Plugin!");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -131,14 +131,14 @@ namespace PckStudio.Features
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.ToString());
|
||||
MessageBox.Show(this, ex.ToString());
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Regex.IsMatch(IPv4TextBox.Text, @"^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$"))
|
||||
{
|
||||
MessageBox.Show("Please enter a valid Wii U IP!");
|
||||
MessageBox.Show(this, "Please enter a valid Wii U IP!");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -169,7 +169,7 @@ namespace PckStudio.Features
|
||||
catch (Exception ex)
|
||||
{
|
||||
SetButtonState(ButtonState.Start);
|
||||
MessageBox.Show(ex.ToString());
|
||||
MessageBox.Show(this, ex.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -184,7 +184,7 @@ namespace PckStudio.Features
|
||||
ListViewHitTestInfo hitTestInfo = listViewPCKS.HitTest(e.Location);
|
||||
if (e.Button == MouseButtons.Right && hitTestInfo.Location != ListViewHitTestLocations.None)
|
||||
{
|
||||
contextMenuStripCaffiine.Show(Cursor.Position);
|
||||
contextMenuStripCaffiine.Show(this, Cursor.Position);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -194,7 +194,7 @@ namespace PckStudio.Features
|
||||
{
|
||||
SetButtonState(ButtonState.Wait);
|
||||
ReplacePck(mod);
|
||||
MessageBox.Show("PCK Replaced!");
|
||||
MessageBox.Show(this, "PCK Replaced!");
|
||||
}
|
||||
SetButtonState(ButtonState.Stop);
|
||||
UpdateDLCPath();
|
||||
@@ -208,10 +208,10 @@ namespace PckStudio.Features
|
||||
OpenFileDialog openPCK = new OpenFileDialog();
|
||||
openPCK.Filter = "PCK File|*.pck";
|
||||
|
||||
if (openPCK.ShowDialog() == DialogResult.OK)
|
||||
if (openPCK.ShowDialog(this) == DialogResult.OK)
|
||||
{
|
||||
ReplacePck(openPCK.FileName);
|
||||
MessageBox.Show("PCK Replaced!");
|
||||
MessageBox.Show(this, "PCK Replaced!");
|
||||
}
|
||||
}
|
||||
SetButtonState(ButtonState.Stop);
|
||||
@@ -283,7 +283,7 @@ namespace PckStudio.Features
|
||||
{
|
||||
OpenFileDialog ofd = new OpenFileDialog();
|
||||
ofd.Filter = "Pack Image|*.png";
|
||||
if (ofd.ShowDialog() == DialogResult.OK)
|
||||
if (ofd.ShowDialog(this) == DialogResult.OK)
|
||||
TextBoxPackImage.Text = ofd.FileName;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace PckStudio.Forms.Additional_Popups.EntityForms
|
||||
}
|
||||
catch (Newtonsoft.Json.JsonException j_ex)
|
||||
{
|
||||
MessageBox.Show(j_ex.Message, "Error");
|
||||
MessageBox.Show(this, j_ex.Message, "Error");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace PckStudio.Forms.Additional_Popups.Grf
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(ParameterName) || string.IsNullOrWhiteSpace(ParameterValue))
|
||||
{
|
||||
MessageBox.Show("Name and Value need valid values");
|
||||
MessageBox.Show(this, "Name and Value need valid values");
|
||||
return;
|
||||
}
|
||||
DialogResult = DialogResult.OK;
|
||||
|
||||
@@ -6,6 +6,7 @@ namespace PckStudio.Forms.Additional_Popups
|
||||
public partial class ItemSelectionPopUp : MetroFramework.Forms.MetroForm
|
||||
{
|
||||
public string SelectedItem => DialogResult == DialogResult.OK ? ComboBox.Text : string.Empty;
|
||||
public int SelectedIndex => DialogResult == DialogResult.OK ? ComboBox.SelectedIndex : -1;
|
||||
|
||||
public string LabelText
|
||||
{
|
||||
|
||||
@@ -246,11 +246,11 @@ namespace PckStudio.Forms.Editor
|
||||
string value = string.Empty;
|
||||
while (!SkinANIM.IsValidANIM(value))
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(value)) MessageBox.Show($"The following value \"{value}\" is not valid. Please try again.");
|
||||
if (!string.IsNullOrWhiteSpace(value)) MessageBox.Show(this, $"The following value \"{value}\" is not valid. Please try again.");
|
||||
TextPrompt diag = new TextPrompt(value);
|
||||
diag.LabelText = "ANIM";
|
||||
diag.OKButtonText = "Ok";
|
||||
if (diag.ShowDialog() == DialogResult.OK)
|
||||
if (diag.ShowDialog(this) == DialogResult.OK)
|
||||
{
|
||||
value = diag.NewText;
|
||||
}
|
||||
@@ -276,7 +276,7 @@ namespace PckStudio.Forms.Editor
|
||||
FileName = animValue.Text + ".png",
|
||||
Filter = "Skin textures|*.png"
|
||||
};
|
||||
if (saveFileDialog.ShowDialog() != DialogResult.OK)
|
||||
if (saveFileDialog.ShowDialog(this) != DialogResult.OK)
|
||||
return;
|
||||
bool isSlim = ruleset.Value.GetFlag(SkinAnimFlag.SLIM_MODEL);
|
||||
bool is64x64 = ruleset.Value.GetFlag(SkinAnimFlag.RESOLUTION_64x64);
|
||||
@@ -349,7 +349,7 @@ namespace PckStudio.Forms.Editor
|
||||
diag.ButtonText = "Presets";
|
||||
diag.ButtonText = "Load";
|
||||
|
||||
if (diag.ShowDialog() != DialogResult.OK)
|
||||
if (diag.ShowDialog(this) != DialogResult.OK)
|
||||
return;
|
||||
|
||||
var templateANIM = new SkinANIM(Templates[diag.SelectedItem]);
|
||||
|
||||
@@ -297,6 +297,7 @@ namespace PckStudio.Forms.Editor
|
||||
private void importJavaAnimationToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (MessageBox.Show(
|
||||
this,
|
||||
"This feature will replace the existing animation data. " +
|
||||
"It might fail if the selected animation script is invalid. " +
|
||||
"Are you sure that you want to continue?",
|
||||
@@ -318,7 +319,7 @@ namespace PckStudio.Forms.Editor
|
||||
string textureFile = fileDialog.FileName.Substring(0, fileDialog.FileName.Length - ".mcmeta".Length);
|
||||
if (!File.Exists(textureFile))
|
||||
{
|
||||
MessageBox.Show(textureFile + " was not found", "Texture not found");
|
||||
MessageBox.Show(this, textureFile + " was not found", "Texture not found");
|
||||
return;
|
||||
}
|
||||
try
|
||||
@@ -332,7 +333,7 @@ namespace PckStudio.Forms.Editor
|
||||
}
|
||||
catch (JsonException j_ex)
|
||||
{
|
||||
MessageBox.Show(j_ex.Message, "Invalid animation");
|
||||
MessageBox.Show(this, j_ex.Message, "Invalid animation");
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -352,29 +353,29 @@ namespace PckStudio.Forms.Editor
|
||||
// removes ".mcmeta" from filename
|
||||
string texturePath = Path.Combine(Path.GetDirectoryName(filename), Path.GetFileNameWithoutExtension(filename));
|
||||
finalTexture.Save(texturePath);
|
||||
MessageBox.Show("Animation was successfully exported as " + Path.GetFileName(filename), "Export successful!");
|
||||
MessageBox.Show(this, "Animation was successfully exported as " + Path.GetFileName(filename), "Export successful!");
|
||||
}
|
||||
}
|
||||
|
||||
private void howToInterpolation_Click(object sender, EventArgs e)
|
||||
{
|
||||
MessageBox.Show("The Interpolation effect is when the animtion smoothly translates between the frames instead of simply displaying the next one. This can be seen with some vanilla Minecraft textures such as Magma and Prismarine.", "Interpolation");
|
||||
MessageBox.Show(this, "The Interpolation effect is when the animtion smoothly translates between the frames instead of simply displaying the next one. This can be seen with some vanilla Minecraft textures such as Magma and Prismarine.", "Interpolation");
|
||||
}
|
||||
|
||||
private void editorControlsToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
MessageBox.Show("Simply drag and drop frames in the tree to rearrange your animation.\n\n" +
|
||||
MessageBox.Show(this, "Simply drag and drop frames in the tree to rearrange your animation.\n\n" +
|
||||
"You can also preview your animation at any time by simply pressing the button under the animation display.", "Editor Controls");
|
||||
}
|
||||
|
||||
private void setBulkSpeedToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
MessageBox.Show("You can edit the frame and its speed by double clicking a frame in the tree. If you'd like to change the entire animation's speed, you can do so with the \"Set Bulk Animation Speed\" button in the \"Tools\" tab", "How to use Bulk Animation tool");
|
||||
MessageBox.Show(this, "You can edit the frame and its speed by double clicking a frame in the tree. If you'd like to change the entire animation's speed, you can do so with the \"Set Bulk Animation Speed\" button in the \"Tools\" tab", "How to use Bulk Animation tool");
|
||||
}
|
||||
|
||||
private void javaAnimationSupportToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
MessageBox.Show("You can import any valid Java Edition tile animations into your pck by opening an mcmeta.\n\n" +
|
||||
MessageBox.Show(this, "You can import any valid Java Edition tile animations into your pck by opening an mcmeta.\n\n" +
|
||||
"You can also export your animation as an Java Edition tile animation. It will also export the actual texture in the same spot.", "Java Edition Support");
|
||||
}
|
||||
|
||||
@@ -408,7 +409,7 @@ namespace PckStudio.Forms.Editor
|
||||
var gif = Image.FromFile(fileDialog.FileName);
|
||||
if (!gif.RawFormat.Equals(ImageFormat.Gif))
|
||||
{
|
||||
MessageBox.Show("Selected file is not a gif", "Invalid file", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
MessageBox.Show(this, "Selected file is not a gif", "Invalid file", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -438,7 +439,7 @@ namespace PckStudio.Forms.Editor
|
||||
Filter = "PNG Files | *.png",
|
||||
Title = "Select a PNG File",
|
||||
};
|
||||
if (ofd.ShowDialog() != DialogResult.OK)
|
||||
if (ofd.ShowDialog(this) != DialogResult.OK)
|
||||
return;
|
||||
Image img = Image.FromFile(ofd.FileName);
|
||||
var textures = img.Split(ImageLayoutDirection.Vertical);
|
||||
|
||||
@@ -124,8 +124,8 @@ namespace PckStudio.Forms.Editor
|
||||
if (!parent.CreateDataFolder()) return;
|
||||
string FileName = Path.Combine(parent.GetDataPath(), entry.Text + ".binka");
|
||||
|
||||
if (File.Exists(FileName)) MessageBox.Show("\"" + entry.Text + ".binka\" exists in the \"Data\" folder", "File found");
|
||||
else MessageBox.Show("\"" + entry.Text + ".binka\" does not exist in the \"Data\" folder. The game will crash when attempting to load this track.", "File missing");
|
||||
if (File.Exists(FileName)) MessageBox.Show(this, "\"" + entry.Text + ".binka\" exists in the \"Data\" folder", "File found");
|
||||
else MessageBox.Show(this, "\"" + entry.Text + ".binka\" does not exist in the \"Data\" folder. The game will crash when attempting to load this track.", "File missing");
|
||||
}
|
||||
|
||||
private void treeView1_AfterSelect(object sender, TreeViewEventArgs e)
|
||||
@@ -145,7 +145,7 @@ namespace PckStudio.Forms.Editor
|
||||
if (available.Length > 0)
|
||||
{
|
||||
using ItemSelectionPopUp add = new ItemSelectionPopUp(available);
|
||||
if (add.ShowDialog() == DialogResult.OK)
|
||||
if (add.ShowDialog(this) == DialogResult.OK)
|
||||
audioFile.AddCategory(GetCategoryId(add.SelectedItem));
|
||||
else return;
|
||||
|
||||
@@ -165,7 +165,7 @@ namespace PckStudio.Forms.Editor
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("There are no more categories that could be added", "All possible categories are used");
|
||||
MessageBox.Show(this, "There are no more categories that could be added", "All possible categories are used");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -179,7 +179,7 @@ namespace PckStudio.Forms.Editor
|
||||
ofn.Multiselect = true;
|
||||
ofn.Filter = "Supported audio files (*.binka,*.wav)|*.binka;*.wav";
|
||||
ofn.Title = "Please choose WAV or BINKA files to add to your pack";
|
||||
ofn.ShowDialog();
|
||||
ofn.ShowDialog(this);
|
||||
ofn.Dispose();
|
||||
if (string.IsNullOrEmpty(ofn.FileName)) return; // Return if name is null or if the user cancels
|
||||
|
||||
@@ -268,7 +268,7 @@ namespace PckStudio.Forms.Editor
|
||||
diag_text += " Pressing yes will replace the existing file. By pressing no, the song entry will be added without affecting the file." +
|
||||
"You can also cancel this operation and all files in queue.";
|
||||
|
||||
DialogResult user_prompt = MessageBox.Show(diag_text, "File already exists", MessageBoxButtons.YesNoCancel);
|
||||
DialogResult user_prompt = MessageBox.Show(this, diag_text, "File already exists", MessageBoxButtons.YesNoCancel);
|
||||
while (user_prompt == DialogResult.None) ; // Stops the editor from adding or processing the file until the user has made their choice
|
||||
if (user_prompt == DialogResult.Cancel)
|
||||
{
|
||||
@@ -364,7 +364,7 @@ namespace PckStudio.Forms.Editor
|
||||
!audioFile.HasCategory(PckAudioFile.AudioCategory.EAudioType.Nether) ||
|
||||
!audioFile.HasCategory(PckAudioFile.AudioCategory.EAudioType.End))
|
||||
{
|
||||
MessageBox.Show("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");
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -375,7 +375,7 @@ namespace PckStudio.Forms.Editor
|
||||
{
|
||||
if (category.SongNames.Count < 1)
|
||||
{
|
||||
MessageBox.Show("The game will crash upon loading your pack if any of the categories are empty. Please remove or occupy the category.", "Empty Category");
|
||||
MessageBox.Show(this, "The game will crash upon loading your pack if any of the categories are empty. Please remove or occupy the category.", "Empty Category");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -385,7 +385,7 @@ namespace PckStudio.Forms.Editor
|
||||
if (!File.Exists(FileName))
|
||||
{
|
||||
songs_missing = true;
|
||||
MessageBox.Show("\"" + song + ".binka\" does not exist in the \"Data\" folder. The game will crash when attempting to load this track.", "File missing");
|
||||
MessageBox.Show(this, "\"" + song + ".binka\" does not exist in the \"Data\" folder. The game will crash when attempting to load this track.", "File missing");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -406,7 +406,7 @@ namespace PckStudio.Forms.Editor
|
||||
|
||||
if (songs_missing)
|
||||
{
|
||||
MessageBox.Show("Failed to save AudioData file because there are missing song entries", "Error");
|
||||
MessageBox.Show(this, "Failed to save AudioData file because there are missing song entries", "Error");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -421,7 +421,7 @@ namespace PckStudio.Forms.Editor
|
||||
|
||||
private void helpToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
MessageBox.Show("Simply drag and drop BINKA or WAV audio files into the right tree to add them to the category selected on the left tree.\n\n" +
|
||||
MessageBox.Show(this, "Simply drag and drop BINKA or WAV audio files into the right tree to add them to the category selected on the left tree.\n\n" +
|
||||
"The \"Menu\" category will only play once when loading the pack, and never again.\n\n" +
|
||||
"The \"Creative\" category will only play songs listed in that category, and unlike other editions of Minecraft, will NOT play songs from the Overworld category. You can fix this by clicking the checkbox found at the top of the form.\n\n" +
|
||||
"The mini game categories will only play if you have your pack loaded in those mini games.\n\n" +
|
||||
@@ -430,7 +430,7 @@ namespace PckStudio.Forms.Editor
|
||||
|
||||
private void deleteUnusedBINKAsToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
DialogResult dr = MessageBox.Show("This will delete all unused BINKA songs in the Data directory. This cannot be undone. Are you sure you want to continue?", "Warning", MessageBoxButtons.YesNo);
|
||||
DialogResult dr = MessageBox.Show(this, "This will delete all unused BINKA songs in the Data directory. This cannot be undone. Are you sure you want to continue?", "Warning", MessageBoxButtons.YesNo);
|
||||
if (dr != DialogResult.Yes) return;
|
||||
var totalSongList = new List<string>();
|
||||
foreach (string song in audioFile.Categories.SelectMany(cat => cat.SongNames))
|
||||
@@ -458,17 +458,17 @@ namespace PckStudio.Forms.Editor
|
||||
totalDeleted++;
|
||||
}
|
||||
}
|
||||
MessageBox.Show("Successfully deleted " + totalDeleted + " files", "Done");
|
||||
MessageBox.Show(this, "Successfully deleted " + totalDeleted + " files", "Done");
|
||||
}
|
||||
|
||||
private void howToAddSongsToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
MessageBox.Show("Right click the right window and press \"Add Entry\" or drag and drop a valid WAV file into the editor's right window. You can also drop other BINKA files, either from the main game or using a tool like BinkMan. The editor will automatically put the song in the Data folder for you.", "How to add a song");
|
||||
MessageBox.Show(this, "Right click the right window and press \"Add Entry\" or drag and drop a valid WAV file into the editor's right window. You can also drop other BINKA files, either from the main game or using a tool like BinkMan. The editor will automatically put the song in the Data folder for you.", "How to add a song");
|
||||
}
|
||||
|
||||
private void whatAreTheCategoriesToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
MessageBox.Show("Categories are pretty self explanatory. The game controls when each category should play.\n" +
|
||||
MessageBox.Show(this, "Categories are pretty self explanatory. The game controls when each category should play.\n" +
|
||||
"\nGAMEPLAY - Plays in the specified dimensions and game modes.\n" +
|
||||
"-Overworld: Plays in survival mode and in Creative if no songs are set\n" +
|
||||
"-Nether: Plays in the Nether.\n" +
|
||||
@@ -484,17 +484,17 @@ namespace PckStudio.Forms.Editor
|
||||
|
||||
private void howToEditCreditsToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
MessageBox.Show("Click Tools -> Credits Editor. This will allow you to edit all the credits easily in the pack easily. Only supports English credits at the moment. ","How to edit credits?");
|
||||
MessageBox.Show(this, "Click Tools -> Credits Editor. This will allow you to edit all the credits easily in the pack easily. Only supports English credits at the moment. ","How to edit credits?");
|
||||
}
|
||||
|
||||
private void optimizeDataFolderToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
MessageBox.Show("Click Tools -> Delete Unused BINKA files. This will clean your folder of any unused songs.", "How to optimize the Data folder");
|
||||
MessageBox.Show(this, "Click Tools -> Delete Unused BINKA files. This will clean your folder of any unused songs.", "How to optimize the Data folder");
|
||||
}
|
||||
|
||||
private void BINKACompressionToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
MessageBox.Show("The numerical up/down control is responsible for the level of compression used when converting WAV files. The default is 4, which was commonly used by 4J for the game's files.","BINKA Compression Level");
|
||||
MessageBox.Show(this, "The numerical up/down control is responsible for the level of compression used when converting WAV files. The default is 4, which was commonly used by 4J for the game's files.","BINKA Compression Level");
|
||||
}
|
||||
|
||||
private void openDataFolderToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
@@ -520,7 +520,7 @@ namespace PckStudio.Forms.Editor
|
||||
ofn.Multiselect = true;
|
||||
ofn.Filter = "Supported audio files (*.binka,*.wav)|*.binka;*.wav";
|
||||
ofn.Title = "Please choose WAV or BINKA files to replace existing track files";
|
||||
ofn.ShowDialog();
|
||||
ofn.ShowDialog(this);
|
||||
ofn.Dispose();
|
||||
if (string.IsNullOrEmpty(ofn.FileName)) return; // Return if name is null or if the user cancels
|
||||
|
||||
@@ -578,7 +578,7 @@ namespace PckStudio.Forms.Editor
|
||||
{
|
||||
using ItemSelectionPopUp add = new ItemSelectionPopUp(available);
|
||||
add.ButtonText = "Save";
|
||||
if (add.ShowDialog() != DialogResult.OK) return;
|
||||
if (add.ShowDialog(this) != DialogResult.OK) return;
|
||||
|
||||
audioFile.RemoveCategory(category.audioType);
|
||||
|
||||
@@ -592,13 +592,13 @@ namespace PckStudio.Forms.Editor
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("There are no categories that aren't already used", "All possible categories are used");
|
||||
MessageBox.Show(this, "There are no categories that aren't already used", "All possible categories are used");
|
||||
}
|
||||
}
|
||||
|
||||
private void organizeTracksToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
if(MessageBox.Show("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(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()) return;
|
||||
string musicdir = Path.Combine(parent.GetDataPath(), "Music");
|
||||
|
||||
@@ -160,7 +160,7 @@ namespace PckStudio.Forms.Editor
|
||||
var diag = new AddEntry("behaviours", ApplicationScope.EntityImages);
|
||||
diag.acceptBtn.Text = "Save";
|
||||
|
||||
if (diag.ShowDialog() == DialogResult.OK)
|
||||
if (diag.ShowDialog(this) == DialogResult.OK)
|
||||
{
|
||||
if (String.IsNullOrEmpty(diag.SelectedEntity)) return;
|
||||
if (behaviourFile.entries.FindAll(behaviour => behaviour.name == diag.SelectedEntity).Count() > 0)
|
||||
@@ -213,7 +213,7 @@ namespace PckStudio.Forms.Editor
|
||||
{
|
||||
var diag = new AddEntry("behaviours", ApplicationScope.EntityImages);
|
||||
|
||||
if(diag.ShowDialog() == DialogResult.OK)
|
||||
if(diag.ShowDialog(this) == DialogResult.OK)
|
||||
{
|
||||
if (string.IsNullOrEmpty(diag.SelectedEntity)) return;
|
||||
if (behaviourFile.entries.FindAll(behaviour => behaviour.name == diag.SelectedEntity).Count() > 0)
|
||||
|
||||
@@ -366,7 +366,7 @@ namespace PckStudio.Forms.Editor
|
||||
colorPick.AllowFullOpen = true;
|
||||
colorPick.AnyColor = true;
|
||||
colorPick.SolidColorOnly = tabControl.SelectedTab == colorsTab;
|
||||
if (colorPick.ShowDialog() != DialogResult.OK) return;
|
||||
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)
|
||||
|
||||
@@ -117,11 +117,11 @@ namespace PckStudio.Forms.Editor
|
||||
if (GrfTreeView.SelectedNode == null || !(GrfTreeView.SelectedNode.Tag is GameRuleFile.GameRule)) return;
|
||||
var grfTag = GrfTreeView.SelectedNode.Tag as GameRuleFile.GameRule;
|
||||
AddParameter prompt = new AddParameter();
|
||||
if (prompt.ShowDialog() == DialogResult.OK)
|
||||
if (prompt.ShowDialog(this) == DialogResult.OK)
|
||||
{
|
||||
if (grfTag.Parameters.ContainsKey(prompt.ParameterName))
|
||||
{
|
||||
MessageBox.Show("Can't add detail that already exists.", "Error");
|
||||
MessageBox.Show(this, "Can't add detail that already exists.", "Error");
|
||||
return;
|
||||
}
|
||||
grfTag.Parameters.Add(prompt.ParameterName, prompt.ParameterValue);
|
||||
@@ -138,7 +138,7 @@ namespace PckStudio.Forms.Editor
|
||||
ReloadParameterTreeView();
|
||||
return;
|
||||
}
|
||||
MessageBox.Show("No Rule selected");
|
||||
MessageBox.Show(this, "No Rule selected");
|
||||
}
|
||||
|
||||
private void GrfDetailsTreeView_KeyDown(object sender, KeyEventArgs e)
|
||||
@@ -153,7 +153,7 @@ namespace PckStudio.Forms.Editor
|
||||
GrfParametersTreeView.SelectedNode is TreeNode paramNode && paramNode.Tag is KeyValuePair<string, string> param)
|
||||
{
|
||||
AddParameter prompt = new AddParameter(param.Key, param.Value, false);
|
||||
if (prompt.ShowDialog() == DialogResult.OK)
|
||||
if (prompt.ShowDialog(this) == DialogResult.OK)
|
||||
{
|
||||
rule.Parameters[prompt.ParameterName] = prompt.ParameterValue;
|
||||
ReloadParameterTreeView();
|
||||
@@ -175,9 +175,9 @@ namespace PckStudio.Forms.Editor
|
||||
using (TextPrompt prompt = new TextPrompt())
|
||||
{
|
||||
prompt.OKButtonText = "Add";
|
||||
if (MessageBox.Show($"Add Game Rule to {parentRule.Name}", "Attention",
|
||||
if (MessageBox.Show(this, $"Add Game Rule to {parentRule.Name}", "Attention",
|
||||
MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes &&
|
||||
prompt.ShowDialog() == DialogResult.OK &&
|
||||
prompt.ShowDialog(this) == DialogResult.OK &&
|
||||
!string.IsNullOrWhiteSpace(prompt.NewText))
|
||||
{
|
||||
var tag = parentRule.AddRule(prompt.NewText);
|
||||
@@ -212,7 +212,7 @@ namespace PckStudio.Forms.Editor
|
||||
{
|
||||
if (_file.Header.unknownData[3] != 0)
|
||||
{
|
||||
MessageBox.Show("World grf saving is currently unsupported");
|
||||
MessageBox.Show(this, "World grf saving is currently unsupported");
|
||||
return;
|
||||
}
|
||||
DialogResult = DialogResult.OK;
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace PckStudio.Forms.Editor
|
||||
if (node == null ||
|
||||
!currentLoc.LocKeys.ContainsKey(node.Text))
|
||||
{
|
||||
MessageBox.Show("Selected Node does not seem to be in the loc file");
|
||||
MessageBox.Show(this, "Selected Node does not seem to be in the loc file");
|
||||
return;
|
||||
}
|
||||
ReloadTranslationTable();
|
||||
@@ -65,7 +65,7 @@ namespace PckStudio.Forms.Editor
|
||||
using (TextPrompt prompt = new TextPrompt())
|
||||
{
|
||||
prompt.OKButtonText = "Add";
|
||||
if (prompt.ShowDialog() == DialogResult.OK &&
|
||||
if (prompt.ShowDialog(this) == DialogResult.OK &&
|
||||
!currentLoc.LocKeys.ContainsKey(prompt.NewText) &&
|
||||
currentLoc.AddLocKey(prompt.NewText, ""))
|
||||
{
|
||||
@@ -87,7 +87,7 @@ namespace PckStudio.Forms.Editor
|
||||
if (e.ColumnIndex != 1 ||
|
||||
treeViewLocKeys.SelectedNode == null)
|
||||
{
|
||||
MessageBox.Show("something went wrong");
|
||||
MessageBox.Show(this, "something went wrong");
|
||||
return;
|
||||
}
|
||||
currentLoc.SetLocEntry(treeViewLocKeys.SelectedNode.Text, tbl.Rows[e.RowIndex][0].ToString(), tbl.Rows[e.RowIndex][1].ToString());
|
||||
@@ -136,7 +136,7 @@ namespace PckStudio.Forms.Editor
|
||||
{
|
||||
string[] avalibleLang = GetAvailableLanguages().ToArray();
|
||||
using (var dialog = new AddLanguage(avalibleLang))
|
||||
if (dialog.ShowDialog() == DialogResult.OK)
|
||||
if (dialog.ShowDialog(this) == DialogResult.OK)
|
||||
{
|
||||
currentLoc.AddLanguage(dialog.SelectedLanguage);
|
||||
ReloadTranslationTable();
|
||||
|
||||
@@ -152,7 +152,7 @@ namespace PckStudio.Forms.Editor
|
||||
{
|
||||
var diag = new Additional_Popups.EntityForms.AddEntry("materials", ApplicationScope.EntityImages);
|
||||
|
||||
if (diag.ShowDialog() == DialogResult.OK)
|
||||
if (diag.ShowDialog(this) == DialogResult.OK)
|
||||
{
|
||||
if (string.IsNullOrEmpty(diag.SelectedEntity)) return;
|
||||
if (materialFile.FindAll(mat => mat.Name == diag.SelectedEntity).Count() > 0)
|
||||
|
||||
@@ -514,7 +514,7 @@ namespace PckStudio.Forms.Editor
|
||||
Title = "Select Texture"
|
||||
};
|
||||
|
||||
if (fileDialog.ShowDialog() == DialogResult.OK)
|
||||
if (fileDialog.ShowDialog(this) == DialogResult.OK)
|
||||
{
|
||||
var img = Image.FromFile(fileDialog.FileName);
|
||||
SetTile(img);
|
||||
@@ -536,7 +536,7 @@ namespace PckStudio.Forms.Editor
|
||||
var animation = file.Get(AnimationDeserializer.DefaultDeserializer);
|
||||
|
||||
var animationEditor = new AnimationEditor(animation, _selectedTile.Tile.InternalName, GetBlendColor());
|
||||
if (animationEditor.ShowDialog() != DialogResult.OK)
|
||||
if (animationEditor.ShowDialog(this) != DialogResult.OK)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -553,7 +553,7 @@ namespace PckStudio.Forms.Editor
|
||||
Filter = "Tile Texture|*.png",
|
||||
FileName = _selectedTile.Tile.InternalName
|
||||
};
|
||||
if (saveFileDialog.ShowDialog() == DialogResult.OK)
|
||||
if (saveFileDialog.ShowDialog(this) == DialogResult.OK)
|
||||
{
|
||||
dataTile.Texture.Save(saveFileDialog.FileName, ImageFormat.Png);
|
||||
}
|
||||
@@ -615,7 +615,7 @@ namespace PckStudio.Forms.Editor
|
||||
0x211d1d // Black
|
||||
};
|
||||
|
||||
if (colorPick.ShowDialog() != DialogResult.OK) return;
|
||||
if (colorPick.ShowDialog(this) != DialogResult.OK) return;
|
||||
|
||||
selectTilePictureBox.BlendColor = colorPick.Color;
|
||||
selectTilePictureBox.Image = dataTile.Texture;
|
||||
|
||||
@@ -51,19 +51,19 @@ namespace PckStudio.Popups
|
||||
{
|
||||
case 64:
|
||||
anim.SetFlag(SkinAnimFlag.RESOLUTION_64x64, true);
|
||||
MessageBox.Show("64x64 Skin Detected");
|
||||
MessageBox.Show(this, "64x64 Skin Detected");
|
||||
skinType = eSkinType._64x64;
|
||||
break;
|
||||
case 32:
|
||||
anim.SetFlag(SkinAnimFlag.RESOLUTION_64x64 | SkinAnimFlag.SLIM_MODEL, false);
|
||||
MessageBox.Show("64x32 Skin Detected");
|
||||
MessageBox.Show(this, "64x32 Skin Detected");
|
||||
skinType = eSkinType._64x32;
|
||||
break;
|
||||
default:
|
||||
if (img.Width == img.Height)
|
||||
{
|
||||
anim.SetFlag(SkinAnimFlag.RESOLUTION_64x64, true);
|
||||
MessageBox.Show("64x64 HD Skin Detected");
|
||||
MessageBox.Show(this, "64x64 HD Skin Detected");
|
||||
skinType = eSkinType._64x64HD;
|
||||
break;
|
||||
}
|
||||
@@ -71,12 +71,12 @@ namespace PckStudio.Popups
|
||||
if (img.Height == img.Width / 2)
|
||||
{
|
||||
anim.SetFlag(SkinAnimFlag.RESOLUTION_64x64 | SkinAnimFlag.SLIM_MODEL, false);
|
||||
MessageBox.Show("64x32 HD Skin Detected");
|
||||
MessageBox.Show(this, "64x32 HD Skin Detected");
|
||||
skinType = eSkinType._64x32HD;
|
||||
break;
|
||||
}
|
||||
|
||||
MessageBox.Show("Not a Valid Skin File");
|
||||
MessageBox.Show(this, "Not a Valid Skin File");
|
||||
skinType = eSkinType.Invalid;
|
||||
return;
|
||||
}
|
||||
@@ -145,12 +145,12 @@ namespace PckStudio.Popups
|
||||
|
||||
private void buttonSkin_Click(object sender, EventArgs e)
|
||||
{
|
||||
contextMenuSkin.Show(Location.X + buttonSkin.Location.X + 2, Location.Y + buttonSkin.Location.Y + buttonSkin.Size.Height);
|
||||
contextMenuSkin.Show(this, Location.X + buttonSkin.Location.X + 2, Location.Y + buttonSkin.Location.Y + buttonSkin.Size.Height);
|
||||
}
|
||||
|
||||
private void buttonCape_Click(object sender, EventArgs e)
|
||||
{
|
||||
contextMenuCape.Show(Location.X + buttonCape.Location.X + 2, Location.Y + buttonCape.Location.Y + buttonCape.Size.Height);
|
||||
contextMenuCape.Show(this, Location.X + buttonCape.Location.X + 2, Location.Y + buttonCape.Location.Y + buttonCape.Size.Height);
|
||||
}
|
||||
|
||||
private void replaceToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
@@ -170,6 +170,7 @@ namespace PckStudio.Popups
|
||||
if (e.Button == MouseButtons.Right)
|
||||
{
|
||||
contextMenuSkin.Show(
|
||||
this,
|
||||
x: Location.X + skinPictureBox.Location.X,
|
||||
y: Location.Y + skinPictureBox.Location.Y + skinPictureBox.Size.Height
|
||||
);
|
||||
@@ -205,6 +206,7 @@ namespace PckStudio.Popups
|
||||
if (e.Button == MouseButtons.Right)
|
||||
{
|
||||
contextMenuCape.Show(
|
||||
this,
|
||||
x: Location.X + capePictureBox.Location.X,
|
||||
y: Location.Y + capePictureBox.Location.Y + capePictureBox.Size.Height
|
||||
);
|
||||
@@ -220,7 +222,7 @@ namespace PckStudio.Popups
|
||||
var img = Image.FromFile(ofd.FileName);
|
||||
if (img.RawFormat != ImageFormat.Png && img.Width != img.Height * 2)
|
||||
{
|
||||
MessageBox.Show("Not a Valid Cape File");
|
||||
MessageBox.Show(this, "Not a Valid Cape File");
|
||||
return;
|
||||
}
|
||||
capePictureBox.Image = Image.FromFile(ofd.FileName);
|
||||
@@ -237,7 +239,7 @@ namespace PckStudio.Popups
|
||||
{
|
||||
if (!int.TryParse(textSkinID.Text, out int _skinId))
|
||||
{
|
||||
MessageBox.Show("The Skin ID Must be a Unique 8 Digit Number Thats Not Already in Use", "Invalid Skin ID", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
MessageBox.Show(this, "The Skin ID Must be a Unique 8 Digit Number Thats Not Already in Use", "Invalid Skin ID", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
return;
|
||||
}
|
||||
string skinId = _skinId.ToString("d08");
|
||||
@@ -283,7 +285,7 @@ namespace PckStudio.Popups
|
||||
private void CreateCustomModel_Click(object sender, EventArgs e)
|
||||
{
|
||||
//Prompt for skin model generator
|
||||
if (MessageBox.Show("Create your own custom skin model?", "", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1) != DialogResult.Yes)
|
||||
if (MessageBox.Show(this, "Create your own custom skin model?", "", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1) != DialogResult.Yes)
|
||||
return;
|
||||
|
||||
skin.SetData(Resources.classic_template, ImageFormat.Png);
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace PckStudio.Popups
|
||||
DialogResult = DialogResult.OK;
|
||||
return;
|
||||
}
|
||||
MessageBox.Show("Please select a filetype before applying");
|
||||
MessageBox.Show(this, "Please select a filetype before applying");
|
||||
}
|
||||
|
||||
private void applyBulkProperties(IReadOnlyCollection<PckFileData> files, int index)
|
||||
@@ -73,10 +73,10 @@ namespace PckStudio.Popups
|
||||
|
||||
if (Enum.IsDefined(typeof(PckFileType), index))
|
||||
{
|
||||
MessageBox.Show($"Data added to {(PckFileType)index} entries");
|
||||
MessageBox.Show(this, $"Data added to {(PckFileType)index} entries");
|
||||
return;
|
||||
}
|
||||
MessageBox.Show("Data added to all entries");
|
||||
MessageBox.Show(this, "Data added to all entries");
|
||||
}
|
||||
|
||||
private void treeMeta_AfterSelect(object sender, TreeViewEventArgs e)
|
||||
|
||||
@@ -1052,7 +1052,7 @@ namespace PckStudio.Forms
|
||||
Bitmap bitmap = new Bitmap(uvPictureBox.Image, 64, 64);
|
||||
using SaveFileDialog saveFileDialog = new SaveFileDialog();
|
||||
saveFileDialog.Filter = "PNG Image Files | *.png";
|
||||
if (saveFileDialog.ShowDialog() == DialogResult.OK)
|
||||
if (saveFileDialog.ShowDialog(this) == DialogResult.OK)
|
||||
{
|
||||
bitmap.Save(saveFileDialog.FileName, ImageFormat.Png);
|
||||
}
|
||||
@@ -1066,7 +1066,7 @@ namespace PckStudio.Forms
|
||||
openFileDialog.Filter = "PNG Image Files | *.png";
|
||||
openFileDialog.Title = "Select Skin Texture";
|
||||
|
||||
if (openFileDialog.ShowDialog() == DialogResult.OK) // skins can only be a 1:1 ratio (base 64x64) or a 2:1 ratio (base 64x32)
|
||||
if (openFileDialog.ShowDialog(this) == DialogResult.OK) // skins can only be a 1:1 ratio (base 64x64) or a 2:1 ratio (base 64x32)
|
||||
{
|
||||
using (var img = Image.FromFile(openFileDialog.FileName))
|
||||
{
|
||||
@@ -1117,7 +1117,7 @@ namespace PckStudio.Forms
|
||||
private void listView1_DoubleClick(object sender, EventArgs e)
|
||||
{
|
||||
ColorDialog colorDialog = new ColorDialog();
|
||||
if (colorDialog.ShowDialog() == DialogResult.OK)
|
||||
if (colorDialog.ShowDialog(this) == DialogResult.OK)
|
||||
listViewBoxes.SelectedItems[0].ForeColor = colorDialog.Color;
|
||||
Rerender();
|
||||
}
|
||||
@@ -1175,7 +1175,7 @@ namespace PckStudio.Forms
|
||||
{
|
||||
SaveFileDialog saveFileDialog = new SaveFileDialog();
|
||||
saveFileDialog.Filter = "Custom Skin Model File | *.CSM";
|
||||
if (saveFileDialog.ShowDialog() != DialogResult.OK)
|
||||
if (saveFileDialog.ShowDialog(this) != DialogResult.OK)
|
||||
return;
|
||||
string contents = "";
|
||||
foreach (ListViewItem listViewItem in listViewBoxes.Items)
|
||||
@@ -1199,7 +1199,7 @@ namespace PckStudio.Forms
|
||||
OpenFileDialog openFileDialog = new OpenFileDialog();
|
||||
openFileDialog.Filter = "Custom Skin Model File | *.CSM";
|
||||
openFileDialog.Title = "Select Custom Skin Model File";
|
||||
if (MessageBox.Show("Import custom model project file? Your current work will be lost!", "", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1) == DialogResult.Yes && openFileDialog.ShowDialog() == DialogResult.OK)
|
||||
if (MessageBox.Show(this, "Import custom model project file? Your current work will be lost!", "", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1) == DialogResult.Yes && openFileDialog.ShowDialog(this) == DialogResult.OK)
|
||||
{
|
||||
listViewBoxes.Items.Clear();
|
||||
modelBoxes.Clear();
|
||||
@@ -1246,7 +1246,7 @@ namespace PckStudio.Forms
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine(ex.Message);
|
||||
MessageBox.Show("Please Select a Part");
|
||||
MessageBox.Show(this, "Please Select a Part");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1261,7 +1261,7 @@ namespace PckStudio.Forms
|
||||
private void changeColorToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
ColorDialog colorDialog = new ColorDialog();
|
||||
if (colorDialog.ShowDialog() == DialogResult.OK)
|
||||
if (colorDialog.ShowDialog(this) == DialogResult.OK)
|
||||
listViewBoxes.SelectedItems[0].ForeColor = colorDialog.Color;
|
||||
Rerender();
|
||||
}
|
||||
@@ -1368,7 +1368,7 @@ namespace PckStudio.Forms
|
||||
OpenFileDialog openFileDialog = new OpenFileDialog();
|
||||
openFileDialog.Filter = "JSON Model File | *.JSON";
|
||||
openFileDialog.Title = "Select JSON Model File";
|
||||
if (MessageBox.Show("Import custom model project file? Your current work will be lost!", "", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1) == DialogResult.Yes && openFileDialog.ShowDialog() == DialogResult.OK)
|
||||
if (MessageBox.Show(this, "Import custom model project file? Your current work will be lost!", "", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1) == DialogResult.Yes && openFileDialog.ShowDialog(this) == DialogResult.OK)
|
||||
{
|
||||
listViewBoxes.Items.Clear();
|
||||
string str1 = JSONToCSM(openFileDialog.FileName);
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace PckStudio.Internal
|
||||
{
|
||||
// this is to specify which build release this is. This is manually updated for now
|
||||
// TODO: add different chars for different configurations
|
||||
private const string BuildType = "b";
|
||||
private const string BuildType = "c";
|
||||
private static System.Globalization.Calendar _buildCalendar;
|
||||
private static DateTime date = new FileInfo(Assembly.GetExecutingAssembly().Location).LastWriteTime;
|
||||
private static string _betaBuildVersion;
|
||||
|
||||
@@ -127,7 +127,7 @@ namespace PckStudio
|
||||
}
|
||||
catch (OverflowException ex)
|
||||
{
|
||||
MessageBox.Show("Failed to open pck\n" +
|
||||
MessageBox.Show(this, "Failed to open pck\n" +
|
||||
"Try checking the 'Open/Save as Switch/Vita/PS4 pck' checkbox in the upper right corner.",
|
||||
"Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
Debug.WriteLine(ex.Message);
|
||||
@@ -151,7 +151,7 @@ namespace PckStudio
|
||||
currentPCK = openPck(filepath);
|
||||
if (currentPCK == null)
|
||||
{
|
||||
MessageBox.Show(string.Format("Failed to load {0}", Path.GetFileName(filepath)), "Error");
|
||||
MessageBox.Show(this, string.Format("Failed to load {0}", Path.GetFileName(filepath)), "Error");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -255,7 +255,7 @@ namespace PckStudio
|
||||
{
|
||||
ofd.CheckFileExists = true;
|
||||
ofd.Filter = "PCK (Minecraft Console Package)|*.pck";
|
||||
if (ofd.ShowDialog() == DialogResult.OK)
|
||||
if (ofd.ShowDialog(this) == DialogResult.OK)
|
||||
{
|
||||
LoadPckFromFile(ofd.FileName);
|
||||
}
|
||||
@@ -275,14 +275,14 @@ namespace PckStudio
|
||||
}
|
||||
catch (OverflowException ex)
|
||||
{
|
||||
MessageBox.Show("Failed to open pck\n" +
|
||||
MessageBox.Show(this, "Failed to open pck\n" +
|
||||
$"Try {(LittleEndianCheckBox.Checked ? "unchecking" : "checking")} the 'Open/Save as Switch/Vita/PS4 pck' check box in the upper right corner.",
|
||||
"Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
Debug.WriteLine(ex.Message);
|
||||
}
|
||||
catch
|
||||
{
|
||||
MessageBox.Show("Failed to open pck. There's two common reasons for this:\n" +
|
||||
MessageBox.Show(this, "Failed to open pck. There's two common reasons for this:\n" +
|
||||
"1. The file is audio/music cues PCK file. Please use the specialized editor while inside of a pck file.\n" +
|
||||
"2. We're aware of an issue where a pck file might fail to load because it contains multiple entries with the same path.",
|
||||
"Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
@@ -482,7 +482,7 @@ namespace PckStudio
|
||||
}
|
||||
|
||||
var viewer = new TextureAtlasEditor(currentPCK, file.Filename, img, tile_size);
|
||||
if (viewer.ShowDialog() == DialogResult.OK)
|
||||
if (viewer.ShowDialog(this) == DialogResult.OK)
|
||||
{
|
||||
Image texture = viewer.FinalTexture;
|
||||
if(isBanners)
|
||||
@@ -595,7 +595,7 @@ namespace PckStudio
|
||||
if (file.HasProperty("BOX"))
|
||||
{
|
||||
using generateModel generate = new generateModel(file);
|
||||
if (generate.ShowDialog() == DialogResult.OK)
|
||||
if (generate.ShowDialog(this) == DialogResult.OK)
|
||||
{
|
||||
entryDataTextBox.Text = entryTypeTextBox.Text = string.Empty;
|
||||
wasModified = true;
|
||||
@@ -611,7 +611,7 @@ namespace PckStudio
|
||||
|
||||
public void HandleModelsFile(PckFileData file)
|
||||
{
|
||||
MessageBox.Show("Models.bin support has not been implemented. You can use the Spark Editor for the time being to edit these files.", "Not implemented yet.");
|
||||
MessageBox.Show(this, "Models.bin support has not been implemented. You can use the Spark Editor for the time being to edit these files.", "Not implemented yet.");
|
||||
}
|
||||
|
||||
public void HandleBehavioursFile(PckFileData file)
|
||||
@@ -791,7 +791,7 @@ namespace PckStudio
|
||||
using SaveFileDialog exFile = new SaveFileDialog();
|
||||
exFile.FileName = Path.GetFileName(file.Filename);
|
||||
exFile.Filter = Path.GetExtension(file.Filename).Replace(".", string.Empty) + " File|*" + Path.GetExtension(file.Filename);
|
||||
if (exFile.ShowDialog() != DialogResult.OK ||
|
||||
if (exFile.ShowDialog(this) != DialogResult.OK ||
|
||||
// Makes sure chosen directory isn't null or whitespace AKA makes sure its usable
|
||||
string.IsNullOrWhiteSpace(Path.GetDirectoryName(exFile.FileName)))
|
||||
{
|
||||
@@ -804,7 +804,7 @@ namespace PckStudio
|
||||
}
|
||||
|
||||
// Verification that file extraction path was successful
|
||||
MessageBox.Show($"\"{node.Text}\" successfully extracted");
|
||||
MessageBox.Show(this, $"\"{node.Text}\" successfully extracted");
|
||||
}
|
||||
|
||||
private void SaveTemplate()
|
||||
@@ -812,7 +812,7 @@ namespace PckStudio
|
||||
using SaveFileDialog saveFileDialog = new SaveFileDialog();
|
||||
saveFileDialog.Filter = "PCK (Minecraft Console Package)|*.pck";
|
||||
saveFileDialog.DefaultExt = ".pck";
|
||||
if (saveFileDialog.ShowDialog() == DialogResult.OK)
|
||||
if (saveFileDialog.ShowDialog(this) == DialogResult.OK)
|
||||
{
|
||||
Save(saveFileDialog.FileName);
|
||||
saveLocation = saveFileDialog.FileName;
|
||||
@@ -827,7 +827,7 @@ namespace PckStudio
|
||||
var writer = new PckFileWriter(currentPCK, LittleEndianCheckBox.Checked ? OMI.Endianness.LittleEndian : OMI.Endianness.BigEndian);
|
||||
writer.WriteToFile(filePath);
|
||||
wasModified = false;
|
||||
MessageBox.Show("Saved Pck file", "File Saved");
|
||||
MessageBox.Show(this, "Saved Pck file", "File Saved");
|
||||
}
|
||||
|
||||
private void replaceToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
@@ -850,7 +850,7 @@ namespace PckStudio
|
||||
string fileExt = Path.GetExtension(file.Filename);
|
||||
|
||||
ofd.Filter = $"{file.Filetype} (*{fileExt}{extra_extensions})|*{fileExt}{extra_extensions}";
|
||||
if (ofd.ShowDialog() == DialogResult.OK)
|
||||
if (ofd.ShowDialog(this) == DialogResult.OK)
|
||||
{
|
||||
string newFileExt = Path.GetExtension(ofd.FileName);
|
||||
file.SetData(File.ReadAllBytes(ofd.FileName));
|
||||
@@ -861,7 +861,7 @@ namespace PckStudio
|
||||
}
|
||||
return;
|
||||
}
|
||||
MessageBox.Show("Can't replace a folder.");
|
||||
MessageBox.Show(this, "Can't replace a folder.");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -877,7 +877,7 @@ namespace PckStudio
|
||||
if (file.Filetype == PckFileType.TextureFile &&
|
||||
(file.Filename == itemPath + "/compass.png" || file.Filename == itemPath + "/clock.png"))
|
||||
{
|
||||
if (MessageBox.Show("Are you sure want to delete this file? If \"compass.png\" or \"clock.png\" are missing, your game will crash upon loading this pack.", "Warning",
|
||||
if (MessageBox.Show(this, "Are you sure want to delete this file? If \"compass.png\" or \"clock.png\" are missing, your game will crash upon loading this pack.", "Warning",
|
||||
MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
|
||||
return true;
|
||||
}
|
||||
@@ -913,7 +913,7 @@ namespace PckStudio
|
||||
wasModified = true;
|
||||
}
|
||||
}
|
||||
else if (MessageBox.Show("Are you sure want to delete this folder? All contents will be deleted", "Warning",
|
||||
else if (MessageBox.Show(this, "Are you sure want to delete this folder? All contents will be deleted", "Warning",
|
||||
MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
|
||||
{
|
||||
string pckFolderDir = node.FullPath;
|
||||
@@ -938,7 +938,7 @@ namespace PckStudio
|
||||
{
|
||||
if (currentPCK.TryGetFile(diag.NewText, file.Filetype, out _))
|
||||
{
|
||||
MessageBox.Show($"{diag.NewText} already exists", "File already exists");
|
||||
MessageBox.Show(this, $"{diag.NewText} already exists", "File already exists");
|
||||
return;
|
||||
}
|
||||
file.Filename = diag.NewText;
|
||||
@@ -966,9 +966,8 @@ namespace PckStudio
|
||||
LOCFile locFile = null;
|
||||
TryGetLocFile(out locFile);
|
||||
using AddNewSkin add = new AddNewSkin(locFile);
|
||||
if (add.ShowDialog() == DialogResult.OK)
|
||||
if (add.ShowDialog(this) == DialogResult.OK)
|
||||
{
|
||||
|
||||
if (currentPCK.HasFile("Skins.pck", PckFileType.SkinDataFile)) // Prioritize Skins.pck
|
||||
{
|
||||
TreeNode subPCK = treeViewMain.Nodes.Find("Skins.pck", false).FirstOrDefault();
|
||||
@@ -1027,12 +1026,12 @@ namespace PckStudio
|
||||
if (currentPCK.Contains(PckFileType.AudioFile))
|
||||
{
|
||||
// the chance of this happening is really really slim but just in case
|
||||
MessageBox.Show("There is already an audio file in this PCK!", "Can't create audio.pck");
|
||||
MessageBox.Show(this, "There is already an audio file in this PCK!", "Can't create audio.pck");
|
||||
return;
|
||||
}
|
||||
if (string.IsNullOrEmpty(saveLocation))
|
||||
{
|
||||
MessageBox.Show("You must save your pck before creating or opening a music cues PCK file", "Can't create audio.pck");
|
||||
MessageBox.Show(this, "You must save your pck before creating or opening a music cues PCK file", "Can't create audio.pck");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1056,7 +1055,7 @@ namespace PckStudio
|
||||
|
||||
if (currentPCK.Contains(animationFilepath, PckFileType.TextureFile))
|
||||
{
|
||||
MessageBox.Show($"{diag.SelectedTile} is already present.", "File already present");
|
||||
MessageBox.Show(this, $"{diag.SelectedTile} is already present.", "File already present");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1131,16 +1130,38 @@ namespace PckStudio
|
||||
if (parent == null) return;
|
||||
|
||||
PckFileData parent_file = parent.Tag as PckFileData;
|
||||
PckFile parent_file_pck =
|
||||
new PckFileReader(
|
||||
LittleEndianCheckBox.Checked ?
|
||||
OMI.Endianness.LittleEndian :
|
||||
OMI.Endianness.BigEndian
|
||||
).FromStream(new MemoryStream(parent_file.Data));
|
||||
|
||||
if (parent_file.Filetype is PckFileType.TexturePackInfoFile || parent_file.Filetype is PckFileType.SkinDataFile)
|
||||
{
|
||||
Debug.WriteLine("Rebuilding " + parent_file.Filename);
|
||||
PckFile newPCKFile = new PckFile(3, parent_file.Filetype is PckFileType.SkinDataFile);
|
||||
|
||||
bool hasSkinsFolder = false;
|
||||
|
||||
// add original pck files to prevent data loss
|
||||
foreach (PckFileData _fd in parent_file_pck.GetFiles())
|
||||
{
|
||||
PckFileData new_file = newPCKFile.CreateNewFile(_fd.Filename, _fd.Filetype);
|
||||
// check for skins folder so files are placed consistently in final pck
|
||||
if (_fd.Filename.StartsWith("Skins/") && parent_file.Filetype is PckFileType.SkinDataFile) hasSkinsFolder = true;
|
||||
foreach (var prop in _fd.GetProperties())
|
||||
new_file.AddProperty(prop);
|
||||
new_file.SetData(_fd.Data);
|
||||
}
|
||||
|
||||
foreach (TreeNode node in GetAllChildNodes(parent.Nodes))
|
||||
{
|
||||
if (node.Tag is PckFileData node_file)
|
||||
{
|
||||
PckFileData new_file = newPCKFile.CreateNewFile(node_file.Filename.Replace(parent_file.Filename + "/", String.Empty), node_file.Filetype);
|
||||
PckFileData new_file = newPCKFile.CreateNewFile(
|
||||
(hasSkinsFolder ? "Skins/" : String.Empty)
|
||||
+ node_file.Filename.Replace(parent_file.Filename + "/", String.Empty), node_file.Filetype);
|
||||
foreach (var prop in node_file.GetProperties())
|
||||
new_file.AddProperty(prop);
|
||||
new_file.SetData(node_file.Data);
|
||||
@@ -1150,7 +1171,12 @@ namespace PckStudio
|
||||
parent_file.SetData(new PckFileWriter(newPCKFile, LittleEndianCheckBox.Checked ? OMI.Endianness.LittleEndian : OMI.Endianness.BigEndian));
|
||||
parent.Tag = parent_file;
|
||||
|
||||
// erase hidden sub-pck nodes to prevent duplication
|
||||
parent.Nodes.Clear();
|
||||
|
||||
BuildMainTreeView();
|
||||
|
||||
MessageBox.Show(this, $"Files added successfully to {parent_file.Filename}");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1202,7 +1228,7 @@ namespace PckStudio
|
||||
{
|
||||
Debug.WriteLine(ex.Message);
|
||||
Trace.WriteLine("Invalid ANIM value: " + property.Value);
|
||||
MessageBox.Show("Failed to parse ANIM value, aborting to normal functionality. Please make sure the value only includes hexadecimal characters (0-9,A-F) and has no more than 8 characters.");
|
||||
MessageBox.Show(this, "Failed to parse ANIM value, aborting to normal functionality. Please make sure the value only includes hexadecimal characters (0-9,A-F) and has no more than 8 characters.");
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -1223,7 +1249,7 @@ namespace PckStudio
|
||||
{
|
||||
Debug.WriteLine(ex.Message);
|
||||
Trace.WriteLine("Invalid BOX value: " + property.Value);
|
||||
MessageBox.Show("Failed to parse BOX value, aborting to normal functionality.");
|
||||
MessageBox.Show(this, "Failed to parse BOX value, aborting to normal functionality.");
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -1234,7 +1260,7 @@ namespace PckStudio
|
||||
|
||||
using (AddPropertyPrompt addProperty = new AddPropertyPrompt(property))
|
||||
{
|
||||
if (addProperty.ShowDialog() == DialogResult.OK)
|
||||
if (addProperty.ShowDialog(this) == DialogResult.OK)
|
||||
{
|
||||
file.SetProperty(file.GetPropertyIndex(property), addProperty.Property);
|
||||
RebuildSubPCK(treeViewMain.SelectedNode.FullPath);
|
||||
@@ -1326,7 +1352,7 @@ namespace PckStudio
|
||||
t.Tag is PckFileData file)
|
||||
{
|
||||
using AddPropertyPrompt addProperty = new AddPropertyPrompt();
|
||||
if (addProperty.ShowDialog() == DialogResult.OK)
|
||||
if (addProperty.ShowDialog(this) == DialogResult.OK)
|
||||
{
|
||||
file.AddProperty(addProperty.Property);
|
||||
RebuildSubPCK(treeViewMain.SelectedNode.FullPath);
|
||||
@@ -1438,7 +1464,7 @@ namespace PckStudio
|
||||
checkSaveState();
|
||||
TextPrompt namePrompt = new TextPrompt();
|
||||
namePrompt.OKButtonText = "Ok";
|
||||
if (namePrompt.ShowDialog() == DialogResult.OK)
|
||||
if (namePrompt.ShowDialog(this) == DialogResult.OK)
|
||||
{
|
||||
currentPCK = InitializePack(new Random().Next(8000, int.MaxValue), 0, namePrompt.NewText, true);
|
||||
isTemplateFile = true;
|
||||
@@ -1451,7 +1477,7 @@ namespace PckStudio
|
||||
{
|
||||
checkSaveState();
|
||||
CreateTexturePackPrompt packPrompt = new CreateTexturePackPrompt();
|
||||
if (packPrompt.ShowDialog() == DialogResult.OK)
|
||||
if (packPrompt.ShowDialog(this) == DialogResult.OK)
|
||||
{
|
||||
currentPCK = InitializeTexturePack(new Random().Next(8000, int.MaxValue), 0, packPrompt.PackName, packPrompt.PackRes, packPrompt.CreateSkinsPck);
|
||||
isTemplateFile = true;
|
||||
@@ -1464,7 +1490,7 @@ namespace PckStudio
|
||||
{
|
||||
checkSaveState();
|
||||
CreateTexturePackPrompt packPrompt = new CreateTexturePackPrompt();
|
||||
if (packPrompt.ShowDialog() == DialogResult.OK)
|
||||
if (packPrompt.ShowDialog(this) == DialogResult.OK)
|
||||
{
|
||||
currentPCK = InitializeMashUpPack(new Random().Next(8000, int.MaxValue), 0, packPrompt.PackName, packPrompt.PackRes);
|
||||
isTemplateFile = true;
|
||||
@@ -1477,7 +1503,7 @@ namespace PckStudio
|
||||
{
|
||||
using AdvancedOptions advanced = new AdvancedOptions(currentPCK);
|
||||
advanced.IsLittleEndian = LittleEndianCheckBox.Checked;
|
||||
if (advanced.ShowDialog() == DialogResult.OK)
|
||||
if (advanced.ShowDialog(this) == DialogResult.OK)
|
||||
{
|
||||
wasModified = true;
|
||||
BuildMainTreeView();
|
||||
@@ -1493,7 +1519,7 @@ namespace PckStudio
|
||||
private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
using CreditsForm info = new CreditsForm();
|
||||
info.ShowDialog();
|
||||
info.ShowDialog(this);
|
||||
}
|
||||
|
||||
private void treeViewMain_KeyDown(object sender, KeyEventArgs e)
|
||||
@@ -1531,7 +1557,7 @@ namespace PckStudio
|
||||
{
|
||||
if (!HasDataFolder())
|
||||
{
|
||||
DialogResult result = MessageBox.Show("There is not a \"Data\" folder present in the pack folder. Would you like to create one?", "Folder missing", MessageBoxButtons.YesNo);
|
||||
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());
|
||||
}
|
||||
@@ -1547,7 +1573,7 @@ namespace PckStudio
|
||||
private void importExtractedSkinsFolder(object sender, EventArgs e)
|
||||
{
|
||||
using FolderBrowserDialog contents = new FolderBrowserDialog();
|
||||
if (contents.ShowDialog() == DialogResult.OK && Directory.Exists(contents.SelectedPath))
|
||||
if (contents.ShowDialog(this) == DialogResult.OK && Directory.Exists(contents.SelectedPath))
|
||||
{
|
||||
string filepath = treeViewMain.SelectedNode?.FullPath ?? "";
|
||||
if (treeViewMain.SelectedNode is not null && treeViewMain.SelectedNode.IsTagOfType<PckFileData>())
|
||||
@@ -1644,7 +1670,7 @@ namespace PckStudio
|
||||
contents.Title = "Select Extracted Skin File";
|
||||
contents.Filter = "Skin File (*.png)|*.png";
|
||||
|
||||
if (contents.ShowDialog() == DialogResult.OK)
|
||||
if (contents.ShowDialog(this) == DialogResult.OK)
|
||||
{
|
||||
string skinNameImport = Path.GetFileName(contents.FileName);
|
||||
byte[] data = File.ReadAllBytes(contents.FileName);
|
||||
@@ -1685,7 +1711,7 @@ namespace PckStudio
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message);
|
||||
MessageBox.Show(this, ex.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1697,7 +1723,7 @@ namespace PckStudio
|
||||
TextPrompt folderNamePrompt = new TextPrompt();
|
||||
if (treeViewMain.SelectedNode is not null) folderNamePrompt.contextLabel.Text = $"New folder at the location of \"{treeViewMain.SelectedNode.FullPath}\"";
|
||||
folderNamePrompt.OKButtonText = "Add";
|
||||
if (folderNamePrompt.ShowDialog() == DialogResult.OK)
|
||||
if (folderNamePrompt.ShowDialog(this) == DialogResult.OK)
|
||||
{
|
||||
TreeNode folerNode = CreateNode(folderNamePrompt.NewText);
|
||||
folerNode.ImageIndex = 0;
|
||||
@@ -1790,7 +1816,7 @@ namespace PckStudio
|
||||
{
|
||||
if (currentPCK is not null &&
|
||||
wasModified &&
|
||||
MessageBox.Show("Save PCK?", "Unsaved PCK", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
|
||||
MessageBox.Show(this, "Save PCK?", "Unsaved PCK", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
|
||||
{
|
||||
if (isTemplateFile || string.IsNullOrEmpty(saveLocation))
|
||||
{
|
||||
@@ -1818,7 +1844,7 @@ namespace PckStudio
|
||||
{
|
||||
string[] Filepaths = (string[])e.Data.GetData(DataFormats.FileDrop, false);
|
||||
if (Filepaths.Length > 1)
|
||||
MessageBox.Show("Only one pck file at a time is currently supported");
|
||||
MessageBox.Show(this, "Only one pck file at a time is currently supported");
|
||||
LoadPckFromFile(Filepaths[0]);
|
||||
}
|
||||
|
||||
@@ -1929,15 +1955,15 @@ namespace PckStudio
|
||||
{
|
||||
using OpenFileDialog fileDialog = new OpenFileDialog();
|
||||
fileDialog.Filter = "Texture File(*.png,*.tga)|*.png;*.tga";
|
||||
if (fileDialog.ShowDialog() == DialogResult.OK)
|
||||
if (fileDialog.ShowDialog(this) == DialogResult.OK)
|
||||
{
|
||||
using TextPrompt renamePrompt = new TextPrompt(Path.GetFileName(fileDialog.FileName));
|
||||
renamePrompt.LabelText = "Path";
|
||||
if (renamePrompt.ShowDialog() == DialogResult.OK && !string.IsNullOrEmpty(renamePrompt.NewText))
|
||||
if (renamePrompt.ShowDialog(this) == DialogResult.OK && !string.IsNullOrEmpty(renamePrompt.NewText))
|
||||
{
|
||||
if (currentPCK.Contains(renamePrompt.NewText, PckFileType.TextureFile))
|
||||
{
|
||||
MessageBox.Show($"'{renamePrompt.NewText}' already exists.", "Import failed", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||||
MessageBox.Show(this, $"'{renamePrompt.NewText}' already exists.", "Import failed", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
PckFileData file = currentPCK.CreateNewFile(renamePrompt.NewText, PckFileType.TextureFile, () => File.ReadAllBytes(fileDialog.FileName));
|
||||
@@ -1951,7 +1977,7 @@ namespace PckStudio
|
||||
{
|
||||
if (treeViewMain.SelectedNode.Tag is PckFileData file)
|
||||
{
|
||||
MessageBox.Show(
|
||||
MessageBox.Show(this,
|
||||
"File path: " + file.Filename +
|
||||
"\nAssigned File type: " + (int)file.Filetype + " (" + file.Filetype + ")" +
|
||||
"\nFile size: " + file.Size +
|
||||
@@ -2017,7 +2043,7 @@ namespace PckStudio
|
||||
{
|
||||
if (currentPCK.TryGetFile("colours.col", PckFileType.ColourTableFile, out _))
|
||||
{
|
||||
MessageBox.Show("A color table file already exists in this PCK and a new one cannot be created.", "Operation aborted");
|
||||
MessageBox.Show(this, "A color table file already exists in this PCK and a new one cannot be created.", "Operation aborted");
|
||||
return;
|
||||
}
|
||||
PckFileData newColorFile = currentPCK.CreateNewFile("colours.col", PckFileType.ColourTableFile);
|
||||
@@ -2038,11 +2064,11 @@ namespace PckStudio
|
||||
SaveFileDialog saveFileDialog = new SaveFileDialog();
|
||||
saveFileDialog.Filter = "3DS Texture|*.3dst";
|
||||
saveFileDialog.DefaultExt = ".3dst";
|
||||
if (saveFileDialog.ShowDialog() == DialogResult.OK)
|
||||
if (saveFileDialog.ShowDialog(this) == DialogResult.OK)
|
||||
{
|
||||
Image img = file.GetTexture();
|
||||
var writer = new _3DSTextureWriter(img);
|
||||
writer.WriteToFile(saveFileDialog.FileName);
|
||||
writer.WriteToFile(saveFileDialog.FileName);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2090,7 +2116,7 @@ namespace PckStudio
|
||||
{
|
||||
if (currentPCK.TryGetFile("Skins.pck", PckFileType.SkinDataFile, out _))
|
||||
{
|
||||
MessageBox.Show("A Skins.pck file already exists in this PCK and a new one cannot be created.", "Operation aborted");
|
||||
MessageBox.Show(this, "A Skins.pck file already exists in this PCK and a new one cannot be created.", "Operation aborted");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2139,14 +2165,14 @@ namespace PckStudio
|
||||
ofd.Filter = "All files (*.*)|*.*";
|
||||
ofd.Multiselect = false;
|
||||
|
||||
if (ofd.ShowDialog() == DialogResult.OK)
|
||||
if (ofd.ShowDialog(this) == DialogResult.OK)
|
||||
{
|
||||
using AddFilePrompt diag = new AddFilePrompt("res/" + Path.GetFileName(ofd.FileName));
|
||||
if (diag.ShowDialog(this) == DialogResult.OK)
|
||||
{
|
||||
if (currentPCK.Contains(diag.Filepath, diag.Filetype))
|
||||
{
|
||||
MessageBox.Show($"'{diag.Filepath}' of type {diag.Filetype} already exists.", "Import failed", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||||
MessageBox.Show(this, $"'{diag.Filepath}' of type {diag.Filetype} already exists.", "Import failed", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
PckFileData file = currentPCK.CreateNewFile(diag.Filepath, diag.Filetype, () => File.ReadAllBytes(ofd.FileName));
|
||||
@@ -2164,7 +2190,7 @@ namespace PckStudio
|
||||
{
|
||||
if (currentPCK.TryGetFile("behaviours.bin", PckFileType.BehavioursFile, out _))
|
||||
{
|
||||
MessageBox.Show("A behaviours file already exists in this PCK and a new one cannot be created.", "Operation aborted");
|
||||
MessageBox.Show(this, "A behaviours file already exists in this PCK and a new one cannot be created.", "Operation aborted");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2176,7 +2202,7 @@ namespace PckStudio
|
||||
{
|
||||
if (currentPCK.TryGetFile("entityMaterials.bin", PckFileType.MaterialFile, out _))
|
||||
{
|
||||
MessageBox.Show("A behaviours file already exists in this PCK and a new one cannot be created.", "Operation aborted");
|
||||
MessageBox.Show(this, "A behaviours file already exists in this PCK and a new one cannot be created.", "Operation aborted");
|
||||
return;
|
||||
}
|
||||
currentPCK.CreateNewFile("entityMaterials.bin", PckFileType.MaterialFile, MaterialResources.MaterialsFileInitializer);
|
||||
@@ -2198,7 +2224,7 @@ namespace PckStudio
|
||||
};
|
||||
if (!PckManager.Visible)
|
||||
{
|
||||
PckManager.Show();
|
||||
PckManager.Show(this);
|
||||
PckManager.BringToFront();
|
||||
}
|
||||
if (PckManager.Focus())
|
||||
@@ -2213,9 +2239,24 @@ namespace PckStudio
|
||||
Filter = "WAV files (*.wav)|*.wav",
|
||||
Title = "Please choose WAV files to convert to BINKA"
|
||||
};
|
||||
if (fileDialog.ShowDialog() == DialogResult.OK)
|
||||
if (fileDialog.ShowDialog(this) == DialogResult.OK)
|
||||
{
|
||||
BinkaConverter.ToBinka(fileDialog.FileNames, new DirectoryInfo(Path.GetDirectoryName(fileDialog.FileName)));
|
||||
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)
|
||||
{
|
||||
BinkaConverter.ToBinka(
|
||||
fileDialog.FileNames,
|
||||
new DirectoryInfo(Path.GetDirectoryName(fileDialog.FileName)),
|
||||
dialog.SelectedIndex + 1 // compression level
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2227,7 +2268,7 @@ namespace PckStudio
|
||||
Filter = "BINKA files (*.binka)|*.binka",
|
||||
Title = "Please choose BINKA files to convert to WAV"
|
||||
};
|
||||
if (fileDialog.ShowDialog() == DialogResult.OK)
|
||||
if (fileDialog.ShowDialog(this) == DialogResult.OK)
|
||||
{
|
||||
BinkaConverter.ToWav(fileDialog.FileNames, new DirectoryInfo(Path.GetDirectoryName(fileDialog.FileName)));
|
||||
}
|
||||
@@ -2283,7 +2324,7 @@ namespace PckStudio
|
||||
Program.UpdateToLatest("Would you like to download it?", MessageBoxButtons.YesNo, MessageBoxIcon.Question, DialogResult.Yes);
|
||||
return;
|
||||
}
|
||||
MessageBox.Show("Already up to date.", "No update available");
|
||||
MessageBox.Show(this, "Already up to date.", "No update available");
|
||||
}
|
||||
|
||||
[Obsolete] // the move functions are to eventually be removed in favor of drag and drop
|
||||
@@ -2311,21 +2352,28 @@ namespace PckStudio
|
||||
|
||||
int index = pck.IndexOfFile(file);
|
||||
|
||||
if (index + amount < 0 || index + amount > pck.FileCount) return;
|
||||
pck.RemoveFile(file);
|
||||
pck.InsertFile(index + amount, file);
|
||||
try
|
||||
{
|
||||
if (index + amount < 0 || index + amount > pck.FileCount) return;
|
||||
pck.RemoveFile(file);
|
||||
pck.InsertFile(index + amount, file);
|
||||
|
||||
if (IsSubPCK)
|
||||
{
|
||||
using (var stream = new MemoryStream())
|
||||
if (IsSubPCK)
|
||||
{
|
||||
var writer = new PckFileWriter(pck, LittleEndianCheckBox.Checked ? OMI.Endianness.LittleEndian : OMI.Endianness.BigEndian);
|
||||
writer.WriteToStream(stream);
|
||||
(GetSubPCK(path).Tag as PckFileData).SetData(stream.ToArray());
|
||||
using (var stream = new MemoryStream())
|
||||
{
|
||||
var writer = new PckFileWriter(pck, LittleEndianCheckBox.Checked ? OMI.Endianness.LittleEndian : OMI.Endianness.BigEndian);
|
||||
writer.WriteToStream(stream);
|
||||
(GetSubPCK(path).Tag as PckFileData).SetData(stream.ToArray());
|
||||
}
|
||||
}
|
||||
BuildMainTreeView();
|
||||
wasModified = true;
|
||||
}
|
||||
BuildMainTreeView();
|
||||
wasModified = true;
|
||||
catch(Exception ex)
|
||||
{
|
||||
MessageBox.Show(this, "Can't move file under or above a folder");
|
||||
}
|
||||
}
|
||||
[Obsolete]
|
||||
private void moveUpToolStripMenuItem_Click(object sender, EventArgs e) => moveFile(-1);
|
||||
|
||||
@@ -58,6 +58,7 @@ namespace PckStudio
|
||||
{
|
||||
bool updateAvailable = Updater.IsUpdateAvailable(Application.ProductVersion);
|
||||
if (updateAvailable && MessageBox.Show(
|
||||
MainInstance ?? null,
|
||||
"New update available.\n" +
|
||||
message,
|
||||
"Update Available",
|
||||
|
||||
Reference in New Issue
Block a user