Implement drop editor functions

This commit is contained in:
2022-10-26 23:30:57 +08:00
parent 74613a809d
commit 7d19876072
5 changed files with 236 additions and 46 deletions

View File

@@ -432,14 +432,14 @@ namespace GrasscutterTools.Forms
{
lnk.Tag = command;
CustomCommandsChanged = true;
await ButtonComplete(BtnSaveCustomCommand);
await UIUtil.ButtonComplete(BtnSaveCustomCommand);
return;
}
}
CustomCommandsChanged = true;
AddCustomCommand(name, command);
await ButtonComplete(BtnSaveCustomCommand);
await UIUtil.ButtonComplete(BtnSaveCustomCommand);
}
/// <summary>
@@ -479,7 +479,7 @@ namespace GrasscutterTools.Forms
CustomCommandsChanged = true;
//TxtCustomName.Text = "";
//TxtCommand.Text = "";
await ButtonComplete(BtnRemoveCustomCommand);
await UIUtil.ButtonComplete(BtnRemoveCustomCommand);
return;
}
}
@@ -1482,7 +1482,7 @@ namespace GrasscutterTools.Forms
private async void BtnCopy_Click(object sender, EventArgs e)
{
CopyCommand();
await ButtonComplete(BtnCopy);
await UIUtil.ButtonComplete(BtnCopy);
}
/// <summary>
@@ -1620,21 +1620,6 @@ namespace GrasscutterTools.Forms
#region - General -
/// <summary>
/// 播放按钮完成动画
/// </summary>
/// <param name="btn"></param>
/// <returns></returns>
private async Task ButtonComplete(Button btn)
{
var t = btn.Text;
btn.Text = "√";
btn.Enabled = false;
await Task.Delay(300);
btn.Text = t;
btn.Enabled = true;
}
/// <summary>
/// 窗口按键按下时触发
/// </summary>