1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 |
do
local DEPRECATED_ARG = nil
function ZO_Tooltip : LayoutCollectibleFromData ( collectibleData , showVisualLayerInfo , cooldownSecondsRemaining , showBlockReason , actorCategory )
if collectibleData then
local params =
{
showNickname = true ,
showIfPurchasable = true ,
showHint = true ,
showVisualLayerInfo = showVisualLayerInfo ,
cooldownSecondsRemaining = cooldownSecondsRemaining ,
showBlockReason = showBlockReason ,
actorCategory = actorCategory ,
}
end
end
end
do
local HIDE_VISUAL_LAYER_INFO = false
local NO_COOLDOWN = nil
local HIDE_BLOCK_REASON = false
if collectibleId then
self : LayoutCollectibleFromData ( collectibleData , HIDE_VISUAL_LAYER_INFO , NO_COOLDOWN , HIDE_BLOCK_REASON )
end
end
end
do
-- Required Params: collectibleId
-- Optional Params: showNickname, showIfPurchasable, showHint, showVisualLayerInfo, cooldownSecondsRemaining, showBlockReason, actorCategory
local collectibleId = params . collectibleId
local actorCategory = params . actorCategory or GAMEPLAY_ACTOR_CATEGORY_PLAYER
--things added to the collection top section stack downward
if specializedCollectibleType == SPECIALIZED_COLLECTIBLE_TYPE_NONE then
else
end
if params . showVisualLayerInfo then
local isOutfitStylePresentInEffectivelyEquippedOutfit = categoryType == COLLECTIBLE_CATEGORY_TYPE_OUTFIT_STYLE and IsCollectiblePresentInEffectivelyEquippedOutfit ( GAMEPLAY_ACTOR_CATEGORY_PLAYER , collectibleId )
if isActive or isOutfitStylePresentInEffectivelyEquippedOutfit then
local visualLayerHidden , highestPriorityVisualLayerThatIsShowing = WouldCollectibleBeHidden ( collectibleId , actorCategory )
if visualLayerHidden then
topSection : AddLine ( ZO_SELECTED_TEXT : Colorize ( GetHiddenByStringForVisualLayer ( highestPriorityVisualLayerThatIsShowing ) ) )
end
end
end
local formattedName = ZO_CachedStrFormat ( SI_COLLECTIBLE_NAME_FORMATTER , GetCollectibleName ( collectibleId ) )
if params . showNickname then
if collectibleNickname ~= "" then
end
end
if params . cooldownSecondsRemaining and params . cooldownSecondsRemaining > 0 then
local secondsRemainingString = ZO_FormatTimeLargestTwo ( params . cooldownSecondsRemaining , TIME_FORMAT_STYLE_DESCRIPTIVE_MINIMAL )
end
end
if categoryType == COLLECTIBLE_CATEGORY_TYPE_COMBINATION_FRAGMENT then
if combinationDescription ~= "" then
bodySection : AddLine ( zo_strformat ( SI_ITEM_FORMAT_STR_COMBINATION , combinationDescription ) , descriptionStyle )
end
end
end
if params . showHint then
if categoryType == COLLECTIBLE_CATEGORY_TYPE_HOUSE and hint == "" then
end
if hint ~= "" then
end
end
if categoryType == COLLECTIBLE_CATEGORY_TYPE_PERSONALITY then
if # emoteOverrideNames > 0 then
local numEmoteNames = # emoteOverrideNames
local formattedEmoteString = zo_strformat ( SI_COLLECTIBLE_TOOLTIP_PERSONALITY_OVERRIDES_DISPLAY_NAMES_FORMATTER , emoteString , numEmoteNames )
bodySection : AddLine ( formattedEmoteString , descriptionStyle , self : GetStyle ( "collectionsPersonality" ) )
end
elseif categoryType == COLLECTIBLE_CATEGORY_TYPE_EMOTE then
if emoteIndex then
bodySection : AddLine ( zo_strformat ( SI_COLLECTIBLE_TOOLTIP_EMOTE_DISPLAY_NAME_FORMATTER , displayName ) , descriptionStyle , self : GetStyle ( "collectionsEmoteGranted" ) )
end
elseif categoryType == COLLECTIBLE_CATEGORY_TYPE_OUTFIT_STYLE then
if numMaterials > 1 then
local materialsNames = { }
for i = 1 , numMaterials do
end
end
if isFree then
applyCost = 0
end
local applyCostString = ZO_Currency_FormatGamepad ( CURT_MONEY , applyCost , ZO_CURRENCY_FORMAT_AMOUNT_ICON )
statValuePair : SetStat ( GetString ( SI_TOOLTIP_COLLECTIBLE_OUTFIT_STYLE_APPLICATION_COST_GAMEPAD ) , self : GetStyle ( "statValuePairStat" ) )
statValuePair : SetValue ( applyCostString , descriptionStyle , self : GetStyle ( "currencyStatValuePairValue" ) )
elseif categoryType == COLLECTIBLE_CATEGORY_TYPE_POLYMORPH then
if isActive and params . showVisualLayerInfo then
bodySection : AddLine ( GetString ( SI_POLYMORPH_CAN_HIDE_WARNING ) , descriptionStyle , self : GetStyle ( "collectionsPolymorphOverrideWarningStyle" ) )
end
elseif categoryType == COLLECTIBLE_CATEGORY_TYPE_COMBINATION_FRAGMENT then
if baseCollectibleId ~= 0 then
if baseCollectibleName ~= "" then
local text = zo_strformat ( SI_COLLECTIBLE_REQUIRED_TO_USE_ITEM , baseCollectibleName , GetCollectibleCategoryNameByCollectibleId ( baseCollectibleId ) )
local colorStyle = IsCollectibleUnlocked ( baseCollectibleId ) and self : GetStyle ( "succeeded" ) or self : GetStyle ( "failed" )
end
end
end
-- Layout the use restrictions
local failsRestriction = false
for restrictionType = COLLECTIBLE_RESTRICTION_TYPE_ITERATION_BEGIN , COLLECTIBLE_RESTRICTION_TYPE_ITERATION_END do
local hasRestrictions , passesRestrictions , allowedNamesString = GetCollectibleRestrictionsByType ( collectibleId , restrictionType )
if hasRestrictions then
local statValuePair = restrictionsSection : AcquireStatValuePair ( self : GetStyle ( "statValuePair" ) , self : GetStyle ( "fullWidth" ) )
statValuePair : SetStat ( GetString ( "SI_COLLECTIBLERESTRICTIONTYPE" , restrictionType ) , self : GetStyle ( "statValuePairStat" ) )
if passesRestrictions then
else
statValuePair : SetValue ( allowedNamesString , self : GetStyle ( "failed" ) , self : GetStyle ( "statValuePairValue" ) )
failsRestriction = true
end
end
end
end
furnishingLimitTypeSection : AddLine ( GetString ( SI_TOOLTIP_FURNISHING_LIMIT_TYPE ) , self : GetStyle ( "furnishingLimitTypeTitle" ) )
furnishingLimitTypeSection : AddLine ( furnishingLimitName , self : GetStyle ( "furnishingLimitTypeDescription" ) )
end
if categoryType == COLLECTIBLE_CATEGORY_TYPE_COMPANION then
if questState == COLLECTIBLE_ASSOCIATED_QUEST_STATE_INACTIVE or questState == COLLECTIBLE_ASSOCIATED_QUEST_STATE_ACCEPTED then
--If we get here, we are going to be showing a specialized error message
--This means we don't want to show the fails restriction or block reason in the tooltip
failsRestriction = false
params . showBlockReason = false
local formattedBlockReason = zo_strformat ( SI_COLLECTIBLE_TOOLTIP_COMPANION_BLOCKED_BY_QUEST_AND_DLC , GetQuestName ( introQuestId ) , GetZoneNameById ( zoneId ) , GetString ( "SI_COLLECTIBLECATEGORYTYPE" , GetCollectibleCategoryType ( zoneCollectibleId ) ) )
else
local formattedBlockReason = zo_strformat ( SI_COLLECTIBLE_TOOLTIP_COMPANION_BLOCKED_BY_QUEST , GetQuestName ( introQuestId ) )
end
end
end
if failsRestriction then
bodySection : AddLine ( GetString ( SI_COLLECTIBLE_TOOLTIP_NOT_USABLE_BY_CHARACTER ) , descriptionStyle , self : GetStyle ( "failed" ) )
elseif params . showBlockReason then
if usageBlockReason ~= COLLECTIBLE_USAGE_BLOCK_REASON_NOT_BLOCKED then
local formattedBlockReason = ZO_CachedStrFormat ( ZO_CACHED_STR_FORMAT_NO_FORMATTER , GetString ( "SI_COLLECTIBLEUSAGEBLOCKREASON" , usageBlockReason ) )
end
end
end
end
topSection : AddLine ( GetString ( "SI_COLLECTIBLECATEGORYTYPE" , setDefaultCollectibleData : GetCategoryTypeToSetDefault ( ) ) )
bodySection : AddLine ( setDefaultCollectibleData : GetDescription ( actorCategory ) , self : GetStyle ( "bodyDescription" ) )
end
if numTags > 0 then
local tagStrings = { }
-- Build a map of tag category -> table of tags in that category
for i = 1 , numTags do
if tagDescription ~= "" then
if not tagStrings [ tagCategory ] then
tagStrings [ tagCategory ] = { }
end
end
end
-- Iterate through categories, and build a section for each category with tags in it
for i = TAG_CATEGORY_MIN_VALUE , TAG_CATEGORY_MAX_VALUE do
if tagStrings [ i ] then
if categoryName ~= "" then
end
itemTagsSection : AddLine ( table . concat ( tagStrings [ i ] , GetString ( SI_LIST_COMMA_SEPARATOR ) ) , self : GetStyle ( "itemTagDescription" ) )
end
end
end
end |