feat: add castle tooltip

This commit is contained in:
2021-12-12 13:32:39 +01:00
parent 4611a198c9
commit 24617c539f
11 changed files with 133 additions and 14 deletions

View File

@@ -0,0 +1,27 @@
#include "render/gui/CastleTooltip.h"
#include "render/gui/imgui/imgui.h"
#include "render/WorldRenderer.h"
#include "game/client/Client.h"
namespace td {
namespace gui {
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();
}
} // namespace gui
} // namespace td