mirror of
https://github.com/Mr-X-GTA/YimMenu.git
synced 2025-06-22 16:52:30 +08:00
refactor: Load tooltips from commands and disable unusable command buttons (#777)
* Set tooltips from command descriptions * Disable unusable commands
This commit is contained in:
@ -8,19 +8,21 @@ namespace big
|
||||
{
|
||||
if (ImGui::TreeNode("Kick"))
|
||||
{
|
||||
auto const is_session_host = [] { return gta_util::get_network()->m_game_session_ptr->is_host(); };
|
||||
|
||||
components::player_command_button<"breakup">(g_player_service->get_selected());
|
||||
components::player_command_button<"lckick">(g_player_service->get_selected());
|
||||
components::disable_unless(std::not_fn(is_session_host), [] {
|
||||
components::player_command_button<"lckick">(g_player_service->get_selected());
|
||||
});
|
||||
components::player_command_button<"bailkick">(g_player_service->get_selected());
|
||||
components::player_command_button<"nfkick">(g_player_service->get_selected());
|
||||
components::player_command_button<"oomkick">(g_player_service->get_selected());
|
||||
components::player_command_button<"shkick">(g_player_service->get_selected());
|
||||
components::player_command_button<"endkick">(g_player_service->get_selected());
|
||||
if (ImGui::IsItemHovered())
|
||||
ImGui::SetTooltip("The kick can take around 10 seconds to work");
|
||||
components::player_command_button<"hostkick">(g_player_service->get_selected());
|
||||
components::disable_unless(is_session_host, [] {
|
||||
components::player_command_button<"hostkick">(g_player_service->get_selected());
|
||||
});
|
||||
components::player_command_button<"desync">(g_player_service->get_selected());
|
||||
if (ImGui::IsItemHovered())
|
||||
ImGui::SetTooltip("The kick can take around 10 seconds to work");
|
||||
|
||||
ImGui::TreePop();
|
||||
}
|
||||
|
Reference in New Issue
Block a user