simplified health bar display
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include "render/gui/CastleTooltip.h"
|
||||
#include "render/gui/imgui/imgui.h"
|
||||
#include "render/gui/LifeProgress.h"
|
||||
|
||||
#include "render/WorldRenderer.h"
|
||||
|
||||
@@ -15,12 +16,18 @@ CastleTooltip::CastleTooltip(client::Client* client) : GuiWidget(client) {
|
||||
void CastleTooltip::Render() {
|
||||
if (m_Castle == nullptr) return;
|
||||
|
||||
ImGui::BeginTooltip();
|
||||
ImGui::PushStyleColor(ImGuiCol_Text, render::WorldRenderer::GetImGuiTeamColor(m_Castle->GetTeam()->GetColor()));
|
||||
ImGui::Text("Castle : ");
|
||||
ImGui::PopStyleColor();
|
||||
ImGui::Text("\tCastle HP : %i/%i", static_cast<int>(m_Castle->GetLife()), game::TeamCastle::CastleMaxLife);
|
||||
ImGui::EndTooltip();
|
||||
if (ImGui::GetIO().KeyShift) {
|
||||
ImGui::BeginTooltip();
|
||||
ImGui::PushStyleColor(ImGuiCol_Text, render::WorldRenderer::GetImGuiTeamColor(m_Castle->GetTeam()->GetColor()));
|
||||
ImGui::Text("Castle : ");
|
||||
ImGui::PopStyleColor();
|
||||
ImGui::Text("\tCastle HP : %i/%i", static_cast<int>(m_Castle->GetLife()), game::TeamCastle::CastleMaxLife);
|
||||
ImGui::EndTooltip();
|
||||
} else {
|
||||
ImGui::BeginTooltip();
|
||||
RenderLifeProgress(m_Castle->GetLife() / static_cast<float>(game::TeamCastle::CastleMaxLife));
|
||||
ImGui::EndTooltip();
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace gui
|
||||
|
||||
Reference in New Issue
Block a user