diff --git a/Aquaria/Entity.cpp b/Aquaria/Entity.cpp index 33d7185..d632866 100644 --- a/Aquaria/Entity.cpp +++ b/Aquaria/Entity.cpp @@ -137,6 +137,8 @@ bool Entity::setBoneLock(const BoneLock &boneLock) onSetBoneLock(); + updateBoneLock(); + return true; } diff --git a/Aquaria/Entity.h b/Aquaria/Entity.h index acf6666..01ee1dd 100644 --- a/Aquaria/Entity.h +++ b/Aquaria/Entity.h @@ -343,6 +343,7 @@ public: bool isEntityInside() const; void updateSoundPosition(); + void updateBoneLock(); Vector getPushVec() const { return pushVec; } float getPushDamage() const { return pushDamage; } @@ -419,8 +420,6 @@ protected: Timer damageTimer; - void updateBoneLock(); - float pushMaxSpeed; std::string currentAnim; LanceData *lancedata; diff --git a/Aquaria/ScriptInterface.cpp b/Aquaria/ScriptInterface.cpp index dd46dbf..48f0510 100644 --- a/Aquaria/ScriptInterface.cpp +++ b/Aquaria/ScriptInterface.cpp @@ -1889,7 +1889,10 @@ luaFunc(quad_setRepeatScale) { Quad *b = getQuad(L); if (b) + { b->repeatToFillScale = Vector(lua_tonumber(L, 2), lua_tonumber(L, 3)); + b->refreshRepeatTextureToFill(); + } luaReturnNil(); } @@ -2954,6 +2957,38 @@ luaFunc(entity_setBoneLock) 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) { Entity *e = entity(L); @@ -9935,6 +9970,8 @@ static const struct { luaRegister(entity_getRidingRotation), luaRegister(entity_getRidingFlip), luaRegister(entity_setBoneLock), + luaRegister(entity_setBoneLockRotation), + luaRegister(entity_setBoneLockOffset), luaRegister(entity_setIngredient), luaRegister(entity_setDeathScene), luaRegister(entity_isDeathScene),