Back to Home

ESO Lua File v100034

ingame/guildfinder/keyboard/guildrecruitment_activitycheckboxtile_keyboard.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
------------------
-- Guild Finder --
------------------
ZO_GUILD_RECRUITMENT_GUILD_LISTING_KEYBOARD_CHECKBOX_HEIGHT = 28
ZO_GUILD_RECRUITMENT_GUILD_LISTING_KEYBOARD_CHECKBOX_END_HEIGHT = 33
-- Primary logic class must be subclassed after the platform class so that platform specific functions will have priority over the logic class functionality
ZO_GuildRecruitment_ActivityCheckboxTile_Keyboard = ZO_Object.MultiSubclass(ZO_Tile_Keyboard, ZO_Tile)
function ZO_GuildRecruitment_ActivityCheckboxTile_Keyboard:New(...)
    return ZO_Tile.New(self, ...)
end
function ZO_GuildRecruitment_ActivityCheckboxTile_Keyboard:PostInitializePlatform()
    ZO_Tile_Keyboard.PostInitializePlatform(self)
    self.checkButton = self.control:GetNamedChild("Check")
end
function ZO_GuildRecruitment_ActivityCheckboxTile_Keyboard:Layout(data)
    ZO_Tile.Layout(self, data)
    self.data = data
    local isChecked = self:GetIsChecked()
    local function OnCheckboxToggled()
        isChecked = ZO_CheckButton_IsChecked(self.checkButton)
        if data.onToggleFunction then
            data.onToggleFunction(self.data.value, isChecked)
        end
    end
    ZO_CheckButton_SetCheckState(self.checkButton, isChecked)
    ZO_CheckButton_SetLabelText(self.checkButton, data.text)
    if self:GetIsDisabled() then
        ZO_CheckButton_Disable(self.checkButton)
    else
        ZO_CheckButton_Enable(self.checkButton)
    end
end
function ZO_GuildRecruitment_ActivityCheckboxTile_Keyboard:GetIsChecked()
    if type(self.data.isChecked) == "function" then
        return self.data.isChecked()
    end
    return self.data.isChecked
end
function ZO_GuildRecruitment_ActivityCheckboxTile_Keyboard:GetIsDisabled()
    if type(self.data.isDisabled) == "function" then
        return self.data.isDisabled()
    end
    return self.data.isDisabled
end
-- XML functions
----------------
    ZO_GuildRecruitment_ActivityCheckboxTile_Keyboard:New(control)
end