Back to Home

ESO Lua File v101037

ingame/guildfinder/guildrecruitment_guildlisting_shared.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
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
------------------
-- Guild Finder --
------------------
ZO_GuildRecruitment_GuildListing_Shared = ZO_GuildRecruitment_Panel_Shared:Subclass()
function ZO_GuildRecruitment_GuildListing_Shared:New(...)
    return ZO_GuildRecruitment_Panel_Shared.New(self, ...)
end
function ZO_GuildRecruitment_GuildListing_Shared:Initialize(control, templateData)
    ZO_GuildRecruitment_Panel_Shared.Initialize(self, control)
    self.templateData = templateData
    local function OnGuildMembershipOrApplicationsChanged(guildId)
        if guildId == self.guildId then
            self:UpdateAlert()
        end
    end
    local function OnGuildInfoChanged(guildId)
        if guildId == self.guildId then
            self:RefreshData()
        end
    end
    GUILD_RECRUITMENT_MANAGER:RegisterCallback("GuildMembershipChanged", OnGuildMembershipOrApplicationsChanged)
    GUILD_RECRUITMENT_MANAGER:RegisterCallback("GuildInfoChanged", OnGuildInfoChanged)
    GUILD_RECRUITMENT_MANAGER:RegisterCallback("GuildApplicationResultsReady", OnGuildMembershipOrApplicationsChanged)
end
function ZO_GuildRecruitment_GuildListing_Shared:InitializeGridList()
    -- Initialize grid list object
    local templateData = self.templateData
    local gridListControl = self.control:GetNamedChild("InfoPanel")
    self.gridListControl = gridListControl
    -- Override default highlight template to hide white outline around tiles
    self.gridList = templateData.gridListClass:New(gridListControl, templateData.gridHighlightTemplate)
    -- NOTE: If you update the number of templates being added to the gridList you must also update
    -- ZO_GUILD_RECRUITMENT_GUILD_LISTING_GAMEPAD_ENTRY_TEMPLATE in GuildRecruitment_GuildListing_Gamepad.lua
    local HIDE_CALLBACK = nil
    local GRID_PADDING_X = 0
    local attributeSelectionData = templateData.attributeSelection
    local activityCheckboxData = templateData.activityCheckbox
    local headlineData = templateData.headlineEditBox
    local descriptionData = templateData.descriptionEditBox
    local roleSelectorData = templateData.roleSelector
    local minimumCPData = templateData.minimumCP
    self.gridList:AddEntryTemplate(attributeSelectionData.entryTemplate, attributeSelectionData.dimensionsX, attributeSelectionData.dimensionsY, ZO_DefaultGridTileEntrySetup, HIDE_CALLBACK, ZO_DefaultGridTileEntryReset, attributeSelectionData.gridPaddingX, attributeSelectionData.gridPaddingY)
    self.gridList:AddEntryTemplate(attributeSelectionData.statusEntryTemplate, attributeSelectionData.statusDimensionsX, attributeSelectionData.dimensionsY, ZO_DefaultGridTileEntrySetup, HIDE_CALLBACK, ZO_DefaultGridTileEntryReset, GRID_PADDING_X, attributeSelectionData.gridPaddingY)
    self.gridList:AddEntryTemplate(attributeSelectionData.startTimeEntryTemplate, attributeSelectionData.startTimeDimensionsX, attributeSelectionData.timeDimensionsY, ZO_DefaultGridTileEntrySetup, HIDE_CALLBACK, ZO_DefaultGridTileEntryReset, GRID_PADDING_X, attributeSelectionData.gridPaddingY)
    self.gridList:AddEntryTemplate(attributeSelectionData.endTimeEntryTemplate, attributeSelectionData.dimensionsX, attributeSelectionData.timeDimensionsY, ZO_DefaultGridTileEntrySetup, HIDE_CALLBACK, ZO_DefaultGridTileEntryReset, GRID_PADDING_X, attributeSelectionData.gridPaddingY)
    self.gridList:AddEntryTemplate(activityCheckboxData.entryTemplate, activityCheckboxData.dimensionsX, activityCheckboxData.dimensionsY, ZO_DefaultGridTileEntrySetup, HIDE_CALLBACK, ZO_DefaultGridTileEntryReset, activityCheckboxData.gridPaddingX, activityCheckboxData.gridPaddingY)
    self.gridList:AddEntryTemplate(activityCheckboxData.endEntryTemplate, activityCheckboxData.dimensionsX, activityCheckboxData.endDimensionsY, ZO_DefaultGridTileEntrySetup, HIDE_CALLBACK, ZO_DefaultGridTileEntryReset, activityCheckboxData.gridPaddingX, activityCheckboxData.gridPaddingY)
    self.gridList:AddEntryTemplate(headlineData.entryTemplate, headlineData.dimensionsX, headlineData.dimensionsY, ZO_DefaultGridTileEntrySetup, self.templateData.textEditHideCallback, ZO_DefaultGridTileEntryReset, GRID_PADDING_X, headlineData.gridPaddingY)
    self.gridList:AddEntryTemplate(descriptionData.entryTemplate, descriptionData.dimensionsX, descriptionData.dimensionsY, ZO_DefaultGridTileEntrySetup, self.templateData.textEditHideCallback, ZO_DefaultGridTileEntryReset, GRID_PADDING_X, descriptionData.gridPaddingY)
    self.gridList:AddEntryTemplate(roleSelectorData.entryTemplate, roleSelectorData.dimensionsX, roleSelectorData.dimensionsY, ZO_DefaultGridTileEntrySetup, HIDE_CALLBACK, ZO_DefaultGridTileEntryReset, GRID_PADDING_X, roleSelectorData.gridPaddingY)
    self.gridList:AddEntryTemplate(roleSelectorData.endEntryTemplate, roleSelectorData.endDimensionsX, roleSelectorData.dimensionsY, ZO_DefaultGridTileEntrySetup, HIDE_CALLBACK, ZO_DefaultGridTileEntryReset, GRID_PADDING_X, roleSelectorData.gridPaddingY)
    self.gridList:AddEntryTemplate(minimumCPData.entryTemplate, minimumCPData.dimensionsX, minimumCPData.dimensionsY, ZO_DefaultGridTileEntrySetup, HIDE_CALLBACK, ZO_DefaultGridTileEntryReset, GRID_PADDING_X, minimumCPData.gridPaddingY)
    self.gridList:AddHeaderTemplate(templateData.headerTemplate, templateData.headerHeight, ZO_DefaultGridTileHeaderSetup)
    self.gridList:SetHeaderPrePadding(templateData.gridPaddingY)
