mirror of
https://github.com/jie65535/GrasscutterCommandGenerator.git
synced 2025-06-08 23:19:14 +08:00
Fix the command is cleared after repeated
This commit is contained in:
parent
2dc8dc734b
commit
f4fc0ef3c5
@ -208,12 +208,11 @@ namespace GrasscutterTools.Forms
|
|||||||
{
|
{
|
||||||
Logger.I(TAG, $"SetCommand(\"{command}\")");
|
Logger.I(TAG, $"SetCommand(\"{command}\")");
|
||||||
var oldCommand = CmbCommand.Text;
|
var oldCommand = CmbCommand.Text;
|
||||||
CmbCommand.Text = (ModifierKeys == Keys.Shift) ?
|
if (ModifierKeys == Keys.Shift && !string.IsNullOrEmpty(oldCommand))
|
||||||
(string.IsNullOrEmpty(oldCommand) ? command : $"{oldCommand} | {command}")
|
command = $"{oldCommand} | {command}";
|
||||||
: command;
|
AddCommandToList(command);
|
||||||
if (ChkAutoCopy.Checked)
|
if (ChkAutoCopy.Checked)
|
||||||
CopyCommand();
|
CopyCommand();
|
||||||
AddCommandToList(command);
|
|
||||||
|
|
||||||
if (ModifierKeys == Keys.Control)
|
if (ModifierKeys == Keys.Control)
|
||||||
{
|
{
|
||||||
@ -233,12 +232,12 @@ namespace GrasscutterTools.Forms
|
|||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(command))
|
if (string.IsNullOrEmpty(command))
|
||||||
command = CmbCommand.Text;
|
command = CmbCommand.Text;
|
||||||
if (!string.IsNullOrEmpty(command))
|
if (string.IsNullOrEmpty(command))
|
||||||
{
|
return;
|
||||||
if (CmbCommand.Items.Count > 19)
|
if (CmbCommand.Items.Count > 19)
|
||||||
CmbCommand.Items.RemoveAt(0);
|
CmbCommand.Items.RemoveAt(0);
|
||||||
CmbCommand.Items.Add(command);
|
CmbCommand.Items.Add(command);
|
||||||
}
|
CmbCommand.SelectedIndex = CmbCommand.Items.Count - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
Loading…
Reference in New Issue
Block a user