mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
fix(ui): cache ghost opacity updates to state changes
This commit is contained in:
parent
cebca9a882
commit
800862c50a
2 changed files with 17 additions and 0 deletions
|
|
@ -621,6 +621,9 @@ private:
|
|||
float resurrectFlashTimer_ = 0.0f;
|
||||
static constexpr float kResurrectFlashDuration = 3.0f;
|
||||
bool ghostStateCallbackSet_ = false;
|
||||
bool ghostOpacityStateKnown_ = false;
|
||||
bool ghostOpacityLastState_ = false;
|
||||
uint32_t ghostOpacityLastInstanceId_ = 0;
|
||||
void renderResurrectFlash();
|
||||
|
||||
// Zone discovery text ("Entering: <ZoneName>")
|
||||
|
|
|
|||
|
|
@ -848,6 +848,20 @@ void GameScreen::render(game::GameHandler& gameHandler) {
|
|||
renderer->setInCombat(gameHandler.isInCombat() &&
|
||||
!gameHandler.isPlayerDead() &&
|
||||
!gameHandler.isPlayerGhost());
|
||||
if (auto* cr = renderer->getCharacterRenderer()) {
|
||||
uint32_t charInstId = renderer->getCharacterInstanceId();
|
||||
if (charInstId != 0) {
|
||||
const bool isGhost = gameHandler.isPlayerGhost();
|
||||
if (!ghostOpacityStateKnown_ ||
|
||||
ghostOpacityLastState_ != isGhost ||
|
||||
ghostOpacityLastInstanceId_ != charInstId) {
|
||||
cr->setInstanceOpacity(charInstId, isGhost ? 0.5f : 1.0f);
|
||||
ghostOpacityStateKnown_ = true;
|
||||
ghostOpacityLastState_ = isGhost;
|
||||
ghostOpacityLastInstanceId_ = charInstId;
|
||||
}
|
||||
}
|
||||
}
|
||||
static glm::vec3 targetGLPos;
|
||||
if (gameHandler.hasTarget()) {
|
||||
auto target = gameHandler.getTarget();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue