* Simplify photo meta (wield image falls back to inventory image)
This commit is contained in:
parent
c84edc1345
commit
f3ac2bde3e
12
init.lua
12
init.lua
|
@ -22,17 +22,9 @@ local create_photo_item = function( pixels )
|
|||
local image = tga_encoder.image( pixels )
|
||||
image:encode()
|
||||
local texture_string = "[png:" .. minetest.encode_base64( image.data )
|
||||
meta:set_string(
|
||||
"xcam:texture",
|
||||
texture_string
|
||||
)
|
||||
meta:set_string(
|
||||
"inventory_image",
|
||||
"${xcam:texture}"
|
||||
)
|
||||
meta:set_string(
|
||||
"wield_image",
|
||||
"${xcam:texture}"
|
||||
texture_string
|
||||
)
|
||||
|
||||
return itemstack
|
||||
|
@ -252,7 +244,7 @@ minetest.register_entity(
|
|||
assert( self._itemstring )
|
||||
local itemstack = ItemStack(self._itemstring)
|
||||
local meta = itemstack:get_meta()
|
||||
local texture = meta:get_string("xcam:texture")
|
||||
local texture = meta:get_string("inventory_image")
|
||||
|
||||
self.object:set_properties({
|
||||
selectionbox = sbox,
|
||||
|
|
Loading…
Reference in New Issue