-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUI.lua
executable file
·119 lines (111 loc) · 3.36 KB
/
UI.lua
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
local EPGPR = EPGPR
-- Structure that holds forms initializers, every key here is a function that when called return _new_ AceGUI frame
EPGPR.UI = {
EPGPR = nil,
LootOverview = nil,
LootOverviewItem = nil,
LootOverviewItemAnnounce = nil,
}
-- Console command /epgp
local _UIEPGPFrame
function EPGPR:UIEPGPFrame()
-- Don't duplicate if we're already shown
if not _UIEPGPFrame then _UIEPGPFrame = EPGPR.UI.EPGPR() end
_UIEPGPFrame:Show()
end
-- LootOverview frame
local _UILootOverview
function EPGPR:UILootOverview()
-- Never duplicate
if not _UILootOverview then _UILootOverview = EPGPR.UI.LootOverview() end
return _UILootOverview
end
StaticPopupDialogs["EPGPR_ACTIVATE_POPUP"] = {
text = "Do you want to use EPGP Reloaded to manage loot?",
button1 = "Yes",
button2 = "No",
OnAccept = function()
EPGPR:Activate()
end,
OnCancel = function()
EPGPR.State.active = false;
end,
timeout = 0,
whileDead = true,
hideOnEscape = true,
preferredIndex = 3,
}
StaticPopupDialogs["EPGPR_GIVE_LOOT_POPUP"] = {
text = "",
button1 = "Yes",
button2 = "Cancel",
OnShow = function(self)
self.text:SetFormattedText("Do you want to give %s to %s for %d GP?", self.data.itemLink, self.data.name, self.data.GP);
end,
OnAccept = function(self)
EPGPR:UILootOverview():Fire("GiveSlot", self.data.slotId, self.data.name, self.data.GP)
end,
timeout = 0,
whileDead = false,
hideOnEscape = true,
preferredIndex = 3,
}
StaticPopupDialogs["EPGPR_CHANGE_GUILD_EPGP_POPUP"] = {
text = "Change Guild EPGP by percent (negative deflate, positive inflate)",
button1 = "Change",
button2 = "Cancel",
OnShow = function (self, data)
self.editBox:SetText("0")
end,
OnAccept = function(self)
EPGPR:GuildChangeEPGP(self.editBox:GetText())
end,
EditBoxOnTextChanged = function (self, data) -- careful! 'self' here points to the editbox, not the dialog
local text = self:GetText()
local value = tonumber(text)
if (tostring(value) == text and value ~= 0) then
self:GetParent().button1:Enable()
else
self:GetParent().button1:Disable()
end
end,
hasEditBox = true,
timeout = 0,
whileDead = true,
hideOnEscape = true,
preferredIndex = 3,
}
StaticPopupDialogs["EPGPR_CHANGE_RAID_EP_POPUP"] = {
text = "Add/Remove Raid EP (negative removes, positive adds)",
button1 = "Award",
button2 = "Cancel",
OnShow = function (self, data)
self.editBox:SetText("0")
end,
OnAccept = function(self)
EPGPR:RaidAddEP(self.editBox:GetText())
end,
EditBoxOnTextChanged = function (self, data) -- careful! 'self' here points to the editbox, not the dialog
local text = self:GetText()
local value = tonumber(text)
if (tostring(value) == text and value ~= 0) then
self:GetParent().button1:Enable()
else
self:GetParent().button1:Disable()
end
end,
hasEditBox = true,
timeout = 0,
whileDead = true,
hideOnEscape = true,
preferredIndex = 3,
}
StaticPopupDialogs["EPGPR_ERROR_POPUP"] = {
text = "",
button1 = "Ok",
OnShow = function(self) self.text:SetText(self.data.text) end,
timeout = 0,
whileDead = true,
hideOnEscape = true,
preferredIndex = 3,
}