Back to Home

ESO Lua File v100027

pregame/charactercreate/zo_charactercreatebucket_base.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
--[[ Character Creation Bucket]]--
ZO_CharacterCreateBucket_Base = ZO_Object:Subclass()
function ZO_CharacterCreateBucket_Base:New(...)
    local bucket = ZO_Object.New(self)
    bucket:Initialize(...)
    return bucket
end
function ZO_CharacterCreateBucket_Base:Initialize(parent, bucketCategory, manager)
    self.parent = parent
    self.category = bucketCategory
    self.manager = manager
    self.expanded = false
    self.controlData = {}
end
function ZO_CharacterCreateBucket_Base:GetContainer()
    return self.container
end
function ZO_CharacterCreateBucket_Base:GetScrollChild()
    return self.scrollChild
end
function ZO_CharacterCreateBucket_Base:UpdateControlsFromData()
    for control, data in pairs(self.controlData) do
        if data.updateFn then
            data.updateFn(control)
        end
    end
end
function ZO_CharacterCreateBucket_Base:RandomizeAppearance(randomizeType)
    for control, data in pairs(self.controlData) do
        if data.randomizeFn then
            data.randomizeFn(control, randomizeType)
        end
    end
end
--[[ Character Creation Bucket Manager ]]--
ZO_CharacterCreateBucketManager_Base = ZO_Object:Subclass()
function ZO_CharacterCreateBucketManager_Base:New(...)
    local manager = ZO_Object.New(self)
    manager:Initialize(...)
    return manager
end
function ZO_CharacterCreateBucketManager_Base:Initialize(container, bucketCategories)
    self.buckets = {}
    self.container = container
    self.currentBucket = nil
    for i, bucketCategory in ipairs(bucketCategories) do
        self:AddBucket(bucketCategory)
    end
end
function ZO_CharacterCreateBucketManager_Base:BucketForCategory(category)
    return self.buckets[category]
end
function ZO_CharacterCreateBucketManager_Base:BucketForChildControl(control)
    return control.bucket
end
function ZO_CharacterCreateBucketManager_Base:Reset()
    for _, bucket in pairs(self.buckets) do
        bucket:Reset()
    end
end
function ZO_CharacterCreateBucketManager_Base:AddControl(control, category, updateFn, randomizeFn, subCategoryId)
    local bucket = self:BucketForCategory(category)
    if bucket then
        bucket:AddControl(control, updateFn, randomizeFn, subCategoryId)
    end
end
function ZO_CharacterCreateBucketManager_Base:RemoveControl(control)
    local bucket = control.bucket
    if bucket then
        bucket:RemoveControl(control)
    end
end
function ZO_CharacterCreateBucketManager_Base:UpdateControlsFromData()
    for _, bucket in pairs(self.buckets) do
        bucket:UpdateControlsFromData()
    end
end
function ZO_CharacterCreateBucketManager_Base:RandomizeAppearance(randomizeType)
    for _, bucket in pairs(self.buckets) do
        bucket:RandomizeAppearance(randomizeType)
    end
end