Back to Home

ESO Lua File v101044

ingame/groupfinder/groupfinderdata.lua

[◄ back to folders ]
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
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
-- Group Listing Base Data
ZO_GroupListingData_Base = ZO_InitializingObject:Subclass()
ZO_GroupListingData_Base.GetTitle = ZO_GroupListingData_Base:MUST_IMPLEMENT()
ZO_GroupListingData_Base.GetCategory = ZO_GroupListingData_Base:MUST_IMPLEMENT()
ZO_GroupListingData_Base.GetSize = ZO_GroupListingData_Base:MUST_IMPLEMENT()
ZO_GroupListingData_Base.GetNumRoles = ZO_GroupListingData_Base:MUST_IMPLEMENT()
ZO_GroupListingData_Base.GetDescription = ZO_GroupListingData_Base:MUST_IMPLEMENT()
ZO_GroupListingData_Base.GetPlaystyle = ZO_GroupListingData_Base:MUST_IMPLEMENT()
-- Expects roleType as a parameter
-- Should return desiredCount and attainedCount
ZO_GroupListingData_Base.GetRoleStatusCount = ZO_GroupListingData_Base:MUST_IMPLEMENT()
ZO_GroupListingData_Base.DoesGroupRequireChampion = ZO_GroupListingData_Base:MUST_IMPLEMENT()
ZO_GroupListingData_Base.DoesGroupRequireVOIP = ZO_GroupListingData_Base:MUST_IMPLEMENT()
ZO_GroupListingData_Base.DoesGroupRequireInviteCode = ZO_GroupListingData_Base:MUST_IMPLEMENT()
ZO_GroupListingData_Base.DoesGroupAutoAcceptRequests = ZO_GroupListingData_Base:MUST_IMPLEMENT()
ZO_GroupListingData_Base.GetChampionPoints = ZO_GroupListingData_Base:MUST_IMPLEMENT()
ZO_GroupListingData_Base.GetDesiredRoleCount = ZO_GroupListingData_Base:MUST_IMPLEMENT()
ZO_GroupListingData_Base.GetAttainedRoleCount = ZO_GroupListingData_Base:MUST_IMPLEMENT()
ZO_GroupListingData_Base.GetStatusIndicatorIcon = ZO_GroupListingData_Base:MUST_IMPLEMENT()
ZO_GroupListingData_Base.GetStatusIndicatorText = ZO_GroupListingData_Base:MUST_IMPLEMENT()
ZO_GroupListingData_Base.GetWarningText = ZO_GroupListingData_Base:MUST_IMPLEMENT()
ZO_GroupListingData_Base.GetJoinabilityResult = ZO_GroupListingData_Base:MUST_IMPLEMENT()
-- Group Listing Search Data
ZO_GroupListingSearchData = ZO_GroupListingData_Base:Subclass()
function ZO_GroupListingSearchData:Initialize(listingIndex)
    local primaryOptionText, secondaryOptionText = GetGroupFinderSearchListingOptionsSelectionTextByIndex(listingIndex)
    self.listingIndex = listingIndex
    self.category = GetGroupFinderSearchListingCategoryByIndex(listingIndex)
    self.primaryOptionText = primaryOptionText
    self.secondaryOptionText = secondaryOptionText
    self.size = GetGroupFinderSearchListingGroupSizeByIndex(listingIndex)
    self.numRoles = GetGroupFinderSearchListingNumRolesByIndex(listingIndex)
end
function ZO_GroupListingSearchData:GetListingIndex()
    return self.listingIndex
end
function ZO_GroupListingSearchData:GetTitle()
end
function ZO_GroupListingSearchData:GetCategory()
    return self.category
end
function ZO_GroupListingSearchData:GetPrimaryOptionText()
    return self.primaryOptionText
end
function ZO_GroupListingSearchData:GetSecondaryOptionText()
    return self.secondaryOptionText
end
function ZO_GroupListingSearchData:GetSize()
    return self.size
end
function ZO_GroupListingSearchData:GetNumRoles()
    return self.numRoles
