engine: client: properly exit from touch editor to menu when user have chosen to cancel and reset

This commit is contained in:
Alibek Omarov 2024-07-29 05:11:41 +03:00
parent 943a30af04
commit dd570b616b

View file

@ -767,14 +767,18 @@ static void Touch_ReloadConfig_f( void )
touch.state = state_none;
if( touch.edit )
touch.edit->finger = -1;
if( touch.selection )
touch.selection->finger = -1;
touch.edit = touch.selection = NULL;
touch.resize_finger = touch.move_finger = touch.look_finger = touch.wheel_finger = -1;
if( FS_FileExists( touch_config_file.string, true ) )
{
if( touch_in_menu.value )
Cvar_DirectSet( &touch_in_menu, "0" );
if( FS_FileExists( touch_config_file.string, true ))
Cbuf_AddTextf( "exec \"%s\"\n", touch_config_file.string );
}
else
{
Touch_LoadDefaults_f();
@ -1010,7 +1014,7 @@ static void Touch_DisableEdit_f( void )
{
Cvar_Set( "touch_in_menu", "0" );
}
else if( cls.key_dest == key_game )
else if( cls.key_dest == key_game )
Touch_WriteConfig();
}