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

Method updateAlchemyMenu

src/interface/interface.cpp:16972–19124  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16970void buildRecipeList(const int player);
16971
16972void 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 )

Callers 1

ingameHudFunction · 0.80

Calls 15

entityDistFunction · 0.85
getFPSScaleFunction · 0.85
uidToItemFunction · 0.85
itemIsEquippedFunction · 0.85
getItemSpritePathFunction · 0.85
makeColorFunction · 0.85
alchemyCookResultFunction · 0.85
alchemyMixResultFunction · 0.85
playerKnowsRecipeFunction · 0.85
skillCapstoneUnlockedFunction · 0.85

Tested by

no test coverage detected