2022-12-06 16:12:02 +00:00
|
|
|
#include "util/teleport.hpp"
|
|
|
|
#include "util/toxic.hpp"
|
2023-03-01 21:27:15 +00:00
|
|
|
#include "views/view.hpp"
|
2022-12-06 16:12:02 +00:00
|
|
|
|
|
|
|
namespace big
|
|
|
|
{
|
|
|
|
void view::player_kick()
|
|
|
|
{
|
2023-06-22 10:11:56 +02:00
|
|
|
ImGui::BeginGroup();
|
2023-10-20 12:24:44 -04:00
|
|
|
components::sub_title("KICK"_T);
|
2023-06-23 13:44:06 +05:00
|
|
|
if (ImGui::BeginListBox("##kick", get_listbox_dimensions()))
|
2022-12-06 16:12:02 +00:00
|
|
|
{
|
2023-03-01 21:27:15 +00:00
|
|
|
auto const is_session_host = [] {
|
|
|
|
return gta_util::get_network()->m_game_session_ptr->is_host();
|
|
|
|
};
|
2022-12-29 20:43:31 -05:00
|
|
|
|
2023-06-23 06:43:44 +00:00
|
|
|
if (!g_player_service->get_self()->is_host())
|
2023-10-20 12:24:44 -04:00
|
|
|
ImGui::Text("VIEW_PLAYER_KICK_HOST_AND_BREAKUP_KICK_REQUIRE_SESSION_HOST"_T.data());
|
2023-06-23 06:43:44 +00:00
|
|
|
|
2023-06-17 15:49:48 +02:00
|
|
|
ImGui::BeginDisabled(!g_player_service->get_self()->is_host());
|
2023-06-22 10:11:56 +02:00
|
|
|
|
2023-06-17 15:49:48 +02:00
|
|
|
components::player_command_button<"hostkick">(g_player_service->get_selected());
|
|
|
|
components::player_command_button<"breakup">(g_player_service->get_selected());
|
|
|
|
|
|
|
|
ImGui::EndDisabled();
|
|
|
|
|
|
|
|
ImGui::SameLine();
|
|
|
|
components::command_checkbox<"breakupcheating">();
|
2023-08-12 21:45:28 +03:00
|
|
|
|
|
|
|
components::player_command_button<"multikick">(g_player_service->get_selected());
|
2024-05-06 14:11:35 -06:00
|
|
|
ImGui::SameLine();
|
2022-12-22 21:23:32 +00:00
|
|
|
components::player_command_button<"oomkick">(g_player_service->get_selected());
|
2024-05-06 14:11:35 -06:00
|
|
|
|
2022-12-22 21:23:32 +00:00
|
|
|
components::player_command_button<"shkick">(g_player_service->get_selected());
|
2024-05-06 14:11:35 -06:00
|
|
|
ImGui::SameLine();
|
2022-12-22 21:23:32 +00:00
|
|
|
components::player_command_button<"endkick">(g_player_service->get_selected());
|
2024-05-06 14:11:35 -06:00
|
|
|
|
2022-12-22 21:23:32 +00:00
|
|
|
components::player_command_button<"desync">(g_player_service->get_selected());
|
2022-12-06 16:12:02 +00:00
|
|
|
|
2023-06-23 13:44:06 +05:00
|
|
|
ImGui::EndListBox();
|
2022-12-06 16:12:02 +00:00
|
|
|
}
|
2023-06-22 10:11:56 +02:00
|
|
|
|
|
|
|
ImGui::EndGroup();
|
2022-12-06 16:12:02 +00:00
|
|
|
}
|
2024-05-06 14:11:35 -06:00
|
|
|
}
|