Repository navigation
wowlua v0.13.12
0.13.12 (2026-11-13)
New
-
toBeCloseToworks on secret numbers, and the newtoBeGreaterThanandtoBeLessThando too:expect(bar:GetStatusBarTexture():GetWidth()).toBeCloseTo(45)measures a bar showing a secret value (its size reads back secret, as in the game). Only how the numbers compare comes out; tests still never read a secret's value. -
Play in VS Code: the wowlua: UI panel has a Play switch. With it on, the mouse and keyboard go to the game as when you play: the mouse hovers frames (their
OnEnterand tooltips), clicks and drags them, and the wheel scrolls them; keys run their key bindings while you hold them (Wwalks, the arrows turn), and what you type goes into the focused edit box, such as the chat's. Off, a click in the panel is a click, as before. -
Tagged mobs:
UnitIsTapDeniedanswers true for a mob tagged by a player outside your group, as in the game, so you can test how your nameplates and unit frames grey such mobs. Spawn one tagged withmock.spawnUnit({ ..., tappedByOther = true })(also in a world profile's units andunit:update), tag it withunit:tap()(orunit:tap(otherPlayer)), and free it withunit:untap();UNIT_FACTIONfires for the mob when its tap becomes denied or free again. The first player to hit an untagged mob (unit:hit,unit:swing,unit:kill({ by = … })) tags it. A mob you or your group tagged, a player and your pet are never tap-denied. Before,UnitIsTapDeniedwas always false. -
secret.showWhen(region, shown[, alpha])inwowlua:secretshows or hides a region by a boolean that may be secret, such as another region'sIsShown().SetShownrefuses a secret from addon code;showWhenshows the region and sets its alpha from the secret instead.
Fixed
- A status bar's fill answers
IsShown()andIsVisible()with a secret while the bar shows a secret value, as in the game, and passing that answer toSetShownfails with the game's error, now worded as the game words it when called as a method: "MyAddon/main.lua:12: bad argument #1 to 'SetShown' (Usage: self:SetShown([show]). Secret values are only allowed during untainted execution for this argument.)". Before, the fill answered a plaintrue, so code that copied it to another region broke in game but passed its tests. Usesecret.showWhento copy it. - A status bar showing a secret value, such as another unit's health (
bar:SetValue(UnitHealth("target"))), makes the size and place of its fill texture secret, as in the game, and of everything anchored to the fill, however many anchors lie between: the incoming heals bar at the health fill's right edge, a texture set over that bar. TheirGetWidth,GetHeight,GetSize,GetRect,GetLeft,GetRight,GetTop,GetBottom,GetCenterandGetPointanswer secret numbers,IsAnchoringSecret()answers true, and comparing such a height (if h > 0) fails with the game's "attempt to compare local 'h' (a secret number value, while execution tainted by 'MyAddon')". The bar itself, and frames anchored to the bar rather than its fill, keep plain sizes. Before, wowlua answered plain numbers there, so code that broke in game at login passed its tests. Read the size from the bar or the frame holding the fill instead, or check withissecretvaluefirst. - Profiles (
wowlua test --profile-out), dev builds' error messages and the debugger name each class method at its own line. In a class whose constructor came before fields with a default value further down (clickHooked: boolean = falseamong the methods), every method above that field was reported at the field's line. - Raid target markers work in tests:
SetRaidTargetputs the marker on the unit (moving it off any other unit, 0 takes it off),GetRaidTargetIndexanswers it andRAID_TARGET_UPDATEfires, so the game's target frame shows the icon. On WoW Forever an addon can no longer mark in combat: as in the game, itsSetRaidTargetis refused withADDON_ACTION_FORBIDDEN("SetRaidTarget()") and the test fails, also when the addon's changes taint the game's unit menu. The game's own menu, untouched by addons, still marks in combat. - The aura buttons of your own aura container (
CreateFrame("AuraContainer", nil, parent, "CustomAuraContainerTemplate")) are off limits to your addon in combat, as in the game: whileC_Secrets.ShouldAurasBeSecret()is true, any call on a button, such asbutton:SetSize(…), fails with "calling 'SetSize' on bad self (Attempt to access forbidden object from code tainted by an AddOn …)" (throughpcall(button.SetSize, button, …): "bad argument #1 to '?' (…)"), andGetParent()on a frame you put on the button fails the same way.button:IsForbidden()still answers false, as in the game. Out of combat, and ininitializeFrame, the button is yours to use. Before, wowlua let addon code use the buttons in combat, so code that broke in game passed its tests. Set up the button itself insideinitializeFrame, and keep your own frames on it for changes in combat. - Nameplates draw at the game's scale. When
NAME_PLATE_UNIT_ADDEDfires, the plate's frame (C_NamePlate.GetNamePlateForUnit(unit)) is still at scale 1, as in the game; from the next frame (mock.nextFrame()in a test) it draws at UIParent's scale times the game's nameplate settings:nameplateSelectedScalefor your target,nameplateMinScalefor a unit farther thannameplateMinScaleDistance(mock.spawnUnit({ distance = 30 })),nameplateMaxScalefor a near one. On WoW Forever at a UI scale of 0.64 that is 0.512 far and 0.768 for your target. The plate follows the UI scale, your target, the unit's distance and those settings as they change. Before, wowlua drew plates at scale 1, so lines and sizes laid out for the plate's scale came out at another size than in game. - A status bar's fill answers
GetWidth,GetHeightandGetSizewith the part its value fills, as its edges do. Before, it answered 0 whileGetLeftandGetRightgave the filled part. - An anchor that would make a loop fails as in the game: when the region you anchor to is itself placed by the one you're anchoring, through any number of anchors (
b:SetPoint("TOP", a, "BOTTOM")and thena:SetPoint("TOP", b, "BOTTOM")),SetPointandSetAllPointsfail with "Action[SetPoint] failed because[Cannot anchor to a region dependent on it]: attempted from: Button:SetPoint.", and the region keeps its points. Before, wowlua anchored it, so code that broke in game passed its tests.