Skip to content

Commit

Permalink
fix: Fixed hardcoded key press to use user's keybinding
Browse files Browse the repository at this point in the history
  • Loading branch information
Haato3o committed Feb 17, 2021
1 parent 0cbdd4b commit 56a0959
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
10 changes: 8 additions & 2 deletions DecorationSearch/Controls/SearchWidget.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
using HunterPie.GUI;
using HunterPie.Memory;
using System.Threading.Tasks;
using HunterPie.Core.Definitions;
using HunterPie.Logger;

namespace DecorationSearch.Controls
{
Expand Down Expand Up @@ -88,9 +90,13 @@ private static async void UpdateDecorationArray(sDecoration[] array)

if (Kernel.Write(decoArrayPtr, array))
{
await VirtualInput.PressKey('N');
sKeyConfig keyConfig = PlayerKeyboard.Get((MenuControls)28);

char vkey = keyConfig.MainKey == 0 ? (char)keyConfig.SubKey : (char)keyConfig.MainKey;

await VirtualInput.PressKey(vkey);
await Task.Delay(10);
await VirtualInput.PressKey('N');
await VirtualInput.PressKey(vkey);
}
}

Expand Down
3 changes: 2 additions & 1 deletion DecorationSearch/DecorationSearch.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,13 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>..\..\HunterPie\HunterPie\bin\x64\Debug\Modules\DecorationSearch\</OutputPath>
<OutputPath>..\..\HunterPie\HunterPie\bin\Debug\Modules\DecorationSearch\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>0</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
Expand Down
4 changes: 2 additions & 2 deletions DecorationSearch/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.2.0")]
[assembly: AssemblyFileVersion("1.0.2.0")]
[assembly: AssemblyVersion("1.0.3.0")]
[assembly: AssemblyFileVersion("1.0.3.0")]
2 changes: 2 additions & 0 deletions DecorationSearch/SearchPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
using HunterPie.Core.Events;
using HunterPie.GUI;
using HunterPie.Memory;
using HunterPie.Logger;
using HunterPie.Core.Input;

namespace DecorationSearch
{
Expand Down

0 comments on commit 56a0959

Please sign in to comment.