| 7265 | } |
| 7266 | |
| 7267 | void Player::HUD_t::finalizeFrameTooltip(Item* item, const int x, const int y, int justify, Frame* parentFrame) |
| 7268 | { |
| 7269 | const int player = this->player.playernum; |
| 7270 | |
| 7271 | Frame* tooltipContainerFrame = nullptr; |
| 7272 | Frame* frameMain = nullptr; |
| 7273 | Frame* frameInventory = nullptr; |
| 7274 | Frame* frameInteract = nullptr; |
| 7275 | Frame* frameTooltipPrompt = nullptr; |
| 7276 | Frame* titleOnlyFrame = nullptr; |
| 7277 | bool compendiumTooltip = false; |
| 7278 | if ( parentFrame != nullptr ) |
| 7279 | { |
| 7280 | // hacks for compendium tooltips |
| 7281 | char name[32]; |
| 7282 | snprintf(name, sizeof(name), "player tooltip container %d", 0); |
| 7283 | tooltipContainerFrame = parentFrame->findFrame(name); |
| 7284 | snprintf(name, sizeof(name), "player title only tooltip %d", 0); |
| 7285 | titleOnlyFrame = tooltipContainerFrame->findFrame(name); |
| 7286 | snprintf(name, sizeof(name), "player tooltip %d", 0); |
| 7287 | frameMain = tooltipContainerFrame->findFrame(name); |
| 7288 | snprintf(name, sizeof(name), "player interact %d", 0); |
| 7289 | frameInteract = parentFrame->findFrame(name); |
| 7290 | snprintf(name, sizeof(name), "player item prompt %d", 0); |
| 7291 | frameTooltipPrompt = tooltipContainerFrame->findFrame(name); |
| 7292 | |
| 7293 | if ( !strcmp(parentFrame->getName(), "compendium") ) |
| 7294 | { |
| 7295 | compendiumTooltip = true; |
| 7296 | } |
| 7297 | } |
| 7298 | else |
| 7299 | { |
| 7300 | tooltipContainerFrame = this->player.inventoryUI.tooltipContainerFrame; |
| 7301 | frameMain = this->player.inventoryUI.tooltipFrame; |
| 7302 | frameInventory = this->player.inventoryUI.frame; |
| 7303 | frameInteract = this->player.inventoryUI.interactFrame; |
| 7304 | frameTooltipPrompt = this->player.inventoryUI.tooltipPromptFrame; |
| 7305 | titleOnlyFrame = this->player.inventoryUI.titleOnlyTooltipFrame; |
| 7306 | if ( !frameInventory ) |
| 7307 | { |
| 7308 | return; |
| 7309 | } |
| 7310 | } |
| 7311 | |
| 7312 | auto& tooltipDisplayedSettings = compendiumTooltip ? this->player.inventoryUI.compendiumItemTooltipDisplay |
| 7313 | : this->player.inventoryUI.itemTooltipDisplay; |
| 7314 | |
| 7315 | const bool doTitleOnlyTooltip = players[player]->shootmode && !compendiumTooltip && !(enableDebugKeys && keystatus[SDLK_g]); |
| 7316 | if ( !doTitleOnlyTooltip ) |
| 7317 | { |
| 7318 | tooltipDisplayedSettings.opacitySetpoint = 0; |
| 7319 | tooltipDisplayedSettings.opacityAnimate = 1.0; |
| 7320 | frameMain->setDisabled(false); |
| 7321 | frameMain->setOpacity(100.0); |
| 7322 | } |
| 7323 | else |
| 7324 | { |
nothing calls this directly
no test coverage detected