MCPcopy Create free account
hub / github.com/OpenDungeons/OpenDungeons / refreshSpellButtonCoolDowns

Method refreshSpellButtonCoolDowns

source/modes/GameMode.cpp:1606–1630  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1604}
1605
1606void GameMode::refreshSpellButtonCoolDowns()
1607{
1608 Player* player = mGameMap->getLocalPlayer();
1609 if (player == nullptr)
1610 {
1611 OD_LOG_ERR("No local player");
1612 return;
1613 }
1614
1615 // We show/hide each icon depending on available skills
1616 SkillManager::listAllSpellsProgressBars([this, player](SpellType spellType, const std::string& castProgressBarName)
1617 {
1618 CEGUI::ProgressBar* progressBar = static_cast<CEGUI::ProgressBar*>(mRootWindow->getChild(castProgressBarName));
1619 float progress = player->getSpellCooldownSmooth(spellType);
1620 if (progress > 0.0)
1621 {
1622 progressBar->show();
1623 progressBar->setProgress(progress);
1624 }
1625 else
1626 {
1627 progressBar->hide();
1628 }
1629 });
1630}
1631
1632void GameMode::selectSquaredTiles(int tileX1, int tileY1, int tileX2, int tileY2)
1633{

Callers

nothing calls this directly

Calls 4

getLocalPlayerMethod · 0.80
showMethod · 0.80
hideMethod · 0.80

Tested by

no test coverage detected