indent with tabs

This commit is contained in:
2023-01-02 13:05:43 +01:00
parent 8f95b1a750
commit 222b79b40a
100 changed files with 4783 additions and 4781 deletions

View File

@@ -14,14 +14,14 @@ namespace gui {
class CastleTooltip : public GuiWidget {
private:
const game::TeamCastle* m_Castle;
const game::TeamCastle* m_Castle;
public:
CastleTooltip(client::Client* client);
CastleTooltip(client::Client* client);
virtual void Render();
virtual void Render();
void SetCastle(const game::TeamCastle* castle) { m_Castle = castle; }
bool IsShown() { return m_Castle != nullptr; }
void SetCastle(const game::TeamCastle* castle) { m_Castle = castle; }
bool IsShown() { return m_Castle != nullptr; }
};
} // namespace gui

View File

@@ -7,13 +7,13 @@ namespace gui {
class FrameMenu : public GuiWidget {
private:
bool m_VSync;
bool m_IsometricView;
bool m_ShowDemoWindow;
bool m_VSync;
bool m_IsometricView;
bool m_ShowDemoWindow;
public:
FrameMenu(client::Client* client);
FrameMenu(client::Client* client);
virtual void Render();
virtual void Render();
};
} // namespace gui

View File

@@ -7,17 +7,17 @@ namespace gui {
class GameMenu : public GuiWidget {
private:
std::unique_ptr<SummonMenu> m_SummonMenu;
std::unique_ptr<SummonMenu> m_SummonMenu;
public:
GameMenu(client::Client* client);
GameMenu(client::Client* client);
virtual void Render();
virtual void Render();
private:
void ShowTPS();
void ShowStats();
void ShowPlayers();
void ShowLobbyProgress();
void ShowTeamSelection();
void ShowTPS();
void ShowStats();
void ShowPlayers();
void ShowLobbyProgress();
void ShowTeamSelection();
};
} // namespace gui

View File

@@ -10,19 +10,19 @@ namespace gui {
class GuiManager {
private:
std::vector<std::unique_ptr<GuiWidget>> m_Widgets;
std::vector<std::unique_ptr<GuiWidget>> m_Widgets;
public:
GuiManager() {}
GuiManager() {}
void RenderWidgets() {
for (auto& widget : m_Widgets) {
widget->Render();
}
}
void RenderWidgets() {
for (auto& widget : m_Widgets) {
widget->Render();
}
}
void AddWidget(std::unique_ptr<GuiWidget>&& widget) {
m_Widgets.push_back(std::move(widget));
}
void AddWidget(std::unique_ptr<GuiWidget>&& widget) {
m_Widgets.push_back(std::move(widget));
}
};
} // namespace gui

View File

@@ -10,13 +10,13 @@ namespace gui {
class GuiWidget {
protected:
client::Client* m_Client;
client::Client* m_Client;
public:
GuiWidget(client::Client* client) : m_Client(client) {}
GuiWidget(client::Client* client) : m_Client(client) {}
client::Client* GetClient() { return m_Client; }
client::Client* GetClient() { return m_Client; }
virtual void Render() = 0;
virtual void Render() = 0;
};
} // namespace gui

View File

@@ -13,24 +13,24 @@ namespace gui {
class MainMenu : public GuiWidget {
private:
bool m_TriedToConnect = false;
bool m_TriedToCreate = false;
std::string m_ConnectAddress;
int m_ConnectPort;
int m_ServerPort = 25565;
std::string m_WorldFilePath;
imgui_addons::ImGuiFileBrowser m_FileDialog;
bool m_TriedToConnect = false;
bool m_TriedToCreate = false;
std::string m_ConnectAddress;
int m_ConnectPort;
int m_ServerPort = 25565;
std::string m_WorldFilePath;
imgui_addons::ImGuiFileBrowser m_FileDialog;
std::unique_ptr<server::Server> m_Server;
std::unique_ptr<server::Server> m_Server;
public:
MainMenu(client::Client* client);
~MainMenu();
MainMenu(client::Client* client);
~MainMenu();
virtual void Render();
virtual void Render();
const server::Server* GetServer() const { return m_Server.get(); }
const server::Server* GetServer() const { return m_Server.get(); }
private:
bool StartServer();
bool StartServer();
};
} // namespace gui

View File

