Module:Abilities/utils: Difference between revisionsGive feedback
Fix for lowercase abilities not appearing in tooltips |
mNo edit summary Tag: Manual revert |
||
| (8 intermediate revisions by 3 users not shown) | |||
| Line 29: | Line 29: | ||
return "Missing Ability Name" | return "Missing Ability Name" | ||
end | end | ||
-- Normalize input for case-insensitive comparison | |||
local normalized_input = string.lower(ability_name) | |||
-- Iterate through all heroes in the data | -- Iterate through all heroes in the data | ||
| Line 35: | Line 38: | ||
for ability_num, ability in pairs(ui_data) do | for ability_num, ability in pairs(ui_data) do | ||
local current_name = lang.get_string(ability.Key) | local current_name = lang.get_string(ability.Key) | ||
if | if string.lower(current_name) == normalized_input then | ||
return hero_key | |||
end | end | ||
end | end | ||