GIGA REFACTOR

This commit is contained in:
2022-03-02 18:51:42 +01:00
parent 553b2f6aad
commit 6df59b1487
92 changed files with 1807 additions and 1785 deletions

View File

@@ -13,21 +13,21 @@ TowerPlacePopup::TowerPlacePopup(client::Client* client) : GuiWidget(client) {
}
void TowerPlacePopup::render() {
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();
game::TowerType towerType = game::TowerType(i);
const game::TowerInfo& towerInfo = game::getTowerInfo(towerType);
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::Text(towerInfo.getName().c_str());
ImGui::Text(towerInfo.GetName().c_str());
ImGui::SameLine();
ImGui::SetCursorPosX(m_TowerPopupTileWidth - 10 - ImGui::CalcTextSize("(?)").x);
@@ -35,7 +35,7 @@ void TowerPlacePopup::render() {
if (ImGui::IsItemHovered()) {
ImGui::BeginTooltip();
ImGui::Text(towerInfo.getDescription().c_str());
ImGui::Text(towerInfo.GetDescription().c_str());
ImGui::EndTooltip();
}
@@ -45,7 +45,7 @@ void TowerPlacePopup::render() {
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);
GetClient()->PlaceTower(towerType, m_ClickWorldPos);
ImGui::CloseCurrentPopup();
}
@@ -57,7 +57,7 @@ void TowerPlacePopup::render() {
}
}
void TowerPlacePopup::setClickPos(const glm::vec2& worldPos) {
void TowerPlacePopup::SetClickPos(const glm::vec2& worldPos) {
m_ClickWorldPos = worldPos;
}