Advertisement
naista2002

Untitled

May 10th, 2015
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.40 KB | None | 0 0
  1. -- Crafting table
  2. function p.craftingTable( f )
  3.     local args = f
  4.     if f == mw.getCurrentFrame() then
  5.         args = f:getParent().args
  6.     end
  7.    
  8.     local arrow = 'Arrow (small)'
  9.     local shapeless = ''
  10.    
  11.     if args["Стрелка"] or '' ~= '' then
  12.         arrow = args["Стрелка"]
  13.     end
  14.     if args["бесформенный"] or '' ~= '' then
  15.         shapeless = '<span title="Этот рецепт&nbsp;&mdash; бесформенный; ресурсы могут располагаться в сетке верстака в любом порядке.">[[File:Grid layout Shapeless.png|link=]]</span>'
  16.     elseif args["фиксированный"] or '' ~= '' then
  17.         local notFixed = ''
  18.         if args["нефиксировано"] or '' ~= '' then
  19.             notFixed = ', кроме ' .. args["нефиксировано"]
  20.         end
  21.         shapeless = '<span title="Этот рецепт&nbsp;&mdash; фиксированный, его ингредиенты не могут быть перемещены или зеркально отражены' .. notFixed .. '.">[[File:Grid layout Fixed.png|link=]]</span>'
  22.     end
  23.    
  24.     local html = {
  25.         '{| class="grid-Crafting_Table" cellpadding="0" cellspacing="0"',
  26.         '| ' .. p.cell{ args.A1, ["моды"] = args["Моды"], ["ссылка"] = args["A1Ссылка"], ["назв"] = args["A1Назв"] },
  27.         '| ' .. p.cell{ args.B1, ["моды"] = args["Моды"], ["ссылка"] = args["B1Ссылка"], ["назв"] = args["B1Назв"] },
  28.         '| ' .. p.cell{ args.C1, ["моды"] = args["Моды"], ["ссылка"] = args["C1Ссылка"], ["назв"] = args["C1Назв"] },
  29.         '| rowspan="2" class="arrow" | [[File:Grid layout ' .. arrow .. '.png|link=]]',
  30.         '| rowspan="3" | ' .. p.cell{ args.Output, mod = args.Mod, link = args.Olink, title = args.Otitle, class = 'output' },
  31.         '|-',
  32.         '| ' .. p.cell{ args.A2, mod = args.Mod, link = args.A2link, title = args.A2title },
  33.         '| ' .. p.cell{ args.B2, mod = args.Mod, link = args.B2link, title = args.B2title },
  34.         '| ' .. p.cell{ args.C2, mod = args.Mod, link = args.C2link, title = args.C2title },
  35.         '|-',
  36.         '| ' .. p.cell{ args.A3, mod = args.Mod, link = args.A3link, title = args.A3title },
  37.         '| ' .. p.cell{ args.B3, mod = args.Mod, link = args.B3link, title = args.B3title },
  38.         '| ' .. p.cell{ args.C3, mod = args.Mod, link = args.C3link, title = args.C3title },
  39.         '| class="shapeless" | ' .. shapeless,
  40.         '|}'
  41.     }
  42.    
  43.     return table.concat( html, '\n' );
  44. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement