mirror of
https://github.com/ValveSoftware/source-sdk-2013.git
synced 2025-04-08 18:40:26 +03:00
Fix crash on VGUI menu bar button cursor entrance
This commit is contained in:
parent
6956e9680e
commit
48809cb86c
@ -41,7 +41,11 @@ protected:
|
||||
virtual void PerformLayout();
|
||||
virtual void Paint();
|
||||
MESSAGE_FUNC( OnMenuClose, "MenuClose" );
|
||||
MESSAGE_FUNC_INT( OnCursorEnteredMenuButton, "CursorEnteredMenuButton", VPanel);
|
||||
#ifdef PLATFORM_64BITS
|
||||
MESSAGE_FUNC_PTR( OnCursorEnteredMenuButton, "CursorEnteredMenuButton", VPanel );
|
||||
#else
|
||||
MESSAGE_FUNC_INT( OnCursorEnteredMenuButton, "CursorEnteredMenuButton", VPanel );
|
||||
#endif
|
||||
|
||||
private:
|
||||
CUtlVector<MenuButton *> m_pMenuButtons;
|
||||
|
@ -221,9 +221,15 @@ void MenuBar::OnMenuClose()
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Message map
|
||||
//-----------------------------------------------------------------------------
|
||||
void MenuBar::OnCursorEnteredMenuButton(int VPanel)
|
||||
#ifdef PLATFORM_64BITS
|
||||
void MenuBar::OnCursorEnteredMenuButton(vgui::Panel* VPanel)
|
||||
{
|
||||
VPANEL menuButton = (VPANEL)VPanel;
|
||||
#else
|
||||
void Menu::OnCursorEnteredMenuItem(int VPanel)
|
||||
{
|
||||
VPANEL menuButton = (VPANEL)VPanel;
|
||||
#endif
|
||||
// see if we had a menu open
|
||||
for ( int i = 0; i < m_pMenuButtons.Count(); i++)
|
||||
{
|
||||
|
@ -238,7 +238,11 @@ void MenuButton::OnCursorEntered()
|
||||
// forward the message on to the parent of this menu.
|
||||
KeyValues *msg = new KeyValues ("CursorEnteredMenuButton");
|
||||
// tell the parent this menuitem is the one that was entered so it can open the menu if it wants
|
||||
#ifdef PLATFORM_64BITS
|
||||
msg->SetPtr("VPanel", (void*)GetVPanel());
|
||||
#else
|
||||
msg->SetInt("VPanel", GetVPanel());
|
||||
#endif
|
||||
ivgui()->PostMessage(GetVParent(), msg, NULL);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user