Skip to content

Commit

Permalink
Merge pull request #301 from tyabus/vguidrawtree
Browse files Browse the repository at this point in the history
engine: Fixed vgui_drawtree on 64 bit engine
  • Loading branch information
nillerusr authored Oct 7, 2023
2 parents c444095 + 1f3f05d commit a709667
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions engine/vgui_drawtreepanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ class CDrawTreeFrame : public vgui::Frame

if ( data )
{
g_DrawTreeSelectedPanel = (data) ? (vgui::VPANEL)data->GetInt( "PanelPtr", 0 ) : 0;
g_DrawTreeSelectedPanel = (data) ? (vgui::VPANEL)data->GetPtr( "PanelPtr", 0 ) : 0;
}
else
{
Expand Down Expand Up @@ -388,7 +388,7 @@ void VGui_RecursivePrintTree(
Q_snprintf( str, sizeof( str ), "%s", name );

pVal->SetString( "Text", str );
pVal->SetInt( "PanelPtr", current );
pVal->SetPtr( "PanelPtr", (void*)current );

pNewParent = pVal;

Expand Down Expand Up @@ -417,23 +417,23 @@ bool UpdateItemState(
vgui::IPanel *ipanel = vgui::ipanel();

KeyValues *pItemData = pTree->GetItemData( iChildItemId );
if ( pItemData->GetInt( "PanelPtr" ) != pSub->GetInt( "PanelPtr" ) ||
if ( pItemData->GetPtr( "PanelPtr" ) != pSub->GetPtr( "PanelPtr" ) ||
Q_stricmp( pItemData->GetString( "Text" ), pSub->GetString( "Text" ) ) != 0 )
{
pTree->ModifyItem( iChildItemId, pSub );
bRet = true;
}

// Ok, this is a new panel.
vgui::VPANEL vPanel = pSub->GetInt( "PanelPtr" );
vgui::VPANEL vPanel = (vgui::VPANEL)pSub->GetPtr( "PanelPtr" );

int iBaseColor[3] = { 255, 255, 255 };
if ( ipanel->IsPopup( vPanel ) )
{
iBaseColor[0] = 255; iBaseColor[1] = 255; iBaseColor[2] = 0;
}

if ( g_FocusPanelList.Find( vPanel ) != -1 )
if ( g_FocusPanelList.Find( vPanel ) != vgui::INVALID_PANEL )
{
iBaseColor[0] = 0; iBaseColor[1] = 255; iBaseColor[2] = 0;
pTree->ExpandItem( iChildItemId, true );
Expand Down

0 comments on commit a709667

Please sign in to comment.