mirror of
https://github.com/AquariaOSE/Aquaria.git
synced 2025-02-03 18:14:01 +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 = "";
|
||||
|
||||
bool versionlabel = false;
|
||||
|
||||
// new place where mods get stopped!
|
||||
// this lets recaching work
|
||||
// (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->continuity.reset();
|
||||
}
|
||||
versionlabel = true;
|
||||
}
|
||||
|
||||
dsq->collectScriptGarbage();
|
||||
|
@ -2602,7 +2605,7 @@ void Game::applyState()
|
|||
|
||||
AquariaGuiElement::canDirMoveGlobal = true;
|
||||
|
||||
dsq->toggleVersionLabel(false);
|
||||
dsq->toggleVersionLabel(versionlabel);
|
||||
|
||||
activation = true;
|
||||
|
||||
|
|
|
@ -7888,21 +7888,6 @@ luaFunc(findWall)
|
|||
luaReturnNum(wall);
|
||||
}
|
||||
|
||||
luaFunc(toggleVersionLabel)
|
||||
{
|
||||
bool on = getBool(L, 1);
|
||||
|
||||
dsq->toggleVersionLabel(on);
|
||||
|
||||
luaReturnBool(on);
|
||||
}
|
||||
|
||||
luaFunc(setVersionLabelText)
|
||||
{
|
||||
dsq->setVersionLabelText();
|
||||
luaReturnNil();
|
||||
}
|
||||
|
||||
luaFunc(setCutscene)
|
||||
{
|
||||
dsq->setCutscene(getBool(L, 1), getBool(L, 2));
|
||||
|
@ -10699,8 +10684,6 @@ static const struct {
|
|||
luaRegister(node_getShape),
|
||||
|
||||
luaRegister(toggleSteam),
|
||||
luaRegister(toggleVersionLabel),
|
||||
luaRegister(setVersionLabelText),
|
||||
|
||||
luaRegister(appendUserDataPath),
|
||||
|
||||
|
|
|
@ -3,3 +3,4 @@
|
|||
-- (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/oldfunctions.lua")
|
||||
|
|
|
@ -10,8 +10,6 @@ decrFlag = nil
|
|||
entity_sound = nil
|
||||
entity_toggleBone = nil
|
||||
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
|
||||
doModSelect = nil
|
||||
doLoadMenu = nil
|
||||
|
|
|
@ -34,7 +34,7 @@ local WARN_FUNCTIONS_VAL =
|
|||
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 =
|
||||
{
|
||||
entity_setCollideWithAvatar = true,
|
||||
|
@ -44,7 +44,6 @@ local DUMMY_FUNCTIONS =
|
|||
entity_addGroupVel = true,
|
||||
entity_avgVel = true,
|
||||
entity_fireAtTarget = true,
|
||||
entity_flipHToAvatar = true,
|
||||
entity_getBehaviorType = true,
|
||||
entity_isSaying = true,
|
||||
entity_moveTowardsGroupCenter = true,
|
||||
|
@ -68,6 +67,8 @@ local DUMMY_FUNCTIONS =
|
|||
entity_stopTimer = true,
|
||||
setEntityScript = true,
|
||||
streamSfx = true,
|
||||
toggleVersionLabel = true,
|
||||
setVersionLabelText = true,
|
||||
}
|
||||
|
||||
-- Deprecated stuff from v1.1's scripts/entities/entityinclude.lua
|
||||
|
@ -85,6 +86,12 @@ local function entity_watchSwimToEntitySide(ent1, ent2)
|
|||
entity_flipToEntity(ent2, ent1)
|
||||
end
|
||||
|
||||
-- Removed unused functions but re-implemented in Lua
|
||||
|
||||
local function entity_flipHToAvatar(me)
|
||||
return entity_flipToEntity(me, getNaija())
|
||||
end
|
||||
|
||||
|
||||
-- Duplicated and renamed functions
|
||||
local REPLACED_FUNCTIONS =
|
||||
|
@ -103,16 +110,20 @@ local REPLACED_FUNCTIONS =
|
|||
inp = toggleInput,
|
||||
isPlayingVoice = isStreamingVoice,
|
||||
playVoice = voice,
|
||||
|
||||
|
||||
-- These are unfortunately broken and can't be fixed.
|
||||
-- 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.
|
||||
-- (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.
|
||||
--msg = screenMessage,
|
||||
--castSong = singSong,
|
||||
|
||||
|
||||
-- entityinclude functions
|
||||
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.mbDown = false
|
||||
v.labelTimer = 0
|
||||
|
||||
function init(me)
|
||||
--stopAllVoice()
|
||||
|
@ -65,18 +64,9 @@ function init(me)
|
|||
fade(1, 0)
|
||||
fade(0, 1)
|
||||
fade2(0, 2, 1, 1, 1)
|
||||
|
||||
setVersionLabelText()
|
||||
toggleVersionLabel(1)
|
||||
|
||||
v.labelTimer = 0
|
||||
end
|
||||
|
||||
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))
|
||||
if isInputEnabled() then
|
||||
debugLog("calling disable input")
|
||||
|
|
Loading…
Add table
Reference in a new issue