end
function ZO_GroupListingSearchData:GetDescription()
end
function ZO_GroupListingSearchData:GetOwnerDisplayName()
end
function ZO_GroupListingSearchData:GetOwnerCharacterName()
end
function ZO_GroupListingSearchData:GetPlaystyle()
end
function ZO_GroupListingSearchData:GetRoleStatusCount(roleType)
end
function ZO_GroupListingSearchData:DoesGroupRequireChampion()
end
function ZO_GroupListingSearchData:DoesGroupRequireVOIP()
end
function ZO_GroupListingSearchData:DoesGroupRequireInviteCode()
end
function ZO_GroupListingSearchData:DoesGroupAutoAcceptRequests()
end
function ZO_GroupListingSearchData:GetChampionPoints()
end
function ZO_GroupListingSearchData:GetDesiredRoleCount(roleType)
    local desiredCount, attainedCount = GetGroupFinderSearchListingRoleStatusCount(self:GetListingIndex(), roleType)
    return desiredCount
end
function ZO_GroupListingSearchData:GetAttainedRoleCount(roleType)
    local desiredCount, attainedCount = GetGroupFinderSearchListingRoleStatusCount(self:GetListingIndex(), roleType)
    return attainedCount
end
function ZO_GroupListingSearchData:GetAttainedRoleCount(roleType)
end
function ZO_GroupListingSearchData:GetStatusIndicatorIcon()
    local joinabilityResult = self:GetJoinabilityResult()
    if joinabilityResult == GROUP_FINDER_ACTION_RESULT_FAILED_ENTITLEMENT_REQUIREMENT then
        if IsInGamepadPreferredMode() then
            return "EsoUI/Art/LFG/Gamepad/gp_LFG_groupFinder_tooltip_dlc_required.dds"
        else
            return "EsoUI/Art/LFG/LFG_groupFinder_tooltip_dlc_required.dds"
        end
    end
end
function ZO_GroupListingSearchData:GetStatusIndicatorText()
    local joinabilityResult = self:GetJoinabilityResult()
    if joinabilityResult == GROUP_FINDER_ACTION_RESULT_FAILED_ENTITLEMENT_REQUIREMENT then
        return GetString(SI_GROUP_FINDER_TOOLTIP_REQUIRES_DLC_LABEL)
    end
end
function ZO_GroupListingSearchData:GetWarningText()
    local joinabilityResult = self:GetJoinabilityResult()
    if joinabilityResult == GROUP_FINDER_ACTION_RESULT_FAILED_ALREADY_JOINED_GROUP
    or joinabilityResult == GROUP_FINDER_ACTION_RESULT_FAILED_ROLE_REQUIREMENT
    or joinabilityResult == GROUP_FINDER_ACTION_RESULT_FAILED_LISTING_NOT_AVAILABLE
    or joinabilityResult == GROUP_FINDER_ACTION_RESULT_FAILED_CP_REQUIREMENT then
        return GetString("SI_GROUPFINDERACTIONRESULT", joinabilityResult)
    end
end
function ZO_GroupListingSearchData:GetJoinabilityResult()
end
function ZO_GroupListingSearchData:IsActiveApplication()
end
function ZO_GroupListingSearchData:GetFirstLockingCollectibleId()
end
-- Group Listing User Type Data
ZO_GroupListingUserTypeData = ZO_GroupListingData_Base:Subclass()
function ZO_GroupListingUserTypeData:Initialize(userType, isEditable)
    self.userType = userType
    self.editableUserType = isEditable and userType or nil
    self.attainedRolesAtEdit = {}
    self.desiredRolesAtEdit = {}
end
function ZO_GroupListingUserTypeData:SetUserType(userType)
    self.userType = userType
end
function ZO_GroupListingUserTypeData:SetEditableUserType(editableUserType)
    self.editableUserType = editableUserType
end
function ZO_GroupListingUserTypeData:GetUserType()
    return self.userType
end
function ZO_GroupListingUserTypeData:GetInternalUserType()
    return self.editableUserType or self.userType
end
function ZO_GroupListingUserTypeData:HasUserTypeChanged()
end
function ZO_GroupListingUserTypeData:IsUserTypeActive()
    return HasGroupListingForUserType(self.userType)