end
function ZO_GuildRecruitment_GuildListing_Shared:UpdateAlert()
    -- To be overridden
end
function ZO_GuildRecruitment_GuildListing_Shared:CanSave()
    return HasGuildRecruitmentDataChanged(self.guildId)
end
function ZO_GuildRecruitment_GuildListing_Shared:Save()
    -- To be overridden
end
function ZO_GuildRecruitment_GuildListing_Shared:GetActivitiesForFocus(value)
    local activities = {}
    if value then
        if value == GUILD_FOCUS_ATTRIBUTE_VALUE_TRADING then
            table.insert(activities, GUILD_ACTIVITY_ATTRIBUTE_VALUE_TRADING)
        elseif value == GUILD_FOCUS_ATTRIBUTE_VALUE_GROUP_PVE then
            -- Not currently tied to any additional attributes
        elseif value == GUILD_FOCUS_ATTRIBUTE_VALUE_ROLEPLAYING then
            table.insert(activities, GUILD_ACTIVITY_ATTRIBUTE_VALUE_ROLEPLAYING)
        elseif value == GUILD_FOCUS_ATTRIBUTE_VALUE_SOCIAL then
            -- Not currently tied to any additional attributes
        elseif value == GUILD_FOCUS_ATTRIBUTE_VALUE_PVP then
            table.insert(activities, GUILD_ACTIVITY_ATTRIBUTE_VALUE_PVP)
        elseif value == GUILD_FOCUS_ATTRIBUTE_VALUE_QUESTING then
            table.insert(activities, GUILD_ACTIVITY_ATTRIBUTE_VALUE_QUESTING)
        elseif value == GUILD_FOCUS_ATTRIBUTE_VALUE_CRAFTING then
            table.insert(activities, GUILD_ACTIVITY_ATTRIBUTE_VALUE_CRAFTING)
        end
    end
    return activities
