mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-07 03:51:50 +00:00
fix: player name 3d text not updating by Decorator
This commit is contained in:
parent
a9d185256a
commit
33db2633a2
5 changed files with 23 additions and 20 deletions
|
|
@ -66,9 +66,7 @@ Decorator::Decorator(
|
|||
continue;
|
||||
}
|
||||
playerTexts[id] = renderer.texts->add(std::make_unique<TextNote>(
|
||||
util::str2wstr_utf8(player->getName()),
|
||||
playerNamePreset,
|
||||
player->getPosition()
|
||||
player->getName(), playerNamePreset, player->getPosition()
|
||||
));
|
||||
}
|
||||
}
|
||||
|
|
@ -296,9 +294,7 @@ void Decorator::updateTextNotes() {
|
|||
continue;
|
||||
}
|
||||
playerTexts[id] = renderer.texts->add(std::make_unique<TextNote>(
|
||||
util::str2wstr_utf8(player->getName()),
|
||||
playerNamePreset,
|
||||
player->getPosition()
|
||||
player->getName(), playerNamePreset, player->getPosition()
|
||||
));
|
||||
}
|
||||
|
||||
|
|
@ -315,6 +311,9 @@ void Decorator::updateTextNotes() {
|
|||
position = entity->getInterpolatedPosition();
|
||||
}
|
||||
note->setPosition(position + glm::vec3(0, 1, 0));
|
||||
if (note->getText() != player->getName()) {
|
||||
note->setText(player->getName());
|
||||
}
|
||||
++textsIter;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue