Talk:VGUI Screen Creation: Difference between revisions
(Fix) |
m (Realized you can't modify CreateMove function because g_pClientMode is accessed through the IClientMode interface that shouldn't change.) |
||
Line 3: | Line 3: | ||
== Fix == | == 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 <code>CInput::ExtraMouseSample</code> uses a dummy CUserCmd structure that only updates the mouse elements, but leaves the keyboard elements uninitialized at 0. So when <code>g_pClientMode->CreateMove()</code> is called near the end of the function it calls <code>C_BasePlayer::DetermineVguiInputMode()</code> 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. | 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 <code>CInput::ExtraMouseSample</code> uses a dummy CUserCmd structure that only updates the mouse elements, but leaves the keyboard elements uninitialized at 0. So when <code>g_pClientMode->CreateMove()</code> is called near the end of the function it calls <code>C_BasePlayer::DetermineVguiInputMode()</code> 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. |
Revision as of 20:18, 26 July 2005
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.