From 005f9d37acc86a46aaeadca25dc4e2c8ec7e6817 Mon Sep 17 00:00:00 2001 From: Lacustat Date: Sun, 1 Nov 2026 14:44:14 +0100 Subject: [PATCH] 0.1.225: Itemdaten (Name, Symbol) bleiben nach Neustart erhalten, Geber-Namen im Levelplan aus der Codex-Liste Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_016onJCSHLwhs9udhC9ZLzk9 --- Codex.lua | 27 +++++++++++++++++++++++++++ CodexUI.lua | 2 +- Freewood-OctoWoW-Codex.toc | 2 +- 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/Codex.lua b/Codex.lua index dc726f8..7a126dd 100644 --- a/Codex.lua +++ b/Codex.lua @@ -434,6 +434,33 @@ function Codex.QualityOf(itemID) return Codex.db.iq and Codex.db.iq[itemID] or nil end +-- Itemdaten, die das Spiel liefert (Name, Qualitaet, Symbol), merken: nach einem Neustart sind sie sonst weg (der Client behaelt sie nicht) +-- und die Listen zeigen erst wieder "#1234" und Fragezeichen, bis alles neu abgefragt ist. +function Codex.RememberItem(itemID, info) + if type(itemID) ~= "number" or type(info) ~= "table" then return end + if info.name then NoteName(itemID, info.name) end + if info.quality then Codex.RememberQuality(itemID, info.quality) end + if type(info.icon) == "string" and info.icon ~= "" then + local ic = Codex.db.iicon + if not ic then ic = {} Codex.db.iicon = ic end + if ic[itemID] ~= info.icon and (ic[itemID] ~= nil or (Codex.db.iiconN or 0) < 9000) then + if ic[itemID] == nil then Codex.db.iiconN = (Codex.db.iiconN or 0) + 1 end + ic[itemID] = info.icon + end + end +end + +if Util.RequestItem and not Codex.itemHooked then + Codex.itemHooked = true + local baseRequest = Util.RequestItem + Util.RequestItem = function(itemID, callback) + return baseRequest(itemID, function(info) + if info and Codex.db then pcall(Codex.RememberItem, itemID, info) end + if callback then return callback(info) end + end) + end +end + Codex.AddCell = AddCell Codex.NoteName = NoteName Codex.Str = Str diff --git a/CodexUI.lua b/CodexUI.lua index cc7defa..ffc5540 100644 --- a/CodexUI.lua +++ b/CodexUI.lua @@ -4121,7 +4121,7 @@ local function Build(content) end row.icon:SetTexCoord(0.08, 0.92, 0.08, 0.92) if e.itemID then - row.icon:SetTexture(ICON.items) + row.icon:SetTexture(Codex.db.iicon and Codex.db.iicon[e.itemID] or ICON.items) local q = Codex.QualityOf(e.itemID) if q then row.title:SetText(Colored(e.title, q)) end Util.RequestItem(e.itemID, function(info) diff --git a/Freewood-OctoWoW-Codex.toc b/Freewood-OctoWoW-Codex.toc index 26fc7c5..dfa2d3c 100644 --- a/Freewood-OctoWoW-Codex.toc +++ b/Freewood-OctoWoW-Codex.toc @@ -3,7 +3,7 @@ ## Notes: Learns quests, creatures and drops while you play: who gives and takes a quest, rewards, objectives, drop chances. ## Notes-deDE: Lernt beim Spielen Quests, Kreaturen und Beute: wer eine Quest vergibt und annimmt, Belohnungen, Ziele, Drop-Chancen. ## Author: Lacustat -## Version: 0.1.224 +## Version: 0.1.225 ## Dependencies: Freewood-OctoWoW-Core ## SavedVariablesPerCharacter: FreewoodSnapshot ## OptionalDeps: Freewood-OctoWoW-CodexData, Freewood-OctoWoW-ForeverData