Module:Inventory slot/Aliases: Difference between revisions

Revert: Previous edit *is working* but would break hundreds of potion inventory icons for a few days until .GIFs are uploaded
Animations: Added animated potions
Line 654: Line 654:
-- turtle master is weird, so just do a fancy string replacement
-- turtle master is weird, so just do a fancy string replacement
if effect.text then
if effect.text then
aliases[name] = { name = name, text = string.gsub( effect.text, '%$1', durations[1] ) }
aliases[name] = { name = name .. '.gif', text = string.gsub( effect.text, '%$1', durations[1] ) }
aliases[name .. ' Extended'] = { name = name, text = string.gsub( effect.text, '%$1', durations[2] ) }
aliases[name .. ' Extended'] = { name = name .. '.gif', text = string.gsub( effect.text, '%$1', durations[2] ) }
aliases[name .. ' Enhanced'] = { name = name, text = string.gsub( effect.enhanced, '%$1', durations[3] ) }
aliases[name .. ' Enhanced'] = { name = name .. '.gif', text = string.gsub( effect.enhanced, '%$1', durations[3] ) }
else
else
-- we always have normal
-- we always have normal
aliases[name] = { name = name, text = string.format( '%s (%s)', effect.effect, durations[1] ) }
aliases[name] = { name = name .. '.gif', text = string.format( '%s (%s)', effect.effect, durations[1] ) }
-- ensure we have extended
-- ensure we have extended
if durations[2] then
if durations[2] then
aliases[name .. ' Extended'] = { name = name, text = string.format( '%s (%s)', effect.effect, durations[2] ) }
aliases[name .. ' Extended'] = { name = name .. '.gif', text = string.format( '%s (%s)', effect.effect, durations[2] ) }
-- and enhanced, currently there is nothing with a duration that can be extended but not enhanced
-- and enhanced, currently there is nothing with a duration that can be extended but not enhanced
if effect.enhanced then
if effect.enhanced then
aliases[name .. ' Enhanced'] = { name = name, text = string.format( '%s %s (%s)', effect.effect, effect.enhanced, durations[3] ) }
aliases[name .. ' Enhanced'] = { name = name .. '.gif', text = string.format( '%s %s (%s)', effect.effect, effect.enhanced, durations[3] ) }
end
end
end
end
Line 673: Line 673:
else
else
-- otherwise its just effect, currently every potion with no duration can be enhanced
-- otherwise its just effect, currently every potion with no duration can be enhanced
aliases[name] = { name = name, text = effect.effect}
aliases[name] = { name = name .. '.gif', text = effect.effect}
aliases[name .. ' Enhanced'] = { name = name, text = effect.effect .. ' ' .. effect.enhanced }
aliases[name .. ' Enhanced'] = { name = name .. '.gif', text = effect.effect .. ' ' .. effect.enhanced }
end
end