diff --git a/GW2Radial/common b/GW2Radial/common index 3e778aa..d26e3dd 160000 --- a/GW2Radial/common +++ b/GW2Radial/common @@ -1 +1 @@ -Subproject commit 3e778aac0dc9f11a197111d937098b3a25a4cbcc +Subproject commit d26e3dd6a63fe6c507e5cb75c855077e2875a49e diff --git a/GW2Radial/include/Wheel.h b/GW2Radial/include/Wheel.h index cfc63cc..91b31e7 100644 --- a/GW2Radial/include/Wheel.h +++ b/GW2Radial/include/Wheel.h @@ -23,10 +23,11 @@ class Wheel : public SettingsMenu::Implementer enum class BehaviorBeforeDelay : int { - NOTHING = 0, - PREVIOUS = 1, - FAVORITE = 2, - DIRECTION = 3 + NOTHING = 0, + PREVIOUS = 1, + FAVORITE = 2, + DIRECTION = 3, + PASS_TO_GAME = 4 }; Wheel(std::shared_ptr bgTexture, std::string nickname, std::string displayName); diff --git a/GW2Radial/include/WheelElement.h b/GW2Radial/include/WheelElement.h index 7efc723..151bfd8 100644 --- a/GW2Radial/include/WheelElement.h +++ b/GW2Radial/include/WheelElement.h @@ -49,11 +49,11 @@ inline bool IsUsable(ConditionalState cs, ConditionalProperties cp) { if (isNone(cs) && isNone(cp & ConditionalProperties::USABLE_DEFAULT)) return false; + if (notNone(cs & ConditionalState::IN_WVW) && isNone(cp & ConditionalProperties::USABLE_WVW)) + return false; if (notNone(cs & ConditionalState::IN_COMBAT) && isNone(cp & ConditionalProperties::USABLE_IN_COMBAT)) return false; - if (notNone(cs & ConditionalState::IN_WVW) && isNone(cp & ConditionalProperties::USABLE_WVW)) - return false; if (notNone(cs & ConditionalState::UNDERWATER) && isNone(cp & ConditionalProperties::USABLE_UNDERWATER)) return false; if (notNone(cs & ConditionalState::ON_WATER) && isNone(cp & ConditionalProperties::USABLE_ON_WATER)) @@ -66,11 +66,11 @@ inline bool IsVisible(ConditionalState cs, ConditionalProperties cp) { if (isNone(cs) && isNone(cp & ConditionalProperties::VISIBLE_DEFAULT)) return false; + if (notNone(cs & ConditionalState::IN_WVW) && isNone(cp & ConditionalProperties::VISIBLE_WVW)) + return false; if (notNone(cs & ConditionalState::IN_COMBAT) && isNone(cp & ConditionalProperties::VISIBLE_IN_COMBAT)) return false; - if (notNone(cs & ConditionalState::IN_WVW) && isNone(cp & ConditionalProperties::VISIBLE_WVW)) - return false; if (notNone(cs & ConditionalState::UNDERWATER) && isNone(cp & ConditionalProperties::VISIBLE_UNDERWATER)) return false; if (notNone(cs & ConditionalState::ON_WATER) && isNone(cp & ConditionalProperties::VISIBLE_ON_WATER)) diff --git a/GW2Radial/src/Wheel.cpp b/GW2Radial/src/Wheel.cpp index 7a1c7a6..99d3f3a 100644 --- a/GW2Radial/src/Wheel.cpp +++ b/GW2Radial/src/Wheel.cpp @@ -278,9 +278,12 @@ void Wheel::DrawMenu(Keybind** currentEditedKeybind) ImGuiConfigurationWrapper(rb, "Favorite##ReleaseBeforeDelay", behaviorOnReleaseBeforeDelay_, int(BehaviorBeforeDelay::FAVORITE)); ImGui::SameLine(); ImGuiConfigurationWrapper(rb, "As if opened##ReleaseBeforeDelay", behaviorOnReleaseBeforeDelay_, int(BehaviorBeforeDelay::DIRECTION)); + ImGui::SameLine(); + ImGuiConfigurationWrapper(rb, "Pass to game##ReleaseBeforeDelay", behaviorOnReleaseBeforeDelay_, int(BehaviorBeforeDelay::PASS_TO_GAME)); ImGuiHelpTooltip( "Determines the behavior of the menu if it is dismissed before it becomes visible. By default, it does nothing, but it can also (1) trigger the last selected item; " - "(2) trigger a fixed \"favorite\" option; (3) function exactly as if the menu was opened, making it possible to select an item with the mouse without seeing them."); + "(2) trigger a fixed \"favorite\" option; (3) function exactly as if the menu was opened, making it possible to select an item with the mouse without seeing them; " + "(4) forward the input to the game."); if (BehaviorBeforeDelay(behaviorOnReleaseBeforeDelay_.value()) == BehaviorBeforeDelay::FAVORITE) { @@ -989,7 +992,6 @@ void Wheel::DeactivateWheel() ResetConditionallyDelayed(true); return; } - // If keybind release was done before the wheel is visible, check our behavior if (currentTriggerTime_ + displayDelayOption_.value() > TimeInMilliseconds()) { @@ -1008,6 +1010,11 @@ void Wheel::DeactivateWheel() if (!currentHovered_) currentHovered_ = GetCenterHoveredElement(); break; + case BehaviorBeforeDelay::PASS_TO_GAME: + bool centerKeybind = currentPosition_.x == 0.5f && currentPosition_.y == 0.5f; + Input::i().SendKeybind((centerKeybind ? centralKeybind_ : keybind_).keyCombo()); + currentHovered_ = nullptr; + break; } } else if (!currentHovered_)