Currently crafted item can now be cancelled even when not near a fabrication station

This commit is contained in:
Liza 2024-03-28 14:36:20 +01:00
parent 6c040389ac
commit 9ae2785fae
Signed by: liza
GPG Key ID: 7199F8D727D55F67
2 changed files with 7 additions and 7 deletions

View File

@ -107,8 +107,7 @@ internal sealed class MainWindow : LWindow
_checkInventory = !_checkInventory; _checkInventory = !_checkInventory;
ImGui.SameLine(); ImGui.SameLine();
ImGui.BeginDisabled(!NearFabricationStation); ImGui.BeginDisabled(!NearFabricationStation || !IsDiscipleOfHand);
ImGui.BeginDisabled(!IsDiscipleOfHand);
if (currentItem.StartedCrafting) if (currentItem.StartedCrafting)
{ {
if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Play, "Resume")) if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Play, "Resume"))
@ -129,7 +128,9 @@ internal sealed class MainWindow : LWindow
ImGui.EndDisabled(); ImGui.EndDisabled();
ImGui.SameLine(); ImGui.SameLine();
ImGui.BeginDisabled(!ImGui.GetIO().KeyCtrl);
bool keysHeld = ImGui.GetIO().KeyCtrl && ImGui.GetIO().KeyShift;
ImGui.BeginDisabled(!keysHeld);
if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Times, "Cancel")) if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Times, "Cancel"))
{ {
State = ButtonState.Pause; State = ButtonState.Pause;
@ -139,10 +140,9 @@ internal sealed class MainWindow : LWindow
} }
ImGui.EndDisabled(); ImGui.EndDisabled();
if (ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled) && !ImGui.GetIO().KeyCtrl) if (ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled) && !keysHeld)
ImGui.SetTooltip( ImGui.SetTooltip(
$"Hold CTRL to remove this as craft. You have to manually use the fabrication station to cancel or finish this craft before you can continue using the queue."); $"Hold CTRL+SHIFT to remove this as craft. You have to manually use the fabrication station to cancel or finish the workshop project before you can continue using the queue.");
ImGui.EndDisabled();
ShowErrorConditions(); ShowErrorConditions();
} }

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net8.0-windows</TargetFramework> <TargetFramework>net8.0-windows</TargetFramework>
<Version>5.2</Version> <Version>5.3</Version>
<LangVersion>11.0</LangVersion> <LangVersion>11.0</LangVersion>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies> <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>