Repository navigation
Split EllesmereUIBlizzardSkin.lua into six files - #2730
Open
JuJuFX-dev wants to merge 5 commits into
Open
JuJuFX-dev wants to merge 5 commits into
JuJuFX-dev wants to merge 5 commits into
Conversation
The load guard also stops the chain when a file is missing or does not compile, the main file binds ns once, the HUD engine lookup reads ns.WSkin, and one core comment names the new file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Nothing changes for the player.
EllesmereUIBlizzardSkin.lua(5,037 lines) becomes six files that load in the same order the code had inside the one file. This file was not near the 200-local limit (56 active chunk locals at most); the gain is readability: one feature area per file instead of fifteen unrelated blocks in one.EllesmereUIBlizzardSkin.luaFFD/GetFFD, window skin styles and looks, the one-time style seedEUI_BlizzardSkin_TooltipSkin.luaEUI_BlizzardSkin_Dialogs.luaEUI_BlizzardSkin_TooltipAnchor.luaEUI_BlizzardSkin_TooltipVisibility.luaEUI_BlizzardSkin_HUD.luaThe cut is a chain in source order: the six files concatenated are the old file. Every cut lies between two top-level statements, so no
doblock and neither of the two;(function() ... end)()wrappers is opened. Because the files load back to back in the.toc, directly behind the main file and beforeEllesmereUIBlizzardSkin_DiminishingReturns.lua, every frame is created, every event registered and everyhooksecurefunc/HookScriptinstalled in the same order and at the same time as before (31hooksecurefunccalls before, 31 after). The comment in the fixed-position block that asks for its hook to register before the growth-direction hook still holds: both blocks sit inEUI_BlizzardSkin_TooltipAnchor.luain their old order.Five commits, meant to be read separately:
Move the Blizzard Skin code into five new files (verbatim): a byte-exact move, no line changed. This commit does not load on its own (the new files are not in the.tocyet, and two of them open with;(function(), which only compiles once a head stands in front of it).Wire the Blizzard Skin files through ns._internals: the head of each new file, a guard table at the end of the main file, five.toclines, eight comment lines whose "below" or "this file" pointed across a file boundary.Blizzard Skin split: point four comments at the files that hold the code: comment text only, one line inEUI_BlizzardSkin_HUD.lua, one inEllesmereUIBlizzardSkin_WindowPacks.lua, two inEUI_BlizzardSkin_Options.lua.Blizzard Skin split: review follow-ups: the load guard described below,nsbound once at the top of the main file instead of threeselect(2, ...)reads, the lazy engine lookup inEUI_BlizzardSkin_HUD.luareadsns.WSkindirectly, and one comment line inEllesmereUI.luanames the file that now holds the game menu skin.Regenerate the locale key list:EllesmereUILocales/_keys.txtas the CI script writes it from a clean checkout; only the count in its header changes (1306 to 1308), a drift that came in withupstream/main, not from this branch.The wiring is the pattern of the Raid Frames and Cooldown Manager splits, in its smallest form. No chunk local of the old file is written across a cut, so there is no setter list at all. The new files read exactly two names from the main file,
FFDandGetFFD, throughns._internals. The table has anerrormetatable, so a missing name fails where the file loads instead of as a nil upvalue later.The load guard keeps the old failure behaviour: in one file, anything that stopped the load (a runtime error, or a compile error such as a blown local limit) took everything after it down too. Here every file checks at its first lines that the file before it loaded to its end (
I.last), and records itself at its own end. So a file that errors, does not compile or is missing from the install stops the files behind it, instead of leaving later hooks installed that call functions an earlier file never defined. This differs from thebrokenflag of the earlier splits, which only catches a runtime error.In the moved bodies exactly one statement changed, in
WS()ofEUI_BlizzardSkin_HUD.lua:_WS = ns.WSkinreplaces the lookup of the same table throughEllesmereUI._ModuleNS[ADDON_NAME]. In the main file, lines 8, 10 and 11 now share onensbinding. Everything else outside the heads and the table is comment text.How was it tested?
Tested in-game on live.
Checklist
HookScript/hooksecurefunconly, neverSetScripton Blizzard frames: unchanged, every hook line moved verbatim; the guard table is a plain Lua table on the addon namespace