mirror of
https://github.com/AquariaOSE/Aquaria.git
synced 2025-06-07 17:11:56 +00:00
Add node_setActivationRange()
This commit is contained in:
parent
f6fc75a165
commit
eb56a93200
4 changed files with 12 additions and 3 deletions
|
@ -42,8 +42,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
std::vector<std::string> allowedMaps;
|
std::vector<std::string> allowedMaps;
|
||||||
|
|
||||||
const int PATH_ACTIVATION_RANGE = 800;
|
|
||||||
|
|
||||||
Vector worldLeftCenter(217,250), worldRightCenter(575, 250);
|
Vector worldLeftCenter(217,250), worldRightCenter(575, 250);
|
||||||
Vector opt_save_original = Vector(350, 350), opt_cancel_original = Vector(450, 350);
|
Vector opt_save_original = Vector(350, 350), opt_cancel_original = Vector(450, 350);
|
||||||
|
|
||||||
|
@ -10369,7 +10367,7 @@ void Game::update(float dt)
|
||||||
{
|
{
|
||||||
Vector diff = p->nodes[0].position - dsq->game->avatar->position;
|
Vector diff = p->nodes[0].position - dsq->game->avatar->position;
|
||||||
|
|
||||||
if (p->isCoordinateInside(dsq->game->avatar->position) || diff.getSquaredLength2D() < sqr(PATH_ACTIVATION_RANGE))
|
if (p->isCoordinateInside(dsq->game->avatar->position) || diff.getSquaredLength2D() < sqr(p->activationRange))
|
||||||
{
|
{
|
||||||
//if (trace(avatar->position, p->nodes[0].position))
|
//if (trace(avatar->position, p->nodes[0].position))
|
||||||
{
|
{
|
||||||
|
|
|
@ -54,6 +54,7 @@ Path::Path()
|
||||||
warpType = 0;
|
warpType = 0;
|
||||||
spiritFreeze = true;
|
spiritFreeze = true;
|
||||||
pauseFreeze = true;
|
pauseFreeze = true;
|
||||||
|
activationRange = 800;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Path::clampPosition(Vector *pos, float radius)
|
void Path::clampPosition(Vector *pos, float radius)
|
||||||
|
|
|
@ -145,6 +145,7 @@ public:
|
||||||
bool pauseFreeze;
|
bool pauseFreeze;
|
||||||
|
|
||||||
PathShape pathShape;
|
PathShape pathShape;
|
||||||
|
float activationRange;
|
||||||
|
|
||||||
|
|
||||||
void parseWarpNodeData(const std::string &dataString);
|
void parseWarpNodeData(const std::string &dataString);
|
||||||
|
|
|
@ -5006,6 +5006,14 @@ luaFunc(node_setCursorActivation)
|
||||||
luaReturnNil();
|
luaReturnNil();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
luaFunc(node_setActivationRange)
|
||||||
|
{
|
||||||
|
Path *p = path(L);
|
||||||
|
if(p)
|
||||||
|
p->activationRange = lua_tonumber(L, 2);
|
||||||
|
luaReturnNil();
|
||||||
|
}
|
||||||
|
|
||||||
luaFunc(node_setCatchActions)
|
luaFunc(node_setCatchActions)
|
||||||
{
|
{
|
||||||
Path *p = path(L);
|
Path *p = path(L);
|
||||||
|
@ -10053,6 +10061,7 @@ static const struct {
|
||||||
luaRegister(entity_isName),
|
luaRegister(entity_isName),
|
||||||
|
|
||||||
|
|
||||||
|
luaRegister(node_setActivationRange),
|
||||||
luaRegister(node_setCursorActivation),
|
luaRegister(node_setCursorActivation),
|
||||||
luaRegister(node_setCatchActions),
|
luaRegister(node_setCatchActions),
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue