muffin v7.4.1
This commit is contained in:
parent
a4175abacd
commit
7ae14cf8b8
24 changed files with 2673 additions and 722 deletions
|
|
@ -94,18 +94,22 @@ internal static class Dive
|
|||
|
||||
private unsafe void Descend()
|
||||
{
|
||||
UIInputData.Keybind keybind = default(UIInputData.Keybind);
|
||||
byte* ptr = stackalloc byte[16];
|
||||
Utf8String* name = Utf8String.FromString("MOVE_DESCENT");
|
||||
UIInputData.Instance()->GetKeybindByName(name, (Keybind*)(&keybind));
|
||||
logger.LogInformation("Dive keybind: {Key1} + {Modifier1}, {Key2} + {Modifier2}", keybind.Key, keybind.Modifier, keybind.AltKey, keybind.AltModifier);
|
||||
UIInputData.Instance()->GetKeybindByName(name, (Keybind*)ptr);
|
||||
SeVirtualKey seVirtualKey = (SeVirtualKey)(*(uint*)ptr);
|
||||
byte b = ptr[4];
|
||||
SeVirtualKey seVirtualKey2 = (SeVirtualKey)((uint*)ptr)[2];
|
||||
byte b2 = ptr[12];
|
||||
logger.LogInformation("Dive keybind: {Key1} + {Modifier1}, {Key2} + {Modifier2}", seVirtualKey, b, seVirtualKey2, b2);
|
||||
int num = 2;
|
||||
List<List<nint>> list = new List<List<nint>>(num);
|
||||
CollectionsMarshal.SetCount(list, num);
|
||||
Span<List<nint>> span = CollectionsMarshal.AsSpan(list);
|
||||
int num2 = 0;
|
||||
span[num2] = GetKeysToPress(keybind.Key, keybind.Modifier);
|
||||
span[num2] = GetKeysToPress(seVirtualKey, b);
|
||||
num2++;
|
||||
span[num2] = GetKeysToPress(keybind.AltKey, keybind.AltModifier);
|
||||
span[num2] = GetKeysToPress(seVirtualKey2, b2);
|
||||
List<nint> list2 = (from x in list
|
||||
where x != null
|
||||
select (x)).MinBy((List<nint> x) => x.Count);
|
||||
|
|
@ -142,18 +146,18 @@ internal static class Dive
|
|||
public static extern nint SendMessage(nint hWnd, uint Msg, nint wParam, nint lParam);
|
||||
}
|
||||
|
||||
private static List<nint>? GetKeysToPress(SeVirtualKey key, ModifierFlag modifier)
|
||||
private static List<nint>? GetKeysToPress(SeVirtualKey key, byte modifier)
|
||||
{
|
||||
List<nint> list = new List<nint>();
|
||||
if (modifier.HasFlag(ModifierFlag.Ctrl))
|
||||
if ((modifier & 1) != 0)
|
||||
{
|
||||
list.Add(17);
|
||||
}
|
||||
if (modifier.HasFlag(ModifierFlag.Shift))
|
||||
if ((modifier & 2) != 0)
|
||||
{
|
||||
list.Add(16);
|
||||
}
|
||||
if (modifier.HasFlag(ModifierFlag.Alt))
|
||||
if ((modifier & 4) != 0)
|
||||
{
|
||||
list.Add(18);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue