| 13895 | } |
| 13896 | |
| 13897 | void GenericGUIMenu::TinkerGUI_t::closeTinkerMenu() |
| 13898 | { |
| 13899 | const int playernum = parentGUI.getPlayer(); |
| 13900 | auto& player = *players[playernum]; |
| 13901 | |
| 13902 | if ( tinkerFrame ) |
| 13903 | { |
| 13904 | tinkerFrame->setDisabled(true); |
| 13905 | } |
| 13906 | animx = 0.0; |
| 13907 | animTooltip = 0.0; |
| 13908 | animPrompt = 0.0; |
| 13909 | animFilter = 0.0; |
| 13910 | animInvalidAction = 0.0; |
| 13911 | animInvalidActionTicks = 0; |
| 13912 | invalidActionType = INVALID_ACTION_NONE; |
| 13913 | isInteractable = false; |
| 13914 | bool wasOpen = bOpen; |
| 13915 | bOpen = false; |
| 13916 | bFirstTimeSnapCursor = false; |
| 13917 | if ( wasOpen ) |
| 13918 | { |
| 13919 | if ( inputs.getUIInteraction(playernum)->selectedItem ) |
| 13920 | { |
| 13921 | inputs.getUIInteraction(playernum)->selectedItem = nullptr; |
| 13922 | inputs.getUIInteraction(playernum)->toggleclick = false; |
| 13923 | } |
| 13924 | inputs.getUIInteraction(playernum)->selectedItemFromChest = 0; |
| 13925 | } |
| 13926 | if ( players[playernum]->GUI.activeModule == Player::GUI_t::MODULE_TINKERING |
| 13927 | && !players[playernum]->shootmode ) |
| 13928 | { |
| 13929 | // reset to inventory mode if still hanging in tinker GUI |
| 13930 | players[playernum]->hud.compactLayoutMode = Player::HUD_t::COMPACT_LAYOUT_INVENTORY; |
| 13931 | players[playernum]->GUI.activateModule(Player::GUI_t::MODULE_INVENTORY); |
| 13932 | if ( !inputs.getVirtualMouse(playernum)->draw_cursor ) |
| 13933 | { |
| 13934 | players[playernum]->GUI.warpControllerToModule(false); |
| 13935 | } |
| 13936 | } |
| 13937 | clearItemDisplayed(); |
| 13938 | itemRequiresTitleReflow = true; |
| 13939 | if ( tinkerFrame ) |
| 13940 | { |
| 13941 | for ( auto f : tinkerFrame->getFrames() ) |
| 13942 | { |
| 13943 | f->removeSelf(); |
| 13944 | } |
| 13945 | tinkerSlotFrames.clear(); |
| 13946 | } |
| 13947 | |
| 13948 | if ( multiplayer != CLIENT ) |
| 13949 | { |
| 13950 | if ( Entity* workstation = uidToEntity(parentGUI.workstationEntityUid) ) |
| 13951 | { |
| 13952 | workstation->skill[6] = 0; |
| 13953 | serverUpdateEntitySkill(workstation, 6); |
| 13954 | } |
no test coverage detected