Working on health bar
This commit is contained in:
1 parent
8552725dfc
commit
22b0e1992f
12 files changed
+121
-57
No files matched your search
+9
-1
@@ -131,7 +131,6 @@ namespace ZL
|
||||
|
||||
}
|
||||
|
||||
|
||||
void Game::setupPart2()
|
||||
{
|
||||
|
||||
@@ -461,6 +460,15 @@ namespace ZL
|
||||
std::cerr << "Failed to load UI: " << e.what() << std::endl;
|
||||
}
|
||||
|
||||
// Wire HP-change callbacks so all player instances update the health bar HUD.
|
||||
for (auto& [name, loc] : locations) {
|
||||
if (loc->player) {
|
||||
loc->player->onHpChanged = [this](float hp, float maxHp) {
|
||||
menuManager.updateHealthBar(hp, maxHp);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
loadingCompleted = true;
|
||||
|
||||
if (audioPlayer->init()) {
|
||||
|
||||
Reference in new issue
Block a user