2022-10-26 14:12:29 +02:00
# include "views/view.hpp"
2022-05-04 19:16:40 +02:00
# include "fiber_pool.hpp"
# include "util/session.hpp"
2022-11-12 07:13:01 +08:00
# include "core/data/region_codes.hpp"
2022-11-14 23:37:38 +08:00
# include "gta_util.hpp"
# include "util/notify.hpp"
2022-05-04 19:16:40 +02:00
namespace big
{
2022-07-06 11:59:08 +02:00
void view : : session ( )
{
2022-10-26 14:12:29 +02:00
static uint64_t rid = 0 ;
ImGui : : InputScalar ( " Input RID " , ImGuiDataType_U64 , & rid ) ;
components : : button ( " Join RID " , [ ]
{
session : : join_by_rockstar_id ( rid ) ;
} ) ;
2022-08-10 08:42:34 +08:00
components : : sub_title ( " Session Switcher " ) ;
2022-07-06 11:59:08 +02:00
if ( ImGui : : ListBoxHeader ( " ###session_switch " ) )
2022-05-04 19:16:40 +02:00
{
2022-07-06 11:59:08 +02:00
for ( const auto & session_type : sessions )
{
2022-10-26 14:12:29 +02:00
components : : selectable ( session_type . name , false , [ & session_type ]
2022-10-19 00:30:32 +02:00
{
session : : join_type ( session_type . id ) ;
2022-07-06 11:59:08 +02:00
} ) ;
}
ImGui : : EndListBox ( ) ;
2022-05-04 19:16:40 +02:00
}
2022-11-12 07:13:01 +08:00
components : : sub_title ( " Region Switcher " ) ;
if ( ImGui : : ListBoxHeader ( " ###region_switch " ) )
{
for ( const auto & region_type : regions )
{
components : : selectable ( region_type . name , * g_pointers - > m_region_code = = region_type . id , [ & region_type ]
{
* g_pointers - > m_region_code = region_type . id ;
} ) ;
}
ImGui : : EndListBox ( ) ;
}
2022-10-26 15:38:01 -04:00
2022-11-19 01:49:36 +00:00
components : : sub_title ( " Player Magnet " ) ;
ImGui : : Checkbox ( " Enabled " , & g - > session . player_magnet_enabled ) ;
if ( g - > session . player_magnet_enabled )
{
ImGui : : InputInt ( " Player Count " , & g - > session . player_magnet_count ) ;
}
2022-10-29 05:54:32 -04:00
components : : sub_title ( " Chat " ) ;
ImGui : : Checkbox ( " Disable Filter " , & g - > session . disable_chat_filter ) ;
2022-11-12 03:17:22 +10:30
ImGui : : Checkbox ( " Log Chat Messages " , & g - > session . log_chat_messages ) ;
ImGui : : Checkbox ( " Log Text Messages " , & g - > session . log_text_messages ) ;
2022-11-14 23:37:38 +08:00
static char msg [ 256 ] ;
ImGui : : InputText ( " ##message " , msg , sizeof ( msg ) ) ;
ImGui : : SameLine ( ) ;
ImGui : : Checkbox ( " Is Team " , & g - > session . is_team ) ;
ImGui : : SameLine ( ) ;
components : : button ( " Send " , [ ]
{
if ( const auto net_game_player = gta_util : : get_network_player_mgr ( ) - > m_local_net_player ; net_game_player )
{
if ( g_pointers - > m_send_chat_message ( * g_pointers - > m_send_chat_ptr , net_game_player - > get_net_data ( ) , msg , g - > session . is_team ) )
notify : : draw_chat ( msg , net_game_player - > get_name ( ) , g - > session . is_team ) ;
}
} ) ;
2022-11-12 18:35:28 +00:00
components : : sub_title ( " Decloak " ) ;
components : : script_patch_checkbox ( " Reveal OTR Players " , & g - > session . decloak_players ) ;
2022-11-13 16:34:44 +00:00
components : : sub_title ( " Force Host " ) ;
ImGui : : Checkbox ( " Force Session Host " , & g - > session . force_session_host ) ;
if ( ImGui : : IsItemHovered ( ) )
ImGui : : SetTooltip ( " Join another session to apply changes. The original host of the session must leave or be kicked. This feature is easily detectable by other mod menus, use with caution " ) ;
2022-05-04 19:16:40 +02:00
}
2022-10-26 14:12:29 +02:00
}