forked from shirsig/aux-addon-vanilla
-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathframe.lua
More file actions
67 lines (64 loc) · 2.48 KB
/
frame.lua
File metadata and controls
67 lines (64 loc) · 2.48 KB
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
module 'aux'
local gui = require 'aux.gui'
function handle.LOAD()
for _, v in ipairs(tab_info) do
tabs:create_tab(v.name)
end
end
function handle.INIT_UI()
do
local frame = CreateFrame('Frame', 'aux_frame', UIParent)
tinsert(UISpecialFrames, 'aux_frame')
if not gui.is_blizzard() then
gui.set_window_style(frame)
end
gui.set_size(frame, 768, 447)
if gui.is_blizzard() then
local frameBorder = CreateFrame('Frame', '$parentBorder', frame)
frameBorder:SetWidth(frame:GetWidth() + 24)
frameBorder:SetHeight(frame:GetHeight() + 24)
frameBorder:SetPoint('CENTER', frame, 'CENTER')
frameBorder:SetBackdrop({edgeFile = [[Interface\Tooltips\UI-Tooltip-Border]], edgeSize = 24,
tile = true, tileSize = 24, bgFile = [[Interface\DialogFrame\UI-DialogBox-Background]],
insets = {
left = 6, right = 6, top = 6, bottom = 6 }})
end
frame:SetPoint('LEFT', 100, 0)
frame:SetToplevel(true)
frame:SetMovable(true)
frame:EnableMouse(true)
frame:SetClampedToScreen(true)
frame:CreateTitleRegion():SetAllPoints()
frame:SetScript('OnShow', function() PlaySound('AuctionWindowOpen') end)
frame:SetScript('OnHide', function() PlaySound('AuctionWindowClose'); CloseAuctionHouse() end)
frame.content = CreateFrame('Frame', nil, frame)
frame.content:SetPoint('TOPLEFT', 4, -80)
frame.content:SetPoint('BOTTOMRIGHT', -4, 35)
frame:Hide()
M.frame = frame
end
do
tabs = gui.tabs(frame, 'DOWN')
tabs._on_select = on_tab_click
function M.set_tab(id) tabs:select(id) end
end
do
local btn = gui.button(frame)
btn:SetPoint('BOTTOMRIGHT', -5, 5)
gui.set_size(btn, 60, 24)
btn:SetText('Close')
btn:SetScript('OnClick', function() frame:Hide() end)
btn:SetFrameLevel(btn:GetFrameLevel() + 2)
close_button = btn
end
do
local btn = gui.button(frame, gui.font_size.small)
btn:SetPoint('RIGHT', close_button, 'LEFT' , -5, 0)
gui.set_size(btn, gui.is_blizzard() and 80 or 60, 24)
btn:SetText(color.blizzard'Blizzard UI')
btn:SetFrameLevel(btn:GetFrameLevel() + 2)
btn:SetScript('OnClick',function()
if AuctionFrame:IsVisible() then HideUIPanel(AuctionFrame) else ShowUIPanel(AuctionFrame) end
end)
end
end