Back to Home

ESO Lua File v100018

ingameshared/marketcurrency/gamepad/marketcurrency_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
ZO_MarketCurrency_Gamepad = ZO_Object.MultiSubclass(ZO_MarketCurrency_Shared, ZO_CallbackObject)
local MARKET_BUY_CROWNS_BUTTON =
{
    alignment = KEYBIND_STRIP_ALIGN_RIGHT,
    gamepadOrder = 1,
    name = GetString(SI_MARKET_BUY_CROWNS),
    keybind = "UI_SHORTCUT_SECONDARY",
}
function ZO_MarketCurrency_Gamepad:New(...)
    local marketCurrency = ZO_CallbackObject.New(self)
    marketCurrency:Initialize(...)
    return marketCurrency
end
function ZO_MarketCurrency_Gamepad:Initialize(control)
    ZO_MarketCurrency_Shared.Initialize(self, control)
    MARKET_CURRENCY_GAMEPAD_FRAGMENT = ZO_FadeSceneFragment:New(control)
end
function ZO_MarketCurrency_Gamepad:InitializeControls()
    self.crownAmountControl = self.control:GetNamedChild("CrownsAmount")
    self.gemAmountControl = self.control:GetNamedChild("GemsAmount")
end
function ZO_MarketCurrency_Gamepad:GetBuyCrownsKeybind(keybind)
    local keybindInfo = ZO_ShallowTableCopy(MARKET_BUY_CROWNS_BUTTON)
    if keybind then
        keybindInfo.keybind = keybind
    end
    return keybindInfo
end
function ZO_MarketCurrency_Gamepad:Show()
    self.control:SetHidden(false)
end
function ZO_MarketCurrency_Gamepad:Hide()
    self.control:SetHidden(true)
end
function ZO_MarketCurrency_Gamepad:OnCrownsUpdated(currentCurrency, difference)
    self.crownAmountControl:SetText(ZO_CommaDelimitNumber(currentCurrency))
    self:FireCallbacks("OnCurrencyUpdated")
end
function ZO_MarketCurrency_Gamepad:OnCrownGemsUpdated(currentCurrency, difference)
    self.gemAmountControl:SetText(ZO_CommaDelimitNumber(currentCurrency))
    self:FireCallbacks("OnCurrencyUpdated")
end
function ZO_MarketCurrency_Gamepad:ModifyKeybindStripStyleForCurrency(originalStyle)
    local style = ZO_ShallowTableCopy(originalStyle)
    local crownsFooterWidth = self.control:GetWidth()
    style.rightAnchorOffset = -(crownsFooterWidth + ZO_GAMEPAD_SCREEN_PADDING)
    return style
end
    MARKET_CURRENCY_GAMEPAD = ZO_MarketCurrency_Gamepad:New(control)
end