indent with tabs
This commit is contained in:
@@ -14,51 +14,51 @@ TowerPlacePopup::TowerPlacePopup(client::Client* client) : GuiWidget(client) {
|
||||
}
|
||||
|
||||
void TowerPlacePopup::Render() {
|
||||
if (ImGui::BeginPopup("TowerPlace")) {
|
||||
ImGui::BeginChild("TowerPlacePopupChild", ImVec2(800, m_TowerPopupTileHeight + 20), false, ImGuiWindowFlags_HorizontalScrollbar);
|
||||
for (int i = 0; i < (int)game::TowerType::TowerCount; i++) {
|
||||
if (i > 0) ImGui::SameLine();
|
||||
if (ImGui::BeginPopup("TowerPlace")) {
|
||||
ImGui::BeginChild("TowerPlacePopupChild", ImVec2(800, m_TowerPopupTileHeight + 20), false, ImGuiWindowFlags_HorizontalScrollbar);
|
||||
for (int i = 0; i < (int)game::TowerType::TowerCount; i++) {
|
||||
if (i > 0) ImGui::SameLine();
|
||||
|
||||
game::TowerType towerType = game::TowerType(i);
|
||||
const game::TowerInfo& towerInfo = game::GetTowerInfo(towerType);
|
||||
game::TowerType towerType = game::TowerType(i);
|
||||
const game::TowerInfo& towerInfo = game::GetTowerInfo(towerType);
|
||||
|
||||
if (!towerInfo.IsBigTower() || (towerInfo.IsBigTower() &&
|
||||
GetClient()->GetGame().GetWorld().CanPlaceBigTower(m_ClickWorldPos, GetClient()->GetGame().GetPlayer()->GetID()))) {
|
||||
if (!towerInfo.IsBigTower() || (towerInfo.IsBigTower() &&
|
||||
GetClient()->GetGame().GetWorld().CanPlaceBigTower(m_ClickWorldPos, GetClient()->GetGame().GetPlayer()->GetID()))) {
|
||||
|
||||
ImGui::BeginChild(std::to_string(i).c_str(), ImVec2(m_TowerPopupTileWidth, m_TowerPopupTileHeight), true);
|
||||
ImGui::BeginChild(std::to_string(i).c_str(), ImVec2(m_TowerPopupTileWidth, m_TowerPopupTileHeight), true);
|
||||
|
||||
ImGui::Text(towerInfo.GetName().c_str());
|
||||
ImGui::Text(towerInfo.GetName().c_str());
|
||||
|
||||
ImGui::SameLine();
|
||||
ImGui::SetCursorPosX(m_TowerPopupTileWidth - 10 - ImGui::CalcTextSize("(?)").x);
|
||||
ImGui::TextDisabled("(?)");
|
||||
ImGui::SameLine();
|
||||
ImGui::SetCursorPosX(m_TowerPopupTileWidth - 10 - ImGui::CalcTextSize("(?)").x);
|
||||
ImGui::TextDisabled("(?)");
|
||||
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::BeginTooltip();
|
||||
ImGui::Text(towerInfo.GetDescription().c_str());
|
||||
ImGui::EndTooltip();
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::BeginTooltip();
|
||||
ImGui::Text(towerInfo.GetDescription().c_str());
|
||||
ImGui::EndTooltip();
|
||||
}
|
||||
|
||||
std::string buyText = std::to_string(100) + " golds";
|
||||
std::string buyText = std::to_string(100) + " golds";
|
||||
|
||||
ImGui::SetCursorPosY(m_TowerPopupTileHeight - m_PlaceTowerButtonHeight - 10);
|
||||
ImGui::SetCursorPosX(m_TowerPopupTileWidth / 2.0f - m_PlaceTowerButtonWidth / 2.0f);
|
||||
ImGui::SetCursorPosY(m_TowerPopupTileHeight - m_PlaceTowerButtonHeight - 10);
|
||||
ImGui::SetCursorPosX(m_TowerPopupTileWidth / 2.0f - m_PlaceTowerButtonWidth / 2.0f);
|
||||
|
||||
if (ImGui::Button(buyText.c_str(), ImVec2(m_PlaceTowerButtonWidth, m_PlaceTowerButtonHeight))) {
|
||||
GetClient()->PlaceTower(towerType, m_ClickWorldPos);
|
||||
ImGui::CloseCurrentPopup();
|
||||
}
|
||||
if (ImGui::Button(buyText.c_str(), ImVec2(m_PlaceTowerButtonWidth, m_PlaceTowerButtonHeight))) {
|
||||
GetClient()->PlaceTower(towerType, m_ClickWorldPos);
|
||||
ImGui::CloseCurrentPopup();
|
||||
}
|
||||
|
||||
ImGui::EndChild();
|
||||
}
|
||||
}
|
||||
ImGui::EndChild();
|
||||
ImGui::EndPopup();
|
||||
}
|
||||
ImGui::EndChild();
|
||||
}
|
||||
}
|
||||
ImGui::EndChild();
|
||||
ImGui::EndPopup();
|
||||
}
|
||||
}
|
||||
|
||||
void TowerPlacePopup::SetClickPos(const Vec2f& worldPos) {
|
||||
m_ClickWorldPos = worldPos;
|
||||
m_ClickWorldPos = worldPos;
|
||||
}
|
||||
|
||||
} // namespace gui
|
||||
|
||||
Reference in New Issue
Block a user