void CUIMapList::UpdateMapList(EGameTypes GameType){ m_pList1->Clear (); m_pList2->Clear (); for (u32 i=0; i<m_maps[GameType].size(); ++i) { CUIListBoxItem* itm = m_pList1->AddItem( CStringTable().translate(m_maps[GameType][i]).c_str() ); itm->SetData ( (void*)(__int64)i ); itm->Enable(m_pExtraContentFilter->IsDataEnabled(m_maps[GameType][i].c_str())); } }
void CUIMapList::UpdateMapList(EGameTypes GameType) { m_pList1->Clear (); m_pList2->Clear (); const SGameTypeMaps& M = gMapListHelper.GetMapListFor(GameType); u32 cnt = M.m_map_names.size(); for (u32 i=0; i<cnt; ++i) { CUIListBoxItem* itm = m_pList1->AddItem( CStringTable().translate(M.m_map_names[i]).c_str() ); itm->SetData ( (void*)(__int64)i ); itm->Enable(m_pExtraContentFilter->IsDataEnabled(M.m_map_names[i].c_str())); } }
void CUIMapList::UpdateMapList(EGameIDs GameType) { typedef buffer_vector<shared_str> MapList; m_pList1->Clear (); const SGameTypeMaps& M = gMapListHelper.GetMapListFor(GameType); u32 cnt = M.m_map_names.size(); for (u32 i=0; i<cnt; ++i) { CUIListBoxItem* itm = m_pList1->AddTextItem( CStringTable().translate(M.m_map_names[i].map_name).c_str() ); itm->SetData ( (void*)(__int64)i ); itm->Enable (true); } u32 list_size = m_pList2->GetSize(); if ( list_size == 0 ) { m_pList2->Clear (); return; } MapList map_list( _alloca( sizeof(shared_str) * list_size ), list_size ); for ( u32 i = 0; i < list_size; ++i ) { LPCSTR st = m_pList2->GetText( i ); map_list.push_back( st ); } m_pList2->Clear(); MapList::const_iterator itb = map_list.begin(); MapList::const_iterator ite = map_list.end(); for ( ; itb != ite; ++itb ) { CUIListBoxItem* itm1 = GetMapItem_fromList1( *itb ); if ( itm1 ) { CUIListBoxItem* itm2 = m_pList2->AddTextItem( (*itb).c_str() ); itm2->SetData( itm1->GetData() ); itm2->Enable( true ); } } }