WoWInterface SVN EasyDaily

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /
    from Rev 157 to Rev 158
    Reverse comparison

Rev 157 → Rev 158

trunk/EasyDaily/locales/koKR.lua
6,9 → 6,11
 
]] local L = LibStub("AceLocale-3.0"):NewLocale("EasyDaily_Base", "koKR"); if not L then return end
 
-- L["Accept Shared Quests"] = ""
-- L["Alt"] = ""
-- L["Auto-Select rewards for quests with more than one reward."] = ""
-- L["Battleground"] = ""
-- L["Both"] = ""
-- L["Complete"] = ""
-- L["Completed"] = ""
-- L["Completed [%s] of [%s] dailies"] = ""
24,8 → 26,10
-- L["Disables the confirmation pop-up that appears when completing a daily quest that requires gold."] = ""
-- L["Displays a quest's state next to its name in the gossip window."] = ""
-- L["Done"] = ""
-- L["Edit"] = ""
-- L["Enabled"] = ""
-- L["Enable/Disable debug mode."] = ""
-- L["Enable/Disable edit mode."] = ""
-- L["Enable/Disable the addon."] = ""
-- L["Enables Auto Turn-in for %s tagged quests."] = ""
-- L["Enhanced Gossip Icons"] = ""
36,6 → 40,7
-- 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["Off"] = ""
-- L["On"] = ""
53,6 → 58,7
-- L["[Right-Click] to toggle the options menu"] = ""
-- L["[Right-Click] to toggle this quest's state"] = ""
-- L["Selection Modifiers"] = ""
-- L["Shared quests are accepted regardless of their modifiers status."] = ""
-- L["Shift"] = ""
-- L["Show an icon on the Minimap."] = ""
-- L["Special"] = ""
trunk/EasyDaily/locales/enUS.lua
4,9 → 4,11
 
]] local L = LibStub("AceLocale-3.0"):NewLocale("EasyDaily_Base", "enUS", true); if not L then return end
 
L["Accept Shared Quests"] = true
L["Alt"] = true
L["Auto-Select rewards for quests with more than one reward."] = true
L["Battleground"] = true
L["Both"] = true
L["Complete"] = true
L["Completed"] = true
L["Completed [%s] of [%s] dailies"] = true
22,7 → 24,9
L["Disables the confirmation pop-up that appears when completing a daily quest that requires gold."] = true
L["Displays a quest's state next to its name in the gossip window."] = true
L["Done"] = true
L["Edit"] = true
L["Enable/Disable debug mode."] = true
L["Enable/Disable edit mode."] = true
L["Enable/Disable the addon."] = true
L["Enabled"] = true
L["Enables Auto Turn-in for %s tagged quests."] = true
33,6 → 37,7
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["Off"] = true
L["On"] = true
48,6 → 53,7
L["Replaces the default gossip icons with color coded versions."] = true
L["Reset"] = true
L["Selection Modifiers"] = true
L["Shared quests are accepted regardless of their modifiers status."] = true
L["Shift"] = true
L["Show an icon on the Minimap."] = true
L["Special"] = true
trunk/EasyDaily/locales/esMX.lua
6,9 → 6,11
 
]] local L = LibStub("AceLocale-3.0"):NewLocale("EasyDaily_Base", "esMX"); if not L then return end
 
-- L["Accept Shared Quests"] = ""
-- L["Alt"] = ""
-- L["Auto-Select rewards for quests with more than one reward."] = ""
-- L["Battleground"] = ""
-- L["Both"] = ""
-- L["Complete"] = ""
-- L["Completed"] = ""
-- L["Completed [%s] of [%s] dailies"] = ""
24,8 → 26,10
-- L["Disables the confirmation pop-up that appears when completing a daily quest that requires gold."] = ""
-- L["Displays a quest's state next to its name in the gossip window."] = ""
-- L["Done"] = ""
-- L["Edit"] = ""
-- L["Enabled"] = ""
-- L["Enable/Disable debug mode."] = ""
-- L["Enable/Disable edit mode."] = ""
-- L["Enable/Disable the addon."] = ""
-- L["Enables Auto Turn-in for %s tagged quests."] = ""
-- L["Enhanced Gossip Icons"] = ""
36,6 → 40,7
-- 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["Off"] = ""
-- L["On"] = ""
53,6 → 58,7
-- L["[Right-Click] to toggle the options menu"] = ""
-- L["[Right-Click] to toggle this quest's state"] = ""
-- L["Selection Modifiers"] = ""
-- L["Shared quests are accepted regardless of their modifiers status."] = ""
-- L["Shift"] = ""
-- L["Show an icon on the Minimap."] = ""
-- L["Special"] = ""
trunk/EasyDaily/locales/zhTW.lua
6,9 → 6,11
 
]] local L = LibStub("AceLocale-3.0"):NewLocale("EasyDaily_Base", "zhTW"); if not L then return end
 
-- L["Accept Shared Quests"] = ""
-- L["Alt"] = ""
-- L["Auto-Select rewards for quests with more than one reward."] = ""
-- L["Battleground"] = ""
-- L["Both"] = ""
-- L["Complete"] = ""
-- L["Completed"] = ""
-- L["Completed [%s] of [%s] dailies"] = ""
24,8 → 26,10
-- L["Disables the confirmation pop-up that appears when completing a daily quest that requires gold."] = ""
-- L["Displays a quest's state next to its name in the gossip window."] = ""
-- L["Done"] = ""
-- L["Edit"] = ""
-- L["Enabled"] = ""
-- L["Enable/Disable debug mode."] = ""
-- L["Enable/Disable edit mode."] = ""
-- L["Enable/Disable the addon."] = ""
-- L["Enables Auto Turn-in for %s tagged quests."] = ""
-- L["Enhanced Gossip Icons"] = ""
36,6 → 40,7
-- 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["Off"] = ""
-- L["On"] = ""
53,6 → 58,7
-- L["[Right-Click] to toggle the options menu"] = ""
-- L["[Right-Click] to toggle this quest's state"] = ""
-- L["Selection Modifiers"] = ""
-- L["Shared quests are accepted regardless of their modifiers status."] = ""
-- L["Shift"] = ""
-- L["Show an icon on the Minimap."] = ""
-- L["Special"] = ""
trunk/EasyDaily/locales/ruRU.lua
6,9 → 6,11
 
]] local L = LibStub("AceLocale-3.0"):NewLocale("EasyDaily_Base", "ruRU"); if not L then return end
 
-- L["Accept Shared Quests"] = ""
L["Alt"] = "Alt"
L["Auto-Select rewards for quests with more than one reward."] = "Автовыбор наград за задания с несколькими наградами."
L["Battleground"] = "Поле боя"
-- L["Both"] = ""
L["Complete"] = "Выполнено"
L["Completed"] = "Выполнено"
L["Completed [%s] of [%s] dailies"] = "Выполнено [%s] из [%s] ежедневных заданий"
22,10 → 24,12
L["Disable PvP Pop-up"] = "Отключить всплывание PvP"
L["Disables the confirmation pop-up that appears when accepting a daily quest that flags you for pvp."] = "Отключает всплывающий запрос подтверждения при попытке взятия ежедневного задания, отмечающего вас, как PvP-активного."
L["Disables the confirmation pop-up that appears when completing a daily quest that requires gold."] = "Отключает всплывающий запрос подтверждения, появляющийся при выполнении ежедневного задания, для которого требуется золото."
-- L["Displays a quest's state next to its name in the gossip window."] = ""
L["Displays a quest's state next to its name in the gossip window."] = "Отображает статус задания после его названия в окне беседы." -- Needs review
L["Done"] = "Готово"
-- L["Edit"] = ""
L["Enabled"] = "Включено"
L["Enable/Disable debug mode."] = "Включить/отключить режим отладки."
-- L["Enable/Disable edit mode."] = ""
L["Enable/Disable the addon."] = "Включить/Отключить аддон."
L["Enables Auto Turn-in for %s tagged quests."] = "Включить автосдачу заданий, помеченных, как %s"
L["Enhanced Gossip Icons"] = "Улучшенные иконки беседы"
36,6 → 40,7
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["Off"] = "Выкл"
L["On"] = "Вкл"
53,6 → 58,7
L["[Right-Click] to toggle the options menu"] = "[Правый клик] для открытия/закрытия меню настроек"
L["[Right-Click] to toggle this quest's state"] = "[Правый-Клик] переключает состояние заданий"
L["Selection Modifiers"] = "Модификаторы выбора"
-- L["Shared quests are accepted regardless of their modifiers status."] = ""
L["Shift"] = "Shift"
L["Show an icon on the Minimap."] = "Отображать иконку у мини-карты."
L["Special"] = "Особые"
trunk/EasyDaily/locales/esES.lua
6,9 → 6,11
 
]] local L = LibStub("AceLocale-3.0"):NewLocale("EasyDaily_Base", "esES"); if not L then return end
 
