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

мНет описания правки
мНет описания правки
Строка 40: Строка 40:
     local out = ""
     local out = ""
      
      
     for _, event in ipairs(eventData) do
     local event = eventData[searchId]
        if event.id == searchId then
    if event then
            local cellEvent = buildCellEvent(name, image, searchId)
        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 {})


            out = out .. "|-\n"
        out = out .. "|-\n"
            out = out .. "! " .. cellEvent .. "\n"
        out = out .. "! " .. cellEvent .. "\n"
            if advert ~= "" then  
        if advert ~= "" then  
                out = out .. "| {{#invoke:Ftl|main|translation|" .. advert .. "}}\n"
            out = out .. "| {{#invoke:Ftl|main|translation|" .. advert .. "}}\n"
            else
        else
                out = out .. "| Происходит без объявления\n"
            out = out .. "| Происходит без объявления\n"
            end
            out = out .. "| " .. description .. "\n"
            out = out .. "| " .. characteristicsList
            break
         end
         end
        out = out .. "| " .. description .. "\n"
        out = out .. "| " .. characteristicsList
     end
     end