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

Method updateGUI

src/interface/interface.cpp:5850–6313  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5848
5849
5850void GenericGUIMenu::updateGUI()
5851{
5852 SDL_Rect pos;
5853 node_t* node;
5854 int y, c;
5855
5856 const Sint32 mousex = inputs.getMouse(gui_player, Inputs::X);
5857 const Sint32 mousey = inputs.getMouse(gui_player, Inputs::Y);
5858 const Sint32 omousex = inputs.getMouse(gui_player, Inputs::OX);
5859 const Sint32 omousey = inputs.getMouse(gui_player, Inputs::OY);
5860
5861 //Generic GUI.
5862 if ( guiActive )
5863 {
5864 auto& player = players[gui_player];
5865 if ( !player->isLocalPlayerAlive()
5866 || stats[gui_player]->HP <= 0
5867 || player->shootmode )
5868 {
5869 closeGUI();
5870 }
5871 if ( guiType == GUI_TYPE_ALCHEMY )
5872 {
5873 if ( (alembicEntityUid == 0 && !alembicItem) || (alembicEntityUid != 0 && !uidToEntity(alembicEntityUid)) )
5874 {
5875 closeGUI();
5876 return;
5877 }
5878
5879 if ( alembicItem )
5880 {
5881 if ( !alembicItem->node )
5882 {
5883 closeGUI();
5884 return;
5885 }
5886 if ( alembicItem->node->list != &stats[gui_player]->inventory )
5887 {
5888 // dropped out of inventory or something.
5889 closeGUI();
5890 return;
5891 }
5892 }
5893 }
5894 else if ( guiType == GUI_TYPE_MAILBOX )
5895 {
5896 if ( mailboxEntityUid == 0 || (mailboxEntityUid != 0 && !uidToEntity(mailboxEntityUid)) )
5897 {
5898 closeGUI();
5899 return;
5900 }
5901 }
5902 else if ( guiType == GUI_TYPE_TINKERING )
5903 {
5904 if ( (workstationEntityUid == 0 && !tinkeringKitItem) || (workstationEntityUid != 0 && !uidToEntity(workstationEntityUid)) )
5905 {
5906 closeGUI();
5907 return;

Callers 1

ingameHudFunction · 0.80

Calls 5

getMouseMethod · 0.80
isLocalPlayerAliveMethod · 0.80
uidToEntityFunction · 0.50
messagePlayerFunction · 0.50
endMethod · 0.45

Tested by

no test coverage detected