Fix KeyState checks

pull/3/head v5.1
Liza 2024-07-12 19:54:03 +02:00
parent 70b69b786e
commit 92f6c9bc8a
Signed by: liza
GPG Key ID: 7199F8D727D55F67
3 changed files with 5 additions and 3 deletions

View File

@ -1,6 +1,6 @@
<Project Sdk="Dalamud.NET.Sdk/9.0.2">
<PropertyGroup>
<Version>5.0</Version>
<Version>5.1</Version>
<OutputPath>dist</OutputPath>
</PropertyGroup>

View File

@ -2,6 +2,7 @@
using System.Linq;
using Dalamud.Game.Addon.Lifecycle;
using Dalamud.Game.Addon.Lifecycle.AddonArgTypes;
using Dalamud.Game.ClientState.Keys;
using Dalamud.Game.Text.SeStringHandling;
using Deliveroo.GameData;
using FFXIVClientStructs.FFXIV.Client.UI;
@ -13,7 +14,7 @@ partial class DeliverooPlugin
{
private unsafe void GrandCompanySupplyRewardPostSetup(AddonEvent type, AddonArgs args)
{
bool quickTurnIn = CurrentStage == Stage.Stopped && _keyState[_configuration.QuickTurnInKey];
bool quickTurnIn = CurrentStage == Stage.Stopped && _configuration.QuickTurnInKey != VirtualKey.NO_KEY && _keyState[_configuration.QuickTurnInKey];
if (CurrentStage == Stage.TurnInSelected || quickTurnIn)
{
AddonGrandCompanySupplyReward* addonSupplyReward = (AddonGrandCompanySupplyReward*)args.Addon;

View File

@ -1,6 +1,7 @@
using System;
using Dalamud.Game.Addon.Lifecycle;
using Dalamud.Game.Addon.Lifecycle.AddonArgTypes;
using Dalamud.Game.ClientState.Keys;
using Dalamud.Memory;
using FFXIVClientStructs.FFXIV.Client.UI;
@ -40,7 +41,7 @@ partial class DeliverooPlugin
CurrentStage = Stage.CloseGcExchange;
ContinueAt = DateTime.Now.AddSeconds(0.5);
}
else if ((CurrentStage == Stage.TurnInSelected || _keyState[_configuration.QuickTurnInKey]) &&
else if ((CurrentStage == Stage.TurnInSelected || (_configuration.QuickTurnInKey != VirtualKey.NO_KEY && _keyState[_configuration.QuickTurnInKey])) &&
_gameStrings.TradeHighQualityItem == text)
{
_pluginLog.Information($"Selecting 'yes' ({text})");