feat: changed tower place popop
This commit is contained in:
@@ -15,20 +15,21 @@ TowerPlacePopup::TowerPlacePopup(client::Client* client) : GuiWidget(client) {
|
||||
|
||||
void TowerPlacePopup::render(){
|
||||
if (ImGui::BeginPopup("TowerPlace")) {
|
||||
ImGui::BeginChild("SubWindow", ImVec2(800, 270), false, ImGuiWindowFlags_HorizontalScrollbar);
|
||||
for (int i = 0; i < (int)game::TowerType::TowerCount; i++) {
|
||||
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 (ImGui::Button(game::getTowerInfo(towerType).getName().c_str())) {
|
||||
getClient()->placeTower(towerType, m_ClickWorldPos);
|
||||
ImGui::CloseCurrentPopup();
|
||||
break;
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip(game::getTowerInfo(towerType).getDescription().c_str(), "%s");
|
||||
}
|
||||
}
|
||||
if(i > 0) ImGui::SameLine();
|
||||
|
||||
ImGui::BeginChild(std::to_string(i).c_str(), ImVec2(250, 250), true);
|
||||
|
||||
ImGui::Text(game::getTowerInfo(game::TowerType(i)).getName().c_str());
|
||||
|
||||
ImGui::SameLine();
|
||||
ImGui::SetCursorPosX(250 - 10 - ImGui::CalcTextSize("(?)").x);
|
||||
ImGui::TextDisabled("(?)");
|
||||
|
||||
ImGui::EndChild();
|
||||
}
|
||||
ImGui::EndChild();
|
||||
ImGui::EndPopup();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user