feat(Player): Added info tab

This commit is contained in:
Yimura 2021-07-23 23:02:46 +02:00
parent 0ab4092d40
commit 24e2db3d0d
3 changed files with 30 additions and 5 deletions

View File

@ -0,0 +1,12 @@
#pragma once
#include "common.hpp"
#include "imgui.h"
namespace big
{
class tab_player
{
public:
static void tab_info();
};
}

View File

@ -0,0 +1,14 @@
#include "player_tabs.hpp"
namespace big
{
void tab_player::tab_info()
{
if (ImGui::BeginTabItem("Info"))
{
ImGui::Checkbox("Spectate", &g.player.spectating);
ImGui::EndTabItem();
}
}
}

View File

@ -1,3 +1,4 @@
#include "player/player_tabs.hpp"
#include "gui/window.hpp"
#include "imgui.h"
@ -15,11 +16,9 @@ namespace big
ImGui::SetNextWindowSize({ 350.f, 300.f }, ImGuiCond_FirstUseEver);
if (g.window.player && ImGui::Begin(title, &g.window.player))
{
/*ImGui::BeginTabBar("tabbar_player");
ImGui::EndTabBar();*/
ImGui::Checkbox("Spectate", &g.player.spectating);
ImGui::BeginTabBar("tabbar_player");
tab_player::tab_info();
ImGui::EndTabBar();
ImGui::End();
}