No edit summary |
No edit summary |
||
(47 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
local p = {} | local p = {} | ||
function p.socketFileName(socket | function p.socketFileName(frame) | ||
local socket = frame.args[1] | |||
local sockets = { | local sockets = { | ||
cerulean = "Icon_RunesCapacity_Mini_001.png", | |||
cerulean = " | almandine = "Icon_RunesCapacity_Mini_002.png", | ||
almandine = " | malachite = "Icon_RunesCapacity_Mini_003.png", | ||
malachite = " | xantic = "Icon_RunesCapacity_Mini_004.png", | ||
xantic = " | rutile = "Icon_RunesCapacity_Mini_005.png", | ||
rutile = " | |||
} | } | ||
if contains(sockets, socket) == true then | if contains(sockets, socket) == true then | ||
return sockets[socket] | return sockets[socket] | ||
end | end | ||
return | return "Icon_RunesCapacity_Mini_000.png" | ||
end | end | ||
function p. | function p.rarityFileName(frame) | ||
local rarity = frame.args[1] | |||
local rarities = { | local rarities = { | ||
standard = " | standard = "UI_RuneSlot_Tier_Standard.png", | ||
rare = " | rare = "UI_RuneSlot_Tier_Rare.png", | ||
ultimate = " | ultimate = "UI_RuneSlot_Tier_Ultimate.png", | ||
transcendent = " | transcendent = "UI_RuneSlot_Tier_Transcendent.png", | ||
} | } | ||
if contains(rarities, rarity) == true then | if contains(rarities, rarity) == true then | ||
return rarities[rarity] | return rarities[rarity] | ||
end | end | ||
return " | return "UI_RuneSlot_Tier.png" | ||
end | end | ||
function p.moduleClassFileName(moduleClass | function p.moduleClassFileName(frame) | ||
local moduleClass = frame.args[1] | |||
local moduleClasses = { | local moduleClasses = { | ||
descendant ="Icon_RunesClass_Mini_0_Color.png", | descendant ="Icon_RunesClass_Mini_0_Color.png", | ||
Line 41: | Line 43: | ||
return moduleClasses[moduleClass] | return moduleClasses[moduleClass] | ||
end | end | ||
return moduleClasses[descendant] | return moduleClasses["descendant"] | ||
end | end | ||
function p.specialSlotFileName(specialSlot) | function p.specialSlotFileName(frame) | ||
local specialSlot = frame.args[1] | |||
local trimmedSpecialSlot = string.gsub(specialSlot, "_(.*)","") | |||
local specialSlots = { | local specialSlots = { | ||
Skill = "UI_RuneSlot_ChaBG01_Mini.png", | |||
Sub = "UI_RuneSlot_ChaBG02_Mini.png" | |||
} | } | ||
if contains(specialSlots, | if contains(specialSlots, trimmedSpecialSlot) == true then | ||
return specialSlots[ | return specialSlots[trimmedSpecialSlot] | ||
end | end | ||
return "" | return "UI_RuneSlot_ChaBG00_Mini.png" | ||
end | end | ||
function contains(table, key) | function contains(table, key) | ||
for _, value in pairs(table) do | for _, value in pairs(table) do | ||
if | if _ == key then | ||
return true | return true | ||
end | end |
Latest revision as of 07:06, 30 June 2024
Documentation for this module may be created at Module:ModuleGenerator/doc
local p = {} function p.socketFileName(frame) local socket = frame.args[1] local sockets = { cerulean = "Icon_RunesCapacity_Mini_001.png", almandine = "Icon_RunesCapacity_Mini_002.png", malachite = "Icon_RunesCapacity_Mini_003.png", xantic = "Icon_RunesCapacity_Mini_004.png", rutile = "Icon_RunesCapacity_Mini_005.png", } if contains(sockets, socket) == true then return sockets[socket] end return "Icon_RunesCapacity_Mini_000.png" end function p.rarityFileName(frame) local rarity = frame.args[1] local rarities = { standard = "UI_RuneSlot_Tier_Standard.png", rare = "UI_RuneSlot_Tier_Rare.png", ultimate = "UI_RuneSlot_Tier_Ultimate.png", transcendent = "UI_RuneSlot_Tier_Transcendent.png", } if contains(rarities, rarity) == true then return rarities[rarity] end return "UI_RuneSlot_Tier.png" end function p.moduleClassFileName(frame) local moduleClass = frame.args[1] local moduleClasses = { descendant ="Icon_RunesClass_Mini_0_Color.png", general = "Icon_RunesClass_Mini_A_Color.png", special = "Icon_RunesClass_Mini_B_Color.png", impact = "Icon_RunesClass_Mini_C_Color.png", highpower = "Icon_RunesClass_Mini_D_Color.png", melee = "Icon_RunesClass_Mini_Melee_Color.png" } if contains(moduleClasses, moduleClass) == true then return moduleClasses[moduleClass] end return moduleClasses["descendant"] end function p.specialSlotFileName(frame) local specialSlot = frame.args[1] local trimmedSpecialSlot = string.gsub(specialSlot, "_(.*)","") local specialSlots = { Skill = "UI_RuneSlot_ChaBG01_Mini.png", Sub = "UI_RuneSlot_ChaBG02_Mini.png" } if contains(specialSlots, trimmedSpecialSlot) == true then return specialSlots[trimmedSpecialSlot] end return "UI_RuneSlot_ChaBG00_Mini.png" end function contains(table, key) for _, value in pairs(table) do if _ == key then return true end end return false end return p