diff --git a/aux-addon.lua b/aux-addon.lua index 98d6722..213bba0 100644 --- a/aux-addon.lua +++ b/aux-addon.lua @@ -50,13 +50,6 @@ do end) end -function LOAD() - include (aux_util) - include (aux_control) - include (aux_util_color) - aux_frame.create() -end - private.tab_info = t function public.TAB(name) local tab = T('name', name) diff --git a/aux-addon.toc b/aux-addon.toc index 4b163d5..8021e16 100644 --- a/aux-addon.toc +++ b/aux-addon.toc @@ -9,9 +9,9 @@ libs\module.lua libs\green_t.lua aux-addon.lua -util\core.lua +util.lua control.lua -util\color.lua +color.lua gui\core.lua frame.lua diff --git a/util/color.lua b/color.lua similarity index 94% rename from util/color.lua rename to color.lua index 3199604..c7ff960 100644 --- a/util/color.lua +++ b/color.lua @@ -1,9 +1,4 @@ -module 'aux.util.color' - -include 'green_t' -include 'aux' -include 'aux.util' -include 'aux.control' +module 'aux' local COLORS = { text = {enabled = {255, 254, 250, 1}, disabled = {147, 151, 139, 1}}, diff --git a/control.lua b/control.lua index 4e1dbf5..dfb57ea 100644 --- a/control.lua +++ b/control.lua @@ -1,8 +1,4 @@ -module 'aux.control' - -include 'green_t' -include 'aux' -include 'aux.util' +module 'aux' local event_frame = CreateFrame'Frame' diff --git a/frame.lua b/frame.lua index f562f33..faffec1 100644 --- a/frame.lua +++ b/frame.lua @@ -1,9 +1,8 @@ -module 'aux.frame' +module 'aux' local gui = require 'aux.gui' -function public.create() - setfenv(1, getfenv(2)) +function private.create_frame() do local frame = CreateFrame('Frame', 'AuxFrame', UIParent) tinsert(UISpecialFrames, 'AuxFrame') diff --git a/libs/green_t.lua b/libs/green_t.lua index ca28f93..c462db8 100644 --- a/libs/green_t.lua +++ b/libs/green_t.lua @@ -1,4 +1,4 @@ -green_t = module +library 'green_t' local next, getn, setn, tremove, type, setmetatable = next, getn, table.setn, tremove, type, setmetatable @@ -16,7 +16,7 @@ do end public.wipe = wipe - CreateFrame('Frame'):SetScript('OnUpdate', function() + CreateFrame'Frame':SetScript('OnUpdate', function() for t in auto_release do release(t) end wipe(auto_release) end) diff --git a/libs/module.lua b/libs/module.lua index 31eff8c..a6d15db 100644 --- a/libs/module.lua +++ b/libs/module.lua @@ -15,7 +15,7 @@ local function proxy_mt(fields, mutators) return { __metatable=false, __index=fields, __newindex=function(_, k, v) return mutators[k](v) end } end -local loaded, _module, _access, _name = {}, {}, {}, {} +local loaded, _interface, _environment, _access, _name = {}, {}, {}, {}, {} local definition_helper_mt = { __metatable=false } function definition_helper_mt:__index(k) @@ -24,7 +24,7 @@ function definition_helper_mt:__index(k) end function definition_helper_mt:__newindex(k, v) local module, name, mode - module, name = _module[self], _name[self] + module, name = loaded[self], _name[self] if name then mode = META[k] or error('Invalid modifier "%s"', k) else name, mode = k, FIELD end if type(name) ~= 'string' or not strfind(name, '^[_%a][_%w]*') then error('Invalid identifier "%s".', name) end module.defined[name .. OPERATION[mode]] = module.defined[name .. OPERATION[mode]] and error('Duplicate identifier "%s".', name) or true @@ -32,10 +32,10 @@ function definition_helper_mt:__newindex(k, v) _access[self], _name[self] = nil, nil end -local function require(name) return loaded[name] end +local function require(name) return _interface[name] end local function include(self, name) - local module = name and _module[name] or error('No module "%s".', name) + local module = name and loaded[name] or error('No module "%s".', name) for _, mode in MODES do for k, v in module[PUBLIC + mode] do if not self.defined[k .. OPERATION[mode]] or error('Import conflict for "%s".', k) then @@ -47,14 +47,13 @@ end local nop_default_mt = { __index=function() return nop end } -function module(name) --- if loaded[name] then _G.error(nil) end - local module, environment, interface, definition_helper, modifiers, accessors, mutators, fields, public_accessors, public_mutators, public_fields +local function create_module(name) + local P, environment, interface, definition_helper, modifiers, accessors, mutators, fields, public_accessors, public_mutators, public_fields environment, interface, definition_helper = {}, {}, setmetatable({}, definition_helper_mt) accessors = { private=function() _access[definition_helper] = PRIVATE; return definition_helper end, public=function() _access[definition_helper] = PUBLIC; return definition_helper end } mutators = setmetatable({ _=nop }, { __index=function(_, k) return function(v) _G[k] = v end end }) fields = setmetatable( - { _M=environment, _G=_G, require=require, include=function(interface) include(module, interface) end, error=error, nop=nop, id=id }, + { _M=environment, _G=_G, require=require, include=function(interface) include(P, interface) end, error=error, nop=nop, id=id }, { __index=function(_, k) local accessor = accessors[k]; if accessor then return accessor() else return _G[k] end end } ) public_accessors = setmetatable({}, nop_default_mt) @@ -62,7 +61,7 @@ function module(name) public_fields = setmetatable({}, { __index=function(_, k) return public_accessors[k]() end }) setmetatable(environment, proxy_mt(fields, mutators)) setmetatable(interface, proxy_mt(public_fields, public_mutators)) - module = { + P = { defined = { _M=true, _G=true, require=true, include=true, error=true, nop=true, id=true, public=true, private=true, ['_=']=true }, [ACCESSOR] = accessors, [MUTATOR] = mutators, @@ -71,7 +70,9 @@ function module(name) [PUBLIC + MUTATOR] = public_mutators, [PUBLIC + FIELD] = public_fields, } - _module[name], _module[definition_helper] = module, module - loaded[name] = interface - setfenv(2, environment) -end \ No newline at end of file + _environment[name], _interface[name] = environment, interface + loaded[name], loaded[definition_helper] = P, P +end + +function module(name) if not loaded[name] then create_module(name) end setfenv(2, _environment[name]) end +function library(name) if loaded[name] then _G.error(nil) end create_module(name) setfenv(2, _environment[name]) end \ No newline at end of file diff --git a/tabs/auctions/frame.lua b/tabs/auctions/frame.lua index 50681e4..869b541 100644 --- a/tabs/auctions/frame.lua +++ b/tabs/auctions/frame.lua @@ -1,4 +1,4 @@ -module 'aux.auctions_tab.frame' +module 'aux.tabs.auctions.frame' local gui = require 'aux.gui' local auction_listing = require 'aux.gui.auction_listing' diff --git a/tabs/bids/frame.lua b/tabs/bids/frame.lua index 58f2d6d..f7e65ae 100644 --- a/tabs/bids/frame.lua +++ b/tabs/bids/frame.lua @@ -1,4 +1,4 @@ -module'aux.bids_tab.frame' +module 'aux.tabs.bids.frame' local gui = require 'aux.gui' local auction_listing = require 'aux.gui.auction_listing' diff --git a/tabs/post/core.lua b/tabs/post/core.lua index e908194..c3eb6a6 100644 --- a/tabs/post/core.lua +++ b/tabs/post/core.lua @@ -1,10 +1,10 @@ -module'aux.post_tab' +module 'aux.tabs.post' -include'green_t' -include'aux' -include'aux.util' -include'aux.control' -include'aux.util.color' +include 'green_t' +include 'aux' +include 'aux.util' +include 'aux.control' +include 'aux.util.color' local info = require 'aux.util.info' local sort_util = require 'aux.util.sort' diff --git a/tabs/post/frame.lua b/tabs/post/frame.lua index 0bc61de..dac6298 100644 --- a/tabs/post/frame.lua +++ b/tabs/post/frame.lua @@ -1,4 +1,4 @@ -module'aux.post_tab.frame' +module'aux.tabs.post.frame' local info = require 'aux.util.info' local money = require 'aux.util.money' diff --git a/tabs/search/core.lua b/tabs/search/core.lua index 7a55eb9..1bc6ac2 100644 --- a/tabs/search/core.lua +++ b/tabs/search/core.lua @@ -1,10 +1,10 @@ -aux_search_tab = module +module 'aux.tabs.search' -include (green_t) -include (aux) -include (aux_util) -include (aux_control) -include (aux_util_color) +include 'green_t' +include 'aux' +include 'aux.util' +include 'aux.control' +include 'aux.util.color' TAB 'Search' @@ -26,23 +26,23 @@ StaticPopupDialogs.AUX_SEARCH_AUTO_BUY = { hideOnEscape = 1, } -public.RESULTS = 1 -public.SAVED = 2 -public.FILTER = 3 +private.RESULTS = 1 +private.SAVED = 2 +private.FILTER = 3 function LOAD() - aux_search_tab_frame.create() +-- aux_search_tab_frame.create() subtab = SAVED end function OPEN() frame:Show() - aux_search_tab_saved.update_search_listings() + update_search_listings() end function CLOSE() - aux_search_tab_results.close_settings() - aux_search_tab_results.current_search.table:SetSelectedRecord() + close_settings() + current_search.table:SetSelectedRecord() frame:Hide() end @@ -56,11 +56,7 @@ function USE_ITEM(item_info) execute(nil, false) end -function public.execute(resume, real_time) - aux_search_tab_results.execute(resume, real_time) -end - -function public.subtab.set(tab) +function private.subtab.set(tab) search_results_button:UnlockHighlight() saved_searches_button:UnlockHighlight() new_filter_button:UnlockHighlight() @@ -80,11 +76,11 @@ function public.subtab.set(tab) end end -function public.set_filter(filter_string) +function private.set_filter(filter_string) search_box:SetText(filter_string) end -function public.add_filter(filter_string) +function private.add_filter(filter_string) local old_filter_string = search_box:GetText() old_filter_string = trim(old_filter_string) @@ -95,7 +91,7 @@ function public.add_filter(filter_string) search_box:SetText(old_filter_string .. filter_string) end -function public.blizzard_page_index(str) +function private.blizzard_page_index(str) if tonumber(str) then return max(0, tonumber(str) - 1) end diff --git a/tabs/search/filter.lua b/tabs/search/filter.lua index 597dbcf..78f6d24 100644 --- a/tabs/search/filter.lua +++ b/tabs/search/filter.lua @@ -1,23 +1,16 @@ -aux_search_tab_filter = module +module 'aux.tabs.search' -include (green_t) -include (aux) -include (aux_util) -include (aux_control) -include (aux_util_color) +local info = require 'aux.util.info' +local money = require 'aux.util.money' +local cache = require 'aux.core.cache' +local filter_util = require 'aux.util.filter' -function LOAD() - include (aux_search_tab) -end - -local filter_util = aux_filter_util - -function public.valid_level(str) +function private.valid_level(str) local level = tonumber(str) return level and bounded(1, 60, level) end -public.blizzard_query = setmetatable(t, { +private.blizzard_query = setmetatable(t, { __index = function(_, key) if key == 'name' then return name_input:GetText() @@ -30,16 +23,16 @@ public.blizzard_query = setmetatable(t, { elseif key == 'usable' then return usable_checkbox:GetChecked() elseif key == 'class' then - local class_index = UIDropDownMenu_GetSelectedValue(aux_search_tab.class_dropdown) + local class_index = UIDropDownMenu_GetSelectedValue(class_dropdown) return (class_index or 0) > 0 and class_index or nil elseif key == 'subclass' then - local subclass_index = UIDropDownMenu_GetSelectedValue(aux_search_tab.subclass_dropdown) + local subclass_index = UIDropDownMenu_GetSelectedValue(subclass_dropdown) return (subclass_index or 0) > 0 and subclass_index or nil elseif key == 'slot' then - local slot_index = UIDropDownMenu_GetSelectedValue(aux_search_tab.slot_dropdown) + local slot_index = UIDropDownMenu_GetSelectedValue(slot_dropdown) return (slot_index or 0) > 0 and slot_index or nil elseif key == 'quality' then - local quality_code = UIDropDownMenu_GetSelectedValue(aux_search_tab.quality_dropdown) + local quality_code = UIDropDownMenu_GetSelectedValue(quality_dropdown) return (quality_code or -1) >= 0 and quality_code or nil end end, @@ -70,7 +63,7 @@ public.blizzard_query = setmetatable(t, { end, }) -function public.update_form() +function private.update_form() if blizzard_query.class and GetAuctionItemSubClasses(blizzard_query.class) then subclass_dropdown.button:Enable() else @@ -186,19 +179,19 @@ function private.clear_form() update_filter_display() end -function public.import_filter_string() +function private.import_filter_string() local filter, error = filter_util.parse_filter_string(select(3, strfind(search_box:GetText(), '^([^;]*)'))) if filter or print(error) then set_form(filter) end end -function public.export_filter_string() +function private.export_filter_string() search_box:SetText(get_filter_builder_query()) filter_parameter_input:ClearFocus() end -function public.formatted_post_filter(components) +function private.formatted_post_filter(components) local no_line_break local stack = tt local str = '' @@ -208,7 +201,7 @@ function public.formatted_post_filter(components) str = str .. ' ' elseif i > 1 then str = str .. '
' - for _=1,getn(stack) do + for _ = 1, getn(stack) do str = str .. color.content.background('----') end end @@ -222,9 +215,9 @@ function public.formatted_post_filter(components) elseif component[1] == 'filter' then for parameter in present(component[3]) do if component[2] == 'item' then - parameter = aux_info.display_name(aux_cache.item_id(parameter)) or '[' .. parameter .. ']' + parameter = info.display_name(cache.item_id(parameter)) or '[' .. parameter .. ']' elseif filter_util.filters[component[2]].input_type == 'money' then - parameter = aux_money.to_string(aux_money.from_string(parameter), nil, true) + parameter = money.to_string(money.from_string(parameter), nil, true) end component_text = component_text .. filter_color(': ') .. parameter end @@ -249,7 +242,7 @@ end private.post_filter = t private.filter_builder_state = T('selected', 0) -function public.data_link_click() +function private.data_link_click() local button = arg3 local index = tonumber(arg1) if button == 'LeftButton' then @@ -274,7 +267,7 @@ function private.add_component(component) tinsert(post_filter, filter_builder_state.selected, component) end -function public.add_post_filter() +function private.add_post_filter() for str in present(filter_input:GetText()) do for filter in present(filter_util.filters[str]) do if filter.input_type ~= '' then @@ -296,7 +289,7 @@ end do local text = '' - function public.update_filter_display() + function private.update_filter_display() text = formatted_post_filter(post_filter) filter_display:SetWidth(filter_display_size()) set_filter_display_offset() @@ -316,7 +309,7 @@ do end end -function public.set_filter_display_offset(x_offset, y_offset) +function private.set_filter_display_offset(x_offset, y_offset) local scroll_frame = filter_display:GetParent() x_offset, y_offset = x_offset or scroll_frame:GetHorizontalScroll(), y_offset or scroll_frame:GetVerticalScroll() local width, height = filter_display_size() @@ -328,7 +321,7 @@ function public.set_filter_display_offset(x_offset, y_offset) scroll_frame:SetVerticalScroll(bounded(y_lower_bound, y_upper_bound, y_offset)) end -function public.initialize_filter_dropdown() +function private.initialize_filter_dropdown() for filter in temp-S('and', 'or', 'not', 'min-unit-bid', 'min-unit-buy', 'max-unit-bid', 'max-unit-buy', 'bid-profit', 'buy-profit', 'bid-vend-profit', 'buy-vend-profit', 'bid-dis-profit', 'buy-dis-profit', 'bid-pct', 'buy-pct', 'item', 'tooltip', 'min-lvl', 'max-lvl', 'rarity', 'left', 'utilizable', 'discard') do UIDropDownMenu_AddButton(T( 'text', filter, @@ -348,7 +341,7 @@ function public.initialize_filter_dropdown() end end -function public.initialize_class_dropdown() +function private.initialize_class_dropdown() local function on_click() if this.value ~= blizzard_query.class then UIDropDownMenu_SetSelectedValue(class_dropdown, this.value) @@ -365,7 +358,7 @@ function public.initialize_class_dropdown() end end -function public.initialize_subclass_dropdown() +function private.initialize_subclass_dropdown() local function on_click() if this.value ~= blizzard_query.subclass then UIDropDownMenu_SetSelectedValue(subclass_dropdown, this.value) @@ -374,7 +367,7 @@ function public.initialize_subclass_dropdown() update_form() end end - local class_index = UIDropDownMenu_GetSelectedValue(aux_search_tab.class_dropdown) + local class_index = UIDropDownMenu_GetSelectedValue(class_dropdown) if class_index and GetAuctionItemSubClasses(class_index) then UIDropDownMenu_AddButton(T('text', ALL, 'value', 0, 'func', on_click)) for i, subclass in temp-A(GetAuctionItemSubClasses(class_index)) do @@ -383,13 +376,13 @@ function public.initialize_subclass_dropdown() end end -function public.initialize_slot_dropdown() +function private.initialize_slot_dropdown() local function on_click() UIDropDownMenu_SetSelectedValue(slot_dropdown, this.value) update_form() end - local class_index = UIDropDownMenu_GetSelectedValue(aux_search_tab.class_dropdown) - local subclass_index = UIDropDownMenu_GetSelectedValue(aux_search_tab.subclass_dropdown) + local class_index = UIDropDownMenu_GetSelectedValue(class_dropdown) + local subclass_index = UIDropDownMenu_GetSelectedValue(subclass_dropdown) if subclass_index and GetAuctionInvTypes(class_index, subclass_index) then UIDropDownMenu_AddButton(T('text', ALL, 'value', '', 'func', on_click)) for i, slot in temp-A(GetAuctionInvTypes(class_index, subclass_index)) do @@ -398,7 +391,7 @@ function public.initialize_slot_dropdown() end end -function public.initialize_quality_dropdown() +function private.initialize_quality_dropdown() local function on_click() UIDropDownMenu_SetSelectedValue(quality_dropdown, this.value) update_form() diff --git a/tabs/search/frame.lua b/tabs/search/frame.lua index 2bc9d0d..32a019a 100644 --- a/tabs/search/frame.lua +++ b/tabs/search/frame.lua @@ -1,675 +1,677 @@ -aux_search_tab_frame = module +module 'aux.tabs.search' -local gui, completion, listing, auction_listing, filter_util = aux_gui, aux_completion, aux_listing, aux_auction_listing, aux_filter_util +local completion = require 'aux.util.completion' +local filter_util = require 'aux.util.filter' +local scan = require 'aux.core.scan' +local gui = require 'aux.gui' +local listing = require 'aux.gui.listing' +local auction_listing = require 'aux.gui.auction_listing' local FILTER_SPACING = 28.5 -function public.create() - setfenv(1, getfenv(2)) - public.frame = CreateFrame('Frame', nil, AuxFrame) - frame:SetAllPoints() - frame:SetScript('OnUpdate', on_update) - frame:Hide() +private.frame = CreateFrame('Frame', nil, AuxFrame) +frame:SetAllPoints() +frame:SetScript('OnUpdate', on_update) +frame:Hide() - frame.filter = gui.panel(frame) - frame.filter:SetAllPoints(AuxFrame.content) +frame.filter = gui.panel(frame) +frame.filter:SetAllPoints(AuxFrame.content) - frame.results = gui.panel(frame) - frame.results:SetAllPoints(AuxFrame.content) +frame.results = gui.panel(frame) +frame.results:SetAllPoints(AuxFrame.content) - frame.saved = CreateFrame('Frame', nil, frame) - frame.saved:SetAllPoints(AuxFrame.content) +frame.saved = CreateFrame('Frame', nil, frame) +frame.saved:SetAllPoints(AuxFrame.content) - frame.saved.favorite = gui.panel(frame.saved) - frame.saved.favorite:SetWidth(378.5) - frame.saved.favorite:SetPoint('TOPLEFT', 0, 0) - frame.saved.favorite:SetPoint('BOTTOMLEFT', 0, 0) +frame.saved.favorite = gui.panel(frame.saved) +frame.saved.favorite:SetWidth(378.5) +frame.saved.favorite:SetPoint('TOPLEFT', 0, 0) +frame.saved.favorite:SetPoint('BOTTOMLEFT', 0, 0) - frame.saved.recent = gui.panel(frame.saved) - frame.saved.recent:SetWidth(378.5) - frame.saved.recent:SetPoint('TOPRIGHT', 0, 0) - frame.saved.recent:SetPoint('BOTTOMRIGHT', 0, 0) - do - local btn = gui.button(frame) - btn:SetPoint('TOPLEFT', 0, 0) - btn:SetWidth(42) - btn:SetHeight(42) - btn:SetScript('OnClick', function() - if this.open then - settings:Hide() - controls:Show() - else - settings:Show() - controls:Hide() - end - this.open = not this.open - end) +frame.saved.recent = gui.panel(frame.saved) +frame.saved.recent:SetWidth(378.5) +frame.saved.recent:SetPoint('TOPRIGHT', 0, 0) +frame.saved.recent:SetPoint('BOTTOMRIGHT', 0, 0) +do + local btn = gui.button(frame) + btn:SetPoint('TOPLEFT', 0, 0) + btn:SetWidth(42) + btn:SetHeight(42) + btn:SetScript('OnClick', function() + if this.open then + settings:Hide() + controls:Show() + else + settings:Show() + controls:Hide() + end + this.open = not this.open + end) - for _, offset in temp-A(14, 10, 6) do - local fake_icon_part = btn:CreateFontString() - fake_icon_part:SetFont([[Fonts\FRIZQT__.TTF]], 23) - fake_icon_part:SetPoint('CENTER', 0, offset) - fake_icon_part:SetText('_') - end + for _, offset in temp-A(14, 10, 6) do + local fake_icon_part = btn:CreateFontString() + fake_icon_part:SetFont([[Fonts\FRIZQT__.TTF]], 23) + fake_icon_part:SetPoint('CENTER', 0, offset) + fake_icon_part:SetText('_') + end - public.settings_button = btn - end - do - local panel = CreateFrame('Frame', nil, frame) - panel:SetBackdrop{bgFile=[[Interface\Buttons\WHITE8X8]]} - panel:SetBackdropColor(color.content.background()) - panel:SetPoint('LEFT', settings_button, 'RIGHT', 0, 0) - panel:SetPoint('RIGHT', 0, 0) - panel:SetHeight(42) - panel:Hide() - public.settings = panel - end - do - local panel = CreateFrame('Frame', nil, frame) - panel:SetPoint('LEFT', settings_button, 'RIGHT', 0, 0) - panel:SetPoint('RIGHT', 0, 1) - panel:SetHeight(40) - public.controls = panel - end - do - local function change() - local page = tonumber(this:GetText()) - local valid_input = page and tostring(max(1, page)) or '' - if this:GetText() ~= valid_input then - this:SetText(valid_input) - end - if blizzard_page_index(this:GetText()) and not real_time_button:GetChecked() then - this:SetBackdropColor(color.state.enabled()) - else - this:SetBackdropColor(color.state.disabled()) - end + private.settings_button = btn +end +do + local panel = CreateFrame('Frame', nil, frame) + panel:SetBackdrop{bgFile=[[Interface\Buttons\WHITE8X8]]} + panel:SetBackdropColor(color.content.background()) + panel:SetPoint('LEFT', settings_button, 'RIGHT', 0, 0) + panel:SetPoint('RIGHT', 0, 0) + panel:SetHeight(42) + panel:Hide() + private.settings = panel +end +do + local panel = CreateFrame('Frame', nil, frame) + panel:SetPoint('LEFT', settings_button, 'RIGHT', 0, 0) + panel:SetPoint('RIGHT', 0, 1) + panel:SetHeight(40) + private.controls = panel +end +do + local function change() + local page = tonumber(this:GetText()) + local valid_input = page and tostring(max(1, page)) or '' + if this:GetText() ~= valid_input then + this:SetText(valid_input) end - do - local editbox = gui.editbox(settings) - editbox:SetPoint('LEFT', 75, 0) - editbox:SetWidth(50) - editbox:SetNumeric(true) - editbox:SetScript('OnTabPressed', function() last_page_input:SetFocus() end) - editbox.enter = execute - editbox.change = change - local label = gui.label(editbox, 16) - label:SetPoint('RIGHT', editbox, 'LEFT', -6, 0) - label:SetText('Pages') - label:SetTextColor(color.text.enabled()) - public.first_page_input = editbox - end - do - local editbox = gui.editbox(settings) - editbox:SetPoint('LEFT', first_page_input, 'RIGHT', 10, 0) - editbox:SetWidth(50) - editbox:SetNumeric(true) - editbox:SetScript('OnTabPressed', function() first_page_input:SetFocus() end) - editbox.enter = execute - editbox.change = change - local label = gui.label(editbox, gui.font_size.medium) - label:SetPoint('RIGHT', editbox, 'LEFT', -3.5, 0) - label:SetText('-') - label:SetTextColor(color.text.enabled()) - public.last_page_input = editbox + if blizzard_page_index(this:GetText()) and not real_time_button:GetChecked() then + this:SetBackdropColor(color.state.enabled()) + else + this:SetBackdropColor(color.state.disabled()) end end do - local btn = gui.checkbutton(settings) - btn:SetPoint('LEFT', 230, 0) - btn:SetWidth(140) - btn:SetHeight(25) - btn:SetText('Real Time Mode') - btn:SetScript('OnClick', function() - this:SetChecked(not this:GetChecked()) - this = first_page_input - first_page_input:GetScript('OnTextChanged')() - this = last_page_input - last_page_input:GetScript('OnTextChanged')() - end) - public.real_time_button = btn - end - do - local btn = gui.checkbutton(settings) - btn:SetPoint('LEFT', real_time_button, 'RIGHT', 15, 0) - btn:SetWidth(140) - btn:SetHeight(25) - btn:SetText('Auto Buyout Mode') - btn:SetScript('OnClick', function() - if this:GetChecked() then - this:SetChecked(false) - else - StaticPopup_Show('AUX_SEARCH_AUTO_BUY') - end - end) - public.auto_buy_button = btn - end - do - local btn = gui.checkbutton(settings) - btn:SetPoint('LEFT', auto_buy_button, 'RIGHT', 15, 0) - btn:SetWidth(140) - btn:SetHeight(25) - btn:SetText('Auto Buyout Filter') - btn:SetScript('OnClick', function() - if this:GetChecked() then - this:SetChecked(false) - aux_search_tab_results.aux_auto_buy_filter = nil - this.prettified = nil - aux_search_tab_results.auto_buy_validator = nil - else - StaticPopup_Show('AUX_SEARCH_AUTO_BUY_FILTER') - end - end) - btn:SetScript('OnEnter', function() - if this.prettified then - GameTooltip_SetDefaultAnchor(GameTooltip, UIParent) - GameTooltip:AddLine(gsub(this.prettified, ';', '\n\n'), 255/255, 254/255, 250/255, true) - GameTooltip:Show() - end - end) - btn:SetScript('OnLeave', function() - GameTooltip:Hide() - end) - public.auto_buy_filter_button = btn - end - do - local btn = gui.button(controls, 25) - btn:SetPoint('LEFT', 5, 0) - btn:SetWidth(30) - btn:SetHeight(25) - btn:SetText('<') - btn:SetScript('OnClick', aux_search_tab_results.previous_search) - public.previous_button = btn - end - do - local btn = gui.button(controls, 25) - btn:SetPoint('LEFT', previous_button, 'RIGHT', 4, 0) - btn:SetWidth(30) - btn:SetHeight(25) - btn:SetText('>') - btn:SetScript('OnClick', aux_search_tab_results.next_search) - public.next_button = btn - end - do - local btn = gui.button(controls, gui.font_size.huge) - btn:SetPoint('RIGHT', -5, 0) - btn:SetWidth(70) - btn:SetHeight(25) - btn:SetText('Start') - btn:RegisterForClicks('LeftButtonUp', 'RightButtonUp') - btn:SetScript('OnClick', function() - if arg1 == 'RightButton' then - set_filter(aux_search_tab_results.current_search.filter_string) - end - execute() - end) - public.start_button = btn - end - do - local btn = gui.button(controls, gui.font_size.huge) - btn:SetPoint('RIGHT', -5, 0) - btn:SetWidth(70) - btn:SetHeight(25) - btn:SetText('Stop') - btn:SetScript('OnClick', function() - aux_scan.abort(aux_search_tab_results.search_scan_id) - end) - public.stop_button = btn - end - do - local btn = gui.button(controls, gui.font_size.huge) - btn:SetPoint('RIGHT', start_button, 'LEFT', -4, 0) - btn:SetWidth(70) - btn:SetHeight(25) - btn:SetText(color.green 'Resume') - btn:SetScript('OnClick', function() - execute(true) - end) - public.resume_button = btn - end - do - local editbox = gui.editbox(controls) - editbox:EnableMouse(1) - editbox.formatter = function(str) - local queries = aux_filter_util.queries(str) - return queries and join(map(copy(queries), function(query) return query.prettified end), ';') or color.red(str) - end - editbox.complete = completion.complete_filter - editbox:SetPoint('RIGHT', start_button, 'LEFT', -4, 0) - editbox:SetHeight(25) - editbox.char = function() - this:complete() - end - editbox:SetScript('OnTabPressed', function() - this:HighlightText(0, 0) - end) + local editbox = gui.editbox(settings) + editbox:SetPoint('LEFT', 75, 0) + editbox:SetWidth(50) + editbox:SetNumeric(true) + editbox:SetScript('OnTabPressed', function() last_page_input:SetFocus() end) editbox.enter = execute - public.search_box = editbox - end + editbox.change = change + local label = gui.label(editbox, 16) + label:SetPoint('RIGHT', editbox, 'LEFT', -6, 0) + label:SetText'Pages' + label:SetTextColor(color.text.enabled()) + private.first_page_input = editbox + end do - gui.horizontal_line(frame, -40) - end - do - local btn = gui.button(frame, gui.font_size.large) - btn:SetPoint('BOTTOMLEFT', AuxFrame.content, 'TOPLEFT', 10, 8) - btn:SetWidth(243) - btn:SetHeight(22) - btn:SetText('Search Results') - btn:SetScript('OnClick', function() subtab = RESULTS end) - public.search_results_button = btn - end - do - local btn = gui.button(frame, gui.font_size.large) - btn:SetPoint('TOPLEFT', search_results_button, 'TOPRIGHT', 5, 0) - btn:SetWidth(243) - btn:SetHeight(22) - btn:SetText('Saved Searches') - btn:SetScript('OnClick', function() subtab = SAVED end) - public.saved_searches_button = btn - end - do - local btn = gui.button(frame, gui.font_size.large) - btn:SetPoint('TOPLEFT', saved_searches_button, 'TOPRIGHT', 5, 0) - btn:SetWidth(243) - btn:SetHeight(22) - btn:SetText('Filter Builder') - btn:SetScript('OnClick', function() subtab = FILTER end) - public.new_filter_button = btn - end - do - local frame = CreateFrame('Frame', nil, frame) - frame:SetWidth(265) - frame:SetHeight(25) - frame:SetPoint('TOPLEFT', AuxFrame.content, 'BOTTOMLEFT', 0, -6) - public.status_bar_frame = frame - end - do - local btn = gui.button(frame.results) - btn:SetPoint('TOPLEFT', status_bar_frame, 'TOPRIGHT', 5, 0) - btn:SetText('Bid') - btn:Disable() - public.bid_button = btn - end - do - local btn = gui.button(frame.results) - btn:SetPoint('TOPLEFT', bid_button, 'TOPRIGHT', 5, 0) - btn:SetText('Buyout') - btn:Disable() - public.buyout_button = btn - end - do - local btn = gui.button(frame.results) - btn:SetPoint('TOPLEFT', buyout_button, 'TOPRIGHT', 5, 0) - btn:SetText('Clear') - btn:SetScript('OnClick', function() - while tremove(aux_search_tab_results.current_search.records) do end - aux_search_tab_results.current_search.table:SetDatabase() - end) - end - do - local btn = gui.button(frame.saved) - btn:SetPoint('TOPLEFT', status_bar_frame, 'TOPRIGHT', 5, 0) - btn:SetText('Favorite') - btn:SetScript('OnClick', function() - local queries, error = filter_util.queries(search_box:GetText()) - if queries then - tinsert(_G.aux_favorite_searches, 1, T( - 'filter_string', search_box:GetText(), - 'prettified', join(map(queries, function(query) return query.prettified end), ';') - )) - else - print('Invalid filter:', error) - end - aux_search_tab_saved.update_search_listings() - end) - end - do - local btn1 = gui.button(frame.filter) - btn1:SetPoint('TOPLEFT', status_bar_frame, 'TOPRIGHT', 5, 0) - btn1:SetText('Search') - btn1:SetScript('OnClick', function() - aux_search_tab_filter.export_filter_string() - execute() - end) - - local btn2 = gui.button(frame.filter) - btn2:SetPoint('LEFT', btn1, 'RIGHT', 5, 0) - btn2:SetText('Export') - btn2:SetScript('OnClick', aux_search_tab_filter.export_filter_string) - - local btn3 = gui.button(frame.filter) - btn3:SetPoint('LEFT', btn2, 'RIGHT', 5, 0) - btn3:SetText('Import') - btn3:SetScript('OnClick', aux_search_tab_filter.import_filter_string) - end - do - local editbox = gui.editbox(frame.filter) - editbox.complete_item = completion.complete(function() return aux_auctionable_items end) - editbox:SetPoint('TOPLEFT', 14, -FILTER_SPACING) - editbox:SetWidth(260) - editbox.char = function() - if aux_search_tab_filter.blizzard_query.exact then - this:complete_item() - end - end - editbox:SetScript('OnTabPressed', function() - if aux_search_tab_filter.blizzard_query.exact then - return - end - if IsShiftKeyDown() then - max_level_input:SetFocus() - else - min_level_input:SetFocus() - end - end) - editbox.change = aux_search_tab_filter.update_form - editbox.enter = papply(editbox.ClearFocus, editbox) - local label = gui.label(editbox, gui.font_size.small) - label:SetPoint('BOTTOMLEFT', editbox, 'TOPLEFT', -2, 1) - label:SetText('Name') - public.name_input = editbox - end - do - local checkbox = gui.checkbox(frame.filter) - checkbox:SetPoint('TOPLEFT', name_input, 'TOPRIGHT', 16, 0) - checkbox:SetScript('OnClick', aux_search_tab_filter.update_form) - local label = gui.label(checkbox, gui.font_size.small) - label:SetPoint('BOTTOMLEFT', checkbox, 'TOPLEFT', -2, 1) - label:SetText('Exact') - public.exact_checkbox = checkbox - end - do - local editbox = gui.editbox(frame.filter) - editbox:SetPoint('TOPLEFT', name_input, 'BOTTOMLEFT', 0, -FILTER_SPACING) - editbox:SetWidth(125) + local editbox = gui.editbox(settings) + editbox:SetPoint('LEFT', first_page_input, 'RIGHT', 10, 0) + editbox:SetWidth(50) editbox:SetNumeric(true) - editbox:SetScript('OnTabPressed', function() - if IsShiftKeyDown() then - name_input:SetFocus() - else - max_level_input:SetFocus() - end - end) - editbox.enter = papply(editbox.ClearFocus, editbox) - editbox.change = function() - local valid_level = aux_search_tab_filter.valid_level(this:GetText()) - if tostring(valid_level) ~= this:GetText() then - this:SetText(valid_level or '') - end - aux_search_tab_filter.update_form() - end - local label = gui.label(editbox, gui.font_size.small) - label:SetPoint('BOTTOMLEFT', editbox, 'TOPLEFT', -2, 1) - label:SetText('Level Range') - public.min_level_input = editbox - end - do - local editbox = gui.editbox(frame.filter) - editbox:SetPoint('TOPLEFT', min_level_input, 'TOPRIGHT', 10, 0) - editbox:SetWidth(125) - editbox:SetNumeric(true) - editbox:SetScript('OnTabPressed', function() - if IsShiftKeyDown() then - min_level_input:SetFocus() - else - name_input:SetFocus() - end - end) - editbox.enter = papply(editbox.ClearFocus, editbox) - editbox.change = function() - local valid_level = aux_search_tab_filter.valid_level(this:GetText()) - if tostring(valid_level) ~= this:GetText() then - this:SetText(valid_level or '') - end - aux_search_tab_filter.update_form() - end + editbox:SetScript('OnTabPressed', function() first_page_input:SetFocus() end) + editbox.enter = execute + editbox.change = change local label = gui.label(editbox, gui.font_size.medium) - label:SetPoint('RIGHT', editbox, 'LEFT', -3, 0) - label:SetText('-') - public.max_level_input = editbox + label:SetPoint('RIGHT', editbox, 'LEFT', -3.5, 0) + label:SetText'-' + label:SetTextColor(color.text.enabled()) + private.last_page_input = editbox end - do - local checkbox = gui.checkbox(frame.filter) - checkbox:SetPoint('TOPLEFT', max_level_input, 'TOPRIGHT', 16, 0) - checkbox:SetScript('OnClick', aux_search_tab_filter.update_form) - local label = gui.label(checkbox, gui.font_size.small) - label:SetPoint('BOTTOMLEFT', checkbox, 'TOPLEFT', -2, 1) - label:SetText('Usable') - public.usable_checkbox = checkbox +end +do + local btn = gui.checkbutton(settings) + btn:SetPoint('LEFT', 230, 0) + btn:SetWidth(140) + btn:SetHeight(25) + btn:SetText'Real Time Mode' + btn:SetScript('OnClick', function() + this:SetChecked(not this:GetChecked()) + this = first_page_input + first_page_input:GetScript('OnTextChanged')() + this = last_page_input + last_page_input:GetScript('OnTextChanged')() + end) + private.real_time_button = btn +end +do + local btn = gui.checkbutton(settings) + btn:SetPoint('LEFT', real_time_button, 'RIGHT', 15, 0) + btn:SetWidth(140) + btn:SetHeight(25) + btn:SetText'Auto Buyout Mode' + btn:SetScript('OnClick', function() + if this:GetChecked() then + this:SetChecked(false) + else + StaticPopup_Show'AUX_SEARCH_AUTO_BUY' + end + end) + private.auto_buy_button = btn +end +do + local btn = gui.checkbutton(settings) + btn:SetPoint('LEFT', auto_buy_button, 'RIGHT', 15, 0) + btn:SetWidth(140) + btn:SetHeight(25) + btn:SetText'Auto Buyout Filter' + btn:SetScript('OnClick', function() + if this:GetChecked() then + this:SetChecked(false) + aux_auto_buy_filter = nil + this.prettified = nil + auto_buy_validator = nil + else + StaticPopup_Show'AUX_SEARCH_AUTO_BUY_FILTER' + end + end) + btn:SetScript('OnEnter', function() + if this.prettified then + GameTooltip_SetDefaultAnchor(GameTooltip, UIParent) + GameTooltip:AddLine(gsub(this.prettified, ';', '\n\n'), 255/255, 254/255, 250/255, true) + GameTooltip:Show() + end + end) + btn:SetScript('OnLeave', function() + GameTooltip:Hide() + end) + private.auto_buy_filter_button = btn +end +do + local btn = gui.button(controls, 25) + btn:SetPoint('LEFT', 5, 0) + btn:SetWidth(30) + btn:SetHeight(25) + btn:SetText'<' + btn:SetScript('OnClick', previous_search) + private.previous_button = btn +end +do + local btn = gui.button(controls, 25) + btn:SetPoint('LEFT', previous_button, 'RIGHT', 4, 0) + btn:SetWidth(30) + btn:SetHeight(25) + btn:SetText'>' + btn:SetScript('OnClick', next_search) + private.next_button = btn +end +do + local btn = gui.button(controls, gui.font_size.huge) + btn:SetPoint('RIGHT', -5, 0) + btn:SetWidth(70) + btn:SetHeight(25) + btn:SetText'Start' + btn:RegisterForClicks('LeftButtonUp', 'RightButtonUp') + btn:SetScript('OnClick', function() + if arg1 == 'RightButton' then + set_filter(current_search.filter_string) + end + execute() + end) + private.start_button = btn +end +do + local btn = gui.button(controls, gui.font_size.huge) + btn:SetPoint('RIGHT', -5, 0) + btn:SetWidth(70) + btn:SetHeight(25) + btn:SetText'Stop' + btn:SetScript('OnClick', function() + scan.abort(search_scan_id) + end) + private.stop_button = btn +end +do + local btn = gui.button(controls, gui.font_size.huge) + btn:SetPoint('RIGHT', start_button, 'LEFT', -4, 0) + btn:SetWidth(70) + btn:SetHeight(25) + btn:SetText(color.green 'Resume') + btn:SetScript('OnClick', function() + execute(true) + end) + private.resume_button = btn +end +do + local editbox = gui.editbox(controls) + editbox:EnableMouse(1) + editbox.formatter = function(str) + local queries = filter_util.queries(str) + return queries and join(map(copy(queries), function(query) return query.prettified end), ';') or color.red(str) end - do - local dropdown = gui.dropdown(frame.filter) - public.class_dropdown = dropdown - dropdown:SetPoint('TOPLEFT', min_level_input, 'BOTTOMLEFT', 0, 5 - FILTER_SPACING) - dropdown:SetWidth(300) - local label = gui.label(dropdown, gui.font_size.small) - label:SetPoint('BOTTOMLEFT', dropdown, 'TOPLEFT', -2, -3) - label:SetText('Item Class') - UIDropDownMenu_Initialize(dropdown, aux_search_tab_filter.initialize_class_dropdown) - dropdown:SetScript('OnShow', function() - UIDropDownMenu_Initialize(this, aux_search_tab_filter.initialize_class_dropdown) - end) - end - do - local dropdown = gui.dropdown(frame.filter) - public.subclass_dropdown = dropdown - dropdown:SetPoint('TOPLEFT', class_dropdown, 'BOTTOMLEFT', 0, 10 - FILTER_SPACING) - dropdown:SetWidth(300) - local label = gui.label(dropdown, gui.font_size.small) - label:SetPoint('BOTTOMLEFT', dropdown, 'TOPLEFT', -2, -3) - label:SetText('Item Subclass') - UIDropDownMenu_Initialize(dropdown, aux_search_tab_filter.initialize_subclass_dropdown) - dropdown:SetScript('OnShow', function() - UIDropDownMenu_Initialize(this, aux_search_tab_filter.initialize_subclass_dropdown) - end) - end - do - local dropdown = gui.dropdown(frame.filter) - public.slot_dropdown = dropdown - dropdown:SetPoint('TOPLEFT', subclass_dropdown, 'BOTTOMLEFT', 0, 10 - FILTER_SPACING) - dropdown:SetWidth(300) - local label = gui.label(dropdown, gui.font_size.small) - label:SetPoint('BOTTOMLEFT', dropdown, 'TOPLEFT', -2, -3) - label:SetText('Item Slot') - UIDropDownMenu_Initialize(dropdown, aux_search_tab_filter.initialize_slot_dropdown) - dropdown:SetScript('OnShow', function() - UIDropDownMenu_Initialize(this, aux_search_tab_filter.initialize_slot_dropdown) - end) - end - do - local dropdown = gui.dropdown(frame.filter) - public.quality_dropdown = dropdown - dropdown:SetPoint('TOPLEFT', slot_dropdown, 'BOTTOMLEFT', 0, 10 - FILTER_SPACING) - dropdown:SetWidth(300) - local label = gui.label(dropdown, gui.font_size.small) - label:SetPoint('BOTTOMLEFT', dropdown, 'TOPLEFT', -2, -3) - label:SetText('Min Quality') - UIDropDownMenu_Initialize(dropdown, aux_search_tab_filter.initialize_quality_dropdown) - dropdown:SetScript('OnShow', function() - UIDropDownMenu_Initialize(this, aux_search_tab_filter.initialize_quality_dropdown) - end) - end - gui.vertical_line(frame.filter, 332) - do - local dropdown = gui.dropdown(frame.filter) - dropdown:SetPoint('TOPRIGHT', -174.5, -10) - dropdown:SetWidth(150) - UIDropDownMenu_Initialize(dropdown, aux_search_tab_filter.initialize_filter_dropdown) - dropdown:SetScript('OnShow', function() - UIDropDownMenu_Initialize(this, aux_search_tab_filter.initialize_filter_dropdown) - end) - _G[dropdown:GetName() .. 'Text']:Hide() - local label = gui.label(dropdown, gui.font_size.medium) - label:SetPoint('RIGHT', dropdown, 'LEFT', -15, 0) - label:SetText('Post Filter') - public.filter_dropdown = dropdown - end - do - local input = gui.editbox(frame.filter) - input:SetPoint('CENTER', filter_dropdown, 'CENTER', 0, 0) - input:SetWidth(150) - input:SetScript('OnTabPressed', function() filter_parameter_input:SetFocus() end) - input.complete = completion.complete(function() return temp-A('and', 'or', 'not', unpack(keys(filter_util.filters))) end) - input.char = function() this:complete() end - input.change = function() - local text = this:GetText() - if filter_util.filters[text] and filter_util.filters[text].input_type ~= '' then - local _, _, suggestions = filter_util.parse_filter_string(text .. '/') - filter_parameter_input:SetNumeric(filter_util.filters[text].input_type == 'number') - filter_parameter_input.complete = completion.complete(function() return suggestions or empty end) - filter_parameter_input:Show() - else - filter_parameter_input:Hide() - end - end - input.enter = function() - if filter_parameter_input:IsVisible() then - filter_parameter_input:SetFocus() - else - aux_search_tab_filter.add_post_filter() - end - end - public.filter_input = input - end - do - local input = gui.editbox(frame.filter) - input:SetPoint('LEFT', filter_dropdown, 'RIGHT', 10, 0) - input:SetWidth(150) - input:SetScript('OnTabPressed', function() - filter_input:SetFocus() - end) - input.char = function() this:complete() end - input.enter = aux_search_tab_filter.add_post_filter - input:Hide() - public.filter_parameter_input = input - end - do - local scroll_frame = CreateFrame('ScrollFrame', nil, frame.filter) - scroll_frame:SetWidth(395) - scroll_frame:SetHeight(270) - scroll_frame:SetPoint('TOPLEFT', 348.5, -50) - scroll_frame:EnableMouse(true) - scroll_frame:EnableMouseWheel(true) - scroll_frame:SetScript('OnMouseWheel', function() - local child = this:GetScrollChild() - child:SetFont('p', [[Fonts\ARIALN.TTF]], bounded(11, 23, select(2, child:GetFont()) + arg1*2)) - aux_search_tab_filter.update_filter_display() - end) - scroll_frame:RegisterForDrag('LeftButton') - scroll_frame:SetScript('OnDragStart', function() - this.x, this.y = GetCursorPosition() - this.x_offset, this.y_offset = this:GetHorizontalScroll(), this:GetVerticalScroll() - this.x_extra, this.y_extra = 0, 0 - this:SetScript('OnUpdate', function() - local x, y = GetCursorPosition() - local new_x_offset = this.x_offset + x - this.x - local new_y_offset = this.y_offset + y - this.y + editbox.complete = completion.complete_filter + editbox:SetPoint('RIGHT', start_button, 'LEFT', -4, 0) + editbox:SetHeight(25) + editbox.char = function() + this:complete() + end + editbox:SetScript('OnTabPressed', function() + this:HighlightText(0, 0) + end) + editbox.enter = execute + private.search_box = editbox +end +do + gui.horizontal_line(frame, -40) +end +do + local btn = gui.button(frame, gui.font_size.large) + btn:SetPoint('BOTTOMLEFT', AuxFrame.content, 'TOPLEFT', 10, 8) + btn:SetWidth(243) + btn:SetHeight(22) + btn:SetText'Search Results' + btn:SetScript('OnClick', function() subtab = RESULTS end) + private.search_results_button = btn +end +do + local btn = gui.button(frame, gui.font_size.large) + btn:SetPoint('TOPLEFT', search_results_button, 'TOPRIGHT', 5, 0) + btn:SetWidth(243) + btn:SetHeight(22) + btn:SetText'Saved Searches' + btn:SetScript('OnClick', function() subtab = SAVED end) + private.saved_searches_button = btn +end +do + local btn = gui.button(frame, gui.font_size.large) + btn:SetPoint('TOPLEFT', saved_searches_button, 'TOPRIGHT', 5, 0) + btn:SetWidth(243) + btn:SetHeight(22) + btn:SetText'Filter Builder' + btn:SetScript('OnClick', function() subtab = FILTER end) + private.new_filter_button = btn +end +do + local frame = CreateFrame('Frame', nil, frame) + frame:SetWidth(265) + frame:SetHeight(25) + frame:SetPoint('TOPLEFT', AuxFrame.content, 'BOTTOMLEFT', 0, -6) + private.status_bar_frame = frame +end +do + local btn = gui.button(frame.results) + btn:SetPoint('TOPLEFT', status_bar_frame, 'TOPRIGHT', 5, 0) + btn:SetText'Bid' + btn:Disable() + private.bid_button = btn +end +do + local btn = gui.button(frame.results) + btn:SetPoint('TOPLEFT', bid_button, 'TOPRIGHT', 5, 0) + btn:SetText'Buyout' + btn:Disable() + private.buyout_button = btn +end +do + local btn = gui.button(frame.results) + btn:SetPoint('TOPLEFT', buyout_button, 'TOPRIGHT', 5, 0) + btn:SetText('Clear') + btn:SetScript('OnClick', function() + while tremove(current_search.records) do end + current_search.table:SetDatabase() + end) +end +do + local btn = gui.button(frame.saved) + btn:SetPoint('TOPLEFT', status_bar_frame, 'TOPRIGHT', 5, 0) + btn:SetText'Favorite' + btn:SetScript('OnClick', function() + local queries, error = filter_util.queries(search_box:GetText()) + if queries then + tinsert(aux_favorite_searches, 1, T( + 'filter_string', search_box:GetText(), + 'prettified', join(map(queries, function(query) return query.prettified end), ';') + )) + else + print('Invalid filter:', error) + end + update_search_listings() + end) +end +do + local btn1 = gui.button(frame.filter) + btn1:SetPoint('TOPLEFT', status_bar_frame, 'TOPRIGHT', 5, 0) + btn1:SetText'Search' + btn1:SetScript('OnClick', function() + export_filter_string() + execute() + end) - aux_search_tab_filter.set_filter_display_offset(new_x_offset - this.x_extra, new_y_offset - this.y_extra) + local btn2 = gui.button(frame.filter) + btn2:SetPoint('LEFT', btn1, 'RIGHT', 5, 0) + btn2:SetText'Export' + btn2:SetScript('OnClick', export_filter_string) - this.x_extra = max(this.x_extra, new_x_offset) - this.y_extra = min(this.y_extra, new_y_offset) - end) - end) - scroll_frame:SetScript('OnDragStop', function() - this:SetScript('OnUpdate', nil) - end) - gui.set_content_style(scroll_frame, -2, -2, -2, -2) - local scroll_child = CreateFrame('SimpleHTML', nil, scroll_frame) - scroll_frame:SetScrollChild(scroll_child) - scroll_child:SetFont('p', [[Fonts\ARIALN.TTF]], 23) - scroll_child:SetTextColor('p', color.label.enabled()) - scroll_child:SetWidth(1) - scroll_child:SetHeight(1) - scroll_child:SetScript('OnHyperlinkClick', aux_search_tab_filter.data_link_click) --- scroll_child:SetHyperlinkFormat("format") TODO - scroll_child.measure = scroll_child:CreateFontString() - public.filter_display = scroll_child - end - - public.status_bars = t - public.tables = t - for _ = 1, 5 do - local status_bar = gui.status_bar(frame) - status_bar:SetAllPoints(status_bar_frame) - status_bar:Hide() - tinsert(status_bars, status_bar) - - local table = auction_listing.CreateAuctionResultsTable(frame.results, auction_listing.search_config) - table:SetHandler('OnCellClick', function(cell, button) - if IsAltKeyDown() and aux_search_tab_results.current_search.table:GetSelection().record == cell.row.data.record then - if button == 'LeftButton' and buyout_button:IsEnabled() then - buyout_button:Click() - elseif button == 'RightButton' and bid_button:IsEnabled() then - bid_button:Click() - end - end - end) - table:SetHandler('OnSelectionChanged', function(rt, datum) - if not datum then return end - aux_search_tab_results.find_auction(datum.record) - end) - table:Hide() - tinsert(tables, table) - end - - local handlers = { - OnClick = function(st, data, _, button) - if not data then return end - if button == 'LeftButton' and IsShiftKeyDown() then - search_box:SetText(data.search.filter_string) - elseif button == 'RightButton' and IsShiftKeyDown() then - add_filter(data.search.filter_string) - elseif button == 'LeftButton' and IsControlKeyDown() then - if st == favorite_searches_listing and data.index > 1 then - local temp = aux_favorite_searches[data.index - 1] - aux_favorite_searches[data.index - 1] = data.search - aux_favorite_searches[data.index] = temp - aux_search_tab_saved.update_search_listings() - end - elseif button == 'RightButton' and IsControlKeyDown() then - if st == favorite_searches_listing and data.index < getn(aux_favorite_searches) then - local temp = aux_favorite_searches[data.index + 1] - aux_favorite_searches[data.index + 1] = data.search - aux_favorite_searches[data.index] = temp - aux_search_tab_saved.update_search_listings() - end - elseif button == 'LeftButton' then - search_box:SetText(data.search.filter_string) - execute() - elseif button == 'RightButton' then - if st == recent_searches_listing then - tinsert(aux_favorite_searches, 1, data.search) - elseif st == favorite_searches_listing then - tremove(aux_favorite_searches, data.index) - end - aux_search_tab_saved.update_search_listings() - end - end, - OnEnter = function(st, data, self) - if not data then return end - GameTooltip_SetDefaultAnchor(GameTooltip, UIParent) - GameTooltip:AddLine(gsub(data.search.prettified, ';', '\n\n'), 255/255, 254/255, 250/255, true) - GameTooltip:Show() - end, - OnLeave = function() - GameTooltip:ClearLines() - GameTooltip:Hide() + local btn3 = gui.button(frame.filter) + btn3:SetPoint('LEFT', btn2, 'RIGHT', 5, 0) + btn3:SetText'Import' + btn3:SetScript('OnClick', import_filter_string) +end +do + local editbox = gui.editbox(frame.filter) + editbox.complete_item = completion.complete(function() return aux_auctionable_items end) + editbox:SetPoint('TOPLEFT', 14, -FILTER_SPACING) + editbox:SetWidth(260) + editbox.char = function() + if blizzard_query.exact then + this:complete_item() + end + end + editbox:SetScript('OnTabPressed', function() + if blizzard_query.exact then + return end - } + if IsShiftKeyDown() then + max_level_input:SetFocus() + else + min_level_input:SetFocus() + end + end) + editbox.change = update_form + editbox.enter = papply(editbox.ClearFocus, editbox) + local label = gui.label(editbox, gui.font_size.small) + label:SetPoint('BOTTOMLEFT', editbox, 'TOPLEFT', -2, 1) + label:SetText'Name' + private.name_input = editbox +end +do + local checkbox = gui.checkbox(frame.filter) + checkbox:SetPoint('TOPLEFT', name_input, 'TOPRIGHT', 16, 0) + checkbox:SetScript('OnClick', update_form) + local label = gui.label(checkbox, gui.font_size.small) + label:SetPoint('BOTTOMLEFT', checkbox, 'TOPLEFT', -2, 1) + label:SetText'Exact' + private.exact_checkbox = checkbox +end +do + local editbox = gui.editbox(frame.filter) + editbox:SetPoint('TOPLEFT', name_input, 'BOTTOMLEFT', 0, -FILTER_SPACING) + editbox:SetWidth(125) + editbox:SetNumeric(true) + editbox:SetScript('OnTabPressed', function() + if IsShiftKeyDown() then + name_input:SetFocus() + else + max_level_input:SetFocus() + end + end) + editbox.enter = papply(editbox.ClearFocus, editbox) + editbox.change = function() + local valid_level = valid_level(this:GetText()) + if tostring(valid_level) ~= this:GetText() then + this:SetText(valid_level or '') + end + update_form() + end + local label = gui.label(editbox, gui.font_size.small) + label:SetPoint('BOTTOMLEFT', editbox, 'TOPLEFT', -2, 1) + label:SetText'Level Range' + private.min_level_input = editbox +end +do + local editbox = gui.editbox(frame.filter) + editbox:SetPoint('TOPLEFT', min_level_input, 'TOPRIGHT', 10, 0) + editbox:SetWidth(125) + editbox:SetNumeric(true) + editbox:SetScript('OnTabPressed', function() + if IsShiftKeyDown() then + min_level_input:SetFocus() + else + name_input:SetFocus() + end + end) + editbox.enter = papply(editbox.ClearFocus, editbox) + editbox.change = function() + local valid_level = valid_level(this:GetText()) + if tostring(valid_level) ~= this:GetText() then + this:SetText(valid_level or '') + end + update_form() + end + local label = gui.label(editbox, gui.font_size.medium) + label:SetPoint('RIGHT', editbox, 'LEFT', -3, 0) + label:SetText'-' + private.max_level_input = editbox +end +do + local checkbox = gui.checkbox(frame.filter) + checkbox:SetPoint('TOPLEFT', max_level_input, 'TOPRIGHT', 16, 0) + checkbox:SetScript('OnClick', update_form) + local label = gui.label(checkbox, gui.font_size.small) + label:SetPoint('BOTTOMLEFT', checkbox, 'TOPLEFT', -2, 1) + label:SetText'Usable' + private.usable_checkbox = checkbox +end +do + local dropdown = gui.dropdown(frame.filter) + private.class_dropdown = dropdown + dropdown:SetPoint('TOPLEFT', min_level_input, 'BOTTOMLEFT', 0, 5 - FILTER_SPACING) + dropdown:SetWidth(300) + local label = gui.label(dropdown, gui.font_size.small) + label:SetPoint('BOTTOMLEFT', dropdown, 'TOPLEFT', -2, -3) + label:SetText'Item Class' + UIDropDownMenu_Initialize(dropdown, initialize_class_dropdown) + dropdown:SetScript('OnShow', function() + UIDropDownMenu_Initialize(this, initialize_class_dropdown) + end) +end +do + local dropdown = gui.dropdown(frame.filter) + private.subclass_dropdown = dropdown + dropdown:SetPoint('TOPLEFT', class_dropdown, 'BOTTOMLEFT', 0, 10 - FILTER_SPACING) + dropdown:SetWidth(300) + local label = gui.label(dropdown, gui.font_size.small) + label:SetPoint('BOTTOMLEFT', dropdown, 'TOPLEFT', -2, -3) + label:SetText'Item Subclass' + UIDropDownMenu_Initialize(dropdown, initialize_subclass_dropdown) + dropdown:SetScript('OnShow', function() + UIDropDownMenu_Initialize(this, initialize_subclass_dropdown) + end) +end +do + local dropdown = gui.dropdown(frame.filter) + private.slot_dropdown = dropdown + dropdown:SetPoint('TOPLEFT', subclass_dropdown, 'BOTTOMLEFT', 0, 10 - FILTER_SPACING) + dropdown:SetWidth(300) + local label = gui.label(dropdown, gui.font_size.small) + label:SetPoint('BOTTOMLEFT', dropdown, 'TOPLEFT', -2, -3) + label:SetText'Item Slot' + UIDropDownMenu_Initialize(dropdown, initialize_slot_dropdown) + dropdown:SetScript('OnShow', function() + UIDropDownMenu_Initialize(this, initialize_slot_dropdown) + end) +end +do + local dropdown = gui.dropdown(frame.filter) + private.quality_dropdown = dropdown + dropdown:SetPoint('TOPLEFT', slot_dropdown, 'BOTTOMLEFT', 0, 10 - FILTER_SPACING) + dropdown:SetWidth(300) + local label = gui.label(dropdown, gui.font_size.small) + label:SetPoint('BOTTOMLEFT', dropdown, 'TOPLEFT', -2, -3) + label:SetText'Min Quality' + UIDropDownMenu_Initialize(dropdown, initialize_quality_dropdown) + dropdown:SetScript('OnShow', function() + UIDropDownMenu_Initialize(this, initialize_quality_dropdown) + end) +end +gui.vertical_line(frame.filter, 332) +do + local dropdown = gui.dropdown(frame.filter) + dropdown:SetPoint('TOPRIGHT', -174.5, -10) + dropdown:SetWidth(150) + UIDropDownMenu_Initialize(dropdown, initialize_filter_dropdown) + dropdown:SetScript('OnShow', function() + UIDropDownMenu_Initialize(this, initialize_filter_dropdown) + end) + _G[dropdown:GetName() .. 'Text']:Hide() + local label = gui.label(dropdown, gui.font_size.medium) + label:SetPoint('RIGHT', dropdown, 'LEFT', -15, 0) + label:SetText'Post Filter' + private.filter_dropdown = dropdown +end +do + local input = gui.editbox(frame.filter) + input:SetPoint('CENTER', filter_dropdown, 'CENTER', 0, 0) + input:SetWidth(150) + input:SetScript('OnTabPressed', function() filter_parameter_input:SetFocus() end) + input.complete = completion.complete(function() return temp-A('and', 'or', 'not', unpack(keys(filter_util.filters))) end) + input.char = function() this:complete() end + input.change = function() + local text = this:GetText() + if filter_util.filters[text] and filter_util.filters[text].input_type ~= '' then + local _, _, suggestions = filter_util.parse_filter_string(text .. '/') + filter_parameter_input:SetNumeric(filter_util.filters[text].input_type == 'number') + filter_parameter_input.complete = completion.complete(function() return suggestions or empty end) + filter_parameter_input:Show() + else + filter_parameter_input:Hide() + end + end + input.enter = function() + if filter_parameter_input:IsVisible() then + filter_parameter_input:SetFocus() + else + add_post_filter() + end + end + private.filter_input = input +end +do + local input = gui.editbox(frame.filter) + input:SetPoint('LEFT', filter_dropdown, 'RIGHT', 10, 0) + input:SetWidth(150) + input:SetScript('OnTabPressed', function() + filter_input:SetFocus() + end) + input.char = function() this:complete() end + input.enter = add_post_filter + input:Hide() + private.filter_parameter_input = input +end +do + local scroll_frame = CreateFrame('ScrollFrame', nil, frame.filter) + scroll_frame:SetWidth(395) + scroll_frame:SetHeight(270) + scroll_frame:SetPoint('TOPLEFT', 348.5, -50) + scroll_frame:EnableMouse(true) + scroll_frame:EnableMouseWheel(true) + scroll_frame:SetScript('OnMouseWheel', function() + local child = this:GetScrollChild() + child:SetFont('p', [[Fonts\ARIALN.TTF]], bounded(11, 23, select(2, child:GetFont()) + arg1*2)) + update_filter_display() + end) + scroll_frame:RegisterForDrag'LeftButton' + scroll_frame:SetScript('OnDragStart', function() + this.x, this.y = GetCursorPosition() + this.x_offset, this.y_offset = this:GetHorizontalScroll(), this:GetVerticalScroll() + this.x_extra, this.y_extra = 0, 0 + this:SetScript('OnUpdate', function() + local x, y = GetCursorPosition() + local new_x_offset = this.x_offset + x - this.x + local new_y_offset = this.y_offset + y - this.y - public.recent_searches_listing = listing.CreateScrollingTable(frame.saved.recent) - recent_searches_listing:SetColInfo{{ name='Recent Searches', width=1 }} - recent_searches_listing:EnableSorting(false) - recent_searches_listing:DisableSelection(true) - recent_searches_listing:SetHandler('OnClick', handlers.OnClick) - recent_searches_listing:SetHandler('OnEnter', handlers.OnEnter) - recent_searches_listing:SetHandler('OnLeave', handlers.OnLeave) + set_filter_display_offset(new_x_offset - this.x_extra, new_y_offset - this.y_extra) - public.favorite_searches_listing = listing.CreateScrollingTable(frame.saved.favorite) - favorite_searches_listing:SetColInfo{{ name='Favorite Searches', width=1 }} - favorite_searches_listing:EnableSorting(false) - favorite_searches_listing:DisableSelection(true) - favorite_searches_listing:SetHandler('OnClick', handlers.OnClick) - favorite_searches_listing:SetHandler('OnEnter', handlers.OnEnter) - favorite_searches_listing:SetHandler('OnLeave', handlers.OnLeave) -end \ No newline at end of file + this.x_extra = max(this.x_extra, new_x_offset) + this.y_extra = min(this.y_extra, new_y_offset) + end) + end) + scroll_frame:SetScript('OnDragStop', function() + this:SetScript('OnUpdate', nil) + end) + gui.set_content_style(scroll_frame, -2, -2, -2, -2) + local scroll_child = CreateFrame('SimpleHTML', nil, scroll_frame) + scroll_frame:SetScrollChild(scroll_child) + scroll_child:SetFont('p', [[Fonts\ARIALN.TTF]], 23) + scroll_child:SetTextColor('p', color.label.enabled()) + scroll_child:SetWidth(1) + scroll_child:SetHeight(1) + scroll_child:SetScript('OnHyperlinkClick', data_link_click) +-- scroll_child:SetHyperlinkFormat("format") TODO + scroll_child.measure = scroll_child:CreateFontString() + private.filter_display = scroll_child +end + +private.status_bars = t +private.tables = t +for _ = 1, 5 do + local status_bar = gui.status_bar(frame) + status_bar:SetAllPoints(status_bar_frame) + status_bar:Hide() + tinsert(status_bars, status_bar) + + local table = auction_listing.CreateAuctionResultsTable(frame.results, auction_listing.search_config) + table:SetHandler('OnCellClick', function(cell, button) + if IsAltKeyDown() and current_search.table:GetSelection().record == cell.row.data.record then + if button == 'LeftButton' and buyout_button:IsEnabled() then + buyout_button:Click() + elseif button == 'RightButton' and bid_button:IsEnabled() then + bid_button:Click() + end + end + end) + table:SetHandler('OnSelectionChanged', function(rt, datum) + if not datum then return end + find_auction(datum.record) + end) + table:Hide() + tinsert(tables, table) +end + +local handlers = { + OnClick = function(st, data, _, button) + if not data then return end + if button == 'LeftButton' and IsShiftKeyDown() then + search_box:SetText(data.search.filter_string) + elseif button == 'RightButton' and IsShiftKeyDown() then + add_filter(data.search.filter_string) + elseif button == 'LeftButton' and IsControlKeyDown() then + if st == favorite_searches_listing and data.index > 1 then + local temp = aux_favorite_searches[data.index - 1] + aux_favorite_searches[data.index - 1] = data.search + aux_favorite_searches[data.index] = temp + update_search_listings() + end + elseif button == 'RightButton' and IsControlKeyDown() then + if st == favorite_searches_listing and data.index < getn(aux_favorite_searches) then + local temp = aux_favorite_searches[data.index + 1] + aux_favorite_searches[data.index + 1] = data.search + aux_favorite_searches[data.index] = temp + update_search_listings() + end + elseif button == 'LeftButton' then + search_box:SetText(data.search.filter_string) + execute() + elseif button == 'RightButton' then + if st == recent_searches_listing then + tinsert(aux_favorite_searches, 1, data.search) + elseif st == favorite_searches_listing then + tremove(aux_favorite_searches, data.index) + end + update_search_listings() + end + end, + OnEnter = function(st, data, self) + if not data then return end + GameTooltip_SetDefaultAnchor(GameTooltip, UIParent) + GameTooltip:AddLine(gsub(data.search.prettified, ';', '\n\n'), 255/255, 254/255, 250/255, true) + GameTooltip:Show() + end, + OnLeave = function() + GameTooltip:ClearLines() + GameTooltip:Hide() + end +} + +private.recent_searches_listing = listing.CreateScrollingTable(frame.saved.recent) +recent_searches_listing:SetColInfo{{ name='Recent Searches', width=1 }} +recent_searches_listing:EnableSorting(false) +recent_searches_listing:DisableSelection(true) +recent_searches_listing:SetHandler('OnClick', handlers.OnClick) +recent_searches_listing:SetHandler('OnEnter', handlers.OnEnter) +recent_searches_listing:SetHandler('OnLeave', handlers.OnLeave) + +private.favorite_searches_listing = listing.CreateScrollingTable(frame.saved.favorite) +favorite_searches_listing:SetColInfo{{ name='Favorite Searches', width=1 }} +favorite_searches_listing:EnableSorting(false) +favorite_searches_listing:DisableSelection(true) +favorite_searches_listing:SetHandler('OnClick', handlers.OnClick) +favorite_searches_listing:SetHandler('OnEnter', handlers.OnEnter) +favorite_searches_listing:SetHandler('OnLeave', handlers.OnLeave) \ No newline at end of file diff --git a/tabs/search/results.lua b/tabs/search/results.lua index e9fdbe6..7a16af5 100644 --- a/tabs/search/results.lua +++ b/tabs/search/results.lua @@ -1,20 +1,16 @@ -aux_search_tab_results = module +module 'aux.tabs.search' -include (green_t) -include (aux) -include (aux_util) -include (aux_control) -include (aux_util_color) +local info = require 'aux.util.info' +local filter_util = require 'aux.util.filter' +local scan_util = require 'aux.util.scan' +local scan = require 'aux.core.scan' function LOAD() - include (aux_search_tab) - new_search('') + new_search'' current_search.dummy = true update_auto_buy_filter() end -local info, scan = aux_info, aux_scan - aux_auto_buy_filter = '' do @@ -49,20 +45,20 @@ end do local id = 0 - function public.search_scan_id.get() return id end - function public.search_scan_id.set(v) id = v end + function private.search_scan_id.get() return id end + function private.search_scan_id.set(v) id = v end end do local validator - function public.auto_buy_validator.get() return validator end - function public.auto_buy_validator.set(v) validator = v end + function private.auto_buy_validator.get() return validator end + function private.auto_buy_validator.set(v) validator = v end end do local searches = t local search_index = 1 - function public.current_search.get() + function private.current_search.get() return searches[search_index] end @@ -118,20 +114,20 @@ do update_search(getn(searches)) end - function public.previous_search() + function private.previous_search() search_box:ClearFocus() update_search(search_index - 1) subtab = RESULTS end - function public.next_search() + function private.next_search() search_box:ClearFocus() update_search(search_index + 1) subtab = RESULTS end end -function public.close_settings() +function private.close_settings() if settings_button.open then settings_button:Click() end @@ -165,7 +161,7 @@ end function private.update_auto_buy_filter() if aux_auto_buy_filter ~= '' then - local queries, error = aux_filter_util.queries(aux_auto_buy_filter) + local queries, error = filter_util.queries(aux_auto_buy_filter) if queries then if getn(queries) > 1 then print 'Error: The automatic buyout filter does not support multi-queries' @@ -232,7 +228,7 @@ function private.start_real_time_scan(query, search, continuation) init[new_records] = temp-values(map) if getn(new_records) > 2000 then - StaticPopup_Show('AUX_SEARCH_TABLE_FULL') + StaticPopup_Show'AUX_SEARCH_TABLE_FULL' else search.records = new_records search.table:SetDatabase(search.records) @@ -244,7 +240,7 @@ function private.start_real_time_scan(query, search, continuation) end, on_abort = function() search.status_bar:update_status(100, 100) - search.status_bar:set_text('Scan paused') + search.status_bar:set_text'Scan paused' search.continuation = next_page or not ignore_page and query.blizzard_query.first_page or true @@ -312,13 +308,13 @@ function private.start_search(queries, continuation) elseif getn(search.records) < 2000 then tinsert(search.records, auction_record) if getn(search.records) == 2000 then - StaticPopup_Show('AUX_SEARCH_TABLE_FULL') + StaticPopup_Show'AUX_SEARCH_TABLE_FULL' end end end, on_complete = function() search.status_bar:update_status(100, 100) - search.status_bar:set_text('Scan complete') + search.status_bar:set_text'Scan complete' if current_search == search and frame.results:IsVisible() and getn(search.records) == 0 then subtab = SAVED @@ -329,7 +325,7 @@ function private.start_search(queries, continuation) end, on_abort = function() search.status_bar:update_status(100, 100) - search.status_bar:set_text('Scan paused') + search.status_bar:set_text'Scan paused' if current_query then search.continuation = {current_query, current_page + 1} @@ -359,7 +355,7 @@ function public.execute(resume, real_time) end local filter_string = search_box:GetText() - local queries, error = aux_filter_util.queries(filter_string) + local queries, error = filter_util.queries(filter_string) if not queries then print('Invalid filter:', error) return @@ -385,7 +381,7 @@ function public.execute(resume, real_time) else new_search(filter_string) end - aux_search_tab_saved.new_recent_search(filter_string, join(map(copy(queries), function(filter) return filter.prettified end), ';')) + new_recent_search(filter_string, join(map(copy(queries), function(filter) return filter.prettified end), ';')) else current_search.records = t current_search.table:SetDatabase(current_search.records) @@ -428,7 +424,7 @@ do local state = IDLE local found_index - function public.find_auction(record) + function private.find_auction(record) local search = current_search if not search.table:ContainsRecord(record) or is_player(record.owner) then @@ -437,7 +433,7 @@ do scan.abort(scan_id) state = SEARCHING - scan_id = aux_scan_util.find( + scan_id = scan_util.find( record, current_search.status_bar, function() diff --git a/tabs/search/saved.lua b/tabs/search/saved.lua index 7d240da..5ca41f9 100644 --- a/tabs/search/saved.lua +++ b/tabs/search/saved.lua @@ -1,19 +1,9 @@ -aux_search_tab_saved = module - -include (green_t) -include (aux) -include (aux_util) -include (aux_control) -include (aux_util_color) - -function LOAD() - include (aux_search_tab) -end +module 'aux.tabs.search' aux_favorite_searches = t aux_recent_searches = t -function public.update_search_listings() +function private.update_search_listings() local favorite_search_rows = t for i, favorite_search in aux_favorite_searches do local name = strsub(favorite_search.prettified, 1, 250) @@ -37,7 +27,7 @@ function public.update_search_listings() recent_searches_listing:SetData(recent_search_rows) end -function public.new_recent_search(filter_string, prettified) +function private.new_recent_search(filter_string, prettified) tinsert(aux_recent_searches, 1, { filter_string = filter_string, prettified = prettified, diff --git a/util/core.lua b/util.lua similarity index 98% rename from util/core.lua rename to util.lua index 0d5d187..bd07140 100644 --- a/util/core.lua +++ b/util.lua @@ -1,7 +1,4 @@ -module 'aux.util' - -include 'green_t' -include 'aux' +module 'aux' do local classes, interfaces, objects = {}, {}, setmetatable({}, { __mode='k' })