-- L["Accept Shared Quests"] = ""
-- L["Alt"] = ""
-- L["Auto-Select rewards for quests with more than one reward."] = ""
-- L["Battleground"] = ""
-- L["Both"] = ""
-- L["Complete"] = ""
-- L["Completed"] = ""
-- L["Completed [%s] of [%s] dailies"] = ""
24,8 → 26,10
-- L["Disables the confirmation pop-up that appears when completing a daily quest that requires gold."] = ""
-- L["Displays a quest's state next to its name in the gossip window."] = ""
-- L["Done"] = ""
-- L["Edit"] = ""
-- L["Enabled"] = ""
-- L["Enable/Disable debug mode."] = ""
-- L["Enable/Disable edit mode."] = ""
-- L["Enable/Disable the addon."] = ""
-- L["Enables Auto Turn-in for %s tagged quests."] = ""
-- L["Enhanced Gossip Icons"] = ""
36,6 → 40,7
-- 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["Off"] = ""
-- L["On"] = ""
53,6 → 58,7
-- L["[Right-Click] to toggle the options menu"] = ""
-- L["[Right-Click] to toggle this quest's state"] = ""
-- L["Selection Modifiers"] = ""
-- L["Shared quests are accepted regardless of their modifiers status."] = ""
-- L["Shift"] = ""
-- L["Show an icon on the Minimap."] = ""
-- L["Special"] = ""
trunk/EasyDaily/locales/frFR.lua
6,9 → 6,11
 
]] local L = LibStub("AceLocale-3.0"):NewLocale("EasyDaily_Base", "frFR"); if not L then return end
 
-- L["Accept Shared Quests"] = ""
-- L["Alt"] = ""
-- L["Auto-Select rewards for quests with more than one reward."] = ""
-- L["Battleground"] = ""
-- L["Both"] = ""
-- L["Complete"] = ""
-- L["Completed"] = ""
-- L["Completed [%s] of [%s] dailies"] = ""
24,8 → 26,10
-- L["Disables the confirmation pop-up that appears when completing a daily quest that requires gold."] = ""
-- L["Displays a quest's state next to its name in the gossip window."] = ""
-- L["Done"] = ""
-- L["Edit"] = ""
L["Enabled"] = "Activé"
L["Enable/Disable debug mode."] = "Activer / désactiver le mode de débogage."
-- L["Enable/Disable edit mode."] = ""
L["Enable/Disable the addon."] = "Activer / désactiver cet add-on."
-- L["Enables Auto Turn-in for %s tagged quests."] = ""
-- L["Enhanced Gossip Icons"] = ""
36,6 → 40,7
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["Off"] = ""
-- L["On"] = ""
53,6 → 58,7
-- L["[Right-Click] to toggle the options menu"] = ""
-- L["[Right-Click] to toggle this quest's state"] = ""
-- L["Selection Modifiers"] = ""
-- L["Shared quests are accepted regardless of their modifiers status."] = ""
-- L["Shift"] = ""
-- L["Show an icon on the Minimap."] = ""
-- L["Special"] = ""
trunk/EasyDaily/locales/deDE.lua
6,9 → 6,11
 
]] local L = LibStub("AceLocale-3.0"):NewLocale("EasyDaily_Base", "deDE"); if not L then return end
 
-- L["Accept Shared Quests"] = ""
-- L["Alt"] = ""
L["Auto-Select rewards for quests with more than one reward."] = "Automatische Auswahl der Belohnung bei mehr als einer Auswahl"
-- L["Battleground"] = ""
-- L["Both"] = ""
-- L["Complete"] = ""
-- L["Completed"] = ""
-- L["Completed [%s] of [%s] dailies"] = ""
24,8 → 26,10
-- L["Disables the confirmation pop-up that appears when completing a daily quest that requires gold."] = ""
-- L["Displays a quest's state next to its name in the gossip window."] = ""
-- L["Done"] = ""
-- L["Edit"] = ""
L["Enabled"] = "aktiviert"
-- L["Enable/Disable debug mode."] = ""
-- L["Enable/Disable edit mode."] = ""
-- L["Enable/Disable the addon."] = ""
-- L["Enables Auto Turn-in for %s tagged quests."] = ""
-- L["Enhanced Gossip Icons"] = ""
36,6 → 40,7
-- 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["Off"] = ""
-- L["On"] = ""
53,6 → 58,7
-- L["[Right-Click] to toggle the options menu"] = ""
-- L["[Right-Click] to toggle this quest's state"] = ""
-- L["Selection Modifiers"] = ""
-- L["Shared quests are accepted regardless of their modifiers status."] = ""
-- L["Shift"] = ""
-- L["Show an icon on the Minimap."] = ""
-- L["Special"] = ""
trunk/EasyDaily/locales/zhCN.lua
6,9 → 6,11
 
]] local L = LibStub("AceLocale-3.0"):NewLocale("EasyDaily_Base", "zhCN"); if not L then return end
 
-- L["Accept Shared Quests"] = ""
-- L["Alt"] = ""
-- L["Auto-Select rewards for quests with more than one reward."] = ""
-- L["Battleground"] = ""
-- L["Both"] = ""
-- L["Complete"] = ""
-- L["Completed"] = ""
-- L["Completed [%s] of [%s] dailies"] = ""
24,8 → 26,10
-- L["Disables the confirmation pop-up that appears when completing a daily quest that requires gold."] = ""
-- L["Displays a quest's state next to its name in the gossip window."] = ""
-- L["Done"] = ""
-- L["Edit"] = ""
-- L["Enabled"] = ""
-- L["Enable/Disable debug mode."] = ""
-- L["Enable/Disable edit mode."] = ""
-- L["Enable/Disable the addon."] = ""
-- L["Enables Auto Turn-in for %s tagged quests."] = ""
-- L["Enhanced Gossip Icons"] = ""
36,6 → 40,7
-- 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["Off"] = ""
-- L["On"] = ""
53,6 → 58,7
-- L["[Right-Click] to toggle the options menu"] = ""
-- L["[Right-Click] to toggle this quest's state"] = ""
-- L["Selection Modifiers"] = ""
-- L["Shared quests are accepted regardless of their modifiers status."] = ""
-- L["Shift"] = ""
-- L["Show an icon on the Minimap."] = ""
-- L["Special"] = ""
trunk/EasyDaily/tracking.lua
1,6 → 1,6
--[[
Desc:
Info: $Id: tracking.lua 40 2009-05-12 02:13:32Z draake $
Info: $Id: tracking.lua 42 2009-05-20 22:32:24Z draake $
]]
 
local _G = _G
40,15 → 40,16
--------------------------------------------------------------------------------------------------
 
function EasyDaily:UnitName(unit)
local name, guid, id, kind, handle = UnitName(unit), UnitGUID(unit) or 0, 0, "", nil
if ( not self:IsValidName(name) ) then
return nil, 0, "", nil
local name, guid = UnitName(unit), UnitGUID(unit)
if ( not self:IsValidName(name) ) or ( not guid ) then
return
end
local tid = bit.band(tonumber(string.sub(guid, -16, -14), 16), 0x00F)
if tid == 1 then
local id, kind, handle
local type = bit.band(tonumber(string.sub(guid, -16, -14), 16), 0x00F)
if type == 1 then
kind, id = "object", tonumber(string.sub(guid, -12, -7), 16)
handle = self:GetHandle(kind, id)
elseif tid == 3 then
elseif type == 3 then
kind, id = "npc", tonumber(string.sub(guid, -12, -7), 16)
handle = self:GetHandle(kind, id)
end
136,7 → 137,7
return objType, objName, tonumber(objCurCount), tonumber(objNeedCount), objText, isDone
end
 
function EasyDaily:QUEST_LOG_UPDATE()
function EasyDaily:QuestLogUpdate()
self:Debug("QUEST_LOG_UPDATE")
self:RefreshQuestLogInfo()
end
185,7 → 186,9
tempLog[index].tag = "normal"
end
tempLog[index].header = tempHeader
tempLog[index].daily = isDaily
if isDaily then
tempLog[index].daily = true
end
if self.log.start.name then
tempLog[index].start = self.log.start
end
233,12 → 236,13
for index, v in pairs(self.log.quest) do
-- Quest was not present in last update
if ( not v.old ) then
if v.daily then
local h, isNew = self:GetHandle("quest", index, true)
local h, isNew = self:GetHandle("quest", index, v.daily)
if h then
if self.log.initialized and isNew then
self:Display(L["Daily Quest Discovered"], v.name)
end
h:SetVal("name", v.name)
h:SetVal("side", bit.bor( h:GetVal("side"), self:UnitSideBit("player") ))
h:SetVal("type", v.daily and "daily" or "normal")
h:SetVal("tag", v.tag)
h:SetVal("header", v.header)
286,12 → 290,10
h:SetVal("start", self:GetTime())
local log = self.log.start[ h:GetVal("name") ]
if log then
h:SetVal("unit", "start", log.type, log.index)
local k, isNew = self:GetHandle(log.type, log.index, true)
if isNew then
k:SetVal("name", log.name)
k:SetVal("coord", log.zone, log.x, log.y, log.dl)
end
local k = self:GetHandle(log.type, log.index, true)
k:SetVal("side", bit.bor( k:GetVal("side"), log.side ))
k:SetVal("name", log.name)
k:SetVal("coord", log.zone, log.x, log.y, log.dl)
end
end
end
303,21 → 305,19
local resetDate, timeLeft = self:GetDailyResetDate()
h:SetVal("reset", resetDate)
end
h:SetVal("done", h:GetVal("done") + 1)
h:SetVal("count", h:GetVal("count") + 1)
local log = self.log.finish[ h:GetVal("name") ]
if log then
h:SetVal("unit", "finish", log.type, log.index)
local k, isNew = self:GetHandle(log.type, log.index, true)
if isNew then
k:SetVal("name", log.name)
k:SetVal("coord", log.zone, log.x, log.y, log.dl)
end
local k = self:GetHandle(log.type, log.index, true)
k:SetVal("side", bit.bor( k:GetVal("side"), log.side ))
k:SetVal("name", log.name)
k:SetVal("coord", log.zone, log.x, log.y, log.dl)
end
end
end
 
