Module:Sandbox/Samlovesmath/Infobox hero: Difference between revisionsGive feedback
Samlovesmath (talk | contribs) added "hero_has_tags", included "herodata" module, reintegrated "Infobox_hero.json" |
Samlovesmath (talk | contribs) added "hero_has_scalars()" |
||
| Line 3: | Line 3: | ||
local theme_data = mw.loadJsonData("Data:Samlovesmath/Infobox_hero.json") | local theme_data = mw.loadJsonData("Data:Samlovesmath/Infobox_hero.json") | ||
local heroes_data_module = require('Module:HeroData') | local heroes_data_module = require('Module:HeroData') | ||
function p.hero_has_scalars(frame) | |||
local frameHero = frame.args[1] | |||
local frameStat = frame.args[2] | |||
local frame = mw.getCurrentFrame() | |||
newFrameSpirit = frame:newChild{title = "Module:HeroData", args = {frameHero, "Spirit", frameStat}} | |||
newFrameLevel = frame:newChild{title = "Module:HeroData", args = {frameHero, "Level", frameStat}} | |||
spiritResult = heroes_data_module.get_hero_scalar(newFrameSpirit) | |||
levelResult = heroes_data_module.get_hero_scalar(newFrameLevel) | |||
if (spiritResult ~= nil and spiritResult ~= "") or (levelResult ~= nil and levelResult ~= "") then | |||
return true | |||
end | |||
return false | |||
end | |||
function p.hero_has_tags(frame) | function p.hero_has_tags(frame) | ||