end
function ZO_GroupListingUserTypeData:UpdateOptions()
end
function ZO_GroupListingUserTypeData:SetTitle(title)
end
function ZO_GroupListingUserTypeData:GetTitle()
end
function ZO_GroupListingUserTypeData:SetCategory(category)
end
function ZO_GroupListingUserTypeData:GetCategory()
end
function ZO_GroupListingUserTypeData:SetPrimaryOption(index)
end
function ZO_GroupListingUserTypeData:GetNumPrimaryOptions()
end
function ZO_GroupListingUserTypeData:GetPrimaryOptionByIndex(index)
end
function ZO_GroupListingUserTypeData:GetPrimaryOptionText()
    local primaryOptionText, secondaryOptionText = GetGroupFinderUserTypeGroupListingOptionsSelectionText(self:GetInternalUserType())
    return primaryOptionText
end
function ZO_GroupListingUserTypeData:SetSecondaryOption(index)
end
function ZO_GroupListingUserTypeData:GetNumSecondaryOptions()
end
function ZO_GroupListingUserTypeData:GetSecondaryOptionByIndex(index)
end
function ZO_GroupListingUserTypeData:GetSecondaryOptionText()
    local primaryOptionText, secondaryOptionText = GetGroupFinderUserTypeGroupListingOptionsSelectionText(self:GetInternalUserType())
    return secondaryOptionText
end
function ZO_GroupListingUserTypeData:SetSize(index)
end
function ZO_GroupListingUserTypeData:GetSize()
end
function ZO_GroupListingUserTypeData:GetSizeMin()
end
function ZO_GroupListingUserTypeData:GetSizeMax()
end
function ZO_GroupListingUserTypeData:GetNumRoles()
end
function ZO_GroupListingUserTypeData:SetDescription(description)
end
function ZO_GroupListingUserTypeData:GetDescription()
end
function ZO_GroupListingUserTypeData:GetOwnerDisplayName()
end
function ZO_GroupListingUserTypeData:GetOwnerCharacterName()
end
function ZO_GroupListingUserTypeData:SetPlaystyle(index)
end
function ZO_GroupListingUserTypeData:GetPlaystyle()
end
function ZO_GroupListingUserTypeData:GetRoleStatusCount(roleType)
    local desiredCount = self:GetDesiredRoleCount(roleType)
    local attainedCount = self:GetAttainedRoleCount(roleType)
    return desiredCount, attainedCount
end
function ZO_GroupListingUserTypeData:SetGroupRequiresChampion(setValue)
end
function ZO_GroupListingUserTypeData:DoesGroupRequireChampion()
end
function ZO_GroupListingUserTypeData:SetGroupRequiresVOIP(setValue)
end
function ZO_GroupListingUserTypeData:DoesGroupRequireVOIP()
end
function ZO_GroupListingUserTypeData:SetGroupRequiresInviteCode(setValue)
end
function ZO_GroupListingUserTypeData:DoesGroupRequireInviteCode()
end
function ZO_GroupListingUserTypeData:SetGroupAutoAcceptRequests(setValue)
end
function ZO_GroupListingUserTypeData:DoesGroupAutoAcceptRequests()
end
function ZO_GroupListingUserTypeData:SetGroupEnforceRoles(setValue)
end
function ZO_GroupListingUserTypeData:DoesGroupEnforceRoles()
end
function ZO_GroupListingUserTypeData:SetChampionPoints(championPoints)
end
function ZO_GroupListingUserTypeData:GetChampionPoints()
end
function ZO_GroupListingUserTypeData:SetInviteCode(inviteCode)
end
function ZO_GroupListingUserTypeData:GetInviteCode()
end
function ZO_GroupListingUserTypeData:SetDesiredRoleCount(roleType, count)
end
function ZO_GroupListingUserTypeData:GetDesiredRoleCount(roleType)
end
function ZO_GroupListingUserTypeData:UpdateDesiredRoleCountAtEdit(roleType)
    self.desiredRolesAtEdit[roleType] = self:GetDesiredRoleCount(roleType)
end
function ZO_GroupListingUserTypeData:SetDesiredRoleCountAtEdit(roleType, value)
    self.desiredRolesAtEdit[roleType] = value
    local currentNumDesiredRoles = 0
    for iteratorRoleType, count in pairs(self.desiredRolesAtEdit) do
        if iteratorRoleType ~= LFG_ROLE_INVALID then
            self:SetDesiredRoleCount(iteratorRoleType, count)
            currentNumDesiredRoles = currentNumDesiredRoles + count
        end
    end
    self.desiredRolesAtEdit[LFG_ROLE_INVALID] = GetGroupFinderUserTypeGroupListingNumRoles(GetCurrentGroupFinderUserType()) - currentNumDesiredRoles
    self:SetDesiredRoleCount(LFG_ROLE_INVALID, self.desiredRolesAtEdit[LFG_ROLE_INVALID])
