mirror of
https://github.com/jie65535/GrasscutterCommandGenerator.git
synced 2025-06-07 22:59:14 +08:00
Impl hold shift run command (#151)
Impl main window input box accept enter (#150)
This commit is contained in:
parent
277e265bf1
commit
92a15afabf
@ -421,6 +421,7 @@ namespace GrasscutterTools.Forms
|
|||||||
//
|
//
|
||||||
resources.ApplyResources(this.TxtCommand, "TxtCommand");
|
resources.ApplyResources(this.TxtCommand, "TxtCommand");
|
||||||
this.TxtCommand.Name = "TxtCommand";
|
this.TxtCommand.Name = "TxtCommand";
|
||||||
|
this.TxtCommand.KeyDown += new System.Windows.Forms.KeyEventHandler(this.TxtCommand_KeyDown);
|
||||||
//
|
//
|
||||||
// BtnCopy
|
// BtnCopy
|
||||||
//
|
//
|
||||||
@ -603,6 +604,7 @@ namespace GrasscutterTools.Forms
|
|||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
0});
|
0});
|
||||||
|
this.NUDRemotePlayerId.KeyDown += new System.Windows.Forms.KeyEventHandler(this.NUDRemotePlayerId_KeyDown);
|
||||||
//
|
//
|
||||||
// BtnConnectOpenCommand
|
// BtnConnectOpenCommand
|
||||||
//
|
//
|
||||||
@ -642,6 +644,7 @@ namespace GrasscutterTools.Forms
|
|||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
0});
|
0});
|
||||||
|
this.NUDVerificationCode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.NUDVerificationCode_KeyDown);
|
||||||
//
|
//
|
||||||
// LblRemotePlayerId
|
// LblRemotePlayerId
|
||||||
//
|
//
|
||||||
@ -669,6 +672,7 @@ namespace GrasscutterTools.Forms
|
|||||||
//
|
//
|
||||||
resources.ApplyResources(this.TxtToken, "TxtToken");
|
resources.ApplyResources(this.TxtToken, "TxtToken");
|
||||||
this.TxtToken.Name = "TxtToken";
|
this.TxtToken.Name = "TxtToken";
|
||||||
|
this.TxtToken.KeyDown += new System.Windows.Forms.KeyEventHandler(this.TxtToken_KeyDown);
|
||||||
//
|
//
|
||||||
// LblToken
|
// LblToken
|
||||||
//
|
//
|
||||||
@ -684,6 +688,7 @@ namespace GrasscutterTools.Forms
|
|||||||
//
|
//
|
||||||
resources.ApplyResources(this.TxtHost, "TxtHost");
|
resources.ApplyResources(this.TxtHost, "TxtHost");
|
||||||
this.TxtHost.Name = "TxtHost";
|
this.TxtHost.Name = "TxtHost";
|
||||||
|
this.TxtHost.KeyDown += new System.Windows.Forms.KeyEventHandler(this.TxtHost_KeyDown);
|
||||||
//
|
//
|
||||||
// BtnQueryServerStatus
|
// BtnQueryServerStatus
|
||||||
//
|
//
|
||||||
@ -2626,6 +2631,7 @@ namespace GrasscutterTools.Forms
|
|||||||
//
|
//
|
||||||
resources.ApplyResources(this.TxtCustomName, "TxtCustomName");
|
resources.ApplyResources(this.TxtCustomName, "TxtCustomName");
|
||||||
this.TxtCustomName.Name = "TxtCustomName";
|
this.TxtCustomName.Name = "TxtCustomName";
|
||||||
|
this.TxtCustomName.KeyDown += new System.Windows.Forms.KeyEventHandler(this.TxtCustomName_KeyDown);
|
||||||
//
|
//
|
||||||
// TPHome
|
// TPHome
|
||||||
//
|
//
|
||||||
|
@ -425,6 +425,14 @@ namespace GrasscutterTools.Forms
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 自定义命令文本框回车时触发
|
||||||
|
/// </summary>
|
||||||
|
private void TxtCustomName_KeyDown(object sender, KeyEventArgs e)
|
||||||
|
{
|
||||||
|
if (e.KeyCode == Keys.Enter) BtnSaveCustomCommand_Click(BtnSaveCustomCommand, e);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 点击保存自定义命令列表时触发
|
/// 点击保存自定义命令列表时触发
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -1938,11 +1946,19 @@ namespace GrasscutterTools.Forms
|
|||||||
/// <param name="command">命令</param>
|
/// <param name="command">命令</param>
|
||||||
private void SetCommand(string command)
|
private void SetCommand(string command)
|
||||||
{
|
{
|
||||||
|
var oldCommand = TxtCommand.Text;
|
||||||
TxtCommand.Text = command;
|
TxtCommand.Text = command;
|
||||||
if (ChkAutoCopy.Checked)
|
if (ChkAutoCopy.Checked)
|
||||||
CopyCommand();
|
CopyCommand();
|
||||||
if (ModifierKeys == Keys.Control)
|
if (ModifierKeys == Keys.Shift)
|
||||||
|
{
|
||||||
OnOpenCommandInvoke();
|
OnOpenCommandInvoke();
|
||||||
|
TxtCommand.Text = oldCommand;
|
||||||
|
}
|
||||||
|
else if (ModifierKeys == Keys.Control)
|
||||||
|
{
|
||||||
|
OnOpenCommandInvoke();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -1976,6 +1992,14 @@ namespace GrasscutterTools.Forms
|
|||||||
Clipboard.SetText(TxtCommand.Text);
|
Clipboard.SetText(TxtCommand.Text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 在命令行内按下回车时直接执行
|
||||||
|
/// </summary>
|
||||||
|
private void TxtCommand_KeyDown(object sender, KeyEventArgs e)
|
||||||
|
{
|
||||||
|
if (e.KeyCode == Keys.Enter) OnOpenCommandInvoke();
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 开放命令执行时触发
|
/// 开放命令执行时触发
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -1990,15 +2014,16 @@ namespace GrasscutterTools.Forms
|
|||||||
private async void BtnInvokeOpenCommand_Click(object sender, EventArgs e)
|
private async void BtnInvokeOpenCommand_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (!BtnInvokeOpenCommand.Enabled) return;
|
if (!BtnInvokeOpenCommand.Enabled) return;
|
||||||
if (TxtCommand.Text.Length < 2)
|
var cmd = TxtCommand.Text;
|
||||||
|
if (cmd.Length < 2)
|
||||||
{
|
{
|
||||||
ShowTip(Resources.CommandContentCannotBeEmpty, TxtCommand);
|
ShowTip(Resources.CommandContentCannotBeEmpty, TxtCommand);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (TxtCommand.Text.IndexOf('|') == -1)
|
if (cmd.IndexOf('|') == -1)
|
||||||
await RunCommands(FormatCommand(TxtCommand.Text));
|
await RunCommands(FormatCommand(cmd));
|
||||||
else
|
else
|
||||||
await RunCommands(TxtCommand.Text.Split('|').Select(it => FormatCommand(it)).ToArray());
|
await RunCommands(cmd.Split('|').Select(it => FormatCommand(it)).ToArray());
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -2267,7 +2292,15 @@ namespace GrasscutterTools.Forms
|
|||||||
else
|
else
|
||||||
LblPlayerCount.Text = status.PlayerCount.ToString();
|
LblPlayerCount.Text = status.PlayerCount.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 输入服务器地址按下回车时触发
|
||||||
|
/// </summary>
|
||||||
|
private void TxtHost_KeyDown(object sender, KeyEventArgs e)
|
||||||
|
{
|
||||||
|
if (e.KeyCode == Keys.Enter) BtnQueryServerStatus_Click(BtnQueryServerStatus, e);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 点击查询服务器状态按钮时触发
|
/// 点击查询服务器状态按钮时触发
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -2313,6 +2346,14 @@ namespace GrasscutterTools.Forms
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 玩家ID输入框按下回车时触发
|
||||||
|
/// </summary>
|
||||||
|
private void NUDRemotePlayerId_KeyDown(object sender, KeyEventArgs e)
|
||||||
|
{
|
||||||
|
if (e.KeyCode == Keys.Enter) BtnSendVerificationCode_Click(BtnSendVerificationCode, e);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 点击发送校验码按钮时触发
|
/// 点击发送校验码按钮时触发
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -2347,6 +2388,14 @@ namespace GrasscutterTools.Forms
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 验证码输入框按下回车时触发
|
||||||
|
/// </summary>
|
||||||
|
private void NUDVerificationCode_KeyDown(object sender, KeyEventArgs e)
|
||||||
|
{
|
||||||
|
if (e.KeyCode == Keys.Enter) BtnConnectOpenCommand_Click(BtnConnectOpenCommand, e);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 点击连接到开放命令按钮时触发
|
/// 点击连接到开放命令按钮时触发
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -2375,6 +2424,14 @@ namespace GrasscutterTools.Forms
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Token 输入框按下回车时触发
|
||||||
|
/// </summary>
|
||||||
|
private void TxtToken_KeyDown(object sender, KeyEventArgs e)
|
||||||
|
{
|
||||||
|
if (e.KeyCode == Keys.Enter) BtnConsoleConnect_Click(BtnConsoleConnect, e);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 点击控制台连接按钮时触发
|
/// 点击控制台连接按钮时触发
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user