| 16804 | } |
| 16805 | |
| 16806 | void GenericGUIMenu::AlchemyGUI_t::closeAlchemyMenu() |
| 16807 | { |
| 16808 | const int playernum = parentGUI.getPlayer(); |
| 16809 | auto& player = *players[playernum]; |
| 16810 | |
| 16811 | if ( alchFrame ) |
| 16812 | { |
| 16813 | alchFrame->setDisabled(true); |
| 16814 | } |
| 16815 | animx = 0.0; |
| 16816 | animTooltip = 0.0; |
| 16817 | |
| 16818 | animPotion1 = 0.0; |
| 16819 | potion1Uid = 0; |
| 16820 | animPotion2 = 0.0; |
| 16821 | potion2Uid = 0; |
| 16822 | alchemyResultPotion.type = POTION_EMPTY; |
| 16823 | potionResultUid = 0; |
| 16824 | animPotionResult = 0.0; |
| 16825 | animRecipeAutoAddToSlot1Uid = 0; |
| 16826 | animRecipeAutoAddToSlot2Uid = 0; |
| 16827 | |
| 16828 | isInteractable = false; |
| 16829 | bool wasOpen = bOpen; |
| 16830 | bOpen = false; |
| 16831 | bFirstTimeSnapCursor = false; |
| 16832 | if ( wasOpen ) |
| 16833 | { |
| 16834 | if ( inputs.getUIInteraction(playernum)->selectedItem ) |
| 16835 | { |
| 16836 | inputs.getUIInteraction(playernum)->selectedItem = nullptr; |
| 16837 | inputs.getUIInteraction(playernum)->toggleclick = false; |
| 16838 | } |
| 16839 | inputs.getUIInteraction(playernum)->selectedItemFromChest = 0; |
| 16840 | } |
| 16841 | if ( players[playernum]->GUI.activeModule == Player::GUI_t::MODULE_ALCHEMY |
| 16842 | && !players[playernum]->shootmode ) |
| 16843 | { |
| 16844 | // reset to inventory mode if still hanging in alchemy GUI |
| 16845 | players[playernum]->hud.compactLayoutMode = Player::HUD_t::COMPACT_LAYOUT_INVENTORY; |
| 16846 | players[playernum]->GUI.activateModule(Player::GUI_t::MODULE_INVENTORY); |
| 16847 | if ( !inputs.getVirtualMouse(playernum)->draw_cursor ) |
| 16848 | { |
| 16849 | players[playernum]->GUI.warpControllerToModule(false); |
| 16850 | } |
| 16851 | } |
| 16852 | clearItemDisplayed(); |
| 16853 | itemRequiresTitleReflow = true; |
| 16854 | if ( alchFrame ) |
| 16855 | { |
| 16856 | for ( auto f : alchFrame->getFrames() ) |
| 16857 | { |
| 16858 | f->removeSelf(); |
| 16859 | } |
| 16860 | alchemySlotFrames.clear(); |
| 16861 | } |
| 16862 | recipes.closeRecipePanel(); |
| 16863 | recipesFrame = nullptr; |
no test coverage detected