mirror of
https://github.com/ValveSoftware/source-sdk-2013.git
synced 2025-04-18 15:22:47 +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 PerformLayout();
|
||||||
virtual void Paint();
|
virtual void Paint();
|
||||||
MESSAGE_FUNC( OnMenuClose, "MenuClose" );
|
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:
|
private:
|
||||||
CUtlVector<MenuButton *> m_pMenuButtons;
|
CUtlVector<MenuButton *> m_pMenuButtons;
|
||||||
|
@ -221,9 +221,15 @@ void MenuBar::OnMenuClose()
|
|||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Purpose: Message map
|
// Purpose: Message map
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
void MenuBar::OnCursorEnteredMenuButton(int VPanel)
|
#ifdef PLATFORM_64BITS
|
||||||
|
void MenuBar::OnCursorEnteredMenuButton(vgui::Panel* VPanel)
|
||||||
{
|
{
|
||||||
VPANEL menuButton = (VPANEL)VPanel;
|
VPANEL menuButton = (VPANEL)VPanel;
|
||||||
|
#else
|
||||||
|
void Menu::OnCursorEnteredMenuItem(int VPanel)
|
||||||
|
{
|
||||||
|
VPANEL menuButton = (VPANEL)VPanel;
|
||||||
|
#endif
|
||||||
// see if we had a menu open
|
// see if we had a menu open
|
||||||
for ( int i = 0; i < m_pMenuButtons.Count(); i++)
|
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.
|
// forward the message on to the parent of this menu.
|
||||||
KeyValues *msg = new KeyValues ("CursorEnteredMenuButton");
|
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
|
// 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());
|
msg->SetInt("VPanel", GetVPanel());
|
||||||
|
#endif
|
||||||
ivgui()->PostMessage(GetVParent(), msg, NULL);
|
ivgui()->PostMessage(GetVParent(), msg, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user