mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-23 07:40:14 +00:00
rendering/game: make player model semi-transparent in ghost form
Add GhostStateCallback to GameHandler, fired when PLAYER_FLAGS_GHOST transitions on or off in UPDATE_OBJECT / login detection. Add setInstanceOpacity() to CharacterRenderer to directly set opacity without disturbing fade-in state. Application wires the callback to set opacity 0.5 on ghost entry and 1.0 on resurrect.
This commit is contained in:
parent
366321042f
commit
c8d9d6b792
5 changed files with 28 additions and 0 deletions
|
|
@ -7749,6 +7749,7 @@ void GameHandler::handleUpdateObject(network::Packet& packet) {
|
|||
releasedSpirit_ = true;
|
||||
playerDead_ = true;
|
||||
LOG_INFO("Player logged in as ghost (PLAYER_FLAGS)");
|
||||
if (ghostStateCallback_) ghostStateCallback_(true);
|
||||
}
|
||||
}
|
||||
// Determine hostility from faction template for online creatures
|
||||
|
|
@ -8212,12 +8213,14 @@ void GameHandler::handleUpdateObject(network::Packet& packet) {
|
|||
if (!wasGhost && nowGhost) {
|
||||
releasedSpirit_ = true;
|
||||
LOG_INFO("Player entered ghost form (PLAYER_FLAGS)");
|
||||
if (ghostStateCallback_) ghostStateCallback_(true);
|
||||
} else if (wasGhost && !nowGhost) {
|
||||
releasedSpirit_ = false;
|
||||
playerDead_ = false;
|
||||
repopPending_ = false;
|
||||
resurrectPending_ = false;
|
||||
LOG_INFO("Player resurrected (PLAYER_FLAGS ghost cleared)");
|
||||
if (ghostStateCallback_) ghostStateCallback_(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue