-
Notifications
You must be signed in to change notification settings - Fork 0
/
SellingUI.lua
89 lines (77 loc) · 3.74 KB
/
SellingUI.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
local PileSeller = _G.PileSeller
function PileSeller:MakeMovable(frame)
frame:EnableMouse(true)
frame:SetMovable(true)
frame:RegisterForDrag("LeftButton")
frame:SetScript("OnDragStart", frame.StartMoving)
frame:SetScript("OnDragStop", frame.StopMovingOrSizing)
end
local psSellingFrame = CreateFrame("FRAME", "PileSeller_SellingFrame", UIParent, "ThinBorderTemplate")
PileSeller:MakeMovable(psSellingFrame)
psSellingFrame:Hide()
psSellingFrame:SetSize(400, 100)
psSellingFrame:SetPoint("TOP", UIParent)
psSellingFrame.bg = psSellingFrame:CreateTexture()
psSellingFrame.bg:SetAllPoints(psSellingFrame)
psSellingFrame.bg:SetTexture([[Interface\Buttons\WHITE8X8]])
psSellingFrame.bg:SetVertexColor(.27,.27,.27,1)
psSellingFrame.lblSelling = psSellingFrame:CreateFontString(nil, "OVERLAY", "GameFontNormal")
psSellingFrame.lblSelling:SetPoint("TOP", psSellingFrame, 0, -10, "BOTTOM")
psSellingFrame.lblSelling:SetText("SCANNING ITEMS")
psSellingFrame:SetFrameStrata("DIALOG")
psSellingFrame.statusBar = CreateFrame("StatusBar", nil, psSellingFrame)
psSellingFrame.statusBar:SetStatusBarTexture(0,84/255,178/255, .9)
psSellingFrame.statusBar:SetMinMaxValues(0, NUM_BAG_SLOTS+1)
psSellingFrame.statusBar:SetValue(0)
psSellingFrame.statusBar:SetWidth(250)
psSellingFrame.statusBar:SetHeight(15)
psSellingFrame.statusBar:SetPoint("CENTER",psSellingFrame,"CENTER")
psSellingFrame.statusBar:SetFrameStrata("TOOLTIP")
--psSellingFrame.statusBar.texture = psSellingFrame.statusBar:CreateTexture()
--psSellingFrame.statusBar.texture:SetAllPoints(psSellingFrame.statusBar)
--psSellingFrame.statusBar.texture:SetTexture("Interface\\Common\\ShadowOverlay-Top")
psSellingFrame.statusBar.border = CreateFrame("FRAME", nil, psSellingFrame.statusBar)
psSellingFrame.statusBar.border:SetSize(250, 16)
psSellingFrame.statusBar.border:SetPoint("LEFT", psSellingFrame.statusBar)
psSellingFrame.statusBar.border:SetBackdrop({
bgFile = [[Interface\Buttons\WHITE8X8]],
edgeFile = [[Interface\Buttons\WHITE8X8]],
edgeSize = 3,
insets = {
left = 1,
right = 1,
top = 1,
bottom = 1
}
})
psSellingFrame.statusBar.border:SetBackdropColor(.76,.76,.76, .3)
psSellingFrame.statusBar.border:SetBackdropBorderColor(0, 0, 0)
psSellingFrame.statusBar.border.lbl = psSellingFrame.statusBar.border:CreateFontString(nil, "OVERLAY", "GameFontHighlight")
psSellingFrame.statusBar.border.lbl:SetPoint("CENTER", psSellingFrame.statusBar.border, 0, -1)
psSellingFrame.statusBar.border.lbl:SetText("0 / 5")
psSellingFrame.statusBar.border.lbl:SetVertexColor(1,1,1)
psSellingFrame.statusBar:SetScript("OnValueChanged", function(self, value)
psSellingFrame.statusBar.border.lbl:SetText(value .. " / " .. NUM_BAG_SLOTS + 1)
end
)
psSellingFrame.sellingLbl = psSellingFrame:CreateFontString(nil, "OVERLAY", "GameFontHighlight")
psSellingFrame.sellingLbl:SetPoint("BOTTOM", psSellingFrame, 0, 25)
psSellingFrame.sellingLbl:SetText("")
psSellingFrame.profitLbl = psSellingFrame:CreateFontString(nil, "OVERLAY", "GameFontHighlight")
psSellingFrame.profitLbl:SetPoint("BOTTOM", psSellingFrame.sellingLbl, 0, -15)
psSellingFrame.profitLbl:SetText("Profit " .. PileSeller:getProfitPerCoin(0))
psSellingFrame.closeBtn = CreateFrame("Button", nil, psSellingFrame,"UIPanelCloseButton")
psSellingFrame.closeBtn:SetSize(26, 26)
psSellingFrame.closeBtn:SetPoint("TOPRIGHT", psSellingFrame, 0, 0)
psSellingFrame.closeBtn:SetScript("OnClick", function()
psSellingFrame.statusBar.border:SetBackdropBorderColor(0,0,0)
psSellingFrame.profitLbl:SetText("Profit: " .. PileSeller:getProfitPerCoin(0))
psSellingFrame.sellingLbl:SetText("")
psSellingFrame.statusBar:SetValue(0)
psSellingFrame:Hide()
end
)
PileSeller.sFrame = psSellingFrame
--function PileSeller:Abracadabra(value)
-- PileSeller.sFrame.statusBar:SetValue(value)
--end