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

Method closeFeatherMenu

src/interface/interface.cpp:21539–21602  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21537}
21538
21539void GenericGUIMenu::FeatherGUI_t::closeFeatherMenu()
21540{
21541 const int playernum = parentGUI.getPlayer();
21542 auto& player = *players[playernum];
21543
21544 if ( featherFrame )
21545 {
21546 featherFrame->setDisabled(true);
21547 }
21548 animx = 0.0;
21549 animTooltip = 0.0;
21550 animPrompt = 0.0;
21551 animFilter = 0.0;
21552 animInvalidAction = 0.0;
21553 animInvalidActionTicks = 0;
21554 animCharge = 0.0;
21555 animChargeStartTicks = 0;
21556 animQtyChange = 0.0;
21557 animPromptTicks = 0;
21558 animDrawer = 0.0;
21559 invalidActionType = INVALID_ACTION_NONE;
21560 isInteractable = false;
21561 bool wasOpen = bOpen;
21562 bOpen = false;
21563 bFirstTimeSnapCursor = false;
21564 highlightedSlot = -1;
21565 bDrawerOpen = false;
21566 labelDiscoveries.clear();
21567 inscribeSuccessTicks = 0;
21568 inscribeSuccessName = "";
21569 if ( wasOpen )
21570 {
21571 if ( inputs.getUIInteraction(playernum)->selectedItem )
21572 {
21573 inputs.getUIInteraction(playernum)->selectedItem = nullptr;
21574 inputs.getUIInteraction(playernum)->toggleclick = false;
21575 }
21576 inputs.getUIInteraction(playernum)->selectedItemFromChest = 0;
21577 }
21578 if ( players[playernum]->GUI.activeModule == Player::GUI_t::MODULE_FEATHER
21579 && !players[playernum]->shootmode )
21580 {
21581 // reset to inventory mode if still hanging in alchemy GUI
21582 players[playernum]->hud.compactLayoutMode = Player::HUD_t::COMPACT_LAYOUT_INVENTORY;
21583 players[playernum]->GUI.activateModule(Player::GUI_t::MODULE_INVENTORY);
21584 if ( !inputs.getVirtualMouse(playernum)->draw_cursor )
21585 {
21586 players[playernum]->GUI.warpControllerToModule(false);
21587 }
21588 }
21589 clearItemDisplayed();
21590 itemRequiresTitleReflow = true;
21591 if ( featherFrame )
21592 {
21593 for ( auto f : featherFrame->getFrames() )
21594 {
21595 f->removeSelf();
21596 }

Callers 1

closeGUIMethod · 0.80

Calls 8

getUIInteractionMethod · 0.80
activateModuleMethod · 0.80
getVirtualMouseMethod · 0.80
removeSelfMethod · 0.80
getPlayerMethod · 0.45
setDisabledMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected