From e13993de9b51b6a899fbe438c722e33548a6f6dc Mon Sep 17 00:00:00 2001 From: Kelsi Date: Thu, 12 Mar 2026 00:16:35 -0700 Subject: [PATCH] Add 'Add to Action Bar' option to spellbook right-click context menu --- src/ui/spellbook_screen.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/ui/spellbook_screen.cpp b/src/ui/spellbook_screen.cpp index c2514e22..e2c81756 100644 --- a/src/ui/spellbook_screen.cpp +++ b/src/ui/spellbook_screen.cpp @@ -687,6 +687,19 @@ void SpellbookScreen::render(game::GameHandler& gameHandler, pipeline::AssetMana } if (onCooldown) ImGui::EndDisabled(); } + if (!isPassive) { + if (ImGui::MenuItem("Add to Action Bar")) { + const auto& bar = gameHandler.getActionBar(); + int firstEmpty = -1; + for (int si = 0; si < game::GameHandler::SLOTS_PER_BAR; ++si) { + if (bar[si].isEmpty()) { firstEmpty = si; break; } + } + if (firstEmpty >= 0) { + gameHandler.setActionBarSlot(firstEmpty, + game::ActionBarSlot::SPELL, info->spellId); + } + } + } if (ImGui::MenuItem("Copy Spell Link")) { char linkBuf[256]; snprintf(linkBuf, sizeof(linkBuf),