big refactoring
This commit is contained in:
@@ -63,13 +63,13 @@ tabs = {}
|
||||
function public.tab(index, name)
|
||||
local module_env = getfenv(2)
|
||||
local tab = {name=name, env=module_env}
|
||||
function module_env.public.ACTIVE.get() return tab == active_tab end
|
||||
function module_env.public.getter.ACTIVE() return tab == active_tab end
|
||||
for _, handler in temp-{'OPEN', 'CLOSE', 'CLICK_LINK', 'USE_ITEM'} do module_env.mutable[handler] = nil end
|
||||
tabs[index] = tab
|
||||
end
|
||||
do
|
||||
local active_tab_index
|
||||
function private.active_tab.get() return tabs[active_tab_index] end
|
||||
function getter.active_tab() return tabs[active_tab_index] end
|
||||
function on_tab_click(index)
|
||||
call(active_tab_index and active_tab.env.CLOSE)
|
||||
active_tab_index = index
|
||||
@@ -88,7 +88,7 @@ end
|
||||
|
||||
do
|
||||
local locked
|
||||
function public.bid_in_progress.get() return locked end
|
||||
function public.getter.bid_in_progress() return locked end
|
||||
function public.place_bid(type, index, amount, on_success)
|
||||
if locked then return end
|
||||
local money = GetMoney()
|
||||
@@ -108,7 +108,7 @@ end
|
||||
|
||||
do
|
||||
local locked
|
||||
function public.cancel_in_progress.get() return locked end
|
||||
function public.getter.cancel_in_progress() return locked end
|
||||
function public.cancel_auction(index, on_success)
|
||||
if locked then return end
|
||||
locked = true
|
||||
|
||||
Reference in New Issue
Block a user