1
0
Fork 0

Fixed an issue that would sometimes not update your instance information correctly.

This commit is contained in:
Andrew Tomaka 2011-09-20 18:32:22 -04:00
parent a512d4cbb8
commit 10449cd7cb
1 changed files with 23 additions and 17 deletions

View File

@ -30,7 +30,7 @@ local options = {
name = 'Sort Field', name = 'Sort Field',
desc = 'Field to sort the tooltip by.', desc = 'Field to sort the tooltip by.',
type = 'select', type = 'select',
values = { 'Character', 'Valor Points' }, values = { 'Character', 'Valor Points', 'Class' },
get = function(info) return db.profile.sortType end, get = function(info) return db.profile.sortType end,
set = function(info, value) db.profile.sortType = value end, set = function(info, value) db.profile.sortType = value end,
}, },
@ -173,17 +173,14 @@ end
--[[ EVENTS ]]-- --[[ EVENTS ]]--
function core:CALENDAR_UPDATE_EVENT_LIST() function core:CALENDAR_UPDATE_EVENT_LIST()
print('CALENDAR_UPDATE_EVENT_LIST{)')
core:GetNextVPReset() core:GetNextVPReset()
end end
function core:UPDATE_INSTANCE_INFO() function core:UPDATE_INSTANCE_INFO()
print('UPDATE_INSTANCE_INFO{)')
core:UpdateChores() core:UpdateChores()
end end
function core:CHAT_MSG_CURRENCY() function core:CHAT_MSG_CURRENCY()
print('CHAT_MSG_CURRENCY{)')
RequestRaidInfo() RequestRaidInfo()
end end
@ -207,8 +204,11 @@ function core:UpdateChores()
db.global[realm][name].valorPoints.resetTime = vpResetTime db.global[realm][name].valorPoints.resetTime = vpResetTime
end end
-- Store Saved Instances -- Store Saved Instances; sometimes, there can be two lockouts to the same instance
local savedInstances = GetNumSavedInstances() local savedInstances = GetNumSavedInstances()
for i = 1, savedInstances do for i = 1, savedInstances do
local instanceName, _, instanceReset, _, _, _, _, _, _, _, _, defeatedBosses = GetSavedInstanceInfo(i) local instanceName, _, instanceReset, _, _, _, _, _, _, _, _, defeatedBosses = GetSavedInstanceInfo(i)
@ -217,8 +217,10 @@ function core:UpdateChores()
db.global[realm][name].lockouts[instanceName] = {} db.global[realm][name].lockouts[instanceName] = {}
db.global[realm][name].lockouts[instanceName].defeatedBosses = defeatedBosses db.global[realm][name].lockouts[instanceName].defeatedBosses = defeatedBosses
db.global[realm][name].lockouts[instanceName].resetTime = time() + instanceReset db.global[realm][name].lockouts[instanceName].resetTime = time() + instanceReset
else -- Let's not delete instances with no lockout for now. ResetInstances() should take care of this
db.global[realm][name].lockouts[instanceName] = nil -- and it solves an issue with two lockouts to the same instance being listed.
--else
-- db.global[realm][name].lockouts[instanceName] = nil
end end
end end
end end
@ -339,18 +341,22 @@ function core:DrawTooltip()
-- Sort table according to options. -- Sort table according to options.
local sortTooltip = function(a, b) local sortTooltip = function(a, b)
local aValue, bValue
if db.profile.sortType == 1 then if db.profile.sortType == 1 then
if db.profile.sortDirection == 1 then aValue = a.name:lower()
return a.name:lower() < b.name:lower() bValue = b.name:lower()
else
return a.name:lower() > b.name:lower()
end
elseif db.profile.sortType == 2 then elseif db.profile.sortType == 2 then
if db.profile.sortDirection == 1 then aValue = a.valorPoints
return a.valorPoints < b.valorPoints bValue = b.valorPoints
else elseif db.profile.sortType == 3 then
return a.valorPoints > b.valorPoints aValue = a.class
end bValue = b.class
end
if db.profile.sortDirection == 1 then
return aValue < bValue
else
return aValue > bValue
end end
end end
table.sort(tooltipTable, sortTooltip ) table.sort(tooltipTable, sortTooltip )