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

Method openStatusScreen

src/interface/interface.cpp:1360–1461  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1358}
1359
1360void 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();

Callers 10

actChestMethod · 0.80
startTradingServerFunction · 0.80
ingameHudFunction · 0.80
net.cppFile · 0.80
openGUIMethod · 0.80
openBookMethod · 0.80
openSignMethod · 0.80

Calls 15

bPlayerIsControllableMethod · 0.80
closeFollowerMenuGUIMethod · 0.80
closeCalloutMenuGUIMethod · 0.80
closeGUIMethod · 0.80
removeSelfMethod · 0.80
findFrameMethod · 0.80
getSizeMethod · 0.80
activateModuleMethod · 0.80
getUIInteractionMethod · 0.80
hasControllerMethod · 0.80
getSelectedSlotXMethod · 0.80
getSelectedSlotYMethod · 0.80

Tested by

no test coverage detected