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

Method updateTooltip

src/mod_tools.cpp:13366–13412  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13364}
13365
13366void Compendium_t::updateTooltip()
13367{
13368 bool update = tooltipNeedUpdate;
13369 tooltipNeedUpdate = false;
13370
13371 if ( MainMenu::main_menu_frame )
13372 {
13373 auto compendiumFrame = MainMenu::main_menu_frame->findFrame("compendium");
13374 if ( !compendiumFrame ) { return; }
13375
13376 players[MainMenu::getMenuOwner()]->inventoryUI.updateInventoryItemTooltip(compendiumFrame);
13377
13378 if ( update )
13379 {
13380 players[MainMenu::getMenuOwner()]->hud.updateFrameTooltip(&compendiumItem, tooltipPos.x, tooltipPos.y, Player::PANEL_JUSTIFY_RIGHT, compendiumFrame);
13381 }
13382
13383 if ( Frame* tooltipContainerFrame = compendiumFrame->findFrame("player tooltip container 0") )
13384 {
13385 if ( auto prompt = tooltipContainerFrame->findFrame("item_widget") )
13386 {
13387 if ( auto tooltip = tooltipContainerFrame->findFrame("player tooltip 0") )
13388 {
13389 if ( tooltip->getSize().w == 0 )
13390 {
13391 prompt->setOpacity(0.0);
13392 }
13393 else
13394 {
13395 prompt->setOpacity(tooltip->getOpacity());
13396 }
13397 if ( Compendium_t::compendiumItem.type == SPELL_ITEM )
13398 {
13399 prompt->setOpacity(0.0);
13400 }
13401 SDL_Rect framePos = prompt->getSize();
13402 framePos.x = tooltip->getSize().x + tooltip->getSize().w - 6 - framePos.w;
13403 framePos.y = tooltip->getSize().y + tooltip->getSize().h - 10;
13404 //framePos.x = 802 + 378 / 2 - framePos.w / 2;
13405 //framePos.y = 110 - framePos.h + 14;
13406 prompt->setSize(framePos);
13407 }
13408 }
13409 }
13410
13411 }
13412}
13413
13414void Compendium_t::readItemsTranslationsFromFile(bool forceLoadBaseDirectory)
13415{

Callers

nothing calls this directly

Calls 6

findFrameMethod · 0.80
updateFrameTooltipMethod · 0.80
getSizeMethod · 0.80
setOpacityMethod · 0.80
getOpacityMethod · 0.80
setSizeMethod · 0.45

Tested by

no test coverage detected