Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016onJCSHLwhs9udhC9ZLzk9
This commit is contained in:
Lacustat
2026-10-29 23:56:45 +01:00
co-authored by Claude Sonnet 5.5
parent f6061b92f2
commit 86df8d52f5
3 changed files with 48 additions and 11 deletions
+4 -3
View File
@@ -47,7 +47,7 @@ end
local function Entry(r)
local cost = Codex.ModePrice(r.pr)
return { nm = r.nm or "?", sp = r.sp, rk = r.rk or (r.sp and Codex.SpellRank(r.sp)) or nil, cost = cost }
return { nm = r.nm or "?", sp = r.sp, rk = r.rk or (r.sp and Codex.SpellRank(r.sp)) or nil, cost = cost, ic = r.ic }
end
-- Fähigkeiten deiner Klasse, die auf dieser Stufe beim Lehrer dazukommen
@@ -60,7 +60,7 @@ function Hints.ClassEntries(level)
if g then
for _, sp in ipairs(g.spells) do
if not SpellKnown(sp.sp) then
list[#list + 1] = { nm = sp.nm or "?", sp = sp.sp, rk = sp.rk or (sp.sp and Codex.SpellRank(sp.sp)) or nil, cost = sp.cost }
list[#list + 1] = { nm = sp.nm or "?", sp = sp.sp, rk = sp.rk or (sp.sp and Codex.SpellRank(sp.sp)) or nil, cost = sp.cost, ic = sp.ic }
end
end
end
@@ -209,7 +209,8 @@ local function Display(h)
for i = 1, MAX_ROWS do
local row, e = frame.rows[i], h.entries[i]
if e and i <= n then
local icon = e.sp and Codex.SpellIcon(e.sp) or nil
-- Das Symbol vom Lehrer-Fenster (beim Scan gelesen) zuerst; die Zauber-ID taugt auf Vanilla-Clients oft nicht
local icon = e.ic or (e.sp and Codex.SpellIcon(e.sp)) or nil
row.icon:SetTexture(icon or "Interface\\Icons\\INV_Misc_QuestionMark")
row.icon:Show()
row.text:SetText(e.nm .. (e.rk and (" |cff9a9aa3(" .. e.rk .. ")|r") or ""))
+43 -7
View File
@@ -276,12 +276,49 @@ function Codex.ReputationRequirement(data)
return false
end
-- Ohne C_TooltipInfo (Vanilla-Client mit ClassicAPI): Tooltip des Haendlerfensters ueber einen eigenen, unsichtbaren GameTooltip lesen.
-- Ergebnis im selben Format wie C_TooltipInfo: { lines = { { leftText, leftColor = { r, g, b } } } }
local scanTip
local function ScanTooltip()
if scanTip then return scanTip end
if not (_G.CreateFrame and _G.UIParent) then return nil end
local ok, tt = pcall(_G.CreateFrame, "GameTooltip", "FreewoodMerchantScan", _G.UIParent, "GameTooltipTemplate")
if not ok or not tt then return nil end
scanTip = tt
return tt
end
local function MerchantTooltipLegacy(i)
local tt = ScanTooltip()
if not (tt and tt.SetMerchantItem and tt.NumLines) then return nil end
if tt.SetOwner then tt:SetOwner(_G.UIParent, "ANCHOR_NONE") end
if tt.ClearLines then tt:ClearLines() end
local ok = pcall(tt.SetMerchantItem, tt, i)
if not ok then return nil end
local lines = {}
for k = 1, tt:NumLines() or 0 do
local fs = _G["FreewoodMerchantScanTextLeft" .. k]
local text = fs and fs.GetText and fs:GetText()
if type(text) == "string" and text ~= "" then
local r, g, b = 1, 1, 1
if fs.GetTextColor then r, g, b = fs:GetTextColor() end
lines[#lines + 1] = { leftText = text, leftColor = { r = r, g = g, b = b } }
end
end
if #lines == 0 then return nil end -- Daten noch nicht da: beim naechsten Haendler-Ereignis erneut versuchen
return { lines = lines }
end
local function MerchantTooltip(i)
if not (C_TooltipInfo and C_TooltipInfo.GetMerchantItem) then return nil end
local ok, data = pcall(C_TooltipInfo.GetMerchantItem, i)
if not ok or type(data) ~= "table" or Util.IsSecret(data) then return nil end
if TooltipUtil and TooltipUtil.SurfaceArgs then pcall(TooltipUtil.SurfaceArgs, data) end
return data
if C_TooltipInfo and C_TooltipInfo.GetMerchantItem then
local ok, data = pcall(C_TooltipInfo.GetMerchantItem, i)
if ok and type(data) == "table" and not Util.IsSecret(data) then
if TooltipUtil and TooltipUtil.SurfaceArgs then pcall(TooltipUtil.SurfaceArgs, data) end
return data
end
return nil
end
return MerchantTooltipLegacy(i)
end
-- /fwruf: zeigt fuer die ersten Waren des offenen Haendlers die Tooltip-Zeilen und was daraus gelesen wurde
@@ -291,8 +328,7 @@ function Roles.RepDiag()
return
end
if not (C_TooltipInfo and C_TooltipInfo.GetMerchantItem) then
FW:Print("Ruf: C_TooltipInfo.GetMerchantItem gibt es hier nicht - Ruf-Zeilen koennen nicht gelesen werden.")
return
FW:Print("Ruf: C_TooltipInfo.GetMerchantItem gibt es hier nicht - es wird der Tooltip des Haendlerfensters gelesen.")
end
FW:Print("Ruf: Muster = " .. tostring(_G.ITEM_REQ_REPUTATION) .. " | Stufen: " .. tostring(_G.FACTION_STANDING_LABEL5) .. ", " .. tostring(_G.FACTION_STANDING_LABEL6))
local shown = 0
+1 -1
View File
@@ -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.186
## Version: 0.1.187
## Dependencies: Freewood-OctoWoW-Core
## OptionalDeps: Freewood-OctoWoW-CodexData, Freewood-OctoWoW-ForeverData