feat: don't show tile select when tooltip

This commit is contained in:
2021-12-12 16:59:57 +01:00
parent e7bf22cea6
commit 61166023df
3 changed files with 4 additions and 0 deletions

View File

@@ -21,6 +21,7 @@ public:
virtual void render(); virtual void render();
void setCastle(const game::TeamCastle* castle) { m_Castle = castle; } void setCastle(const game::TeamCastle* castle) { m_Castle = castle; }
bool isShown() { return m_Castle != nullptr; }
}; };
} // namespace gui } // namespace gui

View File

@@ -21,6 +21,7 @@ public:
virtual void render(); virtual void render();
void setMob(const game::Mob* mob) { m_Mob = mob; } void setMob(const game::Mob* mob) { m_Mob = mob; }
bool isShown() { return m_Mob != nullptr; }
}; };
} // namespace gui } // namespace gui

View File

@@ -101,6 +101,8 @@ void WorldRenderer::renderTowers() const {
void WorldRenderer::renderTileSelect() const { void WorldRenderer::renderTileSelect() const {
if (ImGui::IsAnyItemHovered()) return; if (ImGui::IsAnyItemHovered()) return;
if(m_MobTooltip->isShown() || m_CastleTooltip->isShown()) return;
Renderer::Model tileSelectModel; Renderer::Model tileSelectModel;
tileSelectModel.vao = m_SelectTileVao.get(); tileSelectModel.vao = m_SelectTileVao.get();
tileSelectModel.positon = { (int)m_CursorPos.x, (int)m_CursorPos.y }; tileSelectModel.positon = { (int)m_CursorPos.x, (int)m_CursorPos.y };