MCPcopy Create free account
hub / github.com/bwapi/bwapi / findIndex

Method findIndex

bwapi/BWAPI/Source/BW/Dialog.cpp:244–265  ·  view source on GitHub ↗

----------------- CONSTRUCTORS ------------------ dialog::dialog(u16 ctrlType, short index, const char *text, u16 left, u16 top, u16 width, u16 height, bool (__fastcall *pfInteract)(dialog*,dlgEvent*)) : pNext( nullptr ) , srcBits(width, height) , pszText( const_cast (text) ) , lFlags( CTRL_VISIBLE ) , wIndex( index ) , wCtrlType( ctrlType ) { if ( ctrlT

Source from the content-addressed store, hash-verified

242 }*/
243 // --------------------- FIND ----------------------
244 dialog *dialog::findIndex(short wIndex)
245 {
246 if ( !this )
247 return nullptr;
248
249 dialog *pCurrDlg;
250 if ( this->isDialog() )
251 pCurrDlg = this;
252 else
253 pCurrDlg = this->parent();
254
255 if ( pCurrDlg )
256 pCurrDlg = pCurrDlg->child();
257
258 while ( pCurrDlg && pCurrDlg->getIndex() != wIndex )
259 pCurrDlg = pCurrDlg->next();
260
261 if ( pCurrDlg && pCurrDlg->getIndex() == wIndex )
262 return pCurrDlg;
263
264 return nullptr;
265 }
266 // ------------------ FIND BY NAME -----------------
267 dialog *dialog::findDialog(const char *pszName)
268 {

Callers 3

DrawDialogHookFunction · 0.80
_changeRaceMethod · 0.80
onMenuFrameMethod · 0.80

Calls 5

isDialogMethod · 0.95
parentMethod · 0.95
childMethod · 0.80
nextMethod · 0.80
getIndexMethod · 0.45

Tested by

no test coverage detected