MCPcopy Create free account
hub / github.com/TurningWheel/Barony / drawCalloutMenu

Method drawCalloutMenu

src/interface/interface.cpp:30437–31468  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30435}
30436
30437void CalloutRadialMenu::drawCalloutMenu()
30438{
30439 auto player = players[gui_player];
30440 if ( !player->isLocalPlayer() )
30441 {
30442 closeCalloutMenuGUI();
30443 return;
30444 }
30445
30446 Input& input = Input::inputs[gui_player];
30447
30448 bool allowMenuCancel = true;
30449 if ( input.input("Call Out").input
30450 == input.input("MenuCancel").input )
30451 {
30452 allowMenuCancel = false;
30453 }
30454
30455 if ( selectMoveTo )
30456 {
30457 if ( input.binaryToggle("MenuCancel") )
30458 {
30459 input.consumeBinaryToggle("MenuCancel");
30460 if ( allowMenuCancel )
30461 {
30462 input.consumeBindingsSharedWithBinding("MenuCancel");
30463 closeCalloutMenuGUI();
30464 Player::soundCancel();
30465 }
30466 }
30467 if ( calloutFrame )
30468 {
30469 calloutFrame->setDisabled(true);
30470 }
30471 return;
30472 }
30473
30474 if ( !calloutFrame )
30475 {
30476 return;
30477 }
30478
30479 calloutFrame->setSize(SDL_Rect{ players[gui_player]->camera_virtualx1(),
30480 players[gui_player]->camera_virtualy1(),
30481 players[gui_player]->camera_virtualWidth(),
30482 players[gui_player]->camera_virtualHeight() });
30483
30484 int disableOption = 0;
30485 bool keepWheelOpen = false;
30486
30487 Sint32 omousex = inputs.getMouse(gui_player, Inputs::OX);
30488 Sint32 omousey = inputs.getMouse(gui_player, Inputs::OY);
30489
30490 std::map<int, Frame::image_t*> panelImages;
30491 std::map<int, Frame::image_t*> panelIcons;
30492 Frame* bannerFrame = nullptr;
30493 Field* bannerTxt = nullptr;
30494 Frame::image_t* bannerImgLeft = nullptr;

Callers 1

drawStatusNewFunction · 0.80

Calls 15

getFPSScaleFunction · 0.85
playSoundFunction · 0.85
itemTypeIsInstrumentFunction · 0.85
makeColorFunction · 0.85
isLocalPlayerMethod · 0.80
inputMethod · 0.80
camera_virtualx1Method · 0.80
camera_virtualy1Method · 0.80
camera_virtualWidthMethod · 0.80
camera_virtualHeightMethod · 0.80

Tested by

no test coverage detected