Adjusting healthbar related things
*unit height=healthbar height per default *no hpbars in photomode *renamed function
This commit is contained in:
parent
6d942b8b25
commit
fe936f5c8c
|
@ -5252,7 +5252,9 @@ void Game::render3d(){
|
||||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugPerformance).enabled && chrono.getMillis() > 0) chrono.start();
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugPerformance).enabled && chrono.getMillis() > 0) chrono.start();
|
||||||
|
|
||||||
//renderOnTopBars (aka Healthbars)
|
//renderOnTopBars (aka Healthbars)
|
||||||
renderer.renderOnTopBars();
|
if(photoModeEnabled == false) {
|
||||||
|
renderer.renderOnTopBars();
|
||||||
|
}
|
||||||
|
|
||||||
//particles
|
//particles
|
||||||
renderer.renderParticleManager(rsGame);
|
renderer.renderParticleManager(rsGame);
|
||||||
|
|
|
@ -5620,6 +5620,10 @@ void Renderer::renderOnTopBars(){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(config.getBool("PhotoMode")) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
glPushAttrib(GL_ENABLE_BIT | GL_CURRENT_BIT | GL_DEPTH_BUFFER_BIT);
|
glPushAttrib(GL_ENABLE_BIT | GL_CURRENT_BIT | GL_DEPTH_BUFFER_BIT);
|
||||||
glDisable(GL_LIGHTING);
|
glDisable(GL_LIGHTING);
|
||||||
glDisable(GL_TEXTURE_2D);
|
glDisable(GL_TEXTURE_2D);
|
||||||
|
@ -5661,7 +5665,7 @@ void Renderer::renderOnTopBars(){
|
||||||
|| ((healthbarVisible&hbvSelected) && game->getGui()->isSelected(unit)))) {
|
|| ((healthbarVisible&hbvSelected) && game->getGui()->isSelected(unit)))) {
|
||||||
Vec3f currVec= unit->getCurrVectorFlat();
|
Vec3f currVec= unit->getCurrVectorFlat();
|
||||||
if(healthbarheight==-100.0f) {
|
if(healthbarheight==-100.0f) {
|
||||||
currVec.y+=unit->getType()->getHeight()+1;
|
currVec.y+=unit->getType()->getHeight();
|
||||||
} else {
|
} else {
|
||||||
currVec.y+=healthbarheight;
|
currVec.y+=healthbarheight;
|
||||||
}
|
}
|
||||||
|
@ -5671,9 +5675,9 @@ void Renderer::renderOnTopBars(){
|
||||||
}
|
}
|
||||||
|
|
||||||
if(unit->getType()->getMaxEp() > 0) {
|
if(unit->getType()->getMaxEp() > 0) {
|
||||||
renderSelectionHpBar(currVec,unit->getType()->getSize(),unit->getHpRatio(),healthbarthickness,unit->getEpRatio());
|
renderHealthBar(currVec,unit->getType()->getSize(),unit->getHpRatio(),healthbarthickness,unit->getEpRatio());
|
||||||
} else {
|
} else {
|
||||||
renderSelectionHpBar(currVec,unit->getType()->getSize(),unit->getHpRatio(),healthbarthickness);
|
renderHealthBar(currVec,unit->getType()->getSize(),unit->getHpRatio(),healthbarthickness);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8286,7 +8290,11 @@ void Renderer::enableProjectiveTexturing() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// ==================== private aux drawing ====================
|
// ==================== private aux drawing ====================
|
||||||
void Renderer::renderSelectionHpBar(Vec3f v, int size, float hp, float height, float ep) {
|
void Renderer::renderHealthBar(Vec3f v, int size, float hp, float height, float ep) {
|
||||||
|
if(GlobalStaticFlags::getIsNonGraphicalModeEnabled() == true) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Vec3f rightVector;
|
Vec3f rightVector;
|
||||||
Vec3f upVector;
|
Vec3f upVector;
|
||||||
v.y+=1;
|
v.y+=1;
|
||||||
|
|
|
@ -681,7 +681,7 @@ private:
|
||||||
|
|
||||||
//private aux drawing
|
//private aux drawing
|
||||||
void renderSelectionCircle(Vec3f v, int size, float radius, float thickness=0.2f);
|
void renderSelectionCircle(Vec3f v, int size, float radius, float thickness=0.2f);
|
||||||
void renderSelectionHpBar(Vec3f v, int size, float hp, float height, float ep=-1.0f);
|
void renderHealthBar(Vec3f v, int size, float hp, float height, float ep=-1.0f);
|
||||||
void renderTeamColorEffect(Vec3f &v, int heigth, int size, Vec3f color, const Texture2D *texture);
|
void renderTeamColorEffect(Vec3f &v, int heigth, int size, Vec3f color, const Texture2D *texture);
|
||||||
void renderArrow(const Vec3f &pos1, const Vec3f &pos2, const Vec3f &color, float width);
|
void renderArrow(const Vec3f &pos1, const Vec3f &pos2, const Vec3f &color, float width);
|
||||||
void renderTile(const Vec2i &pos);
|
void renderTile(const Vec2i &pos);
|
||||||
|
|
Loading…
Reference in New Issue