function EasyDaily:QuestCompleteToday(name)
local reset, start, done = self:GetQuestResetInfo(name)
local reset, start, count = self:GetQuestResetInfo(name)
return reset and ( reset > self:GetTime() )
end
 
trunk/EasyDaily/utility.lua
1,6 → 1,6
--[[
Desc:
Info: $Id: utility.lua 40 2009-05-12 02:13:32Z draake $
Info: $Id: utility.lua 42 2009-05-20 22:32:24Z draake $
]]
 
local _G = _G
79,6 → 79,10
return unpack(t, 1, t.n or #t)
end
 
function toboolean(bool)
return ( bool ~= nil ) and ( bool ~= false )
end
 
--------------------------------------------------------------------------------------------------
-- Logic
--------------------------------------------------------------------------------------------------
trunk/EasyDaily/database.lua
1,6 → 1,6
--[[
Desc:
Info: $Id: database.lua 40 2009-05-12 02:13:32Z draake $
Info: $Id: database.lua 42 2009-05-20 22:32:24Z draake $
]]
 
local _G = _G
59,7 → 59,7
if not index then return end
local h = self:GetHandle("quest", index)
if h then
return h:GetVal("reset"), h:GetVal("start"), h:GetVal("done")
return h:GetVal("reset"), h:GetVal("start"), h:GetVal("count")
end
end
 
95,8 → 95,13
 
do
local side = ( UnitFactionGroup("player") == "Alliance" and 1 ) or 2
function EasyDaily:GetPlayerSideBit()
return side
function EasyDaily:UnitSideBit(unit)
if unit == "player" then
return side
else
local faction = UnitFactionGroup(unit)
return ( faction == "Alliance" and 1 ) or ( faction == "Horde" and 2 ) or 3
end
end
end
 
107,39 → 112,43
 
local handlerType = {
quest = {
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 },
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 },
enable = { index = 10, db = "global", locale = nil, side = nil, default = true, type = "type", value = "boolean", table = nil },
type = { index = 11, db = "global", locale = nil, side = nil, default = UNKNOWN, type = "type", value = "string", table = nil },
tag = { index = 12, db = "global", locale = nil, side = nil, default = UNKNOWN, type = "type", value = "string", table = nil },
priority = { index = 13, db = "global", locale = nil, side = nil, default = 0, type = "type", value = "number", table = nil },
header = { index = 14, db = "global", locale = true, side = nil, default = UNKNOWN, type = "type", value = "string", table = nil },
reward = { index = 15, db = "char", locale = nil, side = nil, default = 0, type = "type", value = "number", table = nil },
reset = { index = 16, db = "char", locale = nil, side = nil, default = 0, type = "type", value = "number", table = nil },
start = { index = 17, db = "char", locale = nil, side = nil, default = 0, type = "type", value = "number", table = nil },
count = { index = 18, db = "char", locale = nil, side = nil, default = 0, type = "type", value = "number", table = nil },
unit = { index = 19, db = "global", locale = nil, side = true, default = nil, type = "concat", table = true },
objective = { index = 20, db = "global", locale = nil, side = nil, default = nil, type = "concat", table = true },
group = { index = 21, db = "global", locale = nil, side = nil, default = nil, type = "type", value = "number", table = true },
side = { index = 22, db = "global", locale = nil, side = nil, default = 0, type = "type", value = "number", table = nil },
},
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", },
faction = { index = 10, db = "global", locale = true, side = nil, default = nil, type = "type", value = "string", table = nil },
side = { index = 11, db = "global", locale = nil, side = nil, default = 0, type = "type", value = "number", table = nil },
coord = { index = 12, 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", },
faction = { index = 10, db = "global", locale = true, side = nil, default = nil, type = "type", value = "string", table = nil },
side = { index = 11, db = "global", locale = nil, side = nil, default = 0, type = "type", value = "number", table = nil },
coord = { index = 12, db = "global", locale = nil, side = nil, default = nil, type = "function", value = "SetCoord" },
},
item = {
unit = { db = "global", locale = nil, side = true, default = nil, type = "concat", table = true },
unit = { index = 10, 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", },
coord = { index = 10, db = "global", locale = nil, side = nil, default = nil, type = "function", value = "SetCoord" },
},
}
 
local defaultValues = {
--~ 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 = true, 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 },
hkey = { index = nil, db = "global", locale = nil, side = nil, default = nil, type = "type", value = "number", table = nil, protect = true },
hval = { index = nil, db = "global", locale = nil, side = nil, default = nil, type = "type", value = "string", table = nil, protect = true },
name = { index = 1, db = "global", locale = true, side = nil, default = UNKNOWN, type = "type", value = "string", table = nil, protect = true },
index = { index = 2, db = "global", locale = nil, side = nil, default = nil, type = "type", value = "number", table = nil, protect = nil },
}
 
local defaultMixins = { "Delete", "Refresh", "SetVal", "GetVal" }
161,7 → 170,8
end,
 
SetCoord = function(db, zone, x, y, dl)
assert(db and zone and x and y, "SetCoord")
assert(zone and x and y, "SetCoord")
if type(db) ~= "table" then db = {}; end
if type(db[zone]) ~= "table" then db[zone] = {}; end
local t, i = db[zone], nil
for k = 1, #t, 1 do
177,6 → 187,7
else
table.insert(t, { x = x, y = y, dl = dl, n = 1 })
end
return db
end,
 
SetVal = function(this, key, value, ...)
191,6 → 202,7
elseif data.type == "type" and data.value ~= type(value) then
return
end
key = data.index or key
if data.locale then
if not db[key] then db[key] = {} end
db = db[key]
199,11 → 211,10
if data.side then
if not db[key] then db[key] = {} end
db = db[key]
key = EasyDaily:GetPlayerSideBit()
key = EasyDaily:UnitSideBit("player")
end
if data.type == "function" then
if not db[key] then db[key] = {} end
this[ data.value ](db[key], value, ...)
db[key] = this[ data.value ](db[key], value, ...)
elseif data.table then
EasyDaily:SetLinear("utinsert", db, key, value)
elseif ( not db[key] ) or ( not data.protect ) then
213,20 → 224,27
db[key] = value
end
end
this:Refresh()
end,
 
GetVal = function(this, key)
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
local data = this._data[key]
key = data.index or key
if data.locale then
db = db[key]
key = GetLocale()
end
if data.side then
if not db[key] then db[key] = {} end
db = db[key]
key = EasyDaily:UnitSideBit("player")
end
if type(db) == "table" and type(db[key]) ~= "nil" then
return db[key]
else
return default
return data.default
end
end,
 
249,6 → 267,12
 
end
 
function EasyDaily:SetAllQuestStates(enabled)
for i, h in pairs(self.handlers.quest) do
h:SetVal("enable", toboolean(enabled))
end
end
 
function EasyDaily:RefreshHandles()
for i, v in pairs(self.handlers) do
for j, k in pairs(v) do
322,13 → 346,13
end
end
 
function EasyDaily:BuildHandle(kind, n)
function EasyDaily:BuildHandle(kind, hkey)
 
assert(n and handlerType[kind], "BuildHandle")
assert(hkey and handlerType[kind], "BuildHandle")
 
local handler = {}
 
handler._hkey = n
handler._hkey = hkey
handler._hval = kind
 
for _, v in pairs(defaultMixins) do
340,6 → 364,13
handler._data = handlerType[kind]
 
for i, v in pairs(handlerType[kind]) do
if v.index and EasyDaily.db[ v.db ].data[ hkey ] and EasyDaily.db[ v.db ].data[ hkey ][ i ] then
EasyDaily.db[ v.db ].data[ hkey ][ v.index ] = EasyDaily.db[ v.db ].data[ hkey ][ i ]
EasyDaily.db[ v.db ].data[ hkey ][ i ] = nil
end
end
 
for i, v in pairs(handlerType[kind]) do
if v.type == "function" then
handler[ v.value ] = setMixins[ v.value ]
end
395,3 → 426,13
end
end
 
function EasyDaily:GetLinearArgs(array, index, ...)
if ( type(array) ~= "table" ) or ( not index ) then
return nil
elseif select("#", ...) == 0 then
return array.args[index]
else
return self:GetLinearArgs(array.args[index], ...)
end
end
 
trunk/EasyDaily/gossip.lua New file
0,0 → 1,343
--[[
Desc:
Info: $Id: gossip.lua 42 2009-05-20 22:32:24Z draake $
]]
 
local _G = _G
local pairs, ipairs, type, select, tonumber, tostring = pairs, ipairs, type, select, tonumber, tostring
 
local tinsert, tremove, tsort = table.insert, table.remove, table.sort
local sformat = string.format
 
local L = LibStub("AceLocale-3.0"):GetLocale("EasyDaily_Base")
 
--------------------------------------------------------------------------------------------------
-- Initialization
--------------------------------------------------------------------------------------------------
 
function EasyDaily:CreateFrames()
 
--~ QuestRewardItemChooseText:SetFormattedText("%s (%s)", REWARD_CHOOSE, L|["Right-Click to select which reward should be automatically chosen"])
 
-- Gossip/Quest Frame additional click registration
for i = 1, NUMGOSSIPBUTTONS, 1 do
local b = _G[ "GossipTitleButton" .. i ]
b:RegisterForClicks("LeftButtonUp", "RightButtonUp")
 
b:SetScript("OnEnter", function(this)
EasyDaily:GossipOrQuestButtonTooltip(this)
end)
b:SetScript("OnLeave", GameTooltip_Hide)
 