@@ -14,14 +14,14 @@ namespace gui {
class MobTooltip : public GuiWidget {
private:
const game::Mob* m_Mob;
const game::Mob* m_Mob;
public:
MobTooltip(client::Client* client);
MobTooltip(client::Client* client);
virtual void Render();
virtual void Render();
void SetMob(const game::Mob* mob) { m_Mob = mob; }
bool IsShown() { return m_Mob != nullptr; }
void SetMob(const game::Mob* mob) { m_Mob = mob; }
bool IsShown() { return m_Mob != nullptr; }
};
} // namespace gui

View File

@@ -10,16 +10,16 @@ namespace gui {
class SummonMenu : public GuiWidget {
private:
bool m_MenuOpened;
int m_ImageWidth = 100;
static constexpr int m_MobTypeCount = static_cast<std::size_t>(td::game::MobType::MOB_COUNT);
std::array<int, static_cast<std::size_t>(m_MobTypeCount)> m_Values;
bool m_MenuOpened;
int m_ImageWidth = 100;
static constexpr int m_MobTypeCount = static_cast<std::size_t>(td::game::MobType::MOB_COUNT);
std::array<int, static_cast<std::size_t>(m_MobTypeCount)> m_Values;
public:
SummonMenu(client::Client* client);
SummonMenu(client::Client* client);
virtual void Render();
virtual void Render();
private:
void SetSummonMax(int valueIndex);
void SetSummonMax(int valueIndex);
};
} // namespace gui

View File

@@ -28,21 +28,21 @@ class Renderer;
class TowerGui {
private:
SDL_Window* m_Window;
SDL_GLContext m_GlContext;
td::render::Renderer* m_Renderer;
td::gui::GuiManager m_GuiManager;
std::unique_ptr<td::client::Client> m_Client;
SDL_Window* m_Window;
SDL_GLContext m_GlContext;
td::render::Renderer* m_Renderer;
td::gui::GuiManager m_GuiManager;
std::unique_ptr<td::client::Client> m_Client;
public:
TowerGui(SDL_Window* wndow, SDL_GLContext glContext, td::render::Renderer* renderer);
~TowerGui();
TowerGui(SDL_Window* wndow, SDL_GLContext glContext, td::render::Renderer* renderer);
~TowerGui();
void Render();
void Render();
private:
void InitWidgets();
void Tick();
void BeginFrame();
void EndFrame();
void InitWidgets();
void Tick();
void BeginFrame();
void EndFrame();
};
} // namespace render

View File

@@ -9,19 +9,19 @@ namespace gui {
class TowerPlacePopup : public GuiWidget {
private:
Vec2f m_ClickWorldPos;
Vec2f m_ClickWorldPos;
public:
TowerPlacePopup(client::Client* client);
TowerPlacePopup(client::Client* client);
virtual void Render();
virtual void Render();
void SetClickPos(const Vec2f& worldPos);
void SetClickPos(const Vec2f& worldPos);
private:
static constexpr float m_TowerPopupTileWidth = 200.0f;
static constexpr float m_TowerPopupTileHeight = 200.0f;
static constexpr float m_TowerPopupTileWidth = 200.0f;
static constexpr float m_TowerPopupTileHeight = 200.0f;
static constexpr float m_PlaceTowerButtonWidth = 150.0f;
static constexpr float m_PlaceTowerButtonHeight = 35.0f;
static constexpr float m_PlaceTowerButtonWidth = 150.0f;
static constexpr float m_PlaceTowerButtonHeight = 35.0f;
};
} // namespace gui

View File

@@ -17,19 +17,19 @@ namespace gui {
class UpdateMenu : public GuiWidget {
private:
bool m_Opened;
std::string m_Error;
std::unique_ptr<utils::Updater> m_Updater;
std::shared_future<bool> m_UpdateAvailable;
bool m_Opened;
std::string m_Error;
std::unique_ptr<utils::Updater> m_Updater;
std::shared_future<bool> m_UpdateAvailable;
public:
UpdateMenu(client::Client* client);
virtual ~UpdateMenu();
UpdateMenu(client::Client* client);
virtual ~UpdateMenu();
virtual void Render();
virtual void Render();
private:
void CheckUpdates();
bool IsUpdateChecked();
void RenderErrorPopup();
void CheckUpdates();
bool IsUpdateChecked();
void RenderErrorPopup();
};
} // namespace gui