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