rename entity:set_rig to entity:set_skeleton
This commit is contained in:
parent
6214bf4a19
commit
3b24982c0d
@ -30,7 +30,7 @@ do -- setup visuals
|
|||||||
local bid = block.index(icon:sub(16))
|
local bid = block.index(icon:sub(16))
|
||||||
model = block.get_model(bid)
|
model = block.get_model(bid)
|
||||||
if model == "X" then
|
if model == "X" then
|
||||||
entity:set_rig("base:drop-item")
|
entity:set_skeleton("base:drop-item")
|
||||||
body:set_size(vec3.mul(body:get_size(), {1.0, 0.3, 1.0}))
|
body:set_size(vec3.mul(body:get_size(), {1.0, 0.3, 1.0}))
|
||||||
rig:set_texture("$0", icon)
|
rig:set_texture("$0", icon)
|
||||||
else
|
else
|
||||||
@ -46,7 +46,7 @@ do -- setup visuals
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
entity:set_rig("base:drop-item")
|
entity:set_skeleton("base:drop-item")
|
||||||
body:set_size(vec3.mul(body:get_size(), {1.0, 0.3, 1.0}))
|
body:set_size(vec3.mul(body:get_size(), {1.0, 0.3, 1.0}))
|
||||||
rig:set_texture("$0", icon)
|
rig:set_texture("$0", icon)
|
||||||
end
|
end
|
||||||
|
|||||||
@ -52,7 +52,7 @@ end
|
|||||||
|
|
||||||
local Entity = {__index={
|
local Entity = {__index={
|
||||||
despawn=function(self) return entities.despawn(self.eid) end,
|
despawn=function(self) return entities.despawn(self.eid) end,
|
||||||
set_rig=function(self, s) return entities.set_rig(self.eid, s) end,
|
set_skeleton=function(self, s) return entities.set_skeleton(self.eid, s) end,
|
||||||
get_component=function(self, name) return self.components[name] end,
|
get_component=function(self, name) return self.components[name] end,
|
||||||
has_component=function(self, name) return self.components[name] ~= nil end,
|
has_component=function(self, name) return self.components[name] ~= nil end,
|
||||||
get_uid=function(self) return self.eid end,
|
get_uid=function(self) return self.eid end,
|
||||||
|
|||||||
@ -32,7 +32,7 @@ static int l_despawn(lua::State* L) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int l_set_rig(lua::State* L) {
|
static int l_set_skeleton(lua::State* L) {
|
||||||
if (auto entity = get_entity(L, 1)) {
|
if (auto entity = get_entity(L, 1)) {
|
||||||
std::string skeletonName = lua::require_string(L, 2);
|
std::string skeletonName = lua::require_string(L, 2);
|
||||||
auto rigConfig = content->getRig(skeletonName);
|
auto rigConfig = content->getRig(skeletonName);
|
||||||
@ -48,6 +48,6 @@ const luaL_Reg entitylib [] = {
|
|||||||
{"exists", lua::wrap<l_exists>},
|
{"exists", lua::wrap<l_exists>},
|
||||||
{"spawn", lua::wrap<l_spawn>},
|
{"spawn", lua::wrap<l_spawn>},
|
||||||
{"despawn", lua::wrap<l_despawn>},
|
{"despawn", lua::wrap<l_despawn>},
|
||||||
{"set_rig", lua::wrap<l_set_rig>},
|
{"set_skeleton", lua::wrap<l_set_skeleton>},
|
||||||
{NULL, NULL}
|
{NULL, NULL}
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user