refactoring

This commit is contained in:
Manuel Simon Hirsig
2016-09-04 21:21:47 +02:00
parent e888efcf2a
commit 867505c1a8
23 changed files with 172 additions and 173 deletions
+12 -12
View File
@@ -30,28 +30,28 @@ function _G.SlashCmdList.AUX(command)
aux.cache.populate_wdb()
elseif arguments[1] == 'tooltip' and arguments[2] == 'value' then
_G.aux_tooltip_value = not _G.aux_tooltip_value
print('Historical value in tooltip '..(_G.aux_tooltip_value and 'enabled' or 'disabled')..'.')
print('Historical value in tooltip ' .. (_G.aux_tooltip_value and 'enabled' or 'disabled') .. '.')
elseif arguments[1] == 'tooltip' and arguments[2] == 'daily' then
_G.aux_tooltip_daily = not _G.aux_tooltip_daily
print('Market value in tooltip '..(_G.aux_tooltip_daily and 'enabled' or 'disabled')..'.')
print('Market value in tooltip ' .. (_G.aux_tooltip_daily and 'enabled' or 'disabled') .. '.')
elseif arguments[1] == 'tooltip' and arguments[2] == 'vendor' and arguments[3] == 'buy' then
_G.aux_tooltip_vendor_buy = not _G.aux_tooltip_vendor_buy
print('Vendor buy price in tooltip '..(_G.aux_tooltip_vendor_buy and 'enabled' or 'disabled')..'.')
print('Vendor buy price in tooltip ' .. (_G.aux_tooltip_vendor_buy and 'enabled' or 'disabled') .. '.')
elseif arguments[1] == 'tooltip' and arguments[2] == 'vendor' and arguments[3] == 'sell' then
_G.aux_tooltip_vendor_sell = not _G.aux_tooltip_vendor_sell
print('Vendor sell price in tooltip '..(_G.aux_tooltip_vendor_sell and 'enabled' or 'disabled')..'.')
print('Vendor sell price in tooltip ' .. (_G.aux_tooltip_vendor_sell and 'enabled' or 'disabled') .. '.')
elseif arguments[1] == 'tooltip' and arguments[2] == 'disenchant' and arguments[3] == 'value' then
_G.aux_tooltip_disenchant_value = not _G.aux_tooltip_disenchant_value
print('Disenchant value in tooltip '..(_G.aux_tooltip_disenchant_value and 'enabled' or 'disabled')..'.')
print('Disenchant value in tooltip ' .. (_G.aux_tooltip_disenchant_value and 'enabled' or 'disabled') .. '.')
elseif arguments[1] == 'tooltip' and arguments[2] == 'disenchant' and arguments[3] == 'distribution' then
_G.aux_tooltip_disenchant_distribution = not _G.aux_tooltip_disenchant_distribution
print('Disenchant distribution in tooltip '..(_G.aux_tooltip_disenchant_distribution and 'enabled' or 'disabled')..'.')
print('Disenchant distribution in tooltip ' .. (_G.aux_tooltip_disenchant_distribution and 'enabled' or 'disabled') .. '.')
elseif arguments[1] == 'tooltip' and arguments[2] == 'disenchant' and arguments[3] == 'source' then
_G.aux_tooltip_disenchant_source = not _G.aux_tooltip_disenchant_source
print('Disenchant source in tooltip '..(_G.aux_tooltip_disenchant_source and 'enabled' or 'disabled')..'.')
print('Disenchant source in tooltip ' .. (_G.aux_tooltip_disenchant_source and 'enabled' or 'disabled') .. '.')
elseif arguments[1] == 'ignore' and arguments[2] == 'owner' then
_G.aux_ignore_owner = not _G.aux_ignore_owner
print('Ignoring of owner '..(_G.aux_ignore_owner and 'enabled' or 'disabled')..'.')
print('Ignoring of owner ' .. (_G.aux_ignore_owner and 'enabled' or 'disabled') .. '.')
elseif arguments[1] == 'chars' and arguments[2] == 'add' then
local realm = GetCVar('realmName')
_G.aux_characters[realm] = _G.aux_characters[realm] or t
@@ -59,7 +59,7 @@ function _G.SlashCmdList.AUX(command)
local name = gsub(strlower(arguments[i]), '^%l', strupper)
if not _G.aux_characters[realm][name] then
_G.aux_characters[realm][name] = true
print('Character "'..name..'" added.')
print('Character "' .. name .. '" added.')
end
end
elseif arguments[1] == 'chars' and arguments[2] == 'remove' then
@@ -71,7 +71,7 @@ function _G.SlashCmdList.AUX(command)
local name = gsub(strlower(arguments[i]), '^%l', strupper)
if _G.aux_characters[realm][name] then
_G.aux_characters[realm][name] = nil
print('Character "'..name..'" removed.')
print('Character "' .. name .. '" removed.')
end
end
elseif arguments[1] == 'chars' then
@@ -81,11 +81,11 @@ function _G.SlashCmdList.AUX(command)
tinsert(chars, name)
end
if getn(chars) > 0 then
print('Your characters: "'..join(chars, ', ')..'".')
print('Your characters: "' .. join(chars, ', ') .. '".')
else
print 'You don\'t have any additional characters. To add your characters type "/aux chars add NAME1 NAME2 NAME3...".'
end
else
print('Unknown command: "'..command..'"')
print('Unknown command: "' .. command .. '"')
end
end