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

Method updateFeatherMenu

src/interface/interface.cpp:21683–23211  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21681}
21682
21683void GenericGUIMenu::FeatherGUI_t::updateFeatherMenu()
21684{
21685 const int playernum = parentGUI.getPlayer();
21686 auto player = players[playernum];
21687
21688 if ( !player->isLocalPlayer() )
21689 {
21690 closeFeatherMenu();
21691 return;
21692 }
21693
21694 if ( !featherFrame )
21695 {
21696 return;
21697 }
21698
21699 featherFrame->setSize(SDL_Rect{ players[playernum]->camera_virtualx1(),
21700 players[playernum]->camera_virtualy1(),
21701 featherBaseWidth,
21702 players[playernum]->camera_virtualHeight() });
21703
21704 bool bFeatherDrawerOpen = isInscriptionDrawerOpen();
21705 if ( !bFeatherDrawerOpen )
21706 {
21707 drawerJustifyInverted = false;
21708 }
21709
21710 if ( !featherFrame->isDisabled() && bOpen )
21711 {
21712 if ( !featherGUIHasBeenCreated() )
21713 {
21714 createFeatherMenu();
21715 }
21716
21717 const real_t fpsScale = getFPSScale(50.0); // ported from 50Hz
21718 real_t setpointDiffX = fpsScale * std::max(.01, (1.0 - animx)) / 2.0;
21719 animx += setpointDiffX;
21720 animx = std::min(1.0, animx);
21721 bool mainPanelReady = false;
21722 if ( animx >= .9999 )
21723 {
21724 if ( !bFeatherDrawerOpen )
21725 {
21726 isInteractable = true;
21727 bFirstTimeSnapCursor = false;
21728 }
21729 mainPanelReady = true;
21730 }
21731
21732 if ( bFeatherDrawerOpen && mainPanelReady )
21733 {
21734 real_t setpointDiffX = fpsScale * std::max(.01, (1.0 - animDrawer)) / 3.0;
21735 animDrawer += setpointDiffX;
21736 animDrawer = std::min(1.0, animDrawer);
21737 if ( animDrawer >= .9999 )
21738 {
21739 if ( !bFirstTimeSnapCursor )
21740 {

Callers 1

ingameHudFunction · 0.80

Calls 15

getFPSScaleFunction · 0.85
skillCapstoneUnlockedFunction · 0.85
makeColorFunction · 0.85
getColorFunction · 0.85
onFeatherChangeTabActionFunction · 0.85
playSoundFunction · 0.85
featherChangeChargeEventFunction · 0.85
isLocalPlayerMethod · 0.80
camera_virtualx1Method · 0.80
camera_virtualy1Method · 0.80

Tested by

no test coverage detected