feat: add castle tooltip
This commit is contained in:
27
src/render/gui/CastleTooltip.cpp
Normal file
27
src/render/gui/CastleTooltip.cpp
Normal 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
|
||||
Reference in New Issue
Block a user