Player UI tweaks (#1489)

* Redesigned Player UI

* Formatting
This commit is contained in:
DayibBaba
2023-06-22 10:11:56 +02:00
committed by GitHub
parent 9201cc363b
commit b96fddd8d0
11 changed files with 306 additions and 234 deletions

View File

@ -1,19 +1,39 @@
#include "services/gui/gui_service.hpp"
#include "views/view.hpp"
namespace big
{
void view::view_player()
{
ImGui::Text("VIEW_PLAYER_PLAYER_OPTIONS"_T.data(), g_player_service->get_selected()->get_name());
ImGui::Checkbox("SPECTATE"_T.data(), &g.player.spectating);
if (g_player_service->get_selected()->is_valid())
{
player_ptr current_player = g_player_service->get_selected();
navigation_struct& player_tab = g_gui_service->get_navigation().at(tabs::PLAYER);
strcpy(player_tab.name, current_player->get_name());
strcat(player_tab.name, std::format(" ({})", std::to_string(current_player->id())).data());
if (current_player->is_host())
strcat(player_tab.name, " [HOST]");
if (current_player->is_friend())
strcat(player_tab.name, " [FRIEND]");
if (current_player->is_modder)
strcat(player_tab.name, " [MOD]");
view::player_info();
view::player_troll();
ImGui::SameLine();
view::player_teleport();
view::player_kick();
ImGui::SameLine();
view::player_toxic();
view::player_misc();
ImGui::SameLine();
view::player_vehicle();
}
}