Back to Home

ESO Lua File v100029

ingame/guildkiosk/guildkiosk_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
ZO_PURCHASE_KIOSK_INTERACTION =
{
    type = "Purchase Kiosk",
    interactTypes = { INTERACTION_GUILDKIOSK_PURCHASE },
}
ZO_BID_ON_KIOSK_INTERACTION =
{
    type = "Bid On Kiosk",
    interactTypes = { INTERACTION_GUILDKIOSK_BID },
}
ZO_GuildKiosk_Purchase_Shared = ZO_Object:Subclass()
function ZO_GuildKiosk_Purchase_Shared:New(...)
    local purchase = ZO_Object.New(self)
    purchase:Initialize(...)
    return purchase
end
function ZO_GuildKiosk_Purchase_Shared:Initialize()
    local function OnGuildKioskConsiderPurchaseStart()
        SYSTEMS:GetObject("guildKioskPurchase"):OnGuildKioskConsiderPurchaseStart()
    end
    local function OnGuildKioskConsiderPurchaseStop()
        SYSTEMS:GetObject("guildKioskPurchase"):OnGuildKioskConsiderPurchaseStop()
    end
    EVENT_MANAGER:RegisterForEvent("guildKioskPurchaseShared", EVENT_GUILD_KIOSK_CONSIDER_PURCHASE_START, OnGuildKioskConsiderPurchaseStart)
    EVENT_MANAGER:RegisterForEvent("guildKioskPurchaseShared", EVENT_GUILD_KIOSK_CONSIDER_PURCHASE_STOP, OnGuildKioskConsiderPurchaseStop)
end
ZO_GUILD_KIOSK_PURCHASE_SHARED = ZO_GuildKiosk_Purchase_Shared:New()
local g_nextPurchaseUpdate = nil
function ZO_GuildKiosk_Purchase_OnUpdate(descriptionLabel, gameTimeSecs)    
    if(g_nextPurchaseUpdate == nil or gameTimeSecs >= g_nextPurchaseUpdate) then
        g_nextPurchaseUpdate = gameTimeSecs + 1
        local secsRemaining = GetKioskBidWindowSecondsRemaining()
        local ownershipDuration = ZO_FormatTimeLargestTwo(secsRemaining, TIME_FORMAT_STYLE_DESCRIPTIVE)
        descriptionLabel:SetText(zo_strformat(SI_GUILD_KIOSK_PURCHASE_DESCRIPTION, ownershipDuration))
    end
end
ZO_GuildKiosk_Bid_Shared = ZO_Object:Subclass()
function ZO_GuildKiosk_Bid_Shared:New(...)
    local bid = ZO_Object.New(self)
    bid:Initialize(...)
    return bid
end
function ZO_GuildKiosk_Bid_Shared:Initialize()
    local function OnGuildKioskConsiderBidStart()
        SYSTEMS:GetObject("guildKioskBid"):OnGuildKioskConsiderBidStart()
    end
    local function OnGuildKioskConsiderBidStop()
        SYSTEMS:GetObject("guildKioskBid"):OnGuildKioskConsiderBidStop()
    end
    EVENT_MANAGER:RegisterForEvent("guildKioskBidShared", EVENT_GUILD_KIOSK_CONSIDER_BID_START, function() OnGuildKioskConsiderBidStart() end)
    EVENT_MANAGER:RegisterForEvent("guildKioskBidShared", EVENT_GUILD_KIOSK_CONSIDER_BID_STOP, function() OnGuildKioskConsiderBidStop() end)
end
function ZO_GuildKiosk_Bid_Shared.GetBidActionText(hasBidOnThisTraderAlready)
    if hasBidOnThisTraderAlready then
        return GetString(SI_GUILD_KIOSK_UPDATE_BID)
    else
        return GetString(SI_GUILD_KIOSK_INITIAL_BID)
    end
end
ZO_GUILD_KIOSK_BID_SHARED = ZO_GuildKiosk_Bid_Shared:New()