Back to Home

ESO Lua File v101041

ingame/dyeing/gamepad/dyeing_common_gamepad.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
ZO_DYEING_HIGHLIGHT_OFFSET_GAMEPAD_X = 3
ZO_DYEING_HIGHLIGHT_OFFSET_GAMEPAD_Y = 4
ZO_DYEING_OUTFIT_SWATCH_CHANGED_COLOR = ZO_ColorDef:New("58a7a7")
function ZO_Dyeing_Gamepad_Highlight(control, dyeControl, offsetX, offsetY)
    local sharedHighlight = control.highlight
    offsetX = offsetX or ZO_DYEING_HIGHLIGHT_OFFSET_GAMEPAD_X
    offsetY = offsetY or ZO_DYEING_HIGHLIGHT_OFFSET_GAMEPAD_Y
    local selected = false
    if dyeControl then
        sharedHighlight:ClearAnchors()
        sharedHighlight:SetParent(dyeControl)
        sharedHighlight:SetAnchor(TOPLEFT, dyeControl, TOPLEFT, -offsetX, -offsetY)
        sharedHighlight:SetAnchor(BOTTOMRIGHT, dyeControl, BOTTOMRIGHT, offsetX, offsetY)
        selected = true
    end
    sharedHighlight:SetHidden(not selected)
end
function ZO_Dyeing_Gamepad_SavedSet_Highlight(control, savedSetControl)
    ZO_Dyeing_Gamepad_Highlight(control, savedSetControl, ZO_DYEING_HIGHLIGHT_OFFSET_GAMEPAD_X * 3, ZO_DYEING_HIGHLIGHT_OFFSET_GAMEPAD_Y * 2)
end
    for _, highlight in ipairs(control.dyeHighlightControls) do
        highlight:SetHidden(false)
    end
end
    for channel, highlight in ipairs(control.dyeHighlightControls) do
        highlight:SetHidden(channel ~= dyeChannel)
    end
end
    for _, highlight in ipairs(control.dyeHighlightControls) do
        highlight:SetHidden(true)
    end
end
    for channel, swatchControl in ipairs(control.dyeControls) do
        if swatchControl.dyeChangedControl then 
            if channel == dyeChannel then
                swatchControl.dyeChangedControl:SetColor(ZO_DEFAULT_ENABLED_COLOR:UnpackRGB())
            else
                swatchControl.dyeChangedControl:SetColor(ZO_DYEING_OUTFIT_SWATCH_CHANGED_COLOR:UnpackRGB())
            end
        end
    end
end
    for channel, swatchControl in ipairs(control.dyeControls) do
        if swatchControl.dyeChangedControl then 
            swatchControl.dyeChangedControl:SetColor(ZO_DYEING_OUTFIT_SWATCH_CHANGED_COLOR:UnpackRGB())
        end
    end
end
    for channel, swatchControl in ipairs(control.dyeControls) do
        if swatchControl.dyeChangedControl then 
            swatchControl.dyeChangedControl:SetColor(ZO_DEFAULT_ENABLED_COLOR:UnpackRGB())
        end
    end
end
-- XML functions --
    control.dyeHighlightControls =
    {
        control:GetNamedChild("PrimaryHighlight"),
        control:GetNamedChild("SecondaryHighlight"),
        control:GetNamedChild("AccentHighlight"),
    }
end