From 357826045c06d7afc91be8f1fa2b37d3bfc0e3cf Mon Sep 17 00:00:00 2001 From: Lacustat Date: Wed, 28 Oct 2026 12:58:11 +0100 Subject: [PATCH] 0.1.149: Lernplan-Symbole/Tooltips, Item-Tooltips, Nachnahme-Anhang (1.12-Form), Brett eigenes Fenster, ClassicAPI-Pruefung, Start-Itemkatalog Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_016onJCSHLwhs9udhC9ZLzk9 --- Codex.lua | 10 +++++++++- CodexRoles.lua | 8 +++++++- CodexShare.lua | 3 ++- CodexUI.lua | 28 +++++++++++++++++++++------- Freewood-OctoWoW-Codex.toc | 2 +- 5 files changed, 40 insertions(+), 11 deletions(-) diff --git a/Codex.lua b/Codex.lua index e20c3b9..14a3f8b 100644 --- a/Codex.lua +++ b/Codex.lua @@ -3371,7 +3371,15 @@ function Codex:ItemName(itemID) if seed then return seed end - return Codex.ExtraItemName and Codex.ExtraItemName(itemID) or nil + local extra = Codex.ExtraItemName and Codex.ExtraItemName(itemID) + if extra then return extra end + -- mitgelieferter Katalog (Startdaten): Name ohne Serverabfrage + local Cat = Codex.Catalog + if Cat and Cat.GetItem then + local nm = Cat.GetItem(itemID) + if nm then return nm end + end + return nil end ------------------------------------------------------------------------ diff --git a/CodexRoles.lua b/CodexRoles.lua index 3e40e1a..d8331ad 100644 --- a/CodexRoles.lua +++ b/CodexRoles.lua @@ -663,6 +663,11 @@ function Roles:ScanTrainer() rec.sn, rec.sr = sn, sr and math.floor(sr) or nil end end + local ic = TrainerCall("GetTrainerServiceIcon", i) + ic = ic and Util.Clean(ic[1]) + if (type(ic) == "string" and ic ~= "") or type(ic) == "number" then + rec.ic = ic + end local cost = FirstNumber(TrainerCall("GetTrainerServiceCost", i), "moneyCost") if cost and not seen[key .. ":" .. cost] then seen[key .. ":" .. cost] = true @@ -1093,7 +1098,7 @@ BuildLearnPlan = function(token) local skey = lv .. "\1" .. (r.sp and ("s" .. r.sp) or key) local sp = seen[skey] if not sp then - sp = { nm = r.nm, sp = r.sp, rk = r.rk, lv = lv, pr = {}, trainers = {} } + sp = { nm = r.nm, sp = r.sp, rk = r.rk, lv = lv, ic = r.ic, pr = {}, trainers = {} } seen[skey] = sp local g = levels[lv] if not g then @@ -1105,6 +1110,7 @@ BuildLearnPlan = function(token) end sp.rk = sp.rk or r.rk sp.sp = sp.sp or r.sp + sp.ic = sp.ic or r.ic for p, n in pairs(r.pr or {}) do sp.pr[p] = (sp.pr[p] or 0) + n end local g = levels[lv] if IsPetTrainer(u) then sp.pet = true end diff --git a/CodexShare.lua b/CodexShare.lua index 37a5342..059a294 100644 --- a/CodexShare.lua +++ b/CodexShare.lua @@ -411,7 +411,7 @@ local function TrainTable(src) local nm = Text(r.nm, 60) local pr = PriceMap(r.pr) if nm and pr then - out[e[1]] = { nm = nm, sp = Int(r.sp, 1, 10000000), rk = Text(r.rk, 30), lv = Int(r.lv, 1, 130), sn = Text(r.sn, 40), sr = Int(r.sr, 1, 1000), pr = pr } + out[e[1]] = { nm = nm, sp = Int(r.sp, 1, 10000000), rk = Text(r.rk, 30), lv = Int(r.lv, 1, 130), sn = Text(r.sn, 40), sr = Int(r.sr, 1, 1000), ic = Text(r.ic, 120), pr = pr } count = count + 1 end end @@ -1687,6 +1687,7 @@ local function MergeTrain(dst, src) d.lv = d.lv or r.lv d.sn = d.sn or r.sn d.sr = d.sr or r.sr + d.ic = d.ic or r.ic end end diff --git a/CodexUI.lua b/CodexUI.lua index 2c40995..36f27c2 100644 --- a/CodexUI.lua +++ b/CodexUI.lua @@ -353,10 +353,12 @@ local function ItemIndex() end end end - -- Items aus den Startdaten, deren Itemdaten schon geladen sind (sonst nur Zahlen ohne Namen) + -- Items aus den Startdaten, deren Name bekannt ist: aus dem Client oder aus dem mitgelieferten Katalog + -- (Name, Stufe, Preis ohne Serverabfrage). Unbekannte erscheinen, sobald der Client sie geladen hat. + local CatGet = Codex.Catalog and Codex.Catalog.GetItem if Codex.Forever and Codex.Forever.ItemIds then for id in pairs(Codex.Forever.ItemIds()) do - if not index[id] and Util.GetItem(id) then + if not index[id] and (Util.GetItem(id) or (CatGet and CatGet(id))) then local it = Codex.Forever.Item(id) local f = { zones = {}, best = 0, fe = true } if it then @@ -2142,6 +2144,11 @@ local function Build(content) GameTooltip:SetOwner(self, "ANCHOR_RIGHT") pcall(GameTooltip.SetItemByID, GameTooltip, self.itemID) GameTooltip:Show() + elseif self.tip and GameTooltip then + GameTooltip:SetOwner(self, "ANCHOR_RIGHT") + GameTooltip:SetText(self.tip[1] or "", 1, 1, 1) + for ti = 2, #self.tip do GameTooltip:AddLine(self.tip[ti], 0.8, 0.8, 0.8) end + GameTooltip:Show() elseif self.spellID and GameTooltip then GameTooltip:SetOwner(self, "ANCHOR_RIGHT") local ok = pcall(GameTooltip.SetSpellByID, GameTooltip, self.spellID) @@ -2283,7 +2290,7 @@ local function Build(content) elseif style == "heading" then h = 28; top = 12 elseif style == "item" or style == "link" then h = 26 elseif style == "text" then h = TextHeight(opts.text) end - if opts.spellID then h = 26 end + if opts.spellID or opts.tip then h = 26 end row:ClearAllPoints() row:SetPoint("TOPLEFT", detail.child, "TOPLEFT", 0, -(self.y + top)) row:SetPoint("TOPRIGHT", detail.child, "TOPRIGHT", 0, -(self.y + top)) @@ -2299,7 +2306,8 @@ local function Build(content) row.onClick = opts.onClick row.itemID = opts.itemID row.spellID = opts.spellID - row:EnableMouse(row.clickable or opts.itemID ~= nil or opts.spellID ~= nil) + row.tip = opts.tip + row:EnableMouse(row.clickable or opts.itemID ~= nil or opts.spellID ~= nil or opts.tip ~= nil) local leftX = 4 + indent if opts.icon then @@ -3287,10 +3295,16 @@ local function Build(content) D:Add({ style = "heading", text = string.format(L.CODEX_SEC_LEARN_SPELLS, #g.spells) }) for _, sp in ipairs(g.spells) do local rank = sp.rk or (sp.sp and Codex.SpellRank(sp.sp)) or nil - local icon = sp.sp and Codex.SpellIcon(sp.sp) or nil - D:Add({ text = (sp.nm or "?") .. (rank and (" |cff9a9aa3(" .. rank .. ")|r") or ""), + local icon = sp.sp and Codex.SpellIcon(sp.sp) or sp.ic or nil + local tip + if not sp.sp then + tip = { (sp.nm or "?") .. (rank and (" (" .. rank .. ")") or "") } + if lv > 0 then tip[#tip + 1] = string.format(L.CODEX_TRAIN_LEVEL, lv) end + if sp.cost and sp.cost > 0 then tip[#tip + 1] = FormatMoney(sp.cost) end + end + D:Add({ tip = tip, text = (sp.nm or "?") .. (rank and (" |cff9a9aa3(" .. rank .. ")|r") or ""), right = (sp.cost and sp.cost > 0) and FormatMoney(sp.cost) or "-", rightWidth = 150, - spellID = sp.sp, icon = icon or (sp.sp and "Interface\\Icons\\INV_Misc_QuestionMark") or nil }) + spellID = sp.sp, icon = icon or "Interface\\Icons\\INV_Misc_QuestionMark" }) end D:Add({ style = "heading", text = string.format(L.CODEX_SEC_LEARN_TRAINERS, #g.trainers) }) for i, id in ipairs(g.trainers) do diff --git a/Freewood-OctoWoW-Codex.toc b/Freewood-OctoWoW-Codex.toc index a07099f..d2d0151 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.148 +## Version: 0.1.149 ## Dependencies: Freewood-OctoWoW-Core ## OptionalDeps: Freewood-OctoWoW-CodexData, Freewood-OctoWoW-ForeverData