end
function ZO_GuildRecruitment_GuildListing_Shared:SetDisabledAdditionalActivitiesForFocus(value)
    local activities = self:GetActivitiesForFocus(value)
    for _, activity in pairs(activities) do
        self.attributeSelectionData.activities.isDisabled[activity] = true
    end
end
function ZO_GuildRecruitment_GuildListing_Shared:UpdateAdditionalActivitiesForFocus(value, selected)
    local activities = self:GetActivitiesForFocus(value)
    for _, activity in pairs(activities) do
        SetGuildRecruitmentActivityValue(self.guildId, activity, selected)
        self.attributeSelectionData.activities.isChecked[activity] = selected
    end
end
function ZO_GuildRecruitment_GuildListing_Shared:UpdateAttributeValue(attribute, value)
    for _, data in pairs(self.attributeSelectionData) do
        if data.attribute == attribute then
            if data.currentValue ~= value then
                data.currentValue = value
                if data.updateFunction then
                    data.updateFunction(self.guildId, value)
                end
            end
            break
        end
    end
end
function ZO_GuildRecruitment_GuildListing_Shared:OnFocusSelected(attribute, value, oldValue)
    self:UpdateAttributeValue(attribute, value)
    local SELECTED = true
    self:UpdateAdditionalActivitiesForFocus(oldValue, SELECTED)
    self.attributeSelectionData.activities.isDisabled = {}
    self:SetDisabledAdditionalActivitiesForFocus(self.attributeSelectionData.primaryFocus.currentValue)
    self:SetDisabledAdditionalActivitiesForFocus(self.attributeSelectionData.secondaryFocus.currentValue)
    self.gridList:RefreshGridList()
    KEYBIND_STRIP:UpdateKeybindButtonGroup(self.keybindStripDescriptor)
end
function ZO_GuildRecruitment_GuildListing_Shared:OnDropdownSelected(attribute, value)
    self:UpdateAttributeValue(attribute, value)
    self.gridList:RefreshGridList()
    KEYBIND_STRIP:UpdateKeybindButtonGroup(self.keybindStripDescriptor)
end
function ZO_GuildRecruitment_GuildListing_Shared:OnTextEdited(attribute, text)
    self:UpdateAttributeValue(attribute, text)
    KEYBIND_STRIP:UpdateKeybindButtonGroup(self.keybindStripDescriptor)
end
function ZO_GuildRecruitment_GuildListing_Shared:OnRoleSelected(role, isSelected)
    -- Keyboard sends the role as an object with a role element on it. If that's the case
    -- extract the role enum from the control
    if type(role) ~= "number" and role.role then
        role = role.role
    end
    self.attributeSelectionData.roles.currentValue[role] = isSelected
    if self.attributeSelectionData.roles.baseData.updateFunction then
        self.attributeSelectionData.roles.baseData.updateFunction(self.guildId, role, isSelected)
    end
end
function ZO_GuildRecruitment_GuildListing_Shared:OnMinCPFocusLost(editBox)
    local maxAllowedValue = ZO_GuildFinder_Manager.GetMaxCPAllowedForInput()
    local updatedValue = tonumber(editBox:GetText()) or 0
    if updatedValue > maxAllowedValue then
        editBox:SetText(maxAllowedValue)
        SetGuildRecruitmentMinimumCP(guildId, maxAllowedValue)
    end
