MCPcopy Create free account
hub / github.com/StrongPC123/Far-Cry-1-Source-Full / SelectItem

Method SelectItem

Editor/BaseLibraryDialog.cpp:529–562  ·  view source on GitHub ↗

/////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

527
528//////////////////////////////////////////////////////////////////////////
529void CBaseLibraryDialog::SelectItem( CBaseLibraryItem *item,bool bForceReload )
530{
531 if (item == m_pCurrentItem && !bForceReload)
532 return;
533
534 if (item)
535 {
536 // Selecting item from different library.
537 if (item->GetLibrary() != m_pLibrary)
538 {
539 // Select library first.
540 SelectLibrary( item->GetLibrary()->GetName() );
541 }
542 }
543
544 m_pCurrentItem = item;
545
546 if (item)
547 {
548 m_selectedGroup = item->GetGroupName();
549 }
550 else
551 m_selectedGroup = "";
552
553 m_pCurrentItem = item;
554
555 // Set item visible.
556 HTREEITEM hItem = stl::find_in_map( m_itemsToTree,item,(HTREEITEM)0 );
557 if (hItem)
558 {
559 m_treeCtrl.SelectItem(hItem);
560 m_treeCtrl.EnsureVisible(hItem);
561 }
562}
563
564//////////////////////////////////////////////////////////////////////////
565void CBaseLibraryDialog::Update()

Callers

nothing calls this directly

Calls 4

find_in_mapFunction · 0.85
GetGroupNameMethod · 0.80
GetLibraryMethod · 0.45
GetNameMethod · 0.45

Tested by

no test coverage detected