add bots
This commit is contained in:
@@ -1,18 +1,29 @@
|
||||
#include <td/render/renderer/PlayerListRenderer.h>
|
||||
|
||||
#include <imgui.h>
|
||||
|
||||
#include <iostream>
|
||||
#include <optional>
|
||||
|
||||
namespace td {
|
||||
namespace render {
|
||||
|
||||
void PlayerListRenderer::Render(float a_Lerp) {
|
||||
ImGui::Begin("Players");
|
||||
if (ImGui::Button("Add player")) {
|
||||
OnPlayerCreate();
|
||||
}
|
||||
std::optional<PlayerID> kick;
|
||||
for (const auto& [id, player] : m_Players) {
|
||||
ImGui::PushID(id);
|
||||
ImGui::Text("[%i] %s", id, player.m_PlayerName.c_str());
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button("Kick")){
|
||||
kick = id;
|
||||
}
|
||||
ImGui::PopID();
|
||||
}
|
||||
ImGui::End();
|
||||
if (kick.has_value())
|
||||
OnPlayerKick(*kick);
|
||||
}
|
||||
|
||||
PlayerListRenderer::PlayerListRenderer(const client::PlayerManager& a_Players) : m_Players(a_Players) {}
|
||||
|
||||
Reference in New Issue
Block a user