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 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 |
------------------
-- Guild Finder: Guild Browser Manager --
--
-- Manages Guild Browser data in lua
------------------
ZO_GUILD_BROWSER_META_DATA_ATTRIBUTES =
{
GUILD_META_DATA_ATTRIBUTE_NAME ,
GUILD_META_DATA_ATTRIBUTE_RECRUITMENT_MESSAGE ,
GUILD_META_DATA_ATTRIBUTE_LANGUAGES ,
GUILD_META_DATA_ATTRIBUTE_ACTIVITIES ,
GUILD_META_DATA_ATTRIBUTE_PERSONALITIES ,
GUILD_META_DATA_ATTRIBUTE_ALLIANCE ,
GUILD_META_DATA_ATTRIBUTE_SIZE ,
GUILD_META_DATA_ATTRIBUTE_KIOSK ,
GUILD_META_DATA_ATTRIBUTE_HERALDRY ,
GUILD_META_DATA_ATTRIBUTE_FOUNDED_DATE ,
GUILD_META_DATA_ATTRIBUTE_PRIMARY_FOCUS ,
GUILD_META_DATA_ATTRIBUTE_SECONDARY_FOCUS ,
GUILD_META_DATA_ATTRIBUTE_MINIMUM_CP ,
GUILD_META_DATA_ATTRIBUTE_ROLES ,
GUILD_META_DATA_ATTRIBUTE_START_TIME ,
GUILD_META_DATA_ATTRIBUTE_END_TIME ,
GUILD_META_DATA_ATTRIBUTE_HEADER_MESSAGE ,
}
return manager
end
return
{
initialized = { } ,
}
end
object =
{
initialized = { } ,
}
end
if guildId == requestedGuildId then
local hasGuildData = DoesGuildDataHaveInitializedAttributes ( guildId , unpack ( ZO_GUILD_BROWSER_META_DATA_ATTRIBUTES ) )
if hasGuildData then
end
end
end
return -- Don't update when the search complete is not for our current search or we are waiting to do a new search immediately
end
for i = 1 , numResults do
end
end
local defaults = { applicationText = "" , reportedGuilds = { } }
self . savedVars = ZO_SavedVars : NewAccountWide ( "ZO_Ingame_SavedVariables" , 1 , "ZO_GuildBrowser_ApplicationMessage" , defaults )
end
end
end
end
end
if result == GUILD_APP_RESPONSE_APPLICATION_SENT then
ZO_Dialogs_ShowPlatformDialog ( "GUILD_FINDER_APPLICATION_SUBMITTED" , nil , { mainTextParams = { decoratedGuildName } } )
else
ZO_Dialogs_ShowPlatformDialog ( "GUILD_FINDER_APPLICATION_FAILED" , nil , { mainTextParams = { GetString ( "SI_GUILDAPPLICATIONRESPONSE" , result ) } } )
end
end
EVENT_MANAGER : RegisterForEvent ( "ZO_GuildBrowser_Manager" , EVENT_GUILD_INFO_REQUEST_COMPLETE , OnGuildDataRequestComplete )
EVENT_MANAGER : RegisterForEvent ( "ZO_GuildBrowser_Manager" , EVENT_GUILD_FINDER_SEARCH_COMPLETE , OnGuildFinderSearchComplete )
EVENT_MANAGER : RegisterForEvent ( "ZO_GuildBrowser_Manager" , EVENT_GUILD_FINDER_SEARCH_COOLDOWN_UPDATE , OnGuildFinderSearchCooldownUpdate )
EVENT_MANAGER : RegisterForEvent ( "ZO_GuildBrowser_Manager" , EVENT_GUILD_FINDER_APPLICATION_RESULTS_PLAYER , OnGuildFinderApplicationResults )
EVENT_MANAGER : RegisterForEvent ( "ZO_GuildBrowser_Manager" , EVENT_GUILD_FINDER_APPLICATION_RESPONSE , OnApplicationResponse )
end
for i = 1 , numApps do
local guildId , level , championPoints , alliance , classId , guildName , guildAlliance , accountName , characterName , achievementPoints , applicationMessage = GetGuildFinderAccountApplicationInfo ( i )
local applicationData =
{
index = i ,
guildId = guildId ,
characterName = characterName ,
guildName = guildName ,
guildAlliance = guildAlliance ,
class = classId ,
alliance = alliance ,
championPoints = championPoints ,
achievementPoints = achievementPoints ,
message = applicationMessage ,
durationS = timeRemainingS ,
}
end
end
end
do
-- Retrieve Heraldry Info
local bgCategory , bgStyle , backgroundPrimaryColorIndex , backgroundSecondaryColorIndex , crestCategoryIndex , crestStyleIndex , crestColorIndex = GetGuildHeraldryAttribute ( guildData . guildId )
local _ , _ , backgroundPrimaryR , backgroundPrimaryG , backgroundPrimaryB = GetHeraldryColorInfo ( backgroundPrimaryColorIndex )
local _ , _ , backgroundSecondaryR , backgroundSecondaryG , backgroundSecondaryB = GetHeraldryColorInfo ( backgroundSecondaryColorIndex )
guildData . heraldry = { }
guildData . heraldry . hasHeraldry = not ( backgroundPrimaryColorIndex == 1 and backgroundSecondaryColorIndex == 1 and crestCategoryIndex == 1 and crestStyleIndex == 1 and crestColorIndex == 1 )
guildData . heraldry . bgCategoryIconPath = bgCategoryIconPath
guildData . heraldry . bgStyleIconPath = bgStyleIconPath
guildData . heraldry . crestIconPath = crestIconPath
guildData . heraldry . crestColor = { crestR , crestG , crestB }
guildData . heraldry . primaryBackgroundColor = { backgroundPrimaryR , backgroundPrimaryG , backgroundPrimaryB }
guildData . heraldry . secondaryBackgroundColor = { backgroundSecondaryR , backgroundSecondaryG , backgroundSecondaryB }
end
guildData . roles = { }
local guildId = guildData . guildId
end
end
end
local GUILD_BROWSER_DISPLAY_ATTRIBUTE_FUNCTION =
{
[ GUILD_META_DATA_ATTRIBUTE_NAME ] = function ( guildData ) guildData . guildName = GetGuildNameAttribute ( guildData . guildId ) end ,
[ GUILD_META_DATA_ATTRIBUTE_RECRUITMENT_MESSAGE ] = function ( guildData ) guildData . recruitmentMessage = GetGuildRecruitmentMessageAttribute ( guildData . guildId ) end ,
[ GUILD_META_DATA_ATTRIBUTE_LANGUAGES ] = function ( guildData ) guildData . language = GetGuildLanguageAttribute ( guildData . guildId ) end ,
[ GUILD_META_DATA_ATTRIBUTE_ACTIVITIES ] = function ( guildData ) guildData . activitiesText = ZO_GuildFinder_Manager . GetAttributeCommaFormattedList ( guildData . guildId , GUILD_ACTIVITY_ATTRIBUTE_VALUE_ITERATION_BEGIN , GUILD_ACTIVITY_ATTRIBUTE_VALUE_ITERATION_END , DoesGuildHaveActivityAttribute , "SI_GUILDACTIVITYATTRIBUTEVALUE" ) end ,
[ GUILD_META_DATA_ATTRIBUTE_PERSONALITIES ] = function ( guildData ) guildData . personality = GetGuildPersonalityAttribute ( guildData . guildId ) end ,
[ GUILD_META_DATA_ATTRIBUTE_ALLIANCE ] = function ( guildData ) guildData . alliance = GetGuildAllianceAttribute ( guildData . guildId ) end ,
[ GUILD_META_DATA_ATTRIBUTE_SIZE ] = function ( guildData ) guildData . size = GetGuildSizeAttribute ( guildData . guildId ) end ,
[ GUILD_META_DATA_ATTRIBUTE_KIOSK ] = function ( guildData ) guildData . guildTraderText = GetGuildKioskAttribute ( guildData . guildId ) or GetString ( SI_GUILD_FINDER_GUILD_INFO_DEFAULT_ATTRIBUTE_VALUE ) end ,
[ GUILD_META_DATA_ATTRIBUTE_FOUNDED_DATE ] = function ( guildData ) guildData . foundedDateText = GetGuildFoundedDateAttribute ( guildData . guildId ) end ,
[ GUILD_META_DATA_ATTRIBUTE_PRIMARY_FOCUS ] = function ( guildData ) guildData . primaryFocus = GetGuildPrimaryFocusAttribute ( guildData . guildId ) end ,
[ GUILD_META_DATA_ATTRIBUTE_SECONDARY_FOCUS ] = function ( guildData ) guildData . secondaryFocus = GetGuildSecondaryFocusAttribute ( guildData . guildId ) end ,
[ GUILD_META_DATA_ATTRIBUTE_MINIMUM_CP ] = function ( guildData ) guildData . minimumCP = GetGuildMinimumCPAttribute ( guildData . guildId ) end ,
[ GUILD_META_DATA_ATTRIBUTE_START_TIME ] = function ( guildData ) guildData . startTimeHour = GetGuildLocalStartTimeAttribute ( guildData . guildId ) end ,
[ GUILD_META_DATA_ATTRIBUTE_END_TIME ] = function ( guildData ) guildData . endTimeHour = GetGuildLocalEndTimeAttribute ( guildData . guildId ) end ,
[ GUILD_META_DATA_ATTRIBUTE_HEADER_MESSAGE ] = function ( guildData ) guildData . headerMessage = GetGuildHeaderMessageAttribute ( guildData . guildId ) end ,
}
end
end
end
end
local hasGuildData = DoesGuildDataHaveInitializedAttributes ( guildId , unpack ( ZO_GUILD_BROWSER_META_DATA_ATTRIBUTES ) )
if hasGuildData then
end
return nil
end
if didRequest then
end
return didRequest
end
return false
end
if requestedGuildId == guildId then
return true
end
end
return false
end
end
end
end
end
if application . guildId == guildId then
return true
end
end
return false
end
end
end
end
end
else
end
end
if searchId ~= nil then
end
end
end
end
end
return self . searchState == GUILD_FINDER_SEARCH_STATE_NONE or self . searchState == GUILD_FINDER_SEARCH_STATE_COMPLETE
end
end
do
local DEFAULT_BANNER_TEXTURE = "EsoUI/Art/GuildFinder/tabard_no_heraldry.dds"
local heraldryData = guildData . heraldry
if heraldryData . hasHeraldry then
else
end
end
end
-- Debug only command
end
end
|