//|_ _ _. _ ._ |_ _. _ | //| | (/_ (_| \/ (/_ | | | | (_| (_ |< #include "menu.h" #include "conin.h" #include "cs2/hack.h" #include "xorstr.hpp" PROCESS64* cs2p; I32 perf_tickrate = 2048; I8 menu_page = 1; MENU_PAGE menu_pages[MENU_PAGE_MAX - MENU_PAGE_MIN + 1]; void show_paging( U8 num ) { char line_str[CON_MAX_WIDTH + 3]{}; U32 cur_char = 0; if( num > MENU_PAGE_MIN ) { sprintf( line_str, "<-%s", menu_pages[num-1].name ); cur_char = strlen( line_str ); } char mid_str[16]; sprintf( mid_str, "[%d] %s", num, menu_pages[num].name ); I32 mid_len = strlen( mid_str ); I32 diff = CON_MAX_WIDTH / 2 - (I32)cur_char - mid_len / 2; memset( line_str + cur_char, ' ', diff ); cur_char += diff; strcat( line_str, mid_str ); cur_char += mid_len; if( num < MENU_PAGE_MAX ) { char next_str[16]; sprintf( next_str, "%s->", menu_pages[num+1].name ); I32 next_len = strlen( next_str ); I32 diff = CON_MAX_WIDTH - (I32)cur_char - next_len; memset( line_str + cur_char, ' ', diff ); strcat( line_str, next_str ); } con_set_line( CON_MAX_HEIGHT - 1, line_str, "", con_selected_line == CON_MAX_HEIGHT - 1, CONFG_MAGENTA ); con_set_line_callback( CON_MAX_HEIGHT - 1, []( CON_LINE* self, U8 action ) { if( action == LINE_ACTION_LEFTARROW && menu_page > MENU_PAGE_MIN ) --menu_page; if( action == LINE_ACTION_RIGHTARROW && menu_page < MENU_PAGE_MAX ) ++menu_page; con_clear(); menu_pages[menu_page].page_fn(); show_paging( menu_page ); } ); } void show_page_0() { con_set_line_text( 0, "load config", false ); con_set_line_subtext( 0, "[ENTER]", false, CONFG_LIGHTBLUE ); con_set_line_callback( 0, []( CON_LINE* self, U8 action ) { if( action == LINE_ACTION_ENTER ) { gcfg.load(); } } ); con_set_line_text( 1, "save config", false ); con_set_line_subtext( 1, "[ENTER]", false, CONFG_LIGHTBLUE ); con_set_line_callback( 1, []( CON_LINE* self, U8 action ) { if( action == LINE_ACTION_ENTER ) { gcfg.save(); } } ); con_set_line_text( 2, "perf_tickrate", false ); con_set_line_subtext( 2, u_num_to_string_dec( perf_tickrate ), false, CONFG_BLUE ); con_set_line_callback( 2, []( CON_LINE* self, U8 action ) { if( action == LINE_ACTION_LEFTARROW ) { if( GetAsyncKeyState( VK_LCONTROL ) & 0x8000 ) { if( perf_tickrate > 10 ) perf_tickrate -= 10; else perf_tickrate = 0; } else { if( perf_tickrate > 0 ) --perf_tickrate; } } if( action == LINE_ACTION_RIGHTARROW ) { if( GetAsyncKeyState( VK_LCONTROL ) & 0x8000 ) { if( perf_tickrate < 2048 ) perf_tickrate += 10; else perf_tickrate = 2048; } else { if( perf_tickrate < 2048 ) ++perf_tickrate; } } con_set_line_subtext( 2, u_num_to_string_dec( perf_tickrate ), true, CONFG_BLUE ); } ); } void show_page_1() { /*static SETTING& bhop_active = *gcfg.find( "bhop_active"fnv ); static SETTING& chams_active = *gcfg.find( "chams_active"fnv ); static SETTING& glow_active = *gcfg.find( "glow_active"fnv ); static SETTING& nightmode_active = *gcfg.find( "nightmode_active"fnv ); static SETTING& noflash_active = *gcfg.find( "noflash_active"fnv ); static SETTING& clantag_active = *gcfg.find( "clantag_active"fnv ); con_set_line_text( 0,"bhop",false ); con_set_line_subtext( 0, bhop_active? "[on]" : "[off]", con_selected_line == 0, bhop_active? CONFG_LIGHTGREEN : CONFG_LIGHTRED ); con_set_line_callback(0,[]( CON_LINE *self,U8 action ) { bhop_active = !bhop_active; con_set_line_subtext( 0, bhop_active? "[on]" : "[off]", self->active, bhop_active? CONFG_LIGHTGREEN : CONFG_LIGHTRED ); }); con_set_line_text(1, "chams", false); con_set_line_subtext( 1, chams_active? "[on]" : "[off]", false, chams_active? CONFG_LIGHTGREEN : CONFG_LIGHTRED ); con_set_line_callback( 1, []( CON_LINE *self,U8 action ) { chams_active = !chams_active; con_set_line_subtext( 1, chams_active? "[on]" : "[off]", self->active, chams_active? CONFG_LIGHTGREEN : CONFG_LIGHTRED ); }); con_set_line_text(2, "glow", false); con_set_line_subtext( 2, glow_active? "[on]" : "[off]", false, glow_active? CONFG_LIGHTGREEN : CONFG_LIGHTRED ); con_set_line_callback( 2, []( CON_LINE *self,U8 action ) { glow_active = !glow_active; con_set_line_subtext( 2, glow_active? "[on]" : "[off]", self->active, glow_active? CONFG_LIGHTGREEN : CONFG_LIGHTRED ); }); con_set_line_text(3, "nightmode", false); con_set_line_subtext( 3, nightmode_active? "[on]" : "[off]", false, nightmode_active? CONFG_LIGHTGREEN : CONFG_LIGHTRED ); con_set_line_callback( 3, []( CON_LINE *self,U8 action ) { nightmode_active = !nightmode_active; con_set_line_subtext( 3, nightmode_active? "[on]" : "[off]", self->active, nightmode_active? CONFG_LIGHTGREEN : CONFG_LIGHTRED ); }); con_set_line_text( 4, "no flash", false ); con_set_line_subtext( 4, noflash_active? "[on]" : "[off]", false, noflash_active? CONFG_LIGHTGREEN : CONFG_LIGHTRED ); con_set_line_callback( 4, []( CON_LINE *self,U8 action ) { noflash_active = !noflash_active; con_set_line_subtext( 4, noflash_active? "[on]" : "[off]", self->active, noflash_active? CONFG_LIGHTGREEN : CONFG_LIGHTRED ); }); con_set_line_text( 5, "clantag changer" ); con_set_line_subtext( 5, clantag_active? "[on]" : "[off]", false, clantag_active? CONFG_LIGHTGREEN : CONFG_LIGHTRED ); con_set_line_callback( 5, []( CON_LINE* self, U8 action ) { clantag_active = !clantag_active; con_set_line_subtext( 5, clantag_active? "[on]" : "[off]", self->active, clantag_active? CONFG_LIGHTGREEN : CONFG_LIGHTRED ); } ); con_set_line_text( 7, "dump syscalls to syscall_arch.dump", false ); con_set_line_subtext( 7, key_titles[VK_RETURN], false, CONFG_LIGHTBLUE ); con_set_line_callback( 7, []( CON_LINE*, U8 action ) { if( action == LINE_ACTION_ENTER ) syscall_dump_to_file(); } );*/ } void show_page_2() { /*static SETTING& aim_active = *gcfg.find( "aim_active"fnv ); static SETTING& crosshair_active = *gcfg.find( "crosshair_active"fnv ); static SETTING& rcs_active = *gcfg.find( "rcs_active"fnv ); static SETTING& triggerbot_key = *gcfg.find( "triggerbot_key"fnv ); static SETTING& triggerteam_active = *gcfg.find( "triggerteam_active"fnv ); con_set_line_text( 0,"aim assist",false ); con_set_line_subtext( 0, aim_active? "[on]" : "[off]", con_selected_line == 0, aim_active? CONFG_LIGHTGREEN : CONFG_LIGHTRED ); con_set_line_callback(0,[]( CON_LINE *self,U8 action ) { aim_active = !aim_active; con_set_line_subtext( 0, aim_active? "[on]" : "[off]", self->active, aim_active? CONFG_LIGHTGREEN : CONFG_LIGHTRED ); }); con_set_line_text( 1, "rcs xhair", false); con_set_line_subtext( 1, crosshair_active? "[on]" : "[off]", false, crosshair_active? CONFG_LIGHTGREEN : CONFG_LIGHTRED ); con_set_line_callback( 1, []( CON_LINE *self,U8 action ) { crosshair_active = !crosshair_active; con_set_line_subtext( 1, crosshair_active? "[on]" : "[off]", self->active, crosshair_active? CONFG_LIGHTGREEN : CONFG_LIGHTRED ); }); con_set_line_text( 2, "rcs", false ); con_set_line_subtext( 2, rcs_active? "[on]" : "[off]", false, rcs_active? CONFG_LIGHTGREEN : CONFG_LIGHTRED ); con_set_line_callback( 2, []( CON_LINE *self,U8 action ) { rcs_active = !rcs_active; con_set_line_subtext( 2, rcs_active? "[on]" : "[off]", self->active, rcs_active? CONFG_LIGHTGREEN : CONFG_LIGHTRED ); }); con_set_line_text( 3, "triggerbot", false ); con_set_line_subtext( 3, key_titles[triggerbot_key], false, CONFG_LIGHTBLUE ); con_set_line_callback( 3, []( CON_LINE *,U8 action ) { if( action == LINE_ACTION_ENTER ) { con_update_hotkey( 3, triggerbot_key.v ); } } ); con_set_line_text( 4, "trigger team", false ); con_set_line_subtext( 4, triggerteam_active? "[on]" : "[off]", false, triggerteam_active? CONFG_LIGHTGREEN : CONFG_LIGHTRED ); con_set_line_callback( 4, []( CON_LINE *self,U8 action ) { triggerteam_active = !triggerteam_active; con_set_line_subtext( 4, triggerteam_active? "[on]" : "[off]", self->active, triggerteam_active? CONFG_LIGHTGREEN : CONFG_LIGHTRED ); });*/ } void menu_show_ui( PROCESS64 *p ) { con_clear(); con_capturing_input = true; menu_pages[0] = { "config", &show_page_0 }; menu_pages[1] = { "general", &show_page_1 }; menu_pages[2] = { "aim", &show_page_2 }; show_page_1(); show_paging( 1 ); con_set_bottomline_text( xorstr( "LOCALPLAYER: %08X | FLAGS: %08X | menu" ).get(), 0x0,0x0 ); }