From 8135281dd9fa90ad1ef482104efd19982abadcdf Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 23 Nov 2026 10:01:05 +0000 Subject: [PATCH] Finder: the Bags entry goes through the Bags module (F24) The Finder's Bags entry still called the game's ToggleAllBags from EldoUI's code (PANELS, fn = "ToggleAllBags"): the second way of F24's cause, which builds the game's bag frames from untrusted code, so a bank visit afterwards could again block every right-click use from the bags until a reload. Found by the independent review of the 0.7.3100 update; older than the update. - Modules/Finder/Finder.lua: the entry is `bags = true`, and PanelCall hands it to the Bags module's M:ToggleBags, which uses the game's toggle by itself while EldoUI's window does not replace the bags. The entry's id ("panel:Bags") stays, so pinned and recent entries keep it. - tools/bags/test_game_bag_code.lua: the real PANELS and PanelCall run against the bag model (open and close without the game's code, the game's toggle with its frames shown). The text check now reads every Lua file in the TOCs of EldoUI, the group board and the Loot Sim, also for bag functions named in quotes; post-hooks and AddonFit's watch lists are no call. Against the old Finder: 4 checks fail. - Entry in both changelogs; review/fehler.md F24: the gap, the fix, the test and an in-game check (and "/eui find" there is the item search, not the Finder). Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01EcJkaCPzN6vCKq9vD7Wa8X --- CHANGELOG.md | 1 + EldoUI/CHANGELOG.md | 1 + EldoUI/Modules/Finder/Finder.lua | 13 +++-- review/fehler.md | 28 ++++++---- review/verbesserungen.md | 2 +- tools/bags/test_game_bag_code.lua | 88 ++++++++++++++++++++++++++++++- 6 files changed, 117 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a26e4e..4d83766 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ The in-game **What's New** page (`/eui whatsnew`) shows the highlights of each v #### Fixed - Right-clicking an item in EldoUI's bag window to use it (hearthstone, keys, recipes, or to put it into the trade window) is no longer blocked until a reload after a visit to the bank. EldoUI's bag window no longer runs the game's own bag code: bags opened from the Info Bar, with /eui find or with another window stay open until you close them. +- Picking Bags in the Finder no longer blocks right-click use from the bags after a visit to the bank: it opens and closes EldoUI's bag window the same way the Info Bar does. ## [0.7.3100] - 2026-11-21 diff --git a/EldoUI/CHANGELOG.md b/EldoUI/CHANGELOG.md index 0a26e4e..4d83766 100644 --- a/EldoUI/CHANGELOG.md +++ b/EldoUI/CHANGELOG.md @@ -17,6 +17,7 @@ The in-game **What's New** page (`/eui whatsnew`) shows the highlights of each v #### Fixed - Right-clicking an item in EldoUI's bag window to use it (hearthstone, keys, recipes, or to put it into the trade window) is no longer blocked until a reload after a visit to the bank. EldoUI's bag window no longer runs the game's own bag code: bags opened from the Info Bar, with /eui find or with another window stay open until you close them. +- Picking Bags in the Finder no longer blocks right-click use from the bags after a visit to the bank: it opens and closes EldoUI's bag window the same way the Info Bar does. ## [0.7.3100] - 2026-11-21 diff --git a/EldoUI/Modules/Finder/Finder.lua b/EldoUI/Modules/Finder/Finder.lua index 28edee6..8ae0f56 100644 --- a/EldoUI/Modules/Finder/Finder.lua +++ b/EldoUI/Modules/Finder/Finder.lua @@ -374,8 +374,8 @@ end -- Game panels: the same calls as the game's own key bindings -- (Bindings_Camelot.xml). `fn` names a global; `util` a PlayerSpellsUtil --- function; `map` the world map. combat = false: the panel is protected in --- combat. +-- function; `map` the world map; `bags` the bags. combat = false: the panel +-- is protected in combat. local PANELS = { { text = "Character", fn = "ToggleCharacter", arg = "PaperDollFrame", icon = "Interface\\Icons\\INV_Chest_Chain" }, -- no-L (translated where shown) { text = "Reputation", fn = "ToggleCharacter", arg = "ReputationFrame", icon = "Interface\\Icons\\INV_BannerPVP_02" }, -- no-L (translated where shown) @@ -384,7 +384,7 @@ local PANELS = { { text = "Professions", fn = "ToggleProfessionsBook", icon = "Interface\\Icons\\Trade_BlackSmithing" }, -- no-L (translated where shown) { text = "Quest log", fn = "ToggleQuestLog", icon = "Interface\\Icons\\INV_Misc_Note_01" }, -- no-L (translated where shown) { text = "World map", map = true, icon = "Interface\\Icons\\INV_Misc_Map_01", combat = false }, -- no-L (translated where shown) - { text = "Bags", fn = "ToggleAllBags", icon = "Interface\\Icons\\INV_Box_02" }, -- no-L (translated where shown) + { text = "Bags", bags = true, icon = "Interface\\Icons\\INV_Box_02" }, -- no-L (translated where shown) { text = "Friends", fn = "ToggleFriendsFrame", icon = "Interface\\Icons\\INV_Letter_15" }, -- no-L (translated where shown) { text = "Guild", fn = "ToggleGuildFrame", icon = "Interface\\Icons\\INV_BannerPVP_01" }, -- no-L (translated where shown) { text = "Who", fn = "LFGVanilla_ToggleFrame", argGlobal = "LFG_TAB_WHO", icon = "Interface\\Icons\\INV_Misc_Note_02" }, -- no-L (translated where shown) @@ -408,6 +408,13 @@ local function PanelCall(panel) if panel.map then return C_Map and type(C_Map.OpenWorldMap) == "function" and function() E:OpenWorldMapAt() end or nil end + -- The bags through the Bags module, which keeps the game's bag code out + -- of EldoUI's code while its bag window replaces the game's and uses + -- the game's toggle otherwise (review/fehler.md F24). + if panel.bags then + local bags = E.modules.Bags + return bags and type(bags.ToggleBags) == "function" and function() bags:ToggleBags() end or nil + end if panel.util then local util = Global("PlayerSpellsUtil") return util and type(util[panel.util]) == "function" and function() util[panel.util]() end or nil diff --git a/review/fehler.md b/review/fehler.md index 25124f1..8b0cfc9 100644 --- a/review/fehler.md +++ b/review/fehler.md @@ -31,7 +31,7 @@ plausibel = hängt von API-Verhalten ab, das sich ohne Spiel nicht prüfen läss | F21 | Angeln: Das Fangprotokoll bleibt bei 0 (im Spiel gefunden) | niedrig–mittel | behoben | `cfebaee` | | F22 | Auktionshaus: Verkaufen-Seite bleibt nach „Schnellverkauf“ leer; Rechtsklick in die Taschen verboten (im Spiel gefunden) | mittel | teilweise | `391f0b7` | | F23 | Gilden-Tooltip der Infoleiste fragt im Kampf die Gildennachricht ab → ADDON_ACTION_BLOCKED (im Fehlerlog gefunden) | niedrig | behoben | `bb28608` | -| F24 | Nach einem Bankbesuch ist jeder Rechtsklick zum Benutzen aus den Taschen verboten, bis zum Reload (im Spiel gefunden) | hoch | behoben (im Spiel offen; der Weg über den Finder ist noch offen) | | +| F24 | Nach einem Bankbesuch ist jeder Rechtsklick zum Benutzen aus den Taschen verboten, bis zum Reload (im Spiel gefunden) | hoch | behoben (im Spiel offen) | | **Prüfung der Änderungen:** `luac5.1 -p` über alle 626 Dateien fehlerfrei; luacheck zeigt gegenüber dem Originalstand keine neue Warnung (259 vor und nach den Änderungen, ohne W113/W212); kein neuer unbekannter @@ -92,7 +92,7 @@ bei den Tastenbelegungen (EldoUIs neue Tasten der Verbrauchsgüterleiste neben d | Nr. | In 0.7.3100 | Was im Fork bleibt | |---|---|---| -| F24 | Nein: In `Modules/Bags/Core.lua` gibt EldoUI nur `CanBuyTab` als `M.CanBuyBankTab` heraus, für die neue Schaltfläche „Nächsten Bankreiter kaufen“ auf der Seitenleiste des Bankfensters (`Modules/Bags/BankActions.lua`). Sie ist wie das Plus auf der Taschenleiste seit 0.7.3005 die Kaufschaltfläche des Spiels; ohne sie öffnet sie Blizzards Bankfenster (`M:ShowBlizzardBank`, wie bisher). Neue Aufrufe von `OpenAllBags`, `CloseAllBags` oder `ToggleAllBags` gibt es nicht (im ganzen Addon gesucht; die Textprüfung in `tools/bags/test_game_bag_code.lua` liest nur `Bags/Core.lua`, `InfoBar.lua` und `FlightView.lua`). Die Gegenprüfung fand dabei einen alten Weg, den F24 nicht abdeckt: den Finder (siehe F24). | Alles. | +| F24 | Nein: In `Modules/Bags/Core.lua` gibt EldoUI nur `CanBuyTab` als `M.CanBuyBankTab` heraus, für die neue Schaltfläche „Nächsten Bankreiter kaufen“ auf der Seitenleiste des Bankfensters (`Modules/Bags/BankActions.lua`). Sie ist wie das Plus auf der Taschenleiste seit 0.7.3005 die Kaufschaltfläche des Spiels; ohne sie öffnet sie Blizzards Bankfenster (`M:ShowBlizzardBank`, wie bisher). Neue Aufrufe von `OpenAllBags`, `CloseAllBags` oder `ToggleAllBags` gibt es nicht (im ganzen Addon gesucht; die Textprüfung in `tools/bags/test_game_bag_code.lua` liest nur `Bags/Core.lua`, `InfoBar.lua` und `FlightView.lua`). Die Gegenprüfung fand dabei einen alten Weg, den F24 nicht abdeckte: den Finder (siehe F24, inzwischen behoben). | Alles. | | F23 | Nein: Der Gilden-Tooltip ist unverändert. EldoUIs Änderungen in `InfoBar.lua` sind der neue Block „PvP rank“ und die Trefferwertung in den Blöcken Hit und Spell hit. | Alles. | | F01–F22 | Nein: Code an diesen Stellen gleich. | Alles. | @@ -606,16 +606,23 @@ bei den Tastenbelegungen (EldoUIs neue Tasten der Verbrauchsgüterleiste neben d und mit dem zweiten Druck der Rucksack-Taste. - Der normale Weg mit B ist unverändert. - Mit sichtbaren Rahmen nutzt EldoUI Blizzards Funktionen wie bisher. + - Der Eintrag „Taschen“ des Finders (echtes `PANELS` und `PanelCall` aus `Finder.lua`) öffnet und schließt nur + EldoUIs Fenster und nimmt mit sichtbaren Rahmen das Umschalten des Spiels. - Eine Textprüfung stellt sicher, dass `Core.lua`, `InfoBar.lua` und `FlightView.lua` sie sonst nirgends direkt aufrufen. + Seit der Gegenprüfung liest sie jede Lua-Datei aus den TOCs von EldoUI, Gruppen-Pinnwand und Loot Sim, auch auf + Namen in Anführungszeichen (wie `fn = "ToggleAllBags"`); Nachhaken (`hooksecurefunc`) und die `watch`-Listen in + `Data/AddonFit.lua` folgen nur dem Aufruf des Spiels und zählen nicht. Er läuft nur in der CI, denn auf dem Entwicklungsrechner gibt es kein Lua. -- **Lücke (Gegenprüfung beim Update auf 0.7.3100, 23.11.2026), offen:** Der Finder (`/eui find`, Eintrag „Taschen“) - ruft Blizzards `ToggleAllBags` weiter direkt aus EldoUIs Code auf: `Modules/Finder/Finder.lua` (`PANELS`, Eintrag - `fn = "ToggleAllBags"`; `PanelCall` gibt `function() fn(arg) end` zurück, `M:Run` ruft es auf Klick oder Eingabe auf). - Das ist der zweite Weg der Ursache oben, nur von dort. Szenario: Taschen „Ersetzen“, im Finder „Taschen“ wählen, zur - Bank, dann Rechtsklick auf den Ruhestein: vermutlich wieder „Forbidden … ContainerFrame.lua:1611“ (Codepfad - bestätigt, die Folge plausibel, wie bei F24). Die Textprüfung des Tests liest den Finder nicht. Der Weg stammt nicht - aus dem Update. Fix-Idee: den Eintrag über `E.modules.Bags:ToggleBags()` führen (Rückfall `ToggleAllBags`) wie - `M.ToggleBags` in `InfoBar.lua`; die Textprüfung auf alle Lua-Dateien ausdehnen, auch auf Namen in Anführungszeichen. +- **Lücke (Gegenprüfung beim Update auf 0.7.3100, 23.11.2026), behoben:** Der Finder (das Suchfeld des Moduls Finder, + Eintrag „Taschen“) rief Blizzards `ToggleAllBags` weiter direkt aus EldoUIs Code auf: `Modules/Finder/Finder.lua` + (`PANELS`, Eintrag `fn = "ToggleAllBags"`; `PanelCall` gab `function() fn(arg) end` zurück, `M:Run` ruft es auf Klick + oder Eingabe auf). Das ist der zweite Weg der Ursache oben, nur von dort. Szenario: Taschen „Ersetzen“, im Finder + „Taschen“ wählen, zur Bank, dann Rechtsklick auf den Ruhestein: vermutlich wieder „Forbidden … + ContainerFrame.lua:1611“ (Codepfad bestätigt, die Folge plausibel, wie bei F24). Die Textprüfung des Tests las den + Finder nicht. Der Weg stammt nicht aus dem Update. + - **Umsetzung:** Der Eintrag heißt jetzt `bags = true`, und `PanelCall` führt ihn über `M:ToggleBags` des + Taschen-Moduls. Das nimmt selbst das Umschalten des Spiels, solange EldoUIs Fenster die Taschen nicht ersetzt; ein + eigener Rückfall im Finder ist darum nicht nötig. - **Im Spiel prüfen:** siehe Tabelle unten. ## Sonstiges @@ -648,6 +655,7 @@ Paladin Stufe 24, allein). „Keine Abweichung gemeldet“: Der Schritt war dran | F24 | `/reload`; Taschen mit B öffnen und mit EldoUIs X schließen; zur Bank, etwas herausholen, Bank schließen; Ruhestein oder Rezept per Rechtsklick aus der Tasche benutzen, danach `/run print(issecurevariable("FRAME_THAT_OPENED_BAGS"))print(issecurevariable(BankFrame.BankPanel,"bankType"))print(issecurevariable(MerchantFrame,"selectedTab"))` | Rechtsklick wirkt, kein neuer Eintrag „ContainerFrame.lua:1611“ in `/eui errors`; dreimal `true` | offen | | F24 | Taschen über die Infoleiste öffnen, mit B schließen; noch einmal über die Infoleiste öffnen, einen Händler besuchen und verlassen | B schließt das Fenster; nach dem Händler bleibt es offen | offen | | F24 | mit einem Freund handeln: einen Gegenstand per Rechtsklick aus der Tasche ins Handelsfenster legen | er landet im Handelsfenster | offen | +| F24 | `/reload`; im Finder „Taschen“ wählen (öffnet), noch einmal (schließt), wieder öffnen; zur Bank, etwas herausholen, Bank schließen; Ruhestein per Rechtsklick aus der Tasche benutzen | das Fenster öffnet und schließt; Rechtsklick wirkt, kein neuer Eintrag „ContainerFrame.lua:1611“ | offen | | F17 | Persönliche Ressourcenanzeige (falls genutzt) | Leisten mit EldoUI-Textur | offen | | F17 | Blizzard-Raidframes mit „Improve“ und Click-Casting an; im Kampf jemanden in die Gruppe einladen oder einen Raid bilden lassen, nach dem Kampf mit einer Click-Cast-Bindung auf den neuen Frame klicken | Bindung wirkt sofort nach dem Kampf, nicht erst nach der nächsten Gruppenänderung | offen (Gruppe) | | F17 | Nameplates im EldoUI-Modus, an einer Gruppe Gegner vorbeilaufen | wie vorher; keine Lua-Fehler beim ersten Erscheinen der Plates | keine Abweichung gemeldet, keine Lua-Fehler im Log | diff --git a/review/verbesserungen.md b/review/verbesserungen.md index ed91344..5313e5f 100644 --- a/review/verbesserungen.md +++ b/review/verbesserungen.md @@ -1094,7 +1094,7 @@ Inspect-Anfragen, automatische Loot-Verteilung. | Befund des Prüfers | Reaktion | |---|---| - | F24: Der Finder ruft `ToggleAllBags` direkt auf (alter Weg, nicht aus dem Update); die Textprüfung des Tests liest ihn nicht, die Notiz zum Update nannte sie aber als Beleg | In `fehler.md` unter F24 als offene Lücke eingetragen, die Notiz zum Update berichtigt; Fix getrennt | + | F24: Der Finder ruft `ToggleAllBags` direkt auf (alter Weg, nicht aus dem Update); die Textprüfung des Tests liest ihn nicht, die Notiz zum Update nannte sie aber als Beleg | In `fehler.md` unter F24 eingetragen, die Notiz zum Update berichtigt; behoben im PR danach (Finder über das Taschen-Modul, Textprüfung über alle Lua-Dateien) | | Deutsch: fünf Sätze holprig (PvP-Rangleiste, Jäger in den Neuigkeiten, Obergrenze „öffnet sich“, „Sie“ wie Höflichkeitsform, „Obergrenze“ ohne „erreicht“) | Alle fünf geändert | | Namen aus dem Gedächtnis (Loyalitätsstufen, Futter, „Berg Hyjal“, „Gegenstandsinformationen werden abgerufen“) | Als Punkt für den Spieltest unten | | Glossar nicht nachgezogen | Neue Begriffe in `tools/locale/glossar-deDE.md` | diff --git a/tools/bags/test_game_bag_code.lua b/tools/bags/test_game_bag_code.lua index 60fc38b..6470b89 100644 --- a/tools/bags/test_game_bag_code.lua +++ b/tools/bags/test_game_bag_code.lua @@ -19,8 +19,10 @@ -- the game's bag functions (open, close, toggle); its window opens alone, -- stays through a bank visit and closes on its close button, the info bar -- block, the game's B and the backpack key; with the game's frames shown --- the game's functions are used as before. A text check makes sure no other place in Core.lua, --- InfoBar.lua or FlightView.lua calls them directly. +-- the game's functions are used as before. The Finder's Bags entry +-- (/eui find) runs against the same model. A text check makes sure no +-- other Lua file the TOCs load calls them, directly or by name in quotes +-- (the Finder did: `fn = "ToggleAllBags"`). local ROOT = (arg and arg[0] or ""):match("^(.-)tools/bags/") or "./" local function ReadFile(path) @@ -286,6 +288,36 @@ do Check(world.game[4] == "ToggleAllBags", "ToggleBags uses the game's ToggleAllBags") end +--------------------------------------------------------------------------- +-- The Finder's Bags entry (/eui find): through the Bags module too +--------------------------------------------------------------------------- +local finder = ReadFile("EldoUI/Modules/Finder/Finder.lua") +local panelsText = Between(finder, "local PANELS = {", "\nM.PANELS = PANELS", "Finder.lua PANELS") +local panels = assert(loadstring("return " .. panelsText:sub(#"local PANELS = " + 1), "=Finder.lua PANELS"))() +local bagsPanel +for _, panel in ipairs(panels) do + if panel.text == "Bags" then bagsPanel = panel end +end +assert(bagsPanel, "Finder.lua: no Bags entry in PANELS") +local PanelCall = assert(loadstring("local E, Global = ...\n" + .. Between(finder, "local function PanelCall(panel)", "-- The config window opens only from /eui", "Finder.lua PanelCall") + .. "\nreturn PanelCall", "=Finder.lua PanelCall"))(E, function(name) return rawget(_G, name) end) +E.modules = { Bags = M } + +do + NewWorld(true) + local open = PanelCall(bagsPanel) + Check(type(open) == "function", "the Finder offers its Bags entry") + open() + Check(window:IsShown() and window.eldoOnly, "the Finder's Bags entry opens EldoUI's window alone") + Check(NoGameCalls(), "the Finder's Bags entry calls none of the game's bag functions: " .. table.concat(world.game, ", ")) + open() + Check(not window:IsShown() and NoGameCalls(), "the Finder's Bags entry closes the window again without the game's code") + NewWorld(false) + open() + Check(world.game[1] == "ToggleAllBags", "with the game's bags shown the Finder's Bags entry uses the game's toggle") +end + --------------------------------------------------------------------------- -- No other direct call of the game's bag functions --------------------------------------------------------------------------- @@ -308,6 +340,35 @@ local function DirectCalls(text, allowed) return found end +-- Lines that name one in quotes (a global looked up by name, as the +-- Finder's panel list did), outside comments. A post-hook and AddonFit's +-- watch lists only follow the game's call, so they are no call. +local NAMES = { "OpenAllBags", "CloseAllBags", "ToggleAllBags", "OpenBackpack", "ToggleBackpack", "CloseBackpack", + "OpenBag", "ToggleBag", "CloseBag" } +local function NamedCalls(text) + local found = {} + for line in text:gmatch("[^\n]+") do + local code = line:gsub("%-%-.*$", "") + if not code:find("hooksecurefunc%(") and not code:find("watch%s*=%s*{") then + for _, name in ipairs(NAMES) do + if code:find('"' .. name .. '"', 1, true) or code:find("'" .. name .. "'", 1, true) then found[#found + 1] = line end + end + end + end + return found +end + +-- The Lua files a TOC loads, in its order. +local function TocFiles(toc) + local dir = toc:match("^(.*/)") + local list = {} + for line in ReadFile(toc):gmatch("[^\n]+") do + line = line:gsub("%s+$", "") + if not line:find("^#") and line:find("%.lua$") then list[#list + 1] = dir .. line:gsub("\\", "/") end + end + return list +end + do local list = DirectCalls(core, helpers) Check(#list == 0, "Core.lua calls the game's bag functions only in its helpers: " .. table.concat(list, " | ")) @@ -323,5 +384,28 @@ do Check(#DirectCalls("\tif x then CloseAllBags() end\n") == 1, "counter-check: a direct CloseAllBags() is found") end +do + -- Every other Lua file of the addons with code (the language and data + -- folders hold only tables): no direct call, and no call by name. The + -- three files above keep their own allowed parts; the name check runs on + -- them too. + local own = { ["EldoUI/Modules/Bags/Core.lua"] = true, ["EldoUI/Modules/InfoBar.lua"] = true, + ["EldoUI/Modules/QoL/FlightView.lua"] = true } + local files, bad = 0, {} + for _, toc in ipairs({ "EldoUI/EldoUI.toc", "EldoUI_GroupBoard/EldoUI_GroupBoard.toc", "EldoUI_LootSim/EldoUI_LootSim.toc" }) do + for _, path in ipairs(TocFiles(toc)) do + files = files + 1 + local text = ReadFile(path) + local list = own[path] and {} or DirectCalls(text) + for _, line in ipairs(NamedCalls(text)) do list[#list + 1] = line end + for _, line in ipairs(list) do bad[#bad + 1] = path .. ": " .. line:gsub("^%s+", "") end + end + end + Check(files > 500, ("the TOCs list the addon's Lua files (%d found)"):format(files)) + Check(#bad == 0, "no other Lua file calls the game's bag functions, directly or by name: " .. table.concat(bad, " | ")) + Check(#NamedCalls('\t{ text = "Bags", fn = "ToggleAllBags" },\n') == 1, "counter-check: a bag function named in quotes is found") + Check(#NamedCalls('\thooksecurefunc("ToggleAllBags", function() end)\n') == 0, "counter-check: a post-hook is no call") +end + print(("%d checks passed, %d failed"):format(passed, failures)) os.exit(failures == 0 and 0 or 1)