summaryrefslogtreecommitdiff
path: root/internal_rewrite/ui.h
diff options
context:
space:
mode:
authorUnknown <azeem@live.ru>2018-11-03 11:54:21 +0000
committerUnknown <azeem@live.ru>2018-11-03 11:54:21 +0000
commit90c1619363d89e0ab041f72945b36cfde8b2917a (patch)
treeb3e99a8daf7598bec2eda3dc6f488e687f0b63e8 /internal_rewrite/ui.h
parentb48ce5a80d059d802d1ef3a872731df45ee57c9d (diff)
gay shit
Diffstat (limited to 'internal_rewrite/ui.h')
-rw-r--r--internal_rewrite/ui.h23
1 files changed, 18 insertions, 5 deletions
diff --git a/internal_rewrite/ui.h b/internal_rewrite/ui.h
index f7c3fd7..56f6c88 100644
--- a/internal_rewrite/ui.h
+++ b/internal_rewrite/ui.h
@@ -711,10 +711,13 @@ namespace ui
}
auto fake_ping = std::make_shared< ui::c_form >( 0, 0, 215, 0, xors( "fake latency" ) ); {
+ static auto sv_maxunlag = g_csgo.m_cvar( )->FindVar( "sv_maxunlag" );
+
fake_ping->add_item( std::make_shared< ui::c_dropdown< > >( 0, 0, 120, xors( "enabled" ), &g_settings.misc.net_fakelag,
&dropdowns::fake_ping_activation ) )->add_item( std::make_shared< ui::c_key_picker_small >( 195, 0, &g_settings.misc.net_fakeping_key )
)->set_cond( [ ]( ) { return g_settings.misc.net_fakelag == 1 || g_settings.misc.net_fakelag == 2; } );
- fake_ping->add_item( std::make_shared< ui::c_slider< int > >( 0, 0, 120, 0, 800, xors( "amount" ), &g_settings.misc.net_fakeping_amount( ) )
+
+ fake_ping->add_item( std::make_shared< ui::c_slider< int > >( 0, 0, 120, 0, ( int )( sv_maxunlag->get_float( ) * 1000 ), xors( "amount" ), &g_settings.misc.net_fakeping_amount( ) )
)->set_cond( [ ]( ) { return g_settings.misc.net_fakelag != 4; } );
}
@@ -804,7 +807,7 @@ namespace ui
}
subtab_movement_recorder->add_item( main_form );
- }
+ }
subtab_sheet->add_item( subtab_movement_recorder );
subtab_sheet->add_item( subtab_skins );
@@ -815,16 +818,18 @@ namespace ui
auto tab_config = std::make_shared< ui::c_tab_sheet >( xors( "config" ), &icons::sprite_config ); {
- auto cfg_form = std::make_shared< ui::c_form >( 0, 10, 200, 113, xors( "config" ) );
+ auto cfg_form = std::make_shared< ui::c_form >( 0, 10, 200, 134, xors( "config" ) );
cfg_form->add_item( std::make_shared< ui::c_dropdown< > >( 0, 0, 180, xors( "setting" ), &g_settings.menu.cur_setting, &dropdowns::configs ) );
cfg_form->add_item( std::make_shared< ui::c_button >( 0, 0, 85, 20, xors( "save" ), []( ) { g_settings.save( ); } ) );
cfg_form->add_item( std::make_shared< ui::c_button >( 95, -25, 85, 20, xors( "load" ), []( ) { g_settings.load( ); } ) );
+ cfg_form->add_item( std::make_shared< ui::c_button >( 0, -25, 85, 20, xors( "reset" ), []( ) { g_settings.reset( ); g_settings.save( ); } ) );
+ cfg_form->add_item( std::make_shared< ui::c_button >( 95, -50, 85, 20, xors( "unload" ), []( ) { g_settings.reset( ); } ) );
//cfg_form->add_item( std::make_shared< ui::c_button >( 0, -25, 85, 20, xors( "to clipboard" ), [ ]( ) { g_settings.copy_to_clipboard( ); } ) );
//cfg_form->add_item( std::make_shared< ui::c_button >( 95, -50, 85, 20, xors( "from clipboard" ), [ ]( ) { g_settings.load_from_clipboard( ); } ) );
- auto label = cfg_form->add_item( std::make_shared< ui::c_label >( 0, -25, xors( "menu color" ) ) );
+ auto label = cfg_form->add_item( std::make_shared< ui::c_label >( 0, -50, xors( "menu color" ) ) );
label->add_item( std::make_shared< ui::c_color_picker >( 165, 4, 15, &g_settings.menu.menu_color ) );
- cfg_form->add_item( std::make_shared< ui::c_checkbox >( 0, -25, xors( "anti-untrusted" ), &g_settings.menu.anti_untrusted ) );
+ cfg_form->add_item( std::make_shared< ui::c_checkbox >( 0, -50, xors( "anti-untrusted" ), &g_settings.menu.anti_untrusted ) );
tab_config->add_item( cfg_form );
}
@@ -870,6 +875,14 @@ namespace ui
static auto jitter_air = menu->find_item( xors( "in-air yaw jitter" ) );
jitter_air->set_text( g_settings.rage.air_yaw == 2 ? xors( "spin range" ) : xors( "in-air yaw jitter" ) );
+ static auto sv_maxunlag = g_csgo.m_cvar( )->FindVar( "sv_maxunlag" );
+ static auto fakeping_slider = ( c_slider< int >* )menu->find_item( xors( "amount" ) ).get( );
+
+ auto game_rules = c_base_player::get_game_rules( );
+ if( game_rules ) {
+ fakeping_slider->set_max( *( bool* )( game_rules + 0x75 ) ? 0.f : 800.f );
+ }
+
render_item( menu.get( ) );
// This was annoying me so I decided to remove it in Release mode.