mirror of
https://github.com/babalae/better-genshin-impact
synced 2025-01-08 11:57:53 +08:00
mod: 替换为使用扩展方法,不直接调用SimulateKeyHelper
This commit is contained in:
parent
6d430429f7
commit
68d6cb18ef
@ -21,7 +21,7 @@ public static class InputSimulatorExtension
|
||||
/// <param name="type">按键类型</param>
|
||||
public static void SimulateAction(this InputSimulator self, GIActions action, KeyType type = KeyType.KeyPress)
|
||||
{
|
||||
var key = SimulateKeyHelper.GetActionKey(action);
|
||||
var key = action.ToActionKey();
|
||||
switch (type)
|
||||
{
|
||||
case KeyType.KeyPress:
|
||||
|
@ -20,7 +20,7 @@ public static class PostMessageSimulatorExtension
|
||||
/// <param name="type">按键类型</param>
|
||||
public static PostMessageSimulator SimulateAction(this PostMessageSimulator self, GIActions action, KeyType type = KeyType.KeyPress)
|
||||
{
|
||||
var key = SimulateKeyHelper.GetActionKey(action);
|
||||
var key = action.ToActionKey();
|
||||
switch (type)
|
||||
{
|
||||
case KeyType.KeyPress:
|
||||
@ -122,7 +122,7 @@ public static class PostMessageSimulatorExtension
|
||||
/// <param name="type">按键类型</param>
|
||||
public static PostMessageSimulator SimulateActionBackground(this PostMessageSimulator self, GIActions action, KeyType type = KeyType.KeyPress)
|
||||
{
|
||||
var key = SimulateKeyHelper.GetActionKey(action);
|
||||
var key = action.ToActionKey();
|
||||
switch (type)
|
||||
{
|
||||
case KeyType.KeyPress:
|
||||
|
@ -524,19 +524,19 @@ public class Avatar
|
||||
User32.VK vk = User32.VK.VK_NONAME;
|
||||
if (key == "w")
|
||||
{
|
||||
vk = SimulateKeyHelper.GetActionKey(GIActions.MoveForward).ToVK();
|
||||
vk = GIActions.MoveForward.ToActionKey().ToVK();
|
||||
}
|
||||
else if (key == "s")
|
||||
{
|
||||
vk = SimulateKeyHelper.GetActionKey(GIActions.MoveBackward).ToVK();
|
||||
vk = GIActions.MoveBackward.ToActionKey().ToVK();
|
||||
}
|
||||
else if (key == "a")
|
||||
{
|
||||
vk = SimulateKeyHelper.GetActionKey(GIActions.MoveLeft).ToVK();
|
||||
vk = GIActions.MoveLeft.ToActionKey().ToVK();
|
||||
}
|
||||
else if (key == "d")
|
||||
{
|
||||
vk = SimulateKeyHelper.GetActionKey(GIActions.MoveRight).ToVK();
|
||||
vk = GIActions.MoveRight.ToActionKey().ToVK();
|
||||
}
|
||||
|
||||
if (vk == User32.VK.VK_NONAME)
|
||||
|
@ -81,8 +81,8 @@ public class PickAroundHandler() : IActionHandler
|
||||
double y = oldRadius * Math.Sin(angle);
|
||||
Simulation.SendInput.Mouse.MiddleButtonClick();
|
||||
await Delay(500, _ct);
|
||||
await MoveAfterTurn(SimulateKeyHelper.GetActionKey(GIActions.MoveBackward).ToVK(), (int)Math.Round(y) + 200);
|
||||
await MoveAfterTurn(SimulateKeyHelper.GetActionKey(GIActions.MoveLeft).ToVK(), (int)Math.Round(x));
|
||||
await MoveAfterTurn(GIActions.MoveBackward.ToActionKey().ToVK(), (int)Math.Round(y) + 200);
|
||||
await MoveAfterTurn(GIActions.MoveLeft.ToActionKey().ToVK(), (int)Math.Round(x));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user