Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Crafting table
- function p.craftingTable( f )
- local args = f
- if f == mw.getCurrentFrame() then
- args = f:getParent().args
- end
- local arrow = 'Arrow (small)'
- local shapeless = ''
- if args["Стрелка"] or '' ~= '' then
- arrow = args["Стрелка"]
- end
- if args["бесформенный"] or '' ~= '' then
- shapeless = '<span title="Этот рецепт — бесформенный; ресурсы могут располагаться в сетке верстака в любом порядке.">[[File:Grid layout Shapeless.png|link=]]</span>'
- elseif args["фиксированный"] or '' ~= '' then
- local notFixed = ''
- if args["нефиксировано"] or '' ~= '' then
- notFixed = ', кроме ' .. args["нефиксировано"]
- end
- shapeless = '<span title="Этот рецепт — фиксированный, его ингредиенты не могут быть перемещены или зеркально отражены' .. notFixed .. '.">[[File:Grid layout Fixed.png|link=]]</span>'
- end
- local html = {
- '{| class="grid-Crafting_Table" cellpadding="0" cellspacing="0"',
- '| ' .. p.cell{ args.A1, ["моды"] = args["Моды"], ["ссылка"] = args["A1Ссылка"], ["назв"] = args["A1Назв"] },
- '| ' .. p.cell{ args.B1, ["моды"] = args["Моды"], ["ссылка"] = args["B1Ссылка"], ["назв"] = args["B1Назв"] },
- '| ' .. p.cell{ args.C1, ["моды"] = args["Моды"], ["ссылка"] = args["C1Ссылка"], ["назв"] = args["C1Назв"] },
- '| rowspan="2" class="arrow" | [[File:Grid layout ' .. arrow .. '.png|link=]]',
- '| rowspan="3" | ' .. p.cell{ args.Output, mod = args.Mod, link = args.Olink, title = args.Otitle, class = 'output' },
- '|-',
- '| ' .. p.cell{ args.A2, mod = args.Mod, link = args.A2link, title = args.A2title },
- '| ' .. p.cell{ args.B2, mod = args.Mod, link = args.B2link, title = args.B2title },
- '| ' .. p.cell{ args.C2, mod = args.Mod, link = args.C2link, title = args.C2title },
- '|-',
- '| ' .. p.cell{ args.A3, mod = args.Mod, link = args.A3link, title = args.A3title },
- '| ' .. p.cell{ args.B3, mod = args.Mod, link = args.B3link, title = args.B3title },
- '| ' .. p.cell{ args.C3, mod = args.Mod, link = args.C3link, title = args.C3title },
- '| class="shapeless" | ' .. shapeless,
- '|}'
- }
- return table.concat( html, '\n' );
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement