mirror of
https://github.com/AquariaOSE/Aquaria.git
synced 2025-07-04 06:54:39 +00:00
New action: ACTION_PLACE_AVATAR. Add Lua functions:
- entity_getBoneLockData() - entity_getWeight()
This commit is contained in:
parent
a91a22f463
commit
fdae0fe9a4
3 changed files with 29 additions and 2 deletions
|
@ -163,7 +163,8 @@ enum AquariaActions
|
||||||
ACTION_TOGGLEWORLDMAPEDITOR ,
|
ACTION_TOGGLEWORLDMAPEDITOR ,
|
||||||
|
|
||||||
ACTION_LOOK ,
|
ACTION_LOOK ,
|
||||||
ACTION_TOGGLEHELPSCREEN
|
ACTION_TOGGLEHELPSCREEN,
|
||||||
|
ACTION_PLACE_AVATAR,
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef std::list<Entity*> EntityList;
|
typedef std::list<Entity*> EntityList;
|
||||||
|
|
|
@ -2338,6 +2338,7 @@ void SceneEditor::removeEntity()
|
||||||
void SceneEditor::placeAvatar()
|
void SceneEditor::placeAvatar()
|
||||||
{
|
{
|
||||||
dsq->game->avatar->position = dsq->getGameCursorPosition();
|
dsq->game->avatar->position = dsq->getGameCursorPosition();
|
||||||
|
dsq->game->action(ACTION_PLACE_AVATAR, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SceneEditor::scaleElementUp()
|
void SceneEditor::scaleElementUp()
|
||||||
|
|
|
@ -2386,6 +2386,23 @@ luaFunc(entity_getBoneLockEntity)
|
||||||
luaReturnPtr(ent);
|
luaReturnPtr(ent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
luaFunc(entity_getBoneLockData)
|
||||||
|
{
|
||||||
|
Entity *e = entity(L);
|
||||||
|
if (!e)
|
||||||
|
luaReturnNil();
|
||||||
|
BoneLock b = *e->getBoneLock(); // always safe to deref
|
||||||
|
|
||||||
|
lua_pushboolean(L, b.on);
|
||||||
|
luaPushPointer(L, b.bone);
|
||||||
|
lua_pushnumber(L, b.origRot);
|
||||||
|
lua_pushnumber(L, b.wallNormal.x);
|
||||||
|
lua_pushnumber(L, b.wallNormal.y);
|
||||||
|
lua_pushnumber(L, b.localOffset.x);
|
||||||
|
lua_pushnumber(L, b.localOffset.y);
|
||||||
|
return 7;
|
||||||
|
}
|
||||||
|
|
||||||
luaFunc(entity_ensureLimit)
|
luaFunc(entity_ensureLimit)
|
||||||
{
|
{
|
||||||
Entity *e = entity(L);
|
Entity *e = entity(L);
|
||||||
|
@ -5591,7 +5608,7 @@ luaFunc(entity_setBounce)
|
||||||
{
|
{
|
||||||
CollideEntity *e = collideEntity(L);
|
CollideEntity *e = collideEntity(L);
|
||||||
if (e)
|
if (e)
|
||||||
e->bounceAmount = e->bounceEntityAmount = lua_tonumber(L, 2);
|
e->bounceAmount = lua_tonumber(L, 2);
|
||||||
luaReturnNil();
|
luaReturnNil();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7819,6 +7836,12 @@ luaFunc(entity_setWeight)
|
||||||
luaReturnNil();
|
luaReturnNil();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
luaFunc(entity_getWeight)
|
||||||
|
{
|
||||||
|
CollideEntity *e = collideEntity(L);
|
||||||
|
luaReturnNum(e ? e->weight : 0.0f);
|
||||||
|
}
|
||||||
|
|
||||||
luaFunc(pickupGem)
|
luaFunc(pickupGem)
|
||||||
{
|
{
|
||||||
dsq->continuity.pickupGem(getString(L), !getBool(L, 2));
|
dsq->continuity.pickupGem(getString(L), !getBool(L, 2));
|
||||||
|
@ -8488,6 +8511,7 @@ static const struct {
|
||||||
luaRegister(entity_addIgnoreShotDamageType),
|
luaRegister(entity_addIgnoreShotDamageType),
|
||||||
luaRegister(entity_ensureLimit),
|
luaRegister(entity_ensureLimit),
|
||||||
luaRegister(entity_getBoneLockEntity),
|
luaRegister(entity_getBoneLockEntity),
|
||||||
|
luaRegister(entity_getBoneLockData),
|
||||||
|
|
||||||
luaRegister(entity_setRidingPosition),
|
luaRegister(entity_setRidingPosition),
|
||||||
luaRegister(entity_setRidingData),
|
luaRegister(entity_setRidingData),
|
||||||
|
@ -8626,6 +8650,7 @@ static const struct {
|
||||||
|
|
||||||
luaRegister(createEntity),
|
luaRegister(createEntity),
|
||||||
luaRegister(entity_setWeight),
|
luaRegister(entity_setWeight),
|
||||||
|
luaRegister(entity_getWeight),
|
||||||
|
|
||||||
luaRegister(entity_setActivationType),
|
luaRegister(entity_setActivationType),
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue