ElEditors, Interface administrators, Administrators
70,868
edits
No edit summary |
No edit summary |
||
Line 462: | Line 462: | ||
AVG = 'Average', | AVG = 'Average', | ||
MAX = 'Max', | MAX = 'Max', | ||
TRAIT = {'Empowered', 'Enhanced', 'Useful', 'Heavy'} | TRAIT = {'Empowered', 'Enhanced', 'Useful', 'Heavy'}, | ||
PER = 'Per' | |||
} | } | ||
Line 555: | Line 556: | ||
end | end | ||
if inArgs('avg_hits') then | if inArgs('avg_hits') or inArgs('count') then | ||
-- Enable average/max if needed. | -- Enable average/max if needed. | ||
tbl_content.hit_count.hide = false | tbl_content.hit_count.hide = false | ||
Line 719: | Line 720: | ||
if (type == 'hit_count' and not hide) then | if (type == 'hit_count' and not hide) then | ||
reverseMultiplySpace(); | reverseMultiplySpace(); | ||
local avg_or_each = 'avg' | |||
if inArgs('count') then | |||
avg_or_each = 'each' | |||
end | |||
table.insert(hit_count_table, 1, 'avg') | table.insert(hit_count_table, 1, 'avg') | ||
Line 756: | Line 761: | ||
local value_row = tbl:tag('tr') | local value_row = tbl:tag('tr') | ||
function display(name) | function display(name, range_flag) | ||
local value = out[name]; | local range_factor; | ||
local cell_content = {} | |||
if range_flag == true then | |||
range_factor = 2 | |||
else | |||
range_factor = 1 | |||
end | |||
for i = 1, range_factor, 1 do | |||
local range_prefix = ''; | |||
if range_flag == true then | |||
if i == 1 then | |||
range_prefix = 'min_' | |||
else | |||
range_prefix = 'max_' | |||
end | |||
end | |||
local value = out[range_prefix .. name]; | |||
if (value ~= nil) then | |||
if (args.dump_names == 'true') then | |||
table.insert(cell_content, name) | |||
elseif value ~= 0 then | |||
table.insert(cell_content, formatnum(math.round(value, 2)) .. '%') | |||
else | |||
table.insert(cell_content, '-%') | |||
end | |||
end | end | ||
end | end | ||
if next(cell_content) then | |||
return value_row:tag('td'):wikitext(table.concat(cell_content, " ~ ")); | |||
else | |||
return value_row:tag('td'):wikitext('#ERROR') | |||
end | |||
end | end | ||
Line 833: | Line 859: | ||
table.sort(passive_tbl) | table.sort(passive_tbl) | ||
for k, v in ipairs(passive_tbl) do | for k, v in ipairs(passive_tbl) do | ||
table.insert(str_tbl, v) | table.insert(str_tbl, v) | ||
end | end | ||
display(concat(str_tbl) .. mode_flag) | if inArgs('range_max') then | ||
display(concat(str_tbl) .. mode_flag, true) | |||
else | |||
display(concat(str_tbl) .. mode_flag) | |||
end | |||
if (args.debug2 == 'true') then | if (args.debug2 == 'true') then | ||
ret2 = ret2 .. concat(str_tbl) .. '<br/>' | ret2 = ret2 .. concat(str_tbl) .. '<br/>' |