| 1358 | } |
| 1359 | |
| 1360 | void Player::openStatusScreen(const int whichGUIMode, const int whichInventoryMode, const int whichModule) |
| 1361 | { |
| 1362 | if ( !inputs.bPlayerIsControllable(playernum) ) |
| 1363 | { |
| 1364 | return; |
| 1365 | } |
| 1366 | |
| 1367 | bool oldShootmode = shootmode; |
| 1368 | shootmode = false; |
| 1369 | |
| 1370 | if ( whichGUIMode != GUI_MODE_NONE && whichGUIMode != GUI_MODE_FOLLOWERMENU ) |
| 1371 | { |
| 1372 | FollowerMenu[playernum].closeFollowerMenuGUI(); |
| 1373 | } |
| 1374 | if ( whichGUIMode != GUI_MODE_NONE && whichGUIMode != GUI_MODE_CALLOUT ) |
| 1375 | { |
| 1376 | CalloutMenu[playernum].closeCalloutMenuGUI(); |
| 1377 | } |
| 1378 | GenericGUI[playernum].closeGUI(); |
| 1379 | if ( minimap.mapWindow ) |
| 1380 | { |
| 1381 | minimap.mapWindow->removeSelf(); |
| 1382 | minimap.mapWindow = nullptr; |
| 1383 | } |
| 1384 | if ( messageZone.logWindow ) |
| 1385 | { |
| 1386 | messageZone.logWindow->removeSelf(); |
| 1387 | messageZone.logWindow = nullptr; |
| 1388 | } |
| 1389 | |
| 1390 | int oldgui = gui_mode; |
| 1391 | gui_mode = whichGUIMode; |
| 1392 | if ( oldgui == GUI_MODE_NONE && whichGUIMode == GUI_MODE_INVENTORY ) |
| 1393 | { |
| 1394 | this->hud.compactLayoutMode = HUD_t::COMPACT_LAYOUT_INVENTORY; |
| 1395 | } |
| 1396 | |
| 1397 | if ( oldShootmode ) |
| 1398 | { |
| 1399 | if ( hud.cursorFrame ) |
| 1400 | { |
| 1401 | // center the hud cursor - there is a first time warping of the inventory cursor but we can leave that in |
| 1402 | auto hudCursor = hud.cursorFrame->findFrame("hud cursor"); |
| 1403 | hud.updateCursorAnimation((camera_virtualWidth() / 2), (camera_virtualHeight() / 2), |
| 1404 | hudCursor->getSize().w, hudCursor->getSize().h, true); |
| 1405 | |
| 1406 | // uncomment to always warp the inventory cursor from center of screen |
| 1407 | //SDL_Rect size = hudCursor->getSize(); |
| 1408 | //inventoryUI.updateSelectedSlotAnimation(size.x, size.y, size.w, size.h, true); |
| 1409 | } |
| 1410 | } |
| 1411 | |
| 1412 | int oldmodule = GUI.activeModule; |
| 1413 | GUI.activateModule((GUI_t::GUIModules)whichModule); |
| 1414 | inputs.getUIInteraction(playernum)->selectedItem = nullptr; |
| 1415 | inputs.getUIInteraction(playernum)->selectedItemFromChest = 0; |
| 1416 | inputs.getUIInteraction(playernum)->toggleclick = false; |
| 1417 | GUI.closeDropdowns(); |
no test coverage detected