forked from OpenNeo/impress
use basic image hash on items stuff
This commit is contained in:
parent
f99c7527d0
commit
2501e6e21f
2 changed files with 6 additions and 2 deletions
|
@ -69,7 +69,7 @@ module ItemsHelper
|
|||
def pet_type_image(pet_type, emotion, size)
|
||||
emotion_id = PetTypeImage::Emotions[emotion]
|
||||
size_id = PetTypeImage::Sizes[size]
|
||||
src = sprintf(PetTypeImage::Format, pet_type.image_hash, emotion_id, size_id)
|
||||
src = sprintf(PetTypeImage::Format, pet_type.basic_image_hash, emotion_id, size_id)
|
||||
human_name = pet_type.species.name.humanize
|
||||
image_tag(src, :alt => human_name, :title => human_name)
|
||||
end
|
||||
|
|
|
@ -62,7 +62,11 @@ class PetType < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def image_hash
|
||||
self['image_hash'] || BasicHashes[species.name][color.name]
|
||||
self['image_hash'] || basic_image_hash
|
||||
end
|
||||
|
||||
def basic_image_hash
|
||||
BasicHashes[species.name][color.name]
|
||||
end
|
||||
|
||||
def human_name
|
||||
|
|
Loading…
Reference in a new issue