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 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 |
-- optionalDockCardUpgradeContext should be a table from ZO_TributePatronData:GetDockCards
-- Header
if isContract then
elseif isCurse then
else
end
if not isCurse then
end
-- Title
if acquireCost > 0 then
acquirePair : SetStat ( GetString ( "SI_TRIBUTERESOURCE_ACQUIRE" , costResourceType ) , self : GetStyle ( "statValuePairStat" ) )
end
if defeatCost > 0 then
defeatPair : SetStat ( GetString ( "SI_TRIBUTERESOURCE_DEFEAT" , defeatResourceType ) , self : GetStyle ( "statValuePairStat" ) )
end
-- Activation Mechanics
-- Even when there are no activation effects, add the header, cause we'll put a line saying there are no activation effects
local triggerSection = nil
local ON_ACTIVATION = TRIBUTE_MECHANIC_ACTIVATION_SOURCE_ACTIVATION
if numMechanics > 0 then
local hasNonTriggerMechanics = false
local triggerMechanics = { }
activationSection : AddLine ( GetString ( SI_TRIBUTE_CARD_CHOOSE_ONE_MECHANIC ) , self : GetStyle ( "tributeBodyText" ) , self : GetStyle ( "tributeChooseOneText" ) )
end
local PREPEND_ICON = true
for index = 1 , numMechanics do
if triggerId ~= 0 then
local triggerMechanicData =
{
index = index ,
id = triggerId ,
}
else
hasNonTriggerMechanics = true
end
end
if not hasNonTriggerMechanics then
activationSection : AddLine ( GetString ( SI_TRIBUTE_CARD_NO_PLAY_EFFECT_DESCRIPTION ) , self : GetStyle ( "tributeBodyText" ) )
end
if # triggerMechanics > 0 then
triggerSection : AddLine ( GetString ( SI_TRIBUTE_CARD_TRIGGER_EFFECT_HEADER ) , self : GetStyle ( "bodyHeader" ) )
end
end
else
activationSection : AddLine ( GetString ( SI_TRIBUTE_CARD_NO_PLAY_EFFECT_DESCRIPTION ) , self : GetStyle ( "tributeBodyText" ) )
end
if triggerSection then
end
-- Combo mechanics
local ON_COMBO = TRIBUTE_MECHANIC_ACTIVATION_SOURCE_COMBO
if numMechanics > 0 then
local comboSection = nil
-- We technically only support combo 2, combo 3, and combo 4 right now. Any more requires a different visual solution on the card itself.
-- That said, it makes no real difference to support an arbitrarily higher number here to remain somewhat flexible for future designs
-- since we'll stop as soon as we've processed every mechanic anyway
local MIN_COMBO_NUM = 2
local MAX_COMBO_NUM = 10
local PREPEND_ICON = true
local mechanicsProcessed = 0
for currentComboNum = MIN_COMBO_NUM , MAX_COMBO_NUM do
local isHeaderShown = false
for comboMechanicIndex = 1 , numMechanics do
if currentComboNum == mechanicComboNum then
if not isHeaderShown then
if comboSection then
end
isHeaderShown = true
end
mechanicsProcessed = mechanicsProcessed + 1
if mechanicsProcessed == numMechanics then
break
end
end
end
if mechanicsProcessed == numMechanics then
break
end
end
end
-- Flags
end
if isContract then
elseif isCurse then
end
-- Flavor Text
if flavorText ~= "" then
section : AddLine ( zo_strformat ( GetString ( SI_TRIBUTE_CARD_TEXT_FORMATTER ) , cardData : GetFlavorText ( ) ) , self : GetStyle ( "tributeBodyText" ) )
end
-- Upgrade Information
-- If the context has an upgradesTo, that means it's a base card, it has an upgrade, and we do not currently have the upgrade unlocked
if optionalDockCardUpgradeContext and optionalDockCardUpgradeContext . upgradesTo then
local upgradesToCardData = ZO_TributeCardData : New ( cardData : GetPatronDefId ( ) , optionalDockCardUpgradeContext . upgradesTo )
section : AddLine ( zo_strformat ( GetString ( SI_TRIBUTE_CARD_AVAILABLE_UPGRADE_FORMATTER ) , cardData : GetColorizedName ( ) , upgradesToCardData : GetColorizedName ( ) ) , self : GetStyle ( "tributeBodyText" ) )
section : AddLine ( GetTributeCardUpgradeHintText ( cardData : GetPatronDefId ( ) , optionalDockCardUpgradeContext . cardIndex ) , self : GetStyle ( "tributeBodyText" ) )
end
end
if requirementsText ~= "" and mechanicsText ~= "" then
--Layout the title of the favor state
if favorState == TRIBUTE_PATRON_PERSPECTIVE_FAVOR_STATE_FAVORS_PLAYER then
favorSection : AddLine ( favorText , colorStyle or self : GetStyle ( "succeeded" ) , self : GetStyle ( "bodyHeader" ) )
elseif favorState == TRIBUTE_PATRON_PERSPECTIVE_FAVOR_STATE_NEUTRAL then
elseif favorState == TRIBUTE_PATRON_PERSPECTIVE_FAVOR_STATE_FAVORS_OPPONENT then
else
end
local resultText = ""
--Do not include the result string for neutral patrons
local displayFavorState = favorState
if patronData : DoesSkipNeutralFavorState ( ) and favorState == TRIBUTE_PATRON_PERSPECTIVE_FAVOR_STATE_FAVORS_OPPONENT then
displayFavorState = TRIBUTE_PATRON_PERSPECTIVE_FAVOR_STATE_NEUTRAL
end
end
local formatterStringId = useDesaturatedText and SI_TRIBUTE_PATRON_TOOLTIP_FAVOR_DESCRIPTION_DISABLED_FORMATTER or SI_TRIBUTE_PATRON_TOOLTIP_FAVOR_DESCRIPTION_FORMATTER
favorSection : AddLine ( zo_strformat ( GetString ( formatterStringId ) , requirementsText , mechanicsText , resultText ) , colorStyle or self : GetStyle ( "whiteFontColor" ) , self : GetStyle ( "bodyDescription" ) )
end
end
local highlightActivePatronState = optionalArgs and optionalArgs . highlightActivePatronState or false
local suppressNotCollectibleWarning = optionalArgs and optionalArgs . suppressNotCollectibleWarning or false
local showAcquireHint = optionalArgs and optionalArgs . showAcquireHint or false
local showLore = optionalArgs and optionalArgs . showLore or false
-- Header
topSection : AddLine ( GetString ( "SI_TRIBUTEPATRONPERSPECTIVEFAVORSTATE" , TRIBUTE_PATRON_PERSPECTIVE_FAVOR_STATE_NEUTRAL ) )
else
--Neutral patrons should never be collectible
if collectionId ~= 0 then
topSection : AddLine ( GetString ( "SI_COLLECTIBLEUNLOCKSTATE" , GetCollectibleUnlockStateById ( collectionId ) ) )
end
end
-- Title
local currentFavorState = nil
if highlightActivePatronState and TRIBUTE . GetGameFlowState and TRIBUTE : GetGameFlowState ( ) ~= TRIBUTE_GAME_FLOW_STATE_INACTIVE then
-- Highlight the active Favor state only if requested and if a Tribute game is currently active.
if patronStall then
end
end
do
local useDesaturatedText
useDesaturatedText = currentFavorState and currentFavorState ~= TRIBUTE_PATRON_PERSPECTIVE_FAVOR_STATE_FAVORS_PLAYER or false
self : LayoutTributePatronFavorStateInfo ( patronData , TRIBUTE_PATRON_PERSPECTIVE_FAVOR_STATE_FAVORS_PLAYER , useDesaturatedText )
useDesaturatedText = currentFavorState and currentFavorState ~= TRIBUTE_PATRON_PERSPECTIVE_FAVOR_STATE_NEUTRAL or false
self : LayoutTributePatronFavorStateInfo ( patronData , TRIBUTE_PATRON_PERSPECTIVE_FAVOR_STATE_NEUTRAL , useDesaturatedText )
useDesaturatedText = currentFavorState and currentFavorState ~= TRIBUTE_PATRON_PERSPECTIVE_FAVOR_STATE_FAVORS_OPPONENT or false
self : LayoutTributePatronFavorStateInfo ( patronData , TRIBUTE_PATRON_PERSPECTIVE_FAVOR_STATE_FAVORS_OPPONENT , useDesaturatedText )
end
-- Body
if showLore then
if loreDescription ~= "" then
end
end
local collectibleSection = nil
if collectionId == 0 then
if not suppressNotCollectibleWarning then
collectibleSection : AddLine ( GetString ( SI_TRIBUTE_PATRON_TOOLTIP_NO_COLLECTIBLE ) , self : GetStyle ( "bodyDescription" ) , self : GetStyle ( "failed" ) )
end
elseif showAcquireHint then
end
if collectibleSection then
end
end
return
end
do
end
do
local numCards = patronCardCountData . numCards
patronsSection : AddLine ( zo_strformat ( GetString ( SI_TRIBUTE_PATRON_NAME_WITH_COUNT_AND_SUIT_ICON_FORMATTER ) , numCards , patronSuitIcon , patronName ) , self : GetStyle ( "whiteFontColor" ) , self : GetStyle ( "bodyDescription" ) )
end
end
end
titleSection : AddLine ( zo_strformat ( SI_TRIBUTE_RESOURCE_NAME_FORMATTER , GetString ( "SI_TRIBUTERESOURCE" , resource ) ) )
bodySection : AddLine ( GetString ( "SI_TRIBUTERESOURCE_TOOLTIP" , resource ) , self : GetStyle ( "bodyDescription" ) )
end
bodySection : AddLine ( GetString ( SI_TRIBUTE_DISCARD_COUNTER_TOOLTIP_DESCRIPTION ) , self : GetStyle ( "bodyDescription" ) )
end |