big refactoring

This commit is contained in:
Manuel Simon Hirsig
2016-08-19 11:57:12 +02:00
parent 667990f7d8
commit 7740ba2f7a
28 changed files with 271 additions and 266 deletions
+8 -8
View File
@@ -1,6 +1,6 @@
aux.module 'filter'
function private.default_filter(str)
function default_filter(str)
return {
input_type = '',
validator = function()
@@ -202,7 +202,7 @@ public.filters = {
},
}
function private.operator(str)
function operator(str)
local operator = str == 'not' and {'operator', 'not', 1}
for _, name in {'and', 'or'} do
for arity in aux.util.present(aux.util.select(3, strfind(str, '^'..name..'(%d*)$'))) do
@@ -259,12 +259,12 @@ do
end,
}
function private.blizzard_filter_parser()
function blizzard_filter_parser()
return setmetatable({}, mt)
end
end
function private.parse_parameter(input_type, str)
function parse_parameter(input_type, str)
if input_type == 'money' then
local money = aux.money.from_string(str)
return money and money > 0 and money or nil
@@ -372,7 +372,7 @@ function public.queries(query_string)
return queries
end
function private.suggestions(components)
function suggestions(components)
local suggestions = {}
if components.blizzard.name and aux.util.size(components.blizzard) == 1 then
@@ -455,7 +455,7 @@ function public.query_string(components)
return query_builder.get()
end
function private.prettified_query_string(components)
function prettified_query_string(components)
local prettified = m.query_builder()
for key, filter in components.blizzard do
@@ -505,7 +505,7 @@ function public.unquote(name)
return aux.util.select(3, strfind(name, '^<(.*)>$')) or name
end
function private.blizzard_query(components)
function blizzard_query(components)
local filters = components.blizzard
local query = {name=filters.name and filters.name[2]}
@@ -534,7 +534,7 @@ function private.blizzard_query(components)
return query
end
function private.validator(components)
function validator(components)
local validators = {}
for i, component in components.post do
+1 -1
View File
@@ -287,7 +287,7 @@ function public.tooltip(setter)
return tooltip, AuxTooltip.money
end
function private.item_charges(tooltip)
function item_charges(tooltip)
for _, line in tooltip do
local pattern = '^'..gsub(gsub(ITEM_SPELL_CHARGES_P1, '%%d', '(%%d+)'), '%%%d+%$d', '(%%d+)')..'$'
+5 -5
View File
@@ -1,11 +1,11 @@
aux.module 'money'
private.GOLD_TEXT = '|cffffd70ag|r'
private.SILVER_TEXT = '|cffc7c7cfs|r'
private.COPPER_TEXT = '|cffeda55fc|r'
GOLD_TEXT = '|cffffd70ag|r'
SILVER_TEXT = '|cffc7c7cfs|r'
COPPER_TEXT = '|cffeda55fc|r'
private.COPPER_PER_SILVER = 100
private.COPPER_PER_GOLD = 10000
COPPER_PER_SILVER = 100
COPPER_PER_GOLD = 10000
function public.gsc(money)
local gold = floor(money / m.COPPER_PER_GOLD)
+1 -1
View File
@@ -10,7 +10,7 @@ do
realm = GetCVar('realmName')
end
function private.get_dataset_key()
function get_dataset_key()
return realm..'|'..faction
end
end