/trunk
--[[ |
Desc: |
Info: $Id: turnin.lua 32 2009-05-07 11:18:13Z draake $ |
Info: $Id: turnin.lua 36 2009-05-11 00:57:03Z draake $ |
]] |
local _G = _G |
local _, index, need = self:StrSplit(":", objString) |
local count = self:CountContainerItem(index) |
local floor = math.floor( count / need ) |
self:Debug(GetItemInfo(index), count, need, floor) |
self:RawDebug(GetItemInfo(index), count, need, floor) |
minimum = math.min( floor, minimum or math.huge ) |
end |
if minimum and ( minimum > 0 ) then |
local i = button:GetID() |
if button.isActive == 0 then |
local title, isTrivial = GetAvailableTitle(i), IsAvailableQuestTrivial(i) |
self:Debug("Checking Available Quest:", title) |
if self:CanAdvanceAvailableQuest(title) then |
local priority = self:GetHandleValue("quest", title, "priority") or 0 |
if ( not available_priority ) or ( priority > available_priority ) then |
button.active = nil |
elseif button.isActive == 1 then |
local title, isTrivial = GetActiveTitle(i), IsActiveQuestTrivial(i) |
self:Debug("Checking Active Quest:", title) |
if self:CanAdvanceActiveQuest(title) then |
local priority = self:GetHandleValue("quest", title, "priority") or 0 |
if ( not active_priority ) or ( priority > active_priority ) then |
local index = ( i - 1 ) * 3 + 1 |
if button.type == "Available" then |
local title, isTrivial = v[index], v[index + 2] |
self:Debug("Checking Available Quest:", title) |
if self:CanAdvanceAvailableQuest(title) then |
local priority = self:GetHandleValue("quest", title, "priority") or 0 |
if ( not available_priority ) or ( priority > available_priority ) then |
button.active = nil |
elseif button.type == "Active" then |
local title, isTrivial = j[index], j[index + 2] |
self:Debug("Checking Active Quest:", title) |
if self:CanAdvanceActiveQuest(title) then |
local priority = self:GetHandleValue("quest", title, "priority") or 0 |
if ( not active_priority ) or ( priority > active_priority ) then |
EasyDailyQuestFrameCheckButton:Show() |
local title = GetTitleText() |
-- NPC Tracking |
local name, index, kind = self:UnitName("npc") |
if name and index and kind then |
self.log.start[title] = {} |
self.log.start[title].name, self.log.start[title].index, self.log.start[title].type = name, index, kind |
self.log.start[title].zone, self.log.start[title].x, self.log.start[title].y, self.log.start[title].dl = self:GetLocation() |
self:ScheduleTimer(function() self.log.start[title] = nil; end, 10) |
end |
-- Auto Quest |
if self:QuestEligibleForAdvancement(title) then |
if ( not self:GetPVar("skipflag") ) and QuestFlagsPVP() then |
QuestFrame.dialog = StaticPopup_Show("CONFIRM_ACCEPT_PVP_QUEST") |
self:RefreshQuestRewardHighlight() |
local title = GetTitleText() |
-- NPC Tracking |
local name, index, kind = self:UnitName("npc") |
if name and index and kind then |
self.log.finish[title] = {} |
self.log.finish[title].name, self.log.finish[title].index, self.log.finish[title].type = name, index, kind |
self.log.finish[title].zone, self.log.finish[title].x, self.log.finish[title].y, self.log.finish[title].dl = self:GetLocation() |
self:ScheduleTimer(function() self.log.finish[title] = nil; end, 10) |
end |
-- Auto Quest |
if self:QuestEligibleForAdvancement(title) then |
local money = GetQuestMoneyToGet() |
if money and ( money > 0 ) and ( not self:GetPVar("skipmoney") ) then |
end |
end |
self.vars.complete[title] = true |
end |
-------------------------------------------------------------------------------------------------- |
end |
end |
local autoText = sformat(NORMAL_QUEST_DISPLAY, L["Auto"]) |
function EasyDaily:UpdateGossipOrQuestFrame() |
if ( not self:IsEnabled() ) then 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") and self:GetQuestState(button.title) then |
b:SetFormattedText("%s (%s)", button:GetText(), autoText) |
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, title, isActive = button.icon, button.title, button.active |
local icon, isActive = button.icon, button.active |
local _, _, questType, questTag, _, enabled = self:GetQuestBaseInfo(title) |
iconType = "Available" |
end |
--~ self:Debug(title, isActive, questType, questTag, self:QuestTagIsActive(questTag), iconColor, iconState, iconType) |
self:RawDebug(title, isActive, questType, questTag, self:QuestTagIsActive(questTag), iconColor, iconState, iconType) |
icon:SetTexture("Interface\\Addons\\EasyDaily\\Textures\\Gossip-Icons\\" .. iconColor .. iconState .. iconType) |
self:RefreshQuestRewardHighlight() |
end |
end |
else |
self.hooks["QuestRewardItem_OnClick"](frame) |
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) |
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 |
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(YES, 0, 1, 0) or self:Colorize(NO, 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(" ") |
GameTooltip:AddLine( sformat("%s: %s", "ID", self:Colorize(index, 1, 1, 1)) ) |
GameTooltip:AddLine(" ") |
GameTooltip:AddLine( self:ColorizePattern(L["[Right-Click] to toggle this quest's state"], "%[(.-)%]", 1, 1, 1 )) |
GameTooltip:Show() |
end |
end |
]] local L = LibStub("AceLocale-3.0"):NewLocale("EasyDaily_Base", "esMX"); if not L then return end |
-- L["Alt"] = "" |
-- L["Auto"] = "" |
-- L["Auto-Select rewards for quests with more than one reward."] = "" |
-- L["Auto Turn-in"] = "" |
-- L["Auto Turn-in Text"] = "" |
-- L["Available"] = "" |
-- L["Battleground"] = "" |
-- L["Complete"] = "" |
-- L["Completed"] = "" |
-- L["Completed [%s] of [%s] dailies"] = "" |
-- L["Continent"] = "" |
-- L["Ctrl"] = "" |
-- L["Daily"] = "" |
-- L["Daily Quest Discovered"] = "" |
-- L["Disable PvP Pop-up"] = "" |
-- L["Disables the confirmation pop-up that appears when accepting a daily quest that flags you for pvp."] = "" |
-- L["Disables the confirmation pop-up that appears when completing a daily quest that requires gold."] = "" |
-- L["Displays a quests auto turn-in status in text."] = "" |
-- L["Displays a quests status in text next to its name in the gossip window."] = "" |
-- L["Done"] = "" |
-- L["Enabled"] = "" |
-- L["Enable/Disable debug mode."] = "" |
-- L["Enable/Disable the addon."] = "" |
-- L["Enables Auto Turn-in for %s tagged quests."] = "" |
-- L["Enhanced Gossip Icons"] = "" |
-- L["Force"] = "" |
-- L["General"] = "" |
-- L["Gossip/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["Off"] = "" |
-- L["On"] = "" |
-- L["Quest Confirmation Pop-ups"] = "" |
-- L["Quest Enabled"] = "" |
-- L["Quest Rewards"] = "" |
-- L["Quests"] = "" |
-- L["Quest Status Text"] = "" |
-- L["Quest Tags"] = "" |
-- L["Quick Info"] = "" |
-- L["Repeatable"] = "" |
-- L["Repeatable Quest Discovered"] = "" |
-- L["Replace Gossip Icons"] = "" |
-- L["Replaces the default gossip icons with color coded versions."] = "" |
-- L["Reset"] = "" |
-- L["[Right-Click] to toggle the options menu"] = "" |
-- L["[Right-Click] to toggle this quest's state"] = "" |
-- L["Selection Modifiers"] = "" |
-- L["Shift"] = "" |
-- L["Show an icon on the Minimap."] = "" |
-- L["Special"] = "" |
-- L["Suspend"] = "" |
-- L["Tag"] = "" |
-- L["The [new day] begins in %s"] = "" |
-- L["Toggles 'Auto Turn-in' for this quest."] = "" |
-- L["Toggle this quest's state."] = "" |
-- L["Type"] = "" |
-- 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."] = "" |
-- L["Zone"] = "" |
]] local L = LibStub("AceLocale-3.0"):NewLocale("EasyDaily_Base", "zhTW"); if not L then return end |
-- L["Alt"] = "" |
-- L["Auto"] = "" |
-- L["Auto-Select rewards for quests with more than one reward."] = "" |
-- L["Auto Turn-in"] = "" |
-- L["Auto Turn-in Text"] = "" |
-- L["Available"] = "" |
-- L["Battleground"] = "" |
-- L["Complete"] = "" |
-- L["Completed"] = "" |
-- L["Completed [%s] of [%s] dailies"] = "" |
-- L["Continent"] = "" |
-- L["Ctrl"] = "" |
-- L["Daily"] = "" |
-- L["Daily Quest Discovered"] = "" |
-- L["Disable PvP Pop-up"] = "" |
-- L["Disables the confirmation pop-up that appears when accepting a daily quest that flags you for pvp."] = "" |
-- L["Disables the confirmation pop-up that appears when completing a daily quest that requires gold."] = "" |
-- L["Displays a quests auto turn-in status in text."] = "" |
-- L["Displays a quests status in text next to its name in the gossip window."] = "" |
-- L["Done"] = "" |
-- L["Enabled"] = "" |
-- L["Enable/Disable debug mode."] = "" |
-- L["Enable/Disable the addon."] = "" |
-- L["Enables Auto Turn-in for %s tagged quests."] = "" |
-- L["Enhanced Gossip Icons"] = "" |
-- L["Force"] = "" |
-- L["General"] = "" |
-- L["Gossip/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["Off"] = "" |
-- L["On"] = "" |
-- L["Quest Confirmation Pop-ups"] = "" |
-- L["Quest Enabled"] = "" |
-- L["Quest Rewards"] = "" |
-- L["Quests"] = "" |
-- L["Quest Status Text"] = "" |
-- L["Quest Tags"] = "" |
-- L["Quick Info"] = "" |
-- L["Repeatable"] = "" |
-- L["Repeatable Quest Discovered"] = "" |
-- L["Replace Gossip Icons"] = "" |
-- L["Replaces the default gossip icons with color coded versions."] = "" |
-- L["Reset"] = "" |
-- L["[Right-Click] to toggle the options menu"] = "" |
-- L["[Right-Click] to toggle this quest's state"] = "" |
-- L["Selection Modifiers"] = "" |
-- L["Shift"] = "" |
-- L["Show an icon on the Minimap."] = "" |
-- L["Special"] = "" |
-- L["Suspend"] = "" |
-- L["Tag"] = "" |
-- L["The [new day] begins in %s"] = "" |
-- L["Toggles 'Auto Turn-in' for this quest."] = "" |
-- L["Toggle this quest's state."] = "" |
-- L["Type"] = "" |
-- 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."] = "" |
-- L["Zone"] = "" |
]] local L = LibStub("AceLocale-3.0"):NewLocale("EasyDaily_Base", "ruRU"); if not L then return end |
L["Alt"] = "Alt" |
L["Auto"] = "ÐвÑо" |
L["Auto-Select rewards for quests with more than one reward."] = "ÐвÑовÑÐ±Ð¾Ñ Ð½Ð°Ð³Ñад за Ð·Ð°Ð´Ð°Ð½Ð¸Ñ Ñ Ð½ÐµÑколÑкими нагÑадами." |
L["Auto Turn-in"] = "ÐвÑоÑдаÑа" |
L["Auto Turn-in Text"] = "ТекÑÑ Ð°Ð²ÑоÑдаÑи" |
L["Available"] = "ÐоÑÑÑпно" |
L["Battleground"] = "Ðоле боÑ" |
L["Complete"] = "ÐÑполнено" |
-- L["Completed"] = "" |
L["Completed [%s] of [%s] dailies"] = "ÐÑполнено [%s] из [%s] ежедневнÑÑ Ð·Ð°Ð´Ð°Ð½Ð¸Ð¹" |
-- L["Continent"] = "" |
L["Ctrl"] = "Ctrl" |
L["Daily"] = "Ðжедневно" |
L["Daily Quest Discovered"] = "ÐбнаÑÑжено ежедневное задание" |
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 quests auto turn-in status in text."] = "ÐÑобÑÐ°Ð¶Ð°ÐµÑ ÑÑаÑÑÑ Ð°Ð²ÑоÑдаÑи заданий в каÑеÑÑве ÑекÑÑа." |
-- L["Displays a quests status in text next to its name in the gossip window."] = "" |
-- L["Done"] = "" |
L["Enabled"] = "ÐклÑÑено" |
L["Enable/Disable debug mode."] = "ÐклÑÑиÑÑ/оÑклÑÑиÑÑ Ñежим оÑладки." |
L["Enable/Disable the addon."] = "ÐклÑÑиÑÑ/ÐÑклÑÑиÑÑ Ð°Ð´Ð´Ð¾Ð½." |
L["Enables Auto Turn-in for %s tagged quests."] = "ÐклÑÑиÑÑ Ð°Ð²ÑоÑдаÑÑ Ð·Ð°Ð´Ð°Ð½Ð¸Ð¹, помеÑеннÑÑ , как %s" |
-- L["Enhanced Gossip Icons"] = "" |
L["Force"] = "ÐÑинÑдиÑелÑно" |
L["General"] = "ÐбÑее" |
-- L["Gossip/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["Off"] = "" |
-- L["On"] = "" |
-- L["Quest Confirmation Pop-ups"] = "" |
-- L["Quest Enabled"] = "" |
L["Quest Rewards"] = "ÐагÑÐ°Ð´Ñ Ð·Ð° заданиÑ" |
L["Quests"] = "ÐаданиÑ" |
-- L["Quest Status Text"] = "" |
L["Quest Tags"] = "ÐеÑки заданиÑ" |
L["Quick Info"] = "ÐÑÑÑÑÐ°Ñ Ð¸Ð½Ñа" |
L["Repeatable"] = "ÐовÑоÑÑÑÑееÑÑ" |
L["Repeatable Quest Discovered"] = "ÐбнаÑÑжено повÑоÑÑÑÑееÑÑ Ð·Ð°Ð´Ð°Ð½Ð¸Ðµ" |
L["Replace Gossip Icons"] = "ÐамениÑÑ Ð¸ÐºÐ¾Ð½ÐºÐ¸ беÑедÑ" |
L["Replaces the default gossip icons with color coded versions."] = "ÐамениÑÑ ÑÑандаÑÑнÑе иконки окна беÑÐµÐ´Ñ Ð½Ð° ÑаÑкÑаÑеннÑе." |
-- L["Reset"] = "" |
L["[Right-Click] to toggle the options menu"] = "[ÐÑавÑй клик] Ð´Ð»Ñ Ð¾ÑкÑÑÑиÑ/закÑÑÑÐ¸Ñ Ð¼ÐµÐ½Ñ Ð½Ð°ÑÑÑоек" |
-- L["[Right-Click] to toggle this quest's state"] = "" |
L["Selection Modifiers"] = "ÐодиÑикаÑоÑÑ Ð²ÑбоÑа" |
L["Shift"] = "Shift" |
L["Show an icon on the Minimap."] = "ÐÑобÑажаÑÑ Ð¸ÐºÐ¾Ð½ÐºÑ Ñ Ð¼Ð¸Ð½Ð¸-каÑÑÑ." |
L["Special"] = "ÐÑобÑе" |
L["Suspend"] = "ÐÑиоÑÑановиÑÑ" |
-- L["Tag"] = "" |
L["The [new day] begins in %s"] = "[ÐовÑй денÑ] наÑнÑÑÑÑ ÑеÑез %s" |
L["Toggles 'Auto Turn-in' for this quest."] = "Ðкл/ÐÑкл 'ÐвÑоÑдаÑÑ' данного заданиÑ." |
L["Toggle this quest's state."] = "ÐеÑеклÑÑение ÑÑаÑÑÑа данного заданиÑ." |
-- L["Type"] = "" |
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."] = "ÐÑполÑзоваÑÑ ÑÑÐ¾Ñ Ð¼Ð¾Ð´Ð¸ÑикаÑÐ¾Ñ Ð´Ð»Ñ Ð¿ÑиоÑÑановки пÑоÑеÑÑа авÑоÑдаÑи." |
-- L["Zone"] = "" |
]] local L = LibStub("AceLocale-3.0"):NewLocale("EasyDaily_Base", "esES"); if not L then return end |
-- L["Alt"] = "" |
-- L["Auto"] = "" |
-- L["Auto-Select rewards for quests with more than one reward."] = "" |
-- L["Auto Turn-in"] = "" |
-- L["Auto Turn-in Text"] = "" |
-- L["Available"] = "" |
-- L["Battleground"] = "" |
-- L["Complete"] = "" |
-- L["Completed"] = "" |
-- L["Completed [%s] of [%s] dailies"] = "" |
-- L["Continent"] = "" |
-- L["Ctrl"] = "" |
-- L["Daily"] = "" |
-- L["Daily Quest Discovered"] = "" |
-- L["Disable PvP Pop-up"] = "" |
-- L["Disables the confirmation pop-up that appears when accepting a daily quest that flags you for pvp."] = "" |
-- L["Disables the confirmation pop-up that appears when completing a daily quest that requires gold."] = "" |
-- L["Displays a quests auto turn-in status in text."] = "" |
-- L["Displays a quests status in text next to its name in the gossip window."] = "" |
-- L["Done"] = "" |
-- L["Enabled"] = "" |
-- L["Enable/Disable debug mode."] = "" |
-- L["Enable/Disable the addon."] = "" |
-- L["Enables Auto Turn-in for %s tagged quests."] = "" |
-- L["Enhanced Gossip Icons"] = "" |
-- L["Force"] = "" |
-- L["General"] = "" |
-- L["Gossip/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["Off"] = "" |
-- L["On"] = "" |
-- L["Quest Confirmation Pop-ups"] = "" |
-- L["Quest Enabled"] = "" |
-- L["Quest Rewards"] = "" |
-- L["Quests"] = "" |
-- L["Quest Status Text"] = "" |
-- L["Quest Tags"] = "" |
-- L["Quick Info"] = "" |
-- L["Repeatable"] = "" |
-- L["Repeatable Quest Discovered"] = "" |
-- L["Replace Gossip Icons"] = "" |
-- L["Replaces the default gossip icons with color coded versions."] = "" |
-- L["Reset"] = "" |
-- L["[Right-Click] to toggle the options menu"] = "" |
-- L["[Right-Click] to toggle this quest's state"] = "" |
-- L["Selection Modifiers"] = "" |
-- L["Shift"] = "" |
-- L["Show an icon on the Minimap."] = "" |
-- L["Special"] = "" |
-- L["Suspend"] = "" |
-- L["Tag"] = "" |
-- L["The [new day] begins in %s"] = "" |
-- L["Toggles 'Auto Turn-in' for this quest."] = "" |
-- L["Toggle this quest's state."] = "" |
-- L["Type"] = "" |
-- 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."] = "" |
-- L["Zone"] = "" |
]] local L = LibStub("AceLocale-3.0"):NewLocale("EasyDaily_Base", "frFR"); if not L then return end |
-- L["Alt"] = "" |
-- L["Auto"] = "" |
-- L["Auto-Select rewards for quests with more than one reward."] = "" |
-- L["Auto Turn-in"] = "" |
-- L["Auto Turn-in Text"] = "" |
-- L["Available"] = "" |
-- L["Battleground"] = "" |
-- L["Complete"] = "" |
-- L["Completed"] = "" |
-- L["Completed [%s] of [%s] dailies"] = "" |
-- L["Continent"] = "" |
-- L["Ctrl"] = "" |
-- L["Daily"] = "" |
-- L["Daily Quest Discovered"] = "" |
-- L["Disable PvP Pop-up"] = "" |
-- L["Disables the confirmation pop-up that appears when accepting a daily quest that flags you for pvp."] = "" |
-- L["Disables the confirmation pop-up that appears when completing a daily quest that requires gold."] = "" |
-- L["Displays a quests auto turn-in status in text."] = "" |
-- L["Displays a quests status in text next to its name in the gossip window."] = "" |
-- L["Done"] = "" |
L["Enabled"] = "Activé" |
L["Enable/Disable debug mode."] = "Activer / désactiver le mode de débogage." |
L["Enable/Disable the addon."] = "Activer / désactiver cet add-on." |
-- L["Enables Auto Turn-in for %s tagged quests."] = "" |
-- L["Enhanced Gossip Icons"] = "" |
-- L["Force"] = "" |
-- L["General"] = "" |
-- L["Gossip/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["Off"] = "" |
-- L["On"] = "" |
-- L["Quest Confirmation Pop-ups"] = "" |
-- L["Quest Enabled"] = "" |
-- L["Quest Rewards"] = "" |
-- L["Quests"] = "" |
-- L["Quest Status Text"] = "" |
-- L["Quest Tags"] = "" |
-- L["Quick Info"] = "" |
-- L["Repeatable"] = "" |
-- L["Repeatable Quest Discovered"] = "" |
-- L["Replace Gossip Icons"] = "" |
-- L["Replaces the default gossip icons with color coded versions."] = "" |
-- L["Reset"] = "" |
-- L["[Right-Click] to toggle the options menu"] = "" |
-- L["[Right-Click] to toggle this quest's state"] = "" |
-- L["Selection Modifiers"] = "" |
-- L["Shift"] = "" |
-- L["Show an icon on the Minimap."] = "" |
-- L["Special"] = "" |
-- L["Suspend"] = "" |
-- L["Tag"] = "" |
-- L["The [new day] begins in %s"] = "" |
-- L["Toggles 'Auto Turn-in' for this quest."] = "" |
-- L["Toggle this quest's state."] = "" |
-- L["Type"] = "" |
-- 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."] = "" |
-- L["Zone"] = "" |
]] local L = LibStub("AceLocale-3.0"):NewLocale("EasyDaily_Base", "deDE"); if not L then return end |
-- 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 Turn-in"] = "" |
-- L["Auto Turn-in Text"] = "" |
-- L["Available"] = "" |
-- L["Battleground"] = "" |
-- L["Complete"] = "" |
-- L["Completed"] = "" |
-- L["Completed [%s] of [%s] dailies"] = "" |
-- L["Continent"] = "" |
-- L["Ctrl"] = "" |
-- L["Daily"] = "" |
-- L["Daily Quest Discovered"] = "" |
-- L["Disable PvP Pop-up"] = "" |
-- L["Disables the confirmation pop-up that appears when accepting a daily quest that flags you for pvp."] = "" |
-- L["Disables the confirmation pop-up that appears when completing a daily quest that requires gold."] = "" |
-- L["Displays a quests auto turn-in status in text."] = "" |
-- L["Displays a quests status in text next to its name in the gossip window."] = "" |
-- L["Done"] = "" |
L["Enabled"] = "aktiviert" |
-- L["Enable/Disable debug mode."] = "" |
-- L["Enable/Disable the addon."] = "" |
-- L["Enables Auto Turn-in for %s tagged quests."] = "" |
-- L["Enhanced Gossip Icons"] = "" |
-- L["Force"] = "" |
-- L["General"] = "" |
-- L["Gossip/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["Off"] = "" |
-- L["On"] = "" |
-- L["Quest Confirmation Pop-ups"] = "" |
-- L["Quest Enabled"] = "" |
-- L["Quest Rewards"] = "" |
-- L["Quests"] = "" |
-- L["Quest Status Text"] = "" |
-- L["Quest Tags"] = "" |
-- L["Quick Info"] = "" |
-- L["Repeatable"] = "" |
-- L["Repeatable Quest Discovered"] = "" |
-- L["Replace Gossip Icons"] = "" |
-- L["Replaces the default gossip icons with color coded versions."] = "" |
-- L["Reset"] = "" |
-- L["[Right-Click] to toggle the options menu"] = "" |
-- L["[Right-Click] to toggle this quest's state"] = "" |
-- L["Selection Modifiers"] = "" |
-- L["Shift"] = "" |
-- L["Show an icon on the Minimap."] = "" |
-- L["Special"] = "" |
-- L["Suspend"] = "" |
-- L["Tag"] = "" |
-- L["The [new day] begins in %s"] = "" |
-- L["Toggles 'Auto Turn-in' for this quest."] = "" |
-- L["Toggle this quest's state."] = "" |
-- L["Type"] = "" |
-- 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."] = "" |
-- L["Zone"] = "" |
]] local L = LibStub("AceLocale-3.0"):NewLocale("EasyDaily_Base", "zhCN"); if not L then return end |
-- L["Alt"] = "" |
-- L["Auto"] = "" |
-- L["Auto-Select rewards for quests with more than one reward."] = "" |
-- L["Auto Turn-in"] = "" |
-- L["Auto Turn-in Text"] = "" |
-- L["Available"] = "" |
-- L["Battleground"] = "" |
-- L["Complete"] = "" |
-- L["Completed"] = "" |
-- L["Completed [%s] of [%s] dailies"] = "" |
-- L["Continent"] = "" |
-- L["Ctrl"] = "" |
-- L["Daily"] = "" |
-- L["Daily Quest Discovered"] = "" |
-- L["Disable PvP Pop-up"] = "" |
-- L["Disables the confirmation pop-up that appears when accepting a daily quest that flags you for pvp."] = "" |
-- L["Disables the confirmation pop-up that appears when completing a daily quest that requires gold."] = "" |
-- L["Displays a quests auto turn-in status in text."] = "" |
-- L["Displays a quests status in text next to its name in the gossip window."] = "" |
-- L["Done"] = "" |
-- L["Enabled"] = "" |
-- L["Enable/Disable debug mode."] = "" |
-- L["Enable/Disable the addon."] = "" |
-- L["Enables Auto Turn-in for %s tagged quests."] = "" |
-- L["Enhanced Gossip Icons"] = "" |
-- L["Force"] = "" |
-- L["General"] = "" |
-- L["Gossip/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["Off"] = "" |
-- L["On"] = "" |
-- L["Quest Confirmation Pop-ups"] = "" |
-- L["Quest Enabled"] = "" |
-- L["Quest Rewards"] = "" |
-- L["Quests"] = "" |
-- L["Quest Status Text"] = "" |
-- L["Quest Tags"] = "" |
-- L["Quick Info"] = "" |
-- L["Repeatable"] = "" |
-- L["Repeatable Quest Discovered"] = "" |
-- L["Replace Gossip Icons"] = "" |
-- L["Replaces the default gossip icons with color coded versions."] = "" |
-- L["Reset"] = "" |
-- L["[Right-Click] to toggle the options menu"] = "" |
-- L["[Right-Click] to toggle this quest's state"] = "" |
-- L["Selection Modifiers"] = "" |
-- L["Shift"] = "" |
-- L["Show an icon on the Minimap."] = "" |
-- L["Special"] = "" |
-- L["Suspend"] = "" |
-- L["Tag"] = "" |
-- L["The [new day] begins in %s"] = "" |
-- L["Toggles 'Auto Turn-in' for this quest."] = "" |
-- L["Toggle this quest's state."] = "" |
-- L["Type"] = "" |
-- 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."] = "" |
-- L["Zone"] = "" |
]] local L = LibStub("AceLocale-3.0"):NewLocale("EasyDaily_Base", "koKR"); if not L then return end |
-- L["Alt"] = "" |
-- L["Auto"] = "" |
-- L["Auto-Select rewards for quests with more than one reward."] = "" |
-- L["Auto Turn-in"] = "" |
-- L["Auto Turn-in Text"] = "" |
-- L["Available"] = "" |
-- L["Battleground"] = "" |
-- L["Complete"] = "" |
-- L["Completed"] = "" |
-- L["Completed [%s] of [%s] dailies"] = "" |
-- L["Continent"] = "" |
-- L["Ctrl"] = "" |
-- L["Daily"] = "" |
-- L["Daily Quest Discovered"] = "" |
-- L["Disable PvP Pop-up"] = "" |
-- L["Disables the confirmation pop-up that appears when accepting a daily quest that flags you for pvp."] = "" |
-- L["Disables the confirmation pop-up that appears when completing a daily quest that requires gold."] = "" |
-- L["Displays a quests auto turn-in status in text."] = "" |
-- L["Displays a quests status in text next to its name in the gossip window."] = "" |
-- L["Done"] = "" |
-- L["Enabled"] = "" |
-- L["Enable/Disable debug mode."] = "" |
-- L["Enable/Disable the addon."] = "" |
-- L["Enables Auto Turn-in for %s tagged quests."] = "" |
-- L["Enhanced Gossip Icons"] = "" |
-- L["Force"] = "" |
-- L["General"] = "" |
-- L["Gossip/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["Off"] = "" |
-- L["On"] = "" |
-- L["Quest Confirmation Pop-ups"] = "" |
-- L["Quest Enabled"] = "" |
-- L["Quest Rewards"] = "" |
-- L["Quests"] = "" |
-- L["Quest Status Text"] = "" |
-- L["Quest Tags"] = "" |
-- L["Quick Info"] = "" |
-- L["Repeatable"] = "" |
-- L["Repeatable Quest Discovered"] = "" |
-- L["Replace Gossip Icons"] = "" |
-- L["Replaces the default gossip icons with color coded versions."] = "" |
-- L["Reset"] = "" |
-- L["[Right-Click] to toggle the options menu"] = "" |
-- L["[Right-Click] to toggle this quest's state"] = "" |
-- L["Selection Modifiers"] = "" |
-- L["Shift"] = "" |
-- L["Show an icon on the Minimap."] = "" |
-- L["Special"] = "" |
-- L["Suspend"] = "" |
-- L["Tag"] = "" |
-- L["The [new day] begins in %s"] = "" |
-- L["Toggles 'Auto Turn-in' for this quest."] = "" |
-- L["Toggle this quest's state."] = "" |
-- L["Type"] = "" |
-- 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."] = "" |
-- L["Zone"] = "" |
]] local L = LibStub("AceLocale-3.0"):NewLocale("EasyDaily_Base", "enUS", true); if not L then return end |
L["Alt"] = true |
L["Auto"] = true |
L["Auto Turn-in"] = true |
L["Auto Turn-in Text"] = true |
L["Auto-Select rewards for quests with more than one reward."] = true |
L["Available"] = true |
L["Battleground"] = true |
L["Complete"] = true |
L["Completed"] = true |
L["Completed [%s] of [%s] dailies"] = true |
L["Continent"] = true |
L["Ctrl"] = true |
L["Daily"] = true |
L["Daily Quest Discovered"] = true |
L["Disable PvP Pop-up"] = true |
L["Disables the confirmation pop-up that appears when accepting a daily quest that flags you for pvp."] = true |
L["Disables the confirmation pop-up that appears when completing a daily quest that requires gold."] = true |
L["Displays a quests auto turn-in status in text."] = true |
L["Displays a quests status in text next to its name in the gossip window."] = true |
L["Done"] = true |
L["Enable/Disable debug mode."] = true |
L["Enable/Disable the addon."] = true |
L["Enabled"] = true |
L["Enables Auto Turn-in for %s tagged quests."] = true |
L["Enhanced Gossip Icons"] = true |
L["Force"] = true |
L["General"] = 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["Off"] = true |
L["On"] = true |
L["Quest Confirmation Pop-ups"] = true |
L["Quest Enabled"] = true |
L["Quest Rewards"] = true |
L["Quest Status Text"] = true |
L["Quest Tags"] = true |
L["Quests"] = true |
L["Quick Info"] = true |
L["Repeatable"] = true |
L["Repeatable Quest Discovered"] = true |
L["Replace Gossip Icons"] = true |
L["Replaces the default gossip icons with color coded versions."] = true |
L["Reset"] = true |
L["Selection Modifiers"] = true |
L["Shift"] = true |
L["Show an icon on the Minimap."] = true |
L["Special"] = true |
L["Suspend"] = true |
L["Tag"] = 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["Type"] = 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 |
L["Zone"] = true |
L["[Left-Click] to toggle the quest window"] = true |
L["[Right-Click] to toggle the options menu"] = true |
L["[Right-Click] to toggle this quest's state"] = true |
--[[ |
Desc: |
Info: $Id: tracking.lua 28 2009-05-07 04:22:11Z draake $ |
Info: $Id: tracking.lua 36 2009-05-11 00:57:03Z draake $ |
]] |
local _G = _G |
function EasyDaily:RegisterRepeatableQuest() |
local questTitle = GetTitleText() |
local unitName, nID, kind = self:UnitName("npc") |
local title = GetTitleText() |
if ( not unitName ) or ( not nID ) or ( not kind ) or ( not questTitle ) then |
return |
end |
if ( not title ) then return end |
local h, isNew = self:GetHandle("quest", questTitle, true) |
local h, isNew = self:GetHandle("quest", title, true) |
if isNew then |
self:Display(L["Repeatable Quest Discovered"], questTitle) |
self:Display(L["Repeatable Quest Discovered"], title) |
end |
local zone = self:GetLocation() |
local zone, x, y, dl = self:GetLocation() |
h:SetVal("type", "repeat") |
h:SetVal("tag", "normal") |
h:SetVal("header", zone) |
for oID = 1, GetNumQuestItems(), 1 do |
local _, itemID = self:ParseItemLink( GetQuestItemLink("required", oID) ) |
h:SetVal("objective", "item", itemID, self:SelectOne(3, GetQuestItemInfo("required", oID))) |
for objIndex = 1, GetNumQuestItems(), 1 do |
local _, itemID = self:ParseItemLink( GetQuestItemLink("required", objIndex) ) |
h:SetVal("objective", "item", itemID, self:SelectOne(3, GetQuestItemInfo("required", objIndex))) |
end |
local name, index, kind = self:UnitName("npc") |
if name and index and kind then |
h:SetVal("unit", "start", kind, nindex) |
local k, isNew = self:GetHandle("npc", index, true) |
if isNew then |
k:SetVal("name", unitName) |
k:SetVal("coord", zone, x, y, dl) |
end |
end |
end |
-------------------------------------------------------------------------------------------------- |
[ELITE] = "elite", |
} |
local questLog, tempLog = {}, {} |
local tempLog = {} |
function EasyDaily:RefreshQuestLogInfo(refresh) |
function EasyDaily:RefreshQuestLogInfo() |
if refresh then |
self:CleanTable(questLog) |
end |
local _, numQuests = GetNumQuestLogEntries() |
local collapseHeaders = {} |
end |
else |
local index = self:ParseQuestLink( GetQuestLink(i) ) |
if questLog[index] then |
tempLog[index] = questLog[index] |
tempLog[index].refresh = true |
if self.log.quest[index] then |
tempLog[index] = self.log.quest[index] |
tempLog[index].old = true |
else |
-- Quest was not present in last update |
self:RecordQuestStart(index) |
tempLog[index] = {} |
tempLog[index].name = logName |
tempLog[index].daily = isDaily |
tempLog[index].complete = isComplete |
if self.log.start.name then |
tempLog[index].start = self.log.start |
end |
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 |
if self.log.quest[index] and self.log.quest[index].obj[k] then |
if objCurCount and self.log.quest[index].obj[k].cur and objCurCount > self.log.quest[index].obj[k].cur then |
-- Objective update |
local h = self:GetHandle("quest", index) |
if h then |
self:Debug(index, logName, objType, objName, questLog[index].obj[k].cur, objCurCount, objNeedCount) |
self:Debug(index, logName, objType, objName, self.log.quest[index].obj[k].cur, objCurCount, objNeedCount) |
end |
end |
tempLog[index].obj[k] = questLog[index].obj[k] |
tempLog[index].obj[k] = self.log.quest[index].obj[k] |
else |
tempLog[index].obj[k] = {} |
end |
end |
end |
for index, v in pairs(questLog) do |
for index, v in pairs(self.log.quest) do |
if ( not tempLog[index] ) then |
-- Quest was present in last update, but is now missing |
if self.vars.complete[v.name] then |
-- Quest was present in last update, but is now missing; __Add logic for abandoning quests later |
if v.complete then |
self:RecordQuestComplete(v.name) |
self.vars.complete[v.name] = nil |
end |
end |
end |
local clean = self:CleanTable(questLog) |
questLog = tempLog |
tempLog = clean |
local clean = self:CleanTable(self.log.quest) |
self.log.quest = tempLog |
tempLog = clean |
for index, v in pairs(questLog) do |
if type(v) == "table" and ( not v.refresh ) and v.daily then |
local h, isNew = self:GetHandle("quest", index, true) |
if isNew and self.vars.startup then |
self:Display(L["Daily Quest Discovered"], v.name) |
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) |
if isNew then |
self:Display(L["Daily Quest Discovered"], v.name) |
end |
h:SetVal("name", v.name) |
h:SetVal("type", v.daily and "daily" or "normal") |
h:SetVal("tag", v.tag) |
h:SetVal("header", v.header) |
end |
h:SetVal("name", v.name) |
h:SetVal("type", v.daily and "daily" or "normal") |
h:SetVal("tag", v.tag) |
h:SetVal("header", v.header) |
if self.log.initialized then |
self:RecordQuestStart(index) |
end |
end |
end |
tsort(collapseHeaders, function(a, b) return a > b; end) |
CollapseQuestHeader(v) |
end |
if not self.vars.startup then |
self.vars.startup = true |
if ( not self.log.initialized ) then |
self.log.initialized = true |
end |
end |
return current, max |
end |
function EasyDaily:RecordQuestStart(name) |
local h = self:GetHandle("quest", name) |
if h and h:GetVal("type") == "daily" then |
function EasyDaily:RecordQuestStart(index) |
local h = self:GetHandle("quest", index) |
if h then |
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 |
end |
end |
end |
function EasyDaily:RecordQuestComplete(name) |
local h = self:GetHandle("quest", name) |
if h and h:GetVal("type") == "daily" then |
local resetDate, timeLeft = self:GetDailyResetDate() |
h:SetVal("reset", resetDate) |
h:SetVal("time", self:GetTime()) |
function EasyDaily:RecordQuestComplete(index) |
local h = self:GetHandle("quest", index) |
if h then |
if h:GetVal("type") == "daily" then |
local resetDate, timeLeft = self:GetDailyResetDate() |
h:SetVal("reset", resetDate) |
end |
h:SetVal("done", h:GetVal("done") + 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 |
end |
end |
end |
function EasyDaily:QuestCompleteToday(name) |
local reset, time, done = self:GetQuestResetInfo(name) |
if reset then |
return reset and ( reset > self:GetTime() ) |
end |
local reset, start, done = self:GetQuestResetInfo(name) |
return reset and ( reset > self:GetTime() ) |
end |
--[[ |
Desc: |
Info: $Id: utility.lua 28 2009-05-07 04:22:11Z draake $ |
Info: $Id: utility.lua 36 2009-05-11 00:57:03Z draake $ |
]] |
local _G = _G |
-- Debugging |
-------------------------------------------------------------------------------------------------- |
function EasyDaily:VDebug(...) |
if self.db.profile.verbosedebug then |
self:Debug(...) |
end |
function EasyDaily:Help(...) |
self:ChatDebug(1, ...) |
end |
function EasyDaily:Debug(...) |
if self.db.profile.debug then |
self:ChatDebug(2, ...) |
end |
function EasyDaily:RawDebug(...) |
self:ChatDebug(3, ...) |
end |
function EasyDaily:ChatDebug(level, ...) |
if self.db.profile.debug and ( self.db.profile.debuglevel >= level ) then |
if AceLibrary and AceLibrary:HasInstance("AceConsole-2.0") then |
AceLibrary("AceConsole-2.0").PrintLiteral(self, ...) |
else |
--[[ |
Desc: |
Info: $Id: database.lua 28 2009-05-07 04:22:11Z draake $ |
Info: $Id: database.lua 36 2009-05-11 00:57:03Z draake $ |
]] |
local _G = _G |
-- DB Querying |
-------------------------------------------------------------------------------------------------- |
-- name, index, questType, questTag, header, enable = EasyDaily:GetQuestHandleInfo(name) |
-- name, index, questType, questTag, header, enable = EasyDaily:GetQuestBaseInfo(name) |
function EasyDaily:GetQuestBaseInfo(index) |
if not index then return end |
local h = self:GetHandle("quest", index) |
end |
end |
function EasyDaily:GetQuestCategoryInfo(index) |
if not index then return end |
local h = self:GetHandle("quest", index) |
if h then |
local header, questTag = h:GetVal("header"), h:GetVal("tag") |
local cat1, cat2 |
if self.LibTourist:IsZone(header) then |
local text = self.LibTourist:GetContinent(header) |
if text == UNKNOWN then |
cat1 = L["Special"] |
else |
cat1 = text |
end |
cat2 = header |
elseif self.LibTourist:IsBattleground(header) then |
cat1 = L["Battleground"] |
cat2 = header |
elseif self.LibTourist:IsInstance(header) then |
if questTag == "heroic" then |
cat1 = LFG_TYPE_HEROIC_DUNGEON |
else |
cat1 = LFG_TYPE_NORMAL_DUNGEON |
end |
cat2 = header |
end |
return cat1, cat2 |
end |
end |
function EasyDaily:GetQuestResetInfo(index) |
if not index then return end |
local h = self:GetHandle("quest", index) |
if h then |
return h:GetVal("reset"), h:GetVal("time"), h:GetVal("done") |
return h:GetVal("reset"), h:GetVal("start"), h:GetVal("done") |
end |
end |
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 }, |
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 |
self:InitHandles() |
self.vars.startup = nil |
self:RefreshQuestLogInfo(true) |
self.log.initialize = nil |
self:CleanTable(self.log.start) |
self:CleanTable(self.log.finish) |
self:CleanTable(self.log.quest) |
self:RefreshQuestLogInfo() |
end |
function EasyDaily:RefreshHandles() |
------------------------------------------------------------------------ |
r35 | draake | 2009-05-07 23:13:00 +0000 (Thu, 07 May 2009) | 1 line |
r37 | draake | 2009-05-11 01:00:01 +0000 (Mon, 11 May 2009) | 1 line |
Changed paths: |
A /tags/v2.0-beta.7 (from /trunk:34) |
A /tags/v2.0-beta.8 (from /trunk:36) |
Tagging as v2.0-beta.7 |
Tagging as v2.0-beta.8 |
------------------------------------------------------------------------ |
r36 | draake | 2009-05-11 00:57:03 +0000 (Mon, 11 May 2009) | 6 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 |
Implemented quest giver tracking. |
Merged completed daily quests with uncompleted daily quests and added visual/text indicators in the menu. |
Added some basic info to the temporary quest menu. |
More work on debugging info. |
Clarified some options. |
Fixed a bunch of bugs. |
------------------------------------------------------------------------ |
r34 | draake | 2009-05-07 23:12:17 +0000 (Thu, 07 May 2009) | 1 line |
Changed paths: |
M /trunk/core.lua |
## 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.7 |
## X-Curse-Packaged-Version: v2.0-beta.8 |
## X-Curse-Project-Name: EasyDaily |
## X-Curse-Project-ID: easydaily |
## X-Curse-Repository-ID: wow/easydaily/mainline |
--[[ |
Desc: |
Info: $Id: core.lua 34 2009-05-07 23:12:17Z draake $ |
Info: $Id: core.lua 36 2009-05-11 00:57:03Z draake $ |
]] |
local _G = _G |
enabled = true, |
debug = false, |
vdebug = false, |
debuglevel = 1, |
skipflag = false, |
skipmoney = false, |
} |
self.vars = { |
complete = {} |
complete = {}, |
accept = {}, |
} |
self.log = { |
quest = {}, |
start = {}, |
finish = {}, |
} |
self.LibTourist = LibStub("LibTourist-3.0") |
self.LibAbacus = LibStub("LibAbacus-3.0") |
self.version = {} |
-- Version |
self.version.revision = tonumber("34") |
self.version.revision = tonumber("36") |
if self.version.revision then |
local version = "v2.0-beta.7" |
local version = "v2.0-beta.8" |
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) |
self:CreateResetSlash() |
if self.db.profile.purge then |
self.db.global.purge = 0 |
self.db.profile.purge = nil |
end |
-- Database pursing and handle initialization |
if self.db.global.purge and ( self.db.global.purge < RESETDB ) then |
self:ResetDatabase() |
end |
self.db.global.purge = RESETDB |
self.LibTourist = LibStub("LibTourist-3.0") |
self.LibAbacus = LibStub("LibAbacus-3.0") |
self:CreateFrames() |
self:SetupOptions() |
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 |
b.text = _G[ b:GetName() .. "Text" ] |
b.text:ClearAllPoints() |
b.text:SetPoint("LEFT", b:GetName(), "RIGHT", 0, 0) |
b.text:SetText(L["Auto Turn-in"]) |
b.text:SetText(L["Quest Enabled"]) |
b:SetScript("OnShow", function(this) |
EasyDaily:QuestCheckButtonOnShow(this) |
EasyDaily:QuestCheckButtonOnClick(this) |
end) |
b:SetScript("OnEnter", function(this) |
GameTooltip:SetOwner(this, "ANCHOR_LEFT") |
GameTooltip:SetText(L["Toggles 'Auto Turn-in' for this quest."], nil, nil, nil, nil, 1) |
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) |
--[[ |
Desc: |
Info: $Id: options.lua 32 2009-05-07 11:18:13Z draake $ |
Info: $Id: options.lua 36 2009-05-11 00:57:03Z draake $ |
]] |
local _G = _G |
-------------------------------------------------------------------------------------------------- |
-- available, complete, repeatable, normal |
function EasyDaily:SetQuestOptionsTable(available, complete, repeatable) |
function EasyDaily:SetQuestOptionsTable(daily, repeatable) |
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 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 |
if self:QuestCompleteToday(name) then |
t = complete |
else |
t = available |
end |
t = daily |
elseif ( questType == "repeat" ) then |
t = repeatable |
end |
if t then |
local cat1, cat2 |
if self.LibTourist:IsZone(header) then |
local text = self.LibTourist:GetContinent(header) |
if text == UNKNOWN then |
cat1 = L["Special"] |
cat2 = header |
else |
cat1 = text |
cat2 = header |
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("%x %I:%M:%S", reset)) |
end |
elseif self.LibTourist:IsBattleground(header) then |
cat1 = L["Battleground"] |
cat2 = header |
elseif self.LibTourist:IsInstance(header) then |
if questTag == "heroic" then |
cat1 = LFG_TYPE_HEROIC_DUNGEON |
cat2 = header |
else |
cat1 = LFG_TYPE_NORMAL_DUNGEON |
cat2 = header |
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 = "toggle", |
width = "double", |
name = name, |
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, |
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) |
args = {} |
} |
end |
--~ t[cat1key].childGroups = "tab" |
t[cat1key].args[cat2key].args[idkey] = x |
else |
t[cat1key].args[idkey] = x |
disabled = isDisabled, |
hidden = function() return ( not self.db.profile.debug ) end, |
args = { |
vdebug = { |
debuglevel = { |
order = 1, |
type = "toggle", |
name = "Verbose Debug", |
desc = "Enable/Disable verbose debug mode.", |
type = "select", |
style = "dropdown", |
name = "Debug Level", |
desc = "Sets the debug level.", |
values = { [1] = "Helpful", [2] = "Verbose", [3] = "Maintenance" }, |
get = getFunc, |
set = setFunc, |
}, |
gossipicons = { |
order = 2, |
type = "toggle", |
name = L["Replace Gossip Icons"], |
name = L["Enhanced Gossip Icons"], |
desc = L["Replaces the default gossip icons with color coded versions."], |
get = getFunc, |
set = function(...) setFunc(...); self:RefreshGossipOrQuestFrame(); end, |
gossipstate = { |
order = 3, |
type = "toggle", |
name = L["Auto Turn-in Text"], |
desc = L["Displays a quests auto turn-in status in text."], |
name = L["Quest Status Text"], |
desc = L["Displays a quests status in text next to its name in the gossip window."], |
get = getFunc, |
set = function(...) setFunc(...); self:RefreshGossipOrQuestFrame(); end, |
}, |
order = 2, |
type = "select", |
style = "dropdown", |
name = L["Normal"], |
desc = sformat(L["Use this modifier to Auto Turn-in %s quests."], L["Normal"]), |
name = DUNGEON_DIFFICULTY1, |
desc = sformat(L["Use this modifier to Auto Turn-in %s quests."], DUNGEON_DIFFICULTY1), |
values = function() |
return GetOptMods("override", "suspend") |
end, |
order = 3, |
type = "select", |
style = "dropdown", |
name = L["Daily"], |
desc = sformat(L["Use this modifier to Auto Turn-in %s quests."], L["Daily"]), |
name = DAILY, |
desc = sformat(L["Use this modifier to Auto Turn-in %s quests."], DAILY), |
values = function() |
return GetOptMods("override", "suspend") |
end, |
daily = { |
order = 1, |
type = "group", |
childGroups = "tab", |
name = L["Daily"], |
args = { |
available = { |
order = 1, |
type = "group", |
childGroups = "tab", |
name = L["Available"], |
args = {}, |
}, |
complete = { |
order = 1, |
type = "group", |
childGroups = "tab", |
name = L["Complete"], |
args = {}, |
}, |
}, |
args = {}, |
}, |
repeatable = { |
order = 2, |
name = L["Repeatable"], |
args = {}, |
}, |
--~ normal = { |
--~ order = 3, |
--~ type = "group", |
--~ childGroups = "tab", |
--~ name = L["Normal"], |
--~ args = {}, |
--~ }, |
}, |
}, |
}, |
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 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) |
self:SetQuestOptionsTable(available, complete, repeatable) |
self:SetQuestOptionsTable(daily, repeatable) |
return self.options |
end |