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

Method closeMailMenu

src/interface/interface.cpp:38865–38939  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38863}
38864
38865void GenericGUIMenu::MailboxGui_t::closeMailMenu()
38866{
38867 const int playernum = parentGUI.getPlayer();
38868 auto& player = *players[playernum];
38869
38870 if ( mailFrame )
38871 {
38872 mailFrame->setDisabled(true);
38873 }
38874 animx = 0.0;
38875 animTooltip = 0.0;
38876
38877 animSendItem1 = 0.0;
38878 sendItem1Uid = 0;
38879 mailReceiveItem.type = POTION_EMPTY;
38880 recvItemUid = 0;
38881 animRecvItem = 0.0;
38882
38883 isInteractable = false;
38884 bool wasOpen = bOpen;
38885 bOpen = false;
38886 bFirstTimeSnapCursor = false;
38887 if ( wasOpen )
38888 {
38889 if ( inputs.getUIInteraction(playernum)->selectedItem )
38890 {
38891 inputs.getUIInteraction(playernum)->selectedItem = nullptr;
38892 inputs.getUIInteraction(playernum)->toggleclick = false;
38893 }
38894 inputs.getUIInteraction(playernum)->selectedItemFromChest = 0;
38895 }
38896 if ( players[playernum]->GUI.activeModule == Player::GUI_t::MODULE_MAILBOX
38897 && !players[playernum]->shootmode )
38898 {
38899 // reset to inventory mode if still hanging in alchemy GUI
38900 players[playernum]->hud.compactLayoutMode = Player::HUD_t::COMPACT_LAYOUT_INVENTORY;
38901 players[playernum]->GUI.activateModule(Player::GUI_t::MODULE_INVENTORY);
38902 if ( !inputs.getVirtualMouse(playernum)->draw_cursor )
38903 {
38904 players[playernum]->GUI.warpControllerToModule(false);
38905 }
38906 }
38907 clearItemDisplayed();
38908 itemRequiresTitleReflow = true;
38909 if ( mailFrame )
38910 {
38911 for ( auto f : mailFrame->getFrames() )
38912 {
38913 f->removeSelf();
38914 }
38915 mailSlotFrames.clear();
38916 }
38917 //notifications.clear();
38918
38919 if ( multiplayer != CLIENT )
38920 {
38921 if ( Entity* mailbox = uidToEntity(parentGUI.mailboxEntityUid) )
38922 {

Callers 3

actMailboxFunction · 0.80
net.cppFile · 0.80
closeGUIMethod · 0.80

Calls 11

serverUpdateEntitySkillFunction · 0.85
sendPacketSafeFunction · 0.85
getUIInteractionMethod · 0.80
activateModuleMethod · 0.80
getVirtualMouseMethod · 0.80
removeSelfMethod · 0.80
uidToEntityFunction · 0.50
getPlayerMethod · 0.45
setDisabledMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected