WoWInterface SVN EasyDaily

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /trunk
    from Rev 152 to Rev 153
    Reverse comparison

Rev 152 → Rev 153

EasyDaily/turnin.lua
1,6 → 1,6
--[[
Desc:
Info: $Id: turnin.lua 25 2009-05-04 10:55:20Z draake $
Info: $Id: turnin.lua 28 2009-05-07 04:22:11Z draake $
]]
 
local _G = _G
70,10 → 70,10
self.tracker.gossip[title] = true
return true
end
if self:GetPVar("stickyturnin") and self.tracker.gossip[title] ~= nil then
if self.tracker.gossip[title] ~= nil then
return self.tracker.gossip[title]
end
local found, _, questType, questTag, _, _, enabled = self:GetQuestBaseInfo(title)
local found, _, questType, questTag, _, enabled = self:GetQuestBaseInfo(title)
if ( not found ) then
return self:TypeIDActive("normal")
end
109,34 → 109,29
 
function EasyDaily:CanCompleteRepeatQuest(title)
local _, _, questType = self:GetQuestBaseInfo(title)
--~ local objective = self:GetQuestObjective(title)
if ( questType == "repeat" ) and objective then
local objective = self:GetQuestObjective(title)
if ( questType == "repeat" ) and objective and #objective > 0 then
local minimum
for i, v in ipairs(objective) do
local count = self:CountContainerItem(v.index)
local floor = math.floor( count / v.need )
self:Debug(v.name, count, v.need, floor)
minimum = math.min( floor, amount or math.huge )
for _, objString in ipairs(objective) do
local _, index, need = self:StrSplit(":", objString)
local count = self:CountContainerItem(index)
local floor = math.floor( count / need )
self:Debug(GetItemInfo(index), count, need, floor)
minimum = math.min( floor, minimum or math.huge )
end
return ( minimum > 0 ) and minimum
end
return true -- ONLY UNTIL OBJECTIVES ARE PROPERLY STORED
--~ return true -- ONLY UNTIL OBJECTIVES ARE PROPERLY STORED
end
 
--------------------------------------------------------------------------------------------------
-- Quest/Gossip Frame Events/Functions
--------------------------------------------------------------------------------------------------
 
local autoText = sformat(NORMAL_QUEST_DISPLAY, L["Auto"])
 
-- Triggers on: Active, Available/Repeatable
-- Type: Parent
function EasyDaily:QUEST_GREETING()
self:Debug("QUEST_GREETING")
self:QuestGreeting()
end
 
function EasyDaily:QuestGreeting(refresh)
 
if ( not QuestFrameGreetingPanel:IsShown() ) or ( not self:IsEnabled() ) then
return
146,53 → 141,50
 
self.tracker.gossip.parent = true
 
local r = {}
local active_title, active_index, active_priority
local available_title, available_index, available_priority
 
for n = 1, MAX_NUM_QUESTS, 1 do
local b = _G["QuestTitleButton" .. n]
if b:IsShown() then
local i = b:GetID()
local title, isTrivial, isActive
if b.isActive == 0 then
title, isTrivial = GetAvailableTitle(i), IsAvailableQuestTrivial(i)
if ( not refresh ) and ( not r.title ) then
self:Debug("Checking Available Quest:", title)
if self:CanAdvanceAvailableQuest(title) then
local button = _G["QuestTitleButton" .. n]
if button:IsShown() then
local i = button:GetID()
if button.isActive == 0 then
local title, isTrivial = GetAvailableTitle(i), IsAvailableQuestTrivial(i)
if self:CanAdvanceAvailableQuest(title) then
local priority = self:GetHandleValue("quest", title, "priority") or 0
if ( not available_priority ) or ( priority > available_priority ) then
self:Debug("Eligible Available Quest:", title)
r.title = title
r.available = i
available_title, available_index, available_priority = title, i, priority
end
end
elseif b.isActive == 1 then
title, isTrivial, isActive = GetActiveTitle(i), IsActiveQuestTrivial(i), true
if ( not refresh ) and ( not r.title ) then
self:Debug("Checking Active Quest:", title)
if self:CanAdvanceActiveQuest(title) then
button.title = title
button.active = nil
elseif button.isActive == 1 then
local title, isTrivial = GetActiveTitle(i), IsActiveQuestTrivial(i)
if self:CanAdvanceActiveQuest(title) then
local priority = self:GetHandleValue("quest", title, "priority") or 0
if ( not active_priority ) or ( priority > active_priority ) then
self:Debug("Eligible Active Quest:", title)
r.title = title
r.active = i
active_title, active_index, active_priority = title, i, priority
end
end
button.title = title
button.active = true
end
b.title = title
b.trivial = isTrivial
-- Extra Gossip text
if self:GetPVar("gossipstate") and self:GetQuestState(title) then
b:SetFormattedText("%s (%s)", b:GetText(), autoText)
end
-- Icon Settings
if b.icon and self:GetPVar("gossipicons") then
self:SetGossipIcon(b.icon, title, isActive)
end
else
button.title = nil
button.active = nil
end
end
 
if r.active then
self:Debug("Selecting Active Quest:", r.title)
SelectActiveQuest(r.active)
elseif r.available then
self:Debug("Selecting Available Quest:", r.title)
SelectAvailableQuest(r.available)
self:UpdateGossipOrQuestFrame()
 
if active_title then
self:Debug("Selecting Active Quest:", active_title)
SelectActiveQuest(active_index)
elseif available_title then
self:Debug("Selecting Available Quest:", available_title)
SelectAvailableQuest(available_index)
end
 
end
201,10 → 193,6
-- Type: Parent
function EasyDaily:GOSSIP_SHOW()
self:Debug("GOSSIP_SHOW")
self:GossipShow()
end
 
function EasyDaily:GossipShow(refresh)
 
if ( not GossipFrame:IsShown() ) or ( not self:IsEnabled() ) then
return
214,56 → 202,51
 
local v, j, g = self:Pack(GetGossipAvailableQuests()), self:Pack(GetGossipActiveQuests()), self:Pack(GetGossipOptions())
 
local r = {}
local active_title, active_index, active_priority
local available_title, available_index, available_priority
 
for n = 1, NUMGOSSIPBUTTONS, 1 do
local b = _G["GossipTitleButton" .. n]
if b:IsShown() then
local i = b:GetID()
local button = _G["GossipTitleButton" .. n]
if button:IsShown() and button.type ~= "Gossip" then
local i = button:GetID()
local index = ( i - 1 ) * 3 + 1
local title, isTrivial, isActive
if b.type == "Available" then
title, isTrivial = v[index], v[index + 2]
if ( not refresh ) and ( not r.title ) then
self:Debug("Checking Available Quest:", title)
if self:CanAdvanceAvailableQuest(title) then
if button.type == "Available" then
local title, isTrivial = v[index], v[index + 2]
if self:CanAdvanceAvailableQuest(title) then
local priority = self:GetHandleValue("quest", title, "priority") or 0
if ( not available_priority ) or ( priority > available_priority ) then
self:Debug("Eligible Available Quest:", title)
r.title = title
r.available = i
available_title, available_index, available_priority = title, i, priority
end
end
elseif b.type == "Active" then
title, isTrivial, isActive = j[index], j[index + 2], true
if ( not refresh ) and ( not r.title ) then
self:Debug("Checking Active Quest:", title)
if self:CanAdvanceActiveQuest(title) then
button.title = title
button.active = nil
elseif button.type == "Active" then
local title, isTrivial = j[index], j[index + 2]
if self:CanAdvanceActiveQuest(title) then
local priority = self:GetHandleValue("quest", title, "priority") or 0
if ( not active_priority ) or ( priority > active_priority ) then
self:Debug("Eligible Active Quest:", title)
r.title = title
r.active = i
active_title, active_index, active_priority = title, i, priority
end
end
button.title = title
button.active = true
end
if b.type ~= "Gossip" then
b.title = title
b.trivial = isTrivial
-- Extra Gossip text
if self:GetPVar("gossipstate") and self:GetQuestState(title) then
b:SetFormattedText("%s (%s)", b:GetText(), autoText)
end
-- Icon Settings
if b.icon and self:GetPVar("gossipicons") then
self:SetGossipIcon(b.icon, title, isActive)
end
end
else
button.title = nil
button.active = nil
end
end
 
if r.active then
self:Debug("Selecting Active Quest:", r.title)
SelectGossipActiveQuest(r.active)
elseif r.available then
self:Debug("Selecting Available Quest:", r.title)
SelectGossipAvailableQuest(r.available)
self:UpdateGossipOrQuestFrame()
 
if active_title then
self:Debug("Selecting Active Quest:", active_title)
SelectGossipActiveQuest(active_index)
elseif available_title then
self:Debug("Selecting Available Quest:", available_title)
SelectGossipAvailableQuest(available_index)
end
 
end
323,11 → 306,11
end
else
if GetNumQuestChoices() > 0 then
local i = self:GetHandlerValue("quest", GetTitleText(), "reward")
local i = self:GetHandleValue("quest", GetTitleText(), "reward")
if i and i > 0 and self:GetPVar("multiple") then
GetQuestReward(i)
end
elseif self:GetPVar("single") then
else
GetQuestReward(0)
end
end
347,42 → 330,66
end
end
 
function EasyDaily:SetGossipIcon(icon, title, isActive)
local autoText = sformat(NORMAL_QUEST_DISPLAY, L["Auto"])
 
function EasyDaily:UpdateGossipOrQuestFrame()
 
local _, _, questType, questTag, _, _, questEnabled = self:GetQuestBaseInfo(title)
if ( not self:IsEnabled() ) then return end
 
local iconColor
if ( isActive or questType == "repeat" ) and ( not self:CanCompleteQuest(title) ) then
iconColor = "Grey"
elseif ( questType == "daily" ) or ( questType == "repeat" ) then
iconColor = "Daily"
local n, x
if QuestFrameGreetingPanel:IsShown() then
n, x = MAX_NUM_QUESTS, "QuestTitleButton"
elseif GossipFrame:IsShown() then
n, x = NUMGOSSIPBUTTONS, "GossipTitleButton"
else
iconColor = "Normal"
return
end
 
local iconState
if ( questType == "daily" ) or ( questType == "repeat" ) then
iconState = questEnabled and "Enable" or "Disable"
else
iconState = ""
for i = 1, n, 1 do
local button = _G[ x .. i]
if button.title then
-- Extra Gossip text
if self:GetPVar("gossipstate") and self:GetQuestState(button.title) then
b:SetFormattedText("%s (%s)", button:GetText(), autoText)
end
-- Icon Settings
if button.icon and self:GetPVar("gossipicons") then
 
local icon, title, isActive = button.icon, button.title, button.active
 
local _, _, questType, questTag, _, enabled = self:GetQuestBaseInfo(title)
 
local iconColor
if ( isActive or questType == "repeat" ) and ( not self:CanCompleteQuest(title) ) then
iconColor = "Grey"
elseif ( questType == "daily" ) or ( questType == "repeat" ) then
iconColor = "Daily"
else
iconColor = "Normal"
end
 
local iconState
if ( questType == "daily" ) or ( questType == "repeat" ) then
iconState = enabled and "Enable" or "Disable"
else
iconState = ""
end
 
local iconType
if isActive or ( questType == "repeat" ) then
iconType = "Active"
else
iconType = "Available"
end
 
--~ self:Debug(title, isActive, questType, iconColor, iconState, iconType)
 
icon:SetTexture("Interface\\Addons\\EasyDaily\\Textures\\Gossip-Icons\\" .. iconColor .. iconState .. iconType)
 
end
end
end
 
local iconType
if isActive or ( questType == "repeat" ) then
iconType = "Active"
else
iconType = "Available"
end
 
self:Debug(title, isActive, questType, iconColor, iconState, iconType)
 
icon:SetTexture() -- Clear current icon
icon:SetTexture("Interface\\Addons\\EasyDaily\\Textures\\Gossip-Icons\\" .. iconColor .. iconState .. iconType)
 
if ( not icon:GetTexture() ) then
icon:SetTexture("Interface\\QuestFrame\\UI-Quest-BulletPoint")
end
 
end
 
function EasyDaily:RefreshGossipOrQuestFrame()
390,16 → 397,16
self:ClearTracker("gossip")
QuestFrameGreetingPanel:Hide()
QuestFrameGreetingPanel:Show()
self:QuestGreeting(true)
self:UpdateGossipOrQuestFrame()
elseif GossipFrame:IsShown() then
self:ClearTracker("gossip")
GossipFrameUpdate()
self:GossipShow(true)
self:UpdateGossipOrQuestFrame()
end
end
 
function EasyDaily:RefreshQuestRewardHighlight()
local i = self:GetHandlerValue("quest", GetTitleText(), "reward")
local i = self:GetHandleValue("quest", GetTitleText(), "reward")
if i and i > 0 then
local frame = _G[ "QuestRewardItem" .. i ]
if frame and frame:IsShown() then
414,7 → 421,7
function EasyDaily:QuestRewardItem_OnClick(frame)
if arg1 == "RightButton" then
if ( frame.type == "choice" ) then
local h = self:GetHandler("quest", GetTitleText())
local h = self:GetHandle("quest", GetTitleText())
if h then
local index = frame:GetID()
if index == h:GetVal("reward") then
EasyDaily/locales/esES.lua
9,7 → 9,6
-- L["Alt"] = ""
-- L["Auto"] = ""
-- L["Auto-Select rewards for quests with more than one reward."] = ""
-- L["Auto-Select rewards for quests with one or less reward."] = ""
-- L["Auto Turn-in"] = ""
-- L["Auto Turn-in Text"] = ""
-- L["Available"] = ""
32,14 → 31,14
-- L["Enables Auto Turn-in for %s tagged quests."] = ""
-- L["Force"] = ""
-- L["General"] = ""
-- L["Gossip Window"] = ""
-- L["Gossip/Quest Window"] = ""
-- L["[Left-Click] to toggle the quest window"] = ""
-- L["Minimap Icon"] = ""
-- L["Multiple Rewards"] = ""
-- L["None"] = ""
-- L["Normal"] = ""
-- L["Note: The modifier 'None' refers to when no modifier is being held. Setting the modifier to 'Disable' disables the option."] = ""
-- L["Quest Pop-ups"] = ""
-- L["Quest Confirmation Pop-ups"] = ""
-- L["Quest Rewards"] = ""
-- L["Quests"] = ""
-- L["Quest Tags"] = ""
52,14 → 51,11
-- L["Selection Modifiers"] = ""
-- L["Shift"] = ""
-- L["Show an icon on the Minimap."] = ""
-- L["Single Reward"] = ""
-- L["Special"] = ""
-- L["Sticky Turn-in"] = ""
-- L["Suspend"] = ""
-- L["The [new day] begins in %s"] = ""
-- L["Toggles 'Auto Turn-in' for this quest."] = ""
-- L["Toggle this quest's state."] = ""
-- L["Turn-in sequences will run to completion once they've been started regardless of its modifier's status."] = ""
-- L["Use this modifier to Auto Turn-in %s quests."] = ""
-- L["Use this modifier to forcibly Auto Turn-in any quest. Overrides all settings."] = ""
-- L["Use this modifier to suspend the Auto Turn-in process."] = ""
EasyDaily/locales/frFR.lua
9,7 → 9,6
-- L["Alt"] = ""
-- L["Auto"] = ""
-- L["Auto-Select rewards for quests with more than one reward."] = ""
-- L["Auto-Select rewards for quests with one or less reward."] = ""
-- L["Auto Turn-in"] = ""
-- L["Auto Turn-in Text"] = ""
-- L["Available"] = ""
32,14 → 31,14
-- L["Enables Auto Turn-in for %s tagged quests."] = ""
-- L["Force"] = ""
-- L["General"] = ""
-- L["Gossip Window"] = ""
-- L["Gossip/Quest Window"] = ""
-- L["[Left-Click] to toggle the quest window"] = ""
L["Minimap Icon"] = "Icône de la minicarte"
-- L["Multiple Rewards"] = ""
-- L["None"] = ""
-- L["Normal"] = ""
-- L["Note: The modifier 'None' refers to when no modifier is being held. Setting the modifier to 'Disable' disables the option."] = ""
-- L["Quest Pop-ups"] = ""
-- L["Quest Confirmation Pop-ups"] = ""
-- L["Quest Rewards"] = ""
-- L["Quests"] = ""
-- L["Quest Tags"] = ""
52,14 → 51,11
-- L["Selection Modifiers"] = ""
-- L["Shift"] = ""
-- L["Show an icon on the Minimap."] = ""
-- L["Single Reward"] = ""
-- L["Special"] = ""
-- L["Sticky Turn-in"] = ""
-- L["Suspend"] = ""
-- L["The [new day] begins in %s"] = ""
-- L["Toggles 'Auto Turn-in' for this quest."] = ""
-- L["Toggle this quest's state."] = ""
-- L["Turn-in sequences will run to completion once they've been started regardless of its modifier's status."] = ""
-- L["Use this modifier to Auto Turn-in %s quests."] = ""
-- L["Use this modifier to forcibly Auto Turn-in any quest. Overrides all settings."] = ""
-- L["Use this modifier to suspend the Auto Turn-in process."] = ""
EasyDaily/locales/deDE.lua
9,7 → 9,6
-- L["Alt"] = ""
-- L["Auto"] = ""
L["Auto-Select rewards for quests with more than one reward."] = "Automatische Auswahl der Belohnung bei mehr als einer Auswahl"
-- L["Auto-Select rewards for quests with one or less reward."] = ""
-- L["Auto Turn-in"] = ""
-- L["Auto Turn-in Text"] = ""
-- L["Available"] = ""
32,14 → 31,14
-- L["Enables Auto Turn-in for %s tagged quests."] = ""
-- L["Force"] = ""
-- L["General"] = ""
-- L["Gossip Window"] = ""
-- L["Gossip/Quest Window"] = ""
-- L["[Left-Click] to toggle the quest window"] = ""
-- L["Minimap Icon"] = ""
-- L["Multiple Rewards"] = ""
-- L["None"] = ""
-- L["Normal"] = ""
-- L["Note: The modifier 'None' refers to when no modifier is being held. Setting the modifier to 'Disable' disables the option."] = ""
-- L["Quest Pop-ups"] = ""
-- L["Quest Confirmation Pop-ups"] = ""
-- L["Quest Rewards"] = ""
-- L["Quests"] = ""
-- L["Quest Tags"] = ""
52,14 → 51,11
-- L["Selection Modifiers"] = ""
-- L["Shift"] = ""
-- L["Show an icon on the Minimap."] = ""
-- L["Single Reward"] = ""
-- L["Special"] = ""
-- L["Sticky Turn-in"] = ""
-- L["Suspend"] = ""
-- L["The [new day] begins in %s"] = ""
-- L["Toggles 'Auto Turn-in' for this quest."] = ""
-- L["Toggle this quest's state."] = ""
-- L["Turn-in sequences will run to completion once they've been started regardless of its modifier's status."] = ""
-- L["Use this modifier to Auto Turn-in %s quests."] = ""
-- L["Use this modifier to forcibly Auto Turn-in any quest. Overrides all settings."] = ""
-- L["Use this modifier to suspend the Auto Turn-in process."] = ""
EasyDaily/locales/zhCN.lua
9,7 → 9,6
-- L["Alt"] = ""
-- L["Auto"] = ""
-- L["Auto-Select rewards for quests with more than one reward."] = ""
-- L["Auto-Select rewards for quests with one or less reward."] = ""
-- L["Auto Turn-in"] = ""
-- L["Auto Turn-in Text"] = ""
-- L["Available"] = ""
32,14 → 31,14
-- L["Enables Auto Turn-in for %s tagged quests."] = ""
-- L["Force"] = ""
-- L["General"] = ""
-- L["Gossip Window"] = ""
-- L["Gossip/Quest Window"] = ""
-- L["[Left-Click] to toggle the quest window"] = ""
-- L["Minimap Icon"] = ""
-- L["Multiple Rewards"] = ""
-- L["None"] = ""
-- L["Normal"] = ""
-- L["Note: The modifier 'None' refers to when no modifier is being held. Setting the modifier to 'Disable' disables the option."] = ""
-- L["Quest Pop-ups"] = ""
-- L["Quest Confirmation Pop-ups"] = ""
-- L["Quest Rewards"] = ""
-- L["Quests"] = ""
-- L["Quest Tags"] = ""
52,14 → 51,11
-- L["Selection Modifiers"] = ""
-- L["Shift"] = ""
-- L["Show an icon on the Minimap."] = ""
-- L["Single Reward"] = ""
-- L["Special"] = ""
-- L["Sticky Turn-in"] = ""
-- L["Suspend"] = ""
-- L["The [new day] begins in %s"] = ""
-- L["Toggles 'Auto Turn-in' for this quest."] = ""
-- L["Toggle this quest's state."] = ""
-- L["Turn-in sequences will run to completion once they've been started regardless of its modifier's status."] = ""
-- L["Use this modifier to Auto Turn-in %s quests."] = ""
-- L["Use this modifier to forcibly Auto Turn-in any quest. Overrides all settings."] = ""
-- L["Use this modifier to suspend the Auto Turn-in process."] = ""
EasyDaily/locales/koKR.lua
9,7 → 9,6
-- L["Alt"] = ""
-- L["Auto"] = ""
-- L["Auto-Select rewards for quests with more than one reward."] = ""
-- L["Auto-Select rewards for quests with one or less reward."] = ""
-- L["Auto Turn-in"] = ""
-- L["Auto Turn-in Text"] = ""
-- L["Available"] = ""
32,14 → 31,14
-- L["Enables Auto Turn-in for %s tagged quests."] = ""
-- L["Force"] = ""
-- L["General"] = ""
-- L["Gossip Window"] = ""
-- L["Gossip/Quest Window"] = ""
-- L["[Left-Click] to toggle the quest window"] = ""
-- L["Minimap Icon"] = ""
-- L["Multiple Rewards"] = ""
-- L["None"] = ""
-- L["Normal"] = ""
-- L["Note: The modifier 'None' refers to when no modifier is being held. Setting the modifier to 'Disable' disables the option."] = ""
-- L["Quest Pop-ups"] = ""
-- L["Quest Confirmation Pop-ups"] = ""
-- L["Quest Rewards"] = ""
-- L["Quests"] = ""
-- L["Quest Tags"] = ""
52,14 → 51,11
-- L["Selection Modifiers"] = ""
-- L["Shift"] = ""
-- L["Show an icon on the Minimap."] = ""
-- L["Single Reward"] = ""
-- L["Special"] = ""
-- L["Sticky Turn-in"] = ""
-- L["Suspend"] = ""
-- L["The [new day] begins in %s"] = ""
-- L["Toggles 'Auto Turn-in' for this quest."] = ""
-- L["Toggle this quest's state."] = ""
-- L["Turn-in sequences will run to completion once they've been started regardless of its modifier's status."] = ""
-- L["Use this modifier to Auto Turn-in %s quests."] = ""
-- L["Use this modifier to forcibly Auto Turn-in any quest. Overrides all settings."] = ""
-- L["Use this modifier to suspend the Auto Turn-in process."] = ""
EasyDaily/locales/enUS.lua
9,7 → 9,6
L["Auto Turn-in"] = true
L["Auto Turn-in Text"] = true
L["Auto-Select rewards for quests with more than one reward."] = true
L["Auto-Select rewards for quests with one or less reward."] = true
L["Available"] = true
L["Battleground"] = true
L["Complete"] = true
30,13 → 29,13
L["Enables Auto Turn-in for %s tagged quests."] = true
L["Force"] = true
L["General"] = true
L["Gossip Window"] = true
L["Gossip/Quest Window"] = true
L["Minimap Icon"] = true
L["Multiple Rewards"] = true
L["None"] = true
L["Normal"] = true
L["Note: The modifier 'None' refers to when no modifier is being held. Setting the modifier to 'Disable' disables the option."] = true
L["Quest Pop-ups"] = true
L["Quest Confirmation Pop-ups"] = true
L["Quest Rewards"] = true
L["Quest Tags"] = true
L["Quests"] = true
48,14 → 47,11
L["Selection Modifiers"] = true
L["Shift"] = true
L["Show an icon on the Minimap."] = true
L["Single Reward"] = true
L["Special"] = true
L["Sticky Turn-in"] = true
L["Suspend"] = true
L["The [new day] begins in %s"] = true
L["Toggle this quest's state."] = true
L["Toggles 'Auto Turn-in' for this quest."] = true
L["Turn-in sequences will run to completion once they've been started regardless of its modifier's status."] = true
L["Use this modifier to Auto Turn-in %s quests."] = true
L["Use this modifier to forcibly Auto Turn-in any quest. Overrides all settings."] = true
L["Use this modifier to suspend the Auto Turn-in process."] = true
EasyDaily/locales/esMX.lua
9,7 → 9,6
-- L["Alt"] = ""
-- L["Auto"] = ""
-- L["Auto-Select rewards for quests with more than one reward."] = ""
-- L["Auto-Select rewards for quests with one or less reward."] = ""
-- L["Auto Turn-in"] = ""
-- L["Auto Turn-in Text"] = ""
-- L["Available"] = ""
32,14 → 31,14
-- L["Enables Auto Turn-in for %s tagged quests."] = ""
-- L["Force"] = ""
-- L["General"] = ""
-- L["Gossip Window"] = ""
-- L["Gossip/Quest Window"] = ""
-- L["[Left-Click] to toggle the quest window"] = ""
-- L["Minimap Icon"] = ""
-- L["Multiple Rewards"] = ""
-- L["None"] = ""
-- L["Normal"] = ""
-- L["Note: The modifier 'None' refers to when no modifier is being held. Setting the modifier to 'Disable' disables the option."] = ""
-- L["Quest Pop-ups"] = ""
-- L["Quest Confirmation Pop-ups"] = ""
-- L["Quest Rewards"] = ""
-- L["Quests"] = ""
-- L["Quest Tags"] = ""
52,14 → 51,11
-- L["Selection Modifiers"] = ""
-- L["Shift"] = ""
-- L["Show an icon on the Minimap."] = ""
-- L["Single Reward"] = ""
-- L["Special"] = ""
-- L["Sticky Turn-in"] = ""
-- L["Suspend"] = ""
-- L["The [new day] begins in %s"] = ""
-- L["Toggles 'Auto Turn-in' for this quest."] = ""
-- L["Toggle this quest's state."] = ""
-- L["Turn-in sequences will run to completion once they've been started regardless of its modifier's status."] = ""
-- L["Use this modifier to Auto Turn-in %s quests."] = ""
-- L["Use this modifier to forcibly Auto Turn-in any quest. Overrides all settings."] = ""
-- L["Use this modifier to suspend the Auto Turn-in process."] = ""
EasyDaily/locales/zhTW.lua
9,7 → 9,6
-- L["Alt"] = ""
-- L["Auto"] = ""
-- L["Auto-Select rewards for quests with more than one reward."] = ""
-- L["Auto-Select rewards for quests with one or less reward."] = ""
-- L["Auto Turn-in"] = ""
-- L["Auto Turn-in Text"] = ""
-- L["Available"] = ""
32,14 → 31,14
-- L["Enables Auto Turn-in for %s tagged quests."] = ""
-- L["Force"] = ""
-- L["General"] = ""
-- L["Gossip Window"] = ""
-- L["Gossip/Quest Window"] = ""
-- L["[Left-Click] to toggle the quest window"] = ""
-- L["Minimap Icon"] = ""
-- L["Multiple Rewards"] = ""
-- L["None"] = ""
-- L["Normal"] = ""
-- L["Note: The modifier 'None' refers to when no modifier is being held. Setting the modifier to 'Disable' disables the option."] = ""
-- L["Quest Pop-ups"] = ""
-- L["Quest Confirmation Pop-ups"] = ""
-- L["Quest Rewards"] = ""
-- L["Quests"] = ""
-- L["Quest Tags"] = ""
52,14 → 51,11
-- L["Selection Modifiers"] = ""
-- L["Shift"] = ""
-- L["Show an icon on the Minimap."] = ""
-- L["Single Reward"] = ""
-- L["Special"] = ""
-- L["Sticky Turn-in"] = ""
-- L["Suspend"] = ""
-- L["The [new day] begins in %s"] = ""
-- L["Toggles 'Auto Turn-in' for this quest."] = ""
-- L["Toggle this quest's state."] = ""
-- L["Turn-in sequences will run to completion once they've been started regardless of its modifier's status."] = ""
-- L["Use this modifier to Auto Turn-in %s quests."] = ""
-- L["Use this modifier to forcibly Auto Turn-in any quest. Overrides all settings."] = ""
-- L["Use this modifier to suspend the Auto Turn-in process."] = ""
EasyDaily/locales/ruRU.lua
9,7 → 9,6
L["Alt"] = "Alt"
L["Auto"] = "Авто"
L["Auto-Select rewards for quests with more than one reward."] = "Автовыбор наград за задания с несколькими наградами."
L["Auto-Select rewards for quests with one or less reward."] = "Автовыбор награды за задания с одной наградой."
L["Auto Turn-in"] = "Автосдача"
L["Auto Turn-in Text"] = "Текст автосдачи"
L["Available"] = "Доступно"
32,14 → 31,14
L["Enables Auto Turn-in for %s tagged quests."] = "Включить автосдачу заданий, помеченных, как %s"
L["Force"] = "Принудительно"
L["General"] = "Общее"
L["Gossip Window"] = "Окно разговора"
-- L["Gossip/Quest Window"] = ""
L["[Left-Click] to toggle the quest window"] = "[Левый клик] для открытия/закрытия окна заданий"
L["Minimap Icon"] = "Иконка у мини-карты"
L["Multiple Rewards"] = "Многочисленные награды"
L["None"] = "Отсутствует"
L["Normal"] = "Нормальный"
L["Note: The modifier 'None' refers to when no modifier is being held. Setting the modifier to 'Disable' disables the option."] = "Заметка: Модификатор 'Отсустствует' ссылается на отсутствие назначенного модификатора. Установка модификатора на 'Отключить' отключает эту опцию."
L["Quest Pop-ups"] = "Всплывание задания"
-- L["Quest Confirmation Pop-ups"] = ""
L["Quest Rewards"] = "Награды за задания"
L["Quests"] = "Задания"
L["Quest Tags"] = "Метки задания"
52,14 → 51,11
L["Selection Modifiers"] = "Модификаторы выбора"
L["Shift"] = "Shift"
L["Show an icon on the Minimap."] = "Отображать иконку у мини-карты."
L["Single Reward"] = "Одиночные награды"
L["Special"] = "Особые"
-- L["Sticky Turn-in"] = ""
L["Suspend"] = "Приостановить"
L["The [new day] begins in %s"] = "[Новый день] начнётся через %s"
L["Toggles 'Auto Turn-in' for this quest."] = "Вкл/Откл 'Автосдачу' данного задания."
L["Toggle this quest's state."] = "Переключение статуса данного задания."
-- L["Turn-in sequences will run to completion once they've been started regardless of its modifier's status."] = ""
L["Use this modifier to Auto Turn-in %s quests."] = "Использовать этот модификатор для автосдачи %s заданий."
L["Use this modifier to forcibly Auto Turn-in any quest. Overrides all settings."] = "Использовать этот модификатор для принудительной автосдачи любого задания. Игнорирует все настройки."
L["Use this modifier to suspend the Auto Turn-in process."] = "Использовать этот модификатор для приостановки процесса автосдачи."
EasyDaily/tracking.lua
1,6 → 1,6
--[[
Desc:
Info: $Id: tracking.lua 22 2009-05-04 09:34:29Z draake $
Info: $Id: tracking.lua 28 2009-05-07 04:22:11Z draake $
]]
 
local _G = _G
40,17 → 40,19
--------------------------------------------------------------------------------------------------
 
function EasyDaily:UnitName(unit)
local name, guid, id, kind = UnitName(unit), UnitGUID(unit) or 0, 0, ""
local name, guid, id, kind, handle = UnitName(unit), UnitGUID(unit) or 0, 0, "", nil
if ( not self:IsValidName(name) ) then
return nil, 0, "", nil
end
local tid = bit.band(tonumber(string.sub(guid, -16, -14), 16), 0x00F)
if tid == 1 then
kind, id = "object", tonumber(string.sub(guid, -12, -7), 16)
handle = self:GetHandle(kind, id)
elseif tid == 3 then
kind, id = "npc", tonumber(string.sub(guid, -12, -7), 16)
handle = self:GetHandle(kind, id)
end
return name, id, kind
return name, id, kind, handle
end
 
function EasyDaily:GetLocation()
63,6 → 65,21
return zone, math.floor(x * 1000 + 0.5), math.floor(y * 1000 + 0.5), dl
end
 
function EasyDaily:PLAYER_TARGET_CHANGED()
if ( not UnitExists("target") ) or UnitPlayerControlled("target") then
return
end
local name, id, kind, h = self:UnitName("target")
if ( not name ) or ( not kind ) or ( not h ) then
return
end
if ( not UnitIsTapped("target") ) and self:UnitIsClose("target") then
local zone, x, y, dl = self:GetLocation()
h:SetVal("name", name)
h:SetVal("coord", zone, x, y, dl)
end
end
 
--------------------------------------------------------------------------------------------------
-- Gossip/Quest Frame Registration
--------------------------------------------------------------------------------------------------
76,7 → 93,7
return
end
 
local h, isNew = self:GetHandler("quest", questTitle, true)
local h, isNew = self:GetHandle("quest", questTitle, true)
 
if isNew then
self:Display(L["Repeatable Quest Discovered"], questTitle)
88,13 → 105,10
h:SetVal("tag", "normal")
h:SetVal("header", zone)
 
--~ for oID = 1, GetNumQuestItems(), 1 do
--~ local itemName, itemID = self:ParseItemLink( GetQuestItemLink("required", oID) )
--~ handler:SetData("obj", oID, "name", itemName)
--~ handler:SetData("obj", oID, "index", itemID)
--~ handler:SetData("obj", oID, "type", "item")
--~ handler:SetData("obj", oID, "need", self:SelectOne(3, GetQuestItemInfo("required", oID)))
--~ end
for oID = 1, GetNumQuestItems(), 1 do
local _, itemID = self:ParseItemLink( GetQuestItemLink("required", oID) )
h:SetVal("objective", "item", itemID, self:SelectOne(3, GetQuestItemInfo("required", oID)))
end
 
end
 
132,8 → 146,12
 
local questLog, tempLog = {}, {}
 
function EasyDaily:RefreshQuestLogInfo()
function EasyDaily:RefreshQuestLogInfo(refresh)
 
if refresh then
self:CleanTable(questLog)
end
 
local _, numQuests = GetNumQuestLogEntries()
 
local collapseHeaders = {}
155,6 → 173,10
tempLog[index] = questLog[index]
tempLog[index].refresh = true
else
 
-- Quest was not present in last update
self:RecordQuestStart(index)
 
tempLog[index] = {}
tempLog[index].name = logName
 
169,13 → 191,18
tempLog[index].complete = isComplete
 
tempLog[index].obj = {}
 
end
local numObj = GetNumQuestLeaderBoards(i)
for k = 1, numObj, 1 do
local objType, objName, objCurCount, objNeedCount, objText = self:GetLeaderBoardDetails(k, i)
if questLog[index] and questLog[index].obj[k] then
if objCurCount and questLog[index].obj[k].cur and objCurCount > questLog[index].obj[k].cur then
self:Debug(index, logName, objType, objName, questLog[index].obj[k].cur, objCurCount, objNeedCount)
-- Objective update
local h = self:GetHandle("quest", index)
if h then
self:Debug(index, logName, objType, objName, questLog[index].obj[k].cur, objCurCount, objNeedCount)
end
end
tempLog[index].obj[k] = questLog[index].obj[k]
else
210,7 → 237,7
 
if type(v) == "table" and ( not v.refresh ) and v.daily then
 
local h, isNew = self:GetHandler("quest", index, true)
local h, isNew = self:GetHandle("quest", index, true)
 
if isNew and self.vars.startup then
self:Display(L["Daily Quest Discovered"], v.name)
221,12 → 248,6
h:SetVal("tag", v.tag)
h:SetVal("header", v.header)
 
--~ for j, k in pairs(v.obj) do
--~ handler:SetData("obj", j, "name", k.name or k.text)
--~ handler:SetData("obj", j, "type", k.type)
--~ handler:SetData("obj", j, "need", k.need)
--~ end
 
end
 
end
262,8 → 283,15
return current, max
end
 
function EasyDaily:RecordQuestStart(name)
local h = self:GetHandle("quest", name)
if h and h:GetVal("type") == "daily" then
h:SetVal("start", self:GetTime())
end
end
 
function EasyDaily:RecordQuestComplete(name)
local h = self:GetHandler("quest", name)
local h = self:GetHandle("quest", name)
if h and h:GetVal("type") == "daily" then
local resetDate, timeLeft = self:GetDailyResetDate()
h:SetVal("reset", resetDate)
EasyDaily/utility.lua
1,6 → 1,6
--[[
Desc:
Info: $Id: utility.lua 17 2009-05-02 03:59:49Z draake $
Info: $Id: utility.lua 28 2009-05-07 04:22:11Z draake $
]]
 
local _G = _G
56,6 → 56,16
return s
end
 
function EasyDaily:Concat(seperator, ...)
local s = ""
local n = select("#", ...)
for i = 1, n, 1 do
s = s .. tostring( select(i, ...) )
if i ~= n then s = s .. seperator end
end
return s
end
 
function EasyDaily:StripColors(s)
local r = string.gsub(s, "|c%x+(.-)|r", "%1")
return r
208,6 → 218,12
-- Debugging
--------------------------------------------------------------------------------------------------
 
function EasyDaily:VDebug(...)
if self.db.profile.verbosedebug then
self:Debug(...)
end
end
 
function EasyDaily:Debug(...)
if self.db.profile.debug then
if AceLibrary and AceLibrary:HasInstance("AceConsole-2.0") then
232,14 → 248,9
 
function EasyDaily:ChatPrint(info, r1, g1, b1, r2, g2, b2, ...)
 
local msg = ""
for i = 1, select("#", ...), 1 do
msg = msg .. tostring( select( i, ...) ) .. " "
end
 
local text = string.format("|cff%02x%02x%02x%s|r|cff%02x%02x%02x: %s|r",
(r1 or 1) * 255, (g1 or 1) * 255, (b1 or 1) * 255, info or "EasyDaily",
(r2 or 1) * 255, (g2 or 1) * 255, (b2 or 1) * 255, msg)
(r2 or 1) * 255, (g2 or 1) * 255, (b2 or 1) * 255, self:Concat(", ", ...))
 
DEFAULT_CHAT_FRAME:AddMessage(text)
 
EasyDaily/database.lua
1,6 → 1,6
--[[
Desc:
Info: $Id: database.lua 22 2009-05-04 09:34:29Z draake $
Info: $Id: database.lua 28 2009-05-07 04:22:11Z draake $
]]
 
local _G = _G
17,18 → 17,18
-- DB Querying
--------------------------------------------------------------------------------------------------
 
-- name, index, questType, questTag, header, side, enable = EasyDaily:GetQuestHandlerInfo(name)
-- name, index, questType, questTag, header, enable = EasyDaily:GetQuestHandleInfo(name)
function EasyDaily:GetQuestBaseInfo(index)
if not index then return end
local h = self:GetHandler("quest", index)
local h = self:GetHandle("quest", index)
if h then
return h:GetVal("name"), h:GetVal("index"), h:GetVal("type"), h:GetVal("tag"), h:GetVal("header"), h:GetVal("side"), h:GetVal("enable")
return h:GetVal("name"), h:GetVal("index"), h:GetVal("type"), h:GetVal("tag"), h:GetVal("header"), h:GetVal("enable")
end
end
 
function EasyDaily:GetQuestResetInfo(index)
if not index then return end
local h = self:GetHandler("quest", index)
local h = self:GetHandle("quest", index)
if h then
return h:GetVal("reset"), h:GetVal("time"), h:GetVal("done")
end
36,16 → 36,20
 
function EasyDaily:GetQuestState(index)
if not index then return end
return self:GetHandlerValue("quest", index, "enable")
return self:GetHandleValue("quest", index, "enable")
end
 
function EasyDaily:GetQuestObjective()
 
function EasyDaily:GetQuestObjective(index)
if not index then return end
local h = self:GetHandle("quest", index)
if h then
return h:GetVal("objective")
end
end
 
function EasyDaily:ToggleQuestState(index)
if not index then return end
local h = self:GetHandler("quest", index)
local h = self:GetHandle("quest", index)
if h then
local newState = not h:GetVal("enable")
h:SetVal("enable", newState)
53,122 → 57,85
end
end
 
function EasyDaily:GetHandlerValue(kind, index, key)
local h = self:GetHandler(kind, index)
function EasyDaily:GetHandleValue(kind, index, key)
local h = self:GetHandle(kind, index)
if h then
return h:GetVal(key)
end
end
 
do
local side = ( UnitFactionGroup("player") == "Alliance" and 1 ) or 2
function EasyDaily:GetPlayerSideBit()
return side
end
end
 
 
--------------------------------------------------------------------------------------------------
-- Data Handler Values/Presets/Mixins
-- Data Handle Values/Presets/Mixins
--------------------------------------------------------------------------------------------------
 
local handlerType = {
quest = {
values = {
enable = { db = "global", type = "boolean", locale = nil, default = true },
type = { db = "global", type = "string", locale = nil, default = nil },
tag = { db = "global", type = "string", locale = nil, default = nil },
header = { db = "global", type = "string", locale = true, default = nil },
side = { db = "global", type = "number", locale = nil, default = nil },
reward = { db = "char", type = "number", locale = nil, default = 0 },
time = { db = "char", type = "number", locale = nil, default = 0 },
reset = { db = "char", type = "number", locale = nil, default = 0 },
done = { db = "char", type = "number", locale = nil, default = 0 },
},
objects = {
unit = { db = "global", key = "_unit", mixins = { "SetUnit", "GetUnit", "DelUnit" } },
obj = { db = "global", key = "_obj", mixins = { "SetObj", "GetObj" } },
},
enable = { db = "global", locale = nil, side = nil, default = true, type = "type", value = "boolean", table = nil },
type = { db = "global", locale = nil, side = nil, default = nil, type = "type", value = "string", table = nil },
tag = { db = "global", locale = nil, side = nil, default = nil, type = "type", value = "string", table = nil },
priority = { db = "global", locale = nil, side = nil, default = 0, type = "type", value = "number", table = nil },
header = { db = "global", locale = true, side = nil, default = nil, type = "type", value = "string", table = nil },
reward = { db = "char", locale = nil, side = nil, default = 0, type = "type", value = "number", table = nil },
reset = { db = "char", locale = nil, side = nil, default = 0, type = "type", value = "number", table = nil },
start = { db = "char", locale = nil, side = nil, default = 0, type = "type", value = "number", table = nil },
time = { db = "char", locale = nil, side = nil, default = 0, type = "type", value = "number", table = nil },
done = { db = "char", locale = nil, side = nil, default = 0, type = "type", value = "number", table = nil },
unit = { db = "global", locale = nil, side = true, default = nil, type = "concat", table = true },
objective = { db = "global", locale = nil, side = nil, default = nil, type = "concat", table = true },
},
unit = {
values = {
type = { db = "global", type = "string", locale = nil, default = nil },
side = { db = "global", type = "number", locale = nil, default = nil },
},
objects = {
coord = { db = "global", key = "_coord", mixins = { "SetCoord", "GetCoord" } },
},
npc = {
faction = { db = "global", locale = true, side = nil, default = nil, type = "type", value = "string", table = nil },
reaction = { db = "global", locale = nil, side = true, default = nil, type = "type", value = "string", table = nil },
coord = { db = "global", locale = nil, side = nil, default = nil, type = "function", value = "SetCoord", },
},
object = {
coord = { db = "global", locale = nil, side = nil, default = nil, type = "function", value = "SetCoord", },
},
item = {
values = {},
objects = {
unit = { db = "global", key = "_unit", mixins = { "SetUnit", "GetUnit", "DelUnit" } },
},
unit = { db = "global", locale = nil, side = true, default = nil, type = "concat", table = true },
},
event = {
coord = { db = "global", locale = nil, side = nil, default = nil, type = "function", value = "SetCoord", },
},
}
 
local defaultValues = {
--~ hkey = { db = "global", type = "number", locale = nil, default = nil, protect = true },
hval = { db = "global", type = "string", locale = nil, default = nil, protect = true },
name = { db = "global", type = "string", locale = true, default = nil, protect = true },
index = { db = "global", type = "number", locale = nil, default = nil, protect = true },
--~ hkey = { db = "global", locale = nil, side = nil, default = nil, type = "type", value = "number", table = nil, protect = true },
hval = { db = "global", locale = nil, side = nil, default = nil, type = "type", value = "string", table = nil, protect = true },
name = { db = "global", locale = nil, side = nil, default = nil, type = "type", value = "string", table = nil, protect = true },
index = { db = "global", locale = nil, side = nil, default = nil, type = "type", value = "number", table = nil, protect = true },
}
 
local defaultMixins = { "Delete", "Refresh", "SetVal", "GetVal" }
 
for _, v in pairs(handlerType) do
for j, k in pairs(defaultValues) do
v.values[j] = k
v[j] = k
end
end
 
local setMixins = {
 
SetObj = function(this)
 
this:Refresh()
end,
 
GetObj = function(this)
return
end,
 
SetUnit = function(this, h)
assert(handler, "SetUnit")
local t, i = this._unit, nil
for k = 1, #t, 1 do
if t[k] == h._hkey then
i = k; break
end
end
if ( not i ) then
table.insert(t, h._index)
this:Refresh()
end
end,
 
GetUnit = function(this)
return this._unit
end,
 
DelUnit = function(this, index)
assert(index, "DelUnit")
local t, i = this._unit, nil
for k = 1, #t, 1 do
if t[k] == index then
i = k; break
end
end
if i then
table.remove(t, i)
this:Refresh()
end
end,
 
Refresh = function(this)
 
end,
 
Delete = function(this)
EasyDaily:DeleteHandler(this)
EasyDaily:DeleteHandle(this)
end,
 
SetCoord = function(this, zone, x, y, dl)
assert(zone and x and y, "SetCoord")
if type(this._coord[zone]) ~= "table" then this._coord[zone] = {}; end
local t, i = this._coord[zone], nil
SetCoord = function(db, zone, x, y, dl)
assert(db and zone and x and y, "SetCoord")
if type(db[zone]) ~= "table" then db[zone] = {}; end
local t, i = db[zone], nil
for k = 1, #t, 1 do
if ( math.abs(x - t[k].x) <= 5 ) and ( math.abs(y - t[k].y) <= 5 ) and t[k].dl == dl then
i = k; break
182,42 → 149,49
else
table.insert(t, { x = x, y = y, dl = dl, n = 1 })
end
this:Refresh()
end,
 
GetCoord = function(this)
return this._coord
end,
 
SetVal = function(this, key, value)
assert(type(key) ~= nil and this._data[key] and type(value) ~= nil, "SetVal")
SetVal = function(this, key, value, ...)
assert(type(key) ~= "nil" and this._data[key] and type(value) ~= "nil", "SetVal")
local data = this._data[key]
if not EasyDaily.db[ data.db ].data[ this._hkey ] then
EasyDaily.db[ data.db ].data[ this._hkey ] = {}
end
local db = EasyDaily.db[ data.db ].data[ this._hkey ]
if data.type == type(value) then
if data.locale then
if not db[key] then
db[key] = {}
end
db = db[key]
key = GetLocale()
if data.type == "concat" then
value = EasyDaily:Concat(":", value, ...)
elseif data.type == "type" and data.value ~= type(value) then
return
end
if data.locale then
if not db[key] then db[key] = {} end
db = db[key]
key = GetLocale()
end
if data.side then
if not db[key] then db[key] = {} end
db = db[key]
key = EasyDaily:GetPlayerSideBit()
end
if data.type == "function" then
if not db[key] then db[key] = {} end
this[ data.value ](db[key], value, ...)
elseif data.table then
if not db[key] then db[key] = {} end
EasyDaily:SetLinear("utinsert", db, key, value)
elseif ( not db[key] ) or ( not data.protect ) then
if value == data.default then
db[key] = nil
else
db[key] = value
end
if ( not db[key] ) or ( not data.protect ) then
if value == data.default then
db[key] = nil
else
db[key] = value
end
end
this:Refresh()
end
end,
 
GetVal = function(this, key)
assert(type(key) ~= nil and this._data[key], "GetVal")
assert(type(key) ~= "nil" and this._data[key], "GetVal")
local db = EasyDaily.db[ this._data[key].db ].data[ this._hkey ]
local default = this._data[key].default
if this._data[key].locale then
db = db[key]
key = GetLocale()
225,29 → 199,37
if type(db) == "table" and type(db[key]) ~= "nil" then
return db[key]
else
return this._data[key].default
return default
end
end,
 
}
 
--------------------------------------------------------------------------------------------------
-- Data Handler Creation/Searching
-- Data Handle Creation/Searching
--------------------------------------------------------------------------------------------------
 
function EasyDaily:ResetDatabase()
 
self.db.global.data = {}
self.db.char.data = {}
self.handlers = {}
 
self:InitHandles()
 
self.vars.startup = nil
self:RefreshQuestLogInfo(true)
 
end
 
function EasyDaily:RefreshHandlers()
for i, v in pairs(EasyDaily.handlers) do
v:Refresh()
function EasyDaily:RefreshHandles()
for i, v in pairs(self.handlers) do
for j, k in pairs(v) do
k:Refresh()
end
end
end
 
function EasyDaily:DeleteHandler(h)
function EasyDaily:DeleteHandle(h)
if type(h) == "table" and h._hval then
self.db.global.data[h._hkey] = nil
self.db.char.data[h._hkey] = nil
256,25 → 238,25
end
end
 
function EasyDaily:GetHandler(kind, index, create)
assert(kind and ( type(index) == "number" or type(index) == "string" ), "GetHandler")
for i, v in pairs(self.handlers) do
function EasyDaily:GetHandle(kind, index, create)
assert(kind and self.handlers[kind] and ( type(index) == "number" or type(index) == "string" ), "GetHandle")
for i, v in pairs(self.handlers[kind]) do
if kind == v:GetVal("hval") and ( ( type(index) == "number" and index == v:GetVal("index") ) or ( type(index) == "string" and index == v:GetVal("name") ) ) then
return v
end
end
if create then
return self:CreateHandler(kind, index), true
if create == true then
return self:CreateHandle(kind, index), true
end
end
 
function EasyDaily:CreateHandler(kind, index)
function EasyDaily:CreateHandle(kind, index)
 
assert(kind and ( type(index) == "number" or type(index) == "string" ), "CreateHandler")
assert(kind and self.handlers[kind] and ( type(index) == "number" or type(index) == "string" ), "CreateHandle")
 
local getHandler = self:GetHandler(kind, index)
if getHandler then
return getHandler
local getHandle = self:GetHandle(kind, index)
if getHandle then
return getHandle
end
 
-- Create data namespace
285,33 → 267,36
self.db.global.data[n] = {}
 
-- Create and set handler
self.handlers[n] = self:BuildHandler(kind, n)
self.handlers[kind][n] = self:BuildHandle(kind, n)
 
--~ self.handlers[n]:SetVal("hkey", n)
self.handlers[n]:SetVal("hval", kind)
self.handlers[kind][n]:SetVal("hval", kind)
 
if type(index) == "number" then
self.handlers[n]:SetVal("index", index)
self.handlers[kind][n]:SetVal("index", index)
elseif type(index) == "string" then
self.handlers[n]:SetVal("name", index)
self.handlers[kind][n]:SetVal("name", index)
end
 
return self.handlers[n]
return self.handlers[kind][n]
 
end
 
function EasyDaily:InitHandlers()
function EasyDaily:InitHandles()
self.handlers = {}
for k in pairs(handlerType) do
self.handlers[k] = {}
end
for n, v in pairs(self.db.global.data) do
if v then
self.handlers[n] = self:BuildHandler( v.hval, n )
tinsert(self.handlers[v.hval], self:BuildHandle(v.hval, n))
end
end
end
 
function EasyDaily:BuildHandler(kind, n)
function EasyDaily:BuildHandle(kind, n)
 
assert(n and handlerType[kind], "BuildHandler")
assert(n and handlerType[kind], "BuildHandle")
 
local handler = {}
 
324,18 → 309,12
end
end
 
handler._data = handlerType[kind].values
handler._data = handlerType[kind]
 
for i, v in pairs(handlerType[kind].objects) do
for _, k in pairs(v.mixins) do
if not handler[k] then
handler[k] = setMixins[k]
end
for i, v in pairs(handlerType[kind]) do
if v.type == "function" then
handler[ v.value ] = setMixins[ v.value ]
end
if not EasyDaily.db[ v.db ].data[n][i] then
EasyDaily.db[ v.db ].data[n][i] = {}
end
handler[ v.key ] = EasyDaily.db[ v.db ].data[n][i]
end
 
return handler
355,6 → 334,7
clean = { args = 0, func = function(a, _) if type(a) == "table" then for i in pairs(a) do a[i] = nil; end else a = {}; end return a; end },
tinit = { args = 0, func = function(a, _) if type(a) ~= "nil" then return a; end return {}; end },
tinsert = { args = 1, val = 1, func = function(a, b) if type(a) ~= "table" then a = {}; end tinsert(a, b); return a; end },
utinsert = { args = 1, val = 1, func = function(a, b) if type(a) ~= "table" then a = {}; end EasyDaily:InsertUnique(a, b); return a; end },
}
 
