From c07c3dad6f9c878f7de8a12eb74c83e075dbd592 Mon Sep 17 00:00:00 2001 From: Manuel Simon Hirsig Date: Sun, 28 Aug 2016 03:00:16 +0200 Subject: [PATCH] refactoring --- aux-addon.lua | 10 +++++----- control.lua | 2 +- core/history.lua | 2 +- core/slash.lua | 6 +++--- core/tooltip.lua | 2 +- frame.lua | 6 +++--- gui/auction_listing.lua | 16 +++++++-------- gui/core.lua | 44 ++++++++++++++++++++--------------------- gui/listing.lua | 2 +- tabs/post/core.lua | 6 +++--- tabs/post/frame.lua | 34 +++++++++++++++---------------- tabs/search/core.lua | 2 +- tabs/search/filter.lua | 4 ++-- tabs/search/frame.lua | 24 +++++++++++----------- tabs/search/results.lua | 16 +++++++-------- util/scan.lua | 8 ++++---- 16 files changed, 92 insertions(+), 92 deletions(-) diff --git a/aux-addon.lua b/aux-addon.lua index f02198d..97cbc9c 100644 --- a/aux-addon.lua +++ b/aux-addon.lua @@ -14,7 +14,7 @@ do __call = function(self, name) if not modules[name] then module(aux.core) - aux = self + private.aux = self modules[name] = {env=M, interface=I} end setfenv(2, modules[name].env) @@ -176,7 +176,7 @@ function public.log(...) temp=arg DEFAULT_CHAT_FRAME:AddMessage(LIGHTYELLOW_FONT_COLOR_CODE..msg) end -local event_frame = CreateFrame 'Frame' +local event_frame = CreateFrame('Frame') for event in -temp-set('ADDON_LOADED', 'VARIABLES_LOADED', 'PLAYER_LOGIN', 'AUCTION_HOUSE_SHOW', 'AUCTION_HOUSE_CLOSED', 'AUCTION_BIDDER_LIST_UPDATE', 'AUCTION_OWNED_LIST_UPDATE') do event_frame:RegisterEvent(event) end @@ -297,12 +297,12 @@ do end function public.is_player(name, current) - local realm = GetCVar 'realmName' + local realm = GetCVar('realmName') return not current and index(_G.aux_characters, realm, name) or UnitName 'player' == name end function public.neutral_faction() - return not UnitFactionGroup 'npc' + return not UnitFactionGroup('npc') end function public.min_bid_increment(current_bid) @@ -342,7 +342,7 @@ do end function ADDON_LOADED.Blizzard_AuctionUI() - AuctionFrame:UnregisterEvent 'AUCTION_HOUSE_SHOW' + AuctionFrame:UnregisterEvent('AUCTION_HOUSE_SHOW') AuctionFrame:SetScript('OnHide', nil) hook('ShowUIPanel', function(...) temp=arg if arg[1] == AuctionFrame then return AuctionFrame:Show() end diff --git a/control.lua b/control.lua index 634f483..6ebe826 100644 --- a/control.lua +++ b/control.lua @@ -1,6 +1,6 @@ aux 'core' -event_frame = CreateFrame 'Frame' +event_frame = CreateFrame('Frame') local listeners, threads = t, t diff --git a/core/history.lua b/core/history.lua index d734661..dce6770 100644 --- a/core/history.lua +++ b/core/history.lua @@ -20,7 +20,7 @@ do local time = 0 function private.next_push.get() if time() > time then - local date = date '*t' + local date = date('*t') date.hour, date.min, date.sec = 24, 0, 0 time = time(date) end diff --git a/core/slash.lua b/core/slash.lua index f1b2c09..d8c48a3 100644 --- a/core/slash.lua +++ b/core/slash.lua @@ -51,7 +51,7 @@ function _G.SlashCmdList.AUX(command) _G.aux_ignore_owner = not _G.aux_ignore_owner log('Ignoring of owner '..(_G.aux_ignore_owner and 'enabled' or 'disabled')..'.') elseif arguments[1] == 'chars' and arguments[2] == 'add' then - local realm = GetCVar 'realmName' + local realm = GetCVar('realmName') _G.aux_characters[realm] = _G.aux_characters[realm] or {} for i = 3, getn(arguments) do local name = gsub(strlower(arguments[i]), '^%l', strupper) @@ -61,7 +61,7 @@ function _G.SlashCmdList.AUX(command) end end elseif arguments[1] == 'chars' and arguments[2] == 'remove' then - local realm = GetCVar 'realmName' + local realm = GetCVar('realmName') if not _G.aux_characters[realm] then return end @@ -73,7 +73,7 @@ function _G.SlashCmdList.AUX(command) end end elseif arguments[1] == 'chars' then - local realm = GetCVar 'realmName' + local realm = GetCVar('realmName') local chars = {} for name in _G.aux_characters[realm] or {} do tinsert(chars, name) diff --git a/core/tooltip.lua b/core/tooltip.lua index 6f08cee..f2d55a9 100644 --- a/core/tooltip.lua +++ b/core/tooltip.lua @@ -18,7 +18,7 @@ function LOAD() return unpack(ret) end) end - local orig = GameTooltip:GetScript 'OnTooltipAddMoney' + local orig = GameTooltip:GetScript('OnTooltipAddMoney') GameTooltip:SetScript('OnTooltipAddMoney', function(...) temp=arg if inside_hook then game_tooltip_money = arg1 diff --git a/frame.lua b/frame.lua index cc6f821..1a87b9b 100644 --- a/frame.lua +++ b/frame.lua @@ -14,7 +14,7 @@ do frame:SetMovable(true) frame:EnableMouse(true) frame:SetClampedToScreen(true) - frame:RegisterForDrag 'LeftButton' + frame:RegisterForDrag('LeftButton') frame:SetScript('OnDragStart', function() this:StartMoving() end) frame:SetScript('OnDragStop', function() this:StopMovingOrSizing() end) frame:SetScript('OnShow', function() PlaySound 'AuctionWindowOpen' end) @@ -34,7 +34,7 @@ do local btn = gui.button(aux_frame, 16) btn:SetPoint('BOTTOMRIGHT', -6, 6) gui.set_size(btn, 65, 24) - btn:SetText 'Close' + btn:SetText('Close') btn:SetScript('OnClick', L(aux_frame.Hide, aux_frame)) public.close_button = btn end @@ -42,7 +42,7 @@ do 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' + btn:SetText('Default UI') btn:SetScript('OnClick',function() if AuctionFrame:IsVisible() then HideUIPanel(AuctionFrame) else ShowUIPanel(AuctionFrame) end end) diff --git a/gui/auction_listing.lua b/gui/auction_listing.lua index ff3d096..70fadf0 100644 --- a/gui/auction_listing.lua +++ b/gui/auction_listing.lua @@ -508,7 +508,7 @@ public.bids_config = { fill = function(cell, record) local status if record.high_bidder then - status = color.yellow 'High Bidder' + status = color.yellow('High Bidder') else status = color.red 'Outbid' end @@ -732,9 +732,9 @@ local methods = { -- update sorting highlights for _, cell in self.headCells do local tex = cell:GetNormalTexture() - tex:SetTexture [[Interface\AddOns\aux-AddOn\WorldStateFinalScore-Highlight]] + tex:SetTexture([[Interface\AddOns\aux-AddOn\WorldStateFinalScore-Highlight]]) tex:SetTexCoord(.017, 1, .083, .909) - tex:SetAlpha(0.5) + tex:SetAlpha(.5) end if getn(self.sorts) > 0 then @@ -1062,8 +1062,8 @@ function public.CreateAuctionResultsTable(parent, config) cell:SetScript('OnClick', rt.OnHeadColumnClick) local text = cell:CreateFontString() - text:SetJustifyH 'CENTER' - text:SetJustifyV 'CENTER' + text:SetJustifyH('CENTER') + text:SetJustifyV('CENTER') text:SetFont(gui.font, 12) text:SetTextColor(color.label.enabled()) cell:SetFontString(text) @@ -1072,14 +1072,14 @@ function public.CreateAuctionResultsTable(parent, config) local tex = cell:CreateTexture() tex:SetAllPoints() - tex:SetTexture [[Interface\AddOns\aux-AddOn\WorldStateFinalScore-Highlight]] + tex:SetTexture([[Interface\AddOns\aux-AddOn\WorldStateFinalScore-Highlight]]) tex:SetTexCoord(.017, 1, .083, .909) tex:SetAlpha(.5) cell:SetNormalTexture(tex) local tex = cell:CreateTexture() tex:SetAllPoints() - tex:SetTexture [[Interface\Buttons\UI-Listbox-Highlight]] + tex:SetTexture([[Interface\Buttons\UI-Listbox-Highlight]]) tex:SetTexCoord(.025, .957, .087, .931) tex:SetAlpha(.2) cell:SetHighlightTexture(tex) @@ -1112,7 +1112,7 @@ function public.CreateAuctionResultsTable(parent, config) local text = cell:CreateFontString() text:SetFont(gui.font, min(14, rt.ROW_HEIGHT)) text:SetJustifyH(rt.config[j].align or 'LEFT') - text:SetJustifyV 'CENTER' + text:SetJustifyV('CENTER') text:SetPoint('TOPLEFT', 1, -1) text:SetPoint('BOTTOMRIGHT', -1, 1) cell:SetFontString(text) diff --git a/gui/core.lua b/gui/core.lua index 08b203d..49332ad 100644 --- a/gui/core.lua +++ b/gui/core.lua @@ -8,7 +8,7 @@ function LOAD() aux_border:SetTexture(1, 1, 1, .02) aux_border:SetPoint('TOPLEFT', DropDownList1Backdrop, 'TOPLEFT', -2, 2) aux_border:SetPoint('BOTTOMRIGHT', DropDownList1Backdrop, 'BOTTOMRIGHT', 1.5, -1.5) - aux_border:SetBlendMode 'ADD' + aux_border:SetBlendMode('ADD') aux_background = DropDownList1:CreateTexture(nil, 'OVERLAY') aux_background:SetTexture(color.content.background()) aux_background:SetAllPoints(DropDownList1Backdrop) @@ -42,7 +42,7 @@ function LOAD() text:SetPoint('BOTTOMRIGHT', -8, 0) local highlight = _G['DropDownList1Button'..i..'Highlight'] highlight:ClearAllPoints() - highlight:SetDrawLayer 'OVERLAY' + highlight:SetDrawLayer('OVERLAY') highlight:SetHeight(14) highlight:SetPoint('LEFT', 5, 0) highlight:SetPoint('RIGHT', -3, 0) @@ -64,7 +64,7 @@ function LOAD() text:SetShadowOffset(1, -1) local highlight = _G['DropDownList1Button'..i..'Highlight'] highlight:SetAllPoints() - highlight:SetDrawLayer 'BACKGROUND' + highlight:SetDrawLayer('BACKGROUND') local check = _G['DropDownList1Button'..i..'Check'] check:SetWidth(24) check:SetHeight(24) @@ -97,7 +97,7 @@ end do local menu, structure, orig menu = CreateFrame('Frame', name, UIParent, 'UIMenuTemplate') - orig = menu:GetScript 'OnShow' + orig = menu:GetScript('OnShow') menu:SetScript('OnShow', function() UIMenu_Initialize() for i = 1, getn(structure) do @@ -171,14 +171,14 @@ function public.button(parent, text_height) local highlight = button:CreateTexture(nil, 'HIGHLIGHT') highlight:SetAllPoints() highlight:SetTexture(1, 1, 1, .2) - highlight:SetBlendMode 'BLEND' + highlight:SetBlendMode('BLEND') button.highlight = highlight do local label = button:CreateFontString() label:SetFont(font, text_height) label:SetPoint('CENTER', 0, 0) - label:SetJustifyH 'CENTER' - label:SetJustifyV 'CENTER' + label:SetJustifyH('CENTER') + label:SetJustifyV('CENTER') label:SetHeight(text_height) label:SetTextColor(color.text.enabled()) button:SetFontString(label) @@ -226,14 +226,14 @@ do local highlight = tab:CreateTexture(nil, 'HIGHLIGHT') highlight:SetAllPoints() highlight:SetTexture(1, 1, 1, .2) - highlight:SetBlendMode 'BLEND' + highlight:SetBlendMode('BLEND') tab.highlight = highlight tab.text = tab:CreateFontString() tab.text:SetPoint('LEFT', 3, -1) tab.text:SetPoint('RIGHT', -3, -1) - tab.text:SetJustifyH 'CENTER' - tab.text:SetJustifyV 'CENTER' + tab.text:SetJustifyH('CENTER') + tab.text:SetJustifyV('CENTER') tab.text:SetFont(font, font_size.large2) tab:SetFontString(tab.text) @@ -241,7 +241,7 @@ do tab:SetScript('OnClick', function() if this.id ~= this.group.selected then - PlaySound 'igCharacterInfoTab' + PlaySound('igCharacterInfoTab') this.group:select(this.id) end end) @@ -373,11 +373,11 @@ function public.editbox(parent) display:SetTextColor(color.text.enabled()) editbox.display = display local cursor = label(editbox, font_size.large) - cursor:SetText '|' + cursor:SetText('|') cursor:SetTextColor(color.text.enabled()) cursor:SetAlpha(0) editbox.cursor = cursor - editbox:SetAlignment 'LEFT' + editbox:SetAlignment('LEFT') editbox:SetFontSize(font_size.medium) return editbox end @@ -389,10 +389,10 @@ function public.status_bar(parent) do -- minor status bar (gray one) local status_bar = CreateFrame('STATUSBAR', nil, self, 'TextStatusBar') - status_bar:SetOrientation 'HORIZONTAL' + status_bar:SetOrientation('HORIZONTAL') status_bar:SetMinMaxValues(0, 100) status_bar:SetAllPoints() - status_bar:SetStatusBarTexture [[Interface\Buttons\WHITE8X8]] + status_bar:SetStatusBarTexture([[Interface\Buttons\WHITE8X8]]) status_bar:SetStatusBarColor(.42, .42, .42, .7) status_bar:SetFrameLevel(level + 2) status_bar:SetScript('OnUpdate', function() @@ -407,10 +407,10 @@ function public.status_bar(parent) do -- major status bar (main blue one) local status_bar = CreateFrame('STATUSBAR', nil, self, 'TextStatusBar') - status_bar:SetOrientation 'HORIZONTAL' + status_bar:SetOrientation('HORIZONTAL') status_bar:SetMinMaxValues(0, 100) status_bar:SetAllPoints() - status_bar:SetStatusBarTexture [[Interface\Buttons\WHITE8X8]] + status_bar:SetStatusBarTexture([[Interface\Buttons\WHITE8X8]]) status_bar:SetStatusBarColor(.19, .22, .33, .9) status_bar:SetFrameLevel(level + 3) status_bar:SetScript('OnUpdate', function() @@ -456,7 +456,7 @@ function public.item(parent) item.texture = _G[btn:GetName()..'Icon'] item.texture:SetTexCoord(.06, .94, .06, .94) item.name = label(btn, 15) - item.name:SetJustifyH 'LEFT' + item.name:SetJustifyH('LEFT') item.name:SetPoint('LEFT', btn, 'RIGHT', 10, 0) item.name:SetPoint('RIGHT', item, 'RIGHT', -10, .5) item.count = _G[btn:GetName()..'Count'] @@ -524,7 +524,7 @@ end function public.slider(parent) local slider = CreateFrame('Slider', nil, parent) - slider:SetOrientation 'HORIZONTAL' + slider:SetOrientation('HORIZONTAL') slider:SetHeight(6) slider:SetHitRectInsets(0, 0, -12, -12) slider:SetValue(0) @@ -541,7 +541,7 @@ function public.slider(parent) local label = slider:CreateFontString(nil, 'OVERLAY') label:SetPoint('BOTTOMLEFT', slider, 'TOPLEFT', -3, 8) label:SetPoint('BOTTOMRIGHT', slider, 'TOPRIGHT', 6, 8) - label:SetJustifyH 'LEFT' + label:SetJustifyH('LEFT') label:SetHeight(13) label:SetFont(font, font_size.small) label:SetTextColor(color.label.enabled()) @@ -549,7 +549,7 @@ function public.slider(parent) local editbox = editbox(slider) editbox:SetPoint('LEFT', slider, 'RIGHT', 5, 0) set_size(editbox, 45, 18) - editbox:SetAlignment 'CENTER' + editbox:SetAlignment('CENTER') editbox:SetFontSize(17) slider.label = label @@ -567,6 +567,6 @@ function public.checkbox(parent) checkbox:GetHighlightTexture():SetAllPoints() checkbox:GetHighlightTexture():SetTexture(1, 1, 1, .2) checkbox:GetCheckedTexture():SetTexCoord(.12, .88, .12, .88) - checkbox:GetHighlightTexture 'BLEND' + checkbox:GetHighlightTexture('BLEND') return checkbox end \ No newline at end of file diff --git a/gui/listing.lua b/gui/listing.lua index 8b015e9..fd88a62 100644 --- a/gui/listing.lua +++ b/gui/listing.lua @@ -334,7 +334,7 @@ local methods = { local col = CreateFrame('Button', nil, row) local text = col:CreateFontString() text:SetFont(gui.font, ST_ROW_TEXT_SIZE) - text:SetJustifyV 'CENTER' + text:SetJustifyV('CENTER') text:SetPoint('TOPLEFT', 1, -1) text:SetPoint('BOTTOMRIGHT', -1, 1) col.text = text diff --git a/tabs/post/core.lua b/tabs/post/core.lua index 4367eb9..25bc23a 100644 --- a/tabs/post/core.lua +++ b/tabs/post/core.lua @@ -446,7 +446,7 @@ function refresh_entries() existing_auctions[item_key] = nil local query = scan_util.item_query(item_id) status_bar:update_status(0,0) - status_bar:set_text 'Scanning auctions...' + status_bar:set_text('Scanning auctions...') scan_id = scan.start{ type = 'list', @@ -472,13 +472,13 @@ function refresh_entries() existing_auctions[item_key] = nil update_historical_value_button() status_bar:update_status(100, 100) - status_bar:set_text 'Scan aborted' + status_bar:set_text('Scan aborted') end, on_complete = function() existing_auctions[item_key] = existing_auctions[item_key] or t refresh = true status_bar:update_status(100, 100) - status_bar:set_text 'Scan complete' + status_bar:set_text('Scan complete') end, } end diff --git a/tabs/post/frame.lua b/tabs/post/frame.lua index e540162..a0fb7d2 100644 --- a/tabs/post/frame.lua +++ b/tabs/post/frame.lua @@ -34,7 +34,7 @@ function create_frames() end) local label = gui.label(checkbox, gui.font_size.small) label:SetPoint('LEFT', checkbox, 'RIGHT', 4, 1) - label:SetText 'Show hidden items' + label:SetText('Show hidden items') show_hidden_checkbox = checkbox end @@ -86,14 +86,14 @@ function create_frames() status_bar:SetHeight(25) status_bar:SetPoint('TOPLEFT', aux_frame.content, 'BOTTOMLEFT', 0, -6) status_bar:update_status(100, 100) - status_bar:set_text '' + status_bar:set_text('') end do local btn = gui.button(frame.parameters, 16) btn:SetPoint('TOPLEFT', status_bar, 'TOPRIGHT', 5, 0) btn:SetWidth(80) btn:SetHeight(24) - btn:SetText 'Post' + btn:SetText('Post') btn:SetScript('OnClick', post_auctions) post_button = btn end @@ -102,7 +102,7 @@ function create_frames() btn:SetPoint('TOPLEFT', post_button, 'TOPRIGHT', 5, 0) btn:SetWidth(80) btn:SetHeight(24) - btn:SetText 'Refresh' + btn:SetText('Refresh') btn:SetScript('OnClick', function() scan.abort(scan_id) refresh_entries() @@ -150,7 +150,7 @@ function create_frames() end) slider.editbox:SetNumeric(true) slider.editbox:SetMaxLetters(3) - slider.label:SetText 'Stack Size' + slider.label:SetText('Stack Size') stack_size_slider = slider end do @@ -173,7 +173,7 @@ function create_frames() end end) slider.editbox:SetNumeric(true) - slider.label:SetText 'Stack Count' + slider.label:SetText('Stack Count') stack_count_slider = slider end do @@ -205,7 +205,7 @@ function create_frames() end) local label = gui.label(checkbox, gui.font_size.small) label:SetPoint('LEFT', checkbox, 'RIGHT', 4, 1) - label:SetText 'Hide this item' + label:SetText('Hide this item') hide_checkbox = checkbox end local function money_input() @@ -221,7 +221,7 @@ function create_frames() frame:SetHeight(22) local editbox = gui.editbox(frame) editbox:SetAllPoints() - editbox:SetAlignment 'RIGHT' + editbox:SetAlignment('RIGHT') editbox:SetFontSize(17) editbox:SetScript('OnTabPressed', function() if IsShiftKeyDown() and stack_count_slider.editbox:IsVisible() then @@ -250,18 +250,18 @@ function create_frames() editbox.pretty = gui.label(frame, 17) editbox.pretty:SetPoint('LEFT', 1, 0) editbox.pretty:SetPoint('RIGHT', -2, 0) - editbox.pretty:SetJustifyH 'RIGHT' + editbox.pretty:SetJustifyH('RIGHT') editbox.pretty:SetTextColor(color.text.enabled()) do local label = gui.label(frame, gui.font_size.small) label:SetPoint('BOTTOMLEFT', frame, 'TOPLEFT', -2, 1) - label:SetText 'Unit Starting Price' + label:SetText('Unit Starting Price') end do local label = gui.label(frame, 14) label:SetPoint('LEFT', frame, 'RIGHT', 8, 0) label:SetWidth(50) - label:SetJustifyH 'CENTER' + label:SetJustifyH('CENTER') start_price_percentage = label end unit_start_price = editbox @@ -275,7 +275,7 @@ function create_frames() frame:SetHeight(22) local editbox = gui.editbox(frame) editbox:SetAllPoints() - editbox:SetAlignment 'RIGHT' + editbox:SetAlignment('RIGHT') editbox:SetFontSize(17) editbox:SetScript('OnTabPressed', function() if IsShiftKeyDown() then @@ -302,18 +302,18 @@ function create_frames() editbox.pretty = gui.label(frame, 17) editbox.pretty:SetPoint('LEFT', 1, 0) editbox.pretty:SetPoint('RIGHT', -2, 0) - editbox.pretty:SetJustifyH 'RIGHT' + editbox.pretty:SetJustifyH('RIGHT') editbox.pretty:SetTextColor(color.text.enabled()) do local label = gui.label(frame, gui.font_size.small) label:SetPoint('BOTTOMLEFT', frame, 'TOPLEFT', -2, 1) - label:SetText 'Unit Buyout Price' + label:SetText('Unit Buyout Price') end do local label = gui.label(frame, 14) label:SetPoint('LEFT', frame, 'RIGHT', 8, 0) label:SetWidth(50) - label:SetJustifyH 'CENTER' + label:SetJustifyH('CENTER') buyout_price_percentage = label end unit_buyout_price = editbox @@ -322,7 +322,7 @@ function create_frames() local btn = gui.button(frame.parameters, 14) btn:SetPoint('TOPRIGHT', -10, -146) gui.set_size(btn, 150, 20) - btn:GetFontString():SetJustifyH 'RIGHT' + btn:GetFontString():SetJustifyH('RIGHT') btn:GetFontString():SetPoint('RIGHT', -2, 0) btn:SetScript('OnClick', function() if this.amount then @@ -332,7 +332,7 @@ function create_frames() end) local label = gui.label(btn, gui.font_size.small) label:SetPoint('BOTTOMLEFT', btn, 'TOPLEFT', -2, 1) - label:SetText 'Historical Value' + label:SetText('Historical Value') historical_value_button = btn end end \ No newline at end of file diff --git a/tabs/search/core.lua b/tabs/search/core.lua index 7919568..35203cc 100644 --- a/tabs/search/core.lua +++ b/tabs/search/core.lua @@ -53,7 +53,7 @@ function LOAD() create_frames() subtab = SAVED update_auto_buy_filter() - new_search '' + new_search('') current_search.placeholder = true end diff --git a/tabs/search/filter.lua b/tabs/search/filter.lua index 74f6199..e09a0b4 100644 --- a/tabs/search/filter.lua +++ b/tabs/search/filter.lua @@ -193,7 +193,7 @@ function public.formatted_post_filter(components) elseif i > 1 then str = str..'

' for _=1,getn(stack) do - str = str..color.content.background '----' + str = str..color.content.background('----') end end no_line_break = component[1] == 'operator' and component[2] == 'not' @@ -269,7 +269,7 @@ function add_post_filter() if components and getn(components.blizzard) == 0 and getn(components.post) == 1 then add_component(components.post[1]) update_filter_display() - filter_parameter_input:SetText '' + filter_parameter_input:SetText('') filter_input:HighlightText() filter_input:SetFocus() elseif error then diff --git a/tabs/search/frame.lua b/tabs/search/frame.lua index 60b1227..d3a5f99 100644 --- a/tabs/search/frame.lua +++ b/tabs/search/frame.lua @@ -246,7 +246,7 @@ function create_frames() btn:SetPoint('BOTTOMLEFT', aux_frame.content, 'TOPLEFT', 10, 8) btn:SetWidth(243) btn:SetHeight(22) - btn:SetText 'Search Results' + btn:SetText('Search Results') btn:SetScript('OnClick', function() subtab = RESULTS end) search_results_button = btn end @@ -255,7 +255,7 @@ function create_frames() btn:SetPoint('TOPLEFT', search_results_button, 'TOPRIGHT', 5, 0) btn:SetWidth(243) btn:SetHeight(22) - btn:SetText 'Saved Searches' + btn:SetText('Saved Searches') btn:SetScript('OnClick', function() subtab = SAVED end) saved_searches_button = btn end @@ -264,7 +264,7 @@ function create_frames() btn:SetPoint('TOPLEFT', saved_searches_button, 'TOPRIGHT', 5, 0) btn:SetWidth(243) btn:SetHeight(22) - btn:SetText 'Filter Builder' + btn:SetText('Filter Builder') btn:SetScript('OnClick', function() subtab = FILTER end) new_filter_button = btn end @@ -280,7 +280,7 @@ function create_frames() btn:SetPoint('TOPLEFT', status_bar_frame, 'TOPRIGHT', 5, 0) btn:SetWidth(80) btn:SetHeight(24) - btn:SetText 'Bid' + btn:SetText('Bid') btn:Disable() bid_button = btn end @@ -289,7 +289,7 @@ function create_frames() btn:SetPoint('TOPLEFT', bid_button, 'TOPRIGHT', 5, 0) btn:SetWidth(80) btn:SetHeight(24) - btn:SetText 'Buyout' + btn:SetText('Buyout') btn:Disable() buyout_button = btn end @@ -298,7 +298,7 @@ function create_frames() btn:SetPoint('TOPLEFT', buyout_button, 'TOPRIGHT', 5, 0) btn:SetWidth(80) btn:SetHeight(24) - btn:SetText 'Clear' + btn:SetText('Clear') btn:SetScript('OnClick', function() while tremove(current_search.records) do end current_search.table:SetDatabase() @@ -309,7 +309,7 @@ function create_frames() btn:SetPoint('TOPLEFT', status_bar_frame, 'TOPRIGHT', 5, 0) btn:SetWidth(80) btn:SetHeight(24) - btn:SetText 'Favorite' + btn:SetText('Favorite') btn:SetScript('OnClick', function() local filters = filter_util.queries(search_box:GetText()) if filters then @@ -325,7 +325,7 @@ function create_frames() local btn1 = gui.button(frame.filter, 16) btn1:SetPoint('TOPLEFT', status_bar_frame, 'TOPRIGHT', 5, 0) gui.set_size(btn1, 80, 24) - btn1:SetText 'Search' + btn1:SetText('Search') btn1:SetScript('OnClick', function() export_query_string() execute() @@ -334,13 +334,13 @@ function create_frames() local btn2 = gui.button(frame.filter, 16) btn2:SetPoint('LEFT', btn1, 'RIGHT', 5, 0) gui.set_size(btn2, 80, 24) - btn2:SetText 'Export' + btn2:SetText('Export') btn2:SetScript('OnClick', export_query_string) local btn3 = gui.button(frame.filter, 16) btn3:SetPoint('LEFT', btn2, 'RIGHT', 5, 0) gui.set_size(btn3, 80, 24) - btn3:SetText 'Import' + btn3:SetText('Import') btn3:SetScript('OnClick', import_query_string) end do @@ -367,7 +367,7 @@ function create_frames() editbox.enter = L(editbox.ClearFocus, editbox) local label = gui.label(editbox, gui.font_size.small) label:SetPoint('BOTTOMLEFT', editbox, 'TOPLEFT', -2, 1) - label:SetText 'Name' + label:SetText('Name') name_input = editbox end do @@ -401,7 +401,7 @@ function create_frames() end local label = gui.label(editbox, gui.font_size.small) label:SetPoint('BOTTOMLEFT', editbox, 'TOPLEFT', -2, 1) - label:SetText 'Level Range' + label:SetText('Level Range') min_level_input = editbox end do diff --git a/tabs/search/results.lua b/tabs/search/results.lua index 6e23d5f..3a206da 100644 --- a/tabs/search/results.lua +++ b/tabs/search/results.lua @@ -67,7 +67,7 @@ do search.status_bar = status_bars[getn(searches)] search.status_bar:update_status(100, 100) - search.status_bar:set_text '' + search.status_bar:set_text('') search.table = tables[getn(searches)] search.table:SetSort(1, 2, 3, 4, 5, 6, 7, 8, 9) @@ -192,7 +192,7 @@ function start_real_time_scan(query, search, continuation) end if getn(new_records) > 1000 then - StaticPopup_Show 'AUX_SEARCH_TABLE_FULL' + StaticPopup_Show('AUX_SEARCH_TABLE_FULL') else search.records = new_records search.table:SetDatabase(search.records) @@ -204,7 +204,7 @@ function 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 @@ -244,9 +244,9 @@ function start_search(queries, continuation) on_scan_start = function() search.status_bar:update_status(0,0) if continuation then - search.status_bar:set_text 'Resuming scan...' + search.status_bar:set_text('Resuming scan...') else - search.status_bar:set_text 'Scanning auctions...' + search.status_bar:set_text('Scanning auctions...') end end, on_page_loaded = function(_, total_scan_pages) @@ -272,13 +272,13 @@ function start_search(queries, continuation) elseif getn(search.records) < 1000 then tinsert(search.records, auction_record) if getn(search.records) == 1000 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 @@ -289,7 +289,7 @@ function 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} diff --git a/util/scan.lua b/util/scan.lua index 88933ef..0148b1a 100644 --- a/util/scan.lua +++ b/util/scan.lua @@ -37,7 +37,7 @@ function public.find(auction_record, status_bar, on_abort, on_failure, on_succes queries = queries, on_scan_start = function() status_bar:update_status(0, 0) - status_bar:set_text 'Searching auction...' + status_bar:set_text('Searching auction...') end, on_start_query = function(query_index) status_bar:update_status((query_index - 1) / getn(queries) * 100, 0) @@ -47,20 +47,20 @@ function public.find(auction_record, status_bar, on_abort, on_failure, on_succes found = true ctrl.suspend() status_bar:update_status(100, 100) - status_bar:set_text 'Auction found' + status_bar:set_text('Auction found') return on_success(auction_record.index) end end, on_abort = function() if not found then status_bar:update_status(100, 100) - status_bar:set_text 'Auction not found' + status_bar:set_text('Auction not found') return on_abort() end end, on_complete = function() status_bar:update_status(100, 100) - status_bar:set_text 'Auction not found' + status_bar:set_text('Auction not found') return on_failure() end, }