mirror of
https://github.com/AquariaOSE/Aquaria.git
synced 2025-08-13 17:59:53 +00:00
Add Lua functions for bonelock control. Also make quad_setRepeatTexture() update tex params properly.
+ entity_setBoneLockRotation() + entity_setBoneLockOffset()
This commit is contained in:
parent
04cb3bba11
commit
66b0aa710f
3 changed files with 40 additions and 2 deletions
|
@ -137,6 +137,8 @@ bool Entity::setBoneLock(const BoneLock &boneLock)
|
||||||
|
|
||||||
onSetBoneLock();
|
onSetBoneLock();
|
||||||
|
|
||||||
|
updateBoneLock();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -343,6 +343,7 @@ public:
|
||||||
bool isEntityInside() const;
|
bool isEntityInside() const;
|
||||||
|
|
||||||
void updateSoundPosition();
|
void updateSoundPosition();
|
||||||
|
void updateBoneLock();
|
||||||
|
|
||||||
Vector getPushVec() const { return pushVec; }
|
Vector getPushVec() const { return pushVec; }
|
||||||
float getPushDamage() const { return pushDamage; }
|
float getPushDamage() const { return pushDamage; }
|
||||||
|
@ -419,8 +420,6 @@ protected:
|
||||||
|
|
||||||
Timer damageTimer;
|
Timer damageTimer;
|
||||||
|
|
||||||
void updateBoneLock();
|
|
||||||
|
|
||||||
float pushMaxSpeed;
|
float pushMaxSpeed;
|
||||||
std::string currentAnim;
|
std::string currentAnim;
|
||||||
LanceData *lancedata;
|
LanceData *lancedata;
|
||||||
|
|
|
@ -1889,7 +1889,10 @@ luaFunc(quad_setRepeatScale)
|
||||||
{
|
{
|
||||||
Quad *b = getQuad(L);
|
Quad *b = getQuad(L);
|
||||||
if (b)
|
if (b)
|
||||||
|
{
|
||||||
b->repeatToFillScale = Vector(lua_tonumber(L, 2), lua_tonumber(L, 3));
|
b->repeatToFillScale = Vector(lua_tonumber(L, 2), lua_tonumber(L, 3));
|
||||||
|
b->refreshRepeatTextureToFill();
|
||||||
|
}
|
||||||
luaReturnNil();
|
luaReturnNil();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2954,6 +2957,38 @@ luaFunc(entity_setBoneLock)
|
||||||
luaReturnBool(ret);
|
luaReturnBool(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
luaFunc(entity_setBoneLockRotation)
|
||||||
|
{
|
||||||
|
bool ret = false;
|
||||||
|
if(Entity *e = entity(L))
|
||||||
|
{
|
||||||
|
if(BoneLock *bl = e->getBoneLock())
|
||||||
|
{
|
||||||
|
bl->origRot = lua_tonumber(L, 2);
|
||||||
|
e->updateBoneLock();
|
||||||
|
ret = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
luaReturnBool(ret);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
luaFunc(entity_setBoneLockOffset)
|
||||||
|
{
|
||||||
|
bool ret = false;
|
||||||
|
if(Entity *e = entity(L))
|
||||||
|
{
|
||||||
|
if(BoneLock *bl = e->getBoneLock())
|
||||||
|
{
|
||||||
|
bl->circleOffset.x = lua_tonumber(L, 2);
|
||||||
|
bl->circleOffset.y = lua_tonumber(L, 3);
|
||||||
|
e->updateBoneLock();
|
||||||
|
ret = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
luaReturnBool(ret);
|
||||||
|
}
|
||||||
|
|
||||||
luaFunc(entity_setIngredient)
|
luaFunc(entity_setIngredient)
|
||||||
{
|
{
|
||||||
Entity *e = entity(L);
|
Entity *e = entity(L);
|
||||||
|
@ -9935,6 +9970,8 @@ static const struct {
|
||||||
luaRegister(entity_getRidingRotation),
|
luaRegister(entity_getRidingRotation),
|
||||||
luaRegister(entity_getRidingFlip),
|
luaRegister(entity_getRidingFlip),
|
||||||
luaRegister(entity_setBoneLock),
|
luaRegister(entity_setBoneLock),
|
||||||
|
luaRegister(entity_setBoneLockRotation),
|
||||||
|
luaRegister(entity_setBoneLockOffset),
|
||||||
luaRegister(entity_setIngredient),
|
luaRegister(entity_setIngredient),
|
||||||
luaRegister(entity_setDeathScene),
|
luaRegister(entity_setDeathScene),
|
||||||
luaRegister(entity_isDeathScene),
|
luaRegister(entity_isDeathScene),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue