Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Discord server
Recent changes
Random page
Community
Discord
Steam
Search
Search
English
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Module:Abilities/icon
Module
Discussion
English
Read
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit source
View history
General
What links here
Related changes
Special pages
Page information
Languages
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
local data = mw.loadJsonData("Data:AbilityCards.json") local hero_release_module = require('Module:HeroData/release') local p = {} --Write's an ability link for a given ability name in english --Siphon Life --> Abrams#(1)_Siphon_Life function ability_to_hyperlink(ability_name_to_search) if (ability_name_to_search == nil) then return "No ability name provided" end local hero_name local ability_name local hero_status -- Iterate heros for hero_key, hero_data in pairs(data) do -- Iterate abilities hero_name = hero_data["Name"] hero_status = hero_release_module.get_hero_release_status(hero_key) if hero_status ~= nil then -- not nil means its either released or in hero labs for ability_num, ability_data in pairs(hero_data) do if (ability_num ~= "Name") then ability_name = ability_data["Name"] if (ability_name == ability_name_to_search) then -- Ability number and hero found -- "Siphon Life" > "Siphon_Life" ability_name = ability_name:gsub(" ", "_") return hero_name .. "#(" .. ability_num .. ")_" .. ability_name end end end end end return nil end --Writes an ability's icon from its name --Shoulder Charge --> [[File:Shoulder Charge.png|link=Abrams#(1)_Shoulder_Charge|size=20px]] [[Abrams...|Shoulder Charge]] p.write_ability_icon = function(frame) local ability_name = frame.args[1] local custom_display_text = frame.args[2] if (custom_display_text == nil or custom_display_text == "") then custom_display_text = ability_name end local size = 20 local hyperlink = ability_to_hyperlink(ability_name) if (hyperlink == nil) then return "Ability " .. ability_name .. " not found" end local icon = "[[File:" .. ability_name .. ".png|link=" .. hyperlink .. "|" .. size .. "px]]" icon = '<span style="position: relative; bottom: 2px; filter: brightness(100) saturate(100%);">' .. icon .. '</span>' local link = "[[" .. hyperlink .. "|" .. custom_display_text .. "]]" return icon .. " " .. link end return p
Summary:
Please note that all contributions to Deadlock Wiki are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
Deadlock:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Preview page with this template
Templates used on this page:
Module:Abilities/doc/submodules
(
edit
)
Module:Abilities/icon/doc
(
edit
)