end
function ZO_GuildRecruitment_GuildListing_Shared:BuildAttributeSelectionData()
    local function OnFocusSelected(...)
        self:OnFocusSelected(...)
    end
    local function OnDropdownSelected(...)
        self:OnDropdownSelected(...)
    end
    local function OnTextEdited(...)
        self:OnTextEdited(...)
    end
    local function OnRoleSelected(...)
        self:OnRoleSelected(...)
    end
    local function OnMinCPFocusLost(...)
        self:OnMinCPFocusLost(...)
    end
    self.attributeSelectionData =
    {
        recruitmentStatus = 
        {
            attribute = GUILD_META_DATA_ATTRIBUTE_RECRUITMENT_STATUS,
            entryTemplate = self.templateData.attributeSelection.statusEntryTemplate,
            iterBegin = GUILD_RECRUITMENT_STATUS_ATTRIBUTE_VALUE_ITERATION_BEGIN,
            iterEnd = GUILD_RECRUITMENT_STATUS_ATTRIBUTE_VALUE_ITERATION_END,
            stringPrefix = "SI_GUILDRECRUITMENTSTATUSATTRIBUTEVALUE",
            headerText = self.templateData.attributeSelection.recruitmentHeaderText,
            onSelectionCallback = OnDropdownSelected,
            updateFunction = function(...)
                SetGuildRecruitmentRecruitmentStatus(...)
                local RECRUITMENT_STATUS_CHANGED = true
                self:Save(RECRUITMENT_STATUS_CHANGED)
            end,
            narrationText = self.templateData.attributeSelection.narrationText
        },
        primaryFocus =
        {
            attribute = GUILD_META_DATA_ATTRIBUTE_PRIMARY_FOCUS,
            entryTemplate = self.templateData.attributeSelection.entryTemplate,
            iterBegin = GUILD_FOCUS_ATTRIBUTE_VALUE_TRADING, -- Start at selection after None
            iterEnd = GUILD_FOCUS_ATTRIBUTE_VALUE_ITERATION_END,
            omittedIndex = function()
                local recruitmentMessage, headerMessage, recruitmentStatus, primaryFocus, secondaryFocus = GetGuildRecruitmentInfo(self.guildId)
                return secondaryFocus
            end,
            stringPrefix = "SI_GUILDFOCUSATTRIBUTEVALUE",
            headerText = self.templateData.attributeSelection.primaryFocusHeaderText,
            onSelectionCallback = OnFocusSelected,
            updateFunction = function(...) SetGuildRecruitmentPrimaryFocus(...) end,
            narrationText = self.templateData.attributeSelection.narrationText,
        },
        secondaryFocus =
        {
            attribute = GUILD_META_DATA_ATTRIBUTE_SECONDARY_FOCUS,
            entryTemplate = self.templateData.attributeSelection.entryTemplate,
            iterBegin = GUILD_FOCUS_ATTRIBUTE_VALUE_ITERATION_BEGIN,
            iterEnd = GUILD_FOCUS_ATTRIBUTE_VALUE_ITERATION_END,
            omittedIndex = function()
                local recruitmentMessage, headerMessage, recruitmentStatus, primaryFocus, secondaryFocus = GetGuildRecruitmentInfo(self.guildId)
                return primaryFocus
            end,
            stringPrefix = "SI_GUILDFOCUSATTRIBUTEVALUE",
            headerText = self.templateData.attributeSelection.secondaryFocusHeaderText,
            onSelectionCallback = OnFocusSelected,
            updateFunction = function(...) SetGuildRecruitmentSecondaryFocus(...) end,
            narrationText = self.templateData.attributeSelection.narrationText,
        },
        personality =
        {
            attribute = GUILD_META_DATA_ATTRIBUTE_PERSONALITIES,
            entryTemplate = self.templateData.attributeSelection.entryTemplate,
            iterBegin = GUILD_PERSONALITY_ATTRIBUTE_VALUE_ITERATION_BEGIN,
            iterEnd = GUILD_PERSONALITY_ATTRIBUTE_VALUE_ITERATION_END,
            stringPrefix = "SI_GUILDPERSONALITYATTRIBUTEVALUE",
            headerText = self.templateData.attributeSelection.personalityHeaderText,
            onSelectionCallback = OnDropdownSelected,
            updateFunction = function(...) SetGuildRecruitmentPersonality(...) end,
            narrationText = self.templateData.attributeSelection.narrationText,
        },
        language =
        {
            attribute = GUILD_META_DATA_ATTRIBUTE_LANGUAGES,
            entryTemplate = self.templateData.attributeSelection.entryTemplate,
            iterBegin = GUILD_LANGUAGE_ATTRIBUTE_VALUE_ITERATION_BEGIN,
            iterEnd = GUILD_LANGUAGE_ATTRIBUTE_VALUE_ITERATION_END,
            extraValues = { GUILD_LANGUAGE_ATTRIBUTE_VALUE_OTHER },
            stringPrefix = "SI_GUILDLANGUAGEATTRIBUTEVALUE",
            headerText = self.templateData.attributeSelection.languageHeaderText,
            onSelectionCallback = OnDropdownSelected,
            updateFunction = function(...) SetGuildRecruitmentLanguage(...) end,
            narrationText = self.templateData.attributeSelection.narrationText,
        },
        recruitmentHeadline =
        {
            attribute = GUILD_META_DATA_ATTRIBUTE_HEADER_MESSAGE,
            entryTemplate = self.templateData.headlineEditBox.entryTemplate,
            dimensionsX = self.templateData.headlineEditBox.dimensionsX,
            dimensionsY = self.templateData.headlineEditBox.dimensionsY,
            headerText = self.templateData.headlineEditBox.headerText,
            defaultText = GetString(SI_GUILD_RECRUITMENT_HEADLINE_DEFAULT_TEXT),
            emptyText = GetString(SI_GUILD_RECRUITMENT_HEADLINE_EMPTY_TEXT),
            stripMarkup = true,
            onEditCallback = OnTextEdited,
            updateFunction = function(...) SetGuildRecruitmentHeaderMessage(...) end,
            narrationText = self.templateData.headlineEditBox.narrationText,
        },
        description =
        {
            attribute =  GUILD_META_DATA_ATTRIBUTE_RECRUITMENT_MESSAGE,
            entryTemplate = self.templateData.descriptionEditBox.entryTemplate,
            dimensionsX = self.templateData.descriptionEditBox.dimensionsX,
            dimensionsY = self.templateData.descriptionEditBox.dimensionsY,
            headerText = self.templateData.descriptionEditBox.headerText,
            defaultText = GetString(SI_GUILD_RECRUITMENT_DESCRIPTION_DEFAULT_TEXT),
            emptyText = GetString(SI_GUILD_RECRUITMENT_DESCRIPTION_EMPTY_TEXT),
            onEditCallback = OnTextEdited,
            updateFunction = function(...) SetGuildRecruitmentRecruitmentMessage(...) end,
            narrationText = self.templateData.descriptionEditBox.narrationText
        },
        roles =
        {
            ordering = ZO_GUILD_FINDER_ROLE_ORDER,
            baseData =
            {
                attribute =  GUILD_META_DATA_ATTRIBUTE_ROLES,
                entryTemplate = self.templateData.roleSelector.entryTemplate,
                dimensionsX = self.templateData.roleSelector.dimensionsX,
                dimensionsY = self.templateData.roleSelector.dimensionsY,
                onSelectionCallback = OnRoleSelected,
                updateFunction = function(...) SetGuildRecruitmentRoleValue(...) end,
                narrationText = self.templateData.roleSelector.narrationText,
            },
            overrideData =
            {
                [LFG_ROLE_TANK] =
                {
                    headerText = self.templateData.roleSelector.headerText,
                },
                [LFG_ROLE_HEAL] =
                {
                    headerText = " ",
                },
                [LFG_ROLE_DPS] =
                {
                    entryTemplate = self.templateData.roleSelector.endEntryTemplate,
                    dimensionsX = self.templateData.roleSelector.endDimensionsX,
                    headerText = " ",
                },
            },
        },
        minimumCP =
        {
            attribute =  GUILD_META_DATA_ATTRIBUTE_MINIMUM_CP,
            entryTemplate = self.templateData.minimumCP.entryTemplate,
            dimensionsX = self.templateData.minimumCP.dimensionsX,
            dimensionsY = self.templateData.minimumCP.dimensionsY,
            headerText = self.templateData.minimumCP.headerText,
            onEditCallback = OnTextEdited,
            defaultText = "0",
            onFocusLostCallback = OnMinCPFocusLost,
            updateFunction = function(guildId, text)
                SetGuildRecruitmentMinimumCP(guildId, tonumber(text) or 0)
            end,
            narrationText = self.templateData.minimumCP.narrationText,
        },
        startTime =
        {
            attribute =  GUILD_META_DATA_ATTRIBUTE_START_TIME,
            entryTemplate = self.templateData.attributeSelection.startTimeEntryTemplate,
            isTimeSelection = true,
            headerText = self.templateData.attributeSelection.timeRangeHeaderText,
            onSelectionCallback = OnDropdownSelected,
            updateFunction = function(...) SetGuildRecruitmentStartTime(...) end,
            narrationText = self.templateData.attributeSelection.narrationText,
        },
        endTime =
        {
            attribute =  GUILD_META_DATA_ATTRIBUTE_END_TIME,
            entryTemplate = self.templateData.attributeSelection.endTimeEntryTemplate,
            isTimeSelection = true,
            headerText = " ",
            onSelectionCallback = OnDropdownSelected,
            updateFunction = function(...) SetGuildRecruitmentEndTime(...) end,
            narrationText = self.templateData.attributeSelection.narrationText,
        },
        activities =
        {
            isChecked = {},
            isDisabled = {},
        }
    }
