From ac19eba7c63a29093df8328c412115493e035c4a Mon Sep 17 00:00:00 2001 From: Manuel Simon Hirsig Date: Fri, 26 Aug 2016 23:53:43 +0200 Subject: [PATCH] refactoring --- control.lua | 19 +++++++++++++++++-- core/tooltip.lua | 19 +++++++++++++++++-- tabs/post/core.lua | 28 +++++++++++++++++++++++++--- tabs/search/results.lua | 18 ++++++++++++++++-- 4 files changed, 75 insertions(+), 9 deletions(-) diff --git a/control.lua b/control.lua index dc51f42..6999447 100644 --- a/control.lua +++ b/control.lua @@ -1,8 +1,23 @@ aux 'core' event_frame = CreateFrame 'Frame' -mutable.listeners = t -mutable.threads = t + +do + local t = t + listeners + { + get = function() return t end, + set = function(v) t = v end, + } +end +do + local t = t + threads + { + get = function() return t end, + set = function(v) t = v end, + } +end do local thread_id diff --git a/core/tooltip.lua b/core/tooltip.lua index 2bf8139..67170f1 100644 --- a/core/tooltip.lua +++ b/core/tooltip.lua @@ -3,8 +3,23 @@ aux 'tooltip' local info, disenchant, cache, money, history = aux.info, aux.dise _G.aux_tooltip_value = true game_tooltip_hooks = t -mutable.hooked_setter = nil -mutable.game_tooltip_money = nil + +do + local c + hooked_setter + { + get = function() return c end, + set = function(v) c = v end, + } +end +do + local amount + game_tooltip_money + { + get = function() return amount end, + set = function(v) amount = v end, + } +end function LOAD() for name, f in game_tooltip_hooks do diff --git a/tabs/post/core.lua b/tabs/post/core.lua index 11f82c1..3d79238 100644 --- a/tabs/post/core.lua +++ b/tabs/post/core.lua @@ -32,9 +32,31 @@ end existing_auctions = t inventory_records = t -mutable.scan_id = 0 -mutable.selected_item = nil -mutable.refresh = nil + +do + local id = 0 + scan_id + { + get = function() return id end, + set = function(v) id = v end, + } +end +do + local item + selected_item + { + get = function() return item end, + set = function(v) item = v end, + } +end +do + local c = 0 + refresh + { + get = function() return c end, + set = function(v) c = v end, + } +end function LOAD() create_frames() diff --git a/tabs/search/results.lua b/tabs/search/results.lua index 0297dea..6babec1 100644 --- a/tabs/search/results.lua +++ b/tabs/search/results.lua @@ -2,8 +2,22 @@ aux 'search_tab' local info = aux.info _G.aux_auto_buy_filter = '' -mutable.search_scan_id = 0 -mutable.auto_buy_validator = nil +do + local id = 0 + search_scan_id + { + get = function() return id end, + set = function(v) id = v end, + } +end +do + local validator + auto_buy_validator + { + get = function() return validator end, + set = function(v) validator = v end, + } +end do local searches = t