b.icon = _G[ "GossipTitleButton" .. i .. "GossipIcon" ]
end
for i = 1, MAX_NUM_QUESTS, 1 do
local b = _G[ "QuestTitleButton" .. i ]
b:RegisterForClicks("LeftButtonUp", "RightButtonUp")
 
b:SetScript("OnEnter", function(this)
EasyDaily:GossipOrQuestButtonTooltip(this)
end)
b:SetScript("OnLeave", GameTooltip_Hide)
 
b.icon = _G[ "QuestTitleButton" .. i .. "QuestIcon" ]
end
 
for i = 1, 10, 1 do
local b = _G[ "QuestRewardItem" .. i ]
b:RegisterForClicks("LeftButtonUp", "RightButtonUp")
end
 
-- Create QuestFrame CheckButton
local b = CreateFrame("CheckButton", "EasyDailyQuestFrameCheckButton", QuestFrame, "UICheckButtonTemplate")
b:SetPoint("TOPLEFT", "QuestFrame", "TOPLEFT", 80, -50)
b:SetHitRectInsets(0, -70, 0, 0)
b:SetHeight(24)
b:SetWidth(24)
 
b.text = _G[ b:GetName() .. "Text" ]
b.text:ClearAllPoints()
b.text:SetPoint("LEFT", b:GetName(), "RIGHT", 0, 0)
b.text:SetText(L["Quest Enabled"])
 
b:SetScript("OnShow", function(this)
EasyDaily:QuestCheckButtonOnShow(this)
end)
b:SetScript("OnClick", function(this)
EasyDaily:QuestCheckButtonOnClick(this)
end)
b:SetScript("OnEnter", function(this)
if ( GetCVar("UberTooltips") == "1" ) then
GameTooltip_SetDefaultAnchor(GameTooltip, this)
else
GameTooltip:SetOwner(this, "ANCHOR_LEFT")
end
EasyDaily:GossipOrQuestButtonTooltip(this)
end)
b:SetScript("OnLeave", GameTooltip_Hide)
 
-- Create ItemReward Texture
local f = CreateFrame("Frame", "EasyDailyQuestRewardItemHighlight", QuestRewardScrollChildFrame)
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")
 
end
 
--------------------------------------------------------------------------------------------------
-- Gossip/Quest Frame Functions
--------------------------------------------------------------------------------------------------
 
function EasyDaily:UpdateGossipOrQuestFrame()
 
if ( not self:IsEnabled() ) then return end
 
local n, x
if QuestFrameGreetingPanel:IsShown() then
n, x = MAX_NUM_QUESTS, "QuestTitleButton"
elseif GossipFrame:IsShown() then
n, x = NUMGOSSIPBUTTONS, "GossipTitleButton"
else
return
end
 
for i = 1, n, 1 do
local button = _G[ x .. i]
if button.title then
local title = button.title
-- Extra Gossip text
if self:GetPVar("gossipstate") then
local enable = self:GetQuestState(title)
if type(enable) ~= "nil" then
button:SetFormattedText("%s |cff000000(%s)|r", button:GetText(), enable and L["On"] or L["Off"])
end
end
-- Icon Settings
if button.icon and self:GetPVar("gossipicons") then
 
local icon, isActive = button.icon, 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
if ( not enabled ) or ( not self:QuestTagIsActive(questTag) ) then
iconState = "Disable"
else
iconState = "Enable"
end
else
iconState = ""
end
 
local iconType
if isActive or ( questType == "repeat" ) then
iconType = "Active"
else
iconType = "Available"
end
 
self:Maintenance(title, isActive, questType, questTag, self:QuestTagIsActive(questTag), iconColor, iconState, iconType)
 
icon:SetTexture("Interface\\Addons\\EasyDaily\\Textures\\Gossip-Icons\\" .. iconColor .. iconState .. iconType)
 
end
end
end
 
end
 
function EasyDaily:RefreshGossipOrQuestFrame()
if QuestFrameGreetingPanel:IsShown() then
self:ClearTracker("gossip")
QuestFrameGreetingPanel:Hide()
QuestFrameGreetingPanel:Show()
self:UpdateGossipOrQuestFrame()
elseif GossipFrame:IsShown() then
self:ClearTracker("gossip")
GossipFrameUpdate()
self:UpdateGossipOrQuestFrame()
end
end
 
function EasyDaily:RefreshQuestRewardHighlight()
local i = self:GetHandleValue("quest", GetTitleText(), "reward")
if i and i > 0 then
local frame = _G[ "QuestRewardItem" .. i ]
if frame and frame:IsShown() then
EasyDailyQuestRewardItemHighlight:SetPoint("TOPLEFT", frame, "TOPLEFT", -8, 7)
EasyDailyQuestRewardItemHighlight:Show()
return
end
end
EasyDailyQuestRewardItemHighlight:Hide()
end
 
function EasyDaily:QuestRewardItem_OnClick(frame)
if arg1 == "RightButton" then
if ( frame.type == "choice" ) then
local h = self:GetHandle("quest", GetTitleText())
if h then
local index = frame:GetID()
if index == h:GetVal("reward") then
h:SetVal("reward", 0)
else
h:SetVal("reward", index)
end
self:RefreshQuestRewardHighlight()
end
end
end
self.hooks["QuestRewardItem_OnClick"](frame)
end
 
function EasyDaily:GossipTitleButton_OnClick(frame, button)
if button == "RightButton" then
if ( frame.type == "Available" ) or ( frame.type == "Active" ) then
self:ToggleQuestState(frame.title)
self:RefreshGossipOrQuestFrame()
self:GossipOrQuestButtonTooltip(frame)
end
else
self.hooks["GossipTitleButton_OnClick"](frame, button)
end
end
 
function EasyDaily:QuestTitleButton_OnClick(frame)
if arg1 == "RightButton" then
self:ToggleQuestState(frame.title)
self:RefreshGossipOrQuestFrame()
self:GossipOrQuestButtonTooltip(frame)
else
self.hooks["QuestTitleButton_OnClick"](frame)
end
end
 
function EasyDaily:QuestCheckButtonOnShow(b)
local enable = self:GetQuestState( GetTitleText() )
if type(enable) ~= "nil" then
b:Enable()
b:SetChecked(enable)
b.text:SetTextColor(1, 0.8, 0, 1)
else
b:Enable()
b:SetChecked(nil)
--~ b:Disable()
b.text:SetTextColor(0.5, 0.5, 0.5, 1)
end
end
 
function EasyDaily:QuestCheckButtonOnClick(button)
local h, isNew = self:GetHandle("quest", GetTitleText(), true)
if h then
local newState = not h:GetVal("enable")
h:SetVal("enable", newState)
button:SetChecked(newState)
end
end
 
local TagOptToTagText = {
["normal"] = DUNGEON_DIFFICULTY1,
["group"] = GROUP,
["dungeon"] = LFG_TYPE_NORMAL_DUNGEON,
["raid"] = RAID,
["heroic"] = LFG_TYPE_HEROIC_DUNGEON,
["pvp"] = PVP,
["elite"] = ELITE,
}
 
function EasyDaily:TagOptToTagText(x)
return x and TagOptToTagText[x]
end
 
local TypeOptToTypeText = {
["normal"] = DUNGEON_DIFFICULTY1,
["daily"] = DAILY,
["repeat"] = L["Repeatable"],
}
 
function EasyDaily:TypeOptToTypeText(x)
return x and TypeOptToTypeText[x]
end
 
function EasyDaily:GossipOrQuestButtonTooltip(button)
 
if ( GetCVar("UberTooltips") == "1" ) then
GameTooltip_SetDefaultAnchor(GameTooltip, button)
else
GameTooltip:SetOwner(button, "ANCHOR_RIGHT")
end
 
GameTooltip:ClearLines()
 
local title = button.title or GetTitleText()
local found, index, questType, questTag, header, enable = self:GetQuestBaseInfo(title)
 
if found then
 
GameTooltip:AddDoubleLine(title)
 
GameTooltip:AddLine(" ")
 
local isComplete = self:CanCompleteQuest(title)
 
if isComplete then
if questType == "repeat" then
textComplete = sformat("%s: %s (%s)", L["Complete"], self:Colorize(YES, 0, 1, 0), self:Colorize(isComplete, 1, 1, 1))
else
textComplete = sformat("%s: %s", L["Complete"], self:Colorize(YES, 0, 1, 0))
end
else
textComplete = sformat("%s: %s", L["Complete"], self:Colorize(NO, 1, 0, 0))
end
 
local textEnabled
if enable then
textEnabled = sformat("%s: %s", L["Enabled"], self:Colorize(YES, 0, 1, 0))
else
textEnabled = sformat("%s: %s", L["Enabled"], self:Colorize(NO, 1, 0, 0))
end
 
GameTooltip:AddDoubleLine(textEnabled, textComplete)
 
local typeText = sformat("%s: %s", L["Type"], self:Colorize(self:TypeOptToTypeText(questType), 1, 1, 1))
local tagText = sformat("%s: %s (%s)", L["Tag"], self:Colorize(self:TagOptToTagText(questTag), 1, 1, 1), self:QuestTagIsActive(questTag) and self:Colorize(L["On"], 0, 1, 0) or self:Colorize(L["Off"], 1, 0, 0))
 
local cat1, cat2 = self:GetQuestCategoryInfo(title)
 
local cat1Text = sformat("%s: %s", L["Continent"], self:Colorize(cat1, 1, 1, 1))
local cat2Text = sformat("%s: %s", L["Zone"], self:Colorize(cat2, 1, 1, 1))
 
GameTooltip:AddDoubleLine(typeText, tagText)
GameTooltip:AddDoubleLine(cat1Text, cat2Text)
 
