mirror of
https://github.com/FWGS/xash3d-fwgs.git
synced 2026-08-07 04:40:43 +08:00
engine: client: touch: forcefully disable edit mode when setclientonly was called
This commit is contained in:
@@ -527,12 +527,32 @@ static touch_button_t *Touch_FindFirst( touchbuttonlist_t *list, const char *nam
|
||||
return Touch_FindNext( list->first, name, privileged );
|
||||
}
|
||||
|
||||
static void Touch_DisableEdit_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( touch_in_menu.value )
|
||||
Cvar_DirectSet( &touch_in_menu, "0" );
|
||||
else if( cls.key_dest == key_game )
|
||||
Touch_WriteConfig();
|
||||
}
|
||||
|
||||
void Touch_SetClientOnly( byte state )
|
||||
{
|
||||
// TODO: fix clash with vgui cursors
|
||||
if( touch.clientonly == state )
|
||||
return;
|
||||
|
||||
// a1ba: the way client only touch buttons are used, they might come from
|
||||
// client.dll, locking user in edit state, so disable it first
|
||||
Touch_DisableEdit_f();
|
||||
|
||||
touch.clientonly = state;
|
||||
|
||||
touch.resize_finger = touch.move_finger = touch.look_finger = touch.wheel_finger = -1;
|
||||
@@ -1021,22 +1041,6 @@ static void Touch_EnableEdit_f( void )
|
||||
}
|
||||
}
|
||||
|
||||
static void Touch_DisableEdit_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( touch_in_menu.value )
|
||||
Cvar_DirectSet( &touch_in_menu, "0" );
|
||||
else if( cls.key_dest == key_game )
|
||||
Touch_WriteConfig();
|
||||
}
|
||||
|
||||
static void Touch_DeleteProfile_f( void )
|
||||
{
|
||||
if( Cmd_Argc() != 2 )
|
||||
|
||||
Reference in New Issue
Block a user