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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016onJCSHLwhs9udhC9ZLzk9
This commit is contained in:
Lacustat
2026-11-01 14:44:14 +01:00
co-authored by Claude Sonnet 5.5
parent ea945b98f8
commit 005f9d37ac
3 changed files with 29 additions and 2 deletions
+27
View File
@@ -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