| 5848 | |
| 5849 | |
| 5850 | void 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; |
no test coverage detected