Модуль:Песочница/Pok: различия между версиями

мНет описания правки
мНет описания правки
Строка 4: Строка 4:
local cargoData = mw.loadData("Модуль:IanComradeBot/prototypes/cargo.json/data")
local cargoData = mw.loadData("Модуль:IanComradeBot/prototypes/cargo.json/data")


local function buildCellEvent(name, image)
local function buildCellEvent(name, image, id)
     local cell = '<div style="text-align:center;">'
     local cell = '<div style="text-align:center;">'
     cell = cell .. "" .. name .. "<br>"
     cell = cell .. "" .. name .. "<br>"
     cell = cell .. "<span style='color:#adadad'>".. event.id .. "</span><br>"
     cell = cell .. "<span style='color:#adadad'>".. id .. "</span><br>"
     cell = cell .. '[[File:' .. image .. '|64px]]'
     cell = cell .. '[[File:' .. image .. '|64px]]'
     cell = cell .. '</div>'
     cell = cell .. '</div>'
Строка 41: Строка 41:
for _, event in ipairs(eventData) do
for _, event in ipairs(eventData) do
         if event.id == searchId then
         if event.id == searchId then
             local cellEvent = buildCellEvent(name, image)
             local cellEvent = buildCellEvent(name, image, searchId)
             local advert = (event.StationEvent and event.StationEvent.startAnnouncement) or "Нет оповещения"
             local advert = (event.StationEvent and event.StationEvent.startAnnouncement) or "Нет оповещения"
             local characteristicsList = buildCharacteristicsList(frame, event.StationEvent or {})
             local characteristicsList = buildCharacteristicsList(frame, event.StationEvent or {})
Строка 70: Строка 70:
for _, event in ipairs(eventData) do
for _, event in ipairs(eventData) do
         if event.id == searchId then
         if event.id == searchId then
             local cellEvent = buildCellEvent(name, image)
             local cellEvent = buildCellEvent(name, image, searchId)
             local cargo = event.CargoGiftsRule or {}
             local cargo = event.CargoGiftsRule or {}
             local sender = cargo.sender or "Нет отправителя"
             local sender = cargo.sender or "Нет отправителя"