end
function ZO_GuildRecruitment_GuildListing_Shared:SetGuildId(guildId)
    self.guildId = guildId
    self:RefreshData()
end
function ZO_GuildRecruitment_GuildListing_Shared:RefreshData()
    local guildId = self.guildId
    local recruitmentMessage, headerMessage, recruitmentStatus, primaryFocus, secondaryFocus, personality, language, minimumCP = GetGuildRecruitmentInfo(guildId)
    self.attributeSelectionData.recruitmentStatus.currentValue = recruitmentStatus
    self.attributeSelectionData.primaryFocus.currentValue = primaryFocus
    self.attributeSelectionData.secondaryFocus.currentValue = secondaryFocus
    self.attributeSelectionData.personality.currentValue = personality
    self.attributeSelectionData.language.currentValue = language
    self.attributeSelectionData.recruitmentHeadline.currentValue = headerMessage
    self.attributeSelectionData.description.currentValue = recruitmentMessage
    self.attributeSelectionData.startTime.currentValue = GetGuildRecruitmentStartTime(guildId)
    self.attributeSelectionData.endTime.currentValue = GetGuildRecruitmentEndTime(guildId)
    self.attributeSelectionData.minimumCP.currentValue = minimumCP
    for i = GUILD_ACTIVITY_ATTRIBUTE_VALUE_ITERATION_BEGIN, GUILD_ACTIVITY_ATTRIBUTE_VALUE_ITERATION_END do
        self.attributeSelectionData.activities.isChecked[i] = GetGuildRecruitmentActivityValue(self.guildId, i)
    end
    self.attributeSelectionData.roles.currentValue = {}
    for i, role in ipairs(self.attributeSelectionData.roles.ordering) do
        self.attributeSelectionData.roles.currentValue[role] = GetGuildRecruitmentRoleValue(guildId, role)
    end
    self:BuildGridList()
    self:UpdateAlert()
