Back to Home

ESO Lua File v101039

ingame/help/keyboard/helpcharacterstuck_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
local HelpCharacterStuck_Keyboard = ZO_HelpScreenTemplate_Keyboard:Subclass()
function HelpCharacterStuck_Keyboard:Initialize(control)
     HELP_CUSTOMER_SERVICE_CHARACTER_STUCK_KEYBOARD_FRAGMENT = ZO_FadeSceneFragment:New(control)
     control:RegisterForEvent(EVENT_STUCK_COMPLETE, function() SCENE_MANAGER:Hide("helpCustomerSupport") end)
    HELP_CUSTOMER_SERVICE_CHARACTER_STUCK_KEYBOARD_FRAGMENT:RegisterCallback("StateChange", function(oldState, newState)
                                                                                if newState == SCENE_SHOWING then
                                                                                     self:UpdateCost()
                                                                                end
                                                            end)
     local iconData =
     {
          name = GetString(SI_CUSTOMER_SERVICE_CHARACTER_STUCK),
          categoryFragment = HELP_CUSTOMER_SERVICE_CHARACTER_STUCK_KEYBOARD_FRAGMENT,
        up = "EsoUI/Art/Help/help_tabIcon_stuck_up.dds",
        down = "EsoUI/Art/Help/help_tabIcon_stuck_down.dds",
        over = "EsoUI/Art/Help/help_tabIcon_stuck_over.dds",
     }
     ZO_HelpScreenTemplate_Keyboard.Initialize(self, control, iconData)
     self.helpStuckCost = self.control:GetNamedChild("Cost")
end
function HelpCharacterStuck_Keyboard:UpdateCost()
     local cost = zo_min(GetRecallCost(), GetCurrencyAmount(CURT_MONEY, CURRENCY_LOCATION_CHARACTER))
       local DONT_USE_SHORT_FORMAT = false
     local costText = ZO_CurrencyControl_FormatCurrencyAndAppendIcon(cost, DONT_USE_SHORT_FORMAT, CURT_MONEY)
    local text
        local telvarLossPercentage = zo_floor(GetTelvarStonePercentLossOnNonPvpDeath() * 100)
        text = zo_strformat(SI_CUSTOMER_SERVICE_UNSTUCK_COST_PROMPT_TELVAR, costText, telvarLossPercentage)
    elseif IsActiveWorldBattleground() then
        text = GetString(SI_CUSTOMER_SERVICE_UNSTUCK_COST_PROMPT_IN_BATTLEGROUND)
    else
        text = zo_strformat(SI_CUSTOMER_SERVICE_UNSTUCK_COST_PROMPT, costText)
    end
     self.helpStuckCost:SetText(text)
end
--Global XML
    HELP_CUSTOMER_SERVICE_CHARACTER_STUCK_KEYBOARD = HelpCharacterStuck_Keyboard:New(self)
end
     SendPlayerStuck()
end