refactoring
This commit is contained in:
+2
-2
@@ -49,13 +49,13 @@ do
|
||||
end
|
||||
end
|
||||
}
|
||||
public.accessor.color = color_accessor(function(color)
|
||||
public.color.get = color_accessor(function(color)
|
||||
local r, g, b, a = unpack(color)
|
||||
return setmetatable({r/255, g/255, b/255, a}, mt)
|
||||
end)
|
||||
end
|
||||
|
||||
public.accessor.inline_color = color_accessor(function(color)
|
||||
public.inline_color.get = color_accessor(function(color)
|
||||
local r, g, b, a = unpack(color)
|
||||
return format('|c%02X%02X%02X%02X', a, r, g, b)
|
||||
end)
|
||||
|
||||
+1
-1
@@ -66,7 +66,7 @@ end
|
||||
|
||||
public.huge = 1.8*10^308
|
||||
|
||||
function public.accessor.modified() return IsShiftKeyDown() or IsControlKeyDown() or IsAltKeyDown() end
|
||||
function public.modified.get() return IsShiftKeyDown() or IsControlKeyDown() or IsAltKeyDown() end
|
||||
|
||||
--do TODO
|
||||
-- local _state = setmetatable({}, {__mode='kv'})
|
||||
|
||||
+1
-1
@@ -403,7 +403,7 @@ function public.item_quality_index(item_quality)
|
||||
end
|
||||
end
|
||||
|
||||
function public.accessor.inventory()
|
||||
function public.inventory.get()
|
||||
local bag, slot = 0, 0
|
||||
return function()
|
||||
if not GetBagName(bag) or slot >= GetContainerNumSlots(bag) then
|
||||
|
||||
@@ -4,7 +4,7 @@ _G.aux_datasets = t
|
||||
|
||||
do
|
||||
local dataset
|
||||
function public.accessor.dataset()
|
||||
function public.dataset.get()
|
||||
if not dataset then
|
||||
local dataset_key = format('%s|%s', GetCVar 'realmName', UnitFactionGroup 'player')
|
||||
dataset = _G.aux_datasets[dataset_key] or t
|
||||
|
||||
Reference in New Issue
Block a user