end
function ZO_GroupListingUserTypeData:GetDesiredRoleCountAtEdit(roleType)
    return self.desiredRolesAtEdit[roleType]
end
function ZO_GroupListingUserTypeData:GetAttainedRoleCount(roleType)
end
function ZO_GroupListingUserTypeData:UpdateAttainedRoleCountAtEdit(roleType)
    self.attainedRolesAtEdit[roleType] = self:GetAttainedRoleCount(roleType)
end
function ZO_GroupListingUserTypeData:GetAttainedRoleCountAtEdit(roleType)
    return self.attainedRolesAtEdit[roleType]
end
function ZO_GroupListingUserTypeData:DoesDesiredRolesMatchAttainedRoles()
end
function ZO_GroupListingUserTypeData:GetStatusIndicatorIcon()
    if self:GetUserType() == GROUP_FINDER_GROUP_LISTING_USER_TYPE_APPLIED_TO_GROUP_LISTING then
        if IsInGamepadPreferredMode() then
            return "EsoUI/Art/LFG/Gamepad/gp_LFG_groupFinder_tooltip_applied.dds"
        else
            return "EsoUI/Art/LFG/LFG_groupFinder_tooltip_applied.dds"
        end
    end
end
function ZO_GroupListingUserTypeData:GetStatusIndicatorText()
    if self:GetUserType() == GROUP_FINDER_GROUP_LISTING_USER_TYPE_APPLIED_TO_GROUP_LISTING then
        return GetString(SI_GROUP_FINDER_TOOLTIP_APPLIED_LABEL)
    end
end
function ZO_GroupListingUserTypeData:GetWarningText()
    -- This function is only used for search results, but it's called from shared code,
    -- so it needs to exist on UserTypeData as well.
end
function ZO_GroupListingUserTypeData:GetJoinabilityResult()
    -- This function is only used for search results, but it's called from shared code,
    -- so it needs to exist on UserTypeData as well.
end
-- Group Finder Pending Application Data
ZO_GroupFinderPendingApplicationData = ZO_InitializingObject:Subclass()
function ZO_GroupFinderPendingApplicationData:Initialize(applicantCharacterId)
    local displayName, characterName, classId, level, championPoints, role = GetGroupListingApplicationInfoByCharacterId(applicantCharacterId)
    self.characterId = applicantCharacterId
    self.displayName = displayName
    self.characterName = characterName
    self.classId = classId
    self.level = level
    self.championPoints = championPoints
    self.role = role
end
function ZO_GroupFinderPendingApplicationData:GetCharacterId()
    return self.characterId
end
function ZO_GroupFinderPendingApplicationData:GetDisplayName()
    return self.displayName
end
function ZO_GroupFinderPendingApplicationData:GetFormattedDisplayName()
end
function ZO_GroupFinderPendingApplicationData:GetCharacterName()
    return self.characterName
end
function ZO_GroupFinderPendingApplicationData:GetClassId()
    return self.classId
end
function ZO_GroupFinderPendingApplicationData:GetClassName()
    local gender = GetGenderFromNameDescriptor(self.characterName)
    return zo_strformat(SI_CLASS_NAME, GetClassName(gender, self.classId))
end
function ZO_GroupFinderPendingApplicationData:GetClassIcon()
    if IsInGamepadPreferredMode() then
        return ZO_GetGamepadClassIcon(self.classId)
    else
        return ZO_GetClassIcon(self.classId)
    end
end
function ZO_GroupFinderPendingApplicationData:GetLevel()
    return self.level
end
function ZO_GroupFinderPendingApplicationData:GetChampionPoints()
    return self.championPoints
end
function ZO_GroupFinderPendingApplicationData:GetRole()
    return self.role
end
function ZO_GroupFinderPendingApplicationData:GetNote()
    if not self.note then
        self.note = GetGroupListingApplicationNoteByCharacterId(self.characterId)
    end
    return self.note
end
function ZO_GroupFinderPendingApplicationData:GetEndTimeSeconds()
    return self.endTimeS
end
function ZO_GroupFinderPendingApplicationData:GetTimeRemainingSeconds()
end
function ZO_GroupFinderPendingApplicationData:IsInPendingState()
end