feat: improved tower place + tower upgrade

This commit is contained in:
2021-11-05 17:35:39 +01:00
parent 524af9ad5f
commit f863fb4942
6 changed files with 87 additions and 32 deletions

View File

@@ -125,6 +125,7 @@ typedef std::shared_ptr<Tower> TowerPtr;
namespace TowerFactory {
TowerPtr createTower(TowerType type, TowerID id, std::int32_t x, std::int32_t y, PlayerID builder);
std::string getTowerName(TowerType type);
} // namespace TowerFactory

View File

@@ -163,7 +163,7 @@ public:
bool CanPlaceLittleTower(const glm::vec2& worldPos, PlayerID player) const;
bool CanPlaceBigTower(const glm::vec2& worldPos, PlayerID player) const;
TowerPtr GetTower(const glm::vec2& position); // returns null if no tower is here
TowerPtr getTower(const glm::vec2& position) const; // returns null if no tower is here
const std::unordered_map<ChunkCoord, ChunkPtr>& getChunks() const { return m_Chunks; }

View File

@@ -28,7 +28,7 @@ private:
glm::vec2 m_HoldCursorPos;
float m_Zoom;
float m_CamSensibility = 1;
bool m_TowerPlacePopupOpened = false;
bool m_PopupOpened = false;
VertexCache m_TowersCache;
public:
WorldRenderer(game::World* world, client::ClientGame* client);
@@ -53,6 +53,8 @@ private:
void renderMobs() const;
void renderTileSelect() const;
void renderPopups() const;
void renderTowerPlacePopup() const;
void renderTowerUpgradePopup() const;
void renderMobTooltip() const;
void detectClick();
glm::vec2 getCursorWorldPos() const;