mirror of
https://github.com/AquariaOSE/Aquaria.git
synced 2024-11-15 22:19:07 +00:00
Add Lua functions: getZoom(), setMaxLookDistance()
This commit is contained in:
parent
2cec85fd05
commit
b95dfee4c6
3 changed files with 17 additions and 1 deletions
|
@ -6175,6 +6175,7 @@ void Game::applyState()
|
|||
backgroundImageRepeat = 1;
|
||||
grad = 0;
|
||||
maxZoom = -1;
|
||||
maxLookDistance = 600;
|
||||
saveFile = 0;
|
||||
deathTimer = 0.9;
|
||||
runGameOverScript = false;
|
||||
|
@ -10301,7 +10302,7 @@ void Game::update(float dt)
|
|||
{
|
||||
if (avatar->looking && !dsq->game->isPaused()) {
|
||||
Vector diff = avatar->getAim();//dsq->getGameCursorPosition() - avatar->position;
|
||||
diff.capLength2D(600);
|
||||
diff.capLength2D(maxLookDistance);
|
||||
dest += diff;
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -708,6 +708,7 @@ public:
|
|||
void resetFromTitle();
|
||||
|
||||
float maxZoom;
|
||||
float maxLookDistance;
|
||||
|
||||
void setParallaxTextureCoordinates(Quad *q, float speed);
|
||||
|
||||
|
|
|
@ -5964,12 +5964,24 @@ luaFunc(overrideZoom)
|
|||
luaReturnNil();
|
||||
}
|
||||
|
||||
luaFunc(getZoom)
|
||||
{
|
||||
luaReturnNum(dsq->globalScale.x);
|
||||
}
|
||||
|
||||
luaFunc(disableOverrideZoom)
|
||||
{
|
||||
dsq->game->toggleOverrideZoom(false);
|
||||
luaReturnNil();
|
||||
}
|
||||
|
||||
luaFunc(setMaxLookDistance)
|
||||
{
|
||||
dsq->game->maxLookDistance = lua_tonumber(L, 1);
|
||||
luaReturnNil();
|
||||
}
|
||||
|
||||
|
||||
// dt, range, mod
|
||||
luaFunc(entity_doSpellAvoidance)
|
||||
{
|
||||
|
@ -9713,6 +9725,8 @@ static const struct {
|
|||
|
||||
luaRegister(overrideZoom),
|
||||
luaRegister(disableOverrideZoom),
|
||||
luaRegister(getZoom),
|
||||
luaRegister(setMaxLookDistance),
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue