Merge pull request #915 from diath/add_summon_indicator

Add creature type icons for summons
This commit is contained in:
Eduardo Bart
2017-11-20 12:03:09 -02:00
committed by GitHub
8 changed files with 65 additions and 6 deletions

View File

@@ -33,6 +33,12 @@ NpcIconTrade = 2
NpcIconQuest = 3
NpcIconTradeQuest = 4
CreatureTypePlayer = 0
CreatureTypeMonster = 1
CreatureTypeNpc = 2
CreatureTypeSummonOwn = 3
CreatureTypeSummonOther = 4
-- @}
function getNextSkullId(skullId)
@@ -104,6 +110,16 @@ function getEmblemImagePath(emblemId)
return path
end
function getTypeImagePath(creatureType)
local path
if creatureType == CreatureTypeSummonOwn then
path = '/images/game/creaturetype/summon_own'
elseif creatureType == CreatureTypeSummonOther then
path = '/images/game/creaturetype/summon_other'
end
return path
end
function getIconImagePath(iconId)
local path
if iconId == NpcIconChat then
@@ -139,9 +155,16 @@ function Creature:onEmblemChange(emblemId)
end
end
function Creature:onTypeChange(typeId)
local imagePath = getTypeImagePath(typeId)
if imagePath then
self:setTypeTexture(imagePath)
end
end
function Creature:onIconChange(iconId)
local imagePath = getIconImagePath(iconId)
if imagePath then
self:setIconTexture(imagePath)
end
end
end