mirror of
https://mirror.ghproxy.com/https://github.com/dexyfex/CodeWalker
synced 2024-11-22 15:02:54 +08:00
Enabled onim export function on YcdForm
This commit is contained in:
parent
cd4eee4dc5
commit
cad632ba6f
@ -46,7 +46,30 @@ namespace CodeWalker.Forms
|
||||
|
||||
private void ExportOnim_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (MainListView.SelectedItems[0].Tag is Animation anim)
|
||||
{
|
||||
var saveFileDialog = new SaveFileDialog();
|
||||
|
||||
string newfn = $"{Path.GetFileNameWithoutExtension(Ycd.Name)}_{MainListView.SelectedItems[0].Text}.onim";
|
||||
|
||||
saveFileDialog.FileName = newfn;
|
||||
if (saveFileDialog.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
string path = saveFileDialog.FileName;
|
||||
|
||||
try
|
||||
{
|
||||
using (var file = File.OpenWrite(path))
|
||||
{
|
||||
Ycd.SaveOpenFormatsAnimation(anim, file);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show("Error saving file " + path + ":\n" + ex.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateFormTitle()
|
||||
|
Loading…
Reference in New Issue
Block a user