| 16970 | void buildRecipeList(const int player); |
| 16971 | |
| 16972 | void GenericGUIMenu::AlchemyGUI_t::updateAlchemyMenu() |
| 16973 | { |
| 16974 | const int playernum = parentGUI.getPlayer(); |
| 16975 | auto player = players[playernum]; |
| 16976 | |
| 16977 | if ( !player->isLocalPlayer() ) |
| 16978 | { |
| 16979 | closeAlchemyMenu(); |
| 16980 | return; |
| 16981 | } |
| 16982 | |
| 16983 | Entity* alembicStation = nullptr; |
| 16984 | if ( bOpen ) |
| 16985 | { |
| 16986 | if ( parentGUI.alembicEntityUid != 0 ) |
| 16987 | { |
| 16988 | alembicStation = uidToEntity(parentGUI.alembicEntityUid); |
| 16989 | if ( !alembicStation ) |
| 16990 | { |
| 16991 | parentGUI.closeGUI(); |
| 16992 | return; |
| 16993 | } |
| 16994 | } |
| 16995 | |
| 16996 | if ( alembicStation ) |
| 16997 | { |
| 16998 | if (player->entity && (entityDist(player->entity, alembicStation) > TOUCHRANGE)) |
| 16999 | { |
| 17000 | parentGUI.closeGUI(); |
| 17001 | return; |
| 17002 | } |
| 17003 | } |
| 17004 | } |
| 17005 | |
| 17006 | if ( !alchFrame ) |
| 17007 | { |
| 17008 | return; |
| 17009 | } |
| 17010 | |
| 17011 | alchFrame->setSize(SDL_Rect{ players[playernum]->camera_virtualx1(), |
| 17012 | players[playernum]->camera_virtualy1(), |
| 17013 | alchemyBaseWidth, |
| 17014 | players[playernum]->camera_virtualHeight() }); |
| 17015 | |
| 17016 | if ( !alchFrame->isDisabled() && bOpen ) |
| 17017 | { |
| 17018 | if ( !alchemyGUIHasBeenCreated() ) |
| 17019 | { |
| 17020 | createAlchemyMenu(); |
| 17021 | } |
| 17022 | |
| 17023 | const real_t fpsScale = getFPSScale(50.0); // ported from 50Hz |
| 17024 | real_t setpointDiffX = fpsScale * std::max(.01, (1.0 - animx)) / 2.0; |
| 17025 | animx += setpointDiffX; |
| 17026 | animx = std::min(1.0, animx); |
| 17027 | if ( animx >= .9999 ) |
| 17028 | { |
| 17029 | if ( !bFirstTimeSnapCursor ) |
no test coverage detected