mirror of
https://github.com/brues-code/ClassicAPI.git
synced 2026-11-16 08:00:42 +00:00
The engine's RegisterForClicks (0x00782490) SStrCmpI's each argument against exactly ten literals -- LeftButtonDown 0x1 / LeftButtonUp 0x100, Middle 0x2 / 0x200, Right 0x4 / 0x400, Button4 0x8 / 0x800, Button5 0x10 / 0x1000 -- treats anything else as contributing nothing, and ASSIGNS the OR to the click mask. So the collective names later clients take, "AnyUp" and "AnyDown", did not fall back to the default here: they zeroed the mask and the button silently stopped answering every real click, while Button:Click (which ignores the mask) kept working and hid it. That is what broke the first click-bracket harness yesterday. Frame::ClickMask re-registers RegisterForClicks on the Button method registry (0x00CF4E14, new VAR_BUTTON_METHOD_REGISTRY; most recent registration wins, CheckButton inherits through the type walk). It does not reimplement the parser: for each AnyUp / AnyDown argument it appends the five names that collective stands for onto the Lua stack and tail-calls the engine's own function, which then does the self typecheck, the parse, the setter and any error text itself. The collective string is left in place -- the engine's unknown-name -> 0 rule already makes it inert -- so the reshape is purely additive and the engine's loop terminates exactly as before. Verified in-game with left, middle and right: AnyUp fires OnClick on release; AnyDown on press; "anyup" + "LeftButtonDown" (case check) fires left on both press and release and the others on release only; a LeftButtonUp control is unchanged; "Fnord" alone still yields no clicks.