Conditionally disable some UI buttons
authorLiza Carvelli <liza@carvel.li>
Fri, 16 Aug 2024 20:34:59 +0000 (22:34 +0200)
committerLiza Carvelli <liza@carvel.li>
Fri, 16 Aug 2024 20:34:59 +0000 (22:34 +0200)
Questionable/Windows/QuestComponents/CreationUtilsComponent.cs

index 52bcd65926adf3f8ffcf529400f42157f4b287e0..33fa831c82ad128f58b6c7297e464ce1acde9464 100644 (file)
@@ -148,7 +148,7 @@ internal sealed class CreationUtilsComponent
             ImGui.SameLine();
             ImGui.Text($"QM: {gameObject->NamePlateIconId}");
 
-            ImGui.BeginDisabled(!_movementController.IsNavmeshReady);
+            ImGui.BeginDisabled(!_movementController.IsNavmeshReady || _gameFunctions.IsOccupied());
             if (!_movementController.IsPathfinding)
             {
                 if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Bullseye, "To Target"))
@@ -177,6 +177,7 @@ internal sealed class CreationUtilsComponent
 
             ImGui.EndDisabled();
 
+            ImGui.BeginDisabled(_gameFunctions.IsOccupied());
             ImGui.SameLine();
             bool interact = ImGuiComponents.IconButton(FontAwesomeIcon.MousePointer);
             if (ImGui.IsItemHovered())
@@ -187,7 +188,7 @@ internal sealed class CreationUtilsComponent
                     (GameObject*)_targetManager.Target.Address, false);
                 _logger.LogInformation("XXXXX Interaction Result: {Result}", result);
             }
-
+            ImGui.EndDisabled();
             ImGui.SameLine();
 
             bool copy = ImGuiComponents.IconButton(FontAwesomeIcon.Copy);