Module:HeroData: Difference between revisionsGive feedback
added write_ground_dash_buckets function |
Undo revision 52296 by Monster Domosed (talk) accidentally removed get_hero_tag function Tag: Undo |
||
| Line 782: | Line 782: | ||
} | } | ||
-- | -- Function to call hero tags based on name | ||
p.get_hero_tag = function (frame) | |||
p. | local name = frame.args[1] | ||
local | local number = tonumber(frame.args[2]) | ||
-- Validate input | |||
return | if not name then | ||
return "Error: Missing name input." | |||
end | end | ||
if number ~= 1 and number ~= 2 and number ~= 3 then | |||
return string.format("Error: Invalid number '%s'. Must be 1, 2, or 3.", tostring(frame.args[2])) | |||
end | end | ||
local tagname = TAG_NAME_MAP[name] | |||
if not tagname then | |||
return string.format("Error: Unknown name '%s'.", name) | |||
end | end | ||
-- | -- Build localization key | ||
local | local key = string.format("Citadel_%s_HeroTag_%d", tagname, number) | ||
-- Call Lang.get_string | |||
local result = lang_module.get_string(key) | |||
return result or ("[Missing string for key: " .. key .. "]") | |||
end | end | ||
return p | return p | ||