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

Method updateHealth

source/render/CreatureOverlayStatus.cpp:80–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78}
79
80void CreatureOverlayStatus::updateHealth()
81{
82 // We adapt the material
83 if((mHealthValue != mCreature->getOverlayHealthValue()) ||
84 (mSeat != mCreature->getSeat()))
85 {
86 mHealthValue = mCreature->getOverlayHealthValue();
87 mSeat = mCreature->getSeat();
88 std::string material = RenderManager::getSingleton().rrBuildSkullFlagMaterial(
89 "CreatureOverlay" + Helper::toString(mHealthValue),
90 mSeat->getColorValue());
91 uint32_t healthId = mOverlayIds[static_cast<uint32_t>(CreatureOverlays::health)];
92 mMovableTextOverlay->setMaterialName(healthId, material);
93 }
94
95 if(mLevel != mCreature->getLevel())
96 {
97 mLevel = mCreature->getLevel();
98 uint32_t healthId = mOverlayIds[static_cast<uint32_t>(CreatureOverlays::health)];
99 mMovableTextOverlay->setCaption(healthId, Helper::toString(mLevel));
100 }
101}
102
103void CreatureOverlayStatus::updateStatus(Ogre::Real timeSincelastFrame)
104{

Callers

nothing calls this directly

Calls 7

getOverlayHealthValueMethod · 0.80
setMaterialNameMethod · 0.80
getLevelMethod · 0.80
setCaptionMethod · 0.80
toStringFunction · 0.50
getSeatMethod · 0.45

Tested by

no test coverage detected