GameTooltip:AddLine(" ")
 
if index then
GameTooltip:AddLine( sformat("%s: %s", "ID", self:Colorize(index, 1, 1, 1)) )
GameTooltip:AddLine(" ")
end
 
GameTooltip:AddLine( self:ColorizePattern(L["[Right-Click] to toggle this quest's state"], "%[(.-)%]", 1, 1, 1 ))
 
GameTooltip:Show()
 
end
 
end
 
trunk/EasyDaily/Changelog.txt
1,10 → 1,32
------------------------------------------------------------------------
r41 | draake | 2009-05-12 02:14:01 +0000 (Tue, 12 May 2009) | 1 line
r46 | draake | 2009-05-20 22:44:18 +0000 (Wed, 20 May 2009) | 1 line
Changed paths:
A /tags/v2.0-beta.10 (from /trunk:40)
A /tags/v2.0-beta.11b (from /trunk:42)
 
Tagging as v2.0-beta.10
Tagging as v2.0-beta.11b
------------------------------------------------------------------------
r42 | draake | 2009-05-20 22:32:24 +0000 (Wed, 20 May 2009) | 7 lines
Changed paths:
M /trunk/EasyDaily.toc
M /trunk/core.lua
M /trunk/database.lua
A /trunk/gossip.lua
M /trunk/locales/enUS.lua
M /trunk/options.lua
M /trunk/scripts/Babelfish.lua
M /trunk/scripts/Strings.lua
M /trunk/tracking.lua
M /trunk/turnin.lua
M /trunk/utility.lua
 
Added options regarding shared quests.
Updated DB options and forced DB reset.
Updated locales.
Normal quests can now be learned using the gossip/quest frame check button.
Fixed errors regarding object type NPC's and registering their locations.
Better tracking of quests when they are being accepted/completed.
Reorganized functions that related to the quest/gossip frame.
------------------------------------------------------------------------
r40 | draake | 2009-05-12 02:13:32 +0000 (Tue, 12 May 2009) | 6 lines
Changed paths:
M /trunk/core.lua
trunk/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.10
## X-Curse-Packaged-Version: v2.0-beta.11b
## X-Curse-Project-Name: EasyDaily
## X-Curse-Project-ID: easydaily
## X-Curse-Repository-ID: wow/easydaily/mainline
42,4 → 42,5
inventory.lua
tracking.lua
turnin.lua
gossip.lua
options.lua
trunk/EasyDaily/core.lua
1,6 → 1,6
--[[
Desc:
Info: $Id: core.lua 40 2009-05-12 02:13:32Z draake $
Info: $Id: core.lua 42 2009-05-20 22:32:24Z draake $
]]
 
local _G = _G
18,7 → 18,7
--------------------------------------------------------------------------------------------------
 
-- Increasing this forces a database purge
local RESETDB = 3
local RESETDB = 4
 
local defaults = {
global = {
31,6 → 31,8
debug = false,
debuglevel = 1,
 
questedit = false,
 
skipflag = false,
skipmoney = false,
 
40,6 → 42,7
 
gossipstate = false,
gossipicons = true,
acceptshared = true,
 
tag_normal = true,
tag_group = true,
50,8 → 53,8
tag_elite = true,
 
mod_normal = "disable",
mod_daily = "shift",
mod_repeat = "shift",
mod_daily = "none",
mod_repeat = "none",
mod_override = "alt",
mod_suspend = "disable",
 
91,8 → 94,7
}
 
self.vars = {
complete = {},
accept = {},
 
}
 
self.log = {
107,9 → 109,9
self.version = {}
 
-- Version
self.version.revision = tonumber("40")
self.version.revision = tonumber("42")
if self.version.revision then
local version = "v2.0-beta.10"
local version = "v2.0-beta.11b"
if string.find(version, "^r%d+$") then
self.version.major, self.version.minor, self.version.type = 0, 0, "alpha"
self.version.text = string.format("r%s-alpha", self.version.revision)
141,78 → 143,6
 
end
 
function EasyDaily:CreateFrames()
 
-- Gossip/Quest Frame additional click registration
for i = 1, NUMGOSSIPBUTTONS, 1 do
local b = _G[ "GossipTitleButton" .. i ]
b:RegisterForClicks("LeftButtonUp", "RightButtonUp")
 
b:SetScript("OnEnter", function(this)
EasyDaily:GossipOrQuestButtonTooltip(this)
end)
b:SetScript("OnLeave", GameTooltip_Hide)
 
b.icon = _G[ "GossipTitleButton" .. i .. "GossipIcon" ]
end
for i = 1, MAX_NUM_QUESTS, 1 do
local b = _G[ "QuestTitleButton" .. i ]
b:RegisterForClicks("LeftButtonUp", "RightButtonUp")
 
b:SetScript("OnEnter", function(this)
EasyDaily:GossipOrQuestButtonTooltip(this)
end)
b:SetScript("OnLeave", GameTooltip_Hide)
 
b.icon = _G[ "QuestTitleButton" .. i .. "QuestIcon" ]
end
for i = 1, 10, 1 do
local b = _G[ "QuestRewardItem" .. i ]
b:RegisterForClicks("LeftButtonUp", "RightButtonUp")
end
 
-- Create QuestFrame CheckButton
local b = CreateFrame("CheckButton", "EasyDailyQuestFrameCheckButton", QuestFrame, "UICheckButtonTemplate")
b:SetPoint("TOPLEFT", "QuestFrame", "TOPLEFT", 80, -50)
b:SetHitRectInsets(0, -70, 0, 0)
b:SetHeight(24)
b:SetWidth(24)
 
b.text = _G[ b:GetName() .. "Text" ]
b.text:ClearAllPoints()
b.text:SetPoint("LEFT", b:GetName(), "RIGHT", 0, 0)
b.text:SetText(L["Quest Enabled"])
 
b:SetScript("OnShow", function(this)
EasyDaily:QuestCheckButtonOnShow(this)
end)
b:SetScript("OnClick", function(this)
EasyDaily:QuestCheckButtonOnClick(this)
end)
b:SetScript("OnEnter", function(this)
if ( GetCVar("UberTooltips") == "1" ) then
GameTooltip_SetDefaultAnchor(GameTooltip, this)
else
GameTooltip:SetOwner(this, "ANCHOR_LEFT")
end
EasyDaily:GossipOrQuestButtonTooltip(this)
end)
b:SetScript("OnLeave", GameTooltip_Hide)
 
-- Create ItemReward Texture
local f = CreateFrame("Frame", "EasyDailyQuestRewardItemHighlight", QuestRewardScrollChildFrame)
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")
 
end
 
function EasyDaily:OnEnable()
 
-- Events and timers
229,8 → 159,12
"GOSSIP_CLOSED"
}, 0, "GossipOrQuestClosed")
 
self:RegisterEvent("QUEST_LOG_UPDATE")
--~ self:RegisterBucketEvent({
--~ "QUEST_LOG_UPDATE",
--~ }, 0, "QuestLogUpdate")
 
self:RegisterEvent("QUEST_LOG_UPDATE", "QuestLogUpdate")
 
self:RawHook("QuestRewardItem_OnClick", true)
self:RawHook("GossipTitleButton_OnClick", true)
self:RawHook("QuestTitleButton_OnClick", true)
trunk/EasyDaily/libs/LibBabble-Zone-3.0/LibBabble-Zone-3.0.lua
1,6 → 1,6
--[[
Name: LibBabble-Zone-3.0
Revision: $Rev: 207 $
Revision: $Rev: 208 $
Maintainers: ckknight, nevcairiel, Ackis
Website: http://www.wowace.com/projects/libbabble-zone-3-0/
Dependencies: None
8,7 → 8,7
]]
 
local MAJOR_VERSION = "LibBabble-Zone-3.0"
local MINOR_VERSION = 90000 + tonumber(("$Rev: 207 $"):match("%d+"))
local MINOR_VERSION = 90000 + tonumber(("$Rev: 208 $"):match("%d+"))
 
