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

Function DrawDialogHook

bwapi/BWAPI/Source/Detours.cpp:412–441  ·  view source on GitHub ↗

------------------------------------------------- MENU HOOK ------------------------------------------------

Source from the content-addressed store, hash-verified

410}
411//------------------------------------------------- MENU HOOK ------------------------------------------------
412void __stdcall DrawDialogHook(BW::Bitmap *pSurface, BW::bounds *pBounds)
413{
414 if ( BW::pOldDrawDialogProc )
415 BW::pOldDrawDialogProc(pSurface, pBounds);
416
417 if ( BW::BWDATA::gwGameMode == BW::GAME_GLUES )
418 BWAPI::BroodwarImpl.onMenuFrame();
419
420 BW::dialog *timeout = BW::FindDialogGlobal("TimeOut");
421 if ( timeout )
422 {
423 BW::dialog *dropbtn = timeout->findIndex(2);
424 if ( !dropbtn->isDisabled() && BWAPI::BroodwarImpl.wantDropPlayers )
425 BWAPI::BroodwarImpl.dropPlayers();
426 }
427
428 // WMODE config option
429 if ( switchToWMode && ghMainWnd )
430 {
431 switchToWMode = false;
432 SetWMode(windowRect.right, windowRect.bottom, true);
433 }
434
435 //click the menu dialog that pops up when you win/lose a game
436 BW::dialog *endDialog = BW::FindDialogGlobal("LMission");
437 if ( !endDialog )
438 endDialog = BW::FindDialogGlobal("WMission");
439 if ( endDialog )
440 endDialog->findIndex(-2)->activate();
441}
442
443//--------------------------------------------- OPEN FILE HOOK -----------------------------------------------
444std::string lastFile;

Callers

nothing calls this directly

Calls 7

FindDialogGlobalFunction · 0.85
SetWModeFunction · 0.85
findIndexMethod · 0.80
isDisabledMethod · 0.80
dropPlayersMethod · 0.80
activateMethod · 0.80
onMenuFrameMethod · 0.45

Tested by

no test coverage detected