mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/PCK-Studio.git
synced 2026-06-28 05:45:38 +00:00
Add loading pck via terminal
This commit is contained in:
@@ -47,6 +47,17 @@ namespace PckStudio
|
||||
#endif
|
||||
}
|
||||
|
||||
public void LoadFromPath(string filepath)
|
||||
{
|
||||
currentPCK = openPck(filepath);
|
||||
if (currentPCK == null) return;
|
||||
if (addPasswordToolStripMenuItem.Enabled = checkForPassword())
|
||||
{
|
||||
LoadEditorTab();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void Form1_Load(object sender, EventArgs e)
|
||||
{
|
||||
RPC.Initialize();
|
||||
@@ -90,11 +101,7 @@ namespace PckStudio
|
||||
ofd.Filter = "PCK (Minecraft Console Package)|*.pck";
|
||||
if (ofd.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
currentPCK = openPck(ofd.FileName);
|
||||
if (currentPCK == null) return;
|
||||
if (addPasswordToolStripMenuItem.Enabled = checkForPassword())
|
||||
{
|
||||
LoadEditorTab();
|
||||
LoadFromPath(ofd.FileName);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2780,15 +2787,10 @@ namespace PckStudio
|
||||
|
||||
private void OpenPck_DragDrop(object sender, DragEventArgs e)
|
||||
{
|
||||
string[] FileList = (string[])e.Data.GetData(DataFormats.FileDrop, false);
|
||||
if (FileList.Length > 1)
|
||||
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");
|
||||
currentPCK = openPck(FileList[0]);
|
||||
if (currentPCK == null) return;
|
||||
if (addPasswordToolStripMenuItem.Enabled = checkForPassword())
|
||||
{
|
||||
LoadEditorTab();
|
||||
}
|
||||
LoadFromPath(Filepaths[0]);
|
||||
}
|
||||
|
||||
private void OpenPck_DragLeave(object sender, EventArgs e)
|
||||
|
||||
@@ -14,7 +14,10 @@ namespace PckStudio
|
||||
[STAThread]
|
||||
static void Main(string[] args)
|
||||
{
|
||||
Application.Run(new MainForm());
|
||||
var f = new MainForm();
|
||||
if (args.Length > 0 && args[0].EndsWith(".pck"))
|
||||
f.LoadFromPath(args[0]);
|
||||
Application.Run(f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user