if not LibStub then error(MAJOR_VERSION .. " requires LibStub.") end
local lib = LibStub("LibBabble-3.0"):New(MAJOR_VERSION, MINOR_VERSION)
325,7 → 325,7
Feralas = "Feralas",
["Forge Camp: Terror"] = "Konstruktionslager: Terror",
["Forge Camp: Wrath"] = "Konstruktionslager: Wut",
["Frostwyrm Lair"] = "Frostwyrm Lair", -- Needs review
["Frostwyrm Lair"] = "Frostwyrmbau",
["Furywing's Perch"] = "Isidions Hort",
Gadgetzan = "Gadgetzan",
["Gates of Ahn'Qiraj"] = "Tore von Ahn'Qiraj",
1472,7 → 1472,7
["Crystalsong Forest"] = "Лес Хрустальной Песни",
["Crystal Spine"] = "Хрустальное поле",
Dalaran = "Даларан",
["Dalaran Arena"] = "Арена Даларана", -- Needs review
["Dalaran Arena"] = "Арена Даларана",
["Dalaran Sewers"] = "Арена Даларана",
["Darkmoon Faire"] = "Ярмарка Новолуния",
Darkshore = "Темные берега",
1530,7 → 1530,7
["Isle of Quel'Danas"] = "Остров Кель'Данас",
Kalimdor = "Калимдор",
Karazhan = "Каражан",
["Krasus' Landing"] = "Площадка Красуса",
["Krasus' Landing"] = "Площадка Краса",
Library = "Библиотека",
["Loch Modan"] = "Лок Модан",
["Lower Blackrock Spire"] = "Нижний ярус Черной горы",
1609,7 → 1609,7
["The Culling of Stratholme"] = "Очищение Стратхольма",
["The Dark Portal"] = "Темный портал",
["The Deadmines"] = "Мертвые копи",
["The Descent into Madness"] = "Провал Безумия", -- Needs review
["The Descent into Madness"] = "Провал Безумия",
["The Exodar"] = "Экзодар",
["The Eye"] = "Око",
["The Eye of Eternity"] = "Око Вечности",
1628,7 → 1628,7
["The Ring of Valor"] = "Круг Доблести",
["The Shattered Halls"] = "Разрушенные залы",
["The Slave Pens"] = "Узилище",
["The Spark of Imagination"] = "Искра Воображения", -- Needs review
["The Spark of Imagination"] = "Искра Воображения",
["The Steamvault"] = "Паровое подземелье",
["The Stockade"] = "Тюрьма",
["The Storm Peaks"] = "Грозовая Гряда",
trunk/EasyDaily/libs/LibBabble-Zone-3.0/LibBabble-Zone-3.0.toc
9,7 → 9,7
## X-eMail: ckknight@gmail.com
## X-Category: Library
## X-License: MIT
## X-Curse-Packaged-Version: r207
## X-Curse-Packaged-Version: r208
## X-Curse-Project-Name: LibBabble-Zone-3.0
## X-Curse-Project-ID: libbabble-zone-3-0
## X-Curse-Repository-ID: wow/libbabble-zone-3-0/mainline
trunk/EasyDaily/libs/LibBabble-Faction-3.0/LibBabble-Faction-3.0.lua
1,6 → 1,6
--[[
Name: LibBabble-Faction-3.0
Revision: $Rev: 83 $
Revision: $Rev: 91 $
Maintainers: ckknight, nevcairiel, Ackis
Website: http://www.wowace.com/projects/libbabble-faction-3-0/
Dependencies: None
8,7 → 8,7
]]
 
local MAJOR_VERSION = "LibBabble-Faction-3.0"
local MINOR_VERSION = 90000 + tonumber(("$Rev: 83 $"):match("%d+"))
local MINOR_VERSION = 90000 + tonumber(("$Rev: 91 $"):match("%d+"))
 
if not LibStub then error(MAJOR_VERSION .. " requires LibStub.") end
local lib = LibStub("LibBabble-3.0"):New(MAJOR_VERSION, MINOR_VERSION)
566,7 → 566,7
Kurenai = "Куренай",
["Lower City"] = "Нижний Город",
["Magram Clan Centaur"] = "Кентавры из племени Маграм",
Netherwing = "Крылья Пустоверти",
Netherwing = "Крылья Пустоты",
Neutral = "Равнодушие",
["Ogri'la"] = "Огри'ла",
Orgrimmar = "Оргриммар",
trunk/EasyDaily/libs/LibBabble-Faction-3.0/LibBabble-Faction-3.0.toc
12,7 → 12,7
## X-eMail: oma_daviesh@hotmail.com
## X-Category: Library
## X-License: MIT
## X-Curse-Packaged-Version: r87
## X-Curse-Packaged-Version: r91
## X-Curse-Project-Name: LibBabble-Faction-3.0
## X-Curse-Project-ID: libbabble-faction-3-0
## X-Curse-Repository-ID: wow/libbabble-faction-3-0/mainline
trunk/EasyDaily/libs/AceGUI-3.0/widgets/AceGUIWidget-CheckBox.lua
10,7 → 10,7
]]
do
local Type = "CheckBox"
local Version = 5
local Version = 6
 
local function OnAcquire(self)
self:SetValue(false)
92,8 → 92,8
--Nil is the unknown tristate value
if self.tristate and value == nil then
SetDesaturation(self.check, true)
check:SetWidth(20)
check:SetHeight(20)
check:SetWidth(24)
check:SetHeight(24)
self.check:Show()
else
SetDesaturation(self.check, false)
trunk/EasyDaily/options.lua
1,6 → 1,6
--[[
Desc:
Info: $Id: options.lua 40 2009-05-12 02:13:32Z draake $
Info: $Id: options.lua 42 2009-05-20 22:32:24Z draake $
]]
 
local _G = _G
9,6 → 9,8
local tinsert, tremove, tsort = table.insert, table.remove, table.sort
local sformat = string.format
 
local EasyDaily = EasyDaily
 
local L = LibStub("AceLocale-3.0"):GetLocale("EasyDaily_Base")
 
local LDBIcon = LibStub("LibDBIcon-1.0")
17,95 → 19,43
-- Content
--------------------------------------------------------------------------------------------------
 
-- available, complete, repeatable, normal
function EasyDaily:SetQuestOptionsTable(daily, repeatable)
for i, h in pairs(self.handlers.quest) do
if h:GetVal("hval") == "quest" then
local name, index, questType, questTag, header, enable = h:GetVal("name"), h:GetVal("index"), h:GetVal("type"), h:GetVal("tag"), h:GetVal("header"), h:GetVal("enable")
local t
if ( questType == "daily" ) then
t = daily
elseif ( questType == "repeat" ) then
t = repeatable
function EasyDaily:GetHandleDesc(h)
 
if h:GetVal("hval") == "quest" then
 
local name, index, questType, questTag = h:GetVal("name"), h:GetVal("index"), h:GetVal("type"), h:GetVal("tag")
 
local questComplete = self:QuestCompleteToday(name)
 
-- Description
local desc = ""
 
local reset, done = h:GetVal("reset"), h:GetVal("count")
 
if questComplete then
desc = desc .. sformat("\n%s: %s", self:Colorize(L["Completed"], 1, .8, 0), self:Colorize(YES, 0, 1, 0))
if reset then
desc = desc .. sformat("\n%s: %s", self:Colorize(L["Reset"], 1, .8, 0), date("%A, %B %d - %I:%M:%S %p", reset))
end
if t then
 
local questComplete = self:QuestCompleteToday(name)
 
local cat1, cat2 = self:GetQuestCategoryInfo(name)
 
-- Description
local desc = ""
 
local reset, done = h:GetVal("reset"), h:GetVal("done")
 
if questComplete then
desc = desc .. sformat("\n%s: %s", self:Colorize(L["Completed"], 1, .8, 0), self:Colorize(YES, 0, 1, 0))
if reset then
desc = desc .. sformat("\n%s: %s", self:Colorize(L["Reset"], 1, .8, 0), date("%A, %B %d - %I:%M:%S %p", reset))
end
else
desc = desc .. sformat("\n%s: %s", self:Colorize(L["Completed"], 1, .8, 0), self:Colorize(NO, 1, 0, 0))
end
 
desc = desc .. sformat("\n%s: %s\n", self:Colorize(L["Done"], 1, .8, 0), done)
 
if index then
desc = desc .. sformat("\n%s: %s", self:Colorize("ID", 1, .8, 0), index)
end
 
desc = desc .. sformat("\n%s: %s %s", self:Colorize(L["Type"], 1, .8, 0), self:TagOptToTagText(questTag), self:TypeOptToTypeText(questType))
 
-- Option Table
local idkey = sformat("id-%s", i)
local x = {
type = "group",
name = questComplete and self:Colorize(name, .5, .5, .5) or name,
args = {
state = {
order = 1,
type = "toggle",
width = "full",
name = "Enabled",
desc = L["Toggle this quest's state."],
get = function(info) return h:GetVal("enable") end,
set = function(info, value) h:SetVal("enable", value); self:RefreshGossipOrQuestFrame(); end,
},
questdesc = {
order = 2,
type = "description",
name = desc,
},
},
}
 
local cat1key = sformat("c1-%s", cat1)
if ( not t[cat1key] )then
t[cat1key] = {
type = "group",
name = cat1,
args = {}
}
end
 
local cat2key
if cat2 then
cat2key = sformat("c2-%s", cat2)
if ( not t[cat1key].args[cat2key] )then
t[cat1key].args[cat2key] = {
type = "group",
name = cat2,
args = {}
}
end
t[cat1key].args[cat2key].args[idkey] = x
else
t[cat1key].args[idkey] = x
end
 
end
else
desc = desc .. sformat("\n%s: %s", self:Colorize(L["Completed"], 1, .8, 0), self:Colorize(NO, 1, 0, 0))
end
 
desc = desc .. sformat("\n%s: %s\n", self:Colorize(L["Done"], 1, .8, 0), done)
 
if index then
desc = desc .. sformat("\n%s: %s", self:Colorize("ID", 1, .8, 0), index)
end
 
local tagText, typeText = self:TagOptToTagText(questTag), self:TypeOptToTypeText(questType)
if tagText and typeText then
desc = desc .. sformat("\n%s: %s %s", self:Colorize(L["Type"], 1, .8, 0), tagText, typeText)
end
 
return desc
 
end
 
end
 
