Talk:VGUI Screen Creation

From Valve Developer Community
Revision as of 20:18, 26 July 2005 by Zipster (talk | contribs) (Realized you can't modify CreateMove function because g_pClientMode is accessed through the IClientMode interface that shouldn't change.)
Jump to navigation Jump to search

Moved to "Creating a VGUI Screen" because the Entity description for the vgui_screen entity needs to have this page. --King2500 15:45, 14 Jul 2005 (PDT)

Fix

The input fix for the VGUI panel is poorly explained and doesn't address the real issue. I actually had to look at the revision history to see why the fix was needed at all before I could explore it further. The real problem is that CInput::ExtraMouseSample uses a dummy CUserCmd structure that only updates the mouse elements, but leaves the keyboard elements uninitialized at 0. So when g_pClientMode->CreateMove() is called near the end of the function it calls C_BasePlayer::DetermineVguiInputMode() with the bad input. This further explains why this function would be called 4 or 5 times, since it's the engine requesting extra mouse samples.