setLinearLoop = function(info, array, index, ...)
EasyDaily/Changelog.txt
1,10 → 1,37
------------------------------------------------------------------------
r26 | draake | 2009-05-04 10:56:26 +0000 (Mon, 04 May 2009) | 1 line
r29 | draake | 2009-05-07 04:23:53 +0000 (Thu, 07 May 2009) | 1 line
Changed paths:
A /tags/v2.0-beta.4 (from /trunk:25)
A /tags/v2.0-beta.5 (from /trunk:28)
 
Tagging as v2.0-beta.4
Tagging as v2.0-beta.5
------------------------------------------------------------------------
r28 | draake | 2009-05-07 04:22:11 +0000 (Thu, 07 May 2009) | 5 lines
Changed paths:
M /trunk/core.lua
M /trunk/database.lua
M /trunk/locales/enUS.lua
M /trunk/options.lua
M /trunk/scripts/Strings.lua
M /trunk/tracking.lua
M /trunk/turnin.lua
M /trunk/utility.lua
 
Removed some useless options.
Changed some of the database values to concatenated strings rather than tables. I'll see how that works out.
Laid groundwork for npc tracking (start/end npc's and objectives).
Separated quest/gossip frame visual changes from quest acceptance/completion code.
Laid groundwork for tiered debug modes.
------------------------------------------------------------------------
r27 | draake | 2009-05-05 10:12:13 +0000 (Tue, 05 May 2009) | 2 lines
Changed paths:
M /trunk/database.lua
M /trunk/options.lua
M /trunk/tracking.lua
M /trunk/turnin.lua
 
First attempt at objective tracking and storage.
Repeatable quests are now correctly turned in.
------------------------------------------------------------------------
r25 | draake | 2009-05-04 10:55:20 +0000 (Mon, 04 May 2009) | 1 line
Changed paths:
M /trunk/turnin.lua
100,15 → 127,3
N: Records daily quest data (id, name, objectives, etc).
C: Revised the way the addon version is displayed.
------------------------------------------------------------------------
r15 | draake | 2009-03-30 02:18:14 +0000 (Mon, 30 Mar 2009) | 3 lines
Changed paths:
M /trunk
M /trunk/core.lua
M /trunk/inventory.lua
M /trunk/turnin.lua
M /trunk/util.lua
 
N: Quest requirements for repeatable quests are now learned.
N: Added table utility functions.
C: Experimenting with repo variables.
------------------------------------------------------------------------
EasyDaily/EasyDaily.toc
4,7 → 4,7
## Authors: Draake
## OptionalDeps: Ace3, LibDBIcon-1.0, LibGratuity-3.0, LibAbacus-3.0, LibTourist-3.0, Babble-Faction-3.0, LibBabble-Zone-3.0
## SavedVariables: EasyDaily_DB
## X-Curse-Packaged-Version: v2.0-beta.4
## X-Curse-Packaged-Version: v2.0-beta.5
## X-Curse-Project-Name: EasyDaily
## X-Curse-Project-ID: easydaily
## X-Curse-Repository-ID: wow/easydaily/mainline
EasyDaily/core.lua
1,6 → 1,6
--[[
Desc:
Info: $Id: core.lua 22 2009-05-04 09:34:29Z draake $
Info: $Id: core.lua 28 2009-05-07 04:22:11Z draake $
]]
 
local _G = _G
18,7 → 18,7
--------------------------------------------------------------------------------------------------
 
-- Increasing this forces a database purge
local RESETDB = 0
local RESETDB = 1
 
local defaults = {
global = {
27,16 → 27,17
profile = {
 
enabled = true,
 
debug = false,
vdebug = false,
 
skipflag = false,
skipmoney = false,
single = true,
 
multiple = true,
 
gossipstate = false,
gossipicons = true,
stickyturnin = true,
 
tag_normal = true,
tag_group = true,
47,7 → 48,7
tag_elite = true,
 
mod_normal = "disable",
mod_daily = "shift",
mod_daily = "none",
mod_repeat = "shift",
mod_override = "alt",
mod_suspend = "disable",
84,9 → 85,9
self.version = {}
 
-- Version
self.version.revision = tonumber("25")
self.version.revision = tonumber("28")
if self.version.revision then
local vtext = "v2.0-beta.4"
local vtext = "v2.0-beta.5"
if string.find(vtext, "^r%d+$") then
self.version.text = string.format("r%s-alpha", self.version.revision)
else
106,13 → 107,13
end
]]
 
if self.db.global.purge and ( self.db.global.purge < RESETDB ) then
if EasyDaily.db.global.purge and ( self.db.global.purge < RESETDB ) then
self:ResetDatabase()
self:Print("Database reset to default.")
end
self.db.profile.purge = RESETDB
 
self:InitHandlers()
self:InitHandles()
 
self.tracker = {
spell = {},
176,12 → 177,12
f:SetHeight(64)
f:SetWidth(256)
 
f.texture = f:CreateTexture(nil, "BACKGROUND")
f.texture:SetHeight(64)
f.texture:SetWidth(256)
f.texture:SetAllPoints(f)
f.texture:SetTexture("Interface\\Addons\\EasyDaily\\Textures\\Quest-Frame\\RewardHighlight")
f.texture:SetBlendMode("ADD")
local t = f:CreateTexture(nil, "BACKGROUND")
t:SetHeight(64)
t:SetWidth(256)
t:SetAllPoints(f)
t:SetTexture("Interface\\Addons\\EasyDaily\\Textures\\Quest-Frame\\RewardHighlight")
t:SetBlendMode("ADD")
 
end
 
200,6 → 201,8
self:RegisterEvent("QUEST_PROGRESS")
self:RegisterEvent("QUEST_COMPLETE")
 
self:RegisterEvent("PLAYER_TARGET_CHANGED")
 
self:RegisterBucketEvent({
"QUEST_FINISHED",
"GOSSIP_CLOSED"
229,7 → 232,7
self.db.profile.enabled = false
 
-- Shutdown functions
self.vars.questbutton:Hide()
EasyDailyQuestFrameCheckButton:Hide()
self:RefreshGossipOrQuestFrame()
 
end
EasyDaily/options.lua
1,6 → 1,6
--[[
Desc:
Info: $Id: options.lua 22 2009-05-04 09:34:29Z draake $
Info: $Id: options.lua 28 2009-05-07 04:22:11Z draake $
]]
 
local _G = _G
17,17 → 17,9
-- Content
--------------------------------------------------------------------------------------------------
 
do
local side = UnitFactionGroup("player")
local sideBit = ( side == "Alliance" and 1 ) or 2
function EasyDaily:GetPlayerSideBit()
return sideBit
end
end
 
-- available, complete, repeatable, normal
function EasyDaily:SetQuestOptionsTable(available, complete, repeatable)
for i, h in pairs(self.handlers) do
for i, h in pairs(self.handlers.quest) do
if h:GetVal("hval") == "quest" then
local name, questType, questTag, header, enable = h:GetVal("name"), h:GetVal("type"), h:GetVal("tag"), h:GetVal("header"), h:GetVal("enable")
local t
124,7 → 116,7
local GetOptMods = function(...)
local optMods = { ["ctrl"] = L["Ctrl"], ["alt"] = L["Alt"], ["shift"] = L["Shift"], ["none"] = L["None"], ["disable"] = L["Disable"] }
for i = 1, select("#", ...), 1 do
local v = EasyDaily:GetPVar( EasyDaily:SelectOne(i, ...) )
local v = EasyDaily:GetPVar( "mod_" .. EasyDaily:SelectOne(i, ...) )
if v and v ~= "disable" then
optMods[v] = nil
end
144,12 → 136,12
args = {
enabled = {
order = 1,
width = "half",
type = "toggle",
name = L["Enabled"],
desc = L["Enable/Disable the addon."],
get = function() return self:IsEnabled() end,
set = function(info, value) self[value and "Enable" or "Disable"](self) end,
width = "half",
},
debug = {
order = 2,
169,34 → 161,53
set = function(info, value) self.db.profile.minimapIcon.hide = not value; LDBIcon[value and "Show" or "Hide"](self, "EasyDaily") end,
disabled = function() return not LDBIcon end,
},
resetall = {
order = 3,
type = "execute",
hidden = function() return ( not self.db.profile.debug ) end,
name = "Reset All",
desc = "Resets everything to default.",
func = function() self.db:ResetDB("Default"); self:ResetDatabase(); self.db.profile.debug = true; end,
},
general = {
order = 10,
type = "group",
name = L["General"],
disabled = isDisabled,
args = {
debugmode = {
order = 0,
type = "group",
guiInline = true,
name = "Debug Mode",
disabled = isDisabled,
hidden = function() return ( not self.db.profile.debug ) end,
args = {
vdebug = {
order = 1,
type = "toggle",
name = "Verbose Debug",
desc = "Enable/Disable verbose debug mode.",
get = getFunc,
set = setFunc,
},
resetall = {
order = 2,
type = "execute",
name = "Reset All",
confirm = true,
confirmText = "Are you want to reset the current profile and the entire quest database? This cannot be undone.",
desc = "Resets the current profile and the entire quest database.",
func = function() self.db:ResetDB("Default"); self:ResetDatabase(); self.db.profile.debug = true; end,
},
},
},
gossipdisplay = {
order = 1,
type = "group",
guiInline = true,
name = L["Gossip Window"],
name = L["Gossip/Quest Window"],
args = {
stickyturnin = {
--[[stickyturnin = {
order = 1,
type = "toggle",
name = L["Sticky Turn-in"],
desc = L["Turn-in sequences will run to completion once they've been started regardless of its modifier's status."],
name = "Sticky Turn-in",
desc = "Turn-in sequences will run to completion once they've been started regardless of its modifier's status.",
get = getFunc,
set = setFunc,
},
},]]
gossipicons = {
order = 2,
type = "toggle",
221,17 → 232,9
guiInline = true,
name = L["Quest Rewards"],
args = {
single = {
multiple = {
order = 1,
type = "toggle",
name = L["Single Reward"],
desc = L["Auto-Select rewards for quests with one or less reward."],
get = getFunc,
set = setFunc,
},
multiple = {
order = 2,
type = "toggle",
name = L["Multiple Rewards"],
desc = L["Auto-Select rewards for quests with more than one reward."],
get = getFunc,
243,7 → 246,7
order = 3,
type = "group",
guiInline = true,
name = L["Quest Pop-ups"],
name = L["Quest Confirmation Pop-ups"],
args = {
skipflag = {
order = 1,