end
function ZO_GuildRecruitment_GuildListing_Shared:BuildGridList()
    if self.gridList then
        local currentScrollValue = self.gridList:GetScrollValue()
        self.gridList:ClearGridList()
        self.attributeSelectionData.activities.isDisabled = {}
        -- Recruitment Status
        self:BuildAttributeSelectionEntry(self.attributeSelectionData.recruitmentStatus)
        -- Primary Focus
        self:BuildAttributeSelectionEntry(self.attributeSelectionData.primaryFocus)
        -- Secondary Focus
        self:BuildAttributeSelectionEntry(self.attributeSelectionData.secondaryFocus)
        -- Activity Checkboxes
        self:SetDisabledAdditionalActivitiesForFocus(self.attributeSelectionData.primaryFocus.currentValue)
        self:SetDisabledAdditionalActivitiesForFocus(self.attributeSelectionData.secondaryFocus.currentValue)
        self:BuildActivityCheckboxes()
        -- Role Selector
        self:BuildRoleSelectorEntry(self.attributeSelectionData.roles)
        -- Minimum CP
        self:BuildEditBoxEntry(self.attributeSelectionData.minimumCP)
        -- Personality
        self:BuildAttributeSelectionEntry(self.attributeSelectionData.personality)
        -- Language
        self:BuildAttributeSelectionEntry(self.attributeSelectionData.language)
        -- Play Time Range
        self:BuildAttributeSelectionEntry(self.attributeSelectionData.startTime)
        self:BuildAttributeSelectionEntry(self.attributeSelectionData.endTime)
        -- Recruitment Headline
        self:BuildEditBoxEntry(self.attributeSelectionData.recruitmentHeadline)
        -- Guild Description
        self:BuildEditBoxEntry(self.attributeSelectionData.description)
        
        self.gridList:CommitGridList()
        self.gridList:ScrollToValue(currentScrollValue)
    end
