From e93451ece0b29ba3570f19aba74000d4cc470544 Mon Sep 17 00:00:00 2001 From: Martin Konstantin Herrmann Date: Mon, 9 Nov 2026 20:47:44 +0100 Subject: [PATCH 1/3] UNIT-6 Run specs and proof on the wow-ui-testing library Pin wow-ui-testing v0.1.0 in .wut-version and fetch it into .wut/ with scripts/fetch-wut.sh. tests/run.lua becomes a shim over wowtest's CLI, configured by tests/wut.config.lua; proof loads wowproof from the library. Drop the local wowproof/ copy (its specs run in the library). CI caches and fetches .wut/. --- .github/workflows/tests.yml | 9 + .gitignore | 1 + .wut-version | 1 + AGENTS.md | 1 + DEVELOPMENT.md | 29 +- scripts/fetch-wut.sh | 113 ++++++ tests/proof/setup.lua | 1 + tests/run.lua | 460 +--------------------- tests/wut.config.lua | 9 + tests/wut.lua | 30 ++ wowproof/README.md | 156 -------- wowproof/adapters/mock_state.lua | 228 ----------- wowproof/blp.lua | 151 -------- wowproof/init.lua | 159 -------- wowproof/layout.lua | 141 ------- wowproof/paint.lua | 557 --------------------------- wowproof/raster.lua | 184 --------- wowproof/runner.lua | 36 -- wowproof/scene.lua | 60 --- wowproof/sheet.lua | 55 --- wowproof/sources/atlas_table.lua | 8 - wowproof/sources/remote_dir.lua | 48 --- wowproof/sources/wago_casc.lua | 32 -- wowproof/sources/wow_ui_textures.lua | 110 ------ wowproof/spec/blp_spec.lua | 56 --- wowproof/spec/fake_scene.lua | 40 -- wowproof/spec/layout_spec.lua | 94 ----- wowproof/spec/package_spec.lua | 113 ------ wowproof/spec/paint_spec.lua | 269 ------------- wowproof/spec/sources_spec.lua | 84 ---- 30 files changed, 194 insertions(+), 3041 deletions(-) create mode 100644 .wut-version create mode 100755 scripts/fetch-wut.sh create mode 100644 tests/wut.config.lua create mode 100644 tests/wut.lua delete mode 100644 wowproof/README.md delete mode 100644 wowproof/adapters/mock_state.lua delete mode 100644 wowproof/blp.lua delete mode 100644 wowproof/init.lua delete mode 100644 wowproof/layout.lua delete mode 100644 wowproof/paint.lua delete mode 100644 wowproof/raster.lua delete mode 100644 wowproof/runner.lua delete mode 100644 wowproof/scene.lua delete mode 100644 wowproof/sheet.lua delete mode 100644 wowproof/sources/atlas_table.lua delete mode 100644 wowproof/sources/remote_dir.lua delete mode 100644 wowproof/sources/wago_casc.lua delete mode 100644 wowproof/sources/wow_ui_textures.lua delete mode 100644 wowproof/spec/blp_spec.lua delete mode 100644 wowproof/spec/fake_scene.lua delete mode 100644 wowproof/spec/layout_spec.lua delete mode 100644 wowproof/spec/package_spec.lua delete mode 100644 wowproof/spec/paint_spec.lua delete mode 100644 wowproof/spec/sources_spec.lua diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6eb60af..6960d12 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -26,6 +26,15 @@ jobs: run: sudo apt-get update && sudo apt-get install -y luajit python3 zip unzip jq librsvg2-bin imagemagick fonts-dejavu-core - name: Set up pinned test libraries run: bash scripts/setup-test-libs.sh + - name: Cache the wow-ui-testing library + uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + with: + path: .wut + key: wut-${{ hashFiles('.wut-version', 'tests/wut.config.lua') }} + - name: Fetch the pinned wow-ui-testing library + env: + GITHUB_TOKEN: ${{ github.token }} + run: bash scripts/fetch-wut.sh - name: Check out the matching Blizzard source uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 with: diff --git a/.gitignore b/.gitignore index 03226df..3e6e71b 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ UnitFrames_Media/Libs/ /.proof/ /.proof-art/ /scripts/portrait-capture/node_modules/ +/.wut/ diff --git a/.wut-version b/.wut-version new file mode 100644 index 0000000..6dcec0e --- /dev/null +++ b/.wut-version @@ -0,0 +1 @@ +0997193aeb6d659112724c5f7306f4d7f7f8fae4 # v0.1.0 diff --git a/AGENTS.md b/AGENTS.md index 5f43cc0..e12912b 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -90,6 +90,7 @@ luajit tests/run.lua workbench -t "preview" ``` - Specs live in `tests/spec//` (`core`, `contract`, `components`, `auras`, `units`, `workbench`, `editmode`, `clickgrid`, `tracking`, `onboarding`). Put new specs in the area of the code they exercise; a feature spec keeps its live and Workbench preview tests together. When behaviour also has tests in other areas, tag them in the `describe`/`it` name (`#shields`) and keep existing tags. +- The runner (`wowtest`) and the proof renderer (`wowproof`) come from the shared wow-ui-testing library, pinned by commit in `.wut-version` and fetched into the ignored `.wut/` by `scripts/fetch-wut.sh` (`tests/run.lua` and `scripts/proof.sh` fetch it when missing). `tests/wut.config.lua` configures the runner. Don't edit `.wut/`; library changes go to the wow-ui-testing repository, tried here with `WUT_DIR=`, then a `.wut-version` bump. - Path filters match **spec paths** (`units/` is exactly that folder, `name_spec.lua` exactly that file); `-t` matches test names and `--tag` matches tags. `-j [N]` runs spec files in parallel; `--times` (runner or `scripts/run-tests.sh`) reports per-spec durations; `luajit -jp=F tests/run.lua ...` profiles. The runner includes addon Lua syntax checks. No external busted installation is needed. - `tests/helpers.lua` loads TOCs into a fresh mocked client; `tests/mock/wow.lua` includes fake secrets and `tests/mock/ouf.lua` supplies the usual oUF stand-in. Some specs exercise embedded oUF paths explicitly. - The mock is held to the client API through `tests/fixtures/api_snapshot.lua`, generated from Blizzard's API documentation and Lua source by `luajit scripts/api-snapshot.lua` (regenerate after adding API usage or updating the source checkout, and review the diff). The checkout must match the commit pinned in the workflows, or CI regenerates a different snapshot. `tests/mock/api.lua` enforces it on every mock call: undocumented widget methods, rejected arguments, secrets passed where addon (tainted) code may not pass them, and protected calls in combat raise errors. `tests/spec/contract/api_contract_spec.lua` checks the mock's functions, methods, enums, restricted secret returns and our event names, and that the snapshot is current when the source checkout exists. diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 4587b9a..8f4e1af 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -187,8 +187,8 @@ in source is needed before tagging. | `UnitFrames_Onboarding/` | Load-on-demand Getting started guide: preset looks, tweaks, extras and Workbench hand-off | | `UnitFrames_Media/` | Additional fonts and their licences | | `tests/` | Mocked client, API snapshot and regression specs | -| `wowproof/` | Standalone UI-proof renderer (no UnitFrames code; see its README) | | `scripts/` | Library fetching, installation and API snapshot generation | +| `.wut/` | The fetched [wow-ui-testing](https://github.com/voshond/wow-ui-testing) library (ignored by Git) | New runtime files belong in the relevant TOC in dependency order; tests load those TOCs too. Preserve existing worktree changes and avoid editing @@ -228,7 +228,26 @@ a name ending in `.lua` exactly one file. `-t` and `--tag` narrow further. A run that selects no tests fails. The runner always checks addon Lua syntax. No external busted installation is needed. To see where a spec spends its time, use LuaJIT's profiler: `luajit -jp=F tests/run.lua clickgrid_spec.lua`. -The specs of the `wowproof/` package run with the suite as `wowproof/`. + +### The wow-ui-testing library + +The spec runner (`wowtest`) and the UI-proof renderer (`wowproof`) come from +the shared [wow-ui-testing](https://github.com/voshond/wow-ui-testing) +library, which our other addons use too. `.wut-version` pins one library +commit (full SHA, the version tag after `#`). `scripts/fetch-wut.sh` (a copy +of the library's) downloads that commit into the ignored `.wut/` folder and +does nothing when it is already there; `tests/run.lua`, `scripts/proof.sh` +and CI run it for you, so a fresh checkout needs network once. +`tests/wut.config.lua` tells the runner where specs live and which addon +folders to syntax-check; `tests/run.lua` is a thin shim over the library's +`wowtest/cli.lua`. The library's own specs (including wowproof's) run in its +repository. + +To work on the library and this addon together, point `WUT_DIR` at a local +checkout instead of the pin: `WUT_DIR=../wow-ui-testing luajit tests/run.lua -j`. +To move to a new library version, put its commit SHA in `.wut-version` (and +refresh `scripts/fetch-wut.sh` from it when that changed); the next run +fetches it. ### UI proof @@ -244,9 +263,9 @@ It writes `.proof/.svg`, `.png` and a contact sheet `.proof/index.html (librsvg); our own `.tga` textures need ImageMagick. Scenarios live in `tests/proof/units.lua` and `tests/proof/workbench.lua`: each is a name and a `build` that loads the addon, feeds sample values and returns the region to -render. `tests/proof/setup.lua` is the only coupling to the renderer: it hands -`wowproof` an adapter for the mock and maps our fonts and textures. A spec can -also call `Helpers.Snapshot(name, region)`, which renders only with +render. `tests/proof/setup.lua` is the only coupling to the renderer: it loads +`wowproof` from the library (see above), hands it an adapter for the mock and +maps our fonts and textures. A spec can also call `Helpers.Snapshot(name, region)`, which renders only with `UF_PROOF=1`. CI uploads the images as the `ui-proof` artifact. For a pull request body, `bash scripts/proof-publish.sh ` renders the diff --git a/scripts/fetch-wut.sh b/scripts/fetch-wut.sh new file mode 100755 index 0000000..b8960ed --- /dev/null +++ b/scripts/fetch-wut.sh @@ -0,0 +1,113 @@ +#!/usr/bin/env bash +# Fetches the pinned wow-ui-testing library into .wut/ and the third-party +# addons listed in wut.config.lua into .wut/addons//. Addon repos keep a +# copy of this script; run it from (or pass) the addon repo's root. +# +# bash scripts/fetch-wut.sh [repo root] +# +# .wut-version holds the library's full commit SHA (the first word of its +# first non-comment line). Prints the library folder on stdout, so +# lib="$(bash scripts/fetch-wut.sh)" && luajit "$lib/wowtest/cli.lua" -j +# +# WUT_DIR use this local library checkout instead of downloading one +# WUT_REPO library repository (default: voshond/wow-ui-testing) +# WUT_SOURCE fetch the library from this local git repository instead +# WUT_CONFIG host config (default: wut.config.lua, then tests/wut.config.lua) +# GITHUB_TOKEN / GH_TOKEN (or a logged-in gh) are used when set: they lift +# GitHub's anonymous rate limit and reach private forks. +set -euo pipefail +cd "${1:-$PWD}" +wut_dir="$PWD/.wut" +library_source="${WUT_SOURCE:-${WUT_REPO:-voshond/wow-ui-testing}}" + +die() { echo "fetch-wut: $*" >&2; exit 1; } +say() { echo "fetch-wut: $*" >&2; } + +token() { + local value="${GITHUB_TOKEN:-${GH_TOKEN:-}}" + if [[ -z "$value" ]] && command -v gh >/dev/null; then value="$(gh auth token 2>/dev/null || true)"; fi + printf '%s' "$value" +} + +# Extracts at into the new folder , with .wut-ref. +fetch_tree() { + local source="$1" ref="$2" staging="$3" scratch + scratch="$(mktemp -d)" + mkdir -p "$staging" + if [[ "$source" == /* ]]; then + git -C "$source" archive --format=tar "$ref" | tar -x -C "$staging" + else + local auth=() url="https://codeload.github.com/$source/tar.gz/$ref" secret + secret="$(token)" + if [[ -n "$secret" ]]; then + url="https://api.github.com/repos/$source/tarball/$ref" + auth=(-H "Authorization: Bearer $secret") + fi + curl --fail --silent --show-error --location --retry 3 --max-time 300 "${auth[@]}" "$url" -o "$scratch/source.tar.gz" + tar -xzf "$scratch/source.tar.gz" -C "$staging" --strip-components=1 + fi + rm -rf -- "$scratch" + printf '%s\n' "$ref" > "$staging/.wut-ref" +} + +current_ref() { cat "$1/.wut-ref" 2>/dev/null || true; } + +if [[ -n "${WUT_DIR:-}" ]]; then + lib="$(cd "$WUT_DIR" && pwd)" + say "using the local library in $lib (WUT_DIR)" +else + [[ -f .wut-version ]] || die "no .wut-version in $PWD" + sha="$(grep -v '^[[:space:]]*\(#\|$\)' .wut-version | head -n 1 | awk '{ print $1 }')" + [[ "$sha" =~ ^[0-9a-f]{40}$ ]] || die ".wut-version must start with a full commit SHA, got '$sha'" + if [[ "$(current_ref "$wut_dir")" == "$sha" ]]; then + say "library $sha already in .wut" + else + rm -rf -- "$wut_dir.new" + fetch_tree "$library_source" "$sha" "$wut_dir.new" + if [[ -d "$wut_dir/addons" ]]; then mv "$wut_dir/addons" "$wut_dir.new/addons"; fi + rm -rf -- "$wut_dir" + mv "$wut_dir.new" "$wut_dir" + say "fetched library $sha into .wut" + fi + lib="$wut_dir" +fi + +addons="" +if [[ -f "$lib/wowtest/addons.lua" ]]; then + lua="$(command -v luajit || command -v lua5.1 || true)" + [[ -n "$lua" ]] || die "LuaJIT or Lua 5.1 is required to read wut.config.lua" + addons="$("$lua" "$lib/wowtest/addons.lua" ${WUT_CONFIG:+"$WUT_CONFIG"})" || die "cannot read the addons from wut.config.lua" +else + say "this library version has no third-party addon support; skipping addons" +fi + +declare -A wanted=() +while IFS=$'\t' read -r name source ref toc; do + [[ -n "$name" ]] || continue + wanted[$name]=1 + destination="$wut_dir/addons/$name" + if [[ "$(current_ref "$destination")" == "$ref" ]]; then + say "addon $name $ref already in .wut/addons" + else + rm -rf -- "$destination.new" + fetch_tree "$source" "$ref" "$destination.new" + rm -rf -- "$destination" + mv "$destination.new" "$destination" + say "fetched addon $name $ref into .wut/addons" + fi + if [[ -n "$toc" ]]; then printf '%s\n' "$toc" > "$destination/.wut-toc"; else rm -f -- "$destination/.wut-toc"; fi +done <<< "$addons" + +if [[ -d "$wut_dir/addons" ]]; then + for folder in "$wut_dir/addons"/*/; do + [[ -d "$folder" ]] || continue + name="$(basename "$folder")" + if [[ -z "${wanted[$name]:-}" ]]; then + rm -rf -- "$folder" + say "removed addon $name (no longer in wut.config.lua)" + fi + done +fi + +say "package.path: $lib/?.lua;$lib/?/init.lua" +printf '%s\n' "$lib" diff --git a/tests/proof/setup.lua b/tests/proof/setup.lua index fe54053..2ed3db4 100644 --- a/tests/proof/setup.lua +++ b/tests/proof/setup.lua @@ -1,3 +1,4 @@ +dofile("tests/wut.lua") package.path = "./tests/?.lua;./?.lua;./?/init.lua;" .. package.path local Helpers = require("helpers") diff --git a/tests/run.lua b/tests/run.lua index 0a05c32..f387236 100644 --- a/tests/run.lua +++ b/tests/run.lua @@ -1,7 +1,6 @@ --[[ -Tiny test runner with a busted-compatible subset (describe / it / -before_each / after_each and the assert.* used in our specs), so specs run -without installing anything. Run from the repository root: +Runs the specs with the wow-ui-testing runner (wowtest), configured by +tests/wut.config.lua. Run from the repository root: luajit tests/run.lua all specs luajit tests/run.lua units spec paths containing "units" (folder or file) @@ -15,455 +14,6 @@ without installing anything. Run from the repository root: Path filters are combined with "or"; -t and --tag narrow further. Every run also syntax-checks every addon Lua file. A run that selects no tests fails. ]] --- Keep runner output on stdout when the mock captures the client's print. -local print = print -local pathFilters, nameFilters, tags = {}, {}, {} -local showTimes, jobs, childResult -do - local i = 1 - local function Value(option) - i = i + 1 - return arg[i] or error(option .. " needs a value") - end - while arg[i] do - local value = arg[i] - if value == "--times" then - showTimes = true - elseif value == "-t" or value == "--test" then - nameFilters[#nameFilters + 1] = Value(value) - elseif value == "--tag" then - tags[#tags + 1] = Value(value):gsub("^#", "") - elseif value == "-j" or value == "--jobs" then - if arg[i + 1] and arg[i + 1]:match("^%d+$") then - jobs = tonumber(Value(value)) - else - jobs = 0 -- one per CPU - end - elseif value == "--child" then - childResult = Value(value) -- internal: run one spec file for a parallel run - elseif value:sub(1, 1) == "-" then - error("unknown option " .. value) - else - pathFilters[#pathFilters + 1] = value - end - i = i + 1 - end -end - --- Wall-clock seconds; os.clock would miss time spent in spawned processes. -local Now = os.clock -do - local ok, ffi = pcall(require, "ffi") - if ok then - ffi.cdef("typedef struct { long tv_sec; long tv_nsec; } uf_timespec; int clock_gettime(int, uf_timespec *);") - local spec = ffi.new("uf_timespec") - Now = function() - ffi.C.clock_gettime(1, spec) -- CLOCK_MONOTONIC - return tonumber(spec.tv_sec) + tonumber(spec.tv_nsec) / 1e9 - end - end -end -local startedAt = Now() - --- Assertions ------------------------------------------------------------------- - -local function Describe(value) - if type(value) == "string" then - return string.format("%q", value) - end - return tostring(value) -end - --- Mock widgets reference their parents (cycles), so they compare by identity. -local function IsMockObject(value) - return type(value) == "table" and rawget(value, "__type") ~= nil -end - -local function DeepEqual(a, b) - if rawequal(a, b) then - return true - end - if type(a) ~= "table" or type(b) ~= "table" or IsMockObject(a) or IsMockObject(b) then - return false - end - for k, v in pairs(a) do - if not DeepEqual(v, b[k]) then - return false - end - end - for k in pairs(b) do - if a[k] == nil then - return false - end - end - return true -end - -local function Dump(value, indent) - if IsMockObject(value) then - return "" - end - if type(value) ~= "table" then - return Describe(value) - end - indent = indent or "" - local keys = {} - for k in pairs(value) do - keys[#keys + 1] = k - end - table.sort(keys, function(x, y) return tostring(x) < tostring(y) end) - local lines = { "{" } - for _, k in ipairs(keys) do - lines[#lines + 1] = indent .. " " .. tostring(k) .. " = " .. Dump(value[k], indent .. " ") - end - lines[#lines + 1] = indent .. "}" - return table.concat(lines, "\n") -end - -local luaAssert = assert -assert = setmetatable({}, { __call = function(_, ...) return luaAssert(...) end }) - -function assert.equals(expected, actual, message) - if expected ~= actual then - error((message and message .. ": " or "") .. "expected " .. Describe(expected) .. ", got " .. Describe(actual), 2) - end -end -assert.are_equal = assert.equals - -function assert.same(expected, actual, message) - if not DeepEqual(expected, actual) then - error((message and message .. ": " or "") .. "expected\n" .. Dump(expected) .. "\ngot\n" .. Dump(actual), 2) - end -end -assert.are_same = assert.same - -function assert.is_true(value, message) - if value ~= true then - error((message or "expected true") .. ", got " .. Describe(value), 2) - end -end - -function assert.is_false(value, message) - if value ~= false then - error((message or "expected false") .. ", got " .. Describe(value), 2) - end -end - -function assert.is_nil(value, message) - if value ~= nil then - error((message or "expected nil") .. ", got " .. Describe(value), 2) - end -end - -function assert.is_not_nil(value, message) - if value == nil then - error(message or "expected a value, got nil", 2) - end -end - -function assert.has_error(fn, message) - if pcall(fn) then - error(message or "expected an error", 2) - end -end - -function assert.has_no_error(fn, message) - local ok, err = pcall(fn) - if not ok then - error((message and message .. ": " or "") .. "unexpected error: " .. tostring(err), 2) - end -end - --- Spec DSL ------------------------------------------------------------------------ - -local root = { name = "", tests = {}, before = {}, after = {} } -local current = root - -function describe(name, body) - local block = { name = name, tests = {}, before = {}, after = {}, parent = current } - table.insert(current.tests, { block = block }) - local previous = current - current = block - body() - current = previous -end - -function it(name, body) - table.insert(current.tests, { name = name, body = body }) -end - -function before_each(fn) - table.insert(current.before, fn) -end - -function after_each(fn) - table.insert(current.after, fn) -end - --- Runner ----------------------------------------------------------------------- - -local passed, failed, failures = 0, 0, {} - -local function Hooks(block, field, out) - if block.parent then - Hooks(block.parent, field, out) - end - for _, fn in ipairs(block[field]) do - out[#out + 1] = fn - end - return out -end - -local function Selected(fullName) - for _, text in ipairs(nameFilters) do - if not fullName:find(text, 1, true) then - return false - end - end - if #tags == 0 then - return true - end - for tag in fullName:gmatch("#([%w_%-]+)") do - for _, wanted in ipairs(tags) do - if tag == wanted then - return true - end - end - end - return false -end - -local function RunBlock(block, prefix) - for _, test in ipairs(block.tests) do - if test.block then - RunBlock(test.block, prefix .. test.block.name .. " ") - elseif Selected(prefix .. test.name) then - local fullName = prefix .. test.name - local ok, err = xpcall(function() - for _, fn in ipairs(Hooks(block, "before", {})) do - fn() - end - test.body() - local after = Hooks(block, "after", {}) - for i = #after, 1, -1 do - after[i]() - end - end, debug.traceback) - if ok then - passed = passed + 1 - else - failed = failed + 1 - failures[#failures + 1] = fullName .. "\n " .. tostring(err):gsub("\n", "\n ") - end - end - end -end - -local function Lines(command) - local lines = {} - local handle = io.popen(command) - for line in handle:lines() do - lines[#lines + 1] = line - end - handle:close() - return lines -end - -local function ListFiles(command) - local files = Lines(command) - table.sort(files) - return files -end - -local function Quote(text) - return "'" .. text:gsub("'", "'\\''") .. "'" -end - -local SPEC_DIR = "tests/spec/" -local PACKAGE_SPECS = { { prefix = "wowproof/", dir = "wowproof/spec/" } } -package.path = "./tests/?.lua;./?.lua;./?/init.lua;" .. package.path - -local function SpecPath(file) - for _, package in ipairs(PACKAGE_SPECS) do - if file:sub(1, #package.prefix) == package.prefix then - return package.dir .. file:sub(#package.prefix + 1) - end - end - return SPEC_DIR .. file -end - --- Restores the globals a spec file assigned, so a serial run isolates files --- like the one-process-per-file parallel run does. -local function RestoreGlobals(saved) - for name in pairs(_G) do - if saved[name] == nil then _G[name] = nil end - end - for name, value in pairs(saved) do - _G[name] = value - end -end - --- Runs one spec file (path relative to tests/spec/) in this process. -local function RunFile(file) - local started, before = Now(), { passed = passed, failed = failed, failures = #failures } - local globals = {} - for name, value in pairs(_G) do globals[name] = value end - root = { name = "", tests = {}, before = {}, after = {} } - current = root - local ok, err = xpcall(function() dofile(SpecPath(file)) end, debug.traceback) - if ok then - RunBlock(root, "") - else - failed = failed + 1 - failures[#failures + 1] = file .. " failed to load\n " .. tostring(err):gsub("\n", "\n ") - end - RestoreGlobals(globals) - local result = { file = file, passed = passed - before.passed, failed = failed - before.failed, - seconds = Now() - started, failures = {} } - for i = before.failures + 1, #failures do - result.failures[#result.failures + 1] = failures[i] - end - return result -end - --- One complete line per spec file, written at once so parallel processes --- sharing the terminal never interleave within a line. -local function ReportFile(result) - local tests = result.passed + result.failed - if tests == 0 then return end - local counts = result.failed > 0 and string.format("%d passed, %d failed", result.passed, result.failed) - or string.format("%d passed", result.passed) - io.write(string.format(" %-4s %-52s %-22s %6.2fs\n", result.failed > 0 and "FAIL" or "ok", - result.file, counts, result.seconds)) - io.flush() -end - -if childResult then - local result = RunFile(pathFilters[1]) - ReportFile(result) - local out = assert(io.open(childResult, "w")) - out:write(string.format("return { file = %q, passed = %d, failed = %d, seconds = %.6f, failures = {\n", - result.file, result.passed, result.failed, result.seconds)) - for _, failure in ipairs(result.failures) do - out:write(string.format("%q,\n", failure)) - end - out:write("} }\n") - out:close() - os.exit(0, true) -end - -local function SpecSelected(file) - if #pathFilters == 0 then - return true - end - for _, filter in ipairs(pathFilters) do - if filter:sub(-1) == "/" then - if file:sub(1, #filter) == filter then return true end - elseif filter:match("%.lua$") then - if file == filter or file:match("([^/]+)$") == filter then return true end - elseif file:find(filter, 1, true) then - return true - end - end - return false -end - --- Syntax check of all addon code (catches typos in files the specs don't load). -local syntaxErrors = 0 -local addonFiles = ListFiles("find UnitFrames UnitFrames_Workbench UnitFrames_ClickGrid UnitFrames_Onboarding -name '*.lua' -not -path '*/Libs/*'") -for _, file in ipairs(addonFiles) do - local _, err = loadfile(file) - if err then - syntaxErrors = syntaxErrors + 1 - print("syntax error: " .. err) - end -end - -local syntaxSeconds = Now() - startedAt -print(string.format("Syntax check: %d addon files, %d errors (%.2fs)", #addonFiles, syntaxErrors, syntaxSeconds)) - -local files = {} -for _, path in ipairs(ListFiles("find " .. SPEC_DIR .. " -name '*_spec.lua'")) do - local file = path:sub(#SPEC_DIR + 1) - if SpecSelected(file) then - files[#files + 1] = file - end -end -for _, package in ipairs(PACKAGE_SPECS) do - for _, path in ipairs(ListFiles("find " .. package.dir .. " -name '*_spec.lua'")) do - local file = package.prefix .. path:sub(#package.dir + 1) - if SpecSelected(file) then - files[#files + 1] = file - end - end -end - -if jobs == 0 then - jobs = tonumber(Lines("nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 1")[1]) or 1 -end - -local parallel = jobs and jobs > 1 and #files > 1 -print(string.format("Running %d spec file%s%s", #files, #files == 1 and "" or "s", parallel and string.format(" in %d processes", jobs) or "")) -io.flush() - -local results = {} -if parallel then - -- One process per spec file; xargs starts the next file as soon as a - -- process finishes. Larger files go first, so long specs start early. - local dir = Lines("mktemp -d")[1] - local order = {} - for index, file in ipairs(files) do - local handle = assert(io.open(SpecPath(file))) - order[index] = { index = index, file = file, size = handle:seek("end") } - handle:close() - end - table.sort(order, function(a, b) return a.size > b.size end) - local list = assert(io.open(dir .. "/files", "w")) - for _, entry in ipairs(order) do - list:write(dir, "/", entry.index, ".lua ", entry.file, "\n") - end - list:close() - local forward = {} - for _, text in ipairs(nameFilters) do forward[#forward + 1] = "-t " .. Quote(text) end - for _, tag in ipairs(tags) do forward[#forward + 1] = "--tag " .. Quote(tag) end - local child = "exec luajit tests/run.lua " .. table.concat(forward, " ") .. ' --child "$0" "$1"' - os.execute(string.format("xargs -P %d -L 1 sh -c %s < %s", jobs, Quote(child), Quote(dir .. "/files"))) - for index, file in ipairs(files) do - local chunk = loadfile(dir .. "/" .. index .. ".lua") - local result = chunk and chunk() or { file = file, passed = 0, failed = 1, seconds = 0, - failures = { file .. " did not report a result (the spec process crashed)" } } - results[#results + 1] = result - passed, failed = passed + result.passed, failed + result.failed - for _, failure in ipairs(result.failures) do - failures[#failures + 1] = failure - end - end - os.execute("rm -rf " .. Quote(dir)) -else - for _, file in ipairs(files) do - results[#results + 1] = RunFile(file) - ReportFile(results[#results]) - end -end - -print() -if showTimes then - table.sort(results, function(a, b) return a.seconds > b.seconds end) - print(string.format("%8s %6s %9s %s", "seconds", "tests", "per test", "spec")) - for _, result in ipairs(results) do - local tests = result.passed + result.failed - print(string.format("%8.2f %6d %9.3f %s", result.seconds, tests, result.seconds / math.max(tests, 1), result.file)) - end - print(string.format("%8.2f %6s %9s %s", syntaxSeconds, "", "", "(addon syntax check)")) - print(string.format("%8.2f %6d %9s %s", Now() - startedAt, passed + failed, "", "(total, wall clock)")) -end -for _, failure in ipairs(failures) do - print("FAIL " .. failure) -end -local selectedNothing = passed + failed == 0 -if selectedNothing then - print("No tests matched the given filters.") -end -print(string.format("%d passed, %d failed, %d syntax errors", passed, failed, syntaxErrors)) --- Closing the Lua state lets LuaJIT's profiler (luajit -jp=F tests/run.lua ...) report. -os.exit((failed == 0 and syntaxErrors == 0 and not selectedNothing) and 0 or 1, true) +local wutDir = dofile("tests/wut.lua") +arg[0] = wutDir .. "/wowtest/cli.lua" +dofile(arg[0]) diff --git a/tests/wut.config.lua b/tests/wut.config.lua new file mode 100644 index 0000000..bfc4ecf --- /dev/null +++ b/tests/wut.config.lua @@ -0,0 +1,9 @@ +-- wow-ui-testing runner config (see the library's README, "Configuring wowtest"). +return { + specs = { { dir = "tests/spec/" } }, + path = { "./tests/?.lua" }, + syntax = { + include = { "UnitFrames", "UnitFrames_Workbench", "UnitFrames_ClickGrid", "UnitFrames_Onboarding" }, + exclude = { "*/Libs/*" }, + }, +} diff --git a/tests/wut.lua b/tests/wut.lua new file mode 100644 index 0000000..40682a1 --- /dev/null +++ b/tests/wut.lua @@ -0,0 +1,30 @@ +--[[ +Finds the wow-ui-testing library and puts it on package.path. Runs +scripts/fetch-wut.sh, which downloads the commit pinned in .wut-version into +.wut/ when it isn't there yet (or uses WUT_DIR, a local library checkout). +Returns the library folder. Run from the repository root: + + local wutDir = dofile("tests/wut.lua") +]] +local log = os.tmpname() +local handle = io.popen("bash scripts/fetch-wut.sh 2>" .. log) +local dir = handle:read("*l") +handle:close() + +local messages = io.open(log) +local text = messages and messages:read("*a") or "" +if messages then messages:close() end +os.remove(log) + +if not dir or dir == "" then + io.stderr:write(text) + error("cannot fetch the wow-ui-testing library (scripts/fetch-wut.sh failed); see DEVELOPMENT.md", 0) +end +for line in text:gmatch("[^\n]+") do + if not line:find("already in", 1, true) and not line:find("package.path:", 1, true) then + io.stderr:write(line, "\n") + end +end + +package.path = dir .. "/?.lua;" .. dir .. "/?/init.lua;" .. package.path +return dir diff --git a/wowproof/README.md b/wowproof/README.md deleted file mode 100644 index b138ddd..0000000 --- a/wowproof/README.md +++ /dev/null @@ -1,156 +0,0 @@ -# wowproof - -Visual proof for World of Warcraft addon tests. wowproof takes the frame tree -of a mocked client and renders it to SVG, PNG and an HTML contact sheet. It is -plain Lua 5.1 / LuaJIT and has no dependencies. Two external tools are optional: -`rsvg-convert` turns the SVGs into PNGs, and ImageMagick converts `.tga`/`.blp` -textures. - -It never touches a widget directly. Everything goes through an **adapter**, so -any mock (or any other frame model) can be rendered by writing one. - -## Use - -```lua -package.path = "./?.lua;./?/init.lua;" .. package.path -local Proof = require("wowproof") -local MockState = require("wowproof.adapters.mock_state") - -local proof = Proof.New({ - adapter = MockState({ - isSecret = Mock.IsSecret, - reveal = function(value) return value.secretValue end, - objects = function() return Mock.objects end, - globals = _G, - }), - outDir = ".proof", - assets = { - textures = function(path) return "MyAddon/Media/Glow.tga" end, - fonts = { dirs = { "MyAddon/Fonts" }, family = function(path) return "Roboto", 700 end, default = "Roboto" }, - }, -}) - -proof:Snapshot(MyFrame, "player-frame", { pad = 8, scale = 2, debug = false }) -proof:Sheet() -``` - -`settle = function(layout, region)` (optional) runs after layout and before -painting. It lets the host update state that depends on resolved sizes, such as -backdrop texture coordinates that the real engine recomputes on -`OnSizeChanged`. If `rsvg-convert` is installed but fails, the snapshot -raises an error instead of writing an empty PNG. - -To run named scenarios and get a contact sheet with failures included, use -`require("wowproof.runner").Run({ proof = proof, scenarios = { { name, build } }, filters = arg })`. - -## Adapter contract - -An adapter is a table of functions over the host's region objects. Values -must be plain Lua values. Unwrapping secrets or other host-specific values is -the adapter's job. - -| Function | Returns | -| --- | --- | -| `Parent(r)`, `Children(r)` | the parent region or nil; children in creation order | -| `Order(r)`, `Type(r)`, `Name(r)` | creation index; `Frame`, `StatusBar`, `Texture`, `FontString`, …; a name or nil | -| `Points(r)` | `{ point, relativeTo, relativePoint, x, y }` entries, or `{ all = true, relativeTo }` | -| `Size(r)`, `Scale(r)` | width, height; own scale | -| `Shown(r)`, `Alpha(r)`, `IgnoresParentAlpha(r)` | own shown state; own alpha; boolean | -| `Strata(r)`, `Level(r)`, `Layer(r)` | strata or nil (inherited); frame level; draw layer and sublevel | -| `Texture(r)` | `{ color, vertexColor, file, atlas, gradient = { orientation, from, to }, blend, slice, texCoords }` (`atlas` only while the texture shows it; `texCoords` set after `SetAtlas` are file coordinates, as in the client) | -| `Bar(r)` | nil, or for status bars `{ min, max, value, orientation, reverse, color }` | -| `Text(r)` | nil, or for font strings `{ text, font, size, flags, color, justifyH, justifyV }` | -| `FillOf(r)` *(optional)* | the status bar whose fill texture `r` is; the fill then gets its rect from the bar value | -| `ClipsChildren(r)` *(optional)* | whether the frame clips its children | -| `Model(r)` *(optional)* | nil, or for model frames (`Scene.MODEL_TYPES`) `{ unit, file, displayId, creatureId, zoom, modelAlpha, desaturation }`; all sources nil once cleared | - -`wowproof.scene` validates adapters and lists the strata and draw-layer order. -`wowproof.adapters.mock_state` covers mocks that keep widget state in -`obj.__state` and unimplemented calls in `obj.__calls`. - -## What it draws - -- **Layout:** anchors (single point plus size, two-point stretch, all points), offsets, scale and clipping. - The content is cropped to the snapshot region, everything it draws, and the screen. -- **Paint order:** strata, then frame level, then draw layer, then sublevel, then creation order. - Effective alpha and visibility are honoured. -- **Textures:** - - colour and gradient textures - - Blizzard's white textures, drawn as solid colour - - resolved image files, tinted by vertex colour, including nine-slice and - texture coordinates (crops, mirrors, rotations and tiling beyond 0–1, such as backdrop edges) - - atlases, cropped to their sub-rectangle; later texture coordinates map into it - - anything else as a dashed placeholder titled with its path or atlas name -- **Models:** `PlayerModel` and the other model frames through `assets.models(info)`, which gets - the adapter's `Model(r)` and returns a texture path (resolved through `assets.textures`), - `{ file, texCoords }`, or `{ path, texCoords }` for a local image used as is. The image covers the frame (centre-cropped to its aspect) at the frame's - alpha times the model alpha, desaturated by the model's desaturation. Without art it's a dashed - placeholder titled `model: `; a cleared model draws nothing. -- **Status bars and text:** status bar fills by value, and font strings with justification, outline and `|c` colour codes. - -Rendering is deterministic: the same scene gives the same SVG. - -## Blizzard art - -`wowproof.sources.wow_ui_textures` resolves `Interface\...` paths to PNGs from -the public [Gethe/wow-ui-textures](https://github.com/Gethe/wow-ui-textures) -mirror. It fetches only the files a render asks for, matches names -case-insensitively and caches everything under one pinned commit. Keep the -cache out of version control. It needs `curl` and `jq`. - -```lua -local art = require("wowproof.sources.wow_ui_textures")({ - ref = "d23deaf8f44a7d280dc974a5c9d5321c013db59b", - dir = ".proof-art", - fetch = true, - token = os.getenv("GITHUB_TOKEN"), -}) -assets.textures = function(path) return ownTexture(path) or art(path) end -``` - -Files the commit lacks are remembered in `missing-.txt` and never -requested again. - -The mirror stops at 10.0, so newer art (most atlas sheets) comes from -`wowproof.sources.wago_casc`. It resolves client file IDs to PNGs through -[wago.tools](https://wago.tools)' CASC download, pinned to one client build. -`wowproof.blp` decodes the BLP2 files (uncompressed, palette and DXT1/3/5), -and ImageMagick writes the PNG. It caches under `/casc-/`. - -`assets.atlases` maps an atlas name to `{ file, width, height, left, right, -top, bottom, tilesH, tilesV }`, the fields of `C_Texture.GetAtlasInfo`, with -`file` resolved through `assets.textures`. `wowproof.sources.atlas_table` -wraps a plain table and looks names up case-insensitively, like the client. -Ship a pinned subset of the atlas table with the host so renders stay -deterministic and work offline. - -```lua -local files = require("wowproof.sources.wago_casc")({ build = "1.60.1.70862", dir = ".proof-art" }) -assets.textures = function(path) return ownTexture(path) or art(path) or files(path) end -assets.atlases = require("wowproof.sources.atlas_table")(pinnedAtlases) -``` - -Tiling atlases draw once, not repeated, and flipbooks show their whole sheet. - -Models can't be rendered without the client, so a host maps them to stand-in -art. `wowproof.sources.remote_dir` copies named files once from a private -folder (`host:/dir` over `ssh`, an `https://` URL, or a local folder) into a -cache, for example in-game captures that must not live in the repository: - -```lua -local captures = require("wowproof.sources.remote_dir")({ remote = "nas:/srv/captures", dir = ".proof-art/captures" }) -``` - -A race portrait for player units, from the mirror: - -```lua -assets.models = function(info) - if info.unit then return { file = "Interface\\CharacterFrame\\TemporaryPortrait-Male-Human", texCoords = { 0.14, 0.86, 0.14, 0.86 } } end -end -``` - -## Tests - -`spec/` holds busted-style specs (`describe`/`it`/`assert.*`) that need -nothing but this package. `spec/package_spec.lua` also fails if a file here -mentions the addon that hosts it. diff --git a/wowproof/adapters/mock_state.lua b/wowproof/adapters/mock_state.lua deleted file mode 100644 index bf0ca71..0000000 --- a/wowproof/adapters/mock_state.lua +++ /dev/null @@ -1,228 +0,0 @@ -local Scene = require("wowproof.scene") - -return function(options) - options = options or {} - local isSecret = options.isSecret or function() return false end - local reveal = options.reveal or function(value) return value end - local objects = options.objects or function() return {} end - local globals = options.globals or {} - - local function Plain(value) - if isSecret(value) then return reveal(value) end - return value - end - - local function State(region) - return rawget(region, "__state") - end - - local function LastCall(region, name) - local calls = rawget(region, "__calls") or {} - for index = #calls, 1, -1 do - if calls[index][1] == name then return calls[index] end - end - end - - local function Color(color) - if not color then return nil end - return { Plain(color[1]), Plain(color[2]), Plain(color[3]), Plain(color[4]) } - end - - local function TexCoords(coords) - if type(coords) ~= "table" or #coords < 4 then return nil end - local plain = {} - for index, value in ipairs(coords) do plain[index] = Plain(value) end - return plain - end - - local order = setmetatable({}, { __mode = "k" }) - local function Order(region) - if not order[region] then - for index, object in ipairs(objects()) do order[object] = index end - end - return order[region] or 0 - end - - local adapter = {} - - function adapter.Parent(region) - local parent = State(region).parent - if type(parent) == "table" and rawget(parent, "__state") then return parent end - return nil - end - - function adapter.Children(region) - local state = State(region) - local children = {} - for child in pairs(state.kids or {}) do - if State(child).parent == region then children[#children + 1] = child end - end - table.sort(children, function(a, b) return Order(a) < Order(b) end) - return children - end - - adapter.Order = Order - - function adapter.ClipsChildren(region) - local call = LastCall(region, "SetClipsChildren") - return State(region).clipsChildren == true or (call ~= nil and call[2] == true) - end - - function adapter.FillOf(region) - local parent = adapter.Parent(region) - if parent and State(parent).fill == region then return parent end - return nil - end - - function adapter.Type(region) - return rawget(region, "__type") - end - - function adapter.Name(region) - return State(region).name - end - - function adapter.Points(region) - local points = {} - for _, point in ipairs(State(region).points or {}) do - if point[1] == "ALL" then - points[#points + 1] = { all = true, relativeTo = point[2] } - else - points[#points + 1] = { - point = point[1], - relativeTo = point[2], - relativePoint = point[3], - x = Plain(point[4]), - y = Plain(point[5]), - } - end - end - return points - end - - function adapter.Size(region) - local state = State(region) - return Plain(state.width) or 0, Plain(state.height) or 0 - end - - function adapter.Scale(region) - return Plain(State(region).scale) or 1 - end - - function adapter.Shown(region) - return Plain(State(region).shown) ~= false - end - - function adapter.Alpha(region) - local alpha = Plain(State(region).alpha) - if alpha == nil then return 1 end - return alpha - end - - function adapter.IgnoresParentAlpha(region) - return State(region).ignoreParentAlpha == true - end - - function adapter.Strata(region) - return State(region).strata - end - - function adapter.Level(region) - return Plain(State(region).level) or 0 - end - - function adapter.Layer(region) - local call = LastCall(region, "SetDrawLayer") - if call then return call[2], call[3] end - return State(region).layer, State(region).sublevel - end - - function adapter.Texture(region) - local state = State(region) - local gradient - if state.gradient then - gradient = { orientation = state.gradient[1], from = Color(state.gradient[2]), to = Color(state.gradient[3]) } - end - local bar = adapter.FillOf(region) - local barState = bar and State(bar) or {} - local file = state.texture or barState.texture - if file ~= nil and type(file) ~= "string" then file = tostring(file) end - local atlas - if file and file:sub(1, 6) == "atlas:" then atlas, file = state.atlas or file:sub(7), nil end - return { - color = Color(state.colorTexture), - vertexColor = Color(barState.color) or Color(state.vertexColor), - file = file, - atlas = atlas, - gradient = gradient, - blend = state.blendMode, - slice = state.sliceMargins, - texCoords = TexCoords(state.texCoords), - } - end - - function adapter.Bar(region) - if adapter.Type(region) ~= "StatusBar" then return nil end - local state = State(region) - local fill = state.fill and State(state.fill) or {} - return { - min = Plain(state.min), - max = Plain(state.max), - value = Plain(state.value), - orientation = state.orientation, - reverse = state.reverseFill == true, - color = Color(state.color) or Color(fill.vertexColor) or Color(fill.colorTexture), - file = state.texture, - } - end - - local MODEL_SOURCES = { SetUnit = "unit", SetModel = "file", SetDisplayInfo = "displayId", SetCreature = "creatureId" } - - function adapter.Model(region) - if not Scene.IsModel(adapter, region) then return nil end - local state = State(region) - local info = { zoom = 0, desaturation = 0 } - for _, call in ipairs(rawget(region, "__calls") or {}) do - local name = call[1] - if name == "ClearModel" or MODEL_SOURCES[name] then - info.unit, info.file, info.displayId, info.creatureId = nil, nil, nil, nil - if MODEL_SOURCES[name] then info[MODEL_SOURCES[name]] = Plain(call[2]) end - elseif name == "SetPortraitZoom" then - info.zoom = Plain(call[2]) - elseif name == "SetDesaturation" then - info.desaturation = Plain(call[2]) - end - end - local modelAlpha = Plain(state.modelAlpha) - info.modelAlpha = modelAlpha == nil and 1 or modelAlpha - return info - end - - local function FontObject(value) - if type(value) == "string" then value = globals[value] end - if type(value) == "table" and rawget(value, "__state") then return value end - return nil - end - - function adapter.Text(region) - if adapter.Type(region) ~= "FontString" then return nil end - local state = State(region) - local font = state.font - local fontObject = FontObject(state.fontObject) - local inherited = fontObject and State(fontObject) - font = font or (inherited and inherited.font) or {} - local justifyH = state.justifyH or (LastCall(region, "SetJustifyH") or {})[2] - local justifyV = state.justifyV or (LastCall(region, "SetJustifyV") or {})[2] - return { - text = Plain(state.text), - font = font[1], - size = Plain(font[2]) or 12, - flags = font[3], - color = Color(state.textColor) or (inherited and Color(inherited.textColor)), - justifyH = justifyH, - justifyV = justifyV, - } - end - - return adapter -end diff --git a/wowproof/blp.lua b/wowproof/blp.lua deleted file mode 100644 index 2160a4f..0000000 --- a/wowproof/blp.lua +++ /dev/null @@ -1,151 +0,0 @@ -local ffi = require("ffi") -local bit = require("bit") - -local band, bor, rshift, lshift = bit.band, bit.bor, bit.rshift, bit.lshift - -local Blp = {} - -local HEADER_SIZE = 1172 -local PALETTE_OFFSET = 148 -local COMPRESSION_PALETTE, COMPRESSION_DXT, COMPRESSION_RAW = 1, 2, 3 -local DXT1, DXT3, DXT5 = 0, 1, 7 - -local function UInt16(bytes, offset) - return bor(bytes[offset], lshift(bytes[offset + 1], 8)) -end - -local function UInt32(bytes, offset) - return bytes[offset] + bytes[offset + 1] * 256 + bytes[offset + 2] * 65536 + bytes[offset + 3] * 16777216 -end - -local function Expand565(color) - local r, g, b = band(rshift(color, 11), 31), band(rshift(color, 5), 63), band(color, 31) - return math.floor(r * 255 / 31 + 0.5), math.floor(g * 255 / 63 + 0.5), math.floor(b * 255 / 31 + 0.5) -end - -local function Mix(a, b, weightA, weightB, total) - return math.floor((a * weightA + b * weightB) / total + 0.5) -end - -local function ColorPalette(bytes, offset, fourColor) - local c0, c1 = UInt16(bytes, offset), UInt16(bytes, offset + 2) - local r0, g0, b0 = Expand565(c0) - local r1, g1, b1 = Expand565(c1) - local palette = { { r0, g0, b0, 255 }, { r1, g1, b1, 255 } } - if fourColor or c0 > c1 then - palette[3] = { Mix(r0, r1, 2, 1, 3), Mix(g0, g1, 2, 1, 3), Mix(b0, b1, 2, 1, 3), 255 } - palette[4] = { Mix(r0, r1, 1, 2, 3), Mix(g0, g1, 1, 2, 3), Mix(b0, b1, 1, 2, 3), 255 } - else - palette[3] = { Mix(r0, r1, 1, 1, 2), Mix(g0, g1, 1, 1, 2), Mix(b0, b1, 1, 1, 2), 255 } - palette[4] = { 0, 0, 0, 0 } - end - return palette -end - -local function Dxt3Alpha(bytes, offset) - local alphas = {} - for index = 0, 15 do - local byte = bytes[offset + rshift(index, 1)] - alphas[index] = band(rshift(byte, band(index, 1) * 4), 15) * 17 - end - return alphas -end - -local function Dxt5Alpha(bytes, offset) - local a0, a1 = bytes[offset], bytes[offset + 1] - local levels = { [0] = a0, a1 } - if a0 > a1 then - for step = 2, 7 do levels[step] = Mix(a0, a1, 8 - step, step - 1, 7) end - else - for step = 2, 5 do levels[step] = Mix(a0, a1, 6 - step, step - 1, 5) end - levels[6], levels[7] = 0, 255 - end - local alphas = {} - for half = 0, 1 do - local base = offset + 2 + half * 3 - local bits = bytes[base] + bytes[base + 1] * 256 + bytes[base + 2] * 65536 - for index = 0, 7 do alphas[half * 8 + index] = levels[band(rshift(bits, index * 3), 7)] end - end - return alphas -end - -local function DecodeDxt(bytes, offset, width, height, alphaType, out) - local blockSize = alphaType == DXT1 and 8 or 16 - local blocksWide, blocksHigh = math.ceil(width / 4), math.ceil(height / 4) - for blockY = 0, blocksHigh - 1 do - for blockX = 0, blocksWide - 1 do - local block = offset + (blockY * blocksWide + blockX) * blockSize - local alphas - if alphaType == DXT3 then alphas = Dxt3Alpha(bytes, block) elseif alphaType == DXT5 then alphas = Dxt5Alpha(bytes, block) end - local colorOffset = alphaType == DXT1 and block or block + 8 - local palette = ColorPalette(bytes, colorOffset, alphaType ~= DXT1) - local indices = UInt32(bytes, colorOffset + 4) - for index = 0, 15 do - local x, y = blockX * 4 + index % 4, blockY * 4 + math.floor(index / 4) - if x < width and y < height then - local color = palette[band(rshift(indices, index * 2), 3) + 1] - local target = (y * width + x) * 4 - out[target], out[target + 1], out[target + 2] = color[1], color[2], color[3] - out[target + 3] = alphas and alphas[index] or color[4] - end - end - end - end -end - -local function PaletteAlpha(bytes, offset, index, depth) - if depth == 8 then return bytes[offset + index] end - if depth == 4 then return band(rshift(bytes[offset + rshift(index, 1)], band(index, 1) * 4), 15) * 17 end - if depth == 1 then return band(rshift(bytes[offset + rshift(index, 3)], band(index, 7)), 1) * 255 end - return 255 -end - -local function DecodePalette(bytes, offset, pixels, alphaDepth, out) - for index = 0, pixels - 1 do - local entry = PALETTE_OFFSET + bytes[offset + index] * 4 - local target = index * 4 - out[target], out[target + 1], out[target + 2] = bytes[entry + 2], bytes[entry + 1], bytes[entry] - out[target + 3] = PaletteAlpha(bytes, offset + pixels, index, alphaDepth) - end -end - -local function DecodeRaw(bytes, offset, pixels, out) - for index = 0, pixels - 1 do - local source, target = offset + index * 4, index * 4 - out[target], out[target + 1], out[target + 2], out[target + 3] = - bytes[source + 2], bytes[source + 1], bytes[source], bytes[source + 3] - end -end - -local function ExpectedSize(compression, alphaDepth, alphaType, width, height) - local pixels = width * height - if compression == COMPRESSION_RAW then return pixels * 4 end - if compression == COMPRESSION_PALETTE then return pixels + math.ceil(pixels * alphaDepth / 8) end - if compression == COMPRESSION_DXT and (alphaType == DXT1 or alphaType == DXT3 or alphaType == DXT5) then - return math.ceil(width / 4) * math.ceil(height / 4) * (alphaType == DXT1 and 8 or 16) - end - return nil -end - -function Blp.Decode(data) - if type(data) ~= "string" or #data < HEADER_SIZE or data:sub(1, 4) ~= "BLP2" then return nil, "not a BLP2 file" end - local bytes = ffi.cast("const uint8_t*", data) - local compression, alphaDepth, alphaType = bytes[8], bytes[9], bytes[10] - local width, height = UInt32(bytes, 12), UInt32(bytes, 16) - local offset, size = UInt32(bytes, 20), UInt32(bytes, 84) - local expected = ExpectedSize(compression, alphaDepth, alphaType, width, height) - if not expected then return nil, string.format("unsupported BLP2 encoding %d/%d", compression, alphaType) end - if width == 0 or height == 0 or size < expected or offset + expected > #data then return nil, "truncated BLP2 file" end - local pixels = width * height - local out = ffi.new("uint8_t[?]", pixels * 4) - if compression == COMPRESSION_RAW then - DecodeRaw(bytes, offset, pixels, out) - elseif compression == COMPRESSION_PALETTE then - DecodePalette(bytes, offset, pixels, alphaDepth, out) - else - DecodeDxt(bytes, offset, width, height, alphaType, out) - end - return width, height, ffi.string(out, pixels * 4) -end - -return Blp diff --git a/wowproof/init.lua b/wowproof/init.lua deleted file mode 100644 index eacd11b..0000000 --- a/wowproof/init.lua +++ /dev/null @@ -1,159 +0,0 @@ -local Scene = require("wowproof.scene") -local Layout = require("wowproof.layout") -local Paint = require("wowproof.paint") -local Raster = require("wowproof.raster") -local Sheet = require("wowproof.sheet") - -local Proof = {} -Proof.__index = Proof -Proof.Scene, Proof.Layout, Proof.Paint, Proof.Raster, Proof.Sheet = Scene, Layout, Paint, Raster, Sheet - -function Proof.New(options) - options = options or {} - local assets = options.assets or {} - local outDir = options.outDir or ".proof" - return setmetatable({ - adapter = Scene.Validate(options.adapter), - assets = assets, - outDir = outDir, - cacheDir = outDir .. "/.cache", - screen = options.screen, - scale = options.scale or 2, - png = options.png ~= false, - title = options.title or "UI proof", - settle = options.settle, - entries = {}, - images = {}, - atlases = {}, - }, Proof) -end - -local function LoadImage(self, key, locate) - local cached = self.images[key] - if cached == nil then - local localFile = locate() - local png = localFile and Raster.ToPng(localFile, self.cacheDir) - local uri = png and Raster.DataUri(png) - cached = false - if uri then - local width, height = Raster.PngSize(png) - cached = { uri = uri, width = width, height = height } - end - self.images[key] = cached - end - if not cached then return nil end - return cached.uri, cached.width, cached.height -end - -function Proof:Image(file) - return LoadImage(self, file, function() - local resolve = self.assets.textures - return resolve and resolve(file) - end) -end - -function Proof:File(path) - return LoadImage(self, "path:" .. path, function() return path end) -end - -local function Pixel(value, size) - return math.floor(value * size + 0.5) -end - -local function LoadAtlas(self, name) - local resolve, textures = self.assets.atlases, self.assets.textures - local info = resolve and textures and resolve(name) - local file = info and textures(info.file) - local png = file and Raster.ToPng(file, self.cacheDir) - if not png then return false end - local width, height = Raster.PngSize(png) - if not width then return false end - local left, top = Pixel(info.left, width), Pixel(info.top, height) - local rect = { left = left, top = top, width = Pixel(info.right, width) - left, height = Pixel(info.bottom, height) - top } - if rect.width <= 0 or rect.height <= 0 then return false end - local crop = Raster.Crop(png, rect, self.cacheDir) - local uri = crop and Raster.DataUri(crop) - if not uri then return false end - return { uri = uri, width = rect.width, height = rect.height, - rect = { left = info.left, right = info.right, top = info.top, bottom = info.bottom } } -end - -function Proof:Atlas(name) - local cached = self.atlases[name] - if cached == nil then - cached = LoadAtlas(self, name) or false - self.atlases[name] = cached - end - if not cached then return nil end - return cached.uri, cached.width, cached.height, cached.rect -end - -function Proof:Font(file) - local fonts = self.assets.fonts - if not fonts then return nil end - if fonts.family then - local family, weight = fonts.family(file) - if family then return family, weight end - end - return fonts.default, fonts.defaultWeight -end - -local function FileName(name) - return (name:gsub("[^%w%-_]+", "-")) -end - -function Proof:Render(region, options) - options = options or {} - local layout = Layout.New(self.adapter, self.screen) - if self.settle then self.settle(layout, region) end - return Paint.Render({ - adapter = self.adapter, - layout = layout, - root = region, - pad = options.pad, - debug = options.debug, - background = options.background, - image = function(file) return self:Image(file) end, - file = function(path) return self:File(path) end, - atlas = function(name) return self:Atlas(name) end, - font = function(file) return self:Font(file) end, - model = function(info) return self.assets.models and self.assets.models(info) end, - }) -end - -function Proof:Snapshot(region, name, options) - options = options or {} - local svg, info = self:Render(region, options) - Raster.MakeDir(self.outDir) - local base = self.outDir .. "/" .. FileName(name) - local entry = { name = name, svg = base .. ".svg", width = info.width, height = info.height, regions = info.regions } - Raster.Write(entry.svg, svg) - if self.png then - local fonts = self.assets.fonts and self.assets.fonts.dirs - self.fontConfig = self.fontConfig or Raster.FontConfig(fonts, self.cacheDir) - if Raster.Has("rsvg-convert") then - entry.png = Raster.SvgToPng(entry.svg, base .. ".png", options.scale or self.scale, self.fontConfig) - if not entry.png then - os.remove(base .. ".png") - error("wowproof: rsvg-convert could not render " .. entry.svg, 2) - end - end - end - self.entries[#self.entries + 1] = entry - return entry -end - -function Proof:Fail(name, message) - local entry = { name = name, error = tostring(message) } - self.entries[#self.entries + 1] = entry - return entry -end - -function Proof:Sheet() - Raster.MakeDir(self.outDir) - local file = self.outDir .. "/index.html" - Raster.Write(file, Sheet.Render(self.title, self.entries)) - return file -end - -return Proof diff --git a/wowproof/layout.lua b/wowproof/layout.lua deleted file mode 100644 index fb3d3cc..0000000 --- a/wowproof/layout.lua +++ /dev/null @@ -1,141 +0,0 @@ -local Layout = {} -Layout.__index = Layout - -local FRACTIONS = { - TOPLEFT = { 0, 0 }, - TOP = { 0.5, 0 }, - TOPRIGHT = { 1, 0 }, - LEFT = { 0, 0.5 }, - CENTER = { 0.5, 0.5 }, - RIGHT = { 1, 0.5 }, - BOTTOMLEFT = { 0, 1 }, - BOTTOM = { 0.5, 1 }, - BOTTOMRIGHT = { 1, 1 }, -} -Layout.FRACTIONS = FRACTIONS - -local UNRESOLVED = false - -function Layout.New(adapter, screen) - screen = screen or { width = 1920, height = 1080 } - return setmetatable({ - adapter = adapter, - screen = { left = 0, top = 0, width = screen.width, height = screen.height }, - rects = {}, - scales = {}, - resolving = {}, - }, Layout) -end - -function Layout:Scale(region) - local cached = self.scales[region] - if cached then return cached end - local scale = self.adapter.Scale(region) or 1 - local parent = self.adapter.Parent(region) - if parent then scale = scale * self:Scale(parent) end - self.scales[region] = scale - return scale -end - -function Layout:Place(region, rect) - self.rects[region] = rect -end - -function Layout:Rect(region) - if region == nil then return self.screen end - local cached = self.rects[region] - if cached ~= nil then return cached or nil end - if self.resolving[region] then return nil end - self.resolving[region] = true - local rect = self:Resolve(region) - self.resolving[region] = nil - self.rects[region] = rect or UNRESOLVED - return rect -end - -local function Axis(anchors, size) - local low, high - for _, anchor in ipairs(anchors) do - if not low or anchor[1] < low[1] then low = anchor end - if not high or anchor[1] > high[1] then high = anchor end - end - if not low then return nil end - if low[1] ~= high[1] then - local span = (high[2] - low[2]) / (high[1] - low[1]) - return low[2] - low[1] * span, span - end - return low[2] - low[1] * size, size -end - -function Layout:IntrinsicSize(region, width, height) - if self.adapter.Type(region) ~= "FontString" then return width, height end - local text = self.adapter.Text(region) - local size = text and text.size or 12 - if width == 0 then width = #tostring(text and text.text or "") * size * 0.55 end - if height == 0 then height = size end - return width, height -end - -local function Clamp(value) - if value < 0 then return 0 end - if value > 1 then return 1 end - return value -end - -function Layout:FillRect(bar) - local rect = self:Rect(bar) - local info = rect and self.adapter.Bar(bar) - if not info then return nil end - local low, high, value = info.min or 0, info.max or 1, info.value or 0 - local fraction = high > low and Clamp((value - low) / (high - low)) or 0 - local fill = { left = rect.left, top = rect.top, width = rect.width, height = rect.height } - if info.orientation == "VERTICAL" then - fill.height = rect.height * fraction - if not info.reverse then fill.top = rect.top + rect.height - fill.height end - else - fill.width = rect.width * fraction - if info.reverse then fill.left = rect.left + rect.width - fill.width end - end - return fill -end - -function Layout:Resolve(region) - local adapter = self.adapter - local bar = adapter.FillOf and adapter.FillOf(region) - if bar then return self:FillRect(bar) end - local points = adapter.Points(region) - local parent = adapter.Parent(region) - if #points == 0 then - if parent then return nil end - return self.screen - end - local scale = self:Scale(region) - local width, height = adapter.Size(region) - width, height = self:IntrinsicSize(region, width or 0, height or 0) - width, height = width * scale, height * scale - local xs, ys = {}, {} - for _, point in ipairs(points) do - local relative = point.relativeTo or parent - local target = self:Rect(relative) - if not target then return nil end - if point.all then - xs[#xs + 1] = { 0, target.left } - xs[#xs + 1] = { 1, target.left + target.width } - ys[#ys + 1] = { 0, target.top } - ys[#ys + 1] = { 1, target.top + target.height } - else - local own = FRACTIONS[point.point] - local other = FRACTIONS[point.relativePoint or point.point] - if not own or not other then - error("unknown anchor point " .. tostring(point.point) .. "/" .. tostring(point.relativePoint), 2) - end - xs[#xs + 1] = { own[1], target.left + other[1] * target.width + (point.x or 0) * scale } - ys[#ys + 1] = { own[2], target.top + other[2] * target.height - (point.y or 0) * scale } - end - end - local left, resolvedWidth = Axis(xs, width) - local top, resolvedHeight = Axis(ys, height) - return { left = left, top = top, width = resolvedWidth, height = resolvedHeight } -end - -return Layout diff --git a/wowproof/paint.lua b/wowproof/paint.lua deleted file mode 100644 index a4e3b4d..0000000 --- a/wowproof/paint.lua +++ /dev/null @@ -1,557 +0,0 @@ -local Scene = require("wowproof.scene") - -local Paint = {} - -local DEFAULT_BAR_COLOR = { 0.2, 0.7, 0.3, 1 } -local DEFAULT_TEXT_COLOR = { 1, 1, 1, 1 } -local PLACEHOLDER_COLOR = { 0.42, 0.45, 0.5, 0.25 } - -local function Number(value) - if math.abs(value) < 0.005 then return "0" end - local text = string.format("%.2f", value):gsub("%.?0+$", "") - return text -end -Paint.Number = Number - -local function Escape(text) - return (tostring(text):gsub("&", "&"):gsub("<", "<"):gsub(">", ">"):gsub('"', """)) -end -Paint.Escape = Escape - -local function Clamp(value) - if value < 0 then return 0 end - if value > 1 then return 1 end - return value -end - -local function Rgb(color) - return string.format("rgb(%d,%d,%d)", - math.floor(Clamp(color[1] or 0) * 255 + 0.5), - math.floor(Clamp(color[2] or 0) * 255 + 0.5), - math.floor(Clamp(color[3] or 0) * 255 + 0.5)) -end - -local function Multiply(color, tint) - if not tint then return color end - return { - (color[1] or 1) * (tint[1] or 1), - (color[2] or 1) * (tint[2] or 1), - (color[3] or 1) * (tint[3] or 1), - (color[4] or 1) * (tint[4] or 1), - } -end - -local function RectAttributes(rect) - return string.format('x="%s" y="%s" width="%s" height="%s"', - Number(rect.left), Number(rect.top), Number(math.max(rect.width, 0)), Number(math.max(rect.height, 0))) -end - -local function Fill(color, alpha) - return string.format('fill="%s" fill-opacity="%s"', Rgb(color), Number(Clamp((color[4] or 1) * alpha))) -end - -local function Union(a, b) - if not a then return { left = b.left, top = b.top, width = b.width, height = b.height } end - local left, top = math.min(a.left, b.left), math.min(a.top, b.top) - local right = math.max(a.left + a.width, b.left + b.width) - local bottom = math.max(a.top + a.height, b.top + b.height) - return { left = left, top = top, width = right - left, height = bottom - top } -end - -local function Intersect(a, b) - local left, top = math.max(a.left, b.left), math.max(a.top, b.top) - local right = math.min(a.left + a.width, b.left + b.width) - local bottom = math.min(a.top + a.height, b.top + b.height) - if right <= left or bottom <= top then return nil end - return { left = left, top = top, width = right - left, height = bottom - top } -end - -local function Contains(outer, inner) - return inner.left >= outer.left and inner.top >= outer.top - and inner.left + inner.width <= outer.left + outer.width - and inner.top + inner.height <= outer.top + outer.height -end - -local Context = {} -Context.__index = Context - -function Context:Define(markup) - self.nextId = self.nextId + 1 - local id = "d" .. self.nextId - self.defs[#self.defs + 1] = markup:gsub("{id}", id) - return id -end - -function Context:Emit(markup) - self.body[#self.body + 1] = markup -end - -function Context:Visible(region) - local node = region - while node do - if not self.adapter.Shown(node) then return false end - if node == self.root then return true end - node = self.adapter.Parent(node) - end - return true -end - -function Context:EffectiveAlpha(region) - local alpha, node = 1, region - while node do - alpha = alpha * (self.adapter.Alpha(node) or 1) - if node == self.root or self.adapter.IgnoresParentAlpha(node) then break end - node = self.adapter.Parent(node) - end - return alpha -end - -function Context:Clip(region) - local cached = self.clips[region] - if cached ~= nil then return cached or nil end - local parent = region ~= self.root and self.adapter.Parent(region) - local clip - if parent then - clip = self:Clip(parent) - local parentRect = self.adapter.ClipsChildren and self.adapter.ClipsChildren(parent) and self.layout:Rect(parent) - if parentRect then - if clip then - clip = Intersect(clip, parentRect) or { left = parentRect.left, top = parentRect.top, width = 0, height = 0 } - else - clip = parentRect - end - end - end - self.clips[region] = clip or false - return clip -end - -function Context:ClipPath(clip) - local key = string.format("%s,%s,%s,%s", Number(clip.left), Number(clip.top), Number(clip.width), Number(clip.height)) - if not self.clipIds[key] then - self.clipIds[key] = self:Define(string.format('', RectAttributes(clip))) - end - return self.clipIds[key] -end - -function Context:Strata(region) - local node = region - while node do - local strata = self.adapter.Strata(node) - if strata then return Scene.STRATA_INDEX[strata] or Scene.STRATA_INDEX.MEDIUM end - node = self.adapter.Parent(node) - end - return Scene.STRATA_INDEX.MEDIUM -end - -function Context:SortKey(region) - local adapter = self.adapter - local isRegion = Scene.IsRegion(adapter, region) - local frame = isRegion and adapter.Parent(region) or region - local layer, sublevel = adapter.Layer(region) - if not isRegion then layer = "ARTWORK" end - return { - self:Strata(frame), - frame and adapter.Level(frame) or 0, - Scene.LAYER_INDEX[layer or "ARTWORK"] or Scene.LAYER_INDEX.ARTWORK, - sublevel or 0, - adapter.Order(region), - } -end - -local function CompareKeys(a, b) - for index = 1, #a.key do - if a.key[index] ~= b.key[index] then return a.key[index] < b.key[index] end - end - return false -end - -function Context:Collect(region, out) - out[#out + 1] = region - for _, child in ipairs(self.adapter.Children(region)) do self:Collect(child, out) end - return out -end - -local GRADIENT = '' - .. '' - .. '' - -function Context:ImageDef(key, load) - local cached = self.images[key] - if cached ~= nil then return cached or nil end - local href, width, height, rect = load() - if not href then - self.images[key] = false - return nil - end - local id = self:Define(string.format('', - Number(width or 1), Number(height or 1), href)) - local image = { id = id, width = width, height = height, rect = rect } - self.images[key] = image - return image -end - -local function AtlasCoords(coords, rect) - if not coords or #coords < 4 then return nil end - local width, height = rect.right - rect.left, rect.bottom - rect.top - local function U(value) return (value - rect.left) / width end - local function V(value) return (value - rect.top) / height end - if #coords >= 8 then - local mapped = {} - for index = 1, 8, 2 do mapped[index], mapped[index + 1] = U(coords[index]), V(coords[index + 1]) end - return mapped - end - return { U(coords[1]), U(coords[2]), V(coords[3]), V(coords[4]) } -end -Paint.AtlasCoords = AtlasCoords - -function Context:TextureImage(texture) - if texture.atlas then - local atlas = texture.atlas - local image = self:ImageDef("atlas:" .. atlas, function() return self.atlas(atlas) end) - if image then return image, AtlasCoords(texture.texCoords, image.rect) end - end - local file = texture.file - if not file then return nil end - return self:ImageDef(file, function() return self.image(file) end), texture.texCoords -end - -function Context:DrawImagePiece(image, target, source) - if target.width <= 0 or target.height <= 0 or source.width <= 0 or source.height <= 0 then return end - self:Emit(string.format('', - RectAttributes(target), Number(source.left), Number(source.top), Number(source.width), Number(source.height), image.id)) -end - -local function SourceRect(coords, width, height) - if not coords or #coords < 4 then return { left = 0, top = 0, width = width, height = height } end - local xs, ys = { coords[1], coords[2] }, { coords[3], coords[4] } - if #coords >= 8 then - xs = { coords[1], coords[3], coords[5], coords[7] } - ys = { coords[2], coords[4], coords[6], coords[8] } - end - local left, right = math.min(unpack(xs)), math.max(unpack(xs)) - local top, bottom = math.min(unpack(ys)), math.max(unpack(ys)) - return { left = left * width, top = top * height, width = (right - left) * width, height = (bottom - top) * height } -end -Paint.SourceRect = SourceRect - -local function Corners(coords) - if #coords >= 8 then - return { coords[1], coords[2] }, { coords[3], coords[4] }, { coords[5], coords[6] } - end - local left, right, top, bottom = coords[1], coords[2], coords[3], coords[4] - return { left, top }, { left, bottom }, { right, top } -end - -local function NeedsAffine(coords) - if not coords or #coords < 4 then return false end - for _, value in ipairs(coords) do - if value < 0 or value > 1 then return true end - end - local upperLeft, lowerLeft, upperRight = Corners(coords) - return upperLeft[2] ~= upperRight[2] or upperLeft[1] ~= lowerLeft[1] - or upperRight[1] < upperLeft[1] or lowerLeft[2] < upperLeft[2] -end -Paint.NeedsAffine = NeedsAffine - -local MAX_TILE = 8192 - -local function AffineTransform(rect, coords, width, height) - local upperLeft, lowerLeft, upperRight = Corners(coords) - local ax, ay = upperRight[1] - upperLeft[1], upperRight[2] - upperLeft[2] - local bx, by = lowerLeft[1] - upperLeft[1], lowerLeft[2] - upperLeft[2] - local det = ax * by - bx * ay - if math.abs(det) < 1e-9 then return nil end - local w, h = rect.width, rect.height - local tileWidth = math.sqrt((w * by / det) ^ 2 + (h * ay / det) ^ 2) - local tileHeight = math.sqrt((w * bx / det) ^ 2 + (h * ax / det) ^ 2) - if tileWidth < 0.01 or tileHeight < 0.01 or tileWidth > MAX_TILE or tileHeight > MAX_TILE then return nil end - return { - w * by / det / width, - h * -ay / det / width, - w * -bx / det / height, - h * ax / det / height, - rect.left - w * (by * upperLeft[1] - bx * upperLeft[2]) / det, - rect.top - h * (ax * upperLeft[2] - ay * upperLeft[1]) / det, - } -end -Paint.AffineTransform = AffineTransform - -local function SliceSpans(start, length, sourceLength, low, high) - local scale = math.min(1, length / math.max(low + high, 1)) - local lowTarget, highTarget = low * scale, high * scale - return { - { start, lowTarget, 0, low }, - { start + lowTarget, length - lowTarget - highTarget, low, sourceLength - low - high }, - { start + length - highTarget, highTarget, sourceLength - high, high }, - } -end - -function Context:DrawImageAffine(image, rect, coords) - if rect.width <= 0 or rect.height <= 0 then return end - local matrix = AffineTransform(rect, coords, image.width, image.height) - if not matrix then return end - local values = {} - for index, value in ipairs(matrix) do values[index] = string.format("%.6g", value) end - local id = self:Define(string.format( - '', - Number(image.width), Number(image.height), table.concat(values, " "), image.id)) - self:Emit(string.format('', RectAttributes(rect), id)) -end - -function Context:DrawNineSlice(image, slice, rect) - local columns = SliceSpans(rect.left, rect.width, image.width, slice[1] or 0, slice[3] or 0) - local rows = SliceSpans(rect.top, rect.height, image.height, slice[2] or 0, slice[4] or 0) - for _, row in ipairs(rows) do - for _, column in ipairs(columns) do - self:DrawImagePiece(image, - { left = column[1], top = row[1], width = column[2], height = row[2] }, - { left = column[3], top = row[3], width = column[4], height = row[4] }) - end - end -end - -function Context:DrawTexture(region, rect, alpha) - local texture = self.adapter.Texture(region) - if not texture then return end - local blend = texture.blend == "ADD" and ' style="mix-blend-mode:screen"' or "" - if texture.gradient then - local from, to = texture.gradient.from, texture.gradient.to - local vertical = texture.gradient.orientation == "VERTICAL" - local id = self:Define(string.format(GRADIENT, - "0", vertical and "1" or "0", vertical and "0" or "1", "0", - Rgb(from), Number(Clamp((from[4] or 1) * alpha)), Rgb(to), Number(Clamp((to[4] or 1) * alpha)))) - self:Emit(string.format('', RectAttributes(rect), id, blend)) - return - end - local solid = texture.color or (Scene.IsSolidFile(texture.file) and { 1, 1, 1, 1 }) - if solid then - self:Emit(string.format('', RectAttributes(rect), Fill(Multiply(solid, texture.vertexColor), alpha), blend)) - return - end - local image, coords = self:TextureImage(texture) - if image then - local filter = "" - local tint = texture.vertexColor - if tint then - local id = self:Define(string.format( - '', - Number(tint[1] or 1), Number(tint[2] or 1), Number(tint[3] or 1), Number(tint[4] or 1))) - filter = string.format(' filter="url(#%s)"', id) - end - self:Emit(string.format('', Number(Clamp(alpha)), filter, blend)) - if texture.slice and image.width then - self:DrawNineSlice(image, texture.slice, rect) - elseif NeedsAffine(coords) and image.width then - self:DrawImageAffine(image, rect, coords) - else - self:DrawImagePiece(image, rect, SourceRect(coords, image.width or 1, image.height or 1)) - end - self:Emit("") - return - end - if texture.vertexColor and texture.file then - self:Emit(string.format('', RectAttributes(rect), Fill(texture.vertexColor, alpha), blend)) - return - end - if texture.file or texture.atlas then self:DrawPlaceholder(rect, alpha, texture.file or texture.atlas) end -end - -function Context:DrawPlaceholder(rect, alpha, title) - self:Emit(string.format('%s', - RectAttributes(rect), Fill(PLACEHOLDER_COLOR, alpha), Rgb(PLACEHOLDER_COLOR), Escape(title))) -end - -local function CoverRect(source, target) - if source.width <= 0 or source.height <= 0 or target.width <= 0 or target.height <= 0 then return source end - local aspect = target.width / target.height - if source.width / source.height > aspect then - local width = source.height * aspect - return { left = source.left + (source.width - width) / 2, top = source.top, width = width, height = source.height } - end - local height = source.width / aspect - return { left = source.left, top = source.top + (source.height - height) / 2, width = source.width, height = height } -end -Paint.CoverRect = CoverRect - -local function ModelSubject(info) - return info.unit or info.file or (info.displayId and "display " .. info.displayId) - or (info.creatureId and "creature " .. info.creatureId) -end -Paint.ModelSubject = ModelSubject - -function Context:DrawModel(region, rect, alpha) - local info = self.adapter.Model and self.adapter.Model(region) - if not info then - self:DrawPlaceholder(rect, alpha, "model: " .. self.adapter.Type(region)) - return - end - local subject = ModelSubject(info) - alpha = alpha * Clamp(info.modelAlpha or 1) - if not subject or alpha <= 0 then return end - local art = self.model(info) - if type(art) == "string" then art = { file = art } end - local image - if art and art.path then - image = self:ImageDef("path:" .. art.path, function() return self.file(art.path) end) - elseif art and art.file then - image = self:ImageDef(art.file, function() return self.image(art.file) end) - end - if not image or not image.width then - self:DrawPlaceholder(rect, alpha, "model: " .. subject) - return - end - local filter = "" - local desaturation = Clamp(info.desaturation or 0) - if desaturation > 0 then - local id = self:Define(string.format( - '', - Number(1 - desaturation))) - filter = string.format(' filter="url(#%s)"', id) - end - self:Emit(string.format('', Number(alpha), filter)) - self:DrawImagePiece(image, rect, CoverRect(SourceRect(art.texCoords, image.width, image.height), rect)) - self:Emit("") -end - -function Context:DrawBar(region, alpha) - local bar = self.adapter.Bar(region) - local fill = bar and self.layout:FillRect(region) - if not fill or fill.width <= 0 or fill.height <= 0 then return end - local color = bar.color or DEFAULT_BAR_COLOR - self:Emit(string.format('', RectAttributes(fill), Fill(color, alpha))) -end - -local ANCHORS = { LEFT = "start", CENTER = "middle", RIGHT = "end" } - -local function Segments(text, baseColor) - local segments, color, position = {}, baseColor, 1 - text = text:gsub("|T.-|t", ""):gsub("|A.-|a", ""):gsub("|n", "\n") - while position <= #text do - local start, finish, code = text:find("|c(%x%x%x%x%x%x%x%x)", position) - local reset = text:find("|r", position, true) - local nextStop = math.min(start or #text + 1, reset or #text + 1) - if nextStop > position then segments[#segments + 1] = { text:sub(position, nextStop - 1), color } end - if start and start == nextStop then - color = { - tonumber(code:sub(3, 4), 16) / 255, - tonumber(code:sub(5, 6), 16) / 255, - tonumber(code:sub(7, 8), 16) / 255, - tonumber(code:sub(1, 2), 16) / 255, - } - position = finish + 1 - elseif reset and reset == nextStop then - color = baseColor - position = reset + 2 - else - position = nextStop - end - end - return segments -end -Paint.Segments = Segments - -function Context:DrawText(region, rect, alpha) - local text = self.adapter.Text(region) - if not text or text.text == nil or tostring(text.text) == "" then return end - local size = text.size or 12 - local justify = text.justifyH or "CENTER" - local x = rect.left - if justify == "CENTER" then x = rect.left + rect.width / 2 elseif justify == "RIGHT" then x = rect.left + rect.width end - local y = rect.top + rect.height / 2 - if text.justifyV == "TOP" then y = rect.top + size / 2 elseif text.justifyV == "BOTTOM" then y = rect.top + rect.height - size / 2 end - local flags = text.flags or "" - local stroke = "" - if flags:find("OUTLINE", 1, true) then - stroke = string.format(' stroke="#000" stroke-width="%s" stroke-linejoin="round" paint-order="stroke"', - Number(flags:find("THICK", 1, true) and size * 0.2 or size * 0.12)) - end - local family, weight = self.font(text.font) - local spans = {} - for _, segment in ipairs(Segments(tostring(text.text), text.color or DEFAULT_TEXT_COLOR)) do - spans[#spans + 1] = string.format('%s', Fill(segment[2], alpha), Escape(segment[1])) - end - self:Emit(string.format( - '%s', - Number(x), Number(y), Escape(family or "sans-serif"), weight or 400, Number(size), - ANCHORS[justify] or "middle", stroke, table.concat(spans))) -end - -function Context:DrawOutline(region, rect) - self:Emit(string.format('%s', - RectAttributes(rect), Escape(self.adapter.Name(region) or self.adapter.Type(region)))) -end - -function Paint.Render(options) - local adapter, layout, root = options.adapter, options.layout, options.root - local context = setmetatable({ - adapter = adapter, - layout = layout, - root = root, - image = options.image or function() return nil end, - atlas = options.atlas or function() return nil end, - font = options.font or function() return nil end, - model = options.model or function() return nil end, - file = options.file or function() return nil end, - defs = {}, - body = {}, - images = {}, - clips = {}, - clipIds = {}, - nextId = 0, - }, Context) - local rootRect = layout:Rect(root) - if not rootRect then error("wowproof: the region has no resolvable position", 2) end - if not adapter.Shown(root) then error("wowproof: the region is hidden", 2) end - - local entries, bounds = {}, nil - for _, region in ipairs(context:Collect(root, {})) do - local rect = layout:Rect(region) - local clip = rect and context:Clip(region) - local shown = rect and (clip and Intersect(rect, clip) or (not clip and rect)) - if shown and shown.width > 0 and shown.height > 0 and context:Visible(region) then - local alpha = context:EffectiveAlpha(region) - if alpha > 0 then - entries[#entries + 1] = { region = region, rect = rect, clip = clip, alpha = alpha, key = context:SortKey(region) } - if Scene.IsRegion(adapter, region) or not adapter.FillOf then bounds = Union(bounds, shown) end - end - end - end - table.sort(entries, CompareKeys) - - for _, entry in ipairs(entries) do - local clipped = entry.clip and not Contains(entry.clip, entry.rect) - if clipped then context:Emit(string.format('', context:ClipPath(entry.clip))) end - local kind = adapter.Type(entry.region) - if kind == "Texture" then - context:DrawTexture(entry.region, entry.rect, entry.alpha) - elseif kind == "FontString" then - context:DrawText(entry.region, entry.rect, entry.alpha) - elseif Scene.IsModel(adapter, entry.region) then - context:DrawModel(entry.region, entry.rect, entry.alpha) - elseif not adapter.FillOf and not Scene.IsRegion(adapter, entry.region) then - context:DrawBar(entry.region, entry.alpha) - end - if clipped then context:Emit("") end - end - if options.debug then - for _, entry in ipairs(entries) do context:DrawOutline(entry.region, entry.rect) end - end - - local pad = options.pad or 8 - local view = Intersect(Union(bounds or rootRect, rootRect), layout.screen) or rootRect - view = { left = view.left - pad, top = view.top - pad, width = view.width + pad * 2, height = view.height + pad * 2 } - local width, height = math.ceil(view.width), math.ceil(view.height) - local out = { - string.format('', - width, height, Number(view.left), Number(view.top), Number(width), Number(height)), - } - if #context.defs > 0 then out[#out + 1] = "" .. table.concat(context.defs) .. "" end - out[#out + 1] = string.format('', - Number(view.left), Number(view.top), width, height, options.background or "#14171c") - for _, markup in ipairs(context.body) do out[#out + 1] = markup end - out[#out + 1] = "\n" - return table.concat(out, "\n"), { width = width, height = height, regions = #entries } -end - -return Paint diff --git a/wowproof/raster.lua b/wowproof/raster.lua deleted file mode 100644 index 54df107..0000000 --- a/wowproof/raster.lua +++ /dev/null @@ -1,184 +0,0 @@ -local Raster = {} - -local function Quote(text) - return "'" .. tostring(text):gsub("'", "'\\''") .. "'" -end -Raster.Quote = Quote - -local function Run(command) - local result = os.execute(command) - return result == 0 or result == true -end -Raster.Run = Run - -local tools = {} -function Raster.Has(tool) - if tools[tool] == nil then tools[tool] = Run("command -v " .. Quote(tool) .. " >/dev/null 2>&1") end - return tools[tool] -end - -function Raster.MakeDir(dir) - if not Run("mkdir -p " .. Quote(dir)) then error("wowproof: can't create " .. dir, 2) end -end - -function Raster.Exists(file) - local handle = io.open(file, "rb") - if not handle then return false end - handle:close() - return true -end - -function Raster.Write(file, content) - local handle = assert(io.open(file, "wb")) - handle:write(content) - handle:close() -end - -function Raster.Read(file) - local handle = io.open(file, "rb") - if not handle then return nil end - local content = handle:read("*a") - handle:close() - return content -end - -local ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" - -function Raster.Base64(data) - local out = {} - for index = 1, #data, 3 do - local a, b, c = data:byte(index, index + 2) - local n = a * 65536 + (b or 0) * 256 + (c or 0) - local d1 = math.floor(n / 262144) % 64 - local d2 = math.floor(n / 4096) % 64 - local d3 = math.floor(n / 64) % 64 - local d4 = n % 64 - out[#out + 1] = ALPHABET:sub(d1 + 1, d1 + 1) .. ALPHABET:sub(d2 + 1, d2 + 1) - .. (b and ALPHABET:sub(d3 + 1, d3 + 1) or "=") - .. (c and ALPHABET:sub(d4 + 1, d4 + 1) or "=") - end - return table.concat(out) -end - -local function CacheName(file) - return (file:gsub("[^%w%-_.]+", "_")) .. ".png" -end - -function Raster.ImageTool() - if Raster.Has("magick") then return "magick" end - if Raster.Has("convert") then return "convert" end - return nil -end - -function Raster.ToPng(file, cacheDir) - if file:lower():match("%.png$") then return Raster.Exists(file) and file or nil end - local tool = Raster.ImageTool() - if not tool or not Raster.Exists(file) then return nil end - Raster.MakeDir(cacheDir) - local target = cacheDir .. "/" .. CacheName(file) - if Raster.Exists(target) then return target end - if not Run(tool .. " " .. Quote(file) .. " " .. Quote(target) .. " >/dev/null 2>&1") then return nil end - return target -end - -function Raster.RawToPng(rgba, width, height, target) - local tool = Raster.ImageTool() - if not tool then return nil end - local raw = target .. ".rgba" - Raster.Write(raw, rgba) - local ok = Run(string.format("%s -size %dx%d -depth 8 %s %s >/dev/null 2>&1", - tool, width, height, Quote("rgba:" .. raw), Quote(target))) - os.remove(raw) - return ok and target or nil -end - -function Raster.Crop(png, rect, cacheDir) - local tool = Raster.ImageTool() - if not tool or not Raster.Exists(png) then return nil end - Raster.MakeDir(cacheDir) - local geometry = string.format("%dx%d+%d+%d", rect.width, rect.height, rect.left, rect.top) - local target = cacheDir .. "/" .. CacheName(png .. "@" .. geometry) - if Raster.Exists(target) then return target end - if not Run(string.format("%s %s -crop %s +repage %s >/dev/null 2>&1", tool, Quote(png), geometry, Quote(target))) then - return nil - end - return target -end - -local function NonEmpty(file) - local handle = io.open(file, "rb") - if not handle then return false end - local size = handle:seek("end") - handle:close() - return size > 0 -end -Raster.NonEmpty = NonEmpty - -function Raster.Download(url, target, headers) - Raster.MakeDir(target:match("^(.*)/[^/]+$") or ".") - local partial = target .. ".part" - local curl = io.popen("curl -fsSL --retry 2 --max-time 60 -H @- -o " .. Quote(partial) .. " " .. Quote(url) .. " 2>/dev/null", "w") - curl:write(table.concat(headers or { "User-Agent: wowproof" }, "\n"), "\n") - curl:close() - if not NonEmpty(partial) then - os.remove(partial) - return false - end - os.rename(partial, target) - return true -end - -local function UInt32(data, offset) - local a, b, c, d = data:byte(offset, offset + 3) - return ((a * 256 + b) * 256 + c) * 256 + d -end - -function Raster.PngSize(png) - local data = Raster.Read(png) - if not data or #data < 24 or data:sub(13, 16) ~= "IHDR" then return nil end - return UInt32(data, 17), UInt32(data, 21) -end - -function Raster.DataUri(png) - local data = Raster.Read(png) - if not data then return nil end - return "data:image/png;base64," .. Raster.Base64(data) -end - -local FONTS_CONF = [[ - - -%s/etc/fonts/fonts.conf -%s - -]] - -local function Absolute(path) - if path:sub(1, 1) == "/" then return path end - local handle = io.popen("pwd") - local cwd = handle:read("*l") - handle:close() - return cwd .. "/" .. path -end -Raster.Absolute = Absolute - -function Raster.FontConfig(dirs, cacheDir) - Raster.MakeDir(cacheDir) - local entries = {} - for _, dir in ipairs(dirs or {}) do - entries[#entries + 1] = "" .. Absolute(dir) .. "\n" - end - local file = Absolute(cacheDir .. "/fonts.conf") - Raster.Write(file, string.format(FONTS_CONF, table.concat(entries), Absolute(cacheDir .. "/fontcache"))) - return file -end - -function Raster.SvgToPng(svg, png, scale, fontConfig) - if not Raster.Has("rsvg-convert") then return nil end - local env = fontConfig and ("FONTCONFIG_FILE=" .. Quote(fontConfig) .. " ") or "" - local command = string.format("%srsvg-convert -z %s -o %s %s", env, tostring(scale or 1), Quote(png), Quote(svg)) - if not Run(command) then return nil end - return png -end - -return Raster diff --git a/wowproof/runner.lua b/wowproof/runner.lua deleted file mode 100644 index 8cd58df..0000000 --- a/wowproof/runner.lua +++ /dev/null @@ -1,36 +0,0 @@ -local Runner = {} - -local function Selected(name, filters) - if not filters or #filters == 0 then return true end - for _, filter in ipairs(filters) do - if name:find(filter, 1, true) then return true end - end - return false -end - -function Runner.Run(options) - local proof, print = options.proof, options.print or print - local passed, failed = 0, 0 - for _, scenario in ipairs(options.scenarios) do - if Selected(scenario.name, options.filters) then - local ok, err = xpcall(function() - local region = scenario.build() - local entry = proof:Snapshot(region, scenario.name, scenario.options) - print(string.format(" ok %-40s %s", scenario.name, entry.png or entry.svg)) - end, debug.traceback) - if ok then - passed = passed + 1 - else - failed = failed + 1 - proof:Fail(scenario.name, err) - print(string.format(" FAIL %s\n %s", scenario.name, tostring(err):gsub("\n", "\n "))) - end - if options.after then options.after(scenario) end - end - end - local sheet = proof:Sheet() - print(string.format("%d snapshots, %d failed: %s", passed, failed, sheet)) - return passed, failed, sheet -end - -return Runner diff --git a/wowproof/scene.lua b/wowproof/scene.lua deleted file mode 100644 index 28e8d43..0000000 --- a/wowproof/scene.lua +++ /dev/null @@ -1,60 +0,0 @@ -local Scene = {} - -Scene.REQUIRED = { - "Parent", "Children", "Order", "Type", "Name", - "Points", "Size", "Scale", "Shown", "Alpha", "IgnoresParentAlpha", - "Strata", "Level", "Layer", - "Texture", "Bar", "Text", -} - -Scene.OPTIONAL = { "FillOf", "ClipsChildren", "Model" } - -Scene.SOLID_FILES = { - ["interface\\buttons\\white8x8"] = true, - ["interface\\chatframe\\chatframebackground"] = true, - ["interface\\tooltips\\ui-tooltip-background"] = true, -} - -function Scene.IsSolidFile(file) - return type(file) == "string" and Scene.SOLID_FILES[file:lower()] == true -end - -Scene.REGION_TYPES ={ Texture = true, FontString = true, Line = true, MaskTexture = true } - -Scene.MODEL_TYPES = { Model = true, PlayerModel = true, DressUpModel = true, CinematicModel = true, TabardModel = true } - -function Scene.IsModel(adapter, region) - return Scene.MODEL_TYPES[adapter.Type(region)] == true -end - -Scene.STRATA = { - "WORLD", "BACKGROUND", "LOW", "MEDIUM", "HIGH", "DIALOG", "FULLSCREEN", "FULLSCREEN_DIALOG", "TOOLTIP", -} - -Scene.LAYERS = { "BACKGROUND", "BORDER", "ARTWORK", "OVERLAY", "HIGHLIGHT" } - -local function Index(list) - local index = {} - for position, value in ipairs(list) do index[value] = position end - return index -end -Scene.STRATA_INDEX = Index(Scene.STRATA) -Scene.LAYER_INDEX = Index(Scene.LAYERS) - -function Scene.Validate(adapter) - if type(adapter) ~= "table" then error("wowproof: the adapter must be a table of functions", 2) end - local missing = {} - for _, name in ipairs(Scene.REQUIRED) do - if type(adapter[name]) ~= "function" then missing[#missing + 1] = name end - end - if #missing > 0 then - error("wowproof: the adapter is missing " .. table.concat(missing, ", "), 2) - end - return adapter -end - -function Scene.IsRegion(adapter, region) - return Scene.REGION_TYPES[adapter.Type(region)] == true -end - -return Scene diff --git a/wowproof/sheet.lua b/wowproof/sheet.lua deleted file mode 100644 index bc170ca..0000000 --- a/wowproof/sheet.lua +++ /dev/null @@ -1,55 +0,0 @@ -local Paint = require("wowproof.paint") - -local Sheet = {} - -local PAGE = [[ - - - -%s - - - -

%s

-

%s

-
-%s -
- - -]] - -local function BaseName(path) - return path and path:match("([^/]+)$") -end - -function Sheet.Render(title, entries) - local figures, failed = {}, 0 - for _, entry in ipairs(entries) do - if entry.error then - failed = failed + 1 - figures[#figures + 1] = string.format('
%s
%s
', - Paint.Escape(entry.name), Paint.Escape(entry.error)) - else - local image = BaseName(entry.png) or BaseName(entry.svg) - figures[#figures + 1] = string.format( - '
%s
%ssvg
', - Paint.Escape(image), Paint.Escape(entry.name), Paint.Escape(entry.name), Paint.Escape(BaseName(entry.svg))) - end - end - local summary = string.format("%d snapshots, %d failed", #entries - failed, failed) - return string.format(PAGE, Paint.Escape(title), Paint.Escape(title), summary, table.concat(figures, "\n")) -end - -return Sheet diff --git a/wowproof/sources/atlas_table.lua b/wowproof/sources/atlas_table.lua deleted file mode 100644 index 38678ec..0000000 --- a/wowproof/sources/atlas_table.lua +++ /dev/null @@ -1,8 +0,0 @@ -return function(atlases) - local byName = {} - for name, info in pairs(atlases or {}) do byName[name:lower()] = info end - return function(name) - if type(name) ~= "string" then return nil end - return byName[name:lower()] - end -end diff --git a/wowproof/sources/remote_dir.lua b/wowproof/sources/remote_dir.lua deleted file mode 100644 index 47b95a2..0000000 --- a/wowproof/sources/remote_dir.lua +++ /dev/null @@ -1,48 +0,0 @@ -local Raster = require("wowproof.raster") - -local function IsUrl(remote) - return remote:match("^https?://") ~= nil -end - -local function CopyCommand(remote, name, partial) - local host, dir = remote:match("^([%w%._@%-]+):(.+)$") - if host then - if not Raster.Has("ssh") then return nil end - return "ssh -o BatchMode=yes -o ConnectTimeout=5 " .. Raster.Quote(host) .. " " - .. Raster.Quote("cat " .. Raster.Quote(dir .. "/" .. name)) .. " > " .. Raster.Quote(partial) .. " 2>/dev/null" - end - return "cp " .. Raster.Quote(remote .. "/" .. name) .. " " .. Raster.Quote(partial) .. " 2>/dev/null" -end - -local function Copy(remote, name, target) - if IsUrl(remote) then - return Raster.Has("curl") and Raster.Download(remote .. "/" .. name, target) - end - Raster.MakeDir(target:match("^(.*)/[^/]+$") or ".") - local partial = target .. ".part" - local command = CopyCommand(remote, name, partial) - if not command or not Raster.Run(command) or not Raster.NonEmpty(partial) then - os.remove(partial) - return false - end - os.rename(partial, target) - return true -end - -return function(options) - options = options or {} - local remote = options.remote - local dir = options.dir or error("wowproof: give the remote folder a cache dir (dir)", 2) - local fetch = options.fetch ~= false and remote ~= nil and remote ~= "" - local tried = {} - - return function(name) - if type(name) ~= "string" or name:find("%.%.") or name:sub(1, 1) == "/" then return nil end - local cached = dir .. "/" .. name - if Raster.Exists(cached) then return cached end - if not fetch or tried[name] then return nil end - tried[name] = true - if not Copy((remote:gsub("/$", "")), name, cached) then return nil end - return cached - end -end diff --git a/wowproof/sources/wago_casc.lua b/wowproof/sources/wago_casc.lua deleted file mode 100644 index 619ea55..0000000 --- a/wowproof/sources/wago_casc.lua +++ /dev/null @@ -1,32 +0,0 @@ -local Raster = require("wowproof.raster") -local Blp = require("wowproof.blp") - -local DEFAULT_URL = "https://wago.tools/api/casc/%d?version=%s" - -local function FileId(file) - if type(file) == "number" then return file % 1 == 0 and file > 0 and file or nil end - if type(file) == "string" and file:match("^%d+$") then return tonumber(file) end - return nil -end - -return function(options) - options = options or {} - local build = options.build or error("wowproof: pin the CASC source to a client build (build)", 2) - local dir = (options.dir or ".proof-art") .. "/casc-" .. build - local fetch = options.fetch ~= false - local url = options.url or DEFAULT_URL - - return function(file) - local id = FileId(file) - if not id then return nil end - local cached = string.format("%s/%d.png", dir, id) - if Raster.Exists(cached) then return cached end - if not fetch or not Raster.Has("curl") then return nil end - local blp = string.format("%s/%d.blp", dir, id) - if not Raster.Download(string.format(url, id, build), blp) then return nil end - local width, height, rgba = Blp.Decode(Raster.Read(blp)) - os.remove(blp) - if not width then return nil end - return Raster.RawToPng(rgba, width, height, cached) - end -end diff --git a/wowproof/sources/wow_ui_textures.lua b/wowproof/sources/wow_ui_textures.lua deleted file mode 100644 index 1cf8e24..0000000 --- a/wowproof/sources/wow_ui_textures.lua +++ /dev/null @@ -1,110 +0,0 @@ -local Raster = require("wowproof.raster") - -local DEFAULT_REPOSITORY = "Gethe/wow-ui-textures" - -local function UrlEncode(text) - return (text:gsub("[^%w%-_%.~/]", function(char) return string.format("%%%02X", char:byte()) end)) -end - -return function(options) - options = options or {} - local repository = options.repository or DEFAULT_REPOSITORY - local ref = options.ref or error("wowproof: pin the art source to a commit (ref)", 2) - local dir = options.dir or ".proof-art" - local fetch = options.fetch ~= false - local token = options.token - local treesDir = dir .. "/trees" - local filesDir = dir .. "/" .. ref - local missingFile = dir .. "/missing-" .. ref .. ".txt" - local trees, missing = {}, nil - - local function Download(url, target, api) - local headers = { "User-Agent: wowproof" } - if api then headers[#headers + 1] = "Accept: application/vnd.github+json" end - if api and token and token ~= "" then headers[#headers + 1] = "Authorization: Bearer " .. token end - return Raster.Download(url, target, headers) - end - - local function Tree(sha) - if trees[sha] then return trees[sha] end - local file = treesDir .. "/" .. sha .. ".tsv" - if not Raster.Exists(file) then - if not fetch or not Raster.Has("curl") or not Raster.Has("jq") then return nil end - local json = file .. ".json" - if not Download(string.format("https://api.github.com/repos/%s/git/trees/%s", repository, sha), json, true) then - return nil - end - local ok = Raster.Run("jq -r '.tree[] | [.type, .sha, .path] | @tsv' " .. Raster.Quote(json) .. " > " - .. Raster.Quote(file .. ".part")) - os.remove(json) - if not ok then - os.remove(file .. ".part") - return nil - end - os.rename(file .. ".part", file) - end - local entries = {} - for line in io.lines(file) do - local kind, entrySha, name = line:match("^(%S+)\t(%S+)\t(.+)$") - if kind then entries[name:upper()] = { kind = kind, sha = entrySha, name = name } end - end - trees[sha] = entries - return entries - end - - local function Missing() - if missing then return missing end - missing = {} - if Raster.Exists(missingFile) then - for line in io.lines(missingFile) do missing[line] = true end - end - return missing - end - - local function MarkMissing(key) - Missing()[key] = true - Raster.MakeDir(dir) - local handle = io.open(missingFile, "a") - if handle then - handle:write(key, "\n") - handle:close() - end - end - - local function Locate(key) - local entries = Tree(ref) - if not entries then return nil, true end - local parts = {} - for part in key:gmatch("[^\\]+") do parts[#parts + 1] = part end - local names = {} - for index, part in ipairs(parts) do - local last = index == #parts - local entry = last and entries[part .. ".PNG"] or entries[part] - if not entry or entry.kind ~= (last and "blob" or "tree") then return nil, false end - names[#names + 1] = entry.name - if not last then - entries = Tree(entry.sha) - if not entries then return nil, true end - end - end - return table.concat(names, "/"), false - end - - return function(path) - if type(path) ~= "string" then return nil end - local relative = path:gsub("/", "\\"):match("^[Ii][Nn][Tt][Ee][Rr][Ff][Aa][Cc][Ee]\\(.+)$") - if not relative then return nil end - local key = relative:gsub("%.[BbTt][LlGg][PpAa]$", ""):upper() - local cached = filesDir .. "/" .. key:gsub("\\", "/") .. ".png" - if Raster.Exists(cached) then return cached end - if not fetch or Missing()[key] then return nil end - local remote, transient = Locate(key) - if not remote then - if not transient then MarkMissing(key) end - return nil - end - local url = string.format("https://raw.githubusercontent.com/%s/%s/%s", repository, ref, UrlEncode(remote)) - if not Download(url, cached) then return nil end - return cached - end -end diff --git a/wowproof/spec/blp_spec.lua b/wowproof/spec/blp_spec.lua deleted file mode 100644 index 713ade2..0000000 --- a/wowproof/spec/blp_spec.lua +++ /dev/null @@ -1,56 +0,0 @@ -local Blp = require("wowproof.blp") - -local function UInt32(value) - return string.char(value % 256, math.floor(value / 256) % 256, math.floor(value / 65536) % 256, math.floor(value / 16777216)) -end - -local function File(compression, alphaDepth, alphaType, width, height, body, palette) - return "BLP2" .. UInt32(1) .. string.char(compression, alphaDepth, alphaType, 0) .. UInt32(width) .. UInt32(height) - .. UInt32(1172) .. string.rep(UInt32(0), 15) .. UInt32(#body) .. string.rep(UInt32(0), 15) - .. (palette or "") .. string.rep("\0", 1024 - #(palette or "")) .. body -end - -local function Bytes(text) - return { text:byte(1, -1) } -end - -local RED_BLUE = "\0\248\31\0" - -describe("wowproof BLP2 decoder", function() - it("swizzles uncompressed BGRA to RGBA", function() - local width, height, rgba = Blp.Decode(File(3, 8, 8, 2, 1, "\3\2\1\4\7\6\5\8")) - assert.equals(2, width) - assert.equals(1, height) - assert.same({ 1, 2, 3, 4, 5, 6, 7, 8 }, Bytes(rgba)) - end) - - it("looks palette pixels up with 8-bit and 1-bit alpha", function() - local palette = "\30\20\10\0\60\50\40\0" - local _, _, rgba = Blp.Decode(File(1, 8, 0, 2, 1, "\0\1\128\255", palette)) - assert.same({ 10, 20, 30, 128, 40, 50, 60, 255 }, Bytes(rgba)) - _, _, rgba = Blp.Decode(File(1, 1, 0, 2, 1, "\0\1\2", palette)) - assert.same({ 10, 20, 30, 0, 40, 50, 60, 255 }, Bytes(rgba)) - _, _, rgba = Blp.Decode(File(1, 0, 0, 1, 1, "\1", palette)) - assert.same({ 40, 50, 60, 255 }, Bytes(rgba)) - end) - - it("decodes DXT1 blocks, clipped to the image, with the transparent three-colour mode", function() - local _, _, rgba = Blp.Decode(File(2, 0, 0, 2, 2, RED_BLUE .. UInt32(4))) - assert.same({ 255, 0, 0, 255, 0, 0, 255, 255, 255, 0, 0, 255, 255, 0, 0, 255 }, Bytes(rgba)) - _, _, rgba = Blp.Decode(File(2, 1, 0, 1, 1, "\31\0\0\248" .. UInt32(3))) - assert.same({ 0, 0, 0, 0 }, Bytes(rgba)) - end) - - it("decodes DXT3 and DXT5 alpha", function() - local _, _, rgba = Blp.Decode(File(2, 8, 1, 1, 1, "\8" .. string.rep("\0", 7) .. RED_BLUE .. UInt32(0))) - assert.same({ 255, 0, 0, 136 }, Bytes(rgba)) - _, _, rgba = Blp.Decode(File(2, 8, 7, 2, 1, "\255\0\1\0\0\0\0\0" .. RED_BLUE .. UInt32(0))) - assert.same({ 255, 0, 0, 0, 255, 0, 0, 255 }, Bytes(rgba)) - end) - - it("rejects other files and encodings", function() - assert.is_nil(Blp.Decode("PNG")) - assert.is_nil(Blp.Decode(File(2, 8, 5, 1, 1, string.rep("\0", 16)))) - assert.is_nil(Blp.Decode(File(3, 8, 8, 2, 2, "\0\0\0\0"))) - end) -end) diff --git a/wowproof/spec/fake_scene.lua b/wowproof/spec/fake_scene.lua deleted file mode 100644 index 5ba7b05..0000000 --- a/wowproof/spec/fake_scene.lua +++ /dev/null @@ -1,40 +0,0 @@ -local FakeScene = {} - -function FakeScene.New() - local scene = { nodes = {} } - - function scene.Node(kind, parent, fields) - local node = fields or {} - node.kind, node.parent, node.children = kind, parent, {} - node.points = node.points or {} - node.order = #scene.nodes + 1 - scene.nodes[#scene.nodes + 1] = node - if parent then parent.children[#parent.children + 1] = node end - return node - end - - scene.adapter = { - Parent = function(node) return node.parent end, - Children = function(node) return node.children end, - Order = function(node) return node.order end, - Type = function(node) return node.kind end, - Name = function(node) return node.name end, - Points = function(node) return node.points end, - Size = function(node) return node.width or 0, node.height or 0 end, - Scale = function(node) return node.scale or 1 end, - Shown = function(node) return node.shown ~= false end, - Alpha = function(node) return node.alpha or 1 end, - IgnoresParentAlpha = function(node) return node.ignoreParentAlpha == true end, - Strata = function(node) return node.strata end, - Level = function(node) return node.level or 0 end, - Layer = function(node) return node.layer, node.sublevel end, - Texture = function(node) return node.texture end, - Bar = function(node) return node.bar end, - Text = function(node) return node.text end, - } - - scene.screen = scene.Node("Frame", nil, { name = "Screen" }) - return scene -end - -return FakeScene diff --git a/wowproof/spec/layout_spec.lua b/wowproof/spec/layout_spec.lua deleted file mode 100644 index a2d8369..0000000 --- a/wowproof/spec/layout_spec.lua +++ /dev/null @@ -1,94 +0,0 @@ -local Layout = require("wowproof.layout") -local FakeScene = require("wowproof.spec.fake_scene") - -describe("wowproof layout", function() - local scene, layout - - before_each(function() - scene = FakeScene.New() - layout = Layout.New(scene.adapter, { width = 1000, height = 500 }) - end) - - local function Rect(node) - local rect = layout:Rect(node) - return { rect.left, rect.top, rect.width, rect.height } - end - - it("fills the screen with a parentless region without points", function() - assert.same({ 0, 0, 1000, 500 }, Rect(scene.screen)) - end) - - it("places a single point with its size, y offsets going up", function() - local frame = scene.Node("Frame", scene.screen, { - width = 200, height = 40, - points = { { point = "TOPLEFT", relativePoint = "TOPLEFT", x = 10, y = -20 } }, - }) - assert.same({ 10, 20, 200, 40 }, Rect(frame)) - end) - - it("centers on the relative region's anchor", function() - local frame = scene.Node("Frame", scene.screen, { - width = 100, height = 50, points = { { point = "CENTER", x = 0, y = 50 } }, - }) - assert.same({ 450, 175, 100, 50 }, Rect(frame)) - end) - - it("stretches an axis between two points", function() - local frame = scene.Node("Frame", scene.screen, { - width = 300, height = 60, points = { { point = "CENTER" } }, - }) - local bar = scene.Node("StatusBar", frame, { - height = 20, - points = { - { point = "TOPLEFT", x = 5, y = -5 }, - { point = "TOPRIGHT", x = -5, y = -5 }, - }, - }) - assert.same({ 355, 225, 290, 20 }, Rect(bar)) - end) - - it("copies the relative rect for SetAllPoints", function() - local frame = scene.Node("Frame", scene.screen, { width = 80, height = 30, points = { { point = "TOPLEFT" } } }) - local texture = scene.Node("Texture", frame, { points = { { all = true } } }) - assert.same({ 0, 0, 80, 30 }, Rect(texture)) - end) - - it("anchors to another region than the parent", function() - local a = scene.Node("Frame", scene.screen, { width = 100, height = 20, points = { { point = "TOPLEFT" } } }) - local b = scene.Node("Frame", scene.screen, { - width = 50, height = 20, - points = { { point = "TOPLEFT", relativeTo = a, relativePoint = "BOTTOMLEFT", x = 0, y = -4 } }, - }) - assert.same({ 0, 24, 50, 20 }, Rect(b)) - end) - - it("applies the effective scale to size and offsets", function() - local frame = scene.Node("Frame", scene.screen, { - scale = 2, width = 100, height = 10, points = { { point = "TOPLEFT", x = 10, y = -10 } }, - }) - local child = scene.Node("Frame", frame, { width = 10, height = 10, points = { { point = "TOPLEFT", x = 5 } } }) - assert.same({ 20, 20, 200, 20 }, Rect(frame)) - assert.same({ 30, 20, 20, 20 }, Rect(child)) - end) - - it("leaves a parented region without points unresolved, and survives cycles", function() - local loose = scene.Node("Frame", scene.screen, { width = 10, height = 10 }) - assert.is_nil(layout:Rect(loose)) - local a = scene.Node("Frame", scene.screen, { width = 10, height = 10 }) - local b = scene.Node("Frame", scene.screen, { width = 10, height = 10, points = { { point = "LEFT", relativeTo = a } } }) - a.points = { { point = "LEFT", relativeTo = b } } - assert.is_nil(layout:Rect(a)) - end) - - it("sizes a font string from its text when it has no size", function() - local text = scene.Node("FontString", scene.screen, { - points = { { point = "TOPLEFT" } }, text = { text = "abcd", size = 10 }, - }) - assert.same({ 0, 0, 22, 10 }, Rect(text)) - end) - - it("rejects unknown anchor points", function() - local frame = scene.Node("Frame", scene.screen, { width = 1, height = 1, points = { { point = "MIDDLE" } } }) - assert.has_error(function() layout:Rect(frame) end) - end) -end) diff --git a/wowproof/spec/package_spec.lua b/wowproof/spec/package_spec.lua deleted file mode 100644 index 8d88f84..0000000 --- a/wowproof/spec/package_spec.lua +++ /dev/null @@ -1,113 +0,0 @@ -local Proof = require("wowproof") -local Raster = require("wowproof.raster") -local MockState = require("wowproof.adapters.mock_state") -local FakeScene = require("wowproof.spec.fake_scene") - -local FORBIDDEN = { "Unit" .. "Frames", "%f[%w_]ns" .. "%.", "tests" .. "/" } - -local function PackageFiles() - local files = {} - local handle = io.popen("find wowproof -type f") - for file in handle:lines() do files[#files + 1] = file end - handle:close() - return files -end - -describe("wowproof package", function() - it("knows nothing about the addon that uses it", function() - for _, file in ipairs(PackageFiles()) do - local content = Raster.Read(file) - for _, pattern in ipairs(FORBIDDEN) do - assert.is_nil(content:find(pattern), file .. " mentions " .. pattern) - end - end - end) - - it("base64-encodes like the standard alphabet", function() - assert.equals("", Raster.Base64("")) - assert.equals("TQ==", Raster.Base64("M")) - assert.equals("TWE=", Raster.Base64("Ma")) - assert.equals("TWFu", Raster.Base64("Man")) - end) - - it("writes snapshots and a contact sheet", function() - local dir = io.popen("mktemp -d"):read("*l") - local scene = FakeScene.New() - local frame = scene.Node("Frame", scene.screen, { width = 20, height = 10, points = { { point = "CENTER" } } }) - scene.Node("Texture", frame, { points = { { all = true } }, texture = { color = { 1, 1, 1, 1 } } }) - local proof = Proof.New({ adapter = scene.adapter, outDir = dir, png = false, title = "Fake" }) - local entry = proof:Snapshot(frame, "white box") - proof:Fail("broken", "boom ") - local sheet = Raster.Read(proof:Sheet()) - assert.equals(dir .. "/white-box.svg", entry.svg) - assert.is_true(Raster.Exists(entry.svg)) - assert.is_not_nil(sheet:find("1 snapshots, 1 failed", 1, true)) - assert.is_not_nil(sheet:find("boom <here>", 1, true)) - os.execute("rm -rf " .. Raster.Quote(dir)) - end) - - it("reads the __state widget model through the mock_state adapter", function() - local secret = {} - local function Secret(value) return setmetatable({ value = value }, secret) end - local function Object(kind, parent, state) - state.parent, state.kids, state.points = parent, {}, state.points or {} - local object = { __type = kind, __state = state, __calls = {} } - if parent then parent.__state.kids[object] = true end - return object - end - local root = Object("Frame", nil, {}) - local bar = Object("StatusBar", root, { min = 0, max = Secret(10), value = Secret(4), shown = true }) - bar.__state.fill = Object("Texture", bar, { vertexColor = { 1, 0, 0, 1 } }) - local text = Object("FontString", bar, { text = Secret("40%"), fontObject = "Font" }) - text.__calls[1] = { "SetJustifyH", "RIGHT" } - local font = Object("Font", nil, { font = { "F.ttf", 11, "OUTLINE" } }) - local registry = { root, bar, bar.__state.fill, text, font } - local adapter = MockState({ - isSecret = function(value) return getmetatable(value) == secret end, - reveal = function(value) return value.value end, - objects = function() return registry end, - globals = { Font = font }, - }) - bar.__calls[1] = { "SetClipsChildren", true } - assert.same({ bar.__state.fill, text }, adapter.Children(bar)) - assert.equals(bar, adapter.FillOf(bar.__state.fill)) - assert.is_nil(adapter.FillOf(text)) - assert.is_true(adapter.ClipsChildren(bar)) - assert.is_false(adapter.ClipsChildren(root)) - assert.same({ min = 0, max = 10, value = 4, reverse = false, color = { 1, 0, 0, 1 } }, adapter.Bar(bar)) - local icon = Object("Texture", root, { atlas = "Some-Atlas", texture = "atlas:Some-Atlas" }) - registry[#registry + 1] = icon - assert.equals("Some-Atlas", adapter.Texture(icon).atlas) - assert.is_nil(adapter.Texture(icon).file) - icon.__state.texture = "Interface\\Other" - assert.is_nil(adapter.Texture(icon).atlas) - assert.equals("Interface\\Other", adapter.Texture(icon).file) - local info = adapter.Text(text) - assert.equals("40%", info.text) - assert.equals(11, info.size) - assert.equals("RIGHT", info.justifyH) - assert.equals(4, adapter.Order(text)) - end) - - it("replays model calls through the mock_state adapter", function() - local secret = {} - local function Secret(value) return setmetatable({ value = value }, secret) end - local model = { __type = "PlayerModel", __state = { kids = {} }, __calls = {} } - local adapter = MockState({ - isSecret = function(value) return getmetatable(value) == secret end, - reveal = function(value) return value.value end, - }) - assert.same({ zoom = 0, desaturation = 0, modelAlpha = 1 }, adapter.Model(model)) - model.__calls = { - { "SetModel", "Interface\\Buttons\\TalkToMeQuestionMark.m2" }, { "SetPortraitZoom", 0 }, - { "ClearModel" }, { "SetUnit", "target" }, { "SetPortraitZoom", 1 }, { "SetDesaturation", Secret(0.5) }, - } - model.__state.modelAlpha = Secret(0.4) - assert.same({ unit = "target", zoom = 1, desaturation = 0.5, modelAlpha = 0.4 }, adapter.Model(model)) - model.__calls[#model.__calls + 1] = { "SetDisplayInfo", 1234 } - assert.same({ displayId = 1234, zoom = 1, desaturation = 0.5, modelAlpha = 0.4 }, adapter.Model(model)) - model.__calls[#model.__calls + 1] = { "ClearModel" } - assert.is_nil(adapter.Model(model).displayId) - assert.is_nil(adapter.Model({ __type = "Frame", __state = {}, __calls = {} })) - end) -end) diff --git a/wowproof/spec/paint_spec.lua b/wowproof/spec/paint_spec.lua deleted file mode 100644 index 7660037..0000000 --- a/wowproof/spec/paint_spec.lua +++ /dev/null @@ -1,269 +0,0 @@ -local Layout = require("wowproof.layout") -local Paint = require("wowproof.paint") -local Scene = require("wowproof.scene") -local FakeScene = require("wowproof.spec.fake_scene") - -describe("wowproof paint", function() - local scene, frame - - before_each(function() - scene = FakeScene.New() - frame = scene.Node("Frame", scene.screen, { - name = "Frame", width = 100, height = 20, points = { { point = "TOPLEFT", x = 10, y = -10 } }, - }) - end) - - local function Render(root, options) - options = options or {} - options.adapter, options.root = scene.adapter, root or frame - options.layout = Layout.New(scene.adapter, { width = 400, height = 300 }) - options.pad = options.pad or 0 - return Paint.Render(options) - end - - local function Has(svg, text) - return svg:find(text, 1, true) ~= nil - end - - local function Before(svg, first, second) - return svg:find(first, 1, true) < svg:find(second, 1, true) - end - - it("validates adapters", function() - assert.has_error(function() Scene.Validate({ Parent = function() end }) end) - assert.equals(scene.adapter, Scene.Validate(scene.adapter)) - end) - - it("crops to the region and draws colour textures", function() - scene.Node("Texture", frame, { points = { { all = true } }, texture = { color = { 1, 0, 0, 0.5 } } }) - local svg, info = Render() - assert.equals(100, info.width) - assert.equals(20, info.height) - assert.is_true(Has(svg, 'viewBox="10 10 100 20"')) - assert.is_true(Has(svg, '')) - end) - - it("fills status bars from their value, honouring reverse and vertical fill", function() - local bar = scene.Node("StatusBar", frame, { - points = { { all = true } }, bar = { min = 0, max = 200, value = 50, color = { 0, 1, 0, 1 } }, - }) - assert.is_true(Has(Render(), 'x="10" y="10" width="25" height="20" fill="rgb(0,255,0)"')) - bar.bar.reverse = true - assert.is_true(Has(Render(), 'x="85" y="10" width="25" height="20"')) - bar.bar.reverse, bar.bar.orientation = false, "VERTICAL" - assert.is_true(Has(Render(), 'x="10" y="25" width="100" height="5"')) - end) - - it("paints by strata, level, layer, sublevel, then creation order", function() - local over = scene.Node("Texture", frame, { points = { { all = true } }, layer = "OVERLAY", texture = { color = { 0, 0, 1, 1 } } }) - local back = scene.Node("Texture", frame, { points = { { all = true } }, layer = "BACKGROUND", texture = { color = { 1, 0, 0, 1 } } }) - local child = scene.Node("Frame", frame, { points = { { all = true } }, level = 5 }) - scene.Node("Texture", child, { points = { { all = true } }, layer = "BACKGROUND", texture = { color = { 0, 1, 0, 1 } } }) - local svg = Render() - assert.is_true(Before(svg, "rgb(255,0,0)", "rgb(0,0,255)")) - assert.is_true(Before(svg, "rgb(0,0,255)", "rgb(0,255,0)")) - child.strata, frame.strata = "LOW", "HIGH" - svg = Render() - assert.is_true(Before(svg, "rgb(0,255,0)", "rgb(255,0,0)")) - assert.is_not_nil(over) - assert.is_not_nil(back) - end) - - it("skips hidden and transparent regions and multiplies alpha down the tree", function() - local child = scene.Node("Frame", frame, { points = { { all = true } }, alpha = 0.5 }) - scene.Node("Texture", child, { points = { { all = true } }, texture = { color = { 1, 1, 1, 1 } }, alpha = 0.5 }) - scene.Node("Texture", frame, { points = { { all = true } }, texture = { color = { 1, 0, 0, 1 } }, shown = false }) - scene.Node("Texture", frame, { points = { { all = true } }, texture = { color = { 0, 0, 1, 1 } }, alpha = 0 }) - local svg = Render() - assert.is_true(Has(svg, 'fill="rgb(255,255,255)" fill-opacity="0.25"')) - assert.is_false(Has(svg, "rgb(255,0,0)")) - assert.is_false(Has(svg, "rgb(0,0,255)")) - end) - - it("refuses hidden or unplaced roots", function() - frame.shown = false - assert.has_error(function() Render() end) - local loose = scene.Node("Frame", scene.screen, { width = 1, height = 1 }) - assert.has_error(function() Render(loose) end) - end) - - it("draws text with justification, outline, colour codes and the font resolver", function() - scene.Node("FontString", frame, { - points = { { all = true } }, - text = { text = "HP |cffff0000low|r ", size = 10, font = "Fonts\\X.ttf", flags = "OUTLINE", justifyH = "LEFT" }, - }) - local svg = Render(nil, { font = function(file) if file == "Fonts\\X.ttf" then return "Roboto", 700 end end }) - assert.is_true(Has(svg, 'x="10" y="20" font-family="Roboto" font-weight="700" font-size="10" text-anchor="start"')) - assert.is_true(Has(svg, 'stroke="#000" stroke-width="1.2"')) - assert.is_true(Has(svg, 'low')) - assert.is_true(Has(svg, "<ok>")) - end) - - local function Image(file) - if file == "Own\\Glow.tga" then return "data:image/png;base64,AA", 32, 32 end - end - - it("embeds resolved images once, tints them, and marks unresolved files as placeholders", function() - scene.Node("Texture", frame, { points = { { all = true } }, texture = { file = "Own\\Glow.tga", vertexColor = { 1, 0.5, 0, 1 } } }) - scene.Node("Texture", frame, { points = { { all = true } }, texture = { file = "Own\\Glow.tga" } }) - scene.Node("Texture", frame, { points = { { all = true } }, texture = { file = "Interface\\Missing" } }) - local svg = Render(nil, { image = Image }) - local _, images = svg:gsub("base64,AA", "") - assert.equals(1, images) - assert.is_true(Has(svg, '')) - assert.is_true(Has(svg, 'values="1 0 0 0 0 0 0.5 0 0 0 0 0 0 0 0 0 0 0 1 0"')) - assert.is_true(Has(svg, '')) - assert.is_true(Has(svg, "Interface\\Missing")) - end) - - it("crops images to their texture coordinates", function() - scene.Node("Texture", frame, { - points = { { all = true } }, texture = { file = "Own\\Glow.tga", texCoords = { 0.25, 0.5, 0, 0.25 } }, - }) - assert.is_true(Has(Render(nil, { image = Image }), 'viewBox="8 0 8 8"')) - assert.same({ left = 0, top = 8, width = 32, height = 8 }, - Paint.SourceRect({ 0, 0.25, 0, 0.5, 1, 0.25, 1, 0.5 }, 32, 32)) - assert.same({ left = 0, top = 0, width = 32, height = 16 }, Paint.SourceRect(nil, 32, 16)) - end) - - it("draws atlases from their own sub-rectangle and maps later texture coordinates into it", function() - local rect = { left = 0.5, right = 0.75, top = 0.25, bottom = 0.5 } - local function Atlas(name) - if name == "Known-Atlas" then return "data:image/png;base64,AT", 16, 8, rect end - end - scene.Node("Texture", frame, { points = { { all = true } }, texture = { atlas = "Known-Atlas" } }) - scene.Node("Texture", frame, { - points = { { all = true } }, texture = { atlas = "Known-Atlas", texCoords = { 0.625, 0.75, 0.25, 0.5 } }, - }) - scene.Node("Texture", frame, { points = { { all = true } }, texture = { atlas = "Missing-Atlas" } }) - local svg = Render(nil, { atlas = Atlas }) - local _, images = svg:gsub("base64,AT", "") - assert.equals(1, images) - assert.is_true(Has(svg, '')) - assert.is_true(Has(svg, 'viewBox="0 0 16 8"')) - assert.is_true(Has(svg, 'viewBox="8 0 8 8"')) - assert.is_true(Has(svg, "Missing-Atlas")) - assert.same({ 1, 0, 0, 1 }, Paint.AtlasCoords({ 0.75, 0.5, 0.25, 0.5 }, rect)) - assert.same({ 0, 1, 1, 1, 0, 0, 1, 0 }, Paint.AtlasCoords({ 0.5, 0.5, 0.75, 0.5, 0.5, 0.25, 0.75, 0.25 }, rect)) - assert.is_nil(Paint.AtlasCoords(nil, rect)) - end) - - it("maps rotated and tiled texture coordinates through a pattern transform", function() - local coords = { 0, 2, 1, 2, 0, 0, 1, 0 } - assert.is_true(Paint.NeedsAffine(coords)) - assert.is_false(Paint.NeedsAffine({ 0.1, 0.9, 0.1, 0.9 })) - assert.is_true(Paint.NeedsAffine({ 1, 0, 0, 1 })) - scene.Node("Texture", frame, { points = { { all = true } }, texture = { file = "Own\\Glow.tga", texCoords = coords } }) - local svg = Render(nil, { image = Image }) - assert.is_true(Has(svg, 'patternTransform="matrix(0 0.625 -1.5625 0 110 10)"')) - assert.is_true(Has(svg, '')) - end) - - it("skips texture coordinates that collapse the image", function() - assert.is_nil(Paint.AffineTransform({ left = 0, top = 0, width = 10, height = 10 }, { 0, 0, 0, 0, 0, 0, 0, 0 }, 16, 16)) - assert.is_nil(Paint.AffineTransform({ left = 0, top = 0, width = 200, height = 10 }, { 0, 0, 0, 0.0001, 1, 0, 1, 0.0001 }, 16, 16)) - end) - - it("paints Blizzard's white texture as a tinted solid", function() - scene.Node("Texture", frame, { - points = { { all = true } }, texture = { file = "Interface\\Buttons\\WHITE8X8", vertexColor = { 0, 0, 1, 0.5 } }, - }) - assert.is_true(Has(Render(), 'fill="rgb(0,0,255)" fill-opacity="0.5"')) - end) - - it("draws nine-slice textures with fixed corners", function() - scene.Node("Texture", frame, { points = { { all = true } }, texture = { file = "Own\\Glow.tga", slice = { 8, 8, 8, 8 } } }) - local svg = Render(nil, { image = Image }) - local _, pieces = svg:gsub('', "") - assert.equals(9, pieces) - assert.is_true(Has(svg, '')) - assert.is_true(Has(svg, '\n')) - assert.is_true(Has(svg, '')) - assert.is_true(Has(svg, 'viewBox="0 4.8 32 6.4"')) - assert.same({ left = 0, top = 12, width = 32, height = 8 }, - Paint.CoverRect({ left = 0, top = 0, width = 32, height = 32 }, { left = 0, top = 0, width = 100, height = 25 })) - end) - - it("draws model art from a local file as is", function() - scene.adapter.Model = function(node) return node.model end - scene.Node("PlayerModel", frame, { points = { { all = true } }, model = { unit = "player" } }) - local function File(path) - if path == "captures/Male-Human.png" then return "data:image/png;base64,CA", 20, 20 end - end - local svg = Render(nil, { image = Image, file = File, model = function() return { path = "captures/Male-Human.png" } end }) - assert.is_true(Has(svg, 'href="data:image/png;base64,CA"')) - svg = Render(nil, { image = Image, model = function() return { path = "captures/Missing.png" } end }) - assert.is_true(Has(svg, "model: player")) - end) - - it("draws models without art as placeholders titled with their unit, and cleared models as nothing", function() - scene.adapter.Model = function(node) return node.model end - local model = scene.Node("PlayerModel", frame, { points = { { all = true } }, model = { unit = "focus" } }) - local svg = Render(nil, { image = Image, model = function() return "Interface\\Missing" end }) - assert.is_true(Has(svg, "model: focus")) - assert.is_true(Has(Render(), "model: focus")) - model.model = { displayId = 42 } - assert.is_true(Has(Render(), "model: display 42")) - model.model = { modelAlpha = 1 } - assert.is_false(Has(Render(), "")) - model.model = { unit = "focus", modelAlpha = 0 } - assert.is_false(Has(Render(), "")) - scene.adapter.Model = nil - assert.is_true(Has(Render(), "<title>model: PlayerModel")) - end) - - it("renders the same scene to the same SVG", function() - scene.Node("StatusBar", frame, { points = { { all = true } }, bar = { min = 0, max = 3, value = 1 } }) - scene.Node("FontString", frame, { points = { { point = "CENTER" } }, text = { text = "1/3" } }) - assert.equals(Render(), Render()) - end) -end) diff --git a/wowproof/spec/sources_spec.lua b/wowproof/spec/sources_spec.lua deleted file mode 100644 index fae0074..0000000 --- a/wowproof/spec/sources_spec.lua +++ /dev/null @@ -1,84 +0,0 @@ -local Raster = require("wowproof.raster") -local WowUiTextures = require("wowproof.sources.wow_ui_textures") -local WagoCasc = require("wowproof.sources.wago_casc") -local AtlasTable = require("wowproof.sources.atlas_table") -local RemoteDir = require("wowproof.sources.remote_dir") - -local REF = "abc123" - -describe("wowproof wow-ui-textures source", function() - local dir - - local function Write(path, content) - Raster.MakeDir(path:match("^(.*)/[^/]+$")) - Raster.Write(path, content) - end - - before_each(function() - dir = io.popen("mktemp -d"):read("*l") - Write(dir .. "/trees/" .. REF .. ".tsv", "tree\ticons-sha\tICONS\nblob\tx\tREADME.md\n") - Write(dir .. "/trees/icons-sha.tsv", "blob\ta\tSpell_Holy_Renew.PNG\n") - Write(dir .. "/" .. REF .. "/ICONS/SPELL_HOLY_RENEW.png", "png") - end) - - after_each(function() - os.execute("rm -rf " .. Raster.Quote(dir)) - end) - - it("needs a pinned ref", function() - assert.has_error(function() WowUiTextures({ dir = dir }) end) - end) - - it("resolves Interface paths case-insensitively from its cache, with or without extensions", function() - local resolve = WowUiTextures({ ref = REF, dir = dir, fetch = false }) - local cached = dir .. "/" .. REF .. "/ICONS/SPELL_HOLY_RENEW.png" - assert.equals(cached, resolve("Interface\\Icons\\Spell_Holy_Renew")) - assert.equals(cached, resolve("interface/icons/spell_holy_renew.blp")) - assert.is_nil(resolve("MyAddon\\Media\\Glow")) - assert.is_nil(resolve(1234)) - end) - - it("remembers art the pinned commit doesn't have, without asking the network again", function() - local resolve = WowUiTextures({ ref = REF, dir = dir }) - assert.is_nil(resolve("Interface\\Icons\\Spell_Nature_LifeBloom")) - assert.is_nil(resolve("Interface\\Nowhere\\Thing")) - local missing = Raster.Read(dir .. "/missing-" .. REF .. ".txt") - assert.equals("ICONS\\SPELL_NATURE_LIFEBLOOM\nNOWHERE\\THING\n", missing) - end) - - it("resolves client file IDs from the pinned build's cache only", function() - assert.has_error(function() WagoCasc({ dir = dir }) end) - Write(dir .. "/casc-1.2.3.4/7526019.png", "png") - local resolve = WagoCasc({ build = "1.2.3.4", dir = dir, fetch = false }) - assert.equals(dir .. "/casc-1.2.3.4/7526019.png", resolve(7526019)) - assert.equals(dir .. "/casc-1.2.3.4/7526019.png", resolve("7526019")) - assert.is_nil(resolve(1234)) - assert.is_nil(resolve(1.5)) - assert.is_nil(resolve("Interface\\Icons\\Spell_Holy_Renew")) - end) - - it("copies files from a remote folder into its cache once, and stays inside it", function() - Write(dir .. "/remote/classic/Male-Human.png", "png") - local cache = dir .. "/cache" - local resolve = RemoteDir({ remote = dir .. "/remote/", dir = cache }) - assert.equals(cache .. "/classic/Male-Human.png", resolve("classic/Male-Human.png")) - assert.equals("png", Raster.Read(cache .. "/classic/Male-Human.png")) - assert.is_nil(resolve("classic/Female-Orc.png")) - Write(dir .. "/remote/classic/Female-Orc.png", "png") - assert.is_nil(resolve("classic/Female-Orc.png")) - assert.is_nil(resolve("../remote/classic/Female-Orc.png")) - assert.is_nil(resolve("/etc/hostname")) - assert.equals(cache .. "/classic/Male-Human.png", RemoteDir({ dir = cache })("classic/Male-Human.png")) - assert.is_nil(RemoteDir({ dir = cache, remote = dir .. "/remote", fetch = false })("classic/Female-Orc.png")) - assert.has_error(function() RemoteDir({ remote = dir }) end) - end) - - it("looks atlases up by name, case-insensitively like the client", function() - local info = { file = 7526019 } - local resolve = AtlasTable({ ["RaidFrame-Icon-Rez"] = info }) - assert.equals(info, resolve("raidframe-icon-rez")) - assert.equals(info, resolve("RAIDFRAME-ICON-REZ")) - assert.is_nil(resolve("Missing")) - assert.is_nil(resolve(nil)) - end) -end) From b6ad62d2df79966f054f22abfd6346b0379394c5 Mon Sep 17 00:00:00 2001 From: Martin Konstantin Herrmann Date: Mon, 9 Nov 2026 21:37:14 +0100 Subject: [PATCH 2/3] UNIT-7 Use the library's mock, API snapshot and client data tests/mock/wow.lua now extends wowmock with the UnitFrames globals and helpers load TOCs through wowmock.loader. Drop the local API contract, snapshot, snapshot generator, Blizzard source updater and atlas generator. spell_catalog.py and proof art take the client pin from the library's clientdata/forever.json; specs read Blizzard source from the library's synced checkout. CI no longer checks out wow-ui-source. --- .github/workflows/release.yml | 11 +- .github/workflows/tests.yml | 13 +- .github/workflows/upstream.yml | 35 +- AGENTS.md | 12 +- DEVELOPMENT.md | 77 +- data/forever-atlases/manifest.json | 24 - scripts/api-snapshot.lua | 265 -- scripts/atlas_catalog.py | 221 -- scripts/check-upstream.sh | 24 +- scripts/spell_catalog.py | 36 +- scripts/test-tag.sh | 6 +- scripts/update-blizzard-source.sh | 38 - tests/fixtures/api_snapshot.lua | 2141 ----------------- tests/helpers.lua | 88 +- tests/mock/api.lua | 172 -- tests/mock/wow.lua | 1872 +------------- tests/proof/setup.lua | 10 +- tests/scripts/spell_catalog_test.py | 25 +- tests/spec/auras/aura_bar_collapse_spec.lua | 2 +- tests/spec/auras/aura_bar_spec.lua | 2 +- .../clickgrid/clickgrid_pet_native_spec.lua | 4 +- tests/spec/contract/api_contract_spec.lua | 23 +- tests/spec/contract/atlas_catalog_spec.lua | 7 +- 23 files changed, 131 insertions(+), 4977 deletions(-) delete mode 100644 data/forever-atlases/manifest.json delete mode 100644 scripts/api-snapshot.lua delete mode 100644 scripts/atlas_catalog.py delete mode 100644 scripts/update-blizzard-source.sh delete mode 100644 tests/fixtures/api_snapshot.lua delete mode 100644 tests/mock/api.lua diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 65f48d5..b8a597e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -39,13 +39,10 @@ jobs: run: sudo apt-get update && sudo apt-get install -y luajit python3 zip unzip jq - name: Set up pinned libraries run: bash scripts/setup-test-libs.sh - - name: Check out the matching Blizzard source - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 - with: - repository: Gethe/wow-ui-source - ref: 9dc84f0d3bbae1768ac3405b3716000bd93eda06 # Forever 1.60.1.70862 - path: examples/wow-ui-source-forever - persist-credentials: false + - name: Fetch the pinned wow-ui-testing library + env: + GITHUB_TOKEN: ${{ github.token }} + run: bash scripts/fetch-wut.sh - name: Verify the generated spell catalogue against pinned exports run: python3 -B scripts/spell_catalog.py --fetch --check - name: Save spell classification audit diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6960d12..545196a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -35,25 +35,16 @@ jobs: env: GITHUB_TOKEN: ${{ github.token }} run: bash scripts/fetch-wut.sh - - name: Check out the matching Blizzard source - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 - with: - repository: Gethe/wow-ui-source - ref: 9dc84f0d3bbae1768ac3405b3716000bd93eda06 # Forever 1.60.1.70862 - path: examples/wow-ui-source-forever - persist-credentials: false - name: Verify the generated spell catalogue against pinned exports run: python3 -B scripts/spell_catalog.py --fetch --check - - name: Verify the generated proof atlas table against pinned exports - run: python3 -B scripts/atlas_catalog.py --fetch --check - name: Run all tests and addon syntax checks run: bash scripts/run-tests.sh --times -j - name: Cache Blizzard interface art for UI proof uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: path: .proof-art - key: proof-art-d23deaf8f44a7d280dc974a5c9d5321c013db59b-${{ hashFiles('tests/proof/*.lua') }} - restore-keys: proof-art-d23deaf8f44a7d280dc974a5c9d5321c013db59b- + key: proof-art-${{ hashFiles('.wut-version') }}-${{ hashFiles('tests/proof/*.lua') }} + restore-keys: proof-art-${{ hashFiles('.wut-version') }}- - name: Render UI proof env: GITHUB_TOKEN: ${{ github.token }} diff --git a/.github/workflows/upstream.yml b/.github/workflows/upstream.yml index 1cc421f..ff01de3 100644 --- a/.github/workflows/upstream.yml +++ b/.github/workflows/upstream.yml @@ -1,14 +1,12 @@ name: Upstream -# Weekly drift check against Blizzard's Forever UI source and the pinned -# libraries. A newer Forever source becomes a pull request (re-pinned -# workflows and a regenerated API snapshot; the test suite reviews it). -# Library drift is tracked in one issue: library updates also need -# scripts/fetch-libs.sh and a manual review. +# Weekly drift check against the pinned libraries, tracked in one issue: +# library updates also need scripts/fetch-libs.sh and a manual review. The +# Blizzard Forever UI source is pinned and tracked by the wow-ui-testing +# library; a new client build arrives here as a .wut-version bump. # # Requires the UPSTREAM_TOKEN secret: a fine-grained token for this -# repository with Contents, Pull requests, Issues and Workflows read/write. -# Pull requests opened with it trigger the test suite, unlike GITHUB_TOKEN. +# repository with Contents read and Issues read/write. on: schedule: - cron: '0 6 * * 1' @@ -45,29 +43,6 @@ jobs: - name: Compare pins with upstream id: check run: bash scripts/check-upstream.sh - - name: Propose the newest Forever source - if: steps.check.outputs.source_behind == 'true' - env: - LATEST: ${{ steps.check.outputs.source_latest }} - run: | - bash scripts/update-blizzard-source.sh "$LATEST" - version="$(tr -d '[:space:]' < examples/wow-ui-source-forever/version.txt)" - branch=upstream/wow-ui-source - git config user.name 'github-actions[bot]' - git config user.email '41898282+github-actions[bot]@users.noreply.github.com' - git switch -c "$branch" - git add .github/workflows/tests.yml .github/workflows/release.yml tests/fixtures/api_snapshot.lua tests/fixtures/dot_source.json data/forever-spells/manifest.json UnitFrames/Tracking/DotCatalog.lua - git commit -q -m "Pin Blizzard source to Forever $version" \ - -m "Generated by the Upstream workflow from Gethe/wow-ui-source $LATEST." - git push -q --force origin "$branch" - if [ -z "$(gh pr list --head "$branch" --state open --json number --jq '.[].number')" ]; then - gh pr create --base main --head "$branch" --title "Pin Blizzard source to Forever $version" --body "## Summary - - Pins tests and releases to Gethe/wow-ui-source \`$LATEST\` (Forever $version). - - Regenerates \`tests/fixtures/api_snapshot.lua\` from it. - - Refreshes the spell snapshots and regenerates the DoT catalogue and exclusion audit for the same build. - - Review the snapshot diff for changed or removed APIs the addons use. Install and check the client before merging when the build changes behaviour." - fi - name: Track library drift env: BEHIND: ${{ steps.check.outputs.libs_behind }} diff --git a/AGENTS.md b/AGENTS.md index e12912b..c5904dc 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -5,15 +5,15 @@ - This is **UnitFrames for WoW Forever**, currently targeting TOC Interface `16001`. Use Lua 5.1-compatible code. Forever uses modern Retail/Midnight UI APIs and secret-value restrictions; do not assume Classic-era APIs work because the client was a classic beta. - Read the relevant implementation and tests before changing it. `README.md` describes current features. `docs/01-investigation-api-and-libraries.md`, `docs/02-architecture-plan.md`, and `docs/03-reference-nurfed-forever.md` explain the design and API findings, but contain dated research and unimplemented plans. Current code wins when they disagree. - `docs/WoW unit frames addon libraries.md` is the long conversation history, not a specification to implement wholesale. Search specific topics rather than loading the entire file. -- Verify unfamiliar or changing APIs against the actual client or Blizzard UI/API documentation, preferably the `forever` branch of `Gethe/wow-ui-source` cloned into `examples/wow-ui-source-forever` for local access. Never invent API signatures or texture paths. +- Verify unfamiliar or changing APIs against the actual client or Blizzard UI/API documentation, preferably the Gethe/wow-ui-source commit the wow-ui-testing library pins, checked out into `.wut/.client-source/forever` by `bash .wut/scripts/update-client-source.sh --sync`. Never invent API signatures or texture paths. - Preserve existing worktree changes. Do not commit, push, update dependencies, or install into the game merely because you were asked to explain or review something. ## Code map and conventions - `UnitFrames/Core/`: namespace/bootstrap, schema, AceDB configuration, theme, media, colours and text formats. Core Lua files receive `local _, ns = ...`; the public `UnitFrames` handle exposes that namespace to companion addons. - `UnitFrames/Tracking/`: data-only DoT damage estimates (tracking ported from DoesItDie, MIT). `DotSpells` reads generated numeric metadata, never descriptions. `ns.DotTracker` runs only while `Acquire`d on the exact catalogue client build, checks player-known spell IDs, keys active DoTs by generated family and learns ticks per rank. It matches `UNIT_COMBAT` on target/focus, fires `DotsChanged(key)` and fills reused lists through `Breakdown`. In combat `UNIT_COMBAT` amounts are secret: those hits match on school and rhythm alone (never drop them, or every DoT looks resisted) and are tallied per spell; on `PLAYER_REGEN_ENABLED` the `C_DamageMeter` per-spell totals, minus the generated `directPoints` upfront hit, become weighted average ticks. Fights with unseen ticks, several combo-point sizes or a dominant upfront hit are not learned. Learned tick sizes and weights live in AceDB `global`. -- `tests/proof/atlases.lua` is generated by `python3 -B scripts/atlas_catalog.py` from Wago atlas exports for the same pinned Forever build (manifest in `data/forever-atlases/`). Regenerate it after adding a `SetAtlas` call, so UI proof draws the atlas. -- `Tracking/DotCatalog.lua` is generated by `python3 -B scripts/spell_catalog.py` from checksum-verified Wago exports cached under ignored `examples/forever-spells//`. Only the manifest (`data/forever-spells/manifest.json`), generated Lua and small native-record fixtures are tracked. It must match the exact Forever UI-source build/commit in both workflows and the TOC interface. `scripts/update-blizzard-source.sh` refreshes both sources; `--fetch --check` populates a fresh cache and validates regeneration in CI. Ordinary tests use `--check-pin` and the small fixtures offline. The ignored `catalog.json` audits periodic candidates and exclusions; CI uploads it as an artifact. Channels are excluded. Runtime only accepts player-known spells. Combo builders, finishers, rank families and projectile flags are generated. Agony's uneven shape remains an explicit family-ID exception in `DotSpells`; baseline damage is unmodified client data until ticks are learned. +- `tests/proof/atlases.lua` is generated by the library's `.wut/scripts/atlas_catalog.py --scan ... --output tests/proof/atlases.lua` (command in DEVELOPMENT.md) from Wago atlas exports for its pinned Forever build. Regenerate it after adding a `SetAtlas` call, so UI proof draws the atlas. +- `Tracking/DotCatalog.lua` is generated by `python3 -B scripts/spell_catalog.py` from checksum-verified Wago exports cached under ignored `examples/forever-spells//`. Only the manifest (`data/forever-spells/manifest.json`), generated Lua and small native-record fixtures are tracked. It must match the exact Forever UI-source build/commit the wow-ui-testing library pins (`.wut/clientdata/forever.json`) and the TOC interface; `--update` after a `.wut-version` bump that changes the build. `--fetch --check` populates a fresh cache and validates regeneration in CI. Ordinary tests use `--check-pin` and the small fixtures offline. The ignored `catalog.json` audits periodic candidates and exclusions; CI uploads it as an artifact. Channels are excluded. Runtime only accepts player-known spells. Combo builders, finishers, rank families and projectile flags are generated. Agony's uneven shape remains an explicit family-ID exception in `DotSpells`; baseline damage is unmodified client data until ticks are learned. - Pending DoT damage: `Components/PendingDamage.lua` is owned by Bar (`spec.pendingDamage`, health rows) like Overheal; the `pendingDamage` frame driver binds `UF_PendingDamage` (Elements.lua), and the health `PostUpdate` (`ufHealthHooks`) gives it the secret scale and current health. - `UnitFrames/Components/`: reusable visual building blocks. Keep them independent of oUF bindings; their configuration and data APIs also serve previews. `UnitFrame` exposes rows and optional parts through `GetRow(key)`/`GetPart(key)` and the `Rows()`/`Parts()` iterators; add a part to `UnitFrame.PARTS` rather than adding per-part getters. Ready-check state lives in the `ReadyCheck` presenter (`GetReadyCheck()`), which also owns its settings schema. - Classes (`Core/Class.lua`): configurable visuals extend `Component`, settings controls extend `Widget`, other stateful helpers extend `Object` (`Class:New(...)` calls `Init(...)`). Stateless calculations stay plain module tables of functions. @@ -27,7 +27,7 @@ - `UnitFrames_ClickGrid/`: optional healing panel companion (`/ufcg`): party/raid groups, member targets, native aura slots, status indicators and click-spell bindings, built from the same `UnitFrame` component through the public `UnitFrames` handle. - Match nearby code: tabs, local helpers, existing component methods. New runtime files must be added to the appropriate `.toc` in dependency order; the tests load those TOCs too. - Embedded libraries under either addon's `Libs/` are pinned dependencies, not normal edit targets. The folders are gitignored: `scripts/fetch-libs.sh` replaces local copies and records `UnitFrames/Libs/VERSIONS.md`, and `scripts/setup-test-libs.sh` holds the commits tests and releases build from. Run them only for an intentional dependency update and keep both pins in step. -- `scripts/check-upstream.sh` reports whether the pinned Blizzard source and libraries match upstream; `scripts/update-blizzard-source.sh [commit]` re-pins both workflows to a Forever commit, syncs `examples/wow-ui-source-forever` as a git checkout and regenerates the API snapshot. The weekly Upstream workflow opens a pull request for a newer Forever source and keeps one issue for library drift. +- `scripts/check-upstream.sh` reports whether the embedded libraries match upstream; the weekly Upstream workflow keeps one issue for library drift. The Blizzard source, API snapshot and atlas exports are pinned and bumped in wow-ui-testing; a new client build reaches this repo as a `.wut-version` bump. ## Configuration and lifecycle @@ -92,8 +92,8 @@ luajit tests/run.lua workbench -t "preview" - Specs live in `tests/spec//` (`core`, `contract`, `components`, `auras`, `units`, `workbench`, `editmode`, `clickgrid`, `tracking`, `onboarding`). Put new specs in the area of the code they exercise; a feature spec keeps its live and Workbench preview tests together. When behaviour also has tests in other areas, tag them in the `describe`/`it` name (`#shields`) and keep existing tags. - The runner (`wowtest`) and the proof renderer (`wowproof`) come from the shared wow-ui-testing library, pinned by commit in `.wut-version` and fetched into the ignored `.wut/` by `scripts/fetch-wut.sh` (`tests/run.lua` and `scripts/proof.sh` fetch it when missing). `tests/wut.config.lua` configures the runner. Don't edit `.wut/`; library changes go to the wow-ui-testing repository, tried here with `WUT_DIR=`, then a `.wut-version` bump. - Path filters match **spec paths** (`units/` is exactly that folder, `name_spec.lua` exactly that file); `-t` matches test names and `--tag` matches tags. `-j [N]` runs spec files in parallel; `--times` (runner or `scripts/run-tests.sh`) reports per-spec durations; `luajit -jp=F tests/run.lua ...` profiles. The runner includes addon Lua syntax checks. No external busted installation is needed. -- `tests/helpers.lua` loads TOCs into a fresh mocked client; `tests/mock/wow.lua` includes fake secrets and `tests/mock/ouf.lua` supplies the usual oUF stand-in. Some specs exercise embedded oUF paths explicitly. -- The mock is held to the client API through `tests/fixtures/api_snapshot.lua`, generated from Blizzard's API documentation and Lua source by `luajit scripts/api-snapshot.lua` (regenerate after adding API usage or updating the source checkout, and review the diff). The checkout must match the commit pinned in the workflows, or CI regenerates a different snapshot. `tests/mock/api.lua` enforces it on every mock call: undocumented widget methods, rejected arguments, secrets passed where addon (tainted) code may not pass them, and protected calls in combat raise errors. `tests/spec/contract/api_contract_spec.lua` checks the mock's functions, methods, enums, restricted secret returns and our event names, and that the snapshot is current when the source checkout exists. +- `tests/helpers.lua` loads TOCs into a fresh mocked client through the library's `wowmock.loader`; `tests/mock/wow.lua` extends the library's `wowmock` (fake secrets, the client UI) with the UnitFrames globals to reset, and `tests/mock/ouf.lua` supplies the usual oUF stand-in. Generic mock behaviour belongs in wow-ui-testing, not here. Some specs exercise embedded oUF paths explicitly. +- The mock is held to the library's full API snapshot of the pinned client build (`.wut/wowmock/snapshots/`): undocumented widget methods, rejected arguments, secrets passed where addon (tainted) code may not pass them, and protected calls in combat raise errors. The library regenerates and checks the snapshot; `tests/spec/contract/api_contract_spec.lua` checks our event names and that addon code doesn't use mock-only helpers. Missing client API goes into wowmock from the snapshot (wow-ui-testing, tried here with `WUT_DIR`), not from memory. - Specs simulating Blizzard secure code or engine state use `Mock.SecureDelegate`/`Mock.RunUntainted` (secure delegates such as `UnitFrameUtil.UpdateUnitPvPIndicator`) and `Mock.SetEngineSize` (engine-given, possibly secret dimensions) instead of calling addon-facing APIs with values addon code could not pass. - Add regression tests for fixes. Keep mocks faithful to native assertions/restrictions; do not weaken a mock simply to make a broken implementation pass. Add new mock API from the snapshot, not from memory. - Offline mocks cannot prove rendering, taint safety or combat behaviour. For visual/lifecycle changes, report what still needs in-game verification: Workbench entry switching/release, repeated toggles, sample/live sources, real combat, unit disappearance/replacement, full-health shields, and Edit Mode as relevant. diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 8f4e1af..235988d 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -50,34 +50,32 @@ See the script for `ACE3_REF`, `OUF_REF`, `LEM_REF`, `LDB_REF` and library versions are recorded in `UnitFrames/Libs/VERSIONS.md`. Verify unfamiliar APIs against the actual client or Blizzard's UI/API -documentation. The optional local source checkout is -`examples/wow-ui-source-forever`, using Gethe/wow-ui-source's `forever` branch. +documentation. The client build, its Gethe/wow-ui-source commit and the art +refs are pinned by the wow-ui-testing library (`.wut/clientdata/forever.json`, +see [The wow-ui-testing library](#the-wow-ui-testing-library)). Check that +commit out locally with `bash .wut/scripts/update-client-source.sh --sync`; it lands in the ignored +`.wut/.client-source/forever`, where a few specs run Blizzard's own Lua against +our frames (they skip without it). ## Forever spell catalogue `scripts/spell_catalog.py` compiles `UnitFrames/Tracking/DotCatalog.lua` from Blizzard client tables exported by [Wago](https://wago.tools/db2). It uses the -exact Forever build and UI-source commit pinned in both test and release -workflows, and verifies the addon's TOC interface against that build. Interface -`16001` alone is insufficient to select spell data. - -Refresh the UI source, API snapshot and spell catalogue together with: - -```sh -bash scripts/update-blizzard-source.sh -``` - -To refresh just the spell snapshot for the already-pinned source: +exact Forever build and UI-source commit the wow-ui-testing library pins +(`.wut/clientdata/forever.json`), and verifies the addon's TOC interface +against that build. Interface `16001` alone is insufficient to select spell +data. A new client build arrives as a `.wut-version` bump; then refresh the +spell snapshot for it: ```sh python3 -B scripts/spell_catalog.py --update ``` -The downloader requires a matching local UI-source checkout and requests an +`--update` requires the library's UI-source checkout (`bash .wut/scripts/update-client-source.sh --sync`) and requests an explicit build for every table. It rejects responses whose download filename does not confirm that build. There is no fallback to the latest build. A missing build, changed schema or changed classification evidence stops the update for -review. The weekly Upstream workflow includes spell data in its source-update PR. +review. `data/forever-spells/manifest.json` records the build, UI commit, interface, URLs, confirmed filenames, row counts and SHA-256 hashes of the uncompressed @@ -186,8 +184,8 @@ in source is needed before tagging. | `UnitFrames_ClickGrid/` | Party/raid panel, member targets, indicators, auras and click-spell bindings | | `UnitFrames_Onboarding/` | Load-on-demand Getting started guide: preset looks, tweaks, extras and Workbench hand-off | | `UnitFrames_Media/` | Additional fonts and their licences | -| `tests/` | Mocked client, API snapshot and regression specs | -| `scripts/` | Library fetching, installation and API snapshot generation | +| `tests/` | Regression specs, UnitFrames' mock extensions and UI-proof scenarios | +| `scripts/` | Library fetching, installation, release and the spell catalogue | | `.wut/` | The fetched [wow-ui-testing](https://github.com/voshond/wow-ui-testing) library (ignored by Git) | New runtime files belong in the relevant TOC in dependency order; tests @@ -231,8 +229,10 @@ use LuaJIT's profiler: `luajit -jp=F tests/run.lua clickgrid_spec.lua`. ### The wow-ui-testing library -The spec runner (`wowtest`) and the UI-proof renderer (`wowproof`) come from -the shared [wow-ui-testing](https://github.com/voshond/wow-ui-testing) +The spec runner (`wowtest`), the mocked client and its API snapshot +(`wowmock`), the UI-proof renderer (`wowproof`) and the Blizzard client-data +pins (`clientdata/`: build, wow-ui-source commit, art refs, atlas exports) +come from the shared [wow-ui-testing](https://github.com/voshond/wow-ui-testing) library, which our other addons use too. `.wut-version` pins one library commit (full SHA, the version tag after `#`). `scripts/fetch-wut.sh` (a copy of the library's) downloads that commit into the ignored `.wut/` folder and @@ -277,15 +277,15 @@ The images show real anchoring, sizes, colours, bar fill, text, clipping, texture coordinates and paint order. Blizzard textures and icons (`Interface\...`) are downloaded on demand from the public [Gethe/wow-ui-textures](https://github.com/Gethe/wow-ui-textures) mirror, -pinned in `tests/proof/setup.lua`, into the ignored `.proof-art/` folder. Only +pinned by the library's `clientdata/forever.json`, into the ignored `.proof-art/` folder. Only the files a render uses are fetched, and the cache is reused offline. Never commit that art. `UF_PROOF_ART` picks another cache folder, and `UF_PROOF_ART_FETCH=0` stays offline. Set `GH_TOKEN` or `GITHUB_TOKEN` if GitHub's API rate limit bites. -Atlases (`SetAtlas`) come from `tests/proof/atlases.lua`, which +Atlases (`SetAtlas`) come from `tests/proof/atlases.lua`, which the library's `scripts/atlas_catalog.py` generates from Wago's `UiTextureAtlas`, -`UiTextureAtlasMember` and `UiTextureAtlasElement` exports for the pinned +`UiTextureAtlasMember` and `UiTextureAtlasElement` exports for its pinned Forever build. It keeps only the atlases the addon and oUF elements name: dashed string literals in files that mention atlases, plus `"prefix-" .. value` concatenations. Where an atlas has several members, it takes the 1x one and @@ -294,11 +294,13 @@ Wago for the same build into `.proof-art/casc-/`. Don't edit the generated table: ```sh -python3 -B scripts/atlas_catalog.py --update # fetch exports for the pinned build and regenerate -python3 -B scripts/atlas_catalog.py # regenerate from the cached exports -python3 -B scripts/atlas_catalog.py --fetch --check # what CI runs +python3 -B .wut/scripts/atlas_catalog.py --fetch --output tests/proof/atlases.lua \ + --scan 'UnitFrames*/*.lua' 'UnitFrames*/[!L]*/**/*.lua' 'UnitFrames/Libs/oUF/elements/*.lua' ``` +Add `--check` to verify the committed table instead of writing it. The suite +only checks its build against the library's pin (`atlas_catalog_spec`). + Regenerate after adding a `SetAtlas` call. A name the table lacks draws as a placeholder. @@ -365,17 +367,16 @@ when you want feedback before opening or updating a pull request. ### API snapshot and client verification -The mock API is checked against `tests/fixtures/api_snapshot.lua`. With the -Blizzard source checkout present, the suite also checks that regeneration -produces the committed snapshot. After adding API usage or updating that -checkout, regenerate and review the diff: - -```sh -luajit scripts/api-snapshot.lua -``` - -When updating the client source version, update the workflow's pinned Blizzard -checkout commit alongside the reviewed snapshot. +The mock is the library's `wowmock`, held to its full API snapshot of the +pinned client build (`.wut/wowmock/snapshots/`). `tests/mock/wow.lua` only +extends it with what UnitFrames needs (`Mock.Extend`: the globals cleared on +every install), `tests/mock/ouf.lua` is the oUF stand-in, and +`tests/helpers.lua` loads TOCs through the library's `wowmock.loader`. A mock +gap or a newer client build is fixed in wow-ui-testing (try it here with +`WUT_DIR`), then picked up with a `.wut-version` bump. The library's own CI +regenerates the snapshot from the Blizzard source and compares it. +`tests/spec/contract/api_contract_spec.lua` still checks our side: event names +the addons register and no mock-only helpers in addon code. Add regression tests for fixes. Keep mocks faithful to native restrictions; do not weaken them to make an implementation pass. Offline tests cannot @@ -398,8 +399,8 @@ git tag -a v0.1.0 -m 'UnitFrames 0.1.0' git push origin v0.1.0 ``` -A tag push runs the full suite with pinned dependencies and the matching -Blizzard source, builds `UnitFrames-v0.1.0.zip` and its SHA-256 file, and +A tag push runs the full suite with pinned dependencies and the pinned +wow-ui-testing library, builds `UnitFrames-v0.1.0.zip` and its SHA-256 file, and attaches them to a **draft** GitHub release. Review the notes and publish the draft when ready. Publishing a release directly also builds and attaches the ZIP, even if the tag was not previously pushed separately. diff --git a/data/forever-atlases/manifest.json b/data/forever-atlases/manifest.json deleted file mode 100644 index fd16367..0000000 --- a/data/forever-atlases/manifest.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "build": "1.60.1.70862", - "format": 1, - "tables": { - "UiTextureAtlas": { - "filename": "UiTextureAtlas.1.60.1.70862.csv", - "rows": 2826, - "sha256": "a53e784e29c3a42d4a991e843fa1908d15f1fc381c66ac4ecfc508c3b7d19041", - "url": "https://wago.tools/db2/UiTextureAtlas/csv?build=1.60.1.70862&locale=enUS" - }, - "UiTextureAtlasElement": { - "filename": "UiTextureAtlasElement.1.60.1.70862.csv", - "rows": 20817, - "sha256": "d5b5244ceefcde365bbdcf925104ddf848ce35554bc182b7d9e06071abc7d262", - "url": "https://wago.tools/db2/UiTextureAtlasElement/csv?build=1.60.1.70862&locale=enUS" - }, - "UiTextureAtlasMember": { - "filename": "UiTextureAtlasMember.1.60.1.70862.csv", - "rows": 20685, - "sha256": "000fe3517bb7600aeee97b4465e9c721accd6914dde6ba079ebe00a6e2562d6b", - "url": "https://wago.tools/db2/UiTextureAtlasMember/csv?build=1.60.1.70862&locale=enUS" - } - } -} diff --git a/scripts/api-snapshot.lua b/scripts/api-snapshot.lua deleted file mode 100644 index d6963ca..0000000 --- a/scripts/api-snapshot.lua +++ /dev/null @@ -1,265 +0,0 @@ ---[[ -Regenerates tests/fixtures/api_snapshot.lua from a wow-ui-source checkout: -the documented client API (Blizzard_APIDocumentationGenerated) and Blizzard's -own Lua definitions, limited to what the addons, mocks and specs mention. - - luajit scripts/api-snapshot.lua [wow-ui-source dir] [output file] - -Defaults: examples/wow-ui-source-forever, tests/fixtures/api_snapshot.lua. -Run from the repository root after updating the source checkout to a new -client build, then review the diff: it is the API change list that matters -to us. The tests (tests/mock/api.lua) hold the mock to this snapshot. -]] -local sourceDir = arg[1] or "examples/wow-ui-source-forever" -local outFile = arg[2] or "tests/fixtures/api_snapshot.lua" -local docsDir = sourceDir .. "/Interface/AddOns/Blizzard_APIDocumentationGenerated" -local API = dofile("tests/mock/api.lua") - -local function Lines(command) - local list, pipe = {}, assert(io.popen(command)) - for line in pipe:lines() do list[#list + 1] = line end - pipe:close() - return list -end - -local function Read(path) - local file = assert(io.open(path)) - local text = file:read("*a") - file:close() - return text -end - -local version = Read(sourceDir .. "/version.txt"):match("^%s*(.-)%s*$") - --- Every identifier our code, embedded libraries, mocks and specs mention, --- and those the mock itself defines. -local words, mockWords = {}, {} -for _, path in ipairs(Lines("find UnitFrames UnitFrames_Workbench UnitFrames_ClickGrid UnitFrames_Onboarding UnitFrames_Media tests" - .. " -name '*.lua' -not -name 'api_snapshot.lua'")) do - local mock = path:match("^tests/mock/") ~= nil - for word in Read(path):gmatch("[%a_][%w_]*") do - words[word] = true - if mock then mockWords[word] = true end - end -end - --- Documentation files reference Enum/Constants while defining themselves. -local Proxy -local function Expression() return Proxy("") end -function Proxy(path) - return setmetatable({}, { - __index = function(_, key) return Proxy(path .. "." .. key) end, - __tostring = function() return path end, - __add = Expression, __sub = Expression, __mul = Expression, __div = Expression, - __unm = Expression, __concat = Expression, - }) -end - -local systems = {} -for _, path in ipairs(Lines("find '" .. docsDir .. "' -name '*.lua' | LC_ALL=C sort")) do - local env = setmetatable({ - APIDocumentation = { AddDocumentationTable = function(_, t) systems[#systems + 1] = t end }, - }, { __index = function(_, key) return Proxy(key) end }) - local chunk = assert(loadfile(path)) - setfenv(chunk, env) - chunk() -end - --- "name:Type", with "?" when the argument may be omitted (nilable or defaulted). -local function Field(arg) - return arg.Name .. ":" .. tostring(arg.Type) .. ((arg.Nilable or arg.Default ~= nil) and "?" or "") -end - -local NOT_CONDITIONS = { SecretReturns = true, SecretArguments = true, SecretAccessor = true, - SecretReturnsForAspect = true, SecretArgumentsAddAspect = true, SecretValue = true, SecretPayloads = true } - --- Widget methods keep only their secret and protection rules: overloads --- (SetPoint) make their documented argument lists unsuitable for checks. -local function Compact(fn, method, system) - local def = { system = system } - if not method and fn.Arguments and #fn.Arguments > 0 then - def.args = {} - for i, arg in ipairs(fn.Arguments) do def.args[i] = Field(arg) end - end - if not method and fn.Returns and #fn.Returns > 0 then - def.returns = {} - for i, ret in ipairs(fn.Returns) do def.returns[i] = Field(ret) end - end - def.secretArguments = fn.SecretArguments - def.secretReturns = fn.SecretReturns or nil - def.protected = fn.IsProtectedFunction or nil - for key, value in pairs(fn) do - local condition = not NOT_CONDITIONS[key] and key:match("^Secret(.+)$") - if condition and value == true then - def.secretWhen = def.secretWhen or {} - def.secretWhen[#def.secretWhen + 1] = condition:gsub("^When", "") - end - end - if def.secretWhen then table.sort(def.secretWhen) end - for key, out in pairs({ SecretReturnsForAspect = "secretAspects", SecretArgumentsAddAspect = "addsAspects" }) do - if fn[key] then - def[out] = {} - for i, aspect in ipairs(fn[key]) do def[out][i] = tostring(aspect):match("([^.]+)$") end - end - end - return def -end - -local wantedObjects = {} -for _, chain in pairs(API.TYPES) do - for _, name in ipairs(chain) do wantedObjects[name] = true end -end - -local snapshot = { version = version, functions = {}, enums = {}, events = {}, scriptObjects = {}, - lua = { globals = {}, methods = {}, called = {} } } -for _, system in ipairs(systems) do - if system.Type == "ScriptObject" then - if wantedObjects[system.Name] then - local methods = {} - for _, fn in ipairs(system.Functions or {}) do methods[fn.Name] = Compact(fn, true) end - snapshot.scriptObjects[system.Name] = methods - end - else - for _, fn in ipairs(system.Functions or {}) do - -- A function's own Namespace overrides its system's; "" is global. - local namespace = fn.Namespace - if namespace == nil then namespace = system.Namespace end - if namespace == "" then namespace = nil end - if words[fn.Name] and (not namespace or words[namespace]) then - snapshot.functions[namespace and namespace .. "." .. fn.Name or fn.Name] = Compact(fn, false, system.Name) - end - end - for _, event in ipairs(system.Events or {}) do - if words[event.LiteralName] then snapshot.events[event.LiteralName] = true end - end - end - for _, t in ipairs(system.Tables or {}) do - if t.Type == "Enumeration" and words[t.Name] then - local values = {} - for _, field in ipairs(t.Fields or {}) do values[field.Name] = field.EnumValue end - snapshot.enums[t.Name] = values - end - end -end - ---[[ -Blizzard's Lua, three kinds of evidence that a name exists in the client: - globals global and table fields Blizzard defines that the mock also defines - ("AuraUtil.GetAuraBorderColor") - methods mixin methods (template methods such as SetBackdrop); one example owner - called undocumented engine functions and methods that the mock defines and - Blizzard code calls (CreateFrame, IsInGroup, ...): existence only -]] -local docsPrefix = sourceDir .. "/Interface/AddOns/Blizzard_APIDocumentation" -local KEYWORDS = {} -for word in ("and break do else elseif end false for function if in local nil not or repeat return then true" - .. " until while"):gmatch("%a+") do KEYWORDS[word] = true end -local calls = {} -for _, path in ipairs(Lines("find '" .. sourceDir .. "/Interface' -name '*.lua' | LC_ALL=C sort")) do - if path:sub(1, #docsPrefix) ~= docsPrefix then - local relative = path:sub(#sourceDir + 2) - for line in Read(path):gmatch("[^\n]+") do - local name = line:match("^function%s+([%w_]+)%s*%(") or line:match("^([%w_]+)%s*=[^=]") - local owner, key = line:match("^%s*function%s+([%w_]+)%.([%w_]+)%s*%(") - if not owner then owner, key = line:match("^%s*([%w_]+)%.([%w_]+)%s*=[^=]") end - local mixin, method = line:match("^%s*function%s+([%w_]+):([%w_]+)%s*%(") - -- Globals only matter for what the mock defines; global tables are capitalised. - if name and mockWords[name] then - snapshot.lua.globals[name] = snapshot.lua.globals[name] or relative - elseif owner and owner:match("^[A-Z]") and mockWords[owner] and mockWords[key] then - local full = owner .. "." .. key - snapshot.lua.globals[full] = snapshot.lua.globals[full] or relative - elseif mixin and words[method] then - local first = snapshot.lua.methods[method] - if not first or mixin < first then snapshot.lua.methods[method] = mixin end - -- The mock may also define the mixin table itself ("BackdropTemplateMixin"). - if mixin:match("^[A-Z]") and mockWords[mixin] and mockWords[method] then - local full = mixin .. "." .. method - snapshot.lua.globals[full] = snapshot.lua.globals[full] or relative - end - end - if not line:match("^%s*%-%-") then - for call in (" " .. line):gmatch("[^%w_.:]([%w_]+)%s*%(") do - -- Lua's own globals are not client API. - if mockWords[call] and not KEYWORDS[call] and _G[call] == nil then - calls[call] = calls[call] or relative - end - end - for call in line:gmatch(":([%w_]+)%s*%(") do - if mockWords[call] then calls[":" .. call] = calls[":" .. call] or relative end - end - end - end - end -end -for name, relative in pairs(calls) do - local method = name:match("^:(.+)$") - if method then - if not snapshot.lua.methods[method] then snapshot.lua.called[name] = relative end - elseif not snapshot.functions[name] and not snapshot.lua.globals[name] then - snapshot.lua.called[name] = relative - end -end - --- Filter components aura containers accept (AuraUtil.IsValidFilterString). -snapshot.lua.auraFilters = {} -local auraFilters = assert(Read(sourceDir .. "/Interface/AddOns/Blizzard_FrameXMLUtil/AuraUtil.lua") - :match("AuraUtil%.AuraFilters%s*=%s*(%b{})"), "AuraUtil.AuraFilters not found") -for component in auraFilters:gmatch('=%s*"([%u_]+)"') do snapshot.lua.auraFilters[component] = true end - --- Serialization: sorted keys, one entry per line, for reviewable diffs. -local function Keys(t) - local keys = {} - for key in pairs(t) do keys[#keys + 1] = key end - table.sort(keys, function(a, b) return tostring(a) < tostring(b) end) - return keys -end - -local function Key(key) - if type(key) == "string" and key:match("^[%a_][%w_]*$") and not KEYWORDS[key] then return key end - return "[" .. string.format("%q", key) .. "]" -end - -local function Inline(value) - if type(value) == "string" then return string.format("%q", value) end - if type(value) ~= "table" then return tostring(value) end - local parts = {} - if #value > 0 then - for _, item in ipairs(value) do parts[#parts + 1] = Inline(item) end - else - for _, key in ipairs(Keys(value)) do parts[#parts + 1] = Key(key) .. " = " .. Inline(value[key]) end - end - return "{ " .. table.concat(parts, ", ") .. " }" -end - -local out = { - "-- Generated by scripts/api-snapshot.lua from wow-ui-source " .. version .. ". Do not edit by hand.", - "return {", - "\tversion = " .. string.format("%q", version) .. ",", -} -local function Section(name, t, depth) - local indent = string.rep("\t", depth) - out[#out + 1] = indent .. Key(name) .. " = {" - for _, key in ipairs(Keys(t)) do - local value = t[key] - if type(value) == "table" and depth == 1 and (name == "scriptObjects" or name == "lua") then - Section(key, value, depth + 1) - else - out[#out + 1] = indent .. "\t" .. Key(key) .. " = " .. Inline(value) .. "," - end - end - out[#out + 1] = indent .. "}," -end -for _, name in ipairs({ "functions", "enums", "events", "scriptObjects", "lua" }) do - Section(name, snapshot[name], 1) -end -out[#out + 1] = "}" - -local file = assert(io.open(outFile, "w")) -file:write(table.concat(out, "\n"), "\n") -file:close() -local counts = {} -for _, name in ipairs({ "functions", "enums", "events" }) do - counts[#counts + 1] = #Keys(snapshot[name]) .. " " .. name -end -print(string.format("Wrote %s (%s, %s)", outFile, version, table.concat(counts, ", "))) diff --git a/scripts/atlas_catalog.py b/scripts/atlas_catalog.py deleted file mode 100644 index acc6de8..0000000 --- a/scripts/atlas_catalog.py +++ /dev/null @@ -1,221 +0,0 @@ -import argparse -import csv -import gzip -import io -import json -from pathlib import Path -import re -import subprocess -import sys -import tempfile -from collections import defaultdict - -from spell_catalog import canonical, digest, pinned_source, validate_download - - -ROOT = Path(__file__).resolve().parents[1] -DATA = ROOT / "data/forever-atlases" -CACHE = ROOT / "examples/forever-atlases" -OUTPUT = ROOT / "tests/proof/atlases.lua" -SOURCE_GLOBS = ("UnitFrames*/**/*.lua", "UnitFrames/Libs/oUF/elements/*.lua") -TABLES = { - "UiTextureAtlas": {"ID", "FileDataID", "AtlasWidth", "AtlasHeight"}, - "UiTextureAtlasMember": {"ID", "CommittedName", "UiTextureAtlasID", "Width", "Height", "CommittedLeft", "CommittedRight", "CommittedTop", "CommittedBottom", "UiTextureAtlasElementID", "CommittedFlags"}, - "UiTextureAtlasElement": {"ID", "Name"}, -} -TILES_VERTICALLY, TILES_HORIZONTALLY = 2, 4 -LITERAL = re.compile(r"""(["'])([^"'\s\\]*-[^"'\s\\]*)\1""") -CONCATENATION = re.compile(r"""(["'])([^"'\s\\]+-)\1\s*\.\.\s*[\w.:\[\]()]+(?:\s*\.\.\s*(["'])([^"'\s\\]*)\3)?""") - - -def table_url(name, build): - return f"https://wago.tools/db2/{name}/csv?build={build}&locale=enUS" - - -def parse_table(name, raw): - reader = csv.DictReader(io.StringIO(raw.decode("utf-8-sig"))) - missing = TABLES[name] - set(reader.fieldnames or []) - if missing: - raise ValueError(f"{name}: missing columns {sorted(missing)}") - rows = list(reader) - ids = [int(row["ID"]) for row in rows] - if not rows or len(ids) != len(set(ids)): - raise ValueError(f"{name}: empty table or duplicate IDs") - return rows - - -def download(pin): - tables, records, compressed = {}, {}, {} - for name in TABLES: - url = table_url(name, pin["build"]) - with tempfile.TemporaryDirectory() as directory: - headers = Path(directory) / "headers" - raw = subprocess.check_output(["curl", "--fail", "--silent", "--show-error", "--location", "--max-time", "90", "--dump-header", str(headers), url]) - validate_download(name, pin["build"], headers.read_text()) - tables[name] = parse_table(name, raw) - compressed[name] = gzip.compress(raw, mtime=0) - records[name] = {"url": url, "filename": f"{name}.{pin['build']}.csv", "sha256": digest(raw), "rows": len(tables[name])} - print(f"Fetched {name}: {len(tables[name])} records", file=sys.stderr) - return tables, {"build": pin["build"], "format": 1, "tables": records}, compressed - - -def read_manifest(pin): - manifest = json.loads((DATA / "manifest.json").read_text()) - if manifest.get("format") != 1 or manifest.get("build") != pin["build"]: - raise ValueError("atlas snapshot does not match the pinned Forever build; run --update") - if set(manifest["tables"]) != set(TABLES): - raise ValueError("atlas snapshot table set changed; run --update") - for name in TABLES: - record = manifest["tables"][name] - if record["url"] != table_url(name, pin["build"]) or record.get("filename") != f"{name}.{pin['build']}.csv": - raise ValueError(f"{name}: source does not match the pinned build") - if not re.fullmatch(r"[0-9a-f]{64}", record["sha256"]) or record["rows"] <= 0: - raise ValueError(f"{name}: invalid checksum or row count") - return manifest - - -def read_snapshot(pin): - manifest = read_manifest(pin) - tables = {} - for name in TABLES: - record = manifest["tables"][name] - raw = gzip.decompress((CACHE / pin["build"] / f"{name}.csv.gz").read_bytes()) - if digest(raw) != record["sha256"]: - raise ValueError(f"{name}: checksum mismatch") - tables[name] = parse_table(name, raw) - if len(tables[name]) != record["rows"]: - raise ValueError(f"{name}: row count mismatch") - return tables, manifest - - -def write_cache(pin, compressed): - directory = CACHE / pin["build"] - directory.mkdir(parents=True, exist_ok=True) - for name, content in compressed.items(): - (directory / f"{name}.csv.gz").write_bytes(content) - - -def source_files(root=ROOT): - if not (root / "UnitFrames/Libs/oUF/elements").is_dir(): - raise ValueError("oUF is missing; run scripts/setup-test-libs.sh first") - files = set() - for pattern in SOURCE_GLOBS: - for path in root.glob(pattern): - relative = path.relative_to(root).as_posix() - if "/Libs/" not in relative or relative.startswith("UnitFrames/Libs/oUF/elements/"): - files.add(path) - return sorted(files) - - -def atlas_uses(root=ROOT): - literals, patterns = set(), set() - for path in source_files(root): - text = path.read_text(encoding="utf-8") - if not re.search("atlas", text, re.I): - continue - literals.update(match[2].lower() for match in LITERAL.finditer(text)) - for match in CONCATENATION.finditer(text): - patterns.add(re.escape(match[2].lower()) + r"[a-z]+" + re.escape((match[4] or "").lower())) - return literals, re.compile("|".join(sorted(patterns))) if patterns else None - - -def preferred_member(members): - def rank(member): - name = member["CommittedName"].lower() - return (name.endswith("-2x"), not name.endswith("-c60"), int(member["ID"])) - return min(members, key=rank) - - -def compile_atlases(tables, root=ROOT): - atlases = {row["ID"]: row for row in tables["UiTextureAtlas"]} - members = defaultdict(list) - for row in tables["UiTextureAtlasMember"]: - members[row["UiTextureAtlasElementID"]].append(row) - literals, pattern = atlas_uses(root) - selected = {} - for element in tables["UiTextureAtlasElement"]: - name = element["Name"] - lower = name.lower() - if not members[element["ID"]] or (lower not in literals and not (pattern and pattern.fullmatch(lower))): - continue - member = preferred_member(members[element["ID"]]) - atlas = atlases[member["UiTextureAtlasID"]] - width, height = int(atlas["AtlasWidth"]), int(atlas["AtlasHeight"]) - flags = int(member["CommittedFlags"]) - selected[name] = { - "file": int(atlas["FileDataID"]), - "width": int(member["Width"]), - "height": int(member["Height"]), - "left": int(member["CommittedLeft"]) / width, - "right": int(member["CommittedRight"]) / width, - "top": int(member["CommittedTop"]) / height, - "bottom": int(member["CommittedBottom"]) / height, - "tilesH": bool(flags & TILES_HORIZONTALLY), - "tilesV": bool(flags & TILES_VERTICALLY), - } - if not selected: - raise ValueError("no atlas used by the addon was found in the client tables") - return selected - - -def lua_atlases(atlases, build): - lines = ["return {", f'\tbuild = "{build}",', "\tatlases = {"] - for name in sorted(atlases, key=str.lower): - info = atlases[name] - fields = [f'file = {info["file"]}', f'width = {info["width"]}', f'height = {info["height"]}'] - fields += [f"{key} = {info[key]:.12g}" for key in ("left", "right", "top", "bottom")] - fields += [f'{key} = {"true" if info[key] else "false"}' for key in ("tilesH", "tilesV")] - lines.append(f'\t\t["{name}"] = {{ ' + ", ".join(fields) + " },") - return "\n".join(lines + ["\t},", "}", ""]) - - -def main(): - global CACHE - parser = argparse.ArgumentParser() - parser.add_argument("--update", action="store_true") - parser.add_argument("--check", action="store_true") - parser.add_argument("--fetch", action="store_true") - parser.add_argument("--check-pin", action="store_true") - parser.add_argument("--cache", type=Path, default=CACHE) - args = parser.parse_args() - CACHE = args.cache.resolve() - if args.update and (args.check or args.fetch or args.check_pin): - parser.error("--update cannot be combined with validation or --fetch") - if args.check_pin and (args.check or args.fetch): - parser.error("--check-pin cannot be combined with --check or --fetch") - pin = pinned_source() - if args.update: - tables, manifest, compressed = download(pin) - else: - manifest = read_manifest(pin) - if args.check_pin: - if f'build = "{pin["build"]}"' not in OUTPUT.read_text(): - raise ValueError("generated atlas table build does not match the source pin") - print(f'Forever {pin["build"]}: atlas table pin verified') - return - if args.fetch: - tables, fetched, compressed = download(pin) - if fetched != manifest: - raise ValueError("downloaded tables do not match the committed checksums; review with --update") - write_cache(pin, compressed) - else: - tables, manifest = read_snapshot(pin) - atlases = compile_atlases(tables) - output = lua_atlases(atlases, pin["build"]) - if args.check: - if not OUTPUT.exists() or OUTPUT.read_text() != output: - raise ValueError(f"stale generated artifact: {OUTPUT.relative_to(ROOT)}") - else: - if args.update: - DATA.mkdir(parents=True, exist_ok=True) - write_cache(pin, compressed) - (DATA / "manifest.json").write_text(canonical(manifest)) - OUTPUT.write_text(output) - print(f'Forever {pin["build"]}: {len(atlases)} atlases') - - -if __name__ == "__main__": - try: - main() - except (ValueError, OSError, subprocess.CalledProcessError) as error: - sys.exit(str(error)) diff --git a/scripts/check-upstream.sh b/scripts/check-upstream.sh index 92f7341..9d79f71 100644 --- a/scripts/check-upstream.sh +++ b/scripts/check-upstream.sh @@ -1,15 +1,14 @@ #!/usr/bin/env bash -# Reports whether the pinned Blizzard source and embedded libraries match upstream. +# Reports whether the embedded libraries match upstream. The Blizzard source +# pin lives in the wow-ui-testing library (.wut-version), which tracks it. # # Usage: # bash scripts/check-upstream.sh # -# Reads the wow-ui-source pin from .github/workflows/tests.yml and the library -# commits from scripts/setup-test-libs.sh (the tracked pins CI and releases +# Reads the library commits from scripts/setup-test-libs.sh (the tracked pins CI and releases # build from); asks upstream with plain git. LibSharedMedia and LibDBIcon come # from WowAce SVN and LibDataBroker is frozen upstream; they are not checked. -# In GitHub Actions it also writes step outputs (source_behind, source_latest, -# libs_behind, libs_report) and the job summary. Always exits 0 on a completed check. +# In GitHub Actions it also writes step outputs (libs_behind, libs_report) and the job summary. Always exits 0 on a completed check. set -euo pipefail repo_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" libs="$repo_dir/scripts/setup-test-libs.sh" @@ -18,11 +17,6 @@ trap 'rm -rf "$tmp"' EXIT die() { echo "error: $*" >&2; exit 1; } -source_pin() { - awk '/repository: Gethe\/wow-ui-source/ { found = 1; next } found && /ref:/ { print $2; exit }' \ - "$repo_dir/.github/workflows/tests.yml" -} - library_pin() { sed -n "s|^fetch_tree $1 \([0-9a-f]*\) .*|\1|p" "$libs" } @@ -38,11 +32,6 @@ latest_release() { echo "$tag $sha" } -pinned_source="$(source_pin)" -[[ -n "$pinned_source" ]] || die "no Gethe/wow-ui-source ref in tests.yml" -latest_source="$(git ls-remote https://github.com/Gethe/wow-ui-source.git refs/heads/forever | cut -f1)" -[[ -n "$latest_source" ]] || die "cannot read the forever branch of Gethe/wow-ui-source" - pinned_ouf="$(library_pin oUF-wow/oUF)" pinned_lem="$(library_pin p3lim-wow/LibEditMode)" pinned_ace="$(library_pin WoWUIDev/Ace3)" @@ -56,8 +45,6 @@ git -C "$tmp/Ace3" cat-file -e "$pinned_ace^{commit}" 2>/dev/null || die "pinned latest_ace="$(git -C "$tmp/Ace3" rev-parse HEAD)" ace_changes="$(git -C "$tmp/Ace3" rev-list --count "$pinned_ace..HEAD" -- LibStub CallbackHandler-1.0 AceDB-3.0)" -source_behind=false -[[ "$pinned_source" == "$latest_source" ]] || source_behind=true report=() status() { [[ "$1" == "$2" ]] && echo "current" || echo "behind"; } report+=("| oUF | \`${pinned_ouf:0:7}\` | \`$ouf_tag\` @ \`${latest_ouf:0:7}\` | $(status "$pinned_ouf" "$latest_ouf") |") @@ -72,14 +59,11 @@ done table="| Dependency | Pinned | Upstream | Status | |---|---|---|---| -| wow-ui-source (Forever) | \`${pinned_source:0:8}\` | \`${latest_source:0:8}\` | $(status "$pinned_source" "$latest_source") | $(printf '%s\n' "${report[@]}")" echo "$table" if [[ -n "${GITHUB_OUTPUT:-}" ]]; then { - echo "source_behind=$source_behind" - echo "source_latest=$latest_source" echo "libs_behind=$libs_behind" echo "libs_report<&2; exit 1; } - -commit="${1:-$(git ls-remote "$url" refs/heads/forever | cut -f1)}" -[[ "$commit" =~ ^[0-9a-f]{40}$ ]] || die "expected a full commit SHA, got '$commit'" -if [[ -e "$source_dir" && ! -d "$source_dir/.git" ]]; then - die "$source_dir is not a git checkout; move it aside once and rerun" -fi -if [[ ! -d "$source_dir/.git" ]]; then - git init -q "$source_dir" - git -C "$source_dir" remote add origin "$url" -fi -git -C "$source_dir" fetch -q --depth 1 origin "$commit" -git -C "$source_dir" checkout -q --detach FETCH_HEAD -version="$(tr -d '[:space:]' < "$source_dir/version.txt")" - -for workflow in tests release; do - sed -i -E "/repository: Gethe\/wow-ui-source/,/ref:/ s|ref: [0-9a-f]{40}( # .*)?$|ref: $commit # Forever $version|" \ - "$repo_dir/.github/workflows/$workflow.yml" -done -(cd "$repo_dir" && luajit scripts/api-snapshot.lua "$source_dir") -python3 -B "$repo_dir/scripts/spell_catalog.py" --update --source "$source_dir" -python3 -B "$repo_dir/scripts/atlas_catalog.py" --update -echo "Pinned wow-ui-source $commit (Forever $version)" diff --git a/tests/fixtures/api_snapshot.lua b/tests/fixtures/api_snapshot.lua deleted file mode 100644 index d895d43..0000000 --- a/tests/fixtures/api_snapshot.lua +++ /dev/null @@ -1,2141 +0,0 @@ --- Generated by scripts/api-snapshot.lua from wow-ui-source 1.60.1.70862. Do not edit by hand. -return { - version = "1.60.1.70862", - functions = { - AbbreviateNumbers = { args = { "number:number", "options:NumberAbbrevOptions?" }, returns = { "result:string" }, secretArguments = "AllowedWhenTainted", system = "Localization" }, - BreakUpLargeNumbers = { args = { "largeNumber:number", "natural:bool?" }, returns = { "result:string" }, secretArguments = "AllowedWhenTainted", system = "Localization" }, - ["C_AddOnProfiler.AddMeasuredCallEvent"] = { args = { "name:stringView" }, secretArguments = "AllowedWhenUntainted", system = "AddOnProfiler" }, - ["C_AddOnProfiler.GetAddOnMetric"] = { args = { "name:cstring", "metric:AddOnProfilerMetric" }, returns = { "result:number" }, secretArguments = "AllowedWhenUntainted", system = "AddOnProfiler" }, - ["C_AddOnProfiler.GetOverallMetric"] = { args = { "metric:AddOnProfilerMetric" }, returns = { "result:number" }, secretArguments = "AllowedWhenUntainted", system = "AddOnProfiler" }, - ["C_AddOnProfiler.IsEnabled"] = { returns = { "enabled:bool" }, system = "AddOnProfiler" }, - ["C_AddOnProfiler.MeasureCall"] = { args = { "func:LuaValueVariant", "arguments:LuaValueVariant" }, returns = { "results:AddOnProfilerCallResults", "returns:LuaValueVariant" }, secretArguments = "AllowedWhenUntainted", system = "AddOnProfiler" }, - ["C_AddOns.GetAddOnInfo"] = { args = { "name:uiAddon" }, returns = { "name:cstring", "title:cstring", "notes:cstring", "loadable:bool", "reason:cstring", "security:cstring" }, secretArguments = "AllowedWhenUntainted", system = "AddOns" }, - ["C_AddOns.GetAddOnMetadata"] = { args = { "name:uiAddon", "variable:cstring" }, returns = { "value:cstring" }, secretArguments = "AllowedWhenUntainted", system = "AddOns" }, - ["C_AddOns.GetNumAddOns"] = { returns = { "numAddOns:number" }, system = "AddOns" }, - ["C_AddOns.IsAddOnLoaded"] = { args = { "name:uiAddon" }, returns = { "loadedOrLoading:bool", "loaded:bool" }, secretArguments = "AllowedWhenUntainted", system = "AddOns" }, - ["C_AddOns.LoadAddOn"] = { args = { "name:uiAddon" }, returns = { "loaded:bool?", "value:string?" }, secretArguments = "AllowedWhenUntainted", system = "AddOns" }, - ["C_CVar.GetCVarBool"] = { args = { "name:cstring" }, returns = { "value:bool?" }, secretArguments = "NotAllowed", system = "CVarScripts" }, - ["C_CVar.SetCVar"] = { args = { "name:cstring", "value:cstring?" }, returns = { "success:bool" }, secretArguments = "NotAllowed", system = "CVarScripts" }, - ["C_CVar.SetCVarBitfield"] = { args = { "name:cstring", "index:luaIndex", "value:bool" }, returns = { "success:bool" }, secretArguments = "NotAllowed", system = "CVarScripts" }, - ["C_ClassColor.GetClassColor"] = { args = { "className:string", "tintColor:colorRGB?" }, returns = { "classColor:colorRGB" }, secretArguments = "AllowedWhenTainted", system = "ClassColor" }, - ["C_ClassTalents.GetActiveConfigID"] = { returns = { "activeConfigID:number?" }, system = "ClassTalents" }, - ["C_ColorUtil.GenerateTextColorCode"] = { args = { "color:colorRGB" }, returns = { "textColorCode:string" }, secretArguments = "AllowedWhenTainted", system = "ColorUtil" }, - ["C_ColorUtil.WrapTextInColorCode"] = { args = { "text:cstring", "textColorCode:cstring" }, returns = { "coloredText:string" }, secretArguments = "AllowedWhenTainted", system = "ColorUtil" }, - ["C_CurveUtil.CreateColorCurve"] = { returns = { "curve:LuaColorCurveObject" }, system = "CurveUtil" }, - ["C_CurveUtil.CreateCurve"] = { returns = { "curve:LuaCurveObject" }, system = "CurveUtil" }, - ["C_CurveUtil.EvaluateColorFromBoolean"] = { args = { "boolean:bool", "valueIfTrue:colorRGBA", "valueIfFalse:colorRGBA" }, returns = { "value:colorRGBA" }, secretArguments = "AllowedWhenTainted", system = "CurveUtil" }, - ["C_DamageMeter.GetCombatSessionSourceFromType"] = { args = { "sessionType:DamageMeterSessionType", "type:DamageMeterType", "sourceGUID:WOWGUID?", "sourceCreatureID:number?" }, returns = { "sessionSource:DamageMeterCombatSessionSource" }, secretArguments = "AllowedWhenUntainted", secretWhen = { "InCombat" }, system = "DamageMeter" }, - ["C_DurationUtil.CreateDuration"] = { returns = { "duration:LuaDurationObject" }, system = "DurationUtil" }, - ["C_DurationUtil.CreateDurationTextBinding"] = { returns = { "binding:DurationTextBinding" }, system = "DurationUtil" }, - ["C_EditMode.GetLayouts"] = { returns = { "layoutInfo:EditModeLayouts" }, system = "EditModeManager" }, - ["C_EncodingUtil.CompressString"] = { args = { "source:stringView", "method:CompressionMethod?", "level:CompressionLevel?" }, returns = { "output:string" }, secretArguments = "AllowedWhenUntainted", system = "EncodingUtil" }, - ["C_EncodingUtil.DecodeBase64"] = { args = { "source:stringView", "variant:Base64Variant?" }, returns = { "output:string" }, secretArguments = "AllowedWhenUntainted", system = "EncodingUtil" }, - ["C_EncodingUtil.DecompressString"] = { args = { "source:stringView", "method:CompressionMethod?" }, returns = { "output:string" }, secretArguments = "AllowedWhenUntainted", system = "EncodingUtil" }, - ["C_EncodingUtil.DeserializeCBOR"] = { args = { "source:stringView" }, returns = { "value:LuaValueVariant?" }, secretArguments = "AllowedWhenUntainted", system = "EncodingUtil" }, - ["C_EncodingUtil.EncodeBase64"] = { args = { "source:stringView", "variant:Base64Variant?" }, returns = { "output:string" }, secretArguments = "AllowedWhenUntainted", system = "EncodingUtil" }, - ["C_EncodingUtil.SerializeCBOR"] = { args = { "value:LuaValueVariant?", "options:CBORSerializationOptions?" }, returns = { "output:string" }, secretArguments = "AllowedWhenUntainted", system = "EncodingUtil" }, - ["C_GameRules.IsGameRuleActive"] = { args = { "gameRule:GameRule" }, returns = { "isActive:bool" }, secretArguments = "AllowedWhenUntainted", system = "GameRules" }, - ["C_IncomingSummon.IncomingSummonStatus"] = { args = { "unit:UnitToken" }, returns = { "status:SummonStatus" }, secretArguments = "AllowedWhenUntainted", system = "IncomingSummon" }, - ["C_NamePlate.GetNamePlateForUnit"] = { args = { "unitToken:UnitTokenNamePlate", "includeForbidden:bool?" }, returns = { "nameplate:NamePlateFrame" }, secretArguments = "AllowedWhenUntainted", system = "NamePlate" }, - ["C_NamePlate.SetNamePlateSize"] = { args = { "width:uiUnit", "height:uiUnit" }, secretArguments = "AllowedWhenUntainted", system = "NamePlate" }, - ["C_NamePlateManager.SetNamePlateHitTestInsets"] = { args = { "type:NamePlateType", "left:uiUnit", "right:uiUnit", "top:uiUnit", "bottom:uiUnit" }, secretArguments = "NotAllowed", system = "NamePlateManager" }, - ["C_PartyInfo.GetLootMethod"] = { returns = { "method:LootMethod", "masterLootPartyID:number?", "masterLooterRaidID:number?" }, system = "PartyInfo" }, - ["C_PetInfo.GetPetHappiness"] = { returns = { "happiness:number", "damagePercentage:number", "loyaltyRate:number" }, system = "PetInfo" }, - ["C_PlayerInfo.GetContentDifficultyCreatureForPlayer"] = { args = { "unitToken:UnitToken" }, returns = { "difficulty:RelativeContentDifficulty" }, secretArguments = "AllowedWhenUntainted", system = "PlayerInfo" }, - ["C_PlayerInfo.GetName"] = { args = { "playerLocation:PlayerLocation" }, returns = { "name:string" }, secretArguments = "AllowedWhenUntainted", system = "PlayerLocationInfo" }, - ["C_PvP.GetHonorRewardInfo"] = { args = { "honorLevel:number" }, returns = { "info:HonorRewardInfo?" }, secretArguments = "AllowedWhenUntainted", system = "PvpInfo" }, - ["C_Secrets.CanCompareUnitTokens"] = { args = { "unit1:UnitToken", "unit2:UnitToken" }, returns = { "isUnitComparisonPermitted:bool" }, secretArguments = "AllowedWhenUntainted", system = "SecretUtil" }, - ["C_SpecializationInfo.GetSpecialization"] = { args = { "isInspect:bool?", "isPet:bool?", "specGroupIndex:luaIndex?" }, returns = { "specializationIndex:luaIndex" }, secretArguments = "AllowedWhenUntainted", system = "SpecializationInfo" }, - ["C_Spell.GetOverrideSpell"] = { args = { "spellIdentifier:SpellIdentifier", "spec:number?", "onlyKnown:bool?", "ignoreOverrideSpellID:number?" }, returns = { "overrideSpellID:number" }, secretArguments = "AllowedWhenUntainted", system = "Spell" }, - ["C_Spell.GetSpellCooldown"] = { args = { "spellIdentifier:SpellIdentifier" }, returns = { "spellCooldownInfo:SpellCooldownInfo" }, secretArguments = "AllowedWhenTainted", secretWhen = { "CooldownsRestricted" }, system = "Spell" }, - ["C_Spell.GetSpellCooldownDuration"] = { args = { "spellIdentifier:SpellIdentifier", "ignoreGCD:bool?" }, returns = { "duration:LuaDurationObject" }, secretArguments = "AllowedWhenTainted", system = "Spell" }, - ["C_Spell.GetSpellDescription"] = { args = { "spellIdentifier:SpellIdentifier" }, returns = { "description:string" }, secretArguments = "AllowedWhenTainted", system = "Spell" }, - ["C_Spell.GetSpellInfo"] = { args = { "spellIdentifier:SpellIdentifier" }, returns = { "spellInfo:SpellInfo" }, secretArguments = "AllowedWhenTainted", system = "Spell" }, - ["C_Spell.GetSpellMaxCumulativeAuraApplications"] = { args = { "spellID:SpellIdentifier" }, returns = { "cumulativeAura:number" }, secretArguments = "AllowedWhenTainted", secretWhen = { "UnitAuraRestricted" }, system = "Spell" }, - ["C_Spell.GetSpellName"] = { args = { "spellIdentifier:SpellIdentifier" }, returns = { "name:cstring" }, secretArguments = "AllowedWhenTainted", system = "Spell" }, - ["C_Spell.GetSpellPowerCost"] = { args = { "spellIdentifier:SpellIdentifier" }, returns = { "powerCosts:table" }, secretArguments = "AllowedWhenTainted", system = "Spell" }, - ["C_Spell.GetSpellQueueWindow"] = { returns = { "result:number" }, system = "Spell" }, - ["C_Spell.IsSpellInRange"] = { args = { "spellIdentifier:SpellIdentifier", "targetUnit:UnitToken?" }, returns = { "inRange:bool?" }, secretArguments = "AllowedWhenTainted", system = "Spell" }, - ["C_SpellBook.IsSpellKnown"] = { args = { "spellID:number", "spellBank:SpellBookSpellBank?" }, returns = { "isKnown:bool" }, secretArguments = "AllowedWhenUntainted", system = "SpellBook" }, - ["C_SpellBook.IsSpellKnownOrInSpellBook"] = { args = { "spellID:number", "spellBank:SpellBookSpellBank?", "includeOverrides:bool?" }, returns = { "isKnownOrInSpellBook:bool" }, secretArguments = "AllowedWhenUntainted", system = "SpellBook" }, - ["C_StringUtil.CreateSecondsFormatter"] = { returns = { "formatter:SecondsFormatter" }, system = "StringUtil" }, - ["C_StringUtil.TruncateWhenZero"] = { args = { "number:number" }, returns = { "text:string" }, secretArguments = "AllowedWhenTainted", system = "StringUtil" }, - ["C_StringUtil.WrapString"] = { args = { "infix:stringView", "prefix:stringView?", "suffix:stringView?" }, returns = { "text:string" }, secretArguments = "AllowedWhenTainted", system = "StringUtil" }, - ["C_Texture.GetAtlasInfo"] = { args = { "atlas:textureAtlas" }, returns = { "info:AtlasInfo" }, secretArguments = "AllowedWhenUntainted", system = "TextureUtils" }, - ["C_Timer.After"] = { args = { "seconds:number", "callback:TimerCallback" }, secretArguments = "AllowedWhenUntainted", system = "UITimer" }, - ["C_Timer.NewTimer"] = { args = { "seconds:number", "callback:TickerCallback" }, returns = { "cbObject:TickerCallback" }, secretArguments = "AllowedWhenUntainted", system = "UITimer" }, - ["C_UIFileAsset.IsKnownFile"] = { args = { "asset:FileAsset" }, returns = { "isValid:bool" }, secretArguments = "AllowedWhenUntainted", system = "UIFileAssetAPI" }, - ["C_UnitAuras.AddPrivateAuraAnchor"] = { args = { "args:AddPrivateAuraAnchorArgs" }, returns = { "anchorID:number?" }, secretArguments = "AllowedWhenUntainted", system = "UnitAuras" }, - ["C_UnitAuras.AuraIsBigDefensive"] = { args = { "spellID:SpellIdentifier" }, returns = { "isBigDefensive:bool" }, secretArguments = "AllowedWhenTainted", system = "UnitAuras" }, - ["C_UnitAuras.GetPlayerAuraBySpellID"] = { args = { "spellID:SpellIdentifier" }, returns = { "aura:AuraData?" }, secretArguments = "AllowedWhenTainted", secretWhen = { "UnitAuraRestricted" }, system = "UnitAuras" }, - ["C_UnitAuras.RemovePrivateAuraAnchor"] = { args = { "anchorID:number" }, secretArguments = "AllowedWhenUntainted", system = "UnitAuras" }, - ClearCursor = { system = "GameCursor" }, - ClearFocus = { system = "TargetScript" }, - ClearTarget = { returns = { "willMakeChange:bool" }, system = "TargetScript" }, - CreateFromMixins = { args = { "mixins:LuaValueVariant" }, returns = { "object:LuaValueVariant" }, secretArguments = "AllowedWhenUntainted", system = "FrameScript" }, - CreateSecureDelegate = { args = { "luaFunction:LuaValueReference", "options:SecureDelegateOptions?" }, returns = { "secureDelegateFunction:LuaValueReference" }, secretArguments = "AllowedWhenUntainted", system = "FrameScript" }, - CreateUnitHealPredictionCalculator = { returns = { "healPredictionCalculator:UnitHealPredictionCalculator" }, system = "Unit" }, - GetAddOnMemoryUsage = { args = { "name:uiAddon" }, returns = { "result:number" }, secretArguments = "AllowedWhenUntainted", system = "PerformanceScript" }, - GetArenaOpponentSpec = { args = { "index:luaIndex" }, returns = { "specializationID:number", "gender:number" }, secretArguments = "AllowedWhenUntainted", secretReturns = true, system = "PvpInfo" }, - GetBuildInfo = { returns = { "buildVersion:cstring", "buildNumber:cstring", "buildDate:cstring", "interfaceVersion:number", "localizedVersion:cstring", "buildInfo:string" }, system = "Build" }, - GetCollapsingStarCost = { returns = { "cost:number" }, system = "PlayerScript" }, - GetComboPoints = { args = { "unit:UnitTokenPvPRestrictedForAddOns", "target:UnitTokenPvPRestrictedForAddOns" }, returns = { "result:number" }, secretArguments = "AllowedWhenUntainted", secretWhen = { "UnitPowerRestricted" }, system = "Unit" }, - GetCurrentRegion = { returns = { "region:number" }, system = "Locale" }, - GetCurrentRegionName = { returns = { "regionName:cstring" }, system = "Expansion" }, - GetCursorInfo = { system = "GameCursor" }, - GetCursorPosition = { returns = { "posX:number", "posY:number" }, system = "Input" }, - GetLocale = { returns = { "localeName:cstring" }, system = "Locale" }, - GetNetStats = { returns = { "in:number", "out:number", "latencyList:number" }, system = "ConnectionScript" }, - GetRaidTargetIndex = { args = { "target:UnitToken" }, returns = { "result:luaIndex?" }, secretArguments = "AllowedWhenUntainted", secretReturns = true, system = "RaidMarkers" }, - GetRealmName = { returns = { "realmName:cstring" }, system = "ConnectionScript" }, - GetRuneCooldown = { args = { "runeIndex:luaIndex" }, returns = { "startTime:number", "duration:number", "isRuneReady:bool" }, secretArguments = "AllowedWhenUntainted", system = "PlayerScript" }, - GetServerTime = { returns = { "time:number" }, system = "SystemTime" }, - GetThreatStatusColor = { args = { "gameErrorIndex:number" }, returns = { "colorR:number", "colorG:number", "colorB:number" }, secretArguments = "AllowedWhenUntainted", system = "Threat" }, - GetTime = { returns = { "time:number" }, system = "SystemTime" }, - GetTotemDuration = { args = { "slot:luaIndex" }, returns = { "duration:LuaDurationObject" }, secretArguments = "AllowedWhenUntainted", system = "Totem" }, - GetTotemInfo = { args = { "slot:luaIndex" }, returns = { "haveTotem:bool", "totemName:cstring", "startTime:number", "duration:number", "icon:fileID", "modRate:number", "spellID:number" }, secretArguments = "AllowedWhenUntainted", secretWhen = { "TotemSlotSecret" }, system = "Totem" }, - GetUnitChargedPowerPoints = { args = { "unit:UnitToken" }, returns = { "pointIndices:table" }, secretArguments = "AllowedWhenUntainted", secretWhen = { "UnitPowerRestricted" }, system = "Unit" }, - GetUnitEmpowerHoldAtMaxTime = { args = { "unit:UnitToken" }, returns = { "holdAtMaxTime:number" }, secretArguments = "AllowedWhenUntainted", secretWhen = { "UnitSpellCastRestricted" }, system = "Unit" }, - GetUnitPowerBarInfo = { args = { "unitToken:UnitToken" }, returns = { "info:UnitPowerBarInfo" }, secretArguments = "AllowedWhenUntainted", system = "Unit" }, - GetUnitPowerBarInfoByID = { args = { "barID:number" }, returns = { "info:UnitPowerBarInfo" }, secretArguments = "AllowedWhenUntainted", system = "Unit" }, - GetUnitPowerBarStringsByID = { args = { "barID:number" }, returns = { "name:cstring?", "tooltip:cstring?", "cost:cstring?" }, secretArguments = "AllowedWhenUntainted", system = "Unit" }, - GetUnitTotalModifiedMaxHealthPercent = { args = { "unit:UnitToken" }, returns = { "result:number" }, secretArguments = "AllowedWhenUntainted", system = "Unit" }, - GetXPExhaustion = { returns = { "result:number?" }, system = "PlayerScript" }, - InCombatLockdown = { returns = { "inCombatLockdown:bool" }, system = "RestrictedActions" }, - IsAltKeyDown = { returns = { "down:bool" }, system = "Input" }, - IsControlKeyDown = { returns = { "down:bool" }, system = "Input" }, - IsInInstance = { returns = { "isInInstance:bool", "instanceType:cstring" }, system = "Instance" }, - IsLoggedIn = { returns = { "result:bool" }, system = "PlayerScript" }, - IsResting = { returns = { "result:bool" }, system = "PlayerScript" }, - IsShiftKeyDown = { returns = { "down:bool" }, system = "Input" }, - Mixin = { args = { "object:LuaValueVariant", "mixins:LuaValueVariant" }, returns = { "outObject:LuaValueVariant" }, secretArguments = "AllowedWhenUntainted", system = "FrameScript" }, - PlayerVehicleHasComboPoints = { returns = { "vehicleHasComboPoints:bool" }, system = "Unit" }, - RegionalUniqueNamesEnabled = { returns = { "result:bool" }, system = "Unit" }, - RunScript = { args = { "text:cstring" }, secretArguments = "AllowedWhenUntainted", system = "FrameScript" }, - SetCursorPosition = { args = { "xPosition:uiUnit", "yPosition:uiUnit" }, secretArguments = "AllowedWhenUntainted", system = "Input" }, - SetPortraitTexture = { args = { "textureObject:SimpleTexture", "unitToken:UnitToken", "disableMasking:bool?" }, secretArguments = "AllowedWhenUntainted", system = "Unit" }, - UnitAffectingCombat = { args = { "unit:UnitToken" }, returns = { "result:bool" }, secretArguments = "AllowedWhenUntainted", system = "Unit" }, - UnitAttackSpeed = { args = { "unit:UnitToken" }, returns = { "attackSpeed:number", "offhandAttackSpeed:number?", "rangedAttackSpeed:number?" }, secretArguments = "AllowedWhenUntainted", secretWhen = { "UnitStatsRestricted" }, system = "Unit" }, - UnitBattlePetLevel = { args = { "unit:UnitToken" }, returns = { "result:number?" }, secretArguments = "AllowedWhenUntainted", system = "Unit" }, - UnitCanAttack = { args = { "unit:UnitToken", "target:UnitToken" }, returns = { "result:bool" }, secretArguments = "AllowedWhenUntainted", system = "Unit" }, - UnitCastingDuration = { args = { "unit:UnitTokenPvPRestrictedForAddOns" }, returns = { "duration:LuaDurationObject" }, secretArguments = "AllowedWhenUntainted", secretReturns = true, system = "Unit" }, - UnitCastingInfo = { args = { "unit:UnitTokenPvPRestrictedForAddOns" }, returns = { "name:cstring", "displayName:string", "textureID:fileID", "startTimeMs:number", "endTimeMs:number", "isTradeskill:bool", "castID:WOWGUID", "notInterruptible:bool?", "castingSpellID:number", "castBarID:UnitCastBarID?", "delayTimeMs:number" }, secretArguments = "AllowedWhenUntainted", secretWhen = { "UnitSpellCastRestricted" }, system = "Unit" }, - UnitChannelDuration = { args = { "unit:UnitTokenPvPRestrictedForAddOns" }, returns = { "duration:LuaDurationObject" }, secretArguments = "AllowedWhenUntainted", system = "Unit" }, - UnitChannelInfo = { args = { "unit:UnitTokenPvPRestrictedForAddOns" }, returns = { "name:cstring", "displayName:cstring", "textureID:fileID", "startTimeMs:number", "endTimeMs:number", "isTradeskill:bool", "notInterruptible:bool?", "spellID:number", "isEmpowered:bool", "numEmpowerStages:number", "castBarID:UnitCastBarID?" }, secretArguments = "AllowedWhenUntainted", secretWhen = { "UnitSpellCastRestricted" }, system = "Unit" }, - UnitClass = { args = { "unit:UnitToken" }, returns = { "className:cstring", "classFilename:cstring", "classID:number" }, secretArguments = "AllowedWhenUntainted", secretWhen = { "UnitIdentityRestricted" }, system = "Unit" }, - UnitClassBase = { args = { "unit:UnitToken" }, returns = { "classFilename:cstring", "classID:number" }, secretArguments = "AllowedWhenUntainted", secretWhen = { "UnitIdentityRestricted" }, system = "Unit" }, - UnitClassification = { args = { "unit:UnitToken" }, returns = { "result:cstring" }, secretArguments = "AllowedWhenUntainted", system = "Unit" }, - UnitCreatureFamily = { args = { "unit:UnitToken" }, returns = { "name:cstring", "id:number" }, secretArguments = "AllowedWhenUntainted", secretWhen = { "UnitIdentityRestricted" }, system = "Unit" }, - UnitCreatureType = { args = { "unit:UnitToken" }, returns = { "name:cstring", "id:number" }, secretArguments = "AllowedWhenUntainted", secretWhen = { "UnitIdentityRestricted" }, system = "Unit" }, - UnitDetailedThreatSituation = { args = { "unit:UnitToken", "mobGUID:UnitToken" }, returns = { "isTanking:bool", "status:number", "scaledPercentage:number", "rawPercentage:number", "rawThreat:number" }, secretArguments = "AllowedWhenUntainted", secretWhen = { "UnitThreatValuesRestricted" }, system = "Unit" }, - UnitEffectiveLevel = { args = { "name:cstring" }, returns = { "result:number" }, secretArguments = "AllowedWhenUntainted", system = "Unit" }, - UnitEmpoweredChannelDuration = { args = { "unit:UnitToken", "includeHoldAtMaxTime:bool?" }, returns = { "duration:LuaDurationObject" }, secretArguments = "AllowedWhenUntainted", system = "Unit" }, - UnitEmpoweredStagePercentages = { args = { "unit:UnitToken", "includeHoldAtMaxTime:bool?" }, returns = { "percentages:table" }, secretArguments = "AllowedWhenUntainted", system = "Unit" }, - UnitExists = { args = { "unit:UnitToken?" }, returns = { "result:bool" }, secretArguments = "AllowedWhenUntainted", system = "Unit" }, - UnitFactionGroup = { args = { "unitName:cstring", "checkDisplayRace:bool?" }, returns = { "factionGroupTag:cstring", "localized:cstring" }, secretArguments = "AllowedWhenUntainted", system = "Unit" }, - UnitGUID = { args = { "unit:UnitTokenPvPRestrictedForAddOns" }, returns = { "result:WOWGUID?" }, secretArguments = "AllowedWhenUntainted", secretWhen = { "UnitIdentityRestricted" }, system = "Unit" }, - UnitGetDetailedHealPrediction = { args = { "unit:UnitTokenPvPRestrictedForAddOns", "healerUnit:UnitTokenPvPRestrictedForAddOns?", "healPredictionCalculator:UnitHealPredictionCalculator" }, secretArguments = "AllowedWhenUntainted", system = "Unit" }, - UnitGetIncomingHeals = { args = { "unit:UnitTokenPvPRestrictedForAddOns", "healerGUID:UnitTokenPvPRestrictedForAddOns?" }, returns = { "result:number?" }, secretArguments = "AllowedWhenUntainted", secretReturns = true, system = "Unit" }, - UnitGetTotalAbsorbs = { args = { "unit:UnitTokenPvPRestrictedForAddOns" }, returns = { "result:number" }, secretArguments = "AllowedWhenUntainted", secretReturns = true, system = "Unit" }, - UnitGetTotalHealAbsorbs = { args = { "unit:UnitTokenPvPRestrictedForAddOns" }, returns = { "result:number" }, secretArguments = "AllowedWhenUntainted", secretReturns = true, system = "Unit" }, - UnitGroupRolesAssignedEnum = { args = { "unit:UnitToken?" }, returns = { "result:number" }, secretArguments = "AllowedWhenUntainted", secretWhen = { "UnitIdentityRestricted" }, system = "Unit" }, - UnitHasPowerType = { args = { "unitToken:UnitTokenPvPRestrictedForAddOns", "powerType:PowerType" }, returns = { "hasPower:bool" }, secretArguments = "AllowedWhenUntainted", system = "Unit" }, - UnitHasVehiclePlayerFrameUI = { args = { "unit:UnitToken?" }, returns = { "result:bool" }, secretArguments = "AllowedWhenUntainted", system = "Unit" }, - UnitHasVehicleUI = { args = { "unit:UnitToken?" }, returns = { "result:bool" }, secretArguments = "AllowedWhenUntainted", system = "Unit" }, - UnitHealth = { args = { "unit:UnitTokenPvPRestrictedForAddOns", "usePredicted:bool?" }, returns = { "result:number" }, secretArguments = "AllowedWhenUntainted", secretReturns = true, system = "Unit" }, - UnitHealthMax = { args = { "unit:UnitTokenPvPRestrictedForAddOns" }, returns = { "result:number" }, secretArguments = "AllowedWhenUntainted", secretWhen = { "UnitHealthMaxRestricted" }, system = "Unit" }, - UnitHealthMissing = { args = { "unit:UnitTokenPvPRestrictedForAddOns", "usePredicted:bool?" }, returns = { "result:number" }, secretArguments = "AllowedWhenUntainted", secretReturns = true, system = "Unit" }, - UnitHealthPercent = { args = { "unit:UnitTokenPvPRestrictedForAddOns", "usePredicted:bool?", "curve:LuaCurveObjectBase?" }, returns = { "result:LuaCurveEvaluatedResult" }, secretArguments = "AllowedWhenUntainted", secretReturns = true, secretWhen = { "CurveSecret" }, system = "Unit" }, - UnitHonorLevel = { args = { "unit:UnitToken" }, returns = { "result:number" }, secretArguments = "AllowedWhenUntainted", secretWhen = { "UnitIdentityRestricted" }, system = "Unit" }, - UnitInParty = { args = { "unit:UnitToken?", "partyIndex:luaIndex?" }, returns = { "result:bool" }, secretArguments = "AllowedWhenUntainted", system = "Unit" }, - UnitInPartyIsAI = { args = { "unit:UnitToken?" }, returns = { "result:bool" }, secretArguments = "AllowedWhenUntainted", system = "Unit" }, - UnitInRaid = { args = { "unit:UnitToken?", "partyIndex:luaIndex?" }, returns = { "result:luaIndex?" }, secretArguments = "AllowedWhenUntainted", secretWhen = { "UnitIdentityRestricted" }, system = "Unit" }, - UnitInRange = { args = { "unit:UnitToken" }, returns = { "inRange:bool", "checkedRange:bool" }, secretArguments = "AllowedWhenUntainted", secretReturns = true, system = "Unit" }, - UnitIsBattlePetCompanion = { args = { "unit:UnitToken" }, returns = { "result:bool" }, secretArguments = "AllowedWhenUntainted", system = "Unit" }, - UnitIsConnected = { args = { "unit:UnitToken" }, returns = { "isConnected:bool" }, secretArguments = "AllowedWhenUntainted", system = "Unit" }, - UnitIsDead = { args = { "unit:UnitToken" }, returns = { "result:bool" }, secretArguments = "AllowedWhenUntainted", system = "Unit" }, - UnitIsDeadOrGhost = { args = { "unit:UnitToken" }, returns = { "result:bool" }, secretArguments = "AllowedWhenUntainted", system = "Unit" }, - UnitIsEnemy = { args = { "unit:UnitToken", "target:UnitToken" }, returns = { "result:bool" }, secretArguments = "AllowedWhenUntainted", system = "Unit" }, - UnitIsGameObject = { args = { "unit:UnitToken?" }, returns = { "result:bool" }, secretArguments = "AllowedWhenUntainted", system = "Unit" }, - UnitIsGhost = { args = { "unit:UnitToken" }, returns = { "result:bool" }, secretArguments = "AllowedWhenUntainted", system = "Unit" }, - UnitIsGroupAssistant = { args = { "unit:UnitToken" }, returns = { "isAssistant:bool" }, secretArguments = "AllowedWhenUntainted", secretWhen = { "UnitIdentityRestricted" }, system = "Unit" }, - UnitIsGroupLeader = { args = { "unit:UnitToken", "partyCategory:luaIndex?" }, returns = { "isLeader:bool" }, secretArguments = "AllowedWhenUntainted", secretWhen = { "UnitIdentityRestricted" }, system = "Unit" }, - UnitIsHumanPlayer = { args = { "unit:UnitToken?", "partyIndex:luaIndex?" }, returns = { "result:bool" }, secretArguments = "AllowedWhenUntainted", system = "Unit" }, - UnitIsMercenary = { args = { "name:cstring" }, returns = { "result:bool" }, secretArguments = "AllowedWhenUntainted", system = "Unit" }, - UnitIsPVP = { args = { "unit:UnitToken" }, returns = { "result:bool" }, secretArguments = "AllowedWhenUntainted", secretWhen = { "UnitIdentityRestricted" }, system = "Unit" }, - UnitIsPVPFreeForAll = { args = { "unit:UnitToken" }, returns = { "result:bool" }, secretArguments = "AllowedWhenUntainted", system = "Unit" }, - UnitIsPlayer = { args = { "unit:UnitToken?", "partyIndex:luaIndex?" }, returns = { "result:bool" }, secretArguments = "AllowedWhenUntainted", system = "Unit" }, - UnitIsQuestBoss = { args = { "unit:UnitToken" }, returns = { "result:bool" }, secretArguments = "AllowedWhenUntainted", system = "Unit" }, - UnitIsTapDenied = { args = { "unit:UnitToken" }, returns = { "result:bool" }, secretArguments = "AllowedWhenUntainted", system = "Unit" }, - UnitIsUnit = { args = { "unit1:UnitToken", "unit2:UnitToken" }, returns = { "result:bool" }, secretArguments = "AllowedWhenUntainted", secretWhen = { "UnitComparisonRestricted" }, system = "Unit" }, - UnitIsVisible = { args = { "unit:UnitToken?" }, returns = { "result:bool" }, secretArguments = "AllowedWhenUntainted", system = "Unit" }, - UnitIsWildBattlePet = { args = { "unit:UnitToken" }, returns = { "result:bool" }, secretArguments = "AllowedWhenUntainted", system = "Unit" }, - UnitLeadsAnyGroup = { args = { "unit:UnitToken" }, returns = { "isLeader:bool" }, secretArguments = "AllowedWhenUntainted", secretWhen = { "UnitIdentityRestricted" }, system = "Unit" }, - UnitLevel = { args = { "name:cstring" }, returns = { "result:number" }, secretArguments = "AllowedWhenUntainted", system = "Unit" }, - UnitName = { args = { "unit:UnitToken" }, returns = { "unitName:cstring", "unitServer:cstring" }, secretArguments = "AllowedWhenTainted", secretWhen = { "UnitNameIdentityRestricted" }, system = "Unit" }, - UnitNameUnmodified = { args = { "unit:UnitToken" }, returns = { "unitName:cstring", "unitServer:cstring" }, secretArguments = "AllowedWhenUntainted", secretWhen = { "UnitIdentityRestricted" }, system = "Unit" }, - UnitNameplateShowsWidgetsOnly = { args = { "unit:UnitToken" }, returns = { "nameplateShowsWidgetsOnly:bool" }, secretArguments = "AllowedWhenUntainted", system = "Unit" }, - UnitPhaseReason = { args = { "unit:UnitToken" }, returns = { "reason:PhaseReason?" }, secretArguments = "AllowedWhenUntainted", secretWhen = { "UnitIdentityRestricted" }, system = "Unit" }, - UnitPlayerControlled = { args = { "unit:UnitToken?" }, returns = { "result:bool" }, secretArguments = "AllowedWhenUntainted", system = "Unit" }, - UnitPlayerOrPetInRaid = { args = { "unit:UnitToken?", "partyIndex:luaIndex?" }, returns = { "result:bool" }, secretArguments = "AllowedWhenUntainted", system = "Unit" }, - UnitPower = { args = { "unitToken:UnitTokenPvPRestrictedForAddOns", "powerType:PowerType?", "unmodified:bool?" }, returns = { "power:number" }, secretArguments = "AllowedWhenUntainted", secretWhen = { "UnitPowerRestricted" }, system = "Unit" }, - UnitPowerBarID = { args = { "unitToken:UnitToken" }, returns = { "barID:number" }, secretArguments = "AllowedWhenUntainted", system = "Unit" }, - UnitPowerDisplayMod = { args = { "powerType:PowerType" }, returns = { "displayMod:number" }, secretArguments = "AllowedWhenUntainted", system = "Unit" }, - UnitPowerMax = { args = { "unitToken:UnitTokenPvPRestrictedForAddOns", "powerType:PowerType?", "unmodified:bool?" }, returns = { "maxPower:number" }, secretArguments = "AllowedWhenUntainted", secretWhen = { "UnitPowerMaxRestricted" }, system = "Unit" }, - UnitPowerMissing = { args = { "unitToken:UnitTokenPvPRestrictedForAddOns", "powerType:PowerType?", "unmodified:bool?" }, returns = { "result:number" }, secretArguments = "AllowedWhenUntainted", secretWhen = { "UnitPowerRestricted" }, system = "Unit" }, - UnitPowerPercent = { args = { "unitToken:UnitTokenPvPRestrictedForAddOns", "powerType:PowerType?", "unmodified:bool?", "curve:LuaCurveObjectBase?" }, returns = { "result:LuaCurveEvaluatedResult" }, secretArguments = "AllowedWhenUntainted", secretWhen = { "CurveSecret", "UnitPowerRestricted" }, system = "Unit" }, - UnitPowerType = { args = { "unit:UnitTokenPvPRestrictedForAddOns", "index:number?" }, returns = { "powerType:PowerType", "powerTypeToken:string", "rgbX:number", "rgbY:number", "rgbZ:number" }, secretArguments = "AllowedWhenUntainted", system = "Unit" }, - UnitPvpClassification = { args = { "unit:UnitTokenPvPRestrictedForAddOns" }, returns = { "classification:PvPUnitClassification?" }, secretArguments = "AllowedWhenUntainted", system = "Unit" }, - UnitQuestTrivialLevelRange = { args = { "unit:UnitToken" }, returns = { "levelRange:number" }, secretArguments = "AllowedWhenUntainted", system = "Unit" }, - UnitRace = { args = { "unit:UnitToken" }, returns = { "localizedRaceName:cstring", "englishRaceName:cstring", "raceID:number" }, secretArguments = "AllowedWhenUntainted", secretWhen = { "UnitIdentityRestricted" }, system = "Unit" }, - UnitReaction = { args = { "unit:UnitToken", "target:UnitToken" }, returns = { "result:luaIndex?" }, secretArguments = "AllowedWhenUntainted", system = "Unit" }, - UnitSelectionType = { args = { "unit:UnitToken", "useExtendedColors:bool?" }, returns = { "result:number" }, secretArguments = "AllowedWhenUntainted", system = "Unit" }, - UnitSex = { args = { "unit:UnitToken" }, returns = { "sex:number?" }, secretArguments = "AllowedWhenUntainted", secretWhen = { "UnitIdentityRestricted" }, system = "Unit" }, - UnitStagger = { args = { "unit:UnitTokenPvPRestrictedForAddOns" }, returns = { "result:number" }, secretArguments = "AllowedWhenUntainted", system = "Unit" }, - UnitTargetsVehicleInRaidUI = { args = { "unit:UnitToken?" }, returns = { "result:bool" }, secretArguments = "AllowedWhenUntainted", system = "Unit" }, - UnitThreatSituation = { args = { "unit:UnitToken", "mobGUID:UnitToken?" }, returns = { "result:number?" }, secretArguments = "AllowedWhenUntainted", secretWhen = { "UnitThreatStateRestricted" }, system = "Unit" }, - UnitXP = { args = { "unit:UnitToken" }, returns = { "result:number" }, secretArguments = "AllowedWhenUntainted", system = "Unit" }, - UnitXPMax = { args = { "unit:UnitToken" }, returns = { "result:number" }, secretArguments = "AllowedWhenUntainted", system = "Unit" }, - UpdateAddOnMemoryUsage = { system = "PerformanceScript" }, - issecretvalue = { args = { "value:LuaValueReference" }, returns = { "isSecret:bool" }, secretArguments = "AllowedWhenUntainted", system = "FrameScript" }, - ["math.clamp"] = { args = { "value:number", "minimum:number", "maximum:number" }, returns = { "clampedValue:number" }, secretArguments = "AllowedWhenUntainted", system = "LuaMathExtensions" }, - ["math.normalize"] = { args = { "value:number", "minimum:number", "maximum:number" }, returns = { "normalizedValue:number" }, secretArguments = "AllowedWhenUntainted", system = "LuaMathExtensions" }, - ["math.remap"] = { args = { "value:number", "sourceMinimum:number", "sourceMaximum:number", "destinationMinimum:number", "destinationMaximum:number" }, returns = { "remappedValue:number" }, secretArguments = "AllowedWhenUntainted", system = "LuaMathExtensions" }, - ["math.round"] = { args = { "value:number", "decimalPlaces:number?" }, returns = { "roundedValue:number" }, secretArguments = "AllowedWhenUntainted", system = "LuaMathExtensions" }, - ["math.wrap"] = { args = { "value:number", "minimum:number", "maximum:number" }, returns = { "wrapped:number" }, secretArguments = "AllowedWhenUntainted", system = "LuaMathExtensions" }, - scrubsecretvalues = { args = { "values:LuaValueReference" }, returns = { "scrubbed:LuaValueReference" }, secretArguments = "AllowedWhenUntainted", system = "FrameScript" }, - ["string.contains"] = { args = { "str:stringView", "substring:stringView" }, returns = { "contains:bool" }, secretArguments = "AllowedWhenUntainted", system = "LuaStringExtensions" }, - ["string.trim"] = { args = { "str:stringView", "characters:stringView?" }, returns = { "trimmed:stringView" }, secretArguments = "AllowedWhenUntainted", system = "LuaStringExtensions" }, - ["table.contains"] = { args = { "table:table", "value:any?" }, returns = { "containsValue:bool" }, secretArguments = "AllowedWhenUntainted", system = "LuaTableExtensions" }, - ["table.count"] = { args = { "table:table" }, returns = { "count:number" }, secretArguments = "AllowedWhenUntainted", secretWhen = { "LuaTableHasSecretKeys" }, system = "LuaTableExtensions" }, - ["table.create"] = { args = { "arraySizeHint:number", "nodeSizeHint:number?" }, returns = { "table:table" }, secretArguments = "AllowedWhenUntainted", system = "LuaTableExtensions" }, - ["table.keys"] = { args = { "table:table" }, returns = { "keys:any" }, secretArguments = "AllowedWhenUntainted", system = "LuaTableExtensions" }, - ["table.values"] = { args = { "table:table" }, returns = { "values:any" }, secretArguments = "AllowedWhenUntainted", system = "LuaTableExtensions" }, - }, - enums = { - AddOnProfilerMetric = { CountTimeOver1000Ms = 11, CountTimeOver100Ms = 9, CountTimeOver10Ms = 7, CountTimeOver1Ms = 5, CountTimeOver500Ms = 10, CountTimeOver50Ms = 8, CountTimeOver5Ms = 6, EncounterAverageTime = 2, LastTime = 3, PeakTime = 4, RecentAverageTime = 1, SessionAverageTime = 0 }, - CompressionLevel = { Default = 0, OptimizeForSize = 2, OptimizeForSpeed = 1 }, - CompressionMethod = { Deflate = 0, Gzip = 2, Zlib = 1 }, - CustomAuraButtonDispelTypeStealableFilter = { NotStealable = 1, Stealable = 0 }, - CustomAuraButtonDispelTypeTextureStyle = { Border = 0, BorderWithIcon = 1, CustomAsset = 4, Icon = 2, PreserveAsset = 3 }, - CustomAuraButtonUpdateMode = { Assignment = 0, Update = 1 }, - DamageMeterSessionType = { Current = 1, Expired = 2, Overall = 0 }, - DamageMeterType = { Absorbs = 4, AvoidableDamageTaken = 8, DamageDone = 0, DamageTaken = 7, Deaths = 9, Dispels = 6, Dps = 1, EnemyDamageTaken = 10, HealingDone = 2, Hps = 3, Interrupts = 5 }, - EditModeSettingDisplayType = { Checkbox = 1, Dropdown = 0, Slider = 2 }, - EditModeSystem = { ActionBar = 0, ArchaeologyBar = 19, AuraFrame = 6, Bags = 14, CastBar = 1, ChatFrame = 8, CooldownViewer = 20, DamageMeter = 23, DurabilityFrame = 16, EncounterBar = 4, EncounterEvents = 22, ExtraAbilities = 5, GamepadMainActionBar = 30, GroupFinder = 27, HudTooltip = 11, LootFrame = 10, LossOfControl = 28, MainActionBarEndCap = 26, MicroMenu = 13, Minimap = 2, ObjectiveTracker = 12, PersonalResourceDisplay = 21, RaidWarning = 24, StatusTrackingBar = 15, SwingTimer = 29, TalkingHeadFrame = 7, TimerBars = 17, TotemActionBar = 25, UnitFrame = 3, VehicleLeaveButton = 9, VehicleSeatIndicator = 18 }, - LFGRole = { Damage = 2, Healer = 1, Tank = 0 }, - LootMethod = { Freeforall = 0, Group = 3, Masterlooter = 2, Needbeforegreed = 4, Personal = 5, Roundrobin = 1 }, - LuaCurveType = { Cosine = 2, Cubic = 3, Linear = 0, Step = 1 }, - NamePlateType = { Enemy = 1, Friendly = 0 }, - PlayerSwingType = { MainHand = 0, OffHand = 1, Ranged = 2 }, - PowerType = { Alternate = 10, AlternateEncounter = 24, AlternateMount = 25, AlternateQuest = 23, ArcaneCharges = 16, Balance = 26, BurningEmbers = 14, Chi = 12, ComboPoints = 4, DemonicFury = 15, Energy = 3, Essence = 19, Focus = 2, Fury = 17, Happiness = 27, HolyPower = 9, Insanity = 13, LunarPower = 8, Maelstrom = 11, Mana = 0, Pain = 18, Rage = 1, RuneBlood = 20, RuneChromatic = 29, RuneFrost = 21, RuneUnholy = 22, Runes = 5, RunicPower = 6, ShadowOrbs = 28, SoulShards = 7 }, - PvPUnitClassification = { AssassinAlliance = 6, AssassinHorde = 5, CartRunnerAlliance = 4, CartRunnerHorde = 3, FlagCarrierAlliance = 1, FlagCarrierHorde = 0, FlagCarrierNeutral = 2, OrbCarrierBlue = 7, OrbCarrierGreen = 8, OrbCarrierOrange = 9, OrbCarrierPurple = 10 }, - RelativeContentDifficulty = { Difficult = 3, Easy = 1, Fair = 2, Impossible = 4, Trivial = 0 }, - ScriptObjectAccessRestriction = { DenyTaintedAccessWhenAurasAreSecret = 1 }, - SecondsFormatterAbbreviation = { None = 0, OneLetter = 2, Truncate = 1 }, - SecondsFormatterInterval = { Days = 3, Hours = 2, Minutes = 1, Seconds = 0 }, - SecondsFormatterIntervalWhitespace = { Preserve = 0, Strip = 1, StripIgnoreLocale = 2 }, - SecondsFormatterRounding = { RoundUp = 0, Truncate = 1 }, - StatusBarInterpolation = { ExponentialEaseOut = 1, Immediate = 0 }, - StatusBarTimerDirection = { ElapsedTime = 0, RemainingTime = 1 }, - SummonStatus = { Accepted = 2, Declined = 3, None = 0, Pending = 1 }, - UITextureSliceMode = { Stretched = 0, Tiled = 1 }, - UnitDamageAbsorbClampMode = { MaximumHealth = 2, MissingHealth = 0, MissingHealthWithoutIncomingHeals = 1 }, - UnitHealAbsorbClampMode = { CurrentHealth = 0, MaximumHealth = 1 }, - UnitHealAbsorbMode = { ReducedByIncomingHeals = 0, Total = 1 }, - UnitIncomingHealClampMode = { MaximumHealth = 1, MissingHealth = 0 }, - UnitMaximumHealthMode = { Default = 0, WithAbsorbs = 1 }, - UnitSex = { Both = 3, Female = 1, Male = 0, Neutral = 4, None = 2 }, - }, - events = { - ADDON_LOADED = true, - ARENA_OPPONENT_UPDATE = true, - ARENA_PREP_OPPONENT_SPECIALIZATIONS = true, - COMBO_TARGET_CHANGED = true, - EDIT_MODE_LAYOUTS_UPDATED = true, - GROUP_ROSTER_UPDATE = true, - HONOR_LEVEL_UPDATE = true, - INCOMING_RESURRECT_CHANGED = true, - INCOMING_SUMMON_CHANGED = true, - INSTANCE_ENCOUNTER_ENGAGE_UNIT = true, - NAME_PLATE_UNIT_ADDED = true, - NAME_PLATE_UNIT_REMOVED = true, - NEUTRAL_FACTION_SELECT_RESULT = true, - PARTY_LEADER_CHANGED = true, - PARTY_LOOT_METHOD_CHANGED = true, - PARTY_MEMBER_DISABLE = true, - PARTY_MEMBER_ENABLE = true, - PLAYER_ALIVE = true, - PLAYER_DEAD = true, - PLAYER_ENTERING_WORLD = true, - PLAYER_FOCUS_CHANGED = true, - PLAYER_LEVEL_UP = true, - PLAYER_LOGIN = true, - PLAYER_LOGOUT = true, - PLAYER_PVP_FLAG_CHANGED = true, - PLAYER_REGEN_DISABLED = true, - PLAYER_REGEN_ENABLED = true, - PLAYER_ROLES_ASSIGNED = true, - PLAYER_SPECIALIZATION_CHANGED = true, - PLAYER_SWING = true, - PLAYER_TALENT_UPDATE = true, - PLAYER_TARGET_CHANGED = true, - PLAYER_TOTEM_UPDATE = true, - PLAYER_UNGHOST = true, - PLAYER_UPDATE_RESTING = true, - PLAYER_XP_UPDATE = true, - PORTRAITS_UPDATED = true, - RAID_TARGET_UPDATE = true, - READY_CHECK = true, - READY_CHECK_CONFIRM = true, - READY_CHECK_FINISHED = true, - RUNE_POWER_UPDATE = true, - SPELLS_CHANGED = true, - SPELL_RANGE_CHECK_UPDATE = true, - SPELL_UPDATE_COOLDOWN = true, - TRAIT_CONFIG_UPDATED = true, - UNIT_ABSORB_AMOUNT_CHANGED = true, - UNIT_ATTACK_SPEED = true, - UNIT_AURA = true, - UNIT_CLASSIFICATION_CHANGED = true, - UNIT_COMBAT = true, - UNIT_CONNECTION = true, - UNIT_DISPLAYPOWER = true, - UNIT_ENTERED_VEHICLE = true, - UNIT_EXITED_VEHICLE = true, - UNIT_EXITING_VEHICLE = true, - UNIT_FACTION = true, - UNIT_FLAGS = true, - UNIT_HAPPINESS = true, - UNIT_HEALTH = true, - UNIT_HEAL_ABSORB_AMOUNT_CHANGED = true, - UNIT_HEAL_PREDICTION = true, - UNIT_IN_RANGE_UPDATE = true, - UNIT_LEVEL = true, - UNIT_MAXHEALTH = true, - UNIT_MAXPOWER = true, - UNIT_MAX_HEALTH_MODIFIERS_CHANGED = true, - UNIT_MODEL_CHANGED = true, - UNIT_NAME_UPDATE = true, - UNIT_PET = true, - UNIT_PHASE = true, - UNIT_PORTRAIT_UPDATE = true, - UNIT_POWER_BAR_HIDE = true, - UNIT_POWER_BAR_SHOW = true, - UNIT_POWER_FREQUENT = true, - UNIT_POWER_POINT_CHARGE = true, - UNIT_POWER_UPDATE = true, - UNIT_SPELLCAST_CHANNEL_START = true, - UNIT_SPELLCAST_CHANNEL_STOP = true, - UNIT_SPELLCAST_CHANNEL_UPDATE = true, - UNIT_SPELLCAST_DELAYED = true, - UNIT_SPELLCAST_EMPOWER_START = true, - UNIT_SPELLCAST_EMPOWER_STOP = true, - UNIT_SPELLCAST_EMPOWER_UPDATE = true, - UNIT_SPELLCAST_FAILED = true, - UNIT_SPELLCAST_INTERRUPTED = true, - UNIT_SPELLCAST_INTERRUPTIBLE = true, - UNIT_SPELLCAST_NOT_INTERRUPTIBLE = true, - UNIT_SPELLCAST_SENT = true, - UNIT_SPELLCAST_START = true, - UNIT_SPELLCAST_STOP = true, - UNIT_SPELLCAST_SUCCEEDED = true, - UNIT_TARGETABLE_CHANGED = true, - UNIT_THREAT_LIST_UPDATE = true, - UNIT_THREAT_SITUATION_UPDATE = true, - UPDATE_EXHAUSTION = true, - UPDATE_MACROS = true, - UPDATE_MOUSEOVER_UNIT = true, - UPDATE_SHAPESHIFT_FORM = true, - UPDATE_VEHICLE_ACTIONBAR = true, - WEAPON_SLOT_CHANGED = true, - }, - scriptObjects = { - DurationTextBindingObjectAPI = { - Assign = { secretArguments = "AllowedWhenUntainted" }, - CanFormatText = { }, - CanUpdateFontString = { }, - ClearTextColorCurve = { }, - Copy = { }, - Disable = { }, - Enable = { }, - GetDuration = { }, - GetExpiredText = { }, - GetFontString = { }, - GetFormattedText = { }, - GetFormattedTextColor = { }, - GetTextColorCurve = { }, - GetTimeModifier = { }, - GetUpdateInterval = { }, - GetZeroDurationText = { }, - HasSecretValues = { }, - IsEnabled = { }, - SetDuration = { secretArguments = "AllowedWhenUntainted" }, - SetEnabled = { secretArguments = "AllowedWhenUntainted" }, - SetExpiredText = { secretArguments = "AllowedWhenUntainted" }, - SetFontString = { secretArguments = "AllowedWhenUntainted" }, - SetFormatter = { secretArguments = "AllowedWhenUntainted" }, - SetTextColorCurve = { secretArguments = "AllowedWhenUntainted" }, - SetTextFormat = { secretArguments = "AllowedWhenUntainted" }, - SetTimeModifier = { secretArguments = "AllowedWhenUntainted" }, - SetToDefaults = { }, - SetUpdateInterval = { secretArguments = "AllowedWhenUntainted" }, - SetZeroDurationText = { secretArguments = "AllowedWhenUntainted" }, - UpdateFontString = { }, - }, - FrameAPICharacterModelBase = { - ApplySpellVisualKit = { secretArguments = "AllowedWhenUntainted" }, - CanSetUnit = { secretArguments = "AllowedWhenUntainted" }, - FreezeAnimation = { secretArguments = "AllowedWhenUntainted" }, - GetDisplayInfo = { }, - GetDoBlend = { }, - GetKeepModelOnHide = { }, - HasAnimation = { secretArguments = "AllowedWhenUntainted" }, - PlayAnimKit = { secretArguments = "AllowedWhenUntainted" }, - RefreshCamera = { }, - RefreshUnit = { }, - SetAnimation = { secretArguments = "AllowedWhenUntainted" }, - SetBarberShopAlternateForm = { }, - SetCamDistanceScale = { secretArguments = "AllowedWhenUntainted" }, - SetCreature = { secretArguments = "AllowedWhenUntainted" }, - SetDisplayInfo = { secretArguments = "AllowedWhenUntainted" }, - SetDoBlend = { secretArguments = "AllowedWhenUntainted" }, - SetItem = { secretArguments = "AllowedWhenUntainted" }, - SetItemAppearance = { secretArguments = "AllowedWhenUntainted" }, - SetKeepModelOnHide = { secretArguments = "AllowedWhenUntainted" }, - SetPortraitZoom = { secretArguments = "AllowedWhenUntainted" }, - SetRotation = { secretArguments = "AllowedWhenUntainted" }, - SetUnit = { secretArguments = "AllowedWhenUntainted" }, - StopAnimKit = { }, - ZeroCachedCenterXY = { }, - }, - FrameAPICooldown = { - Clear = { protected = true }, - GetCooldownDisplayDuration = { secretAspects = { "Cooldown" } }, - GetCooldownDuration = { secretAspects = { "Cooldown" } }, - GetCooldownTimes = { secretAspects = { "Cooldown" } }, - GetCountdownAbbrevThreshold = { }, - GetCountdownFontString = { }, - GetCountdownFormatter = { }, - GetCountdownMillisecondsThreshold = { }, - GetDrawBling = { secretAspects = { "CooldownStyle" } }, - GetDrawEdge = { secretAspects = { "CooldownStyle" } }, - GetDrawSwipe = { secretAspects = { "CooldownStyle" } }, - GetEdgeScale = { }, - GetHideCountdownNumbers = { }, - GetMinimumCountdownDuration = { }, - GetReverse = { }, - GetRotation = { }, - GetUseAuraDisplayTime = { }, - IsPaused = { }, - Pause = { }, - Resume = { }, - SetBlingTexture = { secretArguments = "AllowedWhenUntainted" }, - SetCooldown = { addsAspects = { "Cooldown" }, protected = true, secretArguments = "AllowedWhenUntainted" }, - SetCooldownDuration = { addsAspects = { "Cooldown" }, protected = true, secretArguments = "AllowedWhenUntainted" }, - SetCooldownFromDurationObject = { protected = true, secretArguments = "AllowedWhenUntainted" }, - SetCooldownFromExpirationTime = { addsAspects = { "Cooldown" }, protected = true, secretArguments = "AllowedWhenUntainted" }, - SetCooldownUNIX = { addsAspects = { "Cooldown" }, protected = true, secretArguments = "AllowedWhenUntainted" }, - SetCountdownAbbrevThreshold = { secretArguments = "AllowedWhenUntainted" }, - SetCountdownFont = { secretArguments = "AllowedWhenUntainted" }, - SetCountdownFormatter = { secretArguments = "AllowedWhenUntainted" }, - SetCountdownMillisecondsThreshold = { secretArguments = "AllowedWhenUntainted" }, - SetDrawBling = { addsAspects = { "CooldownStyle" }, secretArguments = "AllowedWhenTainted" }, - SetDrawEdge = { addsAspects = { "CooldownStyle" }, secretArguments = "AllowedWhenTainted" }, - SetDrawSwipe = { addsAspects = { "CooldownStyle" }, secretArguments = "AllowedWhenTainted" }, - SetEdgeColor = { addsAspects = { "CooldownStyle" }, secretArguments = "AllowedWhenTainted" }, - SetEdgeScale = { secretArguments = "AllowedWhenUntainted" }, - SetEdgeTexture = { secretArguments = "AllowedWhenUntainted" }, - SetHideCountdownNumbers = { secretArguments = "AllowedWhenUntainted" }, - SetMinimumCountdownDuration = { secretArguments = "AllowedWhenUntainted" }, - SetPaused = { secretArguments = "AllowedWhenUntainted" }, - SetReverse = { secretArguments = "AllowedWhenUntainted" }, - SetRotation = { secretArguments = "AllowedWhenUntainted" }, - SetSwipeColor = { addsAspects = { "CooldownStyle" }, secretArguments = "AllowedWhenTainted" }, - SetSwipeTexture = { secretArguments = "AllowedWhenUntainted" }, - SetTexCoordRange = { secretArguments = "AllowedWhenUntainted" }, - SetUseAuraDisplayTime = { secretArguments = "AllowedWhenUntainted" }, - SetUseCircularEdge = { secretArguments = "AllowedWhenUntainted" }, - }, - FrameAPITooltip = { - AddFontStrings = { secretArguments = "AllowedWhenUntainted" }, - ClearPadding = { }, - GetLeftLine = { secretArguments = "AllowedWhenUntainted" }, - GetMinimumWidth = { secretAspects = { "MinimumWidth" } }, - GetPadding = { secretAspects = { "Padding" } }, - GetRightLine = { secretArguments = "AllowedWhenUntainted" }, - SetMinimumWidth = { addsAspects = { "MinimumWidth" }, secretArguments = "AllowedWhenUntainted" }, - SetPadding = { addsAspects = { "Padding" }, secretArguments = "AllowedWhenUntainted" }, - SetText = { addsAspects = { "Text" }, secretArguments = "AllowedWhenTainted" }, - }, - LuaColorCurveObjectAPI = { - AddPoint = { secretArguments = "AllowedWhenUntainted" }, - ClearPoints = { }, - Copy = { }, - Evaluate = { secretArguments = "AllowedWhenUntainted" }, - EvaluateUnpacked = { secretArguments = "AllowedWhenUntainted" }, - GetPoint = { secretArguments = "AllowedWhenUntainted" }, - GetPointCount = { }, - GetPoints = { }, - RemovePoint = { secretArguments = "AllowedWhenUntainted" }, - SetPoints = { secretArguments = "AllowedWhenUntainted" }, - SetToDefaults = { }, - }, - LuaCurveObjectAPI = { - AddPoint = { secretArguments = "AllowedWhenUntainted" }, - ClearPoints = { }, - Copy = { }, - Evaluate = { secretArguments = "AllowedWhenUntainted" }, - GetPoint = { secretArguments = "AllowedWhenUntainted" }, - GetPointCount = { }, - GetPoints = { }, - RemovePoint = { secretArguments = "AllowedWhenUntainted" }, - SetPoints = { secretArguments = "AllowedWhenUntainted" }, - SetToDefaults = { }, - }, - LuaCurveObjectBaseAPI = { - GetType = { }, - HasSecretValues = { }, - SetType = { secretArguments = "AllowedWhenUntainted" }, - }, - LuaDurationObjectAPI = { - Assign = { secretArguments = "AllowedWhenUntainted" }, - Copy = { }, - EvaluateElapsedDuration = { secretArguments = "AllowedWhenUntainted", secretWhen = { "CurveSecret" } }, - EvaluateElapsedPercent = { secretArguments = "AllowedWhenUntainted", secretWhen = { "CurveSecret" } }, - EvaluateRemainingDuration = { secretArguments = "AllowedWhenUntainted", secretWhen = { "CurveSecret" } }, - EvaluateRemainingPercent = { secretArguments = "AllowedWhenUntainted", secretWhen = { "CurveSecret" } }, - EvaluateTotalDuration = { secretArguments = "AllowedWhenUntainted", secretWhen = { "CurveSecret" } }, - FormatElapsedDuration = { secretArguments = "AllowedWhenUntainted", secretWhen = { "NumericFormatterSecret" } }, - FormatRemainingDuration = { secretArguments = "AllowedWhenUntainted", secretWhen = { "NumericFormatterSecret" } }, - FormatTotalDuration = { secretArguments = "AllowedWhenUntainted", secretWhen = { "NumericFormatterSecret" } }, - GetClock = { }, - GetClockTime = { }, - GetElapsedDuration = { secretArguments = "AllowedWhenUntainted" }, - GetElapsedPercent = { secretArguments = "AllowedWhenUntainted" }, - GetEndTime = { secretArguments = "AllowedWhenUntainted" }, - GetModRate = { }, - GetRemainingDuration = { secretArguments = "AllowedWhenUntainted" }, - GetRemainingPercent = { secretArguments = "AllowedWhenUntainted" }, - GetStartTime = { secretArguments = "AllowedWhenUntainted" }, - GetTotalDuration = { secretArguments = "AllowedWhenUntainted" }, - HasExpired = { secretArguments = "AllowedWhenUntainted" }, - HasSecretValues = { }, - HasStarted = { secretArguments = "AllowedWhenUntainted" }, - IsActive = { secretArguments = "AllowedWhenUntainted" }, - IsZero = { }, - Reset = { }, - SetClock = { secretArguments = "AllowedWhenUntainted" }, - SetTimeFromEnd = { secretArguments = "AllowedWhenUntainted" }, - SetTimeFromStart = { secretArguments = "AllowedWhenUntainted" }, - SetTimeSpan = { secretArguments = "AllowedWhenUntainted" }, - SetToDefaults = { }, - }, - SecondsFormatterAPI = { - CanApproximate = { secretArguments = "AllowedWhenUntainted" }, - CanRoundUpIntervals = { }, - CanRoundUpLastUnit = { }, - EvaluateDesiredUnitCount = { secretArguments = "AllowedWhenUntainted" }, - EvaluateMaxInterval = { secretArguments = "AllowedWhenUntainted" }, - EvaluateMinInterval = { secretArguments = "AllowedWhenUntainted" }, - Format = { secretArguments = "AllowedWhenUntainted" }, - FormatZero = { secretArguments = "AllowedWhenUntainted" }, - GetApproximationSeconds = { }, - GetConvertToLower = { }, - GetDefaultAbbreviation = { }, - GetDesiredUnitCount = { }, - GetDesiredUnitCountCurve = { }, - GetMaxInterval = { }, - GetMaxIntervalCurve = { }, - GetMillisecondsThreshold = { }, - GetMinInterval = { }, - GetMinIntervalCurve = { }, - GetRounding = { }, - GetStripIntervalWhitespace = { }, - Reset = { }, - SetApproximationSeconds = { secretArguments = "AllowedWhenUntainted" }, - SetCanRoundUpIntervals = { secretArguments = "AllowedWhenUntainted" }, - SetCanRoundUpLastUnit = { secretArguments = "AllowedWhenUntainted" }, - SetConvertToLower = { secretArguments = "AllowedWhenUntainted" }, - SetDefaultAbbreviation = { secretArguments = "AllowedWhenUntainted" }, - SetDesiredUnitCount = { secretArguments = "AllowedWhenUntainted" }, - SetDesiredUnitCountCurve = { secretArguments = "AllowedWhenUntainted" }, - SetMaxInterval = { secretArguments = "AllowedWhenUntainted" }, - SetMaxIntervalCurve = { secretArguments = "AllowedWhenUntainted" }, - SetMillisecondsThreshold = { secretArguments = "AllowedWhenUntainted" }, - SetMinInterval = { secretArguments = "AllowedWhenUntainted" }, - SetMinIntervalCurve = { secretArguments = "AllowedWhenUntainted" }, - SetRounding = { secretArguments = "AllowedWhenUntainted" }, - SetStripIntervalWhitespace = { secretArguments = "AllowedWhenUntainted" }, - }, - SimpleAnimAPI = { - GetDuration = { }, - GetElapsed = { }, - GetEndDelay = { }, - GetOrder = { }, - GetProgress = { }, - GetRegionParent = { }, - GetScript = { secretArguments = "AllowedWhenUntainted" }, - GetSmoothProgress = { }, - GetSmoothing = { }, - GetStartDelay = { }, - GetTarget = { }, - HasScript = { secretArguments = "AllowedWhenUntainted", secretAspects = { "ObjectType" } }, - HookScript = { secretArguments = "AllowedWhenUntainted" }, - IsDelaying = { }, - IsDone = { }, - IsPaused = { }, - IsPlaying = { }, - IsStopped = { }, - Pause = { }, - Play = { }, - Restart = { }, - SetChildKey = { secretArguments = "AllowedWhenUntainted" }, - SetDuration = { secretArguments = "AllowedWhenUntainted" }, - SetEndDelay = { secretArguments = "NotAllowed" }, - SetOrder = { secretArguments = "NotAllowed" }, - SetParent = { secretArguments = "AllowedWhenUntainted" }, - SetPlaying = { secretArguments = "NotAllowed" }, - SetScript = { secretArguments = "AllowedWhenUntainted" }, - SetSmoothProgress = { secretArguments = "NotAllowed" }, - SetSmoothing = { secretArguments = "AllowedWhenUntainted" }, - SetStartDelay = { secretArguments = "AllowedWhenUntainted" }, - SetTarget = { secretArguments = "AllowedWhenUntainted" }, - SetTargetKey = { secretArguments = "AllowedWhenUntainted" }, - SetTargetName = { secretArguments = "AllowedWhenUntainted" }, - SetTargetParent = { }, - Stop = { }, - }, - SimpleAnimAlphaAPI = { - GetFromAlpha = { secretAspects = { "Alpha" } }, - GetToAlpha = { secretAspects = { "Alpha" } }, - SetFromAlpha = { addsAspects = { "Alpha" }, secretArguments = "AllowedWhenUntainted" }, - SetToAlpha = { addsAspects = { "Alpha" }, secretArguments = "AllowedWhenUntainted" }, - }, - SimpleAnimFlipBookAPI = { - GetFlipBookColumns = { }, - GetFlipBookFrameHeight = { }, - GetFlipBookFrameWidth = { }, - GetFlipBookFrames = { }, - GetFlipBookRows = { }, - SetFlipBookColumns = { secretArguments = "AllowedWhenUntainted" }, - SetFlipBookFrameHeight = { secretArguments = "AllowedWhenUntainted" }, - SetFlipBookFrameWidth = { secretArguments = "AllowedWhenUntainted" }, - SetFlipBookFrames = { secretArguments = "AllowedWhenUntainted" }, - SetFlipBookRows = { secretArguments = "AllowedWhenUntainted" }, - }, - SimpleAnimGroupAPI = { - CreateAnimation = { secretArguments = "NotAllowed" }, - Finish = { }, - GetAnimationSpeedMultiplier = { }, - GetAnimations = { }, - GetDuration = { }, - GetElapsed = { }, - GetLoopState = { }, - GetLooping = { }, - GetProgress = { }, - GetScript = { secretArguments = "AllowedWhenUntainted" }, - HasScript = { secretArguments = "AllowedWhenUntainted", secretAspects = { "ObjectType" } }, - HookScript = { secretArguments = "AllowedWhenUntainted" }, - IsDone = { }, - IsPaused = { }, - IsPendingFinish = { }, - IsPlaying = { }, - IsReverse = { }, - IsSetToFinalAlpha = { }, - Pause = { }, - Play = { secretArguments = "AllowedWhenUntainted" }, - RemoveAnimations = { }, - Restart = { secretArguments = "AllowedWhenUntainted" }, - SetAnimationSpeedMultiplier = { secretArguments = "AllowedWhenUntainted" }, - SetLooping = { secretArguments = "NotAllowed" }, - SetPlaying = { secretArguments = "AllowedWhenUntainted" }, - SetScript = { secretArguments = "AllowedWhenUntainted" }, - SetToFinalAlpha = { secretArguments = "AllowedWhenUntainted" }, - Stop = { }, - }, - SimpleAnimatableObjectAPI = { - CreateAnimationGroup = { secretArguments = "NotAllowed" }, - GetAnimationGroups = { }, - StopAnimating = { }, - }, - SimpleButtonAPI = { - ClearDisabledTexture = { }, - ClearHighlightTexture = { }, - ClearNormalTexture = { }, - ClearPushedTexture = { }, - Click = { secretArguments = "NotAllowed" }, - Disable = { protected = true }, - Enable = { protected = true }, - GetButtonState = { secretAspects = { "ButtonState" } }, - GetDisabledFontObject = { }, - GetDisabledTexture = { }, - GetFontString = { }, - GetHighlightFontObject = { }, - GetHighlightTexture = { }, - GetMotionScriptsWhileDisabled = { }, - GetNormalFontObject = { }, - GetNormalTexture = { }, - GetPushedTextOffset = { }, - GetPushedTexture = { }, - GetText = { secretAspects = { "Text" } }, - GetTextHeight = { }, - GetTextWidth = { }, - IsEnabled = { secretAspects = { "ButtonState" } }, - RegisterForClicks = { protected = true, secretArguments = "NotAllowed" }, - RegisterForMouse = { protected = true, secretArguments = "NotAllowed" }, - SetButtonState = { addsAspects = { "ButtonState" }, secretArguments = "AllowedWhenUntainted" }, - SetDisabledAtlas = { secretArguments = "AllowedWhenUntainted" }, - SetDisabledFontObject = { secretArguments = "AllowedWhenUntainted" }, - SetDisabledTexture = { secretArguments = "AllowedWhenUntainted" }, - SetEnabled = { addsAspects = { "ButtonState" }, protected = true, secretArguments = "AllowedWhenUntainted" }, - SetFontString = { secretArguments = "AllowedWhenUntainted" }, - SetFormattedText = { addsAspects = { "Text" }, secretArguments = "AllowedWhenUntainted" }, - SetHighlightAtlas = { secretArguments = "AllowedWhenUntainted" }, - SetHighlightFontObject = { secretArguments = "AllowedWhenUntainted" }, - SetHighlightTexture = { secretArguments = "AllowedWhenUntainted" }, - SetMotionScriptsWhileDisabled = { secretArguments = "AllowedWhenUntainted" }, - SetNormalAtlas = { secretArguments = "AllowedWhenUntainted" }, - SetNormalFontObject = { secretArguments = "AllowedWhenUntainted" }, - SetNormalTexture = { secretArguments = "AllowedWhenUntainted" }, - SetPushedAtlas = { secretArguments = "AllowedWhenUntainted" }, - SetPushedTextOffset = { secretArguments = "AllowedWhenUntainted" }, - SetPushedTexture = { secretArguments = "AllowedWhenUntainted" }, - SetText = { addsAspects = { "Text" }, secretArguments = "AllowedWhenUntainted" }, - }, - SimpleCheckboxAPI = { - GetChecked = { }, - GetCheckedTexture = { }, - GetDisabledCheckedTexture = { }, - SetChecked = { secretArguments = "AllowedWhenUntainted" }, - SetCheckedTexture = { secretArguments = "AllowedWhenUntainted" }, - SetDisabledCheckedTexture = { secretArguments = "AllowedWhenUntainted" }, - }, - SimpleEditBoxAPI = { - AddHistoryLine = { secretArguments = "AllowedWhenUntainted" }, - ClearFocus = { }, - ClearHighlightText = { }, - ClearHistory = { }, - Disable = { }, - Enable = { }, - GetAltArrowKeyMode = { }, - GetBlinkSpeed = { }, - GetCursorPosition = { secretAspects = { "Cursor", "Text" } }, - GetDisplayText = { secretAspects = { "Text" } }, - GetFont = { }, - GetFontObject = { }, - GetHighlightColor = { }, - GetHistoryLines = { }, - GetIndentedWordWrap = { }, - GetInputLanguage = { }, - GetJustifyH = { }, - GetJustifyV = { }, - GetMaxBytes = { }, - GetMaxLetters = { }, - GetNumLetters = { }, - GetNumLines = { }, - GetNumber = { secretAspects = { "Text" } }, - GetShadowColor = { }, - GetShadowOffset = { }, - GetSpacing = { }, - GetText = { secretAspects = { "Text" } }, - GetTextColor = { }, - GetTextInsets = { }, - GetUTF8CursorPosition = { secretAspects = { "Cursor", "Text" } }, - GetVisibleTextByteLimit = { }, - HasFocus = { }, - HasText = { }, - HighlightText = { secretArguments = "AllowedWhenUntainted" }, - Insert = { addsAspects = { "Text" }, secretArguments = "AllowedWhenUntainted" }, - IsAlphabeticOnly = { }, - IsAutoFocus = { }, - IsCountInvisibleLetters = { }, - IsEnabled = { }, - IsInIMECompositionMode = { }, - IsMultiLine = { }, - IsNumeric = { }, - IsNumericFullRange = { }, - IsPassword = { }, - IsSecureText = { secretAspects = { "SecureText" } }, - ResetInputMode = { }, - SetAlphabeticOnly = { secretArguments = "AllowedWhenUntainted" }, - SetAltArrowKeyMode = { secretArguments = "AllowedWhenUntainted" }, - SetAutoFocus = { secretArguments = "AllowedWhenUntainted" }, - SetBlinkSpeed = { secretArguments = "AllowedWhenUntainted" }, - SetCountInvisibleLetters = { secretArguments = "AllowedWhenUntainted" }, - SetCursorPosition = { addsAspects = { "Cursor" }, secretArguments = "AllowedWhenUntainted" }, - SetEnabled = { secretArguments = "AllowedWhenUntainted" }, - SetFocus = { }, - SetFont = { secretArguments = "AllowedWhenUntainted" }, - SetFontObject = { secretArguments = "AllowedWhenUntainted" }, - SetHighlightColor = { secretArguments = "AllowedWhenUntainted" }, - SetHistoryLines = { secretArguments = "AllowedWhenUntainted" }, - SetIndentedWordWrap = { secretArguments = "AllowedWhenUntainted" }, - SetJustifyH = { secretArguments = "AllowedWhenUntainted" }, - SetJustifyV = { secretArguments = "AllowedWhenUntainted" }, - SetMaxBytes = { secretArguments = "AllowedWhenUntainted" }, - SetMaxLetters = { secretArguments = "AllowedWhenUntainted" }, - SetMultiLine = { secretArguments = "AllowedWhenUntainted" }, - SetNumber = { addsAspects = { "Text" }, secretArguments = "AllowedWhenUntainted" }, - SetNumeric = { secretArguments = "AllowedWhenUntainted" }, - SetNumericFullRange = { secretArguments = "AllowedWhenUntainted" }, - SetPassword = { secretArguments = "AllowedWhenUntainted" }, - SetSecureText = { addsAspects = { "SecureText" }, secretArguments = "AllowedWhenUntainted" }, - SetSecurityDisablePaste = { }, - SetSecurityDisableSetText = { }, - SetShadowColor = { secretArguments = "AllowedWhenUntainted" }, - SetShadowOffset = { secretArguments = "AllowedWhenUntainted" }, - SetSpacing = { secretArguments = "AllowedWhenUntainted" }, - SetText = { addsAspects = { "Text" }, secretArguments = "AllowedWhenUntainted" }, - SetTextColor = { secretArguments = "AllowedWhenUntainted" }, - SetTextInsets = { secretArguments = "AllowedWhenUntainted" }, - SetVisibleTextByteLimit = { secretArguments = "AllowedWhenUntainted" }, - ToggleInputLanguage = { }, - }, - SimpleFontAPI = { - CopyFontObject = { secretArguments = "AllowedWhenUntainted" }, - GetAlpha = { }, - GetFont = { }, - GetFontHeight = { }, - GetFontObject = { }, - GetFontObjectForAlphabet = { secretArguments = "AllowedWhenUntainted" }, - GetIndentedWordWrap = { }, - GetJustifyH = { }, - GetJustifyV = { }, - GetShadowColor = { }, - GetShadowOffset = { }, - GetSpacing = { }, - GetTextColor = { }, - SetAlpha = { secretArguments = "AllowedWhenUntainted" }, - SetFont = { secretArguments = "AllowedWhenUntainted" }, - SetFontHeight = { secretArguments = "AllowedWhenUntainted" }, - SetFontObject = { secretArguments = "AllowedWhenUntainted" }, - SetIndentedWordWrap = { secretArguments = "AllowedWhenUntainted" }, - SetJustifyH = { secretArguments = "AllowedWhenUntainted" }, - SetJustifyV = { secretArguments = "AllowedWhenUntainted" }, - SetShadowColor = { secretArguments = "AllowedWhenUntainted" }, - SetShadowOffset = { secretArguments = "AllowedWhenUntainted" }, - SetSpacing = { secretArguments = "AllowedWhenUntainted" }, - SetTextColor = { secretArguments = "AllowedWhenUntainted" }, - }, - SimpleFontStringAPI = { - CalculateScreenAreaFromCharacterSpan = { secretArguments = "AllowedWhenUntainted", secretAspects = { "Text" }, secretWhen = { "AnchoringSecret" } }, - CanNonSpaceWrap = { }, - CanWordWrap = { }, - ClearAlphaGradient = { }, - ClearText = { }, - FindCharacterIndexAtCoordinate = { secretArguments = "AllowedWhenUntainted", secretAspects = { "Text" }, secretWhen = { "AnchoringSecret" } }, - GetAlphaGradient = { }, - GetFieldSize = { }, - GetFont = { }, - GetFontHeight = { secretArguments = "AllowedWhenUntainted" }, - GetFontObject = { }, - GetIndentedWordWrap = { }, - GetJustifyH = { }, - GetJustifyV = { }, - GetLineHeight = { }, - GetMaxLines = { }, - GetNumLines = { secretWhen = { "AnchoringSecret" } }, - GetRotation = { }, - GetScaleAnimationMode = { }, - GetShadowColor = { }, - GetShadowOffset = { }, - GetSmoothScaling = { }, - GetSpacing = { }, - GetStringHeight = { secretWhen = { "AnchoringSecret" } }, - GetStringWidth = { secretWhen = { "AnchoringSecret" } }, - GetText = { secretAspects = { "Text" } }, - GetTextColor = { secretAspects = { "VertexColor", "Alpha" } }, - GetTextScale = { }, - GetUnboundedStringWidth = { secretWhen = { "AnchoringSecret" } }, - GetUnboundedStringWidthForText = { secretArguments = "AllowedWhenUntainted", secretWhen = { "AnchoringSecret" } }, - GetWrappedWidth = { secretWhen = { "AnchoringSecret" } }, - IsTruncated = { secretWhen = { "AnchoringSecret" } }, - OnColorsUpdated = { }, - SetAlphaGradient = { secretArguments = "AllowedWhenUntainted" }, - SetDesaturateEmbeddedTextures = { secretArguments = "AllowedWhenUntainted" }, - SetFixedColor = { secretArguments = "AllowedWhenUntainted" }, - SetFont = { secretArguments = "AllowedWhenUntainted" }, - SetFontHeight = { secretArguments = "AllowedWhenUntainted" }, - SetFontObject = { secretArguments = "AllowedWhenUntainted" }, - SetFormattedText = { addsAspects = { "Text" }, secretArguments = "AllowedWhenTainted" }, - SetIndentedWordWrap = { secretArguments = "AllowedWhenUntainted" }, - SetJustifyH = { secretArguments = "AllowedWhenUntainted" }, - SetJustifyV = { secretArguments = "AllowedWhenUntainted" }, - SetMaxLines = { secretArguments = "AllowedWhenUntainted" }, - SetNonSpaceWrap = { secretArguments = "AllowedWhenUntainted" }, - SetRotation = { secretArguments = "AllowedWhenUntainted" }, - SetScaleAnimationMode = { secretArguments = "NotAllowed" }, - SetShadowColor = { secretArguments = "AllowedWhenUntainted" }, - SetShadowOffset = { secretArguments = "AllowedWhenUntainted" }, - SetSmoothScaling = { secretArguments = "AllowedWhenUntainted" }, - SetSpacing = { secretArguments = "AllowedWhenUntainted" }, - SetText = { addsAspects = { "Text" }, secretArguments = "AllowedWhenTainted" }, - SetTextColor = { addsAspects = { "VertexColor", "Alpha" }, secretArguments = "AllowedWhenTainted" }, - SetTextHeight = { secretArguments = "AllowedWhenUntainted" }, - SetTextScale = { secretArguments = "AllowedWhenUntainted" }, - SetTextToFit = { addsAspects = { "Text" }, secretArguments = "AllowedWhenTainted" }, - SetWordWrap = { secretArguments = "AllowedWhenUntainted" }, - }, - SimpleFrameAPI = { - AbortDrag = { }, - AddRoleset = { protected = true, secretArguments = "AllowedWhenUntainted" }, - CanChangeAttribute = { secretAspects = { "ObjectSecurity" } }, - ClearAlphaGradient = { }, - ClearAttribute = { protected = true, secretArguments = "NotAllowed", secretAspects = { "Attributes" } }, - ClearAttributes = { protected = true }, - CreateFontString = { secretArguments = "NotAllowed" }, - CreateLine = { secretArguments = "NotAllowed" }, - CreateMaskTexture = { secretArguments = "NotAllowed" }, - CreateTexture = { secretArguments = "NotAllowed" }, - CreateVectorGraphics = { secretArguments = "NotAllowed" }, - DesaturateHierarchy = { secretArguments = "NotAllowed" }, - DisableDrawLayer = { secretArguments = "AllowedWhenUntainted" }, - DoesClipChildren = { }, - DoesHyperlinkPropagateToParent = { }, - EnableDrawLayer = { secretArguments = "AllowedWhenUntainted" }, - EnableGamePadButton = { protected = true, secretArguments = "NotAllowed" }, - EnableGamePadStick = { protected = true, secretArguments = "NotAllowed" }, - EnableKeyboard = { protected = true, secretArguments = "NotAllowed" }, - ExecuteAttribute = { secretArguments = "AllowedWhenUntainted", secretAspects = { "Attributes" } }, - GetAlpha = { secretAspects = { "Alpha" } }, - GetAttribute = { secretArguments = "AllowedWhenUntainted", secretAspects = { "Attributes" } }, - GetBoundsRect = { }, - GetChildren = { secretAspects = { "Hierarchy" } }, - GetClampRectInsets = { }, - GetDontSavePosition = { }, - GetEffectiveAlpha = { secretAspects = { "Alpha" } }, - GetEffectiveScale = { secretAspects = { "Scale" } }, - GetEffectivelyFlattensRenderLayers = { }, - GetFlattensRenderLayers = { }, - GetFrameLevel = { secretAspects = { "FrameLevel" } }, - GetFrameStrata = { secretAspects = { "FrameStrata" } }, - GetHighestFrameLevel = { secretArguments = "AllowedWhenUntainted" }, - GetHitRectInsets = { }, - GetHyperlinksEnabled = { }, - GetID = { secretAspects = { "ID" } }, - GetNumChildren = { secretAspects = { "Hierarchy" } }, - GetNumRegions = { secretAspects = { "Hierarchy" } }, - GetOnUpdateMode = { }, - GetPropagateKeyboardInput = { }, - GetRaisedFrameLevel = { }, - GetRegions = { secretAspects = { "Hierarchy" } }, - GetResizeBounds = { }, - GetRolesetNames = { }, - GetScale = { secretAspects = { "Scale" } }, - GetWindow = { }, - HasAlphaGradient = { }, - HasFixedFrameLevel = { }, - HasFixedFrameStrata = { }, - Hide = { protected = true }, - InterceptStartDrag = { secretArguments = "AllowedWhenUntainted" }, - IsClampedToScreen = { }, - IsDrawLayerEnabled = { secretArguments = "AllowedWhenUntainted" }, - IsEventRegistered = { secretArguments = "AllowedWhenUntainted" }, - IsFrameBuffer = { }, - IsGamePadButtonEnabled = { }, - IsGamePadStickEnabled = { }, - IsHighlightLocked = { }, - IsIgnoringChildrenForBounds = { }, - IsIgnoringParentAlpha = { }, - IsIgnoringParentScale = { }, - IsKeyboardEnabled = { }, - IsMovable = { }, - IsObjectLoaded = { }, - IsResizable = { }, - IsRolesetFiltered = { }, - IsShown = { secretAspects = { "Shown" } }, - IsToplevel = { secretAspects = { "Toplevel" } }, - IsUserPlaced = { }, - IsUsingParentLevel = { }, - IsVisible = { secretAspects = { "Shown" } }, - LockHighlight = { }, - Lower = { protected = true }, - Raise = { protected = true }, - RegisterAllEvents = { }, - RegisterEvent = { secretArguments = "AllowedWhenUntainted" }, - RegisterEventCallback = { secretArguments = "AllowedWhenUntainted" }, - RegisterForDrag = { secretArguments = "AllowedWhenUntainted" }, - RegisterUnitEvent = { secretArguments = "AllowedWhenUntainted" }, - RegisterUnitEventCallback = { secretArguments = "AllowedWhenUntainted" }, - RemoveRoleset = { protected = true, secretArguments = "AllowedWhenUntainted" }, - ResizeToBoundsRect = { protected = true }, - RotateTextures = { secretArguments = "AllowedWhenUntainted" }, - SetAlpha = { addsAspects = { "Alpha" }, secretArguments = "AllowedWhenTainted" }, - SetAlphaFromBoolean = { addsAspects = { "Alpha" }, secretArguments = "AllowedWhenTainted" }, - SetAlphaGradient = { secretArguments = "AllowedWhenUntainted" }, - SetAttribute = { secretArguments = "AllowedWhenUntainted", secretAspects = { "Attributes" } }, - SetAttributeNoHandler = { secretArguments = "AllowedWhenUntainted", secretAspects = { "Attributes" } }, - SetClampRectInsets = { protected = true, secretArguments = "AllowedWhenUntainted" }, - SetClampedToScreen = { protected = true, secretArguments = "NotAllowed" }, - SetClipsChildren = { secretArguments = "AllowedWhenUntainted" }, - SetDontSavePosition = { secretArguments = "AllowedWhenUntainted" }, - SetDrawLayerEnabled = { secretArguments = "AllowedWhenUntainted" }, - SetFixedFrameLevel = { protected = true, secretArguments = "AllowedWhenUntainted" }, - SetFixedFrameStrata = { protected = true, secretArguments = "AllowedWhenUntainted" }, - SetFlattensRenderLayers = { secretArguments = "AllowedWhenUntainted" }, - SetFrameLevel = { addsAspects = { "FrameLevel" }, protected = true, secretArguments = "AllowedWhenUntainted" }, - SetFrameStrata = { addsAspects = { "FrameStrata" }, protected = true, secretArguments = "AllowedWhenUntainted" }, - SetHighlightLocked = { secretArguments = "AllowedWhenUntainted" }, - SetHitRectInsets = { protected = true, secretArguments = "NotAllowed" }, - SetHyperlinkPropagateToParent = { secretArguments = "AllowedWhenUntainted" }, - SetHyperlinksEnabled = { protected = true, secretArguments = "NotAllowed" }, - SetID = { addsAspects = { "ID" }, protected = true, secretArguments = "AllowedWhenTainted" }, - SetIgnoreParentAlpha = { secretArguments = "AllowedWhenUntainted" }, - SetIgnoreParentScale = { protected = true, secretArguments = "NotAllowed" }, - SetIgnoringChildrenForBounds = { secretArguments = "AllowedWhenUntainted" }, - SetIsFrameBuffer = { secretArguments = "NotAllowed" }, - SetMovable = { secretArguments = "AllowedWhenUntainted" }, - SetOnUpdateMode = { secretArguments = "AllowedWhenUntainted" }, - SetPropagateKeyboardInput = { secretArguments = "AllowedWhenUntainted" }, - SetResizable = { secretArguments = "AllowedWhenUntainted" }, - SetResizeBounds = { secretArguments = "AllowedWhenUntainted" }, - SetRolesets = { protected = true, secretArguments = "AllowedWhenUntainted" }, - SetScale = { addsAspects = { "Scale" }, protected = true, secretArguments = "AllowedWhenUntainted" }, - SetShown = { addsAspects = { "Shown" }, protected = true, secretArguments = "AllowedWhenUntainted" }, - SetToplevel = { addsAspects = { "Toplevel" }, protected = true, secretArguments = "AllowedWhenUntainted" }, - SetUserPlaced = { secretArguments = "AllowedWhenUntainted" }, - SetUsingParentLevel = { protected = true, secretArguments = "AllowedWhenUntainted" }, - SetWindow = { secretArguments = "AllowedWhenUntainted" }, - Show = { protected = true }, - StartMoving = { protected = true, secretArguments = "AllowedWhenUntainted" }, - StartSizing = { protected = true, secretArguments = "AllowedWhenUntainted" }, - StopMovingOrSizing = { protected = true }, - UnlockHighlight = { }, - UnregisterAllEvents = { }, - UnregisterEvent = { secretArguments = "AllowedWhenUntainted" }, - }, - SimpleFrameScriptObjectAPI = { - AddAccessRestrictions = { secretArguments = "NotAllowed" }, - AddForbiddenAspects = { secretArguments = "NotAllowed" }, - AddSecretAspect = { secretArguments = "AllowedWhenUntainted" }, - CanBeAccessedInContext = { secretAspects = { "ObjectSecurity" } }, - GetAccessRestrictions = { secretAspects = { "ObjectSecurity" } }, - GetForbiddenAspects = { secretAspects = { "ObjectSecurity" } }, - GetInheritableForbiddenAspects = { secretArguments = "NotAllowed", secretAspects = { "ObjectSecurity" } }, - GetName = { secretAspects = { "ObjectName" } }, - GetObjectTable = { }, - GetObjectType = { secretAspects = { "ObjectType" } }, - HasAccessConstraints = { secretAspects = { "ObjectSecurity" } }, - HasAnyAccessRestrictions = { secretArguments = "AllowedWhenUntainted", secretAspects = { "ObjectSecurity" } }, - HasAnyForbiddenAspects = { secretArguments = "AllowedWhenUntainted", secretAspects = { "ObjectSecurity" } }, - HasAnySecretAspect = { secretAspects = { "ObjectSecrets" } }, - HasSecretAspect = { secretArguments = "AllowedWhenUntainted", secretAspects = { "ObjectSecrets" } }, - HasSecretValues = { secretAspects = { "ObjectSecrets" } }, - IsForbidden = { secretAspects = { "ObjectSecurity" } }, - IsObjectType = { secretArguments = "AllowedWhenUntainted", secretAspects = { "ObjectType" } }, - IsPreventingSecretValues = { secretAspects = { "ObjectSecrets" } }, - SetForbidden = { }, - SetToDefaults = { protected = true }, - }, - SimpleLineAPI = { - ClearAllPoints = { protected = true }, - GetEndPoint = { }, - GetHitRectThickness = { }, - GetStartPoint = { }, - GetThickness = { }, - SetEndPoint = { secretArguments = "AllowedWhenUntainted" }, - SetHitRectThickness = { secretArguments = "AllowedWhenUntainted" }, - SetStartPoint = { secretArguments = "AllowedWhenUntainted" }, - SetThickness = { secretArguments = "AllowedWhenUntainted" }, - }, - SimpleModelAPI = { - AdvanceTime = { }, - ClearFog = { }, - ClearModel = { }, - ClearTransform = { }, - GetCameraDistance = { }, - GetCameraFacing = { }, - GetCameraPosition = { }, - GetCameraRoll = { }, - GetCameraTarget = { }, - GetDesaturation = { }, - GetFacing = { }, - GetFogColor = { }, - GetFogFar = { }, - GetFogNear = { }, - GetLight = { }, - GetModelAlpha = { }, - GetModelDrawLayer = { }, - GetModelFileID = { }, - GetModelScale = { }, - GetPaused = { }, - GetPitch = { }, - GetPosition = { }, - GetRoll = { }, - GetShadowEffect = { }, - GetViewInsets = { }, - GetViewTranslation = { }, - GetWorldScale = { }, - HasAttachmentPoints = { }, - HasCustomCamera = { }, - IsUsingModelCenterToTransform = { }, - MakeCurrentCameraCustom = { }, - ReplaceIconTexture = { secretArguments = "AllowedWhenUntainted" }, - SetCamera = { secretArguments = "AllowedWhenUntainted" }, - SetCameraDistance = { secretArguments = "AllowedWhenUntainted" }, - SetCameraFacing = { secretArguments = "AllowedWhenUntainted" }, - SetCameraPosition = { secretArguments = "AllowedWhenUntainted" }, - SetCameraRoll = { secretArguments = "AllowedWhenUntainted" }, - SetCameraTarget = { secretArguments = "AllowedWhenUntainted" }, - SetCustomCamera = { secretArguments = "AllowedWhenUntainted" }, - SetDesaturation = { secretArguments = "AllowedWhenUntainted" }, - SetFacing = { secretArguments = "AllowedWhenUntainted" }, - SetFogColor = { secretArguments = "AllowedWhenUntainted" }, - SetFogFar = { secretArguments = "AllowedWhenUntainted" }, - SetFogNear = { secretArguments = "AllowedWhenUntainted" }, - SetGlow = { secretArguments = "AllowedWhenUntainted" }, - SetGradientMask = { secretArguments = "AllowedWhenUntainted" }, - SetLight = { secretArguments = "AllowedWhenUntainted" }, - SetModel = { secretArguments = "AllowedWhenUntainted" }, - SetModelAlpha = { secretArguments = "AllowedWhenUntainted" }, - SetModelDrawLayer = { secretArguments = "AllowedWhenUntainted" }, - SetModelScale = { secretArguments = "AllowedWhenUntainted" }, - SetParticlesEnabled = { secretArguments = "AllowedWhenUntainted" }, - SetPaused = { secretArguments = "AllowedWhenUntainted" }, - SetPitch = { secretArguments = "AllowedWhenUntainted" }, - SetPosition = { secretArguments = "AllowedWhenUntainted" }, - SetRoll = { secretArguments = "AllowedWhenUntainted" }, - SetSequence = { secretArguments = "AllowedWhenUntainted" }, - SetSequenceTime = { secretArguments = "AllowedWhenUntainted" }, - SetShadowEffect = { secretArguments = "AllowedWhenUntainted" }, - SetTransform = { secretArguments = "AllowedWhenUntainted" }, - SetUseGBuffer = { secretArguments = "AllowedWhenUntainted" }, - SetViewInsets = { secretArguments = "AllowedWhenUntainted" }, - SetViewTranslation = { secretArguments = "AllowedWhenUntainted" }, - TransformCameraSpaceToModelSpace = { secretArguments = "AllowedWhenUntainted" }, - UseModelCenterToTransform = { secretArguments = "AllowedWhenUntainted" }, - }, - SimpleObjectAPI = { - ClearParentKey = { }, - GetDebugName = { secretArguments = "AllowedWhenUntainted" }, - GetParent = { secretAspects = { "Hierarchy" } }, - GetParentKey = { }, - SetParentKey = { secretArguments = "AllowedWhenUntainted" }, - }, - SimpleRegionAPI = { - GetAlpha = { secretAspects = { "Alpha" } }, - GetDrawLayer = { }, - GetEffectiveScale = { secretAspects = { "Scale" } }, - GetScale = { secretAspects = { "Scale" } }, - GetVertexColor = { secretAspects = { "VertexColor", "Alpha" } }, - IsIgnoringParentAlpha = { }, - IsIgnoringParentScale = { }, - IsObjectLoaded = { }, - SetAlpha = { addsAspects = { "Alpha" }, secretArguments = "AllowedWhenTainted" }, - SetAlphaFromBoolean = { addsAspects = { "Alpha" }, secretArguments = "AllowedWhenTainted" }, - SetDrawLayer = { secretArguments = "AllowedWhenUntainted" }, - SetIgnoreParentAlpha = { secretArguments = "AllowedWhenUntainted" }, - SetIgnoreParentScale = { protected = true, secretArguments = "NotAllowed" }, - SetScale = { addsAspects = { "Scale" }, protected = true, secretArguments = "AllowedWhenUntainted" }, - SetVertexColor = { addsAspects = { "VertexColor", "Alpha" }, secretArguments = "AllowedWhenTainted" }, - SetVertexColorFromBoolean = { addsAspects = { "VertexColor", "Alpha" }, secretArguments = "AllowedWhenTainted" }, - }, - SimpleScriptRegionAPI = { - CanChangeProtectedState = { secretAspects = { "ObjectSecurity" } }, - CanPropagateMouseClicks = { }, - CanPropagateMouseMotion = { }, - ClearScripts = { }, - CollapsesLayout = { }, - EnableMouse = { protected = true, secretArguments = "NotAllowed" }, - EnableMouseMotion = { protected = true, secretArguments = "NotAllowed" }, - EnableMouseWheel = { protected = true, secretArguments = "NotAllowed" }, - FocusEnter = { protected = true, secretArguments = "NotAllowed" }, - FocusExit = { protected = true, secretArguments = "NotAllowed" }, - GetBottom = { secretWhen = { "AnchoringSecret" } }, - GetCenter = { secretWhen = { "AnchoringSecret" } }, - GetHeight = { secretArguments = "AllowedWhenUntainted", secretWhen = { "AnchoringSecret" } }, - GetLeft = { secretWhen = { "AnchoringSecret" } }, - GetRect = { secretWhen = { "AnchoringSecret" } }, - GetRight = { secretWhen = { "AnchoringSecret" } }, - GetRoundLayoutToNearestPixel = { }, - GetScaledRect = { secretWhen = { "AnchoringSecret" } }, - GetScript = { secretArguments = "AllowedWhenUntainted" }, - GetSize = { secretArguments = "AllowedWhenUntainted", secretWhen = { "AnchoringSecret" } }, - GetSourceLocation = { secretAspects = { "ObjectDebug" } }, - GetTop = { secretWhen = { "AnchoringSecret" } }, - GetWidth = { secretArguments = "AllowedWhenUntainted", secretWhen = { "AnchoringSecret" } }, - HasScript = { secretArguments = "AllowedWhenUntainted", secretAspects = { "ObjectType" } }, - Hide = { }, - HookScript = { secretArguments = "AllowedWhenUntainted" }, - Intersects = { secretArguments = "AllowedWhenUntainted", secretWhen = { "AnchoringSecret" } }, - IsAnchoringRestricted = { secretAspects = { "ObjectSecurity" } }, - IsAnchoringSecret = { secretAspects = { "ObjectSecrets" } }, - IsCollapsed = { }, - IsDragging = { }, - IsMouseClickEnabled = { }, - IsMouseEnabled = { }, - IsMouseMotionEnabled = { }, - IsMouseMotionFocus = { }, - IsMouseOver = { secretArguments = "AllowedWhenUntainted", secretWhen = { "AnchoringSecret" } }, - IsMouseWheelEnabled = { }, - IsProtected = { secretAspects = { "ObjectSecurity" } }, - IsRectValid = { }, - IsShown = { secretAspects = { "Shown" } }, - IsVisible = { secretAspects = { "Shown" } }, - MouseDown = { protected = true, secretArguments = "NotAllowed" }, - MouseUp = { protected = true, secretArguments = "NotAllowed" }, - SetCollapsesLayout = { protected = true, secretArguments = "NotAllowed" }, - SetMouseClickEnabled = { protected = true, secretArguments = "NotAllowed" }, - SetMouseMotionEnabled = { protected = true, secretArguments = "NotAllowed" }, - SetParent = { protected = true, secretArguments = "NotAllowed" }, - SetPassThroughButtons = { protected = true, secretArguments = "NotAllowed" }, - SetPropagateMouseClicks = { protected = true, secretArguments = "NotAllowed" }, - SetPropagateMouseMotion = { protected = true, secretArguments = "NotAllowed" }, - SetRoundLayoutToNearestPixel = { protected = true, secretArguments = "NotAllowed" }, - SetScript = { secretArguments = "AllowedWhenUntainted" }, - SetShown = { addsAspects = { "Shown" }, secretArguments = "AllowedWhenUntainted" }, - ShouldButtonPassThrough = { secretArguments = "AllowedWhenUntainted" }, - Show = { }, - }, - SimpleScriptRegionResizingAPI = { - AdjustPointsOffset = { protected = true, secretArguments = "AllowedWhenUntainted" }, - ClearAllPoints = { protected = true }, - ClearPoint = { protected = true, secretArguments = "AllowedWhenUntainted" }, - ClearPointsOffset = { protected = true }, - GetNumPoints = { }, - GetPoint = { secretArguments = "AllowedWhenUntainted", secretWhen = { "AnchoringSecret" } }, - GetPointByName = { secretArguments = "AllowedWhenUntainted", secretWhen = { "AnchoringSecret" } }, - SetAllPoints = { protected = true, secretArguments = "AllowedWhenUntainted" }, - SetHeight = { protected = true, secretArguments = "AllowedWhenUntainted" }, - SetPoint = { protected = true, secretArguments = "AllowedWhenUntainted" }, - SetPointsOffset = { protected = true, secretArguments = "AllowedWhenUntainted" }, - SetSize = { protected = true, secretArguments = "AllowedWhenUntainted" }, - SetWidth = { protected = true, secretArguments = "AllowedWhenUntainted" }, - }, - SimpleSliderAPI = { - Disable = { }, - Enable = { }, - GetMinMaxValues = { }, - GetObeyStepOnDrag = { }, - GetOrientation = { }, - GetStepsPerPage = { }, - GetThumbTexture = { }, - GetValue = { }, - GetValueStep = { }, - IsDraggingThumb = { }, - IsEnabled = { }, - SetEnabled = { secretArguments = "AllowedWhenUntainted" }, - SetMinMaxValues = { secretArguments = "AllowedWhenUntainted" }, - SetObeyStepOnDrag = { secretArguments = "AllowedWhenUntainted" }, - SetOrientation = { secretArguments = "AllowedWhenUntainted" }, - SetStepsPerPage = { secretArguments = "AllowedWhenUntainted" }, - SetThumbTexture = { secretArguments = "AllowedWhenUntainted" }, - SetValue = { secretArguments = "AllowedWhenUntainted" }, - SetValueStep = { secretArguments = "AllowedWhenUntainted" }, - }, - SimpleStatusBarAPI = { - GetFillStyle = { }, - GetInterpolatedValue = { secretAspects = { "BarValue" } }, - GetMinMaxValues = { secretAspects = { "BarValue" } }, - GetOrientation = { }, - GetRenderMode = { }, - GetReverseFill = { }, - GetRotatesTexture = { }, - GetStatusBarColor = { secretAspects = { "VertexColor", "Alpha" } }, - GetStatusBarDesaturation = { secretAspects = { "Desaturation" } }, - GetStatusBarTexture = { }, - GetTimerDuration = { }, - GetValue = { secretAspects = { "BarValue" } }, - IsInterpolating = { secretAspects = { "BarValue" } }, - IsStatusBarDesaturated = { secretAspects = { "Desaturation" } }, - SetColorFill = { secretArguments = "AllowedWhenUntainted" }, - SetFillStyle = { secretArguments = "AllowedWhenUntainted" }, - SetMinMaxValues = { addsAspects = { "BarValue" }, secretArguments = "AllowedWhenTainted" }, - SetOrientation = { secretArguments = "AllowedWhenUntainted" }, - SetRenderMode = { secretArguments = "AllowedWhenUntainted" }, - SetReverseFill = { secretArguments = "AllowedWhenUntainted" }, - SetRotatesTexture = { secretArguments = "AllowedWhenUntainted" }, - SetStatusBarColor = { addsAspects = { "VertexColor", "Alpha" }, secretArguments = "AllowedWhenTainted" }, - SetStatusBarDesaturated = { addsAspects = { "Desaturation" }, secretArguments = "AllowedWhenTainted" }, - SetStatusBarDesaturation = { addsAspects = { "Desaturation" }, secretArguments = "AllowedWhenTainted" }, - SetStatusBarTexture = { secretArguments = "AllowedWhenUntainted" }, - SetTimerDuration = { secretArguments = "AllowedWhenUntainted" }, - SetToTargetValue = { }, - SetValue = { addsAspects = { "BarValue" }, secretArguments = "AllowedWhenTainted" }, - }, - SimpleTextureAPI = { - AddMaskTexture = { secretArguments = "AllowedWhenUntainted" }, - GetMaskTexture = { secretArguments = "AllowedWhenUntainted", secretAspects = { "Hierarchy" } }, - GetNumMaskTextures = { secretAspects = { "Hierarchy" } }, - RemoveMaskTexture = { secretArguments = "AllowedWhenUntainted" }, - }, - SimpleTextureBaseAPI = { - ClearRadialProgressBar = { }, - ClearSVG = { }, - ClearTextureSlice = { }, - ClearVertexOffsets = { }, - GetAtlas = { }, - GetBlendMode = { }, - GetDesaturation = { secretAspects = { "Desaturation" } }, - GetHorizTile = { }, - GetRadialProgressBarEndOffset = { }, - GetRadialProgressBarFeather = { }, - GetRadialProgressBarPercent = { secretAspects = { "RadialProgress" } }, - GetRadialProgressBarReverse = { }, - GetRadialProgressBarStartOffset = { }, - GetRotation = { secretAspects = { "Rotation" } }, - GetTexCoord = { secretAspects = { "TexCoords" } }, - GetTexelSnappingBias = { }, - GetTexture = { }, - GetTextureFileID = { }, - GetTextureFilePath = { }, - GetTextureSliceMargins = { }, - GetTextureSliceMode = { }, - GetVertTile = { }, - GetVertexOffset = { secretArguments = "AllowedWhenUntainted" }, - IsBlockingLoadRequested = { }, - IsDesaturated = { secretAspects = { "Desaturation" } }, - IsSnappingToPixelGrid = { }, - ResetTexCoord = { }, - SetAtlas = { secretArguments = "AllowedWhenTainted" }, - SetBlendMode = { secretArguments = "AllowedWhenUntainted" }, - SetBlockingLoadsRequested = { secretArguments = "AllowedWhenUntainted" }, - SetColorTexture = { secretArguments = "AllowedWhenTainted" }, - SetDesaturated = { addsAspects = { "Desaturation" }, secretArguments = "AllowedWhenTainted" }, - SetDesaturation = { addsAspects = { "Desaturation" }, secretArguments = "AllowedWhenTainted" }, - SetGradient = { secretArguments = "AllowedWhenUntainted" }, - SetHorizTile = { secretArguments = "AllowedWhenUntainted" }, - SetMask = { secretArguments = "AllowedWhenUntainted" }, - SetRadialProgressBarEndOffset = { secretArguments = "AllowedWhenUntainted" }, - SetRadialProgressBarFeather = { secretArguments = "AllowedWhenUntainted" }, - SetRadialProgressBarPercent = { addsAspects = { "RadialProgress" }, secretArguments = "AllowedWhenTainted" }, - SetRadialProgressBarReverse = { secretArguments = "AllowedWhenUntainted" }, - SetRadialProgressBarStartOffset = { secretArguments = "AllowedWhenUntainted" }, - SetRotation = { addsAspects = { "Rotation" }, secretArguments = "AllowedWhenTainted" }, - SetSVG = { secretArguments = "AllowedWhenTainted" }, - SetSnapToPixelGrid = { secretArguments = "AllowedWhenUntainted" }, - SetSpriteSheetCell = { addsAspects = { "TexCoords" }, secretArguments = "AllowedWhenTainted" }, - SetTexCoord = { addsAspects = { "TexCoords" }, secretArguments = "AllowedWhenTainted" }, - SetTexelSnappingBias = { secretArguments = "AllowedWhenUntainted" }, - SetTexture = { secretArguments = "AllowedWhenTainted" }, - SetTextureSliceMargins = { secretArguments = "AllowedWhenUntainted" }, - SetTextureSliceMode = { secretArguments = "AllowedWhenUntainted" }, - SetVertTile = { secretArguments = "AllowedWhenUntainted" }, - SetVertexOffset = { secretArguments = "AllowedWhenUntainted" }, - }, - UnitHealPredictionCalculatorAPI = { - EvaluateCurrentHealthPercent = { secretArguments = "AllowedWhenUntainted" }, - EvaluateMissingHealthPercent = { secretArguments = "AllowedWhenUntainted" }, - GetCurrentHealth = { }, - GetCurrentHealthPercent = { }, - GetDamageAbsorbClampMode = { }, - GetDamageAbsorbs = { }, - GetHealAbsorbClampMode = { }, - GetHealAbsorbMode = { }, - GetHealAbsorbs = { }, - GetIncomingHealClampMode = { }, - GetIncomingHealOverflowPercent = { }, - GetIncomingHeals = { }, - GetMaximumDamageAbsorbs = { }, - GetMaximumHealAbsorbs = { }, - GetMaximumHealth = { }, - GetMaximumHealthMode = { }, - GetMaximumIncomingHeals = { }, - GetMissingHealth = { }, - GetMissingHealthPercent = { }, - GetPredictedValues = { }, - GetTotalDamageAbsorbs = { }, - GetTotalHealAbsorbs = { }, - GetTotalIncomingHeals = { }, - GetTotalIncomingHealsFromHealer = { }, - HasSecretValues = { }, - Reset = { }, - ResetPredictedValues = { }, - SetDamageAbsorbClampMode = { secretArguments = "NotAllowed" }, - SetHealAbsorbClampMode = { secretArguments = "NotAllowed" }, - SetHealAbsorbMode = { secretArguments = "NotAllowed" }, - SetIncomingHealClampMode = { secretArguments = "NotAllowed" }, - SetIncomingHealOverflowPercent = { secretArguments = "NotAllowed" }, - SetMaximumHealthMode = { secretArguments = "NotAllowed" }, - SetPredictedValues = { secretArguments = "AllowedWhenUntainted" }, - SetToDefaults = { }, - }, - }, - lua = { - auraFilters = { - BIG_DEFENSIVE = true, - CANCELABLE = true, - CROWD_CONTROL = true, - DISPELLABLE = true, - EXTERNAL_DEFENSIVE = true, - HARMFUL = true, - HELPFUL = true, - IMPORTANT = true, - INCLUDE_NAME_PLATE_ONLY = true, - MAW = true, - PLAYER = true, - RAID = true, - RAID_IN_COMBAT = true, - RAID_PLAYER_DISPELLABLE = true, - }, - called = { - [":Assign"] = "Interface/AddOns/Blizzard_AuraContainer/Blizzard_CustomAuraButton.lua", - [":CreateAnimation"] = "Interface/AddOns/Blizzard_HelpPlate/Blizzard_HelpPlate.lua", - [":CreateAnimationGroup"] = "Interface/AddOns/Blizzard_HelpPlate/Blizzard_HelpPlate.lua", - [":CreateButton"] = "Interface/AddOns/Blizzard_AddOnList/AddonList.lua", - [":CreateCheckbox"] = "Interface/AddOns/Blizzard_AuctionHouseUI/Shared/Blizzard_AuctionHouseSearchBar.lua", - [":CreateFontString"] = "Interface/AddOns/Blizzard_DebugTools/Blizzard_TexelSnappingVisualizer.lua", - [":CreateLine"] = "Interface/AddOns/Blizzard_EditMode/Shared/EditModeUtil.lua", - [":CreateRadio"] = "Interface/AddOns/Blizzard_AchievementUI/Cata/Blizzard_AchievementUI.lua", - [":CreateTexture"] = "Interface/AddOns/Blizzard_ActionBar/WoWLabs/ActionButtonOverrides.lua", - [":CreateTitle"] = "Interface/AddOns/Blizzard_AddOnList/AddonList.lua", - [":Evaluate"] = "Interface/AddOns/Blizzard_EncounterTimeline/EncounterTimelineTimerEvent.lua", - [":GetAlpha"] = "Interface/AddOns/Blizzard_AdventureMap/Blizzard_AdventureMapInset.lua", - [":GetEffectiveAlpha"] = "Interface/AddOns/Blizzard_HousingMarketCart/Blizzard_HousingMarketCartTemplates.lua", - [":GetMinMaxValues"] = "Interface/AddOns/Blizzard_AchievementUI/Cata/Blizzard_AchievementUI.lua", - [":GetSmoothProgress"] = "Interface/AddOns/Blizzard_BuffFrame/BuffFrame.lua", - [":GetStringWidth"] = "Interface/AddOns/Blizzard_AchievementUI/Cata/Blizzard_AchievementUI.lua", - [":HookScript"] = "Interface/AddOns/Blizzard_AddOnList/AddonList.lua", - [":IsEventRegistered"] = "Interface/AddOns/Blizzard_ChatFrameBase/Mainline/ChatFrameOverrides.lua", - [":LockHighlight"] = "Interface/AddOns/Blizzard_AccountStore/Blizzard_AccountStoreCardTemplates.lua", - [":RegisterForClicks"] = "Interface/AddOns/Blizzard_ActionBar/Shared/ActionButton.lua", - [":RegisterForDrag"] = "Interface/AddOns/Blizzard_ActionBar/Shared/ActionButton.lua", - [":RegisterUnitEvent"] = "Interface/AddOns/Blizzard_ActionBar/Shared/ActionButton.lua", - [":SetColorTexture"] = "Interface/AddOns/Blizzard_AdventureMap/Blizzard_AdventureMap.lua", - [":SetDesaturation"] = "Interface/AddOns/Blizzard_ArtifactUI/Blizzard_ArtifactPerks.lua", - [":SetDrawBling"] = "Interface/AddOns/Blizzard_Transmog/Blizzard_Transmog.lua", - [":SetDrawEdge"] = "Interface/AddOns/Blizzard_CooldownViewer/CooldownViewer.lua", - [":SetDrawSwipe"] = "Interface/AddOns/Blizzard_Commentator/Classic/Blizzard_CommentatorSpell.lua", - [":SetFixedFrameLevel"] = "Interface/AddOns/Blizzard_SharedTalentUI/Blizzard_SharedTalentFrame.lua", - [":SetFixedFrameStrata"] = "Interface/AddOns/Blizzard_UnitFrame/Shared/PlayerFrame.lua", - [":SetHighlightTexture"] = "Interface/AddOns/Blizzard_ActionBar/Shared/VehicleLeaveButton.lua", - [":SetIgnoreParentAlpha"] = "Interface/AddOns/Blizzard_GamepadActionBars/PageUnit.lua", - [":SetMouseClickEnabled"] = "Interface/AddOns/Blizzard_CatalogShopSharedTemplates/Blizzard_CatalogShop_SharedProductCards.lua", - [":SetMouseMotionEnabled"] = "Interface/AddOns/Blizzard_CooldownViewer/CooldownViewer.lua", - [":SetReverse"] = "Interface/AddOns/Blizzard_UIWidgets/Blizzard_UIWidgetTemplateBase.lua", - [":SetRolesets"] = "Interface/AddOns/Blizzard_ChatFrameBase/Mainline/FloatingChatFrame.lua", - [":SetStatusBarTexture"] = "Interface/AddOns/Blizzard_Contribution/Blizzard_Contribution.lua", - [":SetTexCoord"] = "Interface/AddOns/Blizzard_AchievementUI/Cata/Blizzard_AchievementUI.lua", - [":SetTextureSliceMargins"] = "Interface/AddOns/Blizzard_AuraContainer/Blizzard_AuraContainerUtil.lua", - [":SetTextureSliceMode"] = "Interface/AddOns/Blizzard_AuraContainer/Blizzard_AuraContainerUtil.lua", - [":SetTimerDuration"] = "Interface/AddOns/Blizzard_AuraContainer/Blizzard_CustomAuraButton.lua", - [":UnlockHighlight"] = "Interface/AddOns/Blizzard_AccountStore/Blizzard_AccountStoreCardTemplates.lua", - [":byte"] = "Interface/AddOns/Blizzard_SharedXMLBase/AnchorUtil.lua", - [":callback"] = "Interface/AddOns/Blizzard_ChatFrame/Shared/TextToSpeechCommands.lua", - [":find"] = "Interface/AddOns/Blizzard_AddOnList/AddonList.lua", - [":format"] = "Interface/AddOns/Blizzard_AccountStore/Blizzard_AccountStoreCardTemplates.lua", - [":gmatch"] = "Interface/AddOns/Blizzard_Console/Blizzard_Console.lua", - [":gsub"] = "Interface/AddOns/Blizzard_ChatFrame/Shared/TextToSpeechCommands.lua", - [":lower"] = "Interface/AddOns/Blizzard_AccountStore/Blizzard_AccountStoreCardTemplates.lua", - [":match"] = "Interface/AddOns/Blizzard_ChatFrame/Shared/TextToSpeechFrame.lua", - [":new"] = "Interface/AddOns/Blizzard_BoostTutorial/Blizzard_TutorialLogic.lua", - [":sub"] = "Interface/AddOns/Blizzard_AutoComplete/AutoComplete.lua", - [":update"] = "Interface/AddOns/Blizzard_GroupFinder/Mainline/PVEFrame.lua", - API = "Interface/AddOns/Blizzard_ObjectAPI/Mainline/AsyncCallbackSystem.lua", - AddPoint = "Interface/AddOns/Blizzard_LegacySystem/Blizzard_LegacySystem.lua", - BOTTOMRIGHT = "Interface/AddOns/Blizzard_Settings_Shared/Blizzard_ImplementationReadme.lua", - BUTTON = "Interface/AddOns/Blizzard_Settings_Shared/Blizzard_Keybindings.lua", - Chain = "Interface/AddOns/Blizzard_PTRFeedback/Blizzard_Reports.lua", - ClearText = "Interface/AddOns/Blizzard_PlayerSpells/Blizzard_PlayerSpellsFrame.lua", - CreateButton = "Interface/AddOns/Blizzard_CooldownViewer/CooldownViewerUtil.lua", - CreateContextMenu = "Interface/AddOns/Blizzard_Collections/Classic/Blizzard_MountCollection.lua", - CreateFont = "Interface/AddOns/Blizzard_SharedXML/FontableFrameMixin.lua", - CreateFrame = "Interface/AddOns/Blizzard_AccountStore/Blizzard_AccountStoreItemDisplay.lua", - CreateLine = "Interface/AddOns/Blizzard_MapCanvas/MapCanvas_ScrollContainerMixin.lua", - CreateRadio = "Interface/AddOns/Blizzard_FriendsFrame/Camelot/FriendsFrame.lua", - Factory = "Interface/AddOns/Blizzard_Menu/Menu.lua", - GenerateMenu = "Interface/AddOns/Blizzard_Menu/11_0_0_MenuImplementationGuide.lua", - GetHeight = "Interface/AddOns/Blizzard_ObjectiveTracker/Blizzard_ObjectiveTrackerBlock.lua", - GetMacroInfo = "Interface/AddOns/Blizzard_ClickBindingUI/Blizzard_ClickBindingUI.lua", - GetName = "Interface/AddOns/Blizzard_ItemUpgradeUI/Mainline/Blizzard_ItemUpgradeUI.lua", - GetNumGroupMembers = "Interface/AddOns/Blizzard_Calendar/Mainline/Blizzard_Calendar.lua", - GetNumMacros = "Interface/AddOns/Blizzard_MacroUI/Blizzard_MacroIconSelector.lua", - GetRaidRosterInfo = "Interface/AddOns/Blizzard_CompactRaidFrames/Blizzard_CompactRaidFrameContainer.lua", - GetSize = "Interface/AddOns/Blizzard_SharedXML/LayoutFrame.lua", - GetSpellCooldown = "Interface/AddOns/Blizzard_Deprecated/11_0_0_SpellBookAPITransitionGuide.lua", - GetSpellDescription = "Interface/AddOns/Blizzard_Deprecated/11_0_0_SpellBookAPITransitionGuide.lua", - GetSpellInfo = "Interface/AddOns/Blizzard_Collections/Classic/Blizzard_MountCollection.lua", - GetText = "Interface/AddOns/Blizzard_AchievementUI/Cata/Blizzard_AchievementUI.lua", - GetUnitPvPIndicatorDisplayInfo = "Interface/AddOns/Blizzard_UnitFrame/Shared/UnitFrameUtil.lua", - GetValue = "Interface/AddOns/Blizzard_SettingsDefinitions_Frame/Accessibility.lua", - IsInGroup = "Interface/AddOns/Blizzard_Calendar/Mainline/Blizzard_Calendar.lua", - IsInRaid = "Interface/AddOns/Blizzard_Calendar/Mainline/Blizzard_Calendar.lua", - IsSpellInRange = "Interface/AddOns/Blizzard_Deprecated/11_0_0_SpellBookAPITransitionGuide.lua", - IsSpellKnown = "Interface/AddOns/Blizzard_DeprecatedSpellBook/Deprecated_SpellBook.lua", - OnEvent = "Interface/AddOns/Blizzard_FrameXMLBase/PlayerMovementFrameFader.lua", - OnHide = "Interface/AddOns/Blizzard_SettingsDefinitions_Shared/Subtitles.lua", - Play = "Interface/AddOns/Blizzard_FrameEffects/EffectFactory.lua", - SetAtlas = "Interface/AddOns/Blizzard_EncounterJournal/Mainline/Blizzard_MonthlyActivities.lua", - SetDataProvider = "Interface/AddOns/Blizzard_SharedXML/Shared/Scroll/ScrollBoxListView.lua", - SetParent = "Interface/AddOns/Blizzard_Menu/Menu.lua", - SetPoint = "Interface/AddOns/Blizzard_Menu/Menu.lua", - SetScrollPercentage = "Interface/AddOns/Blizzard_SharedXML/Shared/Scroll/ScrollBar.lua", - SetText = "Interface/AddOns/Blizzard_UIWidgets/Blizzard_UIWidgetTemplateBase.lua", - SetValue = "Interface/AddOns/Blizzard_SettingsDefinitions_Frame/Accessibility.lua", - SetupTextureCoordinates = "Interface/AddOns/Blizzard_SharedXML/NineSlice.lua", - Show = "Interface/AddOns/Blizzard_EncounterWarnings/EncounterWarningsView.lua", - T = "Interface/AddOns/Blizzard_ProfessionsTemplates/Blizzard_ProfessionsRecipeSchematicForm.lua", - TOPLEFT = "Interface/AddOns/Blizzard_Settings_Shared/Blizzard_ImplementationReadme.lua", - UnitHasIncomingResurrection = "Interface/AddOns/Blizzard_UnitFrame/Shared/CompactUnitFrame.lua", - Warrior = "Interface/AddOns/Blizzard_BoostTutorial/Blizzard_TutorialRacialData.lua", - action = "Interface/AddOns/Blizzard_SharedXML/ScriptedAnimations/ScriptAnimatedModelScene.lua", - active = "Interface/AddOns/Blizzard_GamepadActionBars/PageUnit.lua", - addons = "Interface/AddOns/Blizzard_CombatAudioAlerts/Blizzard_CombatAudioAlertManager.lua", - after = "Interface/AddOns/Blizzard_RestrictedAddOnEnvironment/SecureAuraHeader.lua", - anchor = "Interface/AddOns/Blizzard_SharedXML/Mainline/UIDropDownMenu.lua", - are = "Interface/AddOns/Blizzard_SharedXML/CustomBindingButtonMixin.lua", - atlases = "Interface/AddOns/Blizzard_UnitFrame/Mainline/PowerBarColorUtil.lua", - aura = "Interface/AddOns/Blizzard_FrameXML/SharedPetBattleTemplates.lua", - before = "Interface/AddOns/Blizzard_RestrictedAddOnEnvironment/SecureAuraHeader.lua", - button = "Interface/AddOns/Blizzard_GlueXML/Mainline/CharacterServicesShared.lua", - buttons = "Interface/AddOns/Blizzard_LFGUtil/Mainline/PvpPopup.lua", - call = "Interface/AddOns/Blizzard_AuraContainer/Blizzard_AuraContainerUtil.lua", - callback = "Interface/AddOns/Blizzard_AuctionHouseUI/Shared/Blizzard_AuctionHouseFrame.lua", - called = "Interface/AddOns/Blizzard_Menu/11_0_0_MenuImplementationGuide.lua", - change = "Interface/AddOns/Blizzard_DelvesDifficultyPicker/Blizzard_DelvesDifficultyPicker.lua", - channels = "Interface/AddOns/Blizzard_Channels/Classic/ChannelButton.lua", - character = "Interface/AddOns/Blizzard_UIParentPanelManager/Shared/UIParentPanelManager.lua", - chat = "Interface/AddOns/Blizzard_AutoComplete/AutoComplete.lua", - checked = "Interface/AddOns/Blizzard_SharedXML/Mainline/UIDropDownMenu.lua", - children = "Interface/AddOns/Blizzard_GamepadSmartNavigation/Utility.lua", - click = "Interface/AddOns/Blizzard_GamepadSharedUtility/InputHandlers/InputButtonUtility.lua", - color = "Interface/AddOns/Blizzard_Menu/MenuTemplates.lua", - column = "Interface/AddOns/Blizzard_RestrictedAddOnEnvironment/SecureGroupHeaders.lua", - comparison = "Interface/AddOns/Blizzard_GarrisonUI/Mainline/Blizzard_GarrisonShipyardUI.lua", - condition = "Interface/AddOns/Blizzard_AuctionHouseUI/Shared/Blizzard_AuctionHouseItemList.lua", - content = "Interface/AddOns/Blizzard_NamePlates/Blizzard_NamePlateConstants.lua", - coords = "Interface/AddOns/Blizzard_ArtifactUI/Blizzard_ArtifactPerks.lua", - create = "Interface/AddOns/Blizzard_RestrictedAddOnEnvironment/SecureGroupHeaders.lua", - data = "Interface/AddOns/Blizzard_StaticPopup_Glue/Mainline/GlueDialogDefs.lua", - dataProvider = "Interface/AddOns/Blizzard_SharedXML/TableBuilder.lua", - def = "Interface/AddOns/Blizzard_RestrictedAddOnEnvironment/RestrictedExecution.lua", - design = "Interface/AddOns/Blizzard_PagedContent/Blizzard_PagedContentFrame.lua", - direction = "Interface/AddOns/Blizzard_GamepadSmartNavigation/Utility.lua", - dispel = "Interface/AddOns/Blizzard_FrameXMLUtil/AuraUtil.lua", - event = "Interface/AddOns/Blizzard_GamepadActionBars/GamepadOverrideBarMixin.lua", - exist = "Interface/AddOns/Blizzard_FrameXML/SharedPetBattleTemplates.lua", - first = "Interface/AddOns/Blizzard_GamepadSharedUtility/InputBindingStack/BindingSetFactory.lua", - flow = "Interface/AddOns/Blizzard_Channels/Mainline/ChannelFrame.lua", - fn = "Interface/AddOns/Blizzard_GamepadActionBars/TargetActionBars/Shared.lua", - formatter = "Interface/AddOns/Blizzard_SharedXML/Shared/Slider/MinimalSlider.lua", - func = "Interface/AddOns/Blizzard_AchievementUI/Cata/Blizzard_AchievementUI.lua", - functions = "Interface/AddOns/Blizzard_CombatAudioAlerts/Blizzard_CombatAudioAlertManager.lua", - generator = "Interface/AddOns/Blizzard_SharedXMLBase/FunctionUtil.lua", - geterrorhandler = "Interface/AddOns/Blizzard_PrintHandler/Blizzard_PrintHandler.lua", - group = "Interface/AddOns/Blizzard_RestrictedAddOnEnvironment/SecureGroupHeaders.lua", - h = "Interface/AddOns/Blizzard_CombatLog/Mainline/Blizzard_CombatLog.lua", - headers = "Interface/AddOns/Blizzard_GroupFinder/Shared/LFGFrame.lua", - hide = "Interface/AddOns/Blizzard_CombatLog/Mainline/Blizzard_CombatLog.lua", - icon = "Interface/AddOns/Blizzard_Gamepad/UI/Radials/GamepadRadial.lua", - index = "Interface/AddOns/Blizzard_PlayerSpells/ClassTalents/Blizzard_ClassTalentImportExport.lua", - info = "Interface/AddOns/Blizzard_GlueXML/Mainline/CharacterSelect/CharacterSelectUtil.lua", - initializer = "Interface/AddOns/Blizzard_Menu/Menu.lua", - isSelected = "Interface/AddOns/Blizzard_LegacySystem/Blizzard_LegacyChallenges.lua", - it = "Interface/AddOns/Blizzard_GamepadSmartNavigation/Utility.lua", - key = "Interface/AddOns/Blizzard_GamepadSharedUtility/InputBindingStack/BindingSetFactory.lua", - label = "Interface/AddOns/Blizzard_GamepadSharedUtility/PromptedBindings/PromptedBinding.lua", - layout = "Interface/AddOns/Blizzard_CooldownViewer/CooldownViewerSettingsDialogs.lua", - left = "Interface/AddOns/Blizzard_UIPanels_Game/Mainline/EventScheduler.lua", - like = "Interface/AddOns/Blizzard_SharedXMLBase/TableUtil.lua", - menu = "Interface/AddOns/Blizzard_GroupFinder_VanillaStyle/Blizzard_LFGVanilla_Browse.lua", - method = "Interface/AddOns/Blizzard_LegacySystem/Blizzard_LegacySystemUtil.lua", - mode = "Interface/AddOns/Blizzard_EncounterTimeline/EncounterTimelineEventFrame.lua", - model = "Interface/AddOns/Blizzard_SharedXML/ModelSceneActorMixin.lua", - n = "Interface/AddOns/Blizzard_Console/Blizzard_Console.lua", - name = "Interface/AddOns/Blizzard_Deprecated/11_0_0_SpellBookAPITransitionGuide.lua", - names = "Interface/AddOns/Blizzard_RestrictedAddOnEnvironment/SecureGroupHeaders.lua", - offset = "Interface/AddOns/Blizzard_SharedXML/Blizzard_RadialWheel.lua", - offsets = "Interface/AddOns/Blizzard_SharedXML/NineSlice.lua", - one = "Interface/AddOns/Blizzard_HousingDashboard/Blizzard_HousingDashboardInitiatives.lua", - options = "Interface/AddOns/Blizzard_Menu/11_0_0_MenuImplementationGuide.lua", - order = "Interface/AddOns/Blizzard_RestrictedAddOnEnvironment/SecureAuraHeader.lua", - out = "Interface/AddOns/Blizzard_DeclensionFrame/Mainline/DeclensionFrame.lua", - pass = "Interface/AddOns/Blizzard_SharedXML/MixinUtil.lua", - piece = "Interface/AddOns/Blizzard_SharedXML/NineSlice.lua", - pieces = "Interface/AddOns/Blizzard_SharedXML/NineSlice.lua", - player = "Interface/AddOns/Blizzard_CooldownViewer/CooldownViewerAlert.lua", - points = "Interface/AddOns/Blizzard_EncounterJournal/Mainline/Blizzard_MonthlyActivities.lua", - policy = "Interface/AddOns/Blizzard_SharedXMLGame/Mainline/Localization.lua", - prefix = "Interface/AddOns/Blizzard_FrameXMLUtil/AuraUtil.lua", - raid = "Interface/AddOns/Blizzard_RaidUI/Mainline/Blizzard_RaidUI.lua", - realm = "Interface/AddOns/Blizzard_StaticPopup_Game/GameDialogDefs.lua", - region = "Interface/AddOns/Blizzard_Menu/11_0_0_MenuImplementationGuide.lua", - right = "Interface/AddOns/Blizzard_SharedXML/Mainline/UIDropDownMenu.lua", - s = "Interface/AddOns/Blizzard_ArchaeologyUI/Blizzard_ArchaeologyUI.lua", - securecallfunction = "Interface/AddOns/Blizzard_ActionBar/Shared/ActionButton.lua", - self = "Interface/AddOns/Blizzard_FrameXML/SharedPetBattleTemplates.lua", - set = "Interface/AddOns/Blizzard_CombatLogProcessor/Blizzard_CombatLogProcessor.lua", - spacing = "Interface/AddOns/Blizzard_SharedXMLBase/RegionLayoutManager.lua", - spell = "Interface/AddOns/Blizzard_StableUI/Standard/Blizzard_StableUI.lua", - standard = "Interface/AddOns/Blizzard_Calendar/Mainline/Blizzard_Calendar.lua", - strlenutf8 = "Interface/AddOns/Blizzard_AutoComplete/AutoComplete.lua", - style = "Interface/AddOns/Blizzard_SharedXMLGame/Tooltip/TooltipDataHandler.lua", - target = "Interface/AddOns/Blizzard_PetBattleUI/Shared/Blizzard_PetBattleUI.lua", - text = "Interface/AddOns/Blizzard_ChatFrame/Mainline/ChatConfigFrame.lua", - texture = "Interface/AddOns/Blizzard_GamepadActionBars/MainActionBarFrame.lua", - the = "Interface/AddOns/Blizzard_AsyncRequest/Blizzard_AsyncRequest.lua", - them = "Interface/AddOns/Blizzard_UIPanels_Game/Shared/TaxiFrame.lua", - time = "Interface/AddOns/Blizzard_ChatFrameBase/Mainline/ChatFrameOverrides.lua", - title = "Interface/AddOns/Blizzard_Colors/Mainline/ColorManager.lua", - to = "Interface/AddOns/Blizzard_Kiosk/BlizzCon2026/ColdSwap.lua", - top = "Interface/AddOns/Blizzard_SharedXML/HybridScrollFrame.lua", - types = "Interface/AddOns/Blizzard_Menu/11_0_0_MenuImplementationGuide.lua", - unit = "Interface/AddOns/Blizzard_GamepadActionBars/PageUnit.lua", - up = "Interface/AddOns/Blizzard_ObjectiveTracker/Blizzard_ObjectiveTrackerModule.lua", - update = "Interface/AddOns/Blizzard_CooldownViewer/CooldownViewerItemData.lua", - updates = "Interface/AddOns/Blizzard_UIPanels_Game/Mainline/UnitPositionFrameTemplates.lua", - v = "Interface/AddOns/Blizzard_SharedXMLBase/TableUtil.lua", - value = "Interface/AddOns/Blizzard_GamepadSharedUtility/InputBindingStack/InputBindingManager.lua", - with = "Interface/AddOns/Blizzard_SharedXML/MoneyFormatter.lua", - x = "Interface/AddOns/Blizzard_SettingsDefinitions_Shared/Graphics.lua", - }, - globals = { - AnchorUtil = "Interface/AddOns/Blizzard_SharedXMLBase/AnchorUtil.lua", - ["AnchorUtil.ApplyFlowLayout"] = "Interface/AddOns/Blizzard_SharedXMLBase/AnchorUtil.lua", - ["AnchorUtil.CreateFlowLayout"] = "Interface/AddOns/Blizzard_SharedXMLBase/AnchorUtil.lua", - AuraContainerInbound = "Interface/AddOns/Blizzard_AuraContainer/Blizzard_AuraContainerInbound.lua", - ["AuraContainerInbound.GetDefaultAuraDurationFormatter"] = "Interface/AddOns/Blizzard_AuraContainer/Blizzard_AuraContainerInbound.lua", - AuraUtil = "Interface/AddOns/Blizzard_FrameXMLUtil/AuraUtil.lua", - ["AuraUtil.GetAuraBorderColor"] = "Interface/AddOns/Blizzard_FrameXMLUtil/AuraUtil.lua", - ["AuraUtil.IsValidFilterString"] = "Interface/AddOns/Blizzard_FrameXMLUtil/AuraUtil.lua", - ["AuraUtil.SetDataProvider"] = "Interface/AddOns/Blizzard_FrameXMLUtil/AuraUtil.lua", - BackdropTemplateMixin = "Interface/AddOns/Blizzard_SharedXML/Backdrop.lua", - ["BackdropTemplateMixin.ClearBackdrop"] = "Interface/AddOns/Blizzard_SharedXML/Backdrop.lua", - ["BackdropTemplateMixin.GetBackdrop"] = "Interface/AddOns/Blizzard_SharedXML/Backdrop.lua", - ["BackdropTemplateMixin.GetEdgeSize"] = "Interface/AddOns/Blizzard_SharedXML/Backdrop.lua", - ["BackdropTemplateMixin.SetBackdrop"] = "Interface/AddOns/Blizzard_SharedXML/Backdrop.lua", - ["BackdropTemplateMixin.SetBackdropBorderColor"] = "Interface/AddOns/Blizzard_SharedXML/Backdrop.lua", - ["BackdropTemplateMixin.SetBackdropColor"] = "Interface/AddOns/Blizzard_SharedXML/Backdrop.lua", - ["BackdropTemplateMixin.SetupTextureCoordinates"] = "Interface/AddOns/Blizzard_SharedXML/Backdrop.lua", - BaseScrollBoxEvents = "Interface/AddOns/Blizzard_SharedXML/Shared/Scroll/ScrollBox.lua", - ["C_SpellBook.GetOverrideSpell"] = "Interface/AddOns/Blizzard_Deprecated/11_0_0_SpellBookAPITransitionGuide.lua", - ["C_SpellBook.GetSpellInfo"] = "Interface/AddOns/Blizzard_Deprecated/11_0_0_SpellBookAPITransitionGuide.lua", - CallbackRegistryMixin = "Interface/AddOns/Blizzard_SharedXMLBase/CallbackRegistry.lua", - ["CallbackRegistryMixin.RegisterCallback"] = "Interface/AddOns/Blizzard_SharedXMLBase/CallbackRegistry.lua", - CreateColor = "Interface/AddOns/Blizzard_SharedXMLBase/Color.lua", - CreateDataProvider = "Interface/AddOns/Blizzard_SharedXML/DataProvider.lua", - CreateScrollBoxLinearView = "Interface/AddOns/Blizzard_SharedXML/Shared/Scroll/ScrollBoxLinearView.lua", - CreateScrollBoxListLinearView = "Interface/AddOns/Blizzard_SharedXML/Shared/Scroll/ScrollBoxLinearView.lua", - CreateSecureDelegate = "Interface/AddOns/Blizzard_EnvironmentCleanup/Mainline/EnvironmentCleanup.lua", - DifficultyUtil = "Interface/AddOns/Blizzard_FrameXMLUtil/Mainline/DifficultyUtil_Base.lua", - ["DifficultyUtil.GetCreatureDifficultyColor"] = "Interface/AddOns/Blizzard_FrameXMLUtil/Mainline/DifficultyUtil.lua", - ["DifficultyUtil.GetDifficultyColor"] = "Interface/AddOns/Blizzard_FrameXMLUtil/Mainline/DifficultyUtil.lua", - GetClassColor = "Interface/AddOns/Blizzard_SharedXML/ColorUtil.lua", - GetCreatureDifficultyColor = "Interface/AddOns/Blizzard_FrameXMLUtil/Mainline/DifficultyUtil.lua", - GetDifficultyColor = "Interface/AddOns/Blizzard_FrameXMLUtil/Mainline/DifficultyUtil.lua", - LOCALIZED_CLASS_NAMES_MALE = "Interface/AddOns/Blizzard_FrameXMLBase/Cata/Constants.lua", - MenuUtil = "Interface/AddOns/Blizzard_Menu/MenuUtil.lua", - ["MenuUtil.CreateButton"] = "Interface/AddOns/Blizzard_Menu/MenuUtil.lua", - ["MenuUtil.CreateCheckbox"] = "Interface/AddOns/Blizzard_Menu/MenuUtil.lua", - ["MenuUtil.CreateContextMenu"] = "Interface/AddOns/Blizzard_Menu/MenuUtil.lua", - ["MenuUtil.CreateFrame"] = "Interface/AddOns/Blizzard_Menu/MenuUtil.lua", - ["MenuUtil.CreateRadio"] = "Interface/AddOns/Blizzard_Menu/MenuUtil.lua", - ["MenuUtil.CreateTitle"] = "Interface/AddOns/Blizzard_Menu/MenuUtil.lua", - ["Minimap.timer"] = "Interface/AddOns/Blizzard_Minimap/Mainline/Minimap.lua", - PlayerSpellsUtil = "Interface/AddOns/Blizzard_FrameXMLUtil/Mainline/PlayerSpellsUtil.lua", - ["PlayerSpellsUtil.OpenToSpellBookTab"] = "Interface/AddOns/Blizzard_FrameXMLUtil/Mainline/PlayerSpellsUtil.lua", - QuestDifficultyColors = "Interface/AddOns/Blizzard_FrameXMLBase/Constants.lua", - RAID_CLASS_COLORS = "Interface/AddOns/Blizzard_SharedXML/ClassColors.lua", - RegisterAttributeDriver = "Interface/AddOns/Blizzard_RestrictedAddOnEnvironment/SecureStateDriver.lua", - RegisterStateDriver = "Interface/AddOns/Blizzard_RestrictedAddOnEnvironment/SecureStateDriver.lua", - RegisterUnitWatch = "Interface/AddOns/Blizzard_RestrictedAddOnEnvironment/SecureStateDriver.lua", - Round = "Interface/AddOns/Blizzard_SharedXMLBase/MathUtil.lua", - ScrollUtil = "Interface/AddOns/Blizzard_SharedXML/Shared/Scroll/ScrollUtil.lua", - ["ScrollUtil.InitScrollBoxListWithScrollBar"] = "Interface/AddOns/Blizzard_SharedXML/Shared/Scroll/ScrollUtil.lua", - ["ScrollUtil.InitScrollBoxWithScrollBar"] = "Interface/AddOns/Blizzard_SharedXML/Shared/Scroll/ScrollUtil.lua", - ["ScrollUtil.RegisterScrollBoxWithScrollBar"] = "Interface/AddOns/Blizzard_SharedXML/Shared/Scroll/ScrollUtil.lua", - ScrollingEditBoxMixin = "Interface/AddOns/Blizzard_SharedXML/Shared/Scroll/ScrollTemplates.lua", - ["ScrollingEditBoxMixin.ClearFocus"] = "Interface/AddOns/Blizzard_SharedXML/Shared/Scroll/ScrollTemplates.lua", - ["ScrollingEditBoxMixin.ClearText"] = "Interface/AddOns/Blizzard_SharedXML/Shared/Scroll/ScrollTemplates.lua", - ["ScrollingEditBoxMixin.GetEditBox"] = "Interface/AddOns/Blizzard_SharedXML/Shared/Scroll/ScrollTemplates.lua", - ["ScrollingEditBoxMixin.GetInputText"] = "Interface/AddOns/Blizzard_SharedXML/Shared/Scroll/ScrollTemplates.lua", - ["ScrollingEditBoxMixin.GetScrollBox"] = "Interface/AddOns/Blizzard_SharedXML/Shared/Scroll/ScrollTemplates.lua", - ["ScrollingEditBoxMixin.GetText"] = "Interface/AddOns/Blizzard_SharedXML/Shared/Scroll/ScrollTemplates.lua", - ["ScrollingEditBoxMixin.OnShow"] = "Interface/AddOns/Blizzard_SharedXML/Shared/Scroll/ScrollTemplates.lua", - ["ScrollingEditBoxMixin.SetEnabled"] = "Interface/AddOns/Blizzard_SharedXML/Shared/Scroll/ScrollTemplates.lua", - ["ScrollingEditBoxMixin.SetFocus"] = "Interface/AddOns/Blizzard_SharedXML/Shared/Scroll/ScrollTemplates.lua", - ["ScrollingEditBoxMixin.SetFontObject"] = "Interface/AddOns/Blizzard_SharedXML/Shared/Scroll/ScrollTemplates.lua", - ["ScrollingEditBoxMixin.SetText"] = "Interface/AddOns/Blizzard_SharedXML/Shared/Scroll/ScrollTemplates.lua", - ["ScrollingEditBoxMixin.SetTextColor"] = "Interface/AddOns/Blizzard_SharedXML/Shared/Scroll/ScrollTemplates.lua", - SecondsFormatter = "Interface/AddOns/Blizzard_SharedXML/TimeUtil.lua", - SecureHandlerExecute = "Interface/AddOns/Blizzard_RestrictedAddOnEnvironment/SecureHandlers.lua", - SecureHandlerSetFrameRef = "Interface/AddOns/Blizzard_RestrictedAddOnEnvironment/SecureHandlers.lua", - SecureHandlerWrapScript = "Interface/AddOns/Blizzard_RestrictedAddOnEnvironment/SecureHandlers.lua", - SecureStateDriverManager = "Interface/AddOns/Blizzard_RestrictedAddOnEnvironment/SecureStateDriver.lua", - SetCVar = "Interface/AddOns/Blizzard_SharedXMLBase/CvarUtil.lua", - SetRaidTargetIconTexture = "Interface/AddOns/Blizzard_UnitFrame/Mainline/TargetFrame.lua", - ShowMacroFrame = "Interface/AddOns/Blizzard_MacroUI/Blizzard_MacroUI_Bootstrap.lua", - Spell = "Interface/AddOns/Blizzard_ObjectAPI/Mainline/Spell.lua", - UISpecialFrames = "Interface/AddOns/Blizzard_UIParentPanelManager/Shared/UIParentPanelManager.lua", - UnitFrameUtil = "Interface/AddOns/Blizzard_UnitFrame/Shared/UnitFrameUtil.lua", - ["UnitFrameUtil.GetUnitPvPIndicatorDisplayInfo"] = "Interface/AddOns/Blizzard_UnitFrame/Shared/UnitFrameUtil.lua", - UnitFrame_OnEnter = "Interface/AddOns/Blizzard_UnitFrame/Mainline/UnitFrame.lua", - UnitFrame_OnLeave = "Interface/AddOns/Blizzard_UnitFrame/Mainline/UnitFrame.lua", - UnitWatchRegistered = "Interface/AddOns/Blizzard_RestrictedAddOnEnvironment/SecureStateDriver.lua", - UnregisterAttributeDriver = "Interface/AddOns/Blizzard_RestrictedAddOnEnvironment/SecureStateDriver.lua", - UnregisterUnitWatch = "Interface/AddOns/Blizzard_RestrictedAddOnEnvironment/SecureStateDriver.lua", - abs = "Interface/AddOns/Blizzard_SharedXMLBase/Compat.lua", - ceil = "Interface/AddOns/Blizzard_SharedXMLBase/Compat.lua", - class = "Interface/AddOns/middleclass/middleclass.lua", - filter = "Interface/AddOns/Blizzard_RestrictedAddOnEnvironment/SecureAuraHeader.lua", - floor = "Interface/AddOns/Blizzard_SharedXMLBase/Compat.lua", - format = "Interface/AddOns/Blizzard_SharedXMLBase/Compat.lua", - frame = "Interface/AddOns/Blizzard_UIPanels_Game/Shared/PlayerInteractionFrameManager.lua", - gmatch = "Interface/AddOns/Blizzard_SharedXMLBase/Compat.lua", - gsub = "Interface/AddOns/Blizzard_SharedXMLBase/Compat.lua", - max = "Interface/AddOns/Blizzard_SharedXMLBase/Compat.lua", - maxColumns = "Interface/AddOns/Blizzard_RestrictedAddOnEnvironment/SecureGroupHeaders.lua", - min = "Interface/AddOns/Blizzard_SharedXMLBase/Compat.lua", - point = "Interface/AddOns/Blizzard_RestrictedAddOnEnvironment/SecureAuraHeader.lua", - print = "Interface/AddOns/Blizzard_PrintHandler/Blizzard_PrintHandler.lua", - show = "Interface/AddOns/Blizzard_CombatText/Shared/CombatTextConstants.lua", - sort = "Interface/AddOns/Blizzard_SharedXMLBase/Compat.lua", - startingIndex = "Interface/AddOns/Blizzard_RestrictedAddOnEnvironment/SecureGroupHeaders.lua", - strtrim = "Interface/AddOns/Blizzard_SharedXMLBase/Compat.lua", - template = "Interface/AddOns/Blizzard_RestrictedAddOnEnvironment/SecureAuraHeader.lua", - tinsert = "Interface/AddOns/Blizzard_SharedXMLBase/Compat.lua", - unitsPerColumn = "Interface/AddOns/Blizzard_RestrictedAddOnEnvironment/SecureGroupHeaders.lua", - wipe = "Interface/AddOns/Blizzard_SharedXMLBase/Compat.lua", - }, - methods = { - Acquire = "ObjectPoolBaseMixin", - Add = "AccumulatorMixin", - AddAuraAssignedAnimation = "CustomAuraButtonSharedMixin", - AddAuraGroup = "CustomAuraContainerSharedMixin", - AddAuraSlot = "CustomAuraContainerSharedMixin", - AddButton = "ButtonGroupBaseMixin", - AddControl = "BaseButtonTrayMixin", - AddDispelTypeTexture = "CustomAuraButtonSharedMixin", - AddFrame = "ExtraAbilityContainerMixin", - AddGroup = "CompactRaidFrameContainerMixin", - AddInitializer = "BaseMenuDescriptionMixin", - AddLine = "SuppressedPinTooltipContainerMixin", - AddPoint = "CatmullRomSplineMixin", - AddPrivateAuraAnchor = "CompactUnitIndividualPrivateAuraAnchorMixin", - AddRow = "CharacterFrameSidePaneMixin", - Advance = "CharacterServicesFlowMixin", - Apply = "FlowLayoutMixin", - ApplyAuraAssignmentAnimations = "CustomAuraButtonPrivateMixin", - ApplyFlowLayout = "AuraContainerFlowLayoutPrivateMixin", - ApplySize = "ProfessionsSpecPerkMixin", - Arrange = "TableBuilderMixin", - Attach = "BasicContextOptionHandler", - AttachTexture = "CompositorMixin", - Begin = "Class_TutorialBase", - Bind = "InputActionBinding", - Build = "builder", - CallMethod = "HANDLE", - CanEnterEditMode = "EditModeManagerFrameMixin", - Cancel = "AuctionHouseBuyDialogMixin", - Check = "WatchData", - CheckName = "CharacterCreateNameAvailabilityStateMixin", - Clear = "AchievementsObjectivesMixin", - ClearAllHitTestPoints = "NamePlateScriptBaseMixin", - ClearAllPoints = "HANDLE", - ClearBackdrop = "BackdropTemplateMixin", - ClearFocus = "GamepadPopupHandler", - ClearPoints = "CatmullRomSplineMixin", - ClearSelectedSystem = "EditModeManagerFrameMixin", - ClearText = "CommunitiesCreateDialogMixin", - Click = "SmartNavigationMixin", - Close = "ContainerFrameCombinedBagsMixin", - CloseMenu = "DropdownButtonMixin", - Collapse = "AchievementTemplateMixin", - Commit = "KeybindListener", - Count = "AccumulatorMixin", - Create = "AzeriteTierFinalPowerSelectedAnimationMixin", - CreateFrame = "AuraContainerCustomFrameProviderMixin", - CreateLabel = "CurrencyHorizontalLayoutFrameMixin", - CreatePool = "FramePoolCollectionConverterMixin", - Cross = "Vector2DMixin", - Delete = "OpenMailDeleteMixin", - Detach = "BasicContextOptionHandler", - Disable = "ArenaEnemyMatchFramesContainerMixin", - Dot = "Vector2DMixin", - Draw = "LineMixin", - Dump = "ObjectPoolBaseMixin", - Enable = "ArenaEnemyMatchFramesContainerMixin", - EnableMouse = "HANDLE", - EnumerateActive = "ManagedLayoutFrameMixin", - Factory = "ScrollBoxFactoryInitializerMixin", - FadeOut = "ClickToZoomDataProvider_LabelMixin", - Find = "DataProviderMixin", - Finish = "CharacterUpgradeFlow", - Flash = "EventTraceScrollBoxButtonMixin", - FocusFrame = "GamepadFrameControlsManagerMixin", - ForEachFrame = "ActionBarButtonEventsFrameMixin", - Format = "SecondsFormatterMixin", - Free = "ObjectiveTrackerAnimBlockMixin", - FullUpdate = "ClassTalentButtonSelectMixin", - GROUP_ROSTER_UPDATE = "CooldownSyncRelayMixin", - Generate = "BlackColorStyleMenuMixin", - GenerateHexColorMarkup = "ColorMixin", - GenerateMenu = "DropdownButtonMixin", - Get = "AnchorMixin", - GetActiveLayout = "CooldownViewerLayoutManagerMixin", - GetAtlas = "HelpTipCloseButtonMixin", - GetAttribute = "HANDLE", - GetAuraGroupFrame = "CustomAuraContainerSharedMixin", - GetAuraGroupFrameCount = "CustomAuraContainerSharedMixin", - GetBackdrop = "BackdropTemplateMixin", - GetBackground = "DamageMeterEntryMixin", - GetBottom = "RectangleMixin", - GetCenter = "RectangleMixin", - GetChildList = "HANDLE", - GetChildren = "HANDLE", - GetColorAlpha = "ColorPickerFrameMixin", - GetColorRGB = "ColorPickerFrameMixin", - GetContainer = "PrivateAuraAnchorContainerMixin", - GetCursorPosition = "MapCanvasScrollControllerMixin", - GetData = "InitiativeTaskButtonMixin", - GetDefault = "WorldMapFilterMixin", - GetDerivedScrollOffset = "ScrollBoxBaseMixin", - GetDifficultyColor = "NameplateLevelFrameMixin", - GetDrawLayer = "MapExplorationDataProviderMixin", - GetEdgeSize = "BackdropTemplateMixin", - GetEditBox = "ClassTalentLoadoutDialogInputControlMixin", - GetEffectiveScale = "HANDLE", - GetElementSize = "CustomAuraContainerFlowLayoutMixin", - GetFont = "FontableFrameMixin", - GetFontObject = "FontableFrameMixin", - GetFrame = "ClickBindingFramePortraitMixin", - GetFrameLevel = "HANDLE", - GetFrameMagneticEligibility = "EditModeSystemMixin", - GetFrameRef = "HANDLE", - GetHeight = "HANDLE", - GetID = "AuraButtonMixin", - GetIcon = "BaseSpellBookCategoryMixin", - GetInputText = "EventEditBoxMixin", - GetLayouts = "EditModeManagerFrameMixin", - GetLeft = "RectangleMixin", - GetLootMethod = "UnitPopupGroupLootButtonMixin", - GetMagneticFrameInfos = "EditModeMagnetismManager", - GetName = "AdventuresEnemyPuckMixin", - GetNamePlateForUnit = "NamePlateDriverMixin", - GetNumPoints = "CatmullRomSplineMixin", - GetObjectType = "HANDLE", - GetOverallMetric = "AddonListMixin", - GetParent = "AuraContainerCustomFrameProviderMixin", - GetPoint = "CatmullRomSplineMixin", - GetPool = "NamePlateDriverMixin", - GetPosition = "CameraBaseMixin", - GetPower = "RuneforgePowerListMixin", - GetPowerInfo = "RuneforgePowerBaseMixin", - GetRGB = "ColorMixin", - GetRGBA = "ColorMixin", - GetRaidTargetIndex = "NamePlateUnitFrameMixin", - GetRealmName = "TransferRealmEditboxMixin", - GetRect = "HANDLE", - GetRight = "RectangleMixin", - GetRow = "SoulbindTreeNodeMixin", - GetScale = "HANDLE", - GetScaledSelectionCenter = "EditModeSystemMixin", - GetScaledSelectionSides = "EditModeSystemMixin", - GetScript = "InboundContainerFrameMixin", - GetScrollBox = "DamageMeterSessionWindowMixin", - GetScrollPercentage = "ScrollControllerMixin", - GetSize = "AllocationsMixin", - GetSpellCooldown = "CooldownSyncRelayMixin", - GetSpellDescription = "SpellMixin", - GetSpellInfo = "DeathRecapEntryMixin", - GetSpellName = "CustomAuraButtonSharedMixin", - GetState = "BaseHousingActionButtonMixin", - GetStatusBar = "DamageMeterEntryMixin", - GetStatusBarTexture = "DamageMeterEntryMixin", - GetStyle = "DamageMeterEntryMixin", - GetSystemName = "EditModeStatusTrackingBar1SystemMixin", - GetTemplate = "ScrollBoxFactoryInitializerMixin", - GetText = "ClassTalentLoadoutDialogInputControlMixin", - GetTexture = "SpellBookItemMixin", - GetTheme = "CharacterServicesFlowMixin", - GetTop = "RectangleMixin", - GetType = "TransmogLocationMixin", - GetUnit = "AlternatePowerBarBaseMixin", - GetUnitFrame = "CompactRaidFrameContainerMixin", - GetValue = "AccessibilitySettingsPreviewMixin", - GetVertexColor = "VisualAlertBaseMixin", - GetWidth = "HANDLE", - HasValidSelectionRect = "EditModeSystemMixin", - Hide = "EffectFactoryMixin", - HideTooltip = "AuraButtonPrivateMixin", - Init = "AccountNameMixin", - InitButton = "LFGWhoListButtonMixin", - Initialize = "AccountSelectorMixin", - Insert = "BaseMenuDescriptionMixin", - Interrupt = "Class_TutorialBase", - IsAboveFrame = "EditModeSystemMixin", - IsActive = "AuraContainerItemEnchantmentMixin", - IsBelowFrame = "EditModeSystemMixin", - IsElementEnabled = "FlyoutBehaviorMixin", - IsEnabled = "AuraContainerAuraGroupMixin", - IsHorizontallyAlignedWithFrame = "EditModeSystemMixin", - IsInEditMode = "SpellDiminishStatusTrayMixin", - IsKnown = "CooldownViewerItemDataMixin", - IsMouseEnabled = "HANDLE", - IsObjectType = "HANDLE", - IsPlaying = "CustomizationAudioInterfaceMixin", - IsProtected = "HANDLE", - IsQueued = "EncounterTimelineEventIconMixin", - IsShiftKeyDown = "EditModeSystemMixin", - IsShown = "HANDLE", - IsSnapEnabled = "EditModeManagerFrameMixin", - IsSupported = "UnitPopupDungeonDifficulty1ButtonMixin", - IsToTheLeftOfFrame = "EditModeSystemMixin", - IsToTheRightOfFrame = "EditModeSystemMixin", - IsValid = "AzeriteEmpoweredItemDataSourceMixin", - IsVerticallyAlignedWithFrame = "EditModeSystemMixin", - IsVisible = "CampaignMixin", - Layout = "BagsBarMixin", - Leave = "CatalogShopMixin", - Load = "ProfessionsRecipeLoaderMixin", - Loop = "AdventuresFriendlyTargetingIndicatorMixin", - Move = "RectangleMixin", - Name = "Class_TutorialBase", - New = "MapBridgeDataProviderMixin", - Next = "CharacterServicesAutoCompleteButtonMixin", - OnApply = "DecorPetCustomizationMixin", - OnAttributeChanged = "ActionBarActionButtonMixin", - OnCheckButtonClick = "CharacterCreateStartingZoneButtonMixin", - OnClick = "AccountLoginMenuButtonMixin", - OnDragStart = "ActionBarActionButtonMixin", - OnDragStop = "AdventuresMissionPageFollowerPuckMixin", - OnEditFocusGained = "CharacterServicesEditBoxBaseMixin", - OnEditFocusLost = "AuctionHouseAlignedQuantityInputBoxMixin", - OnEnter = "AccountStoreBaseCardMixin", - OnEnterPressed = "AuctionHouseSearchBoxMixin", - OnEscapePressed = "CharacterCreateEditBoxMixin", - OnEvent = "AccountSaveFrameMixin", - OnFinished = "ActionBarOverlayGlowAnimInMixin", - OnHide = "AccountStoreBaseCardMixin", - OnInitialize = "Class_AbilityUse_AbilityReminder", - OnKeyDown = "AddonDialogMixin", - OnLayout = "ObjectiveTrackerAnimBlockMixin", - OnLeave = "AccountStoreBaseCardMixin", - OnLoad = "AbandonHouseConfirmationDialogMixin", - OnMouseDown = "AlliedRacesModelControlButtonMixin", - OnMouseUp = "AchievementDisplayOverviewBulletMixin", - OnMouseWheel = "AccountStoreBaseCardMixin", - OnReceiveDrag = "ActionBarActionButtonMixin", - OnRelease = "NewCosmeticAlertFrameMixin", - OnShow = "AccessibilitySettingsPreviewMixin", - OnSizeChanged = "AccountSaveFrameMixin", - OnSliderValueChanged = "CustomizationOptionSliderMixin", - OnTextChanged = "AuctionHouseQuantityInputBoxMixin", - OnUpdate = "AccountStoreBaseCardMixin", - OnValueChanged = "AnimatedStatusBarMixin", - Open = "FriendsFriendsFrameMixin", - PLAYER_ALIVE = "Class_Death_ReleaseCorpse", - PLAYER_DEAD = "Class_ChangeEquipment", - PLAYER_ENTERING_WORLD = "Class_AbilityWatcher", - PLAYER_LEVEL_UP = "Class_Level3Ability", - PLAYER_REGEN_DISABLED = "Class_AbilityUse_Watcher", - PLAYER_REGEN_ENABLED = "Class_AbilityUse_Watcher", - PLAYER_SPECIALIZATION_CHANGED = "Class_ChangeSpec", - PLAYER_TALENT_UPDATE = "Class_ChangeSpec", - PLAYER_TARGET_CHANGED = "Class_TabTargetingWatcher", - PLAYER_UNGHOST = "Class_Death_MapPrompt", - Pause = "MarchingAntsMixin", - Pick = "DropdownButtonMixin", - Play = "AdventuresFriendlyTargetingIndicatorMixin", - ProcessAura = "PrivateAuraAnchorContainerMixin", - Pulse = "VehicleSeatIndicatorButtonMixin", - Queue = "TutorialManager", - Refresh = "AccountStoreItemRackMixin", - RefreshButton = "ExpansionLandingPageMinimapButtonMixin", - RefreshEvents = "CombatAudioAlertManagerMixin", - RefreshVisibility = "FriendsListSocialCardRAFSummonButtonMixin", - Register = "ScrollBoxDragBehavior", - RegisterAddon = "AddonCompartmentMixin", - RegisterCallback = "CallbackHandleContainerMixin", - RegisterEvent = "Dispatcher", - RegisterEvents = "GenericItemSocketingFrameMixin", - RegisterFrameEventAndCallback = "EventRegistry", - Release = "FrameCloneManager", - ReleaseAll = "FrameCloneManager", - ReleaseAllPools = "OrderHallTalentFrameMixin", - Remove = "DataProviderMixin", - RemoveAuraAssignedAnimation = "CustomAuraButtonSharedMixin", - RemoveDispelTypeTexture = "CustomAuraButtonSharedMixin", - RemovePrivateAuraAnchor = "CompactUnitIndividualPrivateAuraAnchorMixin", - Reset = "AccumulatorMixin", - ResetButton = "MovePadCheckboxMixin", - ResetPosition = "SoftCursorMixin", - Resize = "AddFriendFrameMixin", - Rotate = "DropdownButtonMixin", - Run = "HANDLE", - RunAttribute = "HANDLE", - SPELLS_CHANGED = "Class_AddHunterTameSpells", - SPELL_UPDATE_COOLDOWN = "CooldownSyncRelayMixin", - ScrollToOffset = "ScrollBoxBaseMixin", - Select = "ButtonGroupBaseMixin", - SelectSystem = "EditModeManagerFrameMixin", - Set = "AnchorMixin", - SetActiveStyle = "RPETurnStrafeStyleMixin", - SetAllHitTestPoints = "NamePlateScriptBaseMixin", - SetAllPoints = "HANDLE", - SetAlpha = "HANDLE", - SetAnchorPoint = "FlowLayoutMixin", - SetApplicationCount = "CustomAuraButtonSharedMixin", - SetAtlas = "IconButtonMixin", - SetAttribute = "HANDLE", - SetAuraGroupCandidateFilters = "CustomAuraContainerSharedMixin", - SetAuraGroupEnabled = "AuraContainerAuraGroupManagerMixin", - SetAuraGroupFilterString = "CustomAuraContainerSharedMixin", - SetAuraGroupLayout = "CustomAuraContainerSharedMixin", - SetAuraGroupMaxFrameCount = "CustomAuraContainerSharedMixin", - SetAuraGroupSortMethod = "CustomAuraContainerSharedMixin", - SetAuraProcessingPolicy = "CustomAuraContainerSharedMixin", - SetAuraSlotCandidateFilters = "CustomAuraContainerSharedMixin", - SetAuraSlotEnabled = "AuraContainerAuraSlotManagerMixin", - SetAuraSlotFilterString = "CustomAuraContainerSharedMixin", - SetBackdrop = "BackdropTemplateMixin", - SetBackdropBorderColor = "BackdropTemplateMixin", - SetBackdropColor = "BackdropTemplateMixin", - SetBinding = "HANDLE", - SetBlendMode = "NineSlicePanelMixin", - SetBorderColor = "ColorSwatchMixin", - SetCanRoundUpLastUnit = "SecondsFormatterMixin", - SetCancelAuraButtons = "AuraButtonSharedMixin", - SetChecked = "HouseExteriorCheckboxOptionMixin", - SetColor = "ColorSwatchMixin", - SetColorRGB = "ColorSwatchMixin", - SetCooldown = "CooldownViewerSettingsEditAlertMixin", - SetCursorPosition = "ScrollingEditBoxMixin", - SetDataProvider = "AuctionHouseItemListMixin", - SetDefault = "AdventuresFriendlyTargetingIndicatorMixin", - SetDefaultAbbreviation = "SecondsFormatterMixin", - SetDefaultText = "DropdownSelectionTextMixin", - SetDesaturated = "ItemModelBaseMixin", - SetDesiredUnitCount = "SecondsFormatterMixin", - SetDetails = "DressUpCustomSetDetailsSlotMixin", - SetDrawLayer = "MapExplorationDataProviderMixin", - SetDuration = "AnimatedHealthLossMixin", - SetDurationCooldown = "CustomAuraButtonSharedMixin", - SetDurationText = "CustomAuraButtonSharedMixin", - SetElementExtent = "ScrollBoxListBiaxalViewMixin", - SetElementInitializer = "ScrollBoxListViewMixin", - SetEnabled = "AuraContainerAuraGroupMixin", - SetEndPoint = "LineMixin", - SetExpandedState = "ArtifactTitleTemplateMixin", - SetFlowLayoutAnchorPoint = "AuraContainerFlowLayoutSharedMixin", - SetFlowLayoutAxis = "AuraContainerFlowLayoutSharedMixin", - SetFlowLayoutGrowthDirection = "AuraContainerFlowLayoutSharedMixin", - SetFlowLayoutMaximumLineSize = "AuraContainerFlowLayoutSharedMixin", - SetFlowLayoutPadding = "AuraContainerFlowLayoutSharedMixin", - SetFocus = "HousingCatalogCategoriesMixin", - SetFont = "FontableFrameMixin", - SetFontObject = "FontableFrameMixin", - SetFormattedText = "AutoScalingFontStringMixin", - SetFormatter = "MoneyDenominationDisplayMixin", - SetFrameLevel = "HANDLE", - SetFrameStrata = "HANDLE", - SetGradient = "MarchingAntsMixin", - SetGrowthDirection = "FlowLayoutMixin", - SetHealth = "AdventuresPuckHealthBarMixin", - SetHeight = "HANDLE", - SetHideIfUnscrollable = "ScrollBarMixin", - SetHideTooltipInCombat = "AuraButtonSharedMixin", - SetID = "GamepadHudInfoMixin", - SetIcon = "BasicSegmentHandler", - SetIndex = "CovenantCallingMixin", - SetItems = "AccountStoreItemRackMixin", - SetJustifyH = "FontableFrameMixin", - SetJustifyV = "FontableFrameMixin", - SetLabelColor = "AuctionHouseSellFrameAlignedControlMixin", - SetLayoutAxis = "FlowLayoutMixin", - SetMaximumLineSize = "FlowLayoutMixin", - SetMinInterval = "SecondsFormatterMixin", - SetMinMaxValues = "NumericInputSpinnerMixin", - SetOnClickHandler = "UIButtonMixin", - SetOrder = "ProfessionsCrafterOrderViewMixin", - SetOrientation = "CompactUnitFrameDispelOverlayMixin", - SetOwner = "AzeriteEmpoweredItemTierMixin", - SetPanExtent = "ScrollBoxBaseMixin", - SetParent = "HANDLE", - SetPoint = "AnchorMixin", - SetPosition = "CameraBaseMixin", - SetRGBA = "ColorMixin", - SetRotation = "ModelScenelRotateButtonMixin", - SetScale = "HANDLE", - SetScript = "InboundContainerFrameMixin", - SetScrollMode = "BaseMenuDescriptionMixin", - SetScrollPercentage = "ScrollBarMixin", - SetSelected = "AccountNameMixin", - SetShadowColor = "FontableFrameMixin", - SetShadowOffset = "FontableFrameMixin", - SetShown = "ButtonGroupBaseMixin", - SetSize = "IndexRangeDataProviderMixin", - SetStartDelay = "AnimatedHealthLossMixin", - SetStartPoint = "LineMixin", - SetStatus = "CompactUnitFrameReadyCheckMixin", - SetStatusBarColor = "DamageMeterEntryMixin", - SetStripIntervalWhitespace = "SecondsFormatterMixin", - SetStyle = "ArtifactPowerButtonMixin", - SetTarget = "CharacterServicesFlowMixin", - SetText = "AutoScalingFontStringMixin", - SetTextColor = "FontableFrameMixin", - SetTextInsets = "ScrollingEditBoxMixin", - SetTexture = "AreaPOIEventPinMixin", - SetThickness = "LineMixin", - SetTooltipAnchorPoint = "AuraButtonSharedMixin", - SetType = "ClubFinderOptionsMixin", - SetUnit = "ArenaUnitFrameCcRemoverMixin", - SetValue = "BonusObjectiveTrackerProgressBarMixin", - SetVertexColor = "NamePlateBorderTemplateMixin", - SetVisibility = "AdventuresBoardAuraIconMixin", - SetWidth = "HANDLE", - Setup = "AchievementDisplayOverviewBulletMixin", - SetupColorPickerAndShow = "ColorPickerFrameMixin", - SetupMenu = "ClubFinderFilterDropdownMixin", - SetupTextureCoordinates = "BackdropTemplateMixin", - ShouldShow = "BackpackTokenFrameMixin", - Show = "EffectFactoryMixin", - ShowHighlighted = "EditModeSystemSelectionBaseMixin", - ShowNewLayoutDialog = "EditModeLayoutDialogMixin", - ShowSelected = "EditModeSystemSelectionBaseMixin", - ShowTooltip = "AssistedCombatRotationSpellFrameMixin", - ShowUIPanel = "CooldownViewerSettingsMixin", - Size = "t", - Start = "AnimatedShineMixin", - Status = "Class_TutorialBase", - Stop = "AdventuresFriendlyTargetingIndicatorMixin", - Switch = "CreditsFrameMixin", - Toggle = "BattlefieldMapMixin", - TriggerEvent = "CallbackRegistryMixin", - UNIT_CONNECTION = "CooldownSyncRelayMixin", - UNIT_HEALTH = "Class_LowHealthWatcher", - UNIT_PET = "GamepadFriendlyTargetingActionBarMixin", - UNIT_PORTRAIT_UPDATE = "GamepadFriendlyTargetingActionBarMixin", - UNIT_POWER_FREQUENT = "Class_EnhancedCombatTactics", - UNIT_SPELLCAST_INTERRUPTED = "Class_AbilityUse_Watcher", - UNIT_SPELLCAST_SUCCEEDED = "BoostTutorial", - UNIT_TARGETABLE_CHANGED = "Class_EnhancedCombatTactics_Ranged", - UPDATE_SHAPESHIFT_FORM = "Class_AddSpellToActionBarService", - UPDATE_VEHICLE_ACTIONBAR = "PetSpellFlyoutButtonMixin", - Unbind = "InputAxisBinding", - UnitPower = "WarlockPowerBar", - Unregister = "CallbackHandleContainerMixin", - UnregisterAllEvents = "Dispatcher", - UnregisterCallback = "CallbackRegistryMixin", - UnregisterEvent = "Dispatcher", - Update = "ActionBarActionButtonDerivedMixin", - UpdateAddOnMemoryUsage = "AddonListMixin", - UpdateAllAuras = "AuraContainerSharedMixin", - UpdateAuras = "AdventuresBoardAuraContainerMixin", - UpdateButtons = "BarberShopMixin", - UpdateColor = "HeaderSortButtonMixin", - UpdateControl = "HouseEditorInstructionMixin", - UpdateData = "GarrisonFollowerList", - UpdateDisplay = "AddonCompartmentMixin", - UpdateExperience = "AdventuresRewardsFollowerMixin", - UpdateFrame = "ManagedFrameContainerMixin", - UpdateHealthColor = "PersonalResourceDisplayMixin", - UpdatePresence = "CommunitiesMemberListEntryMixin", - UpdateRange = "GamepadPetActionFlyoutButtonMixin", - UpdateReadyCheck = "PartyMemberFrameMixin", - UpdateSearch = "TransmogSearchBoxMixin", - UpdateSettings = "EditModeSystemSettingsDialogMixin", - UpdateStatus = "ContributionMixin", - UpdateTick = "ArtifactBarMixin", - UpdateTooltip = "ArenaUnitFrameDebuffMixin", - Upgrade = "CovenantSanctumUpgradeTalentListMixin", - WrapTextInColorCode = "ColorMixin", - __index = "auraInstanceMapMetatable", - __newindex = "auraInstanceMapMetatable", - __tostring = "Object", - action = "MicroMenuButtonHandler", - initialize = "Class_TutorialBase", - }, - }, -} diff --git a/tests/helpers.lua b/tests/helpers.lua index 4cd0cd8..faec611 100644 --- a/tests/helpers.lua +++ b/tests/helpers.lua @@ -1,94 +1,24 @@ -- Shared helpers for specs: a fresh mocked client with the addon loaded. local Mock = dofile("tests/mock/wow.lua") local NewStubOUF = dofile("tests/mock/ouf.lua") +local Loader = require("wowmock.loader") local Helpers = { Mock = Mock } +-- The wow-ui-testing library folder, and the Blizzard UI source its pin names +-- (present after bash .wut/scripts/update-client-source.sh --sync). +Helpers.WutDir = package.searchpath("wowmock.loader", package.path):match("^(.*)/wowmock/loader%.lua$") +Helpers.ClientSource = Helpers.WutDir .. "/.client-source/forever" + -- Libraries that need the real client; tests use stand-ins instead. -local SKIP = { +Loader.Skip({ "Libs/oUF/", -- replaced by tests/mock/ouf.lua "Libs/LibEditMode/", -- optional at runtime (LibStub(..., true)) -} - -local function Skipped(path) - for _, pattern in ipairs(SKIP) do - if path:find(pattern, 1, true) then - return true - end - end - return false -end - --- Files are read and compiled once per run. Calling a compiled chunk again --- runs its main body afresh (new locals and closures), like a fresh load, so --- every addon load still starts from a clean state. -local chunks, includes, tocs = {}, {}, {} - -local function Compile(path) - local chunk = chunks[path] - if not chunk then - chunk = assert(loadfile(path)) - chunks[path] = chunk - end - return chunk -end - --- Only