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 |
--
--[[ Market Manager ]] --
--
return manager
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
EVENT_MANAGER : RegisterForEvent ( ZO_MARKET_NAME , EVENT_MARKET_PRODUCT_AVAILABILITY_UPDATED , OnMarketProductAvailabilityUpdated )
EVENT_MANAGER : RegisterForEvent ( ZO_MARKET_NAME , EVENT_MARKET_PURCHASE_RESULT , OnMarketPurchaseResult )
EVENT_MANAGER : RegisterForEvent ( ZO_MARKET_NAME , EVENT_MARKET_PRODUCT_SEARCH_RESULTS_READY , OnMarketSearchResultsReady )
EVENT_MANAGER : RegisterForEvent ( ZO_MARKET_NAME , EVENT_MARKET_PRODUCT_SEARCH_RESULTS_CANCELED , OnMarketSearchResultsCanceled )
EVENT_MANAGER : RegisterForEvent ( ZO_MARKET_NAME , EVENT_COLLECTIBLES_UNLOCK_STATE_CHANGED , OnCollectiblesUnlockStateChanged )
EVENT_MANAGER : RegisterForEvent ( ZO_MARKET_NAME , EVENT_MARKET_SHOW_MARKET_PRODUCT , OnShowMarketProduct )
EVENT_MANAGER : RegisterForEvent ( ZO_MARKET_NAME , EVENT_MARKET_SHOW_MARKET_AND_SEARCH , OnShowMarketAndSearch )
EVENT_MANAGER : RegisterForEvent ( ZO_MARKET_NAME , EVENT_MARKET_REQUEST_PURCHASE_MARKET_PRODUCT , OnRequestPurchaseMarketProduct )
EVENT_MANAGER : RegisterForEvent ( ZO_MARKET_NAME , EVENT_MARKET_SHOW_CHAPTER_UPGRADE , OnShowChapterUpgrade )
EVENT_MANAGER : RegisterForEvent ( ZO_MARKET_NAME , EVENT_ESO_PLUS_FREE_TRIAL_STATUS_CHANGED , OnEsoPlusSubscriptionStatusChanged )
EVENT_MANAGER : RegisterForEvent ( ZO_MARKET_NAME , EVENT_REQUEST_CROWN_GEM_TUTORIAL , OnRequestCrownGemTutorial )
end
end
local consoleStoreName
self . insufficientFundsMainText = zo_strformat ( SI_MARKET_INSUFFICIENT_FUNDS_TEXT , ZO_Currency_GetPlatformFormattedCurrencyIcon ( CURT_CROWNS ) , ZO_GetPlatformStoreName ( ) )
elseif platformServiceType == PLATFORM_SERVICE_TYPE_STEAM then
self . insufficientFundsMainText = zo_strformat ( SI_MARKET_INSUFFICIENT_FUNDS_TEXT_STEAM , ZO_Currency_GetPlatformFormattedCurrencyIcon ( CURT_CROWNS ) )
else -- _ZOS and _DMM
self . insufficientFundsMainText = zo_strformat ( SI_MARKET_INSUFFICIENT_FUNDS_TEXT_WEB , ZO_Currency_GetPlatformFormattedCurrencyIcon ( CURT_CROWNS ) , ZO_GetPlatformStoreName ( ) )
end
end
function Market_Manager : AddMarketProductPurchaseWarningStringsToTable ( marketProductData , stringTable )
end
end
end
do
internalassert ( MARKET_PURCHASE_RESULT_MAX_VALUE == 36 , "Update market error flow to handle new purchase result" )
local IS_SIMPLE_MARKET_PURCHASE_ERROR =
{
[ MARKET_PURCHASE_RESULT_ALREADY_COMPLETED_INSTANT_UNLOCK ] = true ,
[ MARKET_PURCHASE_RESULT_NOT_ENOUGH_CROWN_GEMS ] = true ,
[ MARKET_PURCHASE_RESULT_COLLECTIBLE_ALREADY ] = true ,
[ MARKET_PURCHASE_RESULT_REQUIRES_ESO_PLUS ] = true ,
[ MARKET_PURCHASE_RESULT_EXCEEDS_CURRENCY_CAP ] = true ,
[ MARKET_PURCHASE_RESULT_TEMPORARY_HOTBAR_PROHIBITION ] = true ,
[ MARKET_PURCHASE_RESULT_QUEST_JOURNAL_FULL ] = true ,
[ MARKET_PURCHASE_RESULT_ALREADY_HAVE_QUEST ] = true ,
[ MARKET_PURCHASE_RESULT_ALREADY_COMPLETED_QUEST ] = true ,
[ MARKET_PURCHASE_RESULT_CANNOT_GRANT_QUEST ] = true ,
}
local titleString = displayName
local errorStrings = { }
local allowContinue = true
if IS_SIMPLE_MARKET_PURCHASE_ERROR [ expectedPurchaseResult ] then
allowContinue = false
table . insert ( errorStrings , zo_strformat ( SI_MARKET_UNABLE_TO_PURCHASE_TEXT , GetString ( "SI_MARKETPURCHASABLERESULT" , expectedPurchaseResult ) ) )
elseif expectedPurchaseResult == MARKET_PURCHASE_RESULT_NOT_ENOUGH_VC then
allowContinue = false
elseif expectedPurchaseResult == MARKET_PURCHASE_RESULT_NOT_ENOUGH_ROOM then
allowContinue = false
elseif expectedPurchaseResult == MARKET_PURCHASE_RESULT_PRODUCT_ALREADY_IN_GIFT_INVENTORY then
allowContinue = false
table . insert ( errorStrings , zo_strformat ( SI_MARKET_PURCHASE_ALREADY_HAVE_GIFT_TEXT , ZO_SELECTED_TEXT : Colorize ( displayName ) ) )
end
local dialogParams = {
titleParams = { titleString } ,
}
local hasErrors = # errorStrings > 0
return hasErrors , dialogParams , allowContinue , expectedPurchaseResult
end
end
local titleString = displayName
local errorStrings = { }
local allowContinue = true
if expectedPurchaseResult == MARKET_PURCHASE_RESULT_NOT_ENOUGH_VC then
allowContinue = false
elseif expectedPurchaseResult == MARKET_PURCHASE_RESULT_NOT_ENOUGH_CROWN_GEMS then
allowContinue = false
table . insert ( errorStrings , zo_strformat ( SI_MARKET_UNABLE_TO_PURCHASE_TEXT , GetString ( "SI_MARKETPURCHASABLERESULT" , expectedPurchaseResult ) ) )
elseif expectedPurchaseResult == MARKET_PURCHASE_RESULT_GIFTING_NOT_ALLOWED then
allowContinue = false
elseif expectedPurchaseResult == MARKET_PURCHASE_RESULT_GIFTING_LOCKED then
allowContinue = false
elseif expectedPurchaseResult == MARKET_PURCHASE_RESULT_PRODUCT_ALREADY_IN_GIFT_INVENTORY then
allowContinue = false
table . insert ( errorStrings , zo_strformat ( SI_MARKET_GIFTING_ALREADY_HAVE_GIFT_TEXT , ZO_SELECTED_TEXT : Colorize ( displayName ) ) )
elseif expectedPurchaseResult == MARKET_PURCHASE_RESULT_FAIL_PURCHASE_REQ_LIST then
allowContinue = false
if not passesReqList and errorStringId ~= 0 then
end
end
local dialogParams = {
titleParams = { titleString } ,
}
local hasErrors = # errorStrings > 0
return hasErrors , dialogParams , allowContinue , expectedPurchaseResult
end
-- check if there is an active eso plus product, but only grab the first one
local productId , presentationIndex = GetActiveMarketProductListingsForEsoPlus ( MARKET_DISPLAY_GROUP_CROWN_STORE )
if productId ~= nil and productId > 0 then
local costAfterDiscount = select ( 3 , self . freeTrialMarketProductData : GetMarketProductPricingByPresentation ( ) )
else
end
end
end
end
end
do
-- it's possible to end up in a state where there is no active
-- free trial market product, but the player still is on a free trial
-- in which case the trial is either over or we don't know then it ends
local remainingTime = 0
if productData then
end
local formattedRemainingTime = ZO_FormatTimeLargestTwo ( remainingTime , TIME_FORMAT_STYLE_DESCRIPTIVE_MINIMAL )
local statusText = zo_strformat ( SI_MARKET_SUBSCRIPTION_PAGE_SUBSCRIPTION_STATUS_FREE_TRIAL , formattedRemainingTime )
end
local statusText
generateTextFunction = function ( ) return UpdateEsoPlusFreeTrialStatusText ( self . freeTrialMarketProductData ) end
else
end
end
end
|