end
function ZO_GuildRecruitment_GuildListing_Shared:BuildAttributeSelectionEntry(data)
    data.gridHeaderName = ""
    self.gridList:AddEntry(data, data.entryTemplate)
end
function ZO_GuildRecruitment_GuildListing_Shared:OnActivityCheckboxToggle(attribute, isChecked)
    SetGuildRecruitmentActivityValue(self.guildId, attribute, isChecked)
    self.attributeSelectionData.activities.isChecked[attribute] = isChecked
    self.gridList:RefreshGridList()
    KEYBIND_STRIP:UpdateKeybindButtonGroup(self.keybindStripDescriptor)
end
function ZO_GuildRecruitment_GuildListing_Shared:BuildActivityCheckboxes()
    local attribute = GUILD_META_DATA_ATTRIBUTE_ACTIVITIES
    local headerText = self.templateData.activityCheckbox.headerText
    local narrationText = self.templateData.activityCheckbox.narrationText
    self.attributeSelectionData.activities.entryData = {}
    for i = GUILD_ACTIVITY_ATTRIBUTE_VALUE_ITERATION_BEGIN, GUILD_ACTIVITY_ATTRIBUTE_VALUE_ITERATION_END do
        local data =
        {
            attribute = attribute,
            value = i,
            text = GetString("SI_GUILDACTIVITYATTRIBUTEVALUE", i),
            clickSound = SOUNDS.GAMEPAD_GUILD_FINDER_TOGGLE_ACTIVITY,
            isDisabled = function()
                return self.attributeSelectionData.activities.isDisabled[i]
            end,
            isChecked = function()
                return self.attributeSelectionData.activities.isChecked[i] or self.attributeSelectionData.activities.isDisabled[i]
            end,
            onToggleFunction = function(...) self:OnActivityCheckboxToggle(...) end,
            gridHeaderName = headerText,
            gridHeaderTemplate = self.templateData.headerTemplate,
            narrationText = narrationText,
        }
        if i == GUILD_ACTIVITY_ATTRIBUTE_VALUE_ITERATION_END then
            self.gridList:AddEntry(data, self.templateData.activityCheckbox.endEntryTemplate)
        else
            self.gridList:AddEntry(data, self.templateData.activityCheckbox.entryTemplate)
        end
        self.attributeSelectionData.activities.entryData[i] = data
    end
end
function ZO_GuildRecruitment_GuildListing_Shared:BuildEditBoxEntry(data)
    data.gridHeaderName = ""
    self.gridList:AddEntry(data, data.entryTemplate)
end
function ZO_GuildRecruitment_GuildListing_Shared:BuildRoleSelectorEntry(data)
    for i, role in ipairs(data.ordering) do
        local resultData = ZO_ShallowTableCopy(data.baseData, nil)
        resultData = ZO_ShallowTableCopy(data.overrideData[role], resultData)
        resultData.currentValues = data.currentValue
        resultData.role = role
        self:AddRoleEntry(resultData)
    end
end
function ZO_GuildRecruitment_GuildListing_Shared:AddRoleEntry(data)
    data.gridHeaderName = ""
    self.gridList:AddEntry(data, data.entryTemplate)
end
function ZO_GuildRecruitment_GuildListing_Shared:OnShowing()
    self:RefreshData()
end
function ZO_GuildRecruitment_GuildListing_Shared:OnHidden()
end