Module:Inventory slot/Aliases: Difference between revisions
No edit summary |
fix damaged weapons and tools not having the proper tooltip (attack damage description) |
||
| Line 237: | Line 237: | ||
for _, toolProps in ipairs( tools ) do | for _, toolProps in ipairs( tools ) do | ||
local aliasName = toolProps[1] .. ' ' .. toolProps[2] | local aliasName = toolProps[1] .. ' ' .. toolProps[2] | ||
local damagedName = 'Damaged ' .. aliasName | |||
local text = '/&7When in main hand:/ &2' .. toolProps[3] .. ' Attack Speed/ &2' .. toolProps[4] .. ' Attack Damage' | |||
aliases[aliasName] = { title = aliasName, name = aliasName, text = text } | |||
-- add damaged here as well so it gets the proper tooltip | |||
aliases[damagedName] = { title = aliasName, name = damagedName, text = text } | |||
local materialGroup = toolProps[1]:lower(); | local materialGroup = toolProps[1]:lower(); | ||
| Line 444: | Line 448: | ||
end | end | ||
-- Damaged armor, tools and weapons -- | -- Damaged armor, note it skips tools and weapons as they are handled above to add the damage tooltip -- | ||
local damagedItems = { | local damagedItems = { | ||
'Bow', | 'Bow', | ||
| Line 453: | Line 457: | ||
'Chainmail Leggings', | 'Chainmail Leggings', | ||
'Crossbow', | 'Crossbow', | ||
'Diamond Boots', | 'Diamond Boots', | ||
'Diamond Chestplate', | 'Diamond Chestplate', | ||
'Diamond Helmet', | 'Diamond Helmet', | ||
'Diamond Leggings', | 'Diamond Leggings', | ||
'Elytra', | 'Elytra', | ||
'Fishing Rod', | 'Fishing Rod', | ||
'Flint and Steel', | 'Flint and Steel', | ||
'Golden Boots', | 'Golden Boots', | ||
'Golden Chestplate', | 'Golden Chestplate', | ||
'Golden Helmet', | 'Golden Helmet', | ||
'Golden Leggings', | 'Golden Leggings', | ||
'Iron Boots', | 'Iron Boots', | ||
'Iron Chestplate', | 'Iron Chestplate', | ||
'Iron Helmet', | 'Iron Helmet', | ||
'Iron Leggings', | 'Iron Leggings', | ||
'Leather Boots', | 'Leather Boots', | ||
'Leather Tunic', | 'Leather Tunic', | ||
'Leather Cap', | 'Leather Cap', | ||
'Leather Pants', | 'Leather Pants', | ||
'Netherite Boots', | 'Netherite Boots', | ||
'Netherite Chestplate', | 'Netherite Chestplate', | ||
'Netherite Helmet', | 'Netherite Helmet', | ||
'Netherite Leggings', | 'Netherite Leggings', | ||
'Shears', | 'Shears', | ||
'Shield | 'Shield' | ||
} | } | ||
for _, item in ipairs( damagedItems ) do | for _, item in ipairs( damagedItems ) do | ||