From 8b3c826c1611f3cbab2cd9c8f61ec843bbb716ce Mon Sep 17 00:00:00 2001 From: devbox Date: Mon, 17 Aug 2026 08:04:35 +1000 Subject: [PATCH] Playerbot: fix role verb alias + BotGear addon frame build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - BotCommandParser: accept 'role' (addon verb) and 'role_all'/'roleall' as aliases for 'setrole'/'setrole_all' so the PlayerbotControl roster role menu works (was refused as unknown verb). - BotGear.lua: create frames/buttons with 'BackdropTemplate' so SetBackdrop doesn't throw (retail 11.x+ requirement) — /botgear did nothing because the frame build errored out. Also fix the goldText/bagScroll/bagContent locals being declared after first use. --- src/modules/PlayerbotV2/Addon/BotGear/BotGear.lua | 9 ++++----- src/modules/PlayerbotV2/Bot/BotCommandParser.cpp | 5 +++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/modules/PlayerbotV2/Addon/BotGear/BotGear.lua b/src/modules/PlayerbotV2/Addon/BotGear/BotGear.lua index 2808a3d631..969377e628 100644 --- a/src/modules/PlayerbotV2/Addon/BotGear/BotGear.lua +++ b/src/modules/PlayerbotV2/Addon/BotGear/BotGear.lua @@ -28,6 +28,7 @@ local bagLayout = {} -- [bagNum] = {entry, size} local gold = 0 local selected = nil -- {bag=, slot=} item picked up for move local modelActor = nil +local bagScroll, bagContent, goldText local EQUIP_SLOT_NAMES = { [0]="Head",[1]="Neck",[2]="Shoulder",[3]="Shirt",[4]="Chest", @@ -92,7 +93,7 @@ local function RefreshSlot(btn, entry, count, quality, isSelected) end local function CreateSlotButton(parent, x, y, slotType, bag, slot) - local btn = CreateFrame("Button", nil, parent) + local btn = CreateFrame("Button", nil, parent, "BackdropTemplate") btn:SetSize(SLOT_SIZE, SLOT_SIZE) btn:SetPoint("TOPLEFT", x, -y) btn:SetNormalTexture("Interface\\Buttons\\UI-Quickslot2") @@ -184,8 +185,6 @@ local function RefreshBags() end -- Rebuild the bag section layout inside the scroll content. -local bagScroll, bagContent, goldText - local function BuildBagLayout() local content = bagContent if not content then return end @@ -301,7 +300,7 @@ end local function BuildFrame() if frame then return end - frame = CreateFrame("Frame", "BotGearFrame", UIParent) + frame = CreateFrame("Frame", "BotGearFrame", UIParent, "BackdropTemplate") frame:SetSize(520, 700) frame:SetPoint("CENTER") frame:SetBackdrop({ bgFile="Interface\\DialogFrame\\Background-DialogFrame", @@ -352,7 +351,7 @@ local function BuildFrame() end -- Bags (scroll) - bagScroll = CreateFrame("ScrollFrame", nil, frame) + bagScroll = CreateFrame("ScrollFrame", nil, frame, "BackdropTemplate") bagScroll:SetPoint("TOPLEFT", frame, "TOPLEFT", 205, -40) bagScroll:SetPoint("BOTTOMRIGHT", frame, "BOTTOMRIGHT", -12, 34) bagScroll:SetBackdrop({ bgFile="Interface\\DialogFrame\\UI-DialogBox-Background" }) diff --git a/src/modules/PlayerbotV2/Bot/BotCommandParser.cpp b/src/modules/PlayerbotV2/Bot/BotCommandParser.cpp index 135cb1e4fd..61df75268f 100644 --- a/src/modules/PlayerbotV2/Bot/BotCommandParser.cpp +++ b/src/modules/PlayerbotV2/Bot/BotCommandParser.cpp @@ -2611,12 +2611,13 @@ bool BotCommandParser::DispatchSingle(Player* sender, Player* bot, std::string c desired ? "Aoe: ON (rotation biases AoE)" : "Aoe: OFF (single-target)"}); return true; } - if (cmd == "setrole") + if (cmd == "setrole" || cmd == "role") { // /setrole tank|healer|dps|clear — pin the bot to a role // independent of its spec. Picked up by all group/healer logic via // BotAI::effective_role(). `clear` (or no argument) drops the // override so the snapshot's spec-derived role applies again. + // "role" is the PlayerbotControl addon's verb; "setrole" the chat one. BotAI* ai = Services::Registry().ai(bot->GetGUID().GetCounter()); if (!ai) { @@ -2664,7 +2665,7 @@ bool BotCommandParser::DispatchSingle(Player* sender, Player* bot, std::string c fmt::format("Aoe_all: applied to {} bot(s).", changed)}); return true; } - if (cmd == "setrole_all" || cmd == "setroleall") + if (cmd == "setrole_all" || cmd == "setroleall" || cmd == "role_all" || cmd == "roleall") { // Mass role-override across the group. Useful for "everyone DPS, no // healer for this trash pull" or "everyone tank, /follow_all to taunt