Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/source/game/StarPlayer.cpp
diff options
context:
space:
mode:
authorKae <80987908+Novaenia@users.noreply.github.com>2025-04-26 03:48:26 +1000
committerKae <80987908+Novaenia@users.noreply.github.com>2025-04-26 03:48:26 +1000
commit87751c5a84925cbd9d630c65738e0e77b01a66f0 (patch)
tree9ecfd6479a14fef5916b5dafa056f4d360757e39 /source/game/StarPlayer.cpp
parent6369ba9ec72f097d8cc9ab06bed0c6816da516c8 (diff)
songbook Lua bindings, give NPCs songbooks
Diffstat (limited to 'source/game/StarPlayer.cpp')
-rw-r--r--source/game/StarPlayer.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/source/game/StarPlayer.cpp b/source/game/StarPlayer.cpp
index 43add67..facde2e 100644
--- a/source/game/StarPlayer.cpp
+++ b/source/game/StarPlayer.cpp
@@ -3,6 +3,7 @@
#include "StarJsonExtra.hpp"
#include "StarRoot.hpp"
#include "StarSongbook.hpp"
+#include "StarSongbookLuaBindings.hpp"
#include "StarEmoteProcessor.hpp"
#include "StarSpeciesDatabase.hpp"
#include "StarDamageManager.hpp"
@@ -331,6 +332,7 @@ void Player::init(World* world, EntityId entityId, EntityMode mode) {
p.second->addActorMovementCallbacks(m_movementController.get());
p.second->addCallbacks("player", LuaBindings::makePlayerCallbacks(this));
p.second->addCallbacks("status", LuaBindings::makeStatusControllerCallbacks(m_statusController.get()));
+ p.second->addCallbacks("songbook", LuaBindings::makeSongbookCallbacks(m_songbook.get()));
if (m_client)
p.second->addCallbacks("celestial", LuaBindings::makeCelestialCallbacks(m_client));
p.second->init(world);
@@ -362,6 +364,7 @@ void Player::uninit() {
p.second->removeCallbacks("player");
p.second->removeCallbacks("mcontroller");
p.second->removeCallbacks("status");
+ p.second->removeCallbacks("songbook");
p.second->removeCallbacks("world");
if (m_client)
p.second->removeCallbacks("celestial");
@@ -2272,7 +2275,7 @@ bool Player::instrumentPlaying() {
void Player::instrumentEquipped(String const& instrumentKind) {
if (canUseTool())
- m_songbook->keepalive(instrumentKind, mouthPosition());
+ m_songbook->keepAlive(instrumentKind, mouthPosition());
}
void Player::interact(InteractAction const& action) {