/trunk
--[[ |
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 |
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") |
-- 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 |
-------------------------------------------------------------------------------------------------- |
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 = { |
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, |
}, |
}, |
}, |
}, |
}, |
}, |
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 |
-- 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") |
--[[ |
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 |
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 |
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 |
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 |
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") |
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 |
end |
-------------------------------------------------------------------------------------------------- |
-- Gossip/Quest Frame Functions |
-------------------------------------------------------------------------------------------------- |
function EasyDaily:GossipOrQuestClosed() |
if ( not QuestFrame:IsShown() ) and ( not GossipFrame:IsShown() ) then |
-- NPC Tracking |
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, |
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 |
]] 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"] = "" |
-- 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"] = "" |
-- 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["[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"] = "" |
]] 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"] = "" |
-- 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"] = "" |
-- 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["[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"] = "" |
]] 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] ежедневнÑÑ Ð·Ð°Ð´Ð°Ð½Ð¸Ð¹" |
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"] = "УлÑÑÑеннÑе иконки беÑедÑ" |
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["[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"] = "ÐÑобÑе" |
]] 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"] = "" |
-- 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"] = "" |
-- 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["[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"] = "" |
]] 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"] = "" |
-- 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"] = "" |
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["[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"] = "" |
]] 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"] = "" |
-- 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"] = "" |
-- 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["[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"] = "" |
]] 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"] = "" |
-- 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"] = "" |
-- 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["[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"] = "" |
]] 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"] = "" |
-- 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"] = "" |
-- 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["[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"] = "" |
]] 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 |
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 |
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["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 |
--[[ |
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 |
-------------------------------------------------------------------------------------------------- |
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 |
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 |
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 |
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) |
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 |
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 |
--[[ |
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 |
return unpack(t, 1, t.n or #t) |
end |
function toboolean(bool) |
return ( bool ~= nil ) and ( bool ~= false ) |
end |
-------------------------------------------------------------------------------------------------- |
-- Logic |
-------------------------------------------------------------------------------------------------- |
--[[ |
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 |
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 |
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 |
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" } |
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 |
else |
table.insert(t, { x = x, y = y, dl = dl, n = 1 }) |
end |
return db |
end, |
SetVal = function(this, key, value, ...) |
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] |
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 |
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, |
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 |
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 |
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 |
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 |
--[[ |
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 |
------------------------------------------------------------------------ |
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 |
## 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 |
inventory.lua |
tracking.lua |
turnin.lua |
gossip.lua |
options.lua |
--[[ |
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 |
-------------------------------------------------------------------------------------------------- |
-- Increasing this forces a database purge |
local RESETDB = 3 |
local RESETDB = 4 |
local defaults = { |
global = { |
debug = false, |
debuglevel = 1, |
questedit = false, |
skipflag = false, |
skipmoney = false, |
gossipstate = false, |
gossipicons = true, |
acceptshared = true, |
tag_normal = true, |
tag_group = true, |
tag_elite = true, |
mod_normal = "disable", |
mod_daily = "shift", |
mod_repeat = "shift", |
mod_daily = "none", |
mod_repeat = "none", |
mod_override = "alt", |
mod_suspend = "disable", |
} |
self.vars = { |
complete = {}, |
accept = {}, |
} |
self.log = { |
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) |
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 |
"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) |
--[[ |
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 |
]] |
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) |
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", |
["Crystalsong Forest"] = "ÐÐµÑ Ð¥ÑÑÑÑалÑной ÐеÑни", |
["Crystal Spine"] = "Ð¥ÑÑÑÑалÑное поле", |
Dalaran = "ÐалаÑан", |
["Dalaran Arena"] = "ÐÑена ÐалаÑана", -- Needs review |
["Dalaran Arena"] = "ÐÑена ÐалаÑана", |
["Dalaran Sewers"] = "ÐÑена ÐалаÑана", |
["Darkmoon Faire"] = "ЯÑмаÑка ÐоволÑниÑ", |
Darkshore = "ТемнÑе беÑега", |
["Isle of Quel'Danas"] = "ÐÑÑÑов ÐелÑ'ÐанаÑ", |
Kalimdor = "ÐалимдоÑ", |
Karazhan = "ÐаÑажан", |
["Krasus' Landing"] = "ÐлоÑадка ÐÑаÑÑÑа", |
["Krasus' Landing"] = "ÐлоÑадка ÐÑаÑа", |
Library = "ÐиблиоÑека", |
["Loch Modan"] = "Ðок Ðодан", |
["Lower Blackrock Spire"] = "Ðижний ÑÑÑÑ Ð§ÐµÑной гоÑÑ", |
["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"] = "Ðко ÐеÑноÑÑи", |
["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"] = "ÐÑÐ¾Ð·Ð¾Ð²Ð°Ñ ÐÑÑда", |
## 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 |
--[[ |
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 |
]] |
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) |
Kurenai = "ÐÑÑенай", |
["Lower City"] = "Ðижний ÐоÑод", |
["Magram Clan Centaur"] = "ÐенÑавÑÑ Ð¸Ð· племени ÐагÑам", |
Netherwing = "ÐÑÑлÑÑ ÐÑÑÑовеÑÑи", |
Netherwing = "ÐÑÑлÑÑ ÐÑÑÑоÑÑ", |
Neutral = "РавнодÑÑие", |
["Ogri'la"] = "ÐгÑи'ла", |
Orgrimmar = "ÐÑгÑиммаÑ", |
## 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 |
]] |
do |
local Type = "CheckBox" |
local Version = 5 |
local Version = 6 |
local function OnAcquire(self) |
self:SetValue(false) |
--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) |