big refactoring
This commit is contained in:
+1
-5
@@ -1,8 +1,4 @@
|
||||
function INIT()
|
||||
import :_ 'aux' :_ 'util'
|
||||
end
|
||||
|
||||
module 'aux'
|
||||
module 'core'
|
||||
public.version = '5.0.0'
|
||||
|
||||
public.bids_loaded = false
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
module 'aux'
|
||||
module 'core'
|
||||
|
||||
event_frame = CreateFrame 'Frame'
|
||||
listeners = t
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
module 'aux' import 'gui'
|
||||
module 'core' import 'gui'
|
||||
|
||||
function LOAD()
|
||||
for _, tab in _m.tabs do tabs:create_tab(tab.name) end
|
||||
function public.set_tab(id) tabs:select(id) end
|
||||
end
|
||||
|
||||
do
|
||||
local frame = CreateFrame('Frame', 'aux_frame', UIParent)
|
||||
@@ -22,21 +27,19 @@ do
|
||||
public.aux_frame = frame
|
||||
end
|
||||
do
|
||||
local tabs = gui.tabs(frame, 'DOWN')
|
||||
local tabs = gui.tabs(aux_frame, 'DOWN')
|
||||
tabs._on_select = on_tab_click
|
||||
for _, tab in _m.tabs do tabs:create_tab(tab.name) end
|
||||
function public.set_tab(id) tabs:select(id) end
|
||||
end
|
||||
do
|
||||
local btn = gui.button(frame, 16)
|
||||
local btn = gui.button(aux_frame, 16)
|
||||
btn:SetPoint('BOTTOMRIGHT', -6, 6)
|
||||
gui.set_size(btn, 65, 24)
|
||||
btn:SetText 'Close'
|
||||
btn:SetScript('OnClick', L(frame.Hide, frame))
|
||||
btn:SetScript('OnClick', L(aux_frame.Hide, aux_frame))
|
||||
public.close_button = btn
|
||||
end
|
||||
do
|
||||
local btn = gui.button(frame, 16)
|
||||
local btn = gui.button(aux_frame, 16)
|
||||
btn:SetPoint('RIGHT', close_button, 'LEFT' , -5, 0)
|
||||
gui.set_size(btn, 65, 24)
|
||||
btn:SetText 'Default UI'
|
||||
|
||||
+1
-1
@@ -107,7 +107,7 @@ function module(name)
|
||||
data = {_g=_g, _m=env, _i=interface, import=importer}, accessors=accessors, mutators=mutators,
|
||||
}
|
||||
_modules[name], _state[env], _state[interface], _state[declarator], _state[importer] = state, state, state, state, state
|
||||
importer [''] (ADDON)
|
||||
importer [''] 'core'
|
||||
end
|
||||
setfenv(2, _modules[name].env)
|
||||
end
|
||||
@@ -1,7 +1,7 @@
|
||||
module 'auctions_tab' import 'gui'
|
||||
|
||||
function create_frames()
|
||||
frame = CreateFrame('Frame', nil, frame)
|
||||
frame = CreateFrame('Frame', nil, aux_frame)
|
||||
frame:SetAllPoints()
|
||||
frame:SetScript('OnUpdate', on_update)
|
||||
frame:Hide()
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
module 'bids_tab' import 'gui'
|
||||
|
||||
function create_frames()
|
||||
frame = CreateFrame('Frame', nil, frame)
|
||||
frame = CreateFrame('Frame', nil, aux_frame)
|
||||
frame:SetAllPoints()
|
||||
frame:SetScript('OnUpdate', on_update)
|
||||
frame:Hide()
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
module 'post_tab' import 'gui'
|
||||
|
||||
function create_frames()
|
||||
frame = CreateFrame('Frame', nil, frame)
|
||||
frame = CreateFrame('Frame', nil, aux_frame)
|
||||
frame:SetAllPoints()
|
||||
frame:SetScript('OnUpdate', on_update)
|
||||
frame:Hide()
|
||||
|
||||
@@ -51,7 +51,6 @@ end
|
||||
RESULTS, SAVED, FILTER = 1, 2, 3
|
||||
|
||||
function LOAD()
|
||||
import 'core'
|
||||
create_frames()
|
||||
set_tab(SAVED)
|
||||
update_auto_buy_filter()
|
||||
|
||||
@@ -3,7 +3,7 @@ module 'search_tab' import 'gui'
|
||||
FILTER_SPACING = 28.5
|
||||
|
||||
function create_frames()
|
||||
frame = CreateFrame('Frame', nil, frame)
|
||||
frame = CreateFrame('Frame', nil, aux_frame)
|
||||
frame:SetAllPoints()
|
||||
frame:SetScript('OnUpdate', on_update)
|
||||
frame:Hide()
|
||||
|
||||
Reference in New Issue
Block a user