Module:HeroData: Difference between revisionsGive feedback
Jump to navigation
Jump to search
m shortcut function localize(key, add_space_before_cap(fallback)) now used |
m write_role_playstyle_quote initial |
||
| Line 102: | Line 102: | ||
if (bound_abilities_data == nil) then return "Hero key " .. hero_key.. " has no BoundAbilities" end | if (bound_abilities_data == nil) then return "Hero key " .. hero_key.. " has no BoundAbilities" end | ||
return bound_abilities_data[tonumber(bound_slot_number)]["Key"] | return bound_abilities_data[tonumber(bound_slot_number)]["Key"] | ||
end | |||
p.write_role_playstyle_quote = function(frame) | |||
local hero_key = frame.args[1] | |||
local hero_data = heroes_data[hero_key] | |||
if (hero_data == nil) then return hero_key.." not found" end | |||
local role_key = hero_data["Role"] | |||
local role_localized = lang_module.get_string(role_key, nil, 'en') | |||
local playstyle_key = hero_data["Playstyle"] | |||
local playstyle_localized = lang_module.get_string(playstyle_key, nil, 'en') | |||
local str = "<b>" .. role_localized .. '</b><br>' .. playstyle_localized | |||
local template_args = {} | |||
template_args[1] = "" | |||
template_args[2] = str | |||
return frame:expandTemplate{title = 'Quotation', args = template_args} | |||
end | end | ||