Keine Bearbeitungszusammenfassung
Keine Bearbeitungszusammenfassung
Zeile 1: Zeile 1:
local p = {}
local p = {}
function p.getName(frame)
function p.getName(frame)
    -- Holt die ID aus der Vorlage (z.B. 501)
     local id = tonumber(frame.args[1])
     local id = tonumber(frame.args[1])
     if not id then return "ID fehlt" end
     if not id then return "ID fehlt" end
    -- Greift auf deine Datenbank in Modul:ItemData zu
     local data = mw.loadData('Modul:ItemData')
     local data = mw.loadData('Modul:ItemData')
    -- Sucht den Namen
     if data and data[id] then
     if data and data[id] then
         return data[id].identifiedDisplayName or ("Item " .. id)
         return data[id].identifiedDisplayName or ("Item " .. id)
Zeile 16: Zeile 10:
     end
     end
end
end
return p
return p

Version vom 27. Dezember 2025, 19:28 Uhr

local p = {} function p.getName(frame)

   local id = tonumber(frame.args[1])
   if not id then return "ID fehlt" end
   local data = mw.loadData('Modul:ItemData')
   if data and data[id] then
       return data[id].identifiedDisplayName or ("Item " .. id)
   else
       return "Item " .. id
   end

end return p