Модуль:Песочница/Pok: различия между версиями
Pok (обсуждение | вклад) Нет описания правки |
Pok (обсуждение | вклад) мНет описания правки |
||
| Строка 22: | Строка 22: | ||
function p.main(frame) | function p.main(frame) | ||
-- Подключение CSS | -- Подключение CSS | ||
local cssLink = frame:extensionTag('templatestyles', '', { | local cssLink = frame:extensionTag('templatestyles', '', { | ||
| Строка 39: | Строка 36: | ||
local out = cssLink .. '<div class="research-group">' | local out = cssLink .. '<div class="research-group">' | ||
-- Поиск исследования по ID | |||
local tech = nil | |||
for _, research in ipairs(dataCache) do | |||
if research.technology and research.technology.id == researchId then | |||
tech = research.technology | |||
break | |||
end | |||
end | |||
if not tech then | |||
out = out .. '<div style="color:red;">Исследование с ID "' .. researchId .. '" не найдено.</div>' | |||
else | |||
local tierColor = tierColors[tech.tier] or "#FFFFFF" | |||
local disciplineName = disciplineMapping[tech.discipline] or "Неизвестная дисциплина" | |||
local iconPath = icon ~= "" and icon or (tech.icon and tech.icon.sprite or nil) | local iconPath = icon ~= "" and icon or (tech.icon and tech.icon.sprite or nil) | ||