mirror of
https://github.com/AquariaOSE/Aquaria.git
synced 2025-05-10 19:13:44 +00:00
Remove Lua functions:
- toggleVersionLabel() - setVersionLabelText() + Implement compat function entity_flipHToAvatar() properly
This commit is contained in:
parent
d7ff053efd
commit
fb3d27fcfe
6 changed files with 22 additions and 36 deletions
|
@ -2576,16 +2576,19 @@ void Game::applyState()
|
||||||
|
|
||||||
dsq->returnToScene = "";
|
dsq->returnToScene = "";
|
||||||
|
|
||||||
|
bool versionlabel = false;
|
||||||
|
|
||||||
// new place where mods get stopped!
|
// new place where mods get stopped!
|
||||||
// this lets recaching work
|
// this lets recaching work
|
||||||
// (presumably because there has been time for the garbage to be cleared)
|
// (presumably because there has been time for the garbage to be cleared)
|
||||||
if (sceneToLoad == "title" && dsq->mod.isShuttingDown())
|
if (sceneToLoad == "title")
|
||||||
{
|
{
|
||||||
if (dsq->mod.isActive())
|
if (dsq->mod.isActive() && dsq->mod.isShuttingDown())
|
||||||
{
|
{
|
||||||
dsq->mod.stop();
|
dsq->mod.stop();
|
||||||
dsq->continuity.reset();
|
dsq->continuity.reset();
|
||||||
}
|
}
|
||||||
|
versionlabel = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
dsq->collectScriptGarbage();
|
dsq->collectScriptGarbage();
|
||||||
|
@ -2602,7 +2605,7 @@ void Game::applyState()
|
||||||
|
|
||||||
AquariaGuiElement::canDirMoveGlobal = true;
|
AquariaGuiElement::canDirMoveGlobal = true;
|
||||||
|
|
||||||
dsq->toggleVersionLabel(false);
|
dsq->toggleVersionLabel(versionlabel);
|
||||||
|
|
||||||
activation = true;
|
activation = true;
|
||||||
|
|
||||||
|
|
|
@ -7888,21 +7888,6 @@ luaFunc(findWall)
|
||||||
luaReturnNum(wall);
|
luaReturnNum(wall);
|
||||||
}
|
}
|
||||||
|
|
||||||
luaFunc(toggleVersionLabel)
|
|
||||||
{
|
|
||||||
bool on = getBool(L, 1);
|
|
||||||
|
|
||||||
dsq->toggleVersionLabel(on);
|
|
||||||
|
|
||||||
luaReturnBool(on);
|
|
||||||
}
|
|
||||||
|
|
||||||
luaFunc(setVersionLabelText)
|
|
||||||
{
|
|
||||||
dsq->setVersionLabelText();
|
|
||||||
luaReturnNil();
|
|
||||||
}
|
|
||||||
|
|
||||||
luaFunc(setCutscene)
|
luaFunc(setCutscene)
|
||||||
{
|
{
|
||||||
dsq->setCutscene(getBool(L, 1), getBool(L, 2));
|
dsq->setCutscene(getBool(L, 1), getBool(L, 2));
|
||||||
|
@ -10699,8 +10684,6 @@ static const struct {
|
||||||
luaRegister(node_getShape),
|
luaRegister(node_getShape),
|
||||||
|
|
||||||
luaRegister(toggleSteam),
|
luaRegister(toggleSteam),
|
||||||
luaRegister(toggleVersionLabel),
|
|
||||||
luaRegister(setVersionLabelText),
|
|
||||||
|
|
||||||
luaRegister(appendUserDataPath),
|
luaRegister(appendUserDataPath),
|
||||||
|
|
||||||
|
|
|
@ -3,3 +3,4 @@
|
||||||
-- (In this case and for 1.1.x/Steam compatibility, use "legacy" or "legacy-strict")
|
-- (In this case and for 1.1.x/Steam compatibility, use "legacy" or "legacy-strict")
|
||||||
|
|
||||||
dofile("scripts/compat/internal/osestubs.lua")
|
dofile("scripts/compat/internal/osestubs.lua")
|
||||||
|
dofile("scripts/compat/internal/oldfunctions.lua")
|
||||||
|
|
|
@ -10,8 +10,6 @@ decrFlag = nil
|
||||||
entity_sound = nil
|
entity_sound = nil
|
||||||
entity_toggleBone = nil
|
entity_toggleBone = nil
|
||||||
isPlat = nil -- should not matter on the Lua side what the platform is
|
isPlat = nil -- should not matter on the Lua side what the platform is
|
||||||
toggleVersionLabel = nil
|
|
||||||
setVersionLabelText = nil
|
|
||||||
quit = nil -- mods should not do this ever
|
quit = nil -- mods should not do this ever
|
||||||
doModSelect = nil
|
doModSelect = nil
|
||||||
doLoadMenu = nil
|
doLoadMenu = nil
|
||||||
|
|
|
@ -34,7 +34,7 @@ local WARN_FUNCTIONS_VAL =
|
||||||
isInDialog = false,
|
isInDialog = false,
|
||||||
}
|
}
|
||||||
|
|
||||||
-- These had no function and we can just ignore the call
|
-- These had no effective function and we can just ignore the call
|
||||||
local DUMMY_FUNCTIONS =
|
local DUMMY_FUNCTIONS =
|
||||||
{
|
{
|
||||||
entity_setCollideWithAvatar = true,
|
entity_setCollideWithAvatar = true,
|
||||||
|
@ -44,7 +44,6 @@ local DUMMY_FUNCTIONS =
|
||||||
entity_addGroupVel = true,
|
entity_addGroupVel = true,
|
||||||
entity_avgVel = true,
|
entity_avgVel = true,
|
||||||
entity_fireAtTarget = true,
|
entity_fireAtTarget = true,
|
||||||
entity_flipHToAvatar = true,
|
|
||||||
entity_getBehaviorType = true,
|
entity_getBehaviorType = true,
|
||||||
entity_isSaying = true,
|
entity_isSaying = true,
|
||||||
entity_moveTowardsGroupCenter = true,
|
entity_moveTowardsGroupCenter = true,
|
||||||
|
@ -68,6 +67,8 @@ local DUMMY_FUNCTIONS =
|
||||||
entity_stopTimer = true,
|
entity_stopTimer = true,
|
||||||
setEntityScript = true,
|
setEntityScript = true,
|
||||||
streamSfx = true,
|
streamSfx = true,
|
||||||
|
toggleVersionLabel = true,
|
||||||
|
setVersionLabelText = true,
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Deprecated stuff from v1.1's scripts/entities/entityinclude.lua
|
-- Deprecated stuff from v1.1's scripts/entities/entityinclude.lua
|
||||||
|
@ -85,6 +86,12 @@ local function entity_watchSwimToEntitySide(ent1, ent2)
|
||||||
entity_flipToEntity(ent2, ent1)
|
entity_flipToEntity(ent2, ent1)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Removed unused functions but re-implemented in Lua
|
||||||
|
|
||||||
|
local function entity_flipHToAvatar(me)
|
||||||
|
return entity_flipToEntity(me, getNaija())
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
-- Duplicated and renamed functions
|
-- Duplicated and renamed functions
|
||||||
local REPLACED_FUNCTIONS =
|
local REPLACED_FUNCTIONS =
|
||||||
|
@ -107,12 +114,16 @@ local REPLACED_FUNCTIONS =
|
||||||
-- These are unfortunately broken and can't be fixed.
|
-- These are unfortunately broken and can't be fixed.
|
||||||
-- They are interface function names and the first loaded script would grab them,
|
-- They are interface function names and the first loaded script would grab them,
|
||||||
-- thinking an interface function with that name was provided by whichever script was just loaded.
|
-- thinking an interface function with that name was provided by whichever script was just loaded.
|
||||||
|
-- (This happens to be Li if he's available, or any other entity if he's not spawned)
|
||||||
-- So we ignore these and hope nobody misses them.
|
-- So we ignore these and hope nobody misses them.
|
||||||
--msg = screenMessage,
|
--msg = screenMessage,
|
||||||
--castSong = singSong,
|
--castSong = singSong,
|
||||||
|
|
||||||
-- entityinclude functions
|
-- entityinclude functions
|
||||||
entity_watchSwimToEntitySide = entity_watchSwimToEntitySide,
|
entity_watchSwimToEntitySide = entity_watchSwimToEntitySide,
|
||||||
|
|
||||||
|
-- removed from C++ but implemented in Lua
|
||||||
|
entity_flipHToAvatar = entity_flipHToAvatar,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,6 @@ if not AQUARIA_VERSION then dofile("scripts/entities/entityinclude.lua") end
|
||||||
|
|
||||||
v.n = 0
|
v.n = 0
|
||||||
v.mbDown = false
|
v.mbDown = false
|
||||||
v.labelTimer = 0
|
|
||||||
|
|
||||||
function init(me)
|
function init(me)
|
||||||
--stopAllVoice()
|
--stopAllVoice()
|
||||||
|
@ -65,18 +64,9 @@ function init(me)
|
||||||
fade(1, 0)
|
fade(1, 0)
|
||||||
fade(0, 1)
|
fade(0, 1)
|
||||||
fade2(0, 2, 1, 1, 1)
|
fade2(0, 2, 1, 1, 1)
|
||||||
|
|
||||||
setVersionLabelText()
|
|
||||||
toggleVersionLabel(1)
|
|
||||||
|
|
||||||
v.labelTimer = 0
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function update(me, dt)
|
function update(me, dt)
|
||||||
v.labelTimer = v.labelTimer + dt
|
|
||||||
if v.labelTimer > 0.5 then
|
|
||||||
setVersionLabelText()
|
|
||||||
end
|
|
||||||
cam_setPosition(node_x(me), node_y(me))
|
cam_setPosition(node_x(me), node_y(me))
|
||||||
if isInputEnabled() then
|
if isInputEnabled() then
|
||||||
debugLog("calling disable input")
|
debugLog("calling disable input")
|
||||||
|
|
Loading…
Add table
Reference in a new issue