Editing Module:ItemData/navGive 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 1: | Line 1: | ||
local p = {} | local p = {} | ||
local items_data = mw.loadJsonData("Data:ItemData.json") | local items_data = mw.loadJsonData("Data:ItemData.json") | ||
| Line 12: | Line 10: | ||
["Spirit Lifesteal"] = "Spirit Lifesteal (item)" | ["Spirit Lifesteal"] = "Spirit Lifesteal (item)" | ||
} | } | ||
-- Cached items grouped by slot to prevent redundant full-table evaluations | -- Cached items grouped by slot to prevent redundant full-table evaluations | ||
| Line 105: | Line 93: | ||
if lang_code == "en" then | if lang_code == "en" then | ||
if is_street_brawl then | if is_street_brawl then | ||
item_template = "{{ItemBox|itemName=" .. item_name_english .. "|overrideLinkClick=" .. item_link .. "|overrideTier=5 | item_template = "{{ItemBox|itemName=" .. item_name_english .. "|overrideLinkClick=" .. item_link .. "|overrideTier=5}}" | ||
else | else | ||
item_template = "{{ItemBox|itemName=" .. item_name_english .. "|overrideLinkClick=" .. item_link | item_template = "{{ItemBox|itemName=" .. item_name_english .. "|overrideLinkClick=" .. item_link .. "}}" | ||
end | end | ||
else | else | ||
local link_local = item_link .. "/" .. lang_code | local link_local = item_link .. "/" .. lang_code | ||
if is_street_brawl then | if is_street_brawl then | ||
item_template = "{{ItemBox|itemName=" .. item_name_english .. "|overrideLinkClick=" .. link_local .. "|item_price={{#invoke:Lang|get_string|Citadel_ItemDraft_Legendary}} | item_template = "{{ItemBox|itemName=" .. item_name_english .. "|overrideLinkClick=" .. link_local .. "|item_price={{#invoke:Lang|get_string|Citadel_ItemDraft_Legendary}}}}" | ||
else | else | ||
item_template = "{{ItemBox|itemName=" .. item_name_english .. "|overrideLinkClick=" .. link_local | item_template = "{{ItemBox|itemName=" .. item_name_english .. "|overrideLinkClick=" .. link_local .. "}}" | ||
end | end | ||
end | end | ||
| Line 233: | Line 221: | ||
-- for [[Template:Active Items]] | -- for [[Template:Active Items]] | ||
function p.generate_active_items_table(frame) | function p.generate_active_items_table(frame) | ||
local active_items = {} | local active_items = {} | ||
| Line 295: | Line 231: | ||
item_data["Activation"] and | item_data["Activation"] and | ||
item_data["Activation"] ~= "Passive" then | item_data["Activation"] ~= "Passive" then | ||
table.insert(active_items, { | table.insert(active_items, { | ||
| Line 303: | Line 237: | ||
cost = cost, | cost = cost, | ||
slot = item_data["Slot"] or "Weapon", | slot = item_data["Slot"] or "Weapon", | ||
has_active_desc = item_data["ActiveDescription"] ~= nil | has_active_desc = item_data["ActiveDescription"] ~= nil | ||
}) | }) | ||
end | end | ||
| Line 322: | Line 252: | ||
! {{Souls|{{#invoke:Dictionary|translate|Cost}}}} | ! {{Souls|{{#invoke:Dictionary|translate|Cost}}}} | ||
! {{#invoke:Lang|get_string|Citadel_Mod_Tooltip_Active}} | ! {{#invoke:Lang|get_string|Citadel_Mod_Tooltip_Active}} | ||
! {{#invoke:Lang|get_string|AbilityCooldown_label | ! {{#invoke:Lang|get_string|AbilityCooldown_label}}]=]) | ||
for _, item in ipairs(active_items) do | for _, item in ipairs(active_items) do | ||
| Line 345: | Line 273: | ||
| data-sort-value="%d" style="text-align:center;font-size:15px" | {{Souls|%d}} | | data-sort-value="%d" style="text-align:center;font-size:15px" | {{Souls|%d}} | ||
| {{#invoke:Utilities|process_variables|%s_active_desc|%s}}{{#invoke:Utilities|process_variables|%s_desc|%s}}{{#invoke:Utilities|process_variables|%s_active|%s}} | | {{#invoke:Utilities|process_variables|%s_active_desc|%s}}{{#invoke:Utilities|process_variables|%s_desc|%s}}{{#invoke:Utilities|process_variables|%s_active|%s}} | ||
%s | | style="text-align:center;font-size:16px" | {{#invoke:ItemData|get_prop|%s|AbilityCooldown}}s]=], | ||
bg_color, | bg_color, | ||
item.name, | item.name, | ||
| Line 354: | Line 280: | ||
item.cost, item.cost, | item.cost, item.cost, | ||
item.key, item.name, item.key, item.name, item.key, item.name, | item.key, item.name, item.key, item.name, item.key, item.name, | ||
item.name) | |||
table.insert(rows, row) | table.insert(rows, row) | ||
| Line 362: | Line 286: | ||
table.insert(rows, "\n|}") | table.insert(rows, "\n|}") | ||
return | return frame:preprocess(table.concat(rows, "\n")) | ||
end | end | ||
return p | return p | ||