arm64 : fix vgui2 VPAMEL in messagemap

This commit is contained in:
hymei
2022-06-05 01:13:13 +03:00
committed by nillerusr
parent 0499fde751
commit 3bc519aecf
12 changed files with 69 additions and 35 deletions
+12
View File
@@ -869,6 +869,18 @@ void BuildGroup::PanelAdded(Panel *panel)
_panelDar.AddToTail(temp);
}
//-----------------------------------------------------------------------------
// Purpose: Add panel the list of panels that are in the build group
//-----------------------------------------------------------------------------
void BuildGroup::PanelRemoved(Panel *panel)
{
Assert(panel);
PHandle temp;
temp = panel;
_panelDar.FindAndRemove(temp);
}
//-----------------------------------------------------------------------------
// Purpose: loads the control settings from file
//-----------------------------------------------------------------------------
+2 -4
View File
@@ -2365,9 +2365,8 @@ int Menu::GetCurrentlyHighlightedItem()
//-----------------------------------------------------------------------------
// Purpose: Respond to cursor entering a menuItem.
//-----------------------------------------------------------------------------
void Menu::OnCursorEnteredMenuItem(int VPanel)
void Menu::OnCursorEnteredMenuItem(VPANEL menuItem)
{
VPANEL menuItem = (VPANEL)VPanel;
// if we are in mouse mode
if (m_iInputMode == MOUSE)
{
@@ -2389,9 +2388,8 @@ void Menu::OnCursorEnteredMenuItem(int VPanel)
//-----------------------------------------------------------------------------
// Purpose: Respond to cursor exiting a menuItem
//-----------------------------------------------------------------------------
void Menu::OnCursorExitedMenuItem(int VPanel)
void Menu::OnCursorExitedMenuItem(VPANEL menuItem)
{
VPANEL menuItem = (VPANEL)VPanel;
// only care if we are in mouse mode
if (m_iInputMode == MOUSE)
{
+2 -2
View File
@@ -222,7 +222,7 @@ void MenuItem::OnCursorEntered()
// forward the message on to the parent of this menu.
KeyValues *msg = new KeyValues ("CursorEnteredMenuItem");
// tell the parent this menuitem is the one that was entered so it can highlight it
msg->SetInt("VPanel", GetVPanel());
msg->SetInt("menuItem", ToHandle() );
ivgui()->PostMessage(GetVParent(), msg, NULL);
}
@@ -236,7 +236,7 @@ void MenuItem::OnCursorExited()
// forward the message on to the parent of this menu.
KeyValues *msg = new KeyValues ("CursorExitedMenuItem");
// tell the parent this menuitem is the one that was entered so it can unhighlight it
msg->SetInt("VPanel", GetVPanel());
msg->SetInt("menuItem", ToHandle() );
ivgui()->PostMessage(GetVParent(), msg, NULL);
}
+21 -10
View File
@@ -880,7 +880,7 @@ const char *Panel::GetClassName()
{
// loop up the panel map name
PanelMessageMap *panelMap = GetMessageMap();
if ( panelMap )
if ( panelMap && panelMap->pfnClassName )
{
return panelMap->pfnClassName();
}
@@ -3575,7 +3575,7 @@ void Panel::RequestFocus(int direction)
//-----------------------------------------------------------------------------
void Panel::OnRequestFocus(VPANEL subFocus, VPANEL defaultPanel)
{
CallParentFunction(new KeyValues("OnRequestFocus", "subFocus", subFocus, "defaultPanel", defaultPanel));
CallParentFunction(new KeyValues("OnRequestFocus", "subFocus", ivgui()->PanelToHandle( subFocus ), "defaultPanel", ivgui()->PanelToHandle( defaultPanel )));
}
//-----------------------------------------------------------------------------
@@ -3800,13 +3800,17 @@ void Panel::SetTall(int tall)
void Panel::SetBuildGroup(BuildGroup* buildGroup)
{
//TODO: remove from old group
Assert(buildGroup != NULL);
_buildGroup = buildGroup;
_buildGroup->PanelAdded(this);
if ( _buildGroup == buildGroup )
return;
if ( _buildGroup.Get() )
{
_buildGroup->PanelRemoved( this );
}
_buildGroup = buildGroup;
if ( _buildGroup.Get() )
{
_buildGroup->PanelAdded(this);
}
}
bool Panel::IsBuildGroupEnabled()
@@ -5134,6 +5138,13 @@ void Panel::OnMessage(const KeyValues *params, VPANEL ifromPanel)
VPANEL vp = ivgui()->HandleToPanel( param1->GetInt() );
(this->*((MessageFunc_HandleConstCharPtr_t)pMap->func))( vp, param2->GetWString() );
}
else if ( (DATATYPE_HANDLE == pMap->firstParamType) && (DATATYPE_HANDLE == pMap->secondParamType) )
{
typedef void (Panel::*MessageFunc_HandleConstCharPtr_t)(VPANEL, VPANEL);
VPANEL vp1 = ivgui()->HandleToPanel( param1->GetInt() );
VPANEL vp2 = ivgui()->HandleToPanel( param1->GetInt() );
(this->*((MessageFunc_HandleConstCharPtr_t)pMap->func))( vp1, vp2 );
}
else
{
// the message isn't handled
@@ -5515,7 +5526,7 @@ void Panel::OnDelete()
// Purpose: Panel handle implementation
// Returns a pointer to a valid panel, NULL if the panel has been deleted
//-----------------------------------------------------------------------------
Panel *PHandle::Get()
Panel *PHandle::Get() const
{
if (m_iPanelID != INVALID_PANEL)
{