diff --git a/aux-addon.lua b/aux-addon.lua index 60b4bdc..0da2112 100644 --- a/aux-addon.lua +++ b/aux-addon.lua @@ -1,8 +1,4 @@ -function INIT() - import :_ 'aux' :_ 'util' -end - -module 'aux' +module 'core' public.version = '5.0.0' public.bids_loaded = false diff --git a/control.lua b/control.lua index 95dbcf2..524d5a7 100644 --- a/control.lua +++ b/control.lua @@ -1,4 +1,4 @@ -module 'aux' +module 'core' event_frame = CreateFrame 'Frame' listeners = t diff --git a/frame.lua b/frame.lua index 2e7b894..0f80bbf 100644 --- a/frame.lua +++ b/frame.lua @@ -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' diff --git a/module.lua b/module.lua index 4f6327d..a073a18 100644 --- a/module.lua +++ b/module.lua @@ -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 \ No newline at end of file diff --git a/tabs/auctions/frame.lua b/tabs/auctions/frame.lua index 533f8b9..f2bec9c 100644 --- a/tabs/auctions/frame.lua +++ b/tabs/auctions/frame.lua @@ -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() diff --git a/tabs/bids/frame.lua b/tabs/bids/frame.lua index 056e041..f5e4625 100644 --- a/tabs/bids/frame.lua +++ b/tabs/bids/frame.lua @@ -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() diff --git a/tabs/post/frame.lua b/tabs/post/frame.lua index 122b953..395e089 100644 --- a/tabs/post/frame.lua +++ b/tabs/post/frame.lua @@ -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() diff --git a/tabs/search/core.lua b/tabs/search/core.lua index 4c477b9..cd0a73c 100644 --- a/tabs/search/core.lua +++ b/tabs/search/core.lua @@ -51,7 +51,6 @@ end RESULTS, SAVED, FILTER = 1, 2, 3 function LOAD() - import 'core' create_frames() set_tab(SAVED) update_auto_buy_filter() diff --git a/tabs/search/frame.lua b/tabs/search/frame.lua index 5aa876f..5562e40 100644 --- a/tabs/search/frame.lua +++ b/tabs/search/frame.lua @@ -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()