Editing Module:Infobox itemGive feedback
Jump to navigation
Jump to search
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
| Latest revision | Your text | ||
| Line 15: | Line 15: | ||
local tostring = tostring | local tostring = tostring | ||
local type = type | local type = type | ||
-- Pre-computed constants | -- Pre-computed constants | ||
| Line 41: | Line 32: | ||
-- Item name override mapping (old name -> new name) | -- Item name override mapping (old name -> new name) | ||
local ITEM_NAME_OVERRIDES = { | local ITEM_NAME_OVERRIDES = { | ||
[" | ["Backstabber"] = "Stalker", | ||
} | } | ||
| Line 75: | Line 65: | ||
local function resolve_item_name(name) | local function resolve_item_name(name) | ||
-- Check if there's an override for this name | -- Check if there's an override for this name | ||
return ITEM_NAME_OVERRIDES[name] or name | |||
end | end | ||
| Line 236: | Line 205: | ||
if label == "" then return val_str end | if label == "" then return val_str end | ||
-- Resolve link priority: Override > JSON Stat | -- Resolve link priority: Override > Attribute Map Link > JSON Stat Link | ||
local link_target = link_override | local link_target = link_override | ||
if not link_target or link_target == "" then | if not link_target or link_target == "" then | ||
link_target = | link_target = attr_link | ||
end | end | ||
if not link_target or link_target == "" then | if not link_target or link_target == "" then | ||
link_target = | link_target = stat_links[prop_key] | ||
end | end | ||
| Line 306: | Line 275: | ||
icon_str = format("{{Icon/%s|[[File:%s|%spx|link=%s]]}}", color, img, 18, link or "") | icon_str = format("{{Icon/%s|[[File:%s|%spx|link=%s]]}}", color, img, 18, link or "") | ||
end | end | ||
return { | return { | ||
| Line 455: | Line 400: | ||
return append_conditional(val_str, allow_conditional, usage_flags) | return append_conditional(val_str, allow_conditional, usage_flags) | ||
end | end | ||
| Line 538: | Line 466: | ||
if item.StreetBrawl == true then | if item.StreetBrawl == true then | ||
insert(lines, "| street_brawl = true") | insert(lines, "| street_brawl = true") | ||
end | end | ||
| Line 609: | Line 531: | ||
main_formatter = function(obj) | main_formatter = function(obj) | ||
if obj.Key:match("^StatusEffect") then | if obj.Key:match("^StatusEffect") then | ||
return | return format(STATUS_FMT, obj.Key) | ||
end | end | ||
return format_value_enhanced( | return format_value_enhanced( | ||
| Line 617: | Line 539: | ||
end | end | ||
alt_formatter = function(obj) | alt_formatter = function(obj) | ||
return format_value_enhanced( | return format_value_enhanced( | ||
resolved_name, obj.Key, obj.Value, obj.Type, | resolved_name, obj.Key, obj.Value, obj.Type, | ||
| Line 629: | Line 548: | ||
main_formatter = function(obj) | main_formatter = function(obj) | ||
if obj.Key:match("^StatusEffect") then | if obj.Key:match("^StatusEffect") then | ||
return | return format(STATUS_FMT, obj.Key) | ||
end | end | ||
return format_value( | return format_value( | ||
| Line 637: | Line 556: | ||
end | end | ||
alt_formatter = function(obj) | alt_formatter = function(obj) | ||
return format_value( | return format_value( | ||
obj.Key, obj.Value, obj.Type, obj.LocTokenOverride, | obj.Key, obj.Value, obj.Type, obj.LocTokenOverride, | ||