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 |
----
-- MarketAnnouncement_Manager
----
EVENT_MANAGER : RegisterForEvent ( "MarketAnnouncement_Manager" , EVENT_PLAYER_ACTIVATED , function ( ) self : OnPlayerActivated ( ) end )
local MARKET_PRODUCT_SORT_KEYS =
{
isDeprioritized = { tiebreaker = "announceSortOrder" , tieBreakerSortOrder = ZO_SORT_ORDER_UP } ,
announceSortOrder = { tiebreaker = "isPromo" , tieBreakerSortOrder = ZO_SORT_ORDER_DOWN } ,
isPromo = { tiebreaker = "isLimitedTime" , tieBreakerSortOrder = ZO_SORT_ORDER_DOWN } ,
isLimitedTime = { tiebreaker = "timeLeft" , tieBreakerSortOrder = ZO_SORT_ORDER_UP } ,
timeLeft = { isNumeric = true , tiebreaker = "hasActivationRequirement" , tieBreakerSortOrder = ZO_SORT_ORDER_DOWN } ,
hasActivationRequirement = { tiebreaker = "containsDLC" , tieBreakerSortOrder = ZO_SORT_ORDER_DOWN } ,
containsDLC = { tiebreaker = "isNew" , tieBreakerSortOrder = ZO_SORT_ORDER_DOWN } ,
isNew = { tiebreaker = "isOnSale" , tieBreakerSortOrder = ZO_SORT_ORDER_DOWN } ,
isOnSale = { tiebreaker = "onSaleTimeLeft" , tieBreakerSortOrder = ZO_SORT_ORDER_UP } ,
onSaleTimeLeft = { tiebreaker = "name" , tieBreakerSortOrder = ZO_SORT_ORDER_UP } ,
stackCount = { }
}
return ZO_TableOrderingFunction ( entry1 , entry2 , "isDeprioritized" , MARKET_PRODUCT_SORT_KEYS , ZO_SORT_ORDER_UP )
end
if numAnnouncementProducts > 0 then -- future proofing for possible addition of non-market product announcements or just no announcements
for i = 1 , numAnnouncementProducts do
-- need to check if the products should show as limited time first instead of just getting the time left
local productInfo =
{
productData = productData ,
-- for sorting
isLimitedTime = isLimitedTime ,
isOnSale = hasDiscount ,
isDeprioritized = isDeprioritized ,
hasActivationRequirement = hasActivationRequirement ,
announceSortOrder = announceSortOrder ,
}
end
end
end
end
EVENT_MANAGER : RegisterForEvent ( "EVENT_MARKET_ANNOUNCEMENT_UPDATED" , EVENT_MARKET_ANNOUNCEMENT_UPDATED , OnMarketAnnouncementDataUpdated )
EVENT_MANAGER : RegisterForEvent ( "EVENT_EVENT_ANNOUNCEMENTS_UPDATED" , EVENT_EVENT_ANNOUNCEMENTS_UPDATED , OnEventAnnouncementsUpdated )
EVENT_MANAGER : RegisterForEvent ( "EVENT_EVENT_ANNOUNCEMENTS_RECEIVED" , EVENT_EVENT_ANNOUNCEMENTS_RECEIVED , OnEventAnnouncementsUpdated )
end
end
end
function MarketAnnouncement_Manager : GetMarketProductListingsForHouseTemplate ( houseTemplateId , displayGroup )
end
local houseDiscountPercent = select ( 4 , ZO_MarketProduct_GetDefaultHousingTemplatePricingInfo ( productData : GetId ( ) , function ( ... ) return self : GetMarketProductListingsForHouseTemplate ( ... ) end ) )
-- houseDiscountPercent could come back as nil if there is no market listing currently available for the market product
return houseDiscountPercent and houseDiscountPercent > 0 or false
end
return false
end
end
if newState == SCENE_HIDING then
end
end
for i = 1 , numEventAnnouncements do
{
index = i ,
}
end
end
end
end
if eventAnnouncementData then
eventAnnouncementData . remainingTime = remainingTime
end
return remainingTime
end
end
|