mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30: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
|
|
@ -2876,6 +2876,15 @@ void CharacterRenderer::startFadeIn(uint32_t instanceId, float durationSeconds)
|
|||
it->second.fadeInDuration = durationSeconds;
|
||||
}
|
||||
|
||||
void CharacterRenderer::setInstanceOpacity(uint32_t instanceId, float opacity) {
|
||||
auto it = instances.find(instanceId);
|
||||
if (it != instances.end()) {
|
||||
it->second.opacity = std::clamp(opacity, 0.0f, 1.0f);
|
||||
// Cancel any fade-in in progress to avoid overwriting the new opacity
|
||||
it->second.fadeInDuration = 0.0f;
|
||||
}
|
||||
}
|
||||
|
||||
void CharacterRenderer::setActiveGeosets(uint32_t instanceId, const std::unordered_set<uint16_t>& geosets) {
|
||||
auto it = instances.find(instanceId);
|
||||
if (it != instances.end()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue