Back to Home

ESO Lua File v100031

ingame/guild/guildheraldry_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
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
-----------------------------------
-- GuildHeraldryManager Shared
-----------------------------------
ZO_HERALDRY_CATEGORY_MODE = 1
ZO_HERALDRY_COLOR_MODE = 2
ZO_HERALDRY_BG_STYLE_MODE = 3
ZO_HERALDRY_CREST_STYLE_MODE = 4
ZO_HERALDRY_SKIP_ANIM = true
ZO_HERALDRY_SKIP_SOUND = true
ZO_GuildHeraldryManager_Shared = ZO_Object:Subclass()
function ZO_GuildHeraldryManager_Shared:New(...)
    local manager = ZO_Object.New(self)
    manager:Initialize(...)
    return manager
end
function ZO_GuildHeraldryManager_Shared:Initialize(control, currencyOptions, templateData)
    self.control = control
    self.currencyOptions = currencyOptions
    self.bgStyleCatListControl = self.control:GetNamedChild("BGStyleCategoryList")
    self.crestStyleCatListControl = self.control:GetNamedChild("CrestStyleCategoryList")
    self.pendingTransaction = false
    EVENT_MANAGER:RegisterForEvent("guildHeraldry", EVENT_PLAYER_DEACTIVATED, function(eventCode)
        EndHeraldryCustomization()
    end)
    -- This is platform specific data that needs to be overridden by the inheriting classes as it
    -- specifies the platform specific data to use.
    --[[ Expected values in templateData:
gridListClass - The class object to be use to new the style and color grid lists
styleEntryTemplate - The template to be used a style element
styleEntryWidth - The width of a style element
styleEntryHeight - The height of a style element
styleGridPadding - The offset of between style elements both horizontally and vertically
styleEntrySetup - The function used to setup a style element
styleEntryReset - The function used to reset a style element
styleHasGridHeader - Bool value of if the style section should have a header internal to the grid list
colorEntryTemplate - The template to be used a color element
colorEntryWidth - The width of a color element
colorEntryHeight - The height of a style element
colorEntrySetup - The function used to setup a color element
colorEntryReset - The height of a color element
headerTemplate - The template used for an in-grid header for both style and color
headerHeight - The height of the header template
]]
    self.templateData = templateData
    self.styleGridListControl = self.control:GetNamedChild("StylePane")
    self.colorGridListControl = self.control:GetNamedChild("ColorPane")
end
local function EqualityFunction(leftData, rightData)
    return leftData.categoryIndex == rightData.categoryIndex and leftData.categoryName == rightData.categoryName
end
function ZO_GuildHeraldryManager_Shared:InitializeStyleCategoryLists(scrollList, scrollListTemplate)
    local function SetupFunction(control, data, selected, selectedDuringRebuild, enabled)
        control:SetHidden(false)
        control:SetTexture(data.icon)
        control.categoryIndex = data.categoryIndex
        control.categoryName = data.categoryName
        if selected then
            self:SetViewedStyleCategory(data.categoryIndex)
            data.categoryList.selectedLabel:SetText(data.categoryName)
        end
    end
    local SHOWN_CATEGORIES = 5
    local MIN_SCALE = .6
    local MAX_SCALE = 1.0
    self.bgStyleCatList = scrollList:New(self.bgStyleCatListControl, scrollListTemplate, SHOWN_CATEGORIES, SetupFunction, EqualityFunction)
    self.bgStyleCatList:SetScaleExtents(MIN_SCALE, MAX_SCALE)
    self.bgStyleCatList.selectedLabel = GetControl(self.bgStyleCatListControl, "SelectedLabel")
    self.crestStyleCatList = scrollList:New(self.crestStyleCatListControl, scrollListTemplate, SHOWN_CATEGORIES, SetupFunction, EqualityFunction)
    self.crestStyleCatList:SetScaleExtents(MIN_SCALE, MAX_SCALE)
    self.crestStyleCatList.selectedLabel = GetControl(self.crestStyleCatListControl, "SelectedLabel")
end
function ZO_GuildHeraldryManager_Shared:PopulateStyleCategoryLists()
    self.bgStyleCatList:Clear()
    for i = 1, GetNumHeraldryBackgroundCategories() do
        local catName, upIcon = GetHeraldryBackgroundCategoryInfo(i)
        local data = { categoryName = catName, icon = upIcon, categoryIndex = i, categoryList = self.bgStyleCatList }
        self.bgStyleCatList:AddEntry(data)
    end
    self.bgStyleCatList:Commit()
    self.crestStyleCatList:Clear()
    for i = 1, GetNumHeraldryCrestCategories() do
        local catName, icon = GetHeraldryCrestCategoryInfo(i)
        local data = { categoryName = catName, icon = icon, categoryIndex = i, categoryList = self.crestStyleCatList }
        self.crestStyleCatList:AddEntry(data)
    end
    self.crestStyleCatList:Commit()
end
function ZO_GuildHeraldryManager_Shared:InitializeStyleGridList()
    local templateData = self.templateData
    self.styleGridList = templateData.gridListClass:New(self.styleGridListControl)
    local NO_HIDE_CALLBACK = nil
    self.styleGridList:AddEntryTemplate(templateData.styleEntryTemplate, templateData.styleEntryWidth, templateData.styleEntryHeight, templateData.styleEntrySetup, NO_HIDE_CALLBACK, templateData.styleEntryReset, templateData.styleGridPadding, templateData.styleGridPadding)
    self.styleGridList:AddHeaderTemplate(templateData.headerTemplate, templateData.headerHeight, ZO_DefaultGridTileHeaderSetup)
end
function ZO_GuildHeraldryManager_Shared:InitializeColorGridList()
    local templateData = self.templateData
    self.colorGridList = templateData.gridListClass:New(self.colorGridListControl)
    local NO_HIDE_CALLBACK = nil
    local GRID_PADDING = 0
    local CENTER_ENTRIES = true
    self.colorGridList:AddEntryTemplate(templateData.colorEntryTemplate, templateData.colorEntryWidth, templateData.colorEntryHeight, templateData.colorEntrySetup, NO_HIDE_CALLBACK, templateData.colorEntryReset, GRID_PADDING, GRID_PADDING, CENTER_ENTRIES)
    self.colorGridList:AddHeaderTemplate(templateData.headerTemplate, templateData.headerHeight, ZO_DefaultGridTileHeaderSetup)
end
function ZO_GuildHeraldryManager_Shared:InitializeColorCategories()
    self.colorListsByCategory = {}
    for hueCategory = DYE_HUE_CATEGORY_ITERATION_BEGIN, DYE_HUE_CATEGORY_ITERATION_END do
        self.colorListsByCategory[hueCategory] = {}
    end
    
    for i = 1, GetNumHeraldryColors() do
        local colorName, hueCategory, r, g, b, sortKey = GetHeraldryColorInfo(i)
        local data =
        {
            colorIndex = i,
            dyeName = colorName,
            hueCategory = hueCategory,
            known = true,
            r = r,
            g = g,
            b = b,
            sortKey = sortKey,
        }
        table.insert(self.colorListsByCategory[hueCategory], data)
    end
    for hueCategory = DYE_HUE_CATEGORY_ITERATION_BEGIN, DYE_HUE_CATEGORY_ITERATION_END do
        table.sort(self.colorListsByCategory[hueCategory], ZO_Dyeing_DyeSortComparator)
    end
    self.sortedColorList = {}
    for sortStyleCategory, colors in pairs(self.colorListsByCategory) do
        for _, color in ipairs(colors) do
            color.categoryOrder = sortStyleCategory
            table.insert(self.sortedColorList, color)
        end
    end
    table.sort(self.sortedColorList, ZO_DyeSwatchesGridSort)
end
function ZO_GuildHeraldryManager_Shared:BuildStyleGridList()
    self.styleGridList:ClearGridList()
    if(self.mode == ZO_HERALDRY_BG_STYLE_MODE or self.mode == ZO_HERALDRY_CREST_STYLE_MODE) and self.activeData then
        local templateData = self.templateData
        -- Iterate through styles and create each style
        local selectedStyle = self.activeData.getSelectedStyle()
        local viewingSelectedCategory = self.activeData.getSelectedCategory() == self.activeData.getViewCategory()
        for i = 1, self.activeData.getNum() do
            local gridHeaderName = ""
            if self.activeData.mode == ZO_HERALDRY_BG_STYLE_MODE then
                gridHeaderName = GetString(SI_GUILD_HERALDRY_PATTERN_HEADER)
            elseif self.activeData.mode == ZO_HERALDRY_CREST_STYLE_MODE then
                gridHeaderName = GetString(SI_GUILD_HERALDRY_DESIGN_HEADER)
            end
            if not templateData.styleHasGridHeader and self.stylesHeader then
                self.stylesHeader:SetText(gridHeaderName)
                gridHeaderName = ""
            end
            local styleName, icon = self.activeData.getInfo(i)
            local data =
            {
                index = i,
                styleName = styleName,
                icon = icon,
                checked = viewingSelectedCategory and i == selectedStyle,
                gridHeaderName = gridHeaderName,
                gridHeaderTemplate = templateData.headerTemplate
            }
            self.styleGridList:AddEntry(data, templateData.styleEntryTemplate)
        end
        self.styleGridList:CommitGridList()
    end
end
function ZO_GuildHeraldryManager_Shared:BuildColorGridList()
    self.colorGridList:ClearGridList()
    if self.mode == ZO_HERALDRY_COLOR_MODE and self.activeData then
        local templateData = self.templateData
        local tempTable = {}
        local selectedData = nil
        for i, color in ipairs(self.sortedColorList) do
            color.checked = false
            local swatchObject = ZO_DyeingSwatch_Shared:New(self)
            swatchObject:SetDataSource(color)
            swatchObject.gridHeaderName = GetString("SI_DYEHUECATEGORY", color.categoryOrder)
            swatchObject.gridHeaderTemplate = templateData.headerTemplate
            swatchObject.color = ZO_ColorDef:New(color.r, color.g, color.b)
            if self.activeData and color.colorIndex == self.activeData.getSelectedColorIndex() then
                color.checked = true
                selectedData = swatchObject
            end
            self.colorGridList:AddEntry(swatchObject, templateData.colorEntryTemplate)
        end
        self.colorGridList:CommitGridList()
        if selectedData then
            local NO_CALLBACK = nil
            local ANIMATE_INSTANTLY = true
            self.colorGridList:ScrollDataToCenter(selectedData, NO_CALLBACK, ANIMATE_INSTANTLY)
        end
    end
end
function ZO_GuildHeraldryManager_Shared:OnCategorySelected(data)
    local oldData = self.activeData
    self.activeData = data
    if self.initialized then
        if oldData and (oldData ~= data) and oldData.changed then
            oldData.changed(oldData, data)
        end
        if self.panelNameLabel then
            self.panelNameLabel:SetText(data.name)
        end
        self:SwitchMode(data.mode)
        if data.resetToSelectedCategory then
            data.resetToSelectedCategory()
        end
        data.layout()
    end
end
function ZO_GuildHeraldryManager_Shared:SelectColor(colorIndex, becauseOfRebuild)
    local selectedColorIndex = self.activeData.getSelectedColorIndex()
    if selectedColorIndex ~= colorIndex or becauseOfRebuild then
        local colorDataList = self.colorGridList:GetData()
        for i, entryData in ipairs(colorDataList) do
            if not entryData.data.header and entryData.data.lineBreakAmount == nil then
                local selected = false
                local data = entryData.data:GetDataSource()
                if data.colorIndex == colorIndex then
                    selected = true
                end
                data.checked = selected
                self:SetEntryDataSelected(entryData, selected)
            end
        end
        self.activeData.setSelectedColorIndex(colorIndex)
        self.colorGridList:RefreshGridList()
        if not becauseOfRebuild then
            self:SetPendingIndices()
        end
    end
end
function ZO_GuildHeraldryManager_Shared:SetSelectedHeraldryIndices()
    self.selectedBackgroundCategory, self.selectedBackgroundStyle, self.selectedBackgroundPrimaryColor, self.selectedBackgroundSecondaryColor, self.selectedCrestCategory, self.selectedCrestStyle, self.selectedCrestColor = GetPendingHeraldryIndices()
    self.viewBackgroundCategory = self.selectedBackgroundCategory
    self.viewCrestCategory = self.selectedCrestCategory
    self.bgStyleCatList:SetSelectedDataIndex(self.selectedBackgroundCategory)
    self.crestStyleCatList:SetSelectedDataIndex(self.selectedCrestCategory)
end
function ZO_GuildHeraldryManager_Shared:SetGuildId(guildId)
    if self.guildId ~= guildId then
        self.guildId = guildId
        if SCENE_MANAGER:IsShowing("guildHeraldry") then
            EndHeraldryCustomization()
            StartHeraldryCustomization(guildId)
        end
    end
end
function ZO_GuildHeraldryManager_Shared:IsEnabled()
    return IsPlayerAllowedToEditHeraldry(self.guildId)
end
function ZO_GuildHeraldryManager_Shared:SetViewedStyleCategory(index)
    self.activeData.setViewCategory(index)
    self.activeData.layout()
end
function ZO_GuildHeraldryManager_Shared:SetSelectedStyleCategory(index)
    self.activeData.setSelectedCategory(index)
end
function ZO_GuildHeraldryManager_Shared:SetPendingIndices()
        self.selectedBackgroundCategory, self.selectedBackgroundStyle, self.selectedBackgroundPrimaryColor, self.selectedBackgroundSecondaryColor,
        self.selectedCrestCategory, self.selectedCrestStyle, self.selectedCrestColor
    )
end
function ZO_GuildHeraldryManager_Shared:IsViewingStyleCategoryWithSelection()
    if self.activeData and self.activeData.mode ~= ZO_HERALDRY_COLOR_MODE then
        return self.activeData.getViewCategory() == self.activeData.getSelectedCategory()
    end
    return false
end
function ZO_GuildHeraldryManager_Shared:SelectStyle(styleIndex, becauseOfRebuild)
    local previouslySelectedIndex = self.activeData.getSelectedStyle()
    if becauseOfRebuild or not self:IsViewingStyleCategoryWithSelection() or previouslySelectedIndex ~= styleIndex then
        local styleDataList = self.styleGridList:GetData()
        for i, entryData in ipairs(styleDataList) do
            if not entryData.data.header then
                local data = entryData.data
                data.checked = data.index == styleIndex
            end
        end
        self.activeData.setSelectedCategory(self.activeData.getViewCategory())
        self.activeData.setSelectedStyle(styleIndex)
        self.styleGridList:RefreshGridList()
        if not becauseOfRebuild then
            self:SetPendingIndices()
        end
    end
end
function ZO_GuildHeraldryManager_Shared:CanSave()
end
function ZO_GuildHeraldryManager_Shared:SetPendingExit(isPendingExit)
    self.isPendingExit = isPendingExit
end
function ZO_GuildHeraldryManager_Shared:IsPendingExit()
    return self.isPendingExit
end
function ZO_GuildHeraldryManager_Shared:IsCurrentBlockingScene()
    return false -- May be overridden
end
function ZO_GuildHeraldryManager_Shared:AttemptSaveIfBlocking(showBaseScene)
    local attemptedSave = false
    if self:IsCurrentBlockingScene() then
        self:AttemptSaveAndExit(showBaseScene)
        attemptedSave = true
    end
    return attemptedSave
end
function ZO_GuildHeraldryManager_Shared:AttemptPromptSaveWarning()
    if HasPendingHeraldryChanges() then
        self:SetPendingExit(true)
        if not IsCreatingHeraldryForFirstTime() then
            local pendingCost = GetPendingHeraldryCost()
            local heraldryFunds = GetHeraldryGuildBankedMoney()
            if heraldryFunds and pendingCost <= heraldryFunds then
                self:ConfirmHeraldryApplyChanges()
                return true
            end
        end
    end
    return false
end
function ZO_GuildHeraldryManager_Shared:AttemptSaveAndExit(showBaseScene)
    if not self:AttemptPromptSaveWarning() then
        self:ConfirmExit(showBaseScene)
    end
end
function ZO_GuildHeraldryManager_Shared:OnConfirmHideScene(scene, nextSceneName, bypassHideSceneConfirmationReason)
    if bypassHideSceneConfirmationReason == nil then
        if self:AttemptPromptSaveWarning() then
            return
        end
    end
    scene:AcceptHideScene()
end
function ZO_GuildHeraldryManager_Shared:ConfirmExit(showBaseScene)
    -- Should be overridden by child classes
end
function ZO_GuildHeraldryManager_Shared:CancelExit()
    -- Should be overridden by child classes
end
function ZO_GuildHeraldryManager_Shared:NoChoiceExitCallback()
    -- Should be overridden by child classes
end
function ZO_GuildHeraldryManager_Shared:SwitchMode(mode)
    if self.mode ~= mode then
        self.mode = mode
        if mode == ZO_HERALDRY_COLOR_MODE then
            self.bgStyleCatListControl:SetHidden(true)
            self.crestStyleCatListControl:SetHidden(true)
            self.styleGridListControl:SetHidden(true)
            self.colorGridListControl:SetHidden(false)
            self:BuildColorGridList()
        elseif mode == ZO_HERALDRY_BG_STYLE_MODE then
            self.bgStyleCatListControl:SetHidden(false)
            self.crestStyleCatListControl:SetHidden(true)
            self.styleGridListControl:SetHidden(false)
            self.colorGridListControl:SetHidden(true)
            self:BuildStyleGridList()
        elseif mode == ZO_HERALDRY_CREST_STYLE_MODE then
            self.bgStyleCatListControl:SetHidden(true)
            self.crestStyleCatListControl:SetHidden(false)
            self.styleGridListControl:SetHidden(false)
            self.colorGridListControl:SetHidden(true)
            self:BuildStyleGridList()
        else
            self.bgStyleCatListControl:SetHidden(true)
            self.crestStyleCatListControl:SetHidden(true)
            self.styleGridListControl:SetHidden(true)
            self.colorGridListControl:SetHidden(true)
            self:BuildColorGridList()
        end
    end
