A button that drinks for you has to be one of the game's secure buttons, and a secure button placed on a window locks that whole window during a fight. The answer that worked in game was an invisible secure button, kept apart from the party window and laid over a drawn one. Getting the click to reach it took three changes at once, and which of the three did the job is not known.
The question
Can the party window carry a button that drinks (out of a fight) and warns the party (in a fight), without the window itself being frozen every time a fight starts?
Why it mattered
OAP Party Utilities has an out-of-mana button on its party window. One click warns the party if you are too dry to cast, then drinks the drink you chose.
Addon code may not use an item by itself. The comment at the top of DrinkButton.lua puts it this way: using an item takes the game's secure button, and a secure button is a protected frame. One placed on the party window would make the whole window protected: no moving, showing or hiding it in a fight.
The same day, 2026-10-14, the Buffs helper box met the second rule. Its cast buttons were to sit after a line of text, and the game refused with the message "Cannot anchor protected frames to regions". A secure button can be fixed to a frame, but not to a piece of text or a picture.
What could have been done
Put the secure button on the window and accept the lock: fine for a box that is put away for fights anyway, such as the Buffs helper. Or keep the window free: draw an ordinary button on it and lay a separate, invisible secure button over the top, belonging to the screen and following the drawn one about while no fight is on.
How it was done
The overlay was built and tried in game on 2026-10-14. It did not work: the secure button never got a click.
The OAP Debug log showed why, up to a point. Both buttons were in the same place and the same size, the secure one at level 7 over the drawn one at level 2, shown, with the mouse switched on. The game still gave every click to the drawn button underneath.
Three things were then changed together. The drawn button stops taking the mouse while the secure one is over it. The secure button was given something to hit: a black texture at 1 percent, too faint to see. The code calls this "one guess at why it never got a click". And the secure button was registered for both the press and the release, so the press is not left for a frame underneath.
A fourth fix carries the same date. Clicking the party window could raise it after the secure button was made, and then the drawn button was on top and took the click; the code's note quotes the report as "clicking the oom button does nothing". The secure button's level is now kept five above the drawn one's.
What was seen
After the overlay fix the button drank, out of combat. The plan ticks this off with the drink used in the test, Sweet Nectar.
In boss fights a new problem appeared on 2026-10-16. The warning is party chat sent by the addon, and all three clicks in one boss fight were blocked: the log showed ADDON_ACTION_BLOCKED at SendChatMessage. On ordinary enemies the same click had worked.
The secure button was then given a second job. As a fight starts it becomes a macro that types the party message, and after the fight it goes back to the drink. On 2026-10-18 I pressed it once in a boss fight and the party saw the message.
On 2026-11-11 I confirmed in game: too dry in a party, one click warns then drinks, and the message is said once, not twice. In a fight a click only warns, and after the fight it drinks again.
On 2026-11-12 the order of events was measured from the log for the Buffs helper box: the game's fight-start event (PLAYER_REGEN_DISABLED) arrived while the combat lock was still off. The whole design leans on that gap, because it is the last moment a protected frame can be changed.
Measured on 2026-11-13 with a probe over eight fights: the lock comes on the next drawn frame, 4 to 13 ms after the fight-start event. With it on, moving the Buffs box on its Give page (cast buttons showing) was refused, and so was hiding it; fading it worked.
The same day showed what makes a frame protected. The box stayed protected with no cast button shown, then with none left inside it; it was freed only when the unused buttons were moved out into a hidden holder and their anchors to the box's lines were cleared too. On Forever a frame counts as protected while a secure button is inside it or anchored to it, shown or not. I wrote: "done: slides all round that time".
The decision
Put secure buttons inside a frame only if that frame is put away for every fight, and put it away at the fight-start event, just before the lock.
On a frame that stays up, such as the party window, the secure button is a separate invisible button over the drawn one, never anchored to the window. Keep all three overlay changes, because nobody knows which one made the click arrive.
One cost is accepted: in a fight the secure button cannot move. If the party window is moved or hidden mid-fight, the button stays where the window was until the fight ends.
Since 2026-11-13: cast buttons not in use are kept outside the Buffs box, unanchored, so the box is protected only while they show. A box that is still protected when a fight starts stops taking the mouse in the fight-start handler and fades out where it is.
Ways tried
Never give up, never surrender
Where the AI stalled, and what it took to get past it.
The plan's note of 2026-10-16 on the blocked boss-fight chat reads: "It cannot be got round". The addon was changed to say in the chat window why the warning was not sent, and that was where it rested.
After the next blocked boss fight I said what I actually wanted: in a fight, only the party message, no drink. The secure button was then made to carry the message as a macro during fights, since a macro run by a secure button counts as you typing it. My one press in a boss fight on 2026-10-18 showed that it does get through. The record does not say who first suggested the macro.
Still not known
- Which of the three overlay changes fixed the click (no mouse on the drawn button, the 1 percent texture, registering both press and release) is not known. All three are kept.
- The plan's item that the party window still moves and hides during a fight is not ticked: not verified in the record.
- A click passed on to the secure button while it is hidden (from an OAP UnitButtons bar) rests on reading the game's code; the plan marks clicking it hidden as not verified in game, though I confirmed the bar button working with the party window closed on 2026-11-11.
- Whether the game would let a locked window's height change (for the Collapse style) has not been seen in game.
See also
Sources
The project files and commits this report was written from.
- OAPPartyUtils: DrinkButton.lua (header comment; drawnTakesMouse, follow, makeSecure, fightStarts, ns.DrinkButtonWhere)
- OAPPartyUtils: BuffsCast.lua (plainButton, ns.CreateBuffCastButton)
- OAPPartyUtils: BuffsHelper.lua (comment on 'Cannot anchor protected frames to regions', in game 2026-10-14; hide and fightStarts comments)
- OAPPartyUtils: PLAN.md, 'Buff helper' step 4 (secure buttons in the box, hiding on PLAYER_REGEN_DISABLED)
- OAPPartyUtils: PLAN.md, 'Drink button, helper buttons, drink messages (2026-10-14)'
- OAPPartyUtils: PLAN.md, 'The out-of-mana button on OAP UnitButtons' bars (2026-11-10)'
- OAPPartyUtils: PLAN.md, 'Windows slide away for a fight (2026-11-12)'
- OAPPartyUtils: git commit 2026-10-18 'Role ring, Buffs helper fixes, more drink/OOM messages, OAP Debug level' (first commit holding DrinkButton.lua and BuffsCast.lua)
- OAPPartyUtils: PLAN.md, 'Windows slide away for a fight' (lock probe and putAway, 2026-11-13)
- OAPPartyUtils: Claude transcript 78db918d, 2026-11-13