--------------------------------------------------------------------------------------------------
238,6 → 188,14
get = getFunc,
set = function(...) setFunc(...); self:RefreshGossipOrQuestFrame(); end,
},
acceptshared = {
order = 4,
type = "toggle",
name = L["Accept Shared Quests"],
desc = L["Shared quests are accepted regardless of their modifiers status."],
get = getFunc,
set = setFunc,
},
},
},
rewards = {
424,20 → 382,71
type = "group",
name = L["Quests"],
args = {
enableall = {
order = 1,
type = "execute",
name = "Enable All",
desc = "Enables all quests",
func = function(info) self:Debug( self:GetLinearArgs(info.options, unpack(info, 1, #info - 1)) ); self:SetAllQuestStates(true) end,
},
disableall = {
order = 2,
type = "execute",
name = "Disable All",
desc = "Disables all quests",
func = function() self:SetAllQuestStates(false) end,
},
daily = {
order = 1,
order = 3,
type = "group",
childGroups = "tab",
name = L["Daily"],
args = {},
name = DAILY,
args = {
questedit = {
order = 1,
type = "toggle",
name = L["Edit"],
desc = L["Enable/Disable edit mode."],
get = getFunc,
set = setFunc,
disabled = isDisabled,
},
},
},
repeatable = {
order = 2,
order = 4,
type = "group",
childGroups = "tab",
name = L["Repeatable"],
args = {},
args = {
questedit = {
order = 1,
type = "toggle",
name = L["Edit"],
desc = L["Enable/Disable edit mode."],
get = getFunc,
set = setFunc,
disabled = isDisabled,
},
},
},
normal = {
order = 5,
type = "group",
childGroups = "tab",
name = DUNGEON_DIFFICULTY1,
args = {
questedit = {
order = 1,
type = "toggle",
name = L["Edit"],
desc = L["Enable/Disable edit mode."],
get = getFunc,
set = setFunc,
disabled = isDisabled,
},
},
},
},
},
},
445,14 → 454,159
self.options.plugins.profiles = { profiles = LibStub("AceDBOptions-3.0"):GetOptionsTable(self.db) }
end
 
--~ local available = self:CleanTable(self.options.args.quests.args.daily.args.available.args)
--~ local complete = self:CleanTable(self.options.args.quests.args.daily.args.complete.args)
local daily = self:CleanTable(self.options.args.quests.args.daily.args)
local repeatable = self:CleanTable(self.options.args.quests.args.repeatable.args)
--~ local normal = self:CleanTable(self.options.args.quests.args.normal.args)
for i, h in pairs(self.handlers.quest) do
 
local option
 
if ( h:GetVal("type") == "daily" ) then
option = self.options.args.quests.args.daily.args
elseif ( h:GetVal("type") == "repeat" ) then
option = self.options.args.quests.args.repeatable.args
elseif ( h:GetVal("type") == "normal" ) then
option = self.options.args.quests.args.normal.args
end
 
if option then
 
local cat1, cat2 = self:GetQuestCategoryInfo( h:GetVal("name") )
 
-- Option Table
local cat1key = sformat("c1-%s", cat1)
if ( not option[cat1key] )then
option[cat1key] = {
type = "group",
name = cat1,
args = {},
}
end
 
local cat2key = sformat("c2-%s", cat2)
if ( not option[cat1key].args[cat2key] )then
option[cat1key].args[cat2key] = {
type = "group",
name = cat2,
args = {
state = {
order = 1,
type = "toggle",
tristate = true,
name = "Enable",
desc = "Enable all quests in this category",
get = function(info)
local t = EasyDaily:GetLinearArgs(info.options, unpack(info, 1, #info - 1))
local state
for i in pairs(t.args) do
i = tonumber(i)
if i then
local c = EasyDaily.handlers.quest[i]:GetVal("enable")
if state ~= nil then
if state ~= c then
return
end
else
state = c
end
end
end
return state
end,
set = function(info, value)
local t = EasyDaily:GetLinearArgs(info.options, unpack(info, 1, #info - 1))
local state
for i in pairs(t.args) do
i = tonumber(i)
if i then
EasyDaily.handlers.quest[i]:SetVal("enable", toboolean(value))
end
end
end,
},
},
}
end
 
local idkey = tostring(i)
if ( not option[cat1key].args[cat2key].args[idkey] ) then
option[cat1key].args[cat2key].args[idkey] = {
type = "group",
name = function()
local name = h:GetVal("name")
if self:QuestCompleteToday(name) then
return self:Colorize(name, .5, .5, .5)
elseif ( not h:GetVal("enable") ) then
return self:Colorize(name, 1, 0, 0)
else
return name
end
end,
args = {
state = {
order = 1,
width = "half",
type = "toggle",
name = "Enable",
desc = L["Toggle this quest's state."],
get = function(info) return h:GetVal("enable") end,
set = function(info, value) h:SetVal("enable", value); self:RefreshGossipOrQuestFrame(); end,
},
header = {
order = 2,
name = "Header",
desc = "",
hidden = function() return ( not self.db.profile.questedit ) end,
type = "input",
get = function(info) return h:GetVal("header") end,
set = function(info, value) h:SetVal("header", value); end,
validate = function() end,
},
side = {
order = 3,
type = "select",
style = "dropdown",
name = "Side",
desc = "Select which side this quest is available for.",
hidden = function() return ( not self.db.profile.questedit ) end,
values = { [0] = L["None"], [1] = FACTION_ALLIANCE, [2] = FACTION_HORDE, [3] = L["Both"] },
get = function(info) return h:GetVal("side") end,
set = function(info, value) return h:SetVal("side", value) end,
},
tag = {
order = 4,
type = "select",
style = "dropdown",
name = "Tag",
desc = "Select which tag applies to this quest.",
hidden = function() return ( not self.db.profile.questedit ) end,
values = { ["normal"] = DUNGEON_DIFFICULTY1, ["group"] = GROUP, ["dungeon"] = LFG_TYPE_NORMAL_DUNGEON, ["raid"] = RAID, ["heroic"] = LFG_TYPE_HEROIC_DUNGEON, ["pvp"] = PVP, ["elite"] = ELITE },
get = function(info) return h:GetVal("tag") end,
set = function(info, value) return h:SetVal("tag", value) end,
},
type = {
order = 5,
type = "select",
style = "dropdown",
name = "Type",
desc = "Select which type this quest is.",
hidden = function() return ( not self.db.profile.questedit ) end,
values = { ["normal"] = DUNGEON_DIFFICULTY1, ["daily"] = DAILY, ["repeat"] = L["Repeatable"] },
get = function(info) return h:GetVal("type") end,
set = function(info, value) h:SetVal("type", value) end,
},
questdesc = {
order = 50,
width = "full",
type = "description",
name = function() return self:GetHandleDesc(h) end,
hidden = function() return ( self.db.profile.questedit ) end,
},
},
}
end
 
end
 
end
 
self:SetQuestOptionsTable(daily, repeatable)
 
return self.options
end
 
464,7 → 618,7
-- Register Options
AceConfig:RegisterOptionsTable("EasyDaily", getOptions, "edtest")
AceConfigDialog:SetDefaultSize("EasyDaily", 790, 540)
AceConfigDialog:AddToBlizOptions("EasyDaily", "EasyDaily")
--~ AceConfigDialog:AddToBlizOptions("EasyDaily", "EasyDaily")
 
-- Slash Commands
local AceConsole = LibStub("AceConsole-3.0")
trunk/EasyDaily/turnin.lua
1,6 → 1,6
--[[
Desc:
Info: $Id: turnin.lua 40 2009-05-12 02:13:32Z draake $
Info: $Id: turnin.lua 42 2009-05-20 22:32:24Z draake $
]]
 
local _G = _G
59,6 → 59,9
end
 
function EasyDaily:QuestEligibleForAdvancement(title)
if self.tracker.gossip.shared then
return self:GetPVar("acceptshared")
end
if self:QuestTypeKeyIsDown("suspend") then
self.tracker.gossip[title] = false
return
263,18 → 266,22
 
EasyDailyQuestFrameCheckButton:Show()
 
local title = GetTitleText()
self.tracker.gossip.title = GetTitleText()
 
-- NPC Tracking
local name, index, kind = self:UnitName("npc")
if name and index and kind then
self.tracker.gossip.title, self.tracker.gossip.part = title, "start"
self.tracker.gossip.part = "start"
self.tracker.gossip.name, self.tracker.gossip.index, self.tracker.gossip.type = name, index, kind
self.tracker.gossip.side = self:UnitSideBit("npc")
self.tracker.gossip.zone, self.tracker.gossip.x, self.tracker.gossip.y, self.tracker.gossip.dl = self:GetLocation()
self.tracker.gossip.shared = nil
else
self.tracker.gossip.shared = true
end
 
-- Auto Quest
if self:QuestEligibleForAdvancement(title) then
if self:QuestEligibleForAdvancement(self.tracker.gossip.title) then
if ( not self:GetPVar("skipflag") ) and QuestFlagsPVP() then
QuestFrame.dialog = StaticPopup_Show("CONFIRM_ACCEPT_PVP_QUEST")
else
294,13 → 301,14
 
EasyDailyQuestFrameCheckButton:Show()
 
local title = GetTitleText()
local isRepeat = ( not self:GetQuestLogInfoByName(title) )
self.tracker.gossip.title = GetTitleText()
 
local isRepeat = ( not self:GetQuestLogInfoByName(self.tracker.gossip.title) )
if isRepeat then
-- Quest is repeatable
self:RegisterRepeatableQuest()
end
if self:QuestEligibleForAdvancement(title) then
if self:QuestEligibleForAdvancement(self.tracker.gossip.title) then
if IsQuestCompletable() then
CompleteQuest()
--~ elseif isRepeat and self.tracker.gossip.parent then
320,15 → 328,22
 
self:RefreshQuestRewardHighlight()
 
local title = GetTitleText()
self.tracker.gossip.title = GetTitleText()
 
-- NPC Tracking
self.tracker.gossip.title, self.tracker.gossip.part = title, "finish"
self.tracker.gossip.name, self.tracker.gossip.index, self.tracker.gossip.type = self:UnitName("npc")
self.tracker.gossip.zone, self.tracker.gossip.x, self.tracker.gossip.y, self.tracker.gossip.dl = self:GetLocation()
local name, index, kind = self:UnitName("npc")
if name and index and kind then
self.tracker.gossip.part = "start"
self.tracker.gossip.name, self.tracker.gossip.index, self.tracker.gossip.type = name, index, kind
self.tracker.gossip.side = self:UnitSideBit("npc")
self.tracker.gossip.zone, self.tracker.gossip.x, self.tracker.gossip.y, self.tracker.gossip.dl = self:GetLocation()
self.tracker.gossip.shared = nil
else
self.tracker.gossip.shared = true
end
 
-- Auto Quest
if self:QuestEligibleForAdvancement(title) then
if self:QuestEligibleForAdvancement(self.tracker.gossip.title) then
local money = GetQuestMoneyToGet()
if money and ( money > 0 ) and ( not self:GetPVar("skipmoney") ) then
QuestFrame.dialog = StaticPopup_Show("CONFIRM_COMPLETE_EXPENSIVE_QUEST")
337,7 → 352,7
end
else
if GetNumQuestChoices() > 0 then
local i = self:GetHandleValue("quest", GetTitleText(), "reward")
local i = self:GetHandleValue("quest", self.tracker.gossip.title, "reward")
if i and i > 0 and self:GetPVar("multiple") then
GetQuestReward(i)
end
351,10 → 366,6
 
end
 
--------------------------------------------------------------------------------------------------
-- Gossip/Quest Frame Functions
--------------------------------------------------------------------------------------------------
 
function EasyDaily:GossipOrQuestClosed()
if ( not QuestFrame:IsShown() ) and ( not GossipFrame:IsShown() ) then
-- NPC Tracking
364,6 → 375,7
name = self.tracker.gossip.name,
index = self.tracker.gossip.index,
type = self.tracker.gossip.type,
side = self.tracker.gossip.side,
zone = self.tracker.gossip.zone,
x = self.tracker.gossip.x,
y = self.tracker.gossip.y,
375,245 → 387,3
end
end
 
function EasyDaily:UpdateGossipOrQuestFrame()
 
if ( not self:IsEnabled() ) then return end
 
local n, x
if QuestFrameGreetingPanel:IsShown() then
n, x = MAX_NUM_QUESTS, "QuestTitleButton"
elseif GossipFrame:IsShown() then
n, x = NUMGOSSIPBUTTONS, "GossipTitleButton"
else
return
end
 
for i = 1, n, 1 do
local button = _G[ x .. i]
if button.title then
local title = button.title
-- Extra Gossip text
if self:GetPVar("gossipstate") then
local enable = self:GetQuestState(title)
if type(enable) ~= "nil" then
button:SetFormattedText("%s |cff000000(%s)|r", button:GetText(), enable and L["On"] or L["Off"])
end
end
-- Icon Settings
if button.icon and self:GetPVar("gossipicons") then
 
local icon, isActive = button.icon, 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
if ( not enabled ) or ( not self:QuestTagIsActive(questTag) ) then
iconState = "Disable"
else
iconState = "Enable"
end
else
iconState = ""
end
 
local iconType
if isActive or ( questType == "repeat" ) then
iconType = "Active"
else
iconType = "Available"
end
 
self:Maintenance(title, isActive, questType, questTag, self:QuestTagIsActive(questTag), iconColor, iconState, iconType)
 
icon:SetTexture("Interface\\Addons\\EasyDaily\\Textures\\Gossip-Icons\\" .. iconColor .. iconState .. iconType)
 
end
end
end
 
end
 
function EasyDaily:RefreshGossipOrQuestFrame()
if QuestFrameGreetingPanel:IsShown() then
self:ClearTracker("gossip")
QuestFrameGreetingPanel:Hide()
QuestFrameGreetingPanel:Show()
self:UpdateGossipOrQuestFrame()
elseif GossipFrame:IsShown() then
self:ClearTracker("gossip")
GossipFrameUpdate()
self:UpdateGossipOrQuestFrame()
end
end
 
function EasyDaily:RefreshQuestRewardHighlight()
local i = self:GetHandleValue("quest", GetTitleText(), "reward")
if i and i > 0 then
local frame = _G[ "QuestRewardItem" .. i ]
if frame and frame:IsShown() then
EasyDailyQuestRewardItemHighlight:SetPoint("TOPLEFT", frame, "TOPLEFT", -8, 7)
EasyDailyQuestRewardItemHighlight:Show()
return
end
end
EasyDailyQuestRewardItemHighlight:Hide()
end
 
function EasyDaily:QuestRewardItem_OnClick(frame)
if arg1 == "RightButton" then
if ( frame.type == "choice" ) then
local h = self:GetHandle("quest", GetTitleText())
if h then
local index = frame:GetID()
if index == h:GetVal("reward") then
h:SetVal("reward", 0)
else
h:SetVal("reward", index)
end
self:RefreshQuestRewardHighlight()
end
end
end
self.hooks["QuestRewardItem_OnClick"](frame)
end
 
function EasyDaily:GossipTitleButton_OnClick(frame, button)
if button == "RightButton" then
if ( frame.type == "Available" ) or ( frame.type == "Active" ) then
self:ToggleQuestState(frame.title)
self:RefreshGossipOrQuestFrame()
self:GossipOrQuestButtonTooltip(frame)
end
else
self.hooks["GossipTitleButton_OnClick"](frame, button)
end
end
 
function EasyDaily:QuestTitleButton_OnClick(frame)
if arg1 == "RightButton" then
self:ToggleQuestState(frame.title)
self:RefreshGossipOrQuestFrame()
self:GossipOrQuestButtonTooltip(frame)
else
self.hooks["QuestTitleButton_OnClick"](frame)
end
end
 
function EasyDaily:QuestCheckButtonOnShow(b)
local enable = self:GetQuestState( GetTitleText() )
if type(enable) ~= "nil" then
b:Enable()
b:SetChecked(enable)
b.text:SetTextColor(1, 0.8, 0, 1)
else
b:SetChecked(nil)
b:Disable()
b.text:SetTextColor(0.5, 0.5, 0.5, 1)
end
end
 
function EasyDaily:QuestCheckButtonOnClick(button)
local newState = self:ToggleQuestState(GetTitleText())
button:SetChecked(newState)
end
 
local TagOptToTagText = {
["normal"] = DUNGEON_DIFFICULTY1,
["group"] = GROUP,
["dungeon"] = LFG_TYPE_NORMAL_DUNGEON,
["raid"] = RAID,
["heroic"] = LFG_TYPE_HEROIC_DUNGEON,
["pvp"] = PVP,
["elite"] = ELITE,
}
 
function EasyDaily:TagOptToTagText(x)
return x and TagOptToTagText[x]
end
 
local TypeOptToTypeText = {
["normal"] = DUNGEON_DIFFICULTY1,
["daily"] = DAILY,
["repeat"] = L["Repeatable"],
}
 
function EasyDaily:TypeOptToTypeText(x)
return x and TypeOptToTypeText[x]
end
 
function EasyDaily:GossipOrQuestButtonTooltip(button)
 
if ( GetCVar("UberTooltips") == "1" ) then
GameTooltip_SetDefaultAnchor(GameTooltip, button)
else
GameTooltip:SetOwner(button, "ANCHOR_RIGHT")
end
 
GameTooltip:ClearLines()
 
local title = button.title or GetTitleText()
local found, index, questType, questTag, header, enable = self:GetQuestBaseInfo(title)
 
if found then
 
GameTooltip:AddDoubleLine(title)
 
GameTooltip:AddLine(" ")
 
local isComplete = self:CanCompleteQuest(title)
 
if isComplete then
if questType == "repeat" then
textComplete = sformat("%s: %s (%s)", L["Complete"], self:Colorize(YES, 0, 1, 0), self:Colorize(isComplete, 1, 1, 1))
else
textComplete = sformat("%s: %s", L["Complete"], self:Colorize(YES, 0, 1, 0))
end
else
textComplete = sformat("%s: %s", L["Complete"], self:Colorize(NO, 1, 0, 0))
end
 
local textEnabled
if enable then
textEnabled = sformat("%s: %s", L["Enabled"], self:Colorize(YES, 0, 1, 0))
else
textEnabled = sformat("%s: %s", L["Enabled"], self:Colorize(NO, 1, 0, 0))
end
 
GameTooltip:AddDoubleLine(textEnabled, textComplete)
 
local typeText = sformat("%s: %s", L["Type"], self:Colorize(self:TypeOptToTypeText(questType), 1, 1, 1))
local tagText = sformat("%s: %s (%s)", L["Tag"], self:Colorize(self:TagOptToTagText(questTag), 1, 1, 1), self:QuestTagIsActive(questTag) and self:Colorize(L["On"], 0, 1, 0) or self:Colorize(L["Off"], 1, 0, 0))
 
local cat1, cat2 = self:GetQuestCategoryInfo(title)
 
local cat1Text = sformat("%s: %s", L["Continent"], self:Colorize(cat1, 1, 1, 1))
local cat2Text = sformat("%s: %s", L["Zone"], self:Colorize(cat2, 1, 1, 1))
 
GameTooltip:AddDoubleLine(typeText, tagText)
GameTooltip:AddDoubleLine(cat1Text, cat2Text)
 
GameTooltip:AddLine(" ")
 
if index then
GameTooltip:AddLine( sformat("%s: %s", "ID", self:Colorize(index, 1, 1, 1)) )
GameTooltip:AddLine(" ")
end
 
GameTooltip:AddLine( self:ColorizePattern(L["[Right-Click] to toggle this quest's state"], "%[(.-)%]", 1, 1, 1 ))
 
GameTooltip:Show()
 
end
 
end