end
function ZO_GuildHeraldryManager_Shared:SetEntryDataSelected(entryData, selected)
    -- To be overridden
end
--[[
Dialog functions.
--]]
function ZO_GuildHeraldryManager_Shared:GetPurchaseDialogName()
    -- Must be overridden
    assert(false)
end
function ZO_GuildHeraldryManager_Shared:GetApplyChangesDialogName()
    -- Must be overridden
    assert(false)
end
local function SetupHeraldryDialog(control)
end
function ZO_GuildHeraldryManager_Shared:PurchaseHeraldryDialogInitialize(control)
        return
    end
    {
        customControl = control,
        setup = SetupHeraldryDialog,
        gamepadInfo =
        {
            dialogType = GAMEPAD_DIALOGS.BASIC,
        },
        title =
        {
            text = SI_GUILD_HERALDRY_DIALOG_PURCHASE_TITLE,
        },
        mainText = 
        {
            text = SI_GUILD_HERALDRY_DIALOG_PURCHASE_DESCRIPTION,
        },
        buttons =
        {
            {
                keybind =   "DIALOG_PRIMARY",
                control =   control and GetControl(control, "Accept"),
                text =      SI_DIALOG_ACCEPT,
                callback =  function(dialog)
                    ApplyPendingHeraldryChanges()
                    dialog.data.owner.pendingTransaction = true
                end,
            },
            {
                keybind =   "DIALOG_NEGATIVE",
                control =   control and GetControl(control, "Cancel"),
                text =      SI_DIALOG_CANCEL,
                callback =  function(dialog)
                    -- Do nothing
                end,
            },
        }
    })
end
function ZO_GuildHeraldryManager_Shared:ApplyChangesHeraldryDialogInitialize(control)
        return
    end
    {
        customControl = control,
        setup = SetupHeraldryDialog,
        gamepadInfo =
        {
            dialogType = GAMEPAD_DIALOGS.BASIC,
        },
        title =
        {
            text = SI_GUILD_HERALDRY_DIALOG_APPLY_CHANGES_TITLE,
        },
        mainText = 
        {
            text =  function()
                local textValue
                if self:IsPendingExit() then
                    textValue = SI_GUILD_HERALDRY_DIALOG_APPLY_CHANGES_PENDING_EXIT_DESCRIPTION
                else
                    textValue = SI_GUILD_HERALDRY_DIALOG_APPLY_CHANGES_DESCRIPTION
                end
                return textValue
            end,
        },
        noChoiceCallback =  function()
            if self:IsPendingExit() then
                self:NoChoiceExitCallback()
            end
        end,
        buttons =
        {
            {
                keybind =   "DIALOG_PRIMARY",
                control =   control and GetControl(control, "Accept"),
                text =      SI_GUILD_HERALDRY_DIALOG_ACCEPT,
                callback =  function(dialog)
                    ApplyPendingHeraldryChanges()
                    dialog.data.owner.pendingTransaction = true
                    if self:IsPendingExit() then
                        self:ConfirmExit()
                    end
                end,
            },
            {
                keybind =   "DIALOG_NEGATIVE",
                control =   control and GetControl(control, "Cancel"),
                text =      SI_GUILD_HERALDRY_DIALOG_CANCEL,
                callback =  function(dialog)
                    if self:IsPendingExit() then
                        self:ConfirmExit()
                    end
                end,
            },
            {
                keybind =   "DIALOG_TERTIARY",
                control =   control and GetControl(control, "Return"),
                text =      SI_GAMEPAD_GUILD_HERALDRY_CANCEL_EXIT,
                callback =  function(dialog)
                    self:CancelExit()
                end,
                visible =   function()
                    return IsInGamepadPreferredMode() and self:IsPendingExit()
                end,
            },
        }
    })
end
function ZO_GuildHeraldryManager_Shared:ConfirmHeraldryPurchase(control, showDialogFunc)
    if not self.m_purchaseHeraldryDialog then
        self.m_purchaseHeraldryDialog = true
    end
    local data = { owner = self }
end
function ZO_GuildHeraldryManager_Shared:ConfirmHeraldryApplyChanges(control, showDialogFunc)
    if not self.m_applyChangesHeraldryDialog then
        self.m_applyChangesHeraldryDialog = true
    end
    local data = { owner = self }
end
--[[
Global XML.
--]]
    local swatchObject = swatchControl.object
    if swatchObject then
        swatchObject.mousedOver = true
        swatchObject:UpdateSelectedState()
    end
end
    local swatchObject = swatchControl.object
    if swatchObject then
        swatchObject.mousedOver = false
        swatchObject:UpdateSelectedState()
    end
end