| 19790 | } |
| 19791 | |
| 19792 | void GenericGUIMenu::AlchemyGUI_t::setItemDisplayNameAndPriceBrew(Item* item, const bool isTooltipForResultPotion, const bool isTooltipForRecipe) |
| 19793 | { |
| 19794 | itemTooltipForRecipe = isTooltipForRecipe; |
| 19795 | |
| 19796 | char buf[1024]; |
| 19797 | if ( !item->identified ) |
| 19798 | { |
| 19799 | if ( isTooltipForResultPotion ) |
| 19800 | { |
| 19801 | snprintf(buf, sizeof(buf), "%s (?)", Language::get(4161)); |
| 19802 | } |
| 19803 | else |
| 19804 | { |
| 19805 | snprintf(buf, sizeof(buf), "%s %s (?)", ItemTooltips.getItemStatusAdjective(item->type, item->status).c_str(), item->getName()); |
| 19806 | } |
| 19807 | } |
| 19808 | else if ( item->type == TOOL_BOMB && isTooltipForResultPotion ) |
| 19809 | { |
| 19810 | snprintf(buf, sizeof(buf), "%s", Language::get(4167)); |
| 19811 | } |
| 19812 | else |
| 19813 | { |
| 19814 | snprintf(buf, sizeof(buf), "%s %s (%+d)", ItemTooltips.getItemStatusAdjective(item->type, item->status).c_str(), item->getName(), item->beatitude); |
| 19815 | } |
| 19816 | |
| 19817 | auto activateSelectionPrompt = alchFrame->findField("activate prompt"); |
| 19818 | activateSelectionPrompt->setText(""); |
| 19819 | |
| 19820 | int player = parentGUI.getPlayer(); |
| 19821 | bool isSameResult = false; |
| 19822 | bool isDuplicationResult = false; |
| 19823 | if ( itemCategory(item) == POTION && item->type != POTION_EMPTY ) |
| 19824 | { |
| 19825 | bool isEquipped = itemIsEquipped(item, player); |
| 19826 | if ( (!item->identified || isEquipped) && !isTooltipForResultPotion && !isTooltipForRecipe ) |
| 19827 | { |
| 19828 | itemActionType = ALCHEMY_ACTION_UNIDENTIFIED_POTION; |
| 19829 | } |
| 19830 | else |
| 19831 | { |
| 19832 | itemActionType = ALCHEMY_ACTION_OK; |
| 19833 | } |
| 19834 | auto find = clientLearnedAlchemyIngredients[player].find(item->type); |
| 19835 | Item* basePotion = nullptr; |
| 19836 | Item* secondaryPotion = nullptr; |
| 19837 | bool isRandomResult = false; |
| 19838 | bool recipeMissingMaterials = false; |
| 19839 | if ( isTooltipForRecipe ) |
| 19840 | { |
| 19841 | recipeMissingMaterials = true; |
| 19842 | itemActionType = ALCHEMY_ACTION_UNIDENTIFIED_POTION; |
| 19843 | for ( auto& entry : recipes.recipeList ) |
| 19844 | { |
| 19845 | if ( &entry.resultItem == item ) |
| 19846 | { |
| 19847 | if ( entry.basePotionUid != 0 && entry.secondaryPotionUid != 0 ) |
| 19848 | { |
| 19849 | recipeMissingMaterials = false; |
nothing calls this directly
no test coverage detected