From cd9b7cdb040e83f74397640aeadeab58b0422085 Mon Sep 17 00:00:00 2001 From: Alex Shubert Date: Sun, 15 Dec 2013 00:36:19 +0400 Subject: [PATCH 01/14] typo fix --- loc/localization_RU.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/loc/localization_RU.lua b/loc/localization_RU.lua index 818e748..82392f5 100644 --- a/loc/localization_RU.lua +++ b/loc/localization_RU.lua @@ -164,7 +164,7 @@ privateTable.L.quests = { ["Угощение для Хаоханя"]={item="Жареный на углях стейк из тигриного мяса", amount=5, currency=false}, ["Угощение для старика Горной Лапы"]={item="Тушеное черепашье мясо", amount=5, currency=false}, ["Угощение для Шо"]={item="Рыба по-дольски", amount=5, currency=false}, -["Угощение длDZя Тины"]={item="Лосось духов огня", amount=5, currency=false}, +["Угощение для Тины"]={item="Лосось духов огня", amount=5, currency=false}, ["Поход за продуктами"]={item="Пакет с продуктами", amount=1, currency=false}, --MOP timeless Island ['Бок тяжелого яка']={item="Бок тяжелого яка", amount=1, currency=false}, -- 1.7.9.5 From e5bedf4941e84a775cc4f34a34b688e67e7f59be Mon Sep 17 00:00:00 2001 From: Alex Shubert Date: Sun, 15 Dec 2013 00:39:19 +0400 Subject: [PATCH 02/14] typo fix --- loc/localization_DE.lua | 1 - loc/localization_EN.lua | 1 - loc/localization_FR.lua | 1 - 3 files changed, 3 deletions(-) diff --git a/loc/localization_DE.lua b/loc/localization_DE.lua index 2593465..ef68b80 100644 --- a/loc/localization_DE.lua +++ b/loc/localization_DE.lua @@ -157,7 +157,6 @@ privateTable.L.quests = { ["Spaß für die Kleinen"] = {item=393, amount=15, currency=true}, --MoP ["Saat der Angst"]={item="Schreckensambersplitter", amount=5, currency=false}, -["Auffüllen der Speisekammer"]={item="Bündel mit Zutaten", amount=1, currency=false}, ["Ein Gericht für Jogu"]={item="Gebratene Karotten", amount=5, currency=false}, ["Garnelenklößchen"]={item="Garnelenklößchen", amount=5, currency=false}, diff --git a/loc/localization_EN.lua b/loc/localization_EN.lua index 15cefe3..bc8eb1f 100644 --- a/loc/localization_EN.lua +++ b/loc/localization_EN.lua @@ -146,7 +146,6 @@ privateTable.L.quests = { ["Fun for the Little Ones"] = {item=393, amount=15, currency=true}, --MoP ["Seeds of Fear"]={item="Dread Amber Shards", amount=5, currency=false}, -["Replenishing the Pantry"]={item="Bundle of Groceries", amount=1, currency=false}, ["A Dish for Jogu"]={item="Sauteed Carrots", amount=5, currency=false}, ["A Dish for Ella"]={item="Shrimp Dumplings", amount=5, currency=false}, diff --git a/loc/localization_FR.lua b/loc/localization_FR.lua index edd6c26..21fe34f 100644 --- a/loc/localization_FR.lua +++ b/loc/localization_FR.lua @@ -152,7 +152,6 @@ privateTable.L.quests = { ["Les petits s'amusent aussi"] = {item=393, amount=15, currency=true}, --MoP ["Les graines de la peur"]={item="Eclats d’ambre d’effroi", amount=5, currency=false}, -["Remplir le garde-manger"]={item="Panier de vivres", amount=1, currency=false}, ["Un plat pour Jogu"]={item="Carottes sautées", amount=5, currency=false}, ["Un plat pour Ella"]={item="Raviolis aux crevettes", amount=5, currency=false}, -- 1.7.9.5 From 731a5da23c77af5865142be60e29bba10be113c7 Mon Sep 17 00:00:00 2001 From: Alex Shubert Date: Sun, 15 Dec 2013 02:38:42 +0400 Subject: [PATCH 03/14] code refactoring. note: all/daily is broken now --- ui/main_options.lua | 214 +++++++++++++++------------------------------------ 1 file changed, 60 insertions(+), 154 deletions(-) diff --git a/ui/main_options.lua b/ui/main_options.lua index 53a9b91..fe41795 100644 --- a/ui/main_options.lua +++ b/ui/main_options.lua @@ -4,198 +4,105 @@ local O = addonName .. "OptionsPanel" AutoTurnIn.OptionsPanel = CreateFrame("Frame", O) AutoTurnIn.OptionsPanel.name=addonName local OptionsPanel = AutoTurnIn.OptionsPanel - +-- switch flag. 'false' signals that reset must be made. 'true' allows redraw the screen keeping values local MakeACopy=true -- Title local title = OptionsPanel:CreateFontString(nil, "ARTWORK", "GameFontNormalLarge") title:SetText(addonName .." ".. AutoTurnIn.defaults.version) + -- Description local notes = GetAddOnMetadata(addonName, "Notes-" .. GetLocale()) or GetAddOnMetadata(addonName, "Notes") local subText = OptionsPanel:CreateFontString(nil, "ARTWORK", "GameFontHighlightSmall") subText:SetText(notes) + -- Reset button local ResetButton = CreateFrame("Button", nil, OptionsPanel, "OptionsButtonTemplate") ResetButton:SetText(L["resetbutton"]) ResetButton:SetScript("OnClick", function() ptable.TempConfig = CopyTable(AutoTurnIn.defaults) - MakeACopy=false; AutoTurnIn.RewardPanel.refresh(); AutoTurnIn.OptionsPanel.refresh(); end) -local function CreateCheckbox(name, marginx, marginy) - local nm = O..name - local cb = CreateFrame("CheckButton", nm, OptionsPanel, "OptionsCheckButtonTemplate") - _G[nm.."Text"]:SetText(L[name]) - cb:SetPoint("TOPLEFT", OptionsPanel, "BOTTOMLEFT", marginx, marginy) - - cb:SetScript("OnClick", function(self) - ptable.TempConfig[name] = self:GetChecked() == 1 - end) - return cb +local function newCheckbox(name, caption, config) + local cb = CreateFrame("CheckButton", "$parent"..name, OptionsPanel, "OptionsCheckButtonTemplate") + _G[cb:GetName().."Text"]:SetText(caption and caption or name) + cb:SetScript("OnClick", function(self) + ptable.TempConfig[config] = self:GetChecked() == 1 + end) + return cb end --- 'Enable' CheckBox -local Enable = CreateCheckbox("enabled", 0, -14) - --- Quest types to handle -local QuestLabel = OptionsPanel:CreateFontString(nil, "ARTWORK", "GameFontNormal") -QuestLabel:SetText(L["questTypeLabel"]) -local QuestConst = {L["questTypeAll"], L["questTypeList"]} -local QuestDropDown = CreateFrame("Frame", O.."QuestDropDown", OptionsPanel, "UIDropDownMenuTemplate") -UIDropDownMenu_Initialize(QuestDropDown, function (self, level) - for k, v in ipairs(QuestConst) do - local info = UIDropDownMenu_CreateInfo() - info.text, info.value = v, k - info.func = function(self) - UIDropDownMenu_SetSelectedID(QuestDropDown, self:GetID()) - ptable.TempConfig.all = (self:GetID() == 1) - end - UIDropDownMenu_AddButton(info, level) - end -end) -UIDropDownMenu_SetWidth(QuestDropDown, 200); -UIDropDownMenu_JustifyText(QuestDropDown, "LEFT") - --- DarkmoonTeleport -local TrivialQuests = CreateFrame("CheckButton", O.."TrivialQuests", OptionsPanel, "OptionsCheckButtonTemplate") -_G[TrivialQuests:GetName().."Text"]:SetText(L["TrivialQuests"]) -TrivialQuests:SetScript("OnClick", function(self) - ptable.TempConfig.trivial = self:GetChecked() == 1 -end) - --- Tournament loot type -local TournamentDropDownLabel = OptionsPanel:CreateFontString(nil, "ARTWORK", "GameFontNormal") -TournamentDropDownLabel:SetText(L["tournamentLabel"]) -local TournamentConst = {L["tournamentWrit"], L["tournamentPurse"]}; -local TournamentDropDown = CreateFrame("Frame", O.."TournamentDropDown", OptionsPanel, "UIDropDownMenuTemplate") -function TournamentDropDown:initialize () - for k, v in ipairs(TournamentConst) do - local info = UIDropDownMenu_CreateInfo() - info.text, info.value = v, k - info.func = function(self) - UIDropDownMenu_SetSelectedID(TournamentDropDown, self:GetID()) - ptable.TempConfig.tournament = self:GetID() - end - UIDropDownMenu_AddButton(info, level) - end +local function newDropDown(caption, name, values, config) + local label = OptionsPanel:CreateFontString(nil, "ARTWORK", "GameFontNormal") + label:SetText(caption) + + local dropDown = CreateFrame("Frame", O..name, OptionsPanel, "UIDropDownMenuTemplate") + UIDropDownMenu_Initialize(dropDown, function (self, level) + for k, v in ipairs(values) do + local info = UIDropDownMenu_CreateInfo() + info.text, info.value = v, k + info.func = function(self) + UIDropDownMenu_SetSelectedID(dropDown, self:GetID()) + ptable.TempConfig[config] = self:GetID() + end + UIDropDownMenu_AddButton(info, level) + end + end) + UIDropDownMenu_SetWidth(dropDown, 200); + UIDropDownMenu_JustifyText(dropDown, "LEFT") + label:SetPoint("BOTTOMLEFT", dropDown, "TOPLEFT", 18, 0) + return dropDown end -UIDropDownMenu_SetWidth(TournamentDropDown, 200); -UIDropDownMenu_JustifyText(TournamentDropDown, "LEFT") --- How to loot -local LootLabel = OptionsPanel:CreateFontString(nil, "ARTWORK", "GameFontNormal") -LootLabel:SetText(L["lootTypeLabel"]) -local LootConst = {L["lootTypeFalse"], L["lootTypeGreed"], L["lootTypeNeed"]} -local LootDropDown = CreateFrame("Frame", O.."LootDropDown", OptionsPanel, "UIDropDownMenuTemplate") -UIDropDownMenu_Initialize(LootDropDown, function (self, level) - for k, v in ipairs(LootConst) do - local info = UIDropDownMenu_CreateInfo() - info.text, info.value = v, k - info.func = function(self) - UIDropDownMenu_SetSelectedID(LootDropDown, self:GetID()) - ptable.TempConfig.lootreward = self:GetID() - end - UIDropDownMenu_AddButton(info, level) - end -end) -UIDropDownMenu_SetWidth(LootDropDown, 200); -UIDropDownMenu_JustifyText(LootDropDown, "LEFT") - --- Teleport to Darkmoon Faire -local ToDarkMoon= CreateFrame("CheckButton", O.."ToDarkMoon", OptionsPanel, "OptionsCheckButtonTemplate") -_G[O.."ToDarkMoonText"]:SetText(L["ToDarkmoonLabel"]) -ToDarkMoon:SetScript("OnClick", function(self) - ptable.TempConfig.todarkmoon = self:GetChecked() == 1 -end) +-- 'Enable' CheckBox +local Enable = newCheckbox("enabled", L["enabled"], "enabled") +-- trivial, so called grayed quests +local TrivialQuests = newCheckbox("TrivialQuests", L["TrivialQuests"], "trivial") -- DarkmoonTeleport -local DarkMoonCannon = CreateFrame("CheckButton", O.."DarkMoonCannon", OptionsPanel, "OptionsCheckButtonTemplate") -_G[O.."DarkMoonCannonText"]:SetText(L["DarkmoonTeleLabel"]) -DarkMoonCannon:SetScript("OnClick", function(self) - ptable.TempConfig.darkmoonteleport = self:GetChecked() == 1 -end) - +local ToDarkMoon = newCheckbox("ToDarkMoon", L["ToDarkmoonLabel"], "todarkmoon") +-- Darkmoon Teleport to cannon +local DarkMoonCannon = newCheckbox("DarkMoonCannon", L["DarkmoonTeleLabel"], "darkmoonteleport") -- Darkmoon games -local DarkMoonAutoStart = CreateFrame("CheckButton", O.."DarkMoonAutoStart", OptionsPanel, "OptionsCheckButtonTemplate") -_G[DarkMoonAutoStart:GetName().."Text"]:SetText(L["DarkmoonAutoLabel"]) -DarkMoonAutoStart:SetScript("OnClick", function(self) - ptable.TempConfig.darkmoonautostart = self:GetChecked() == 1 -end) - +local DarkMoonAutoStart = newCheckbox("DarkMoonAutoStart", L["DarkmoonAutoLabel"], "darkmoonautostart") -- 'Show Reward Text' CheckBox -local ShowRewardText = CreateFrame("CheckButton", O.."Reward", OptionsPanel, "OptionsCheckButtonTemplate") -_G[ShowRewardText:GetName().."Text"]:SetText(L["rewardtext"]) -ShowRewardText:SetScript("OnClick", function(self) - ptable.TempConfig.showrewardtext = self:GetChecked() == 1 -end) - --- 'Equip Reward Text' CheckBox -local EquipReward = CreateFrame("CheckButton", O.."Equip", OptionsPanel, "OptionsCheckButtonTemplate") -_G[EquipReward:GetName().."Text"]:SetText(L["autoequip"]) -EquipReward:SetScript("OnClick", function(self) - ptable.TempConfig.autoequip = self:GetChecked() == 1 -end) - --- 'Equip Reward Text' CheckBox -local Debug = CreateFrame("CheckButton", O.."Debug", OptionsPanel, "OptionsCheckButtonTemplate") -_G[Debug:GetName().."Text"]:SetText(L["debug"]) -Debug:SetScript("OnClick", function(self) - ptable.TempConfig.debug = self:GetChecked() == 1 -end) - -local ShareQuests = CreateFrame("CheckButton", O.."ShareQuests", OptionsPanel, "OptionsCheckButtonTemplate") -_G[ShareQuests:GetName().."Text"]:SetText(L["ShareQuestsLabel"]) -ShareQuests:SetScript("OnClick", function(self) - ptable.TempConfig.questshare = self:GetChecked() == 1 -end) +local ShowRewardText = newCheckbox("Reward", L["rewardtext"], "showrewardtext") +-- 'Equip Reward' CheckBox +local EquipReward = newCheckbox("Equip", L["autoequip"], "autoequip") +-- reward loot explanation +local Debug = newCheckbox("Debug", L["debug"], "debug") +-- share quest (!!! alpha) +local ShareQuests = newCheckbox("ShareQuests", L["ShareQuestsLabel"], "questshare") +-- 'Show QuestLevel' CheckBox +local ShowQuestLevel = newCheckbox("QuestLevel", L["questlevel"], "questlevel") +-- 'Show Watch Quest Level' CheckBox +local ShowWatchLevel = newCheckbox("WatchLevel", L["watchlevel"], "watchlevel") -- Auto toggle key -local ToggleKeyLabel = OptionsPanel:CreateFontString(nil, "ARTWORK", "GameFontNormal") -ToggleKeyLabel:SetText(L["togglekey"]) local ToggleKeyConst = {NONE_KEY, ALT_KEY, CTRL_KEY, SHIFT_KEY} -local ToggleKeyDropDown = CreateFrame("Frame", O.."ToggleKeyDropDown", OptionsPanel, "UIDropDownMenuTemplate") -UIDropDownMenu_Initialize(ToggleKeyDropDown, function (self, level) - for k, v in ipairs(ToggleKeyConst) do - local info = UIDropDownMenu_CreateInfo() - info.text, info.value = v, k - info.func = function(self) - UIDropDownMenu_SetSelectedID(ToggleKeyDropDown, self:GetID()) - ptable.TempConfig.togglekey = self:GetID() - end - UIDropDownMenu_AddButton(info, level) - end -end) -UIDropDownMenu_SetWidth(ToggleKeyDropDown, 200); -UIDropDownMenu_JustifyText(ToggleKeyDropDown, "LEFT") - --- 'Show QuestLevel' CheckBox -local ShowQuestLevel = CreateFrame("CheckButton", O.."QuestLevel", OptionsPanel, "OptionsCheckButtonTemplate") -_G[ShowQuestLevel:GetName().."Text"]:SetText(L["questlevel"]) -ShowQuestLevel:SetScript("OnClick", function(self) - ptable.TempConfig.questlevel = self:GetChecked() == 1 -end) +local ToggleKeyDropDown = newDropDown(L["togglekey"], "ToggleKeyDropDown", ToggleKeyConst, "ToggleKeyConst") +-- Quest types to handle +local QuestConst = {L["questTypeAll"], L["questTypeList"]} +local QuestDropDown = newDropDown(L["questTypeLabel"], "QuestDropDown", QuestConst, "all") -- self:GetID() == 1 +-- Tournament loot type +local TournamentConst = {L["tournamentWrit"], L["tournamentPurse"]} +local TournamentDropDown = newDropDown(L["tournamentLabel"], "TournamentDropDown", TournamentConst, "tournament") +-- How to loot +local LootConst = {L["lootTypeFalse"], L["lootTypeGreed"], L["lootTypeNeed"]} +local LootDropDown = newDropDown(L["lootTypeLabel"], "LootDropDown", LootConst, "lootreward") --- 'Show Watch Quest Level' CheckBox -local ShowWatchLevel = CreateFrame("CheckButton", O.."WatchLevel", OptionsPanel, "OptionsCheckButtonTemplate") -_G[ShowWatchLevel:GetName().."Text"]:SetText(L["watchlevel"]) -ShowWatchLevel:SetScript("OnClick", function(self) - ptable.TempConfig.watchlevel = self:GetChecked() == 1 -end) -- Control placement title:SetPoint("TOPLEFT", 16, -16) subText:SetPoint("TOPLEFT", title, "BOTTOMLEFT", 0, -8) ResetButton:SetPoint("TOPRIGHT", OptionsPanel, "TOPRIGHT", -10, -10) Enable:SetPoint("TOPLEFT", subText, "BOTTOMLEFT", 0, -14) -QuestLabel:SetPoint("BOTTOMLEFT", QuestDropDown, "TOPLEFT", 18, 0) QuestDropDown:SetPoint("TOPLEFT", Enable, "BOTTOMLEFT", -15, -22) TrivialQuests:SetPoint("TOPLEFT", QuestDropDown, "TOPRIGHT", 30, 0) -LootLabel:SetPoint("BOTTOMLEFT", LootDropDown, "TOPLEFT", 18, 0) LootDropDown:SetPoint("TOPLEFT", QuestDropDown, "BOTTOMLEFT", 0, -22) -TournamentDropDownLabel:SetPoint("BOTTOMLEFT", TournamentDropDown, "TOPLEFT", 18, 0) TournamentDropDown:SetPoint("TOPLEFT", LootDropDown, "TOPRIGHT", 17, 0) EquipReward:SetPoint("TOPLEFT", LootDropDown, "BOTTOMLEFT", 16, -10) ShowRewardText:SetPoint("TOPLEFT", EquipReward, "BOTTOMLEFT", 0, -10) @@ -203,7 +110,6 @@ ToDarkMoon:SetPoint("TOPLEFT", ShowRewardText, "BOTTOMLEFT", 0, -10) DarkMoonCannon:SetPoint("TOPLEFT", ToDarkMoon, "BOTTOMLEFT", 0, -10) DarkMoonAutoStart:SetPoint("TOPLEFT", DarkMoonCannon, "BOTTOMLEFT", 0, -10) Debug:SetPoint("TOPLEFT", ResetButton, "BOTTOMLEFT", 0, -10) -ToggleKeyLabel:SetPoint("BOTTOMLEFT", ToggleKeyDropDown, "TOPLEFT", 18, 0) ToggleKeyDropDown:SetPoint("TOPLEFT", DarkMoonAutoStart, "BOTTOMLEFT", -15, -22) ShowQuestLevel:SetPoint("TOPLEFT", ToggleKeyDropDown, "BOTTOMLEFT", 16, -10) ShowWatchLevel:SetPoint("TOPLEFT", ShowQuestLevel, "BOTTOMLEFT", 0, -10) @@ -223,7 +129,7 @@ OptionsPanel.refresh = function() UIDropDownMenu_SetText(LootDropDown, LootConst[ptable.TempConfig.lootreward]) UIDropDownMenu_SetSelectedID(TournamentDropDown, ptable.TempConfig.tournament) - UIDropDownMenu_SetText(TournamentDropDown,TournamentConst[ptable.TempConfig.tournament]) + UIDropDownMenu_SetText(TournamentDropDown, TournamentConst[ptable.TempConfig.tournament]) ToDarkMoon:SetChecked(ptable.TempConfig.todarkmoon) DarkMoonCannon:SetChecked(ptable.TempConfig.darkmoonteleport) DarkMoonAutoStart:SetChecked(ptable.TempConfig.darkmoonautostart) -- 1.7.9.5 From 253d9e77600ceb31497ff36801437440dc51a874 Mon Sep 17 00:00:00 2001 From: Alex Shubert Date: Sun, 15 Dec 2013 02:40:40 +0400 Subject: [PATCH 04/14] bumping toc to reset options --- AutoTurnIn.toc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AutoTurnIn.toc b/AutoTurnIn.toc index 77cbcb7..03dc778 100644 --- a/AutoTurnIn.toc +++ b/AutoTurnIn.toc @@ -1,6 +1,6 @@ ## Interface: 50400 ## Title: AutoTurnIn -## Version: 4.3 +## Version: 4.4 ## Author: Alex Shubert ## Notes: Quest handling automation ## Notes-ruRU: Автоматически обработка заданий -- 1.7.9.5 From cfa497162ccf9972e907ceb0764ac24bb4311ad2 Mon Sep 17 00:00:00 2001 From: Alex Shubert Date: Sun, 15 Dec 2013 03:14:41 +0400 Subject: [PATCH 05/14] fixed prev commit, now index is used correctly --- AutoTurnIn.lua | 12 ++++++------ ui/main_options.lua | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/AutoTurnIn.lua b/AutoTurnIn.lua index 57e5953..5636d2a 100644 --- a/AutoTurnIn.lua +++ b/AutoTurnIn.lua @@ -11,7 +11,7 @@ local C = ptable.CONST local TOCVersion = GetAddOnMetadata(addonName, "Version") AutoTurnIn = LibStub("AceAddon-3.0"):NewAddon("AutoTurnIn", "AceEvent-3.0", "AceConsole-3.0") -AutoTurnIn.defaults = {enabled = true, all = false, trivial = false, lootreward = 1, tournament = 2, +AutoTurnIn.defaults = {enabled = true, all = 2, trivial = false, lootreward = 1, tournament = 2, darkmoonteleport=true, todarkmoon=true, togglekey=4, darkmoonautostart=true, showrewardtext=true, version=TOCVersion, autoequip = false, debug=false, questlevel=true, watchlevel=true, questshare=false, @@ -57,7 +57,7 @@ end -- quest autocomplete handlers and functions function AutoTurnIn:OnEnable() if (not AutoTurnInCharacterDB) or (not AutoTurnInCharacterDB.version or (AutoTurnInCharacterDB.version < TOCVersion)) then - AutoTurnInCharacterDB = nil + AutoTurnInCharacterDB = nil self:Print(L["reset"]) end @@ -121,11 +121,11 @@ end -- returns true if quest offered by gossip is daily function AutoTurnIn:AllOrCachedDaily(questname) - return AutoTurnInCharacterDB.all or (not not self.questCache[questname]) + return AutoTurnInCharacterDB.all == 1 or (not not self.questCache[questname]) end function AutoTurnIn:AllOrDaily(questname) - return AutoTurnInCharacterDB.all or (QuestIsDaily() or QuestIsWeekly()) + return AutoTurnInCharacterDB.all == 1 or (QuestIsDaily() or QuestIsWeekly()) end -- caches offered by gossip quest as daily @@ -207,7 +207,7 @@ function AutoTurnIn:QUEST_GREETING() self:CacheAsDaily(GetAvailableTitle(index)) end - if (triviaAndAllowedOrNotTrivia and notBlackListed and (AutoTurnInCharacterDB.all or isDaily)) then + if (triviaAndAllowedOrNotTrivia and notBlackListed and (AutoTurnInCharacterDB.all == 1 or isDaily)) then if quest and quest.amount then if self:GetItemAmount(quest.currency, quest.item) >= quest.amount then SelectAvailableQuest(index) @@ -258,7 +258,7 @@ function AutoTurnIn:VarArgForAvailableQuests(...) local notBlackListed = not (quest and (quest.donotaccept or AutoTurnIn:IsIgnoredQuest(title))) -- Quest is appropriate if: (it is trivial and trivial are accepted) and (any quest accepted or (it is daily quest that is not in ignore list)) - if (triviaAndAllowedOrNotTrivia and notBlackListed and (AutoTurnInCharacterDB.all or isDaily )) then + if (triviaAndAllowedOrNotTrivia and notBlackListed and (AutoTurnInCharacterDB.all == 1 or isDaily )) then if quest and quest.amount then if self:GetItemAmount(quest.currency, quest.item) >= quest.amount then SelectGossipAvailableQuest(math.floor(i/MOP_INDEX_CONST)+1) diff --git a/ui/main_options.lua b/ui/main_options.lua index fe41795..ee233d6 100644 --- a/ui/main_options.lua +++ b/ui/main_options.lua @@ -122,8 +122,8 @@ OptionsPanel.refresh = function() Enable:SetChecked(ptable.TempConfig.enabled) - UIDropDownMenu_SetSelectedID(QuestDropDown, ptable.TempConfig.all and 1 or 2) - UIDropDownMenu_SetText(QuestDropDown, ptable.TempConfig.all and L["questTypeAll"] or L["questTypeList"] ) + UIDropDownMenu_SetSelectedID(QuestDropDown, ptable.TempConfig.all) + UIDropDownMenu_SetText(QuestDropDown, QuestConst[ptable.TempConfig.all]) UIDropDownMenu_SetSelectedID(LootDropDown, ptable.TempConfig.lootreward) UIDropDownMenu_SetText(LootDropDown, LootConst[ptable.TempConfig.lootreward]) -- 1.7.9.5 From fa4ee722b2ff382f001b568a3257d42fe1cca995 Mon Sep 17 00:00:00 2001 From: Alex Shubert Date: Sun, 15 Dec 2013 13:05:17 +0400 Subject: [PATCH 06/14] shrunk some variable's scope to local --- QuestLevel.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/QuestLevel.lua b/QuestLevel.lua index 989dce1..2ee4653 100644 --- a/QuestLevel.lua +++ b/QuestLevel.lua @@ -46,7 +46,7 @@ function AutoTurnIn:ShowQuestLevelInWatchFrame() end for i = 1, #WATCHFRAME_LINKBUTTONS do - button = WATCHFRAME_LINKBUTTONS[i] + local button = WATCHFRAME_LINKBUTTONS[i] if( button.type == "QUEST" ) then local questIndex = GetQuestIndexForWatch(button.index) @@ -55,7 +55,7 @@ function AutoTurnIn:ShowQuestLevelInWatchFrame() if textLine.text:GetText() and (not string.find("", "^%[.*%].*")) then local title, level, _, _, _, _, _, isDaily = GetQuestLogTitle(questIndex) local questTypeIndex = GetQuestLogQuestType(questIndex) - tagString = AutoTurnIn.QuestTypesIndex[questTypeIndex] + local tagString = AutoTurnIn.QuestTypesIndex[questTypeIndex] if (not tagString) then --AutoTurnIn:Print("Please, inform addon author unknown QT for: " ..title) tagString = "" -- 1.7.9.5 From d0b9a15b980b9c7264cc7e8831e00118febf9d73 Mon Sep 17 00:00:00 2001 From: Alex Shubert Date: Sun, 15 Dec 2013 20:29:48 +0400 Subject: [PATCH 07/14] except daily added --- AutoTurnIn.lua | 43 +++++++++++++++++++++++++++++-------------- loc/localization_DE.lua | 5 +++-- loc/localization_EN.lua | 5 +++-- loc/localization_FR.lua | 3 ++- loc/localization_RU.lua | 5 +++-- ui/main_options.lua | 2 +- 6 files changed, 41 insertions(+), 22 deletions(-) diff --git a/AutoTurnIn.lua b/AutoTurnIn.lua index 5636d2a..8620458 100644 --- a/AutoTurnIn.lua +++ b/AutoTurnIn.lua @@ -9,6 +9,8 @@ local addonName, ptable = ... local L = ptable.L local C = ptable.CONST local TOCVersion = GetAddOnMetadata(addonName, "Version") +local Q_ALL, Q_DAILY, Q_EXCEPTDAILY = 1, 2, 3 + AutoTurnIn = LibStub("AceAddon-3.0"):NewAddon("AutoTurnIn", "AceEvent-3.0", "AceConsole-3.0") AutoTurnIn.defaults = {enabled = true, all = 2, trivial = false, lootreward = 1, tournament = 2, @@ -119,18 +121,30 @@ function AutoTurnIn:QUEST_LOG_UPDATE() end end --- returns true if quest offered by gossip is daily -function AutoTurnIn:AllOrCachedDaily(questname) - return AutoTurnInCharacterDB.all == 1 or (not not self.questCache[questname]) +-- Available check requires cache +-- Active check query API function Returns true if quest matches options +function AutoTurnIn:isAppropriate(questname, byCache) + local daily + if byCache then + daily = (not not self.questCache[questname]) + else + daily = (QuestIsDaily() or QuestIsWeekly()) + end + return self:_isAppropriate(daily) end -function AutoTurnIn:AllOrDaily(questname) - return AutoTurnInCharacterDB.all == 1 or (QuestIsDaily() or QuestIsWeekly()) +-- 'private' function +function AutoTurnIn:_isAppropriate(daily) + if daily then + return (AutoTurnInCharacterDB.all ~= Q_EXCEPTDAILY) + else + return (AutoTurnInCharacterDB.all ~= Q_DAILY) + end end -- caches offered by gossip quest as daily -function AutoTurnIn:CacheAsDaily(gossipQuest) - self.questCache[gossipQuest] = true +function AutoTurnIn:CacheAsDaily(questname) + self.questCache[questname] = true end function AutoTurnIn:IsIgnoredQuest(quest) @@ -185,13 +199,14 @@ end -- Old 'Quest NPC' interaction system. See http://wowprogramming.com/docs/events/QUEST_GREETING function AutoTurnIn:QUEST_GREETING() + print("OLD") if (not self:AllowedToHandle(true)) then return end for index=1, GetNumActiveQuests() do local quest, isComplete = GetActiveTitle(index) - if isComplete and (self:AllOrCachedDaily(quest)) then + if isComplete and (self:isAppropriate(quest, true)) then SelectActiveQuest(index) end end @@ -207,7 +222,7 @@ function AutoTurnIn:QUEST_GREETING() self:CacheAsDaily(GetAvailableTitle(index)) end - if (triviaAndAllowedOrNotTrivia and notBlackListed and (AutoTurnInCharacterDB.all == 1 or isDaily)) then + if (triviaAndAllowedOrNotTrivia and notBlackListed and self:_isAppropriate(isDaily)) then if quest and quest.amount then if self:GetItemAmount(quest.currency, quest.item) >= quest.amount then SelectAvailableQuest(index) @@ -229,7 +244,7 @@ function AutoTurnIn:VarArgForActiveQuests(...) local isComplete = select(i+3, ...) -- complete status if ( isComplete ) then local questname = select(i, ...) - if self:AllOrCachedDaily(questname) then + if self:isAppropriate(questname, true) then local quest = L.quests[questname] if quest and quest.amount then if self:GetItemAmount(quest.currency, quest.item) >= quest.amount then @@ -258,7 +273,7 @@ function AutoTurnIn:VarArgForAvailableQuests(...) local notBlackListed = not (quest and (quest.donotaccept or AutoTurnIn:IsIgnoredQuest(title))) -- Quest is appropriate if: (it is trivial and trivial are accepted) and (any quest accepted or (it is daily quest that is not in ignore list)) - if (triviaAndAllowedOrNotTrivia and notBlackListed and (AutoTurnInCharacterDB.all == 1 or isDaily )) then + if (triviaAndAllowedOrNotTrivia and notBlackListed and self:_isAppropriate(isDaily)) then if quest and quest.amount then if self:GetItemAmount(quest.currency, quest.item) >= quest.amount then SelectGossipAvailableQuest(math.floor(i/MOP_INDEX_CONST)+1) @@ -329,7 +344,7 @@ function AutoTurnIn:QUEST_DETAIL() self:CacheAsDaily(GetTitleText()) end - if self:AllowedToHandle() and self:AllOrDaily() then + if self:AllowedToHandle() and self:isAppropriate() then QuestInfoDescriptionText:SetAlphaGradient(0, -1) QuestInfoDescriptionText:SetAlpha(1) AcceptQuest() @@ -344,7 +359,7 @@ function AutoTurnIn:QUEST_ACCEPTED(event, index) end function AutoTurnIn:QUEST_PROGRESS() - if self:AllowedToHandle() and IsQuestCompletable() and self:AllOrDaily() then + if self:AllowedToHandle() and IsQuestCompletable() and self:isAppropriate() then CompleteQuest() end end @@ -586,7 +601,7 @@ function AutoTurnIn:QUEST_COMPLETE() --/script faction = (GameTooltip:NumLines() > 2 and not UnitIsPlayer(select(2,GameTooltip:GetUnit()))) and -- getglobal("GameTooltipTextLeft"..GameTooltip:NumLines()):GetText() DEFAULT_CHAT_FRAME:AddMessage(faction or "NIL") - if self:AllOrDaily() then + if self:isAppropriate() then local questname = GetTitleText() local quest = L.quests[questname] diff --git a/loc/localization_DE.lua b/loc/localization_DE.lua index ef68b80..06d0bfa 100644 --- a/loc/localization_DE.lua +++ b/loc/localization_DE.lua @@ -15,8 +15,9 @@ privateTable.L = setmetatable({ ["questTypeLabel"] = "quests", ["questTypeAll"] = "alle", - ["TrivialQuests"]="'graue' Quests annehmen", - ["questTypeList"] = "Tägliche Quests", + ["questTypeList"] = "Tägliche", + ["questTypeExceptDaily"] = "außer Tägliche", + ["TrivialQuests"]="'graue' Quests annehmen", ["ShareQuestsLabel"] = "teilen die Quest", ["lootTypeLabel"]="Jobs mit Belohnungen", diff --git a/loc/localization_EN.lua b/loc/localization_EN.lua index bc8eb1f..8f15cfd 100644 --- a/loc/localization_EN.lua +++ b/loc/localization_EN.lua @@ -21,8 +21,9 @@ privateTable.L = setmetatable({ ["questTypeLabel"] = "Quests to handle", ["questTypeAll"] = "all", - ["TrivialQuests"]="Accept 'grey' quests", - ["questTypeList"] = "daily", + ["questTypeList"] = "daily", + ["questTypeExceptDaily"] = "except daily", + ["TrivialQuests"]="Accept 'grey' quests", ["ShareQuestsLabel"] = "Quest auto sharing", ["lootTypeLabel"]="Quests with rewards", diff --git a/loc/localization_FR.lua b/loc/localization_FR.lua index 21fe34f..ef98994 100644 --- a/loc/localization_FR.lua +++ b/loc/localization_FR.lua @@ -13,8 +13,9 @@ privateTable.L = setmetatable({ ["questTypeLabel"] = "Quêtes à prendre en compte", ["questTypeAll"] = "Toutes", + ["questTypeList"] = "journalières", + ["questTypeExceptDaily"] = "excepté journalières", ["TrivialQuests"]= "Accepter les quêtes 'grise'", - ["questTypeList"] = "Quêtes journalières", ["ShareQuestsLabel"] = "partager la quête", ["lootTypeLabel"]="Quêtes à récompense d'objet", diff --git a/loc/localization_RU.lua b/loc/localization_RU.lua index 82392f5..8990801 100644 --- a/loc/localization_RU.lua +++ b/loc/localization_RU.lua @@ -15,8 +15,9 @@ privateTable.L = setmetatable({ ["questTypeLabel"] = "задания", ["questTypeAll"] = "все", - ["TrivialQuests"]="брать 'серые' квесты", - ["questTypeList"] = "ежедневные", + ["questTypeList"] = "ежедневные", + ["questTypeExceptDaily"] = "кроме ежедневных", + ["TrivialQuests"]="брать 'серые' квесты", ["ShareQuestsLabel"] = "Предлагать задание группе", ["lootTypeLabel"]="задания с наградами", diff --git a/ui/main_options.lua b/ui/main_options.lua index ee233d6..fd43471 100644 --- a/ui/main_options.lua +++ b/ui/main_options.lua @@ -85,7 +85,7 @@ local ShowWatchLevel = newCheckbox("WatchLevel", L["watchlevel"], "watchlevel") local ToggleKeyConst = {NONE_KEY, ALT_KEY, CTRL_KEY, SHIFT_KEY} local ToggleKeyDropDown = newDropDown(L["togglekey"], "ToggleKeyDropDown", ToggleKeyConst, "ToggleKeyConst") -- Quest types to handle -local QuestConst = {L["questTypeAll"], L["questTypeList"]} +local QuestConst = {L["questTypeAll"], L["questTypeList"], L["questTypeExceptDaily"]} local QuestDropDown = newDropDown(L["questTypeLabel"], "QuestDropDown", QuestConst, "all") -- self:GetID() == 1 -- Tournament loot type local TournamentConst = {L["tournamentWrit"], L["tournamentPurse"]} -- 1.7.9.5 From 499a194a068a6a38f543ca398af9cbe8b1545d74 Mon Sep 17 00:00:00 2001 From: Alex Shubert Date: Sun, 15 Dec 2013 22:38:05 +0400 Subject: [PATCH 08/14] white items now considered as OkByStat and OkBysecondaryStat --- AutoTurnIn.lua | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/AutoTurnIn.lua b/AutoTurnIn.lua index 8620458..6416fb0 100644 --- a/AutoTurnIn.lua +++ b/AutoTurnIn.lua @@ -470,7 +470,7 @@ function AutoTurnIn:TurnInQuest(rewardIndex) self:Print("Debug: turning quest in, no choice required") end else - GetQuestReward(rewardIndex) + --GetQuestReward(rewardIndex) end end @@ -519,7 +519,7 @@ function AutoTurnIn:Need() self:Print(L["stopitemfound"]:format(_G[equipSlot])) return true end - local itemCandidate = {index=i, points=0, type="", stat="NOTCHOSEN", secondary={}} + local itemCandidate = {index=i, points=0, type="", stat="", secondary={}} --DEBUG structure -- TYPE: item is suitable if there are no type specified at all or item type is chosen local OkByType = false @@ -533,23 +533,30 @@ function AutoTurnIn:Need() itemCandidate.type=subclass .. ((not not OkByType) and "=>OK" or "=>FAIL") --STAT+SECONDARY: Same here: if no stat specified or item stat is chosen then item is wanted - local OkByStat = not next(AutoTurnInCharacterDB.stat) -- true if table is empty + local OkByStat = not next(AutoTurnInCharacterDB.stat) -- true if table is empty local OkBySecondary = not next(AutoTurnInCharacterDB.secondary) -- true if table is empty if (not (OkByStat and OkBySecondaryStat)) then wipe(self.stattable) GetItemStats(link, self.stattable) + local count = 0 for stat, value in pairs(self.stattable) do + count = count + 1 if ( AutoTurnInCharacterDB.stat[stat] ) then OkByStat = true - itemCandidate.stat=_G[stat].."=>OK" + itemCandidate.stat = _G[stat].. "=>OK" end if ( AutoTurnInCharacterDB.secondary[stat] ) then OkBySecondary = true itemCandidate.points = itemCandidate.points + 1 tinsert(itemCandidate.secondary, _G[stat]) end - end - end + end + if (count == 1) then + OkByStat, OkBySecondary = true, true -- плозое решение. теряется основная илея + end + else + itemCandidate.stat = "NO_STAT_SETTINGS" + end -- User may not choose any options hence any item became 'ok'. That situation is undoubtly incorrect. local SettingsExists = (class == C.WEAPONLABEL and next(AutoTurnInCharacterDB.weapon) or next(AutoTurnInCharacterDB.armor)) -- 1.7.9.5 From 112419900a23e51ef08c1e02c6d7cce665b55eb8 Mon Sep 17 00:00:00 2001 From: Alex Shubert Date: Sun, 15 Dec 2013 22:50:46 +0400 Subject: [PATCH 09/14] comment describing common items treatment added --- AutoTurnIn.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/AutoTurnIn.lua b/AutoTurnIn.lua index 6416fb0..be54d4c 100644 --- a/AutoTurnIn.lua +++ b/AutoTurnIn.lua @@ -470,7 +470,7 @@ function AutoTurnIn:TurnInQuest(rewardIndex) self:Print("Debug: turning quest in, no choice required") end else - --GetQuestReward(rewardIndex) + GetQuestReward(rewardIndex) end end @@ -551,8 +551,8 @@ function AutoTurnIn:Need() tinsert(itemCandidate.secondary, _G[stat]) end end - if (count == 1) then - OkByStat, OkBySecondary = true, true -- плозое решение. теряется основная илея + if (count == 1) then -- Common quality items have only 1 attribute. This 'if' makes them suitable loot candidates. + OkByStat, OkBySecondary = true, true end else itemCandidate.stat = "NO_STAT_SETTINGS" -- 1.7.9.5 From 03169e31e2b21b55373c93275522f8a3a14e31b1 Mon Sep 17 00:00:00 2001 From: Alex Shubert Date: Mon, 16 Dec 2013 21:41:34 +0400 Subject: [PATCH 10/14] turn in only --- AutoTurnIn.lua | 56 +++++++++++++++++++++++++---------------------- loc/localization_DE.lua | 3 ++- loc/localization_EN.lua | 19 ++++++++-------- loc/localization_FR.lua | 3 ++- loc/localization_RU.lua | 1 + ui/main_options.lua | 7 ++++-- 6 files changed, 50 insertions(+), 39 deletions(-) diff --git a/AutoTurnIn.lua b/AutoTurnIn.lua index be54d4c..81dd124 100644 --- a/AutoTurnIn.lua +++ b/AutoTurnIn.lua @@ -13,7 +13,8 @@ local Q_ALL, Q_DAILY, Q_EXCEPTDAILY = 1, 2, 3 AutoTurnIn = LibStub("AceAddon-3.0"):NewAddon("AutoTurnIn", "AceEvent-3.0", "AceConsole-3.0") -AutoTurnIn.defaults = {enabled = true, all = 2, trivial = false, lootreward = 1, tournament = 2, +AutoTurnIn.defaults = {enabled = true, all = 2, trivial = false, completeonly = false, + lootreward = 1, tournament = 2, darkmoonteleport=true, todarkmoon=true, togglekey=4, darkmoonautostart=true, showrewardtext=true, version=TOCVersion, autoequip = false, debug=false, questlevel=true, watchlevel=true, questshare=false, @@ -199,7 +200,6 @@ end -- Old 'Quest NPC' interaction system. See http://wowprogramming.com/docs/events/QUEST_GREETING function AutoTurnIn:QUEST_GREETING() - print("OLD") if (not self:AllowedToHandle(true)) then return end @@ -211,27 +211,29 @@ function AutoTurnIn:QUEST_GREETING() end end - for index=1, GetNumAvailableQuests() do - local isTrivial, isDaily, isRepeatable = GetAvailableQuestInfo(index) - local triviaAndAllowedOrNotTrivia = (not isTrivial) or AutoTurnInCharacterDB.trivial - local title = GetAvailableTitle(index) - local quest = L.quests[title] - local notBlackListed = not (quest and (quest.donotaccept or AutoTurnIn:IsIgnoredQuest(title))) + if not AutoTurnInCharacterDB.completeonly then + for index=1, GetNumAvailableQuests() do + local isTrivial, isDaily, isRepeatable = GetAvailableQuestInfo(index) + local triviaAndAllowedOrNotTrivia = (not isTrivial) or AutoTurnInCharacterDB.trivial + local title = GetAvailableTitle(index) + local quest = L.quests[title] + local notBlackListed = not (quest and (quest.donotaccept or AutoTurnIn:IsIgnoredQuest(title))) - if isDaily then - self:CacheAsDaily(GetAvailableTitle(index)) - end + if isDaily then + self:CacheAsDaily(GetAvailableTitle(index)) + end - if (triviaAndAllowedOrNotTrivia and notBlackListed and self:_isAppropriate(isDaily)) then - if quest and quest.amount then - if self:GetItemAmount(quest.currency, quest.item) >= quest.amount then - SelectAvailableQuest(index) - end - else - SelectAvailableQuest(index) - end - end - end + if (triviaAndAllowedOrNotTrivia and notBlackListed and self:_isAppropriate(isDaily)) then + if quest and quest.amount then + if self:GetItemAmount(quest.currency, quest.item) >= quest.amount then + SelectAvailableQuest(index) + end + else + SelectAvailableQuest(index) + end + end + end + end end -- (gaq[i+3]) equals "1" if quest is complete, "nil" otherwise @@ -317,7 +319,9 @@ function AutoTurnIn:GOSSIP_SHOW() local questCount = GetNumGossipActiveQuests() > 0 self:VarArgForActiveQuests(GetGossipActiveQuests()) - self:VarArgForAvailableQuests(GetGossipAvailableQuests()) + if not AutoTurnInCharacterDB.completeonly then + self:VarArgForAvailableQuests(GetGossipAvailableQuests()) + end if self:isDarkmoonAndAllowed(questCount) then local options = {GetGossipOptions()} @@ -343,8 +347,8 @@ function AutoTurnIn:QUEST_DETAIL() if (QuestIsDaily() or QuestIsWeekly()) then self:CacheAsDaily(GetTitleText()) end - - if self:AllowedToHandle() and self:isAppropriate() then + + if self:AllowedToHandle() and self:isAppropriate() and (not AutoTurnInCharacterDB.completeonly)then QuestInfoDescriptionText:SetAlphaGradient(0, -1) QuestInfoDescriptionText:SetAlpha(1) AcceptQuest() @@ -360,7 +364,7 @@ end function AutoTurnIn:QUEST_PROGRESS() if self:AllowedToHandle() and IsQuestCompletable() and self:isAppropriate() then - CompleteQuest() + CompleteQuest() end end @@ -469,7 +473,7 @@ function AutoTurnIn:TurnInQuest(rewardIndex) elseif (GetNumQuestChoices() == 0) then self:Print("Debug: turning quest in, no choice required") end - else + else GetQuestReward(rewardIndex) end end diff --git a/loc/localization_DE.lua b/loc/localization_DE.lua index 06d0bfa..ffbe384 100644 --- a/loc/localization_DE.lua +++ b/loc/localization_DE.lua @@ -19,13 +19,14 @@ privateTable.L = setmetatable({ ["questTypeExceptDaily"] = "außer Tägliche", ["TrivialQuests"]="'graue' Quests annehmen", ["ShareQuestsLabel"] = "teilen die Quest", + ["CompleteOnly"] = "zurückliefern bloß", ["lootTypeLabel"]="Jobs mit Belohnungen", ["lootTypeFalse"]="nicht abgeben", ["lootTypeGreed"]="Teuerste Belohnung wählen", ["lootTypeNeed"]="Wähle Belohnung nach Parametern", - ["tournamentLabel"]="Turnier", + ["tournamentLabel"]="Das Argentumturnier", ["tournamentWrit"]="Verfügung des Champions", -- 46114 ["tournamentPurse"]="Geldbeutel des Champions", -- 45724 diff --git a/loc/localization_EN.lua b/loc/localization_EN.lua index 8f15cfd..8ce112e 100644 --- a/loc/localization_EN.lua +++ b/loc/localization_EN.lua @@ -19,19 +19,20 @@ privateTable.L = setmetatable({ ["dontloottrue"]="do not complete quests with rewards", ["resetbutton"]="reset", - ["questTypeLabel"] = "Quests to handle", + ["questTypeLabel"] = "quests to handle", ["questTypeAll"] = "all", ["questTypeList"] = "daily", ["questTypeExceptDaily"] = "except daily", ["TrivialQuests"]="Accept 'grey' quests", - ["ShareQuestsLabel"] = "Quest auto sharing", + ["ShareQuestsLabel"] = "quest auto sharing", + ["CompleteOnly"] = "turn in only", - ["lootTypeLabel"]="Quests with rewards", + ["lootTypeLabel"]="quests with rewards", ["lootTypeFalse"]="don't turn in", ["lootTypeGreed"]="loot most expensive reward", ["lootTypeNeed"]="loot by parameters", - ["tournamentLabel"]="Tournament", + ["tournamentLabel"]="Argent Tournament", ["tournamentWrit"]="Champion's Writ", -- 46114 ["tournamentPurse"]="Champion's Purse", -- 45724 @@ -40,11 +41,11 @@ privateTable.L = setmetatable({ ["DarkmoonFaireTeleport"]="Teleportologist Fozlebub", ["DarkmoonAutoLabel"]="Darkmoon: start the game!", - ["rewardtext"]="Print quest competition text", - ["questlevel"]="Show quest level", - ["watchlevel"]="Show watched quest level", - ["autoequip"]="Equip received reward", - ["togglekey"]="Enable/disable key", + ["rewardtext"]="print quest competition text", + ["questlevel"]="show quest level", + ["watchlevel"]="show watched quest level", + ["autoequip"]="equip received reward", + ["togglekey"]="enable/disable key", ['Jewelry']="Jewelry", ["rewardlootoptions"]="Reward loot rules", diff --git a/loc/localization_FR.lua b/loc/localization_FR.lua index ef98994..a3858b8 100644 --- a/loc/localization_FR.lua +++ b/loc/localization_FR.lua @@ -17,13 +17,14 @@ privateTable.L = setmetatable({ ["questTypeExceptDaily"] = "excepté journalières", ["TrivialQuests"]= "Accepter les quêtes 'grise'", ["ShareQuestsLabel"] = "partager la quête", + ["CompleteOnly"] = "turn in only", ["lootTypeLabel"]="Quêtes à récompense d'objet", ["lootTypeFalse"]="Ne pas rendre", ["lootTypeGreed"]="Vhoisir la récompense la plus chère", ["lootTypeNeed"]="choisir la récompense selon les paramètres", - ["tournamentLabel"]="Tournoi d'argent", + ["tournamentLabel"]="Le tournoi d'Argent", ["tournamentWrit"]="Commission de champion", -- 46114 ["tournamentPurse"]="Bourse de champion", -- 45724 diff --git a/loc/localization_RU.lua b/loc/localization_RU.lua index 8990801..ea838e0 100644 --- a/loc/localization_RU.lua +++ b/loc/localization_RU.lua @@ -19,6 +19,7 @@ privateTable.L = setmetatable({ ["questTypeExceptDaily"] = "кроме ежедневных", ["TrivialQuests"]="брать 'серые' квесты", ["ShareQuestsLabel"] = "Предлагать задание группе", + ["CompleteOnly"] = "только завершать", ["lootTypeLabel"]="задания с наградами", ["lootTypeFalse"]="не сдавать", diff --git a/ui/main_options.lua b/ui/main_options.lua index fd43471..d46347a 100644 --- a/ui/main_options.lua +++ b/ui/main_options.lua @@ -61,7 +61,8 @@ end local Enable = newCheckbox("enabled", L["enabled"], "enabled") -- trivial, so called grayed quests local TrivialQuests = newCheckbox("TrivialQuests", L["TrivialQuests"], "trivial") - +-- Only hand in the quest +local CompleteOnly = newCheckbox("CompleteOnly", L["CompleteOnly"], "completeonly") -- DarkmoonTeleport local ToDarkMoon = newCheckbox("ToDarkMoon", L["ToDarkmoonLabel"], "todarkmoon") -- Darkmoon Teleport to cannon @@ -102,8 +103,9 @@ ResetButton:SetPoint("TOPRIGHT", OptionsPanel, "TOPRIGHT", -10, -10) Enable:SetPoint("TOPLEFT", subText, "BOTTOMLEFT", 0, -14) QuestDropDown:SetPoint("TOPLEFT", Enable, "BOTTOMLEFT", -15, -22) TrivialQuests:SetPoint("TOPLEFT", QuestDropDown, "TOPRIGHT", 30, 0) +CompleteOnly:SetPoint("TOPLEFT", TrivialQuests, "BOTTOMLEFT", 0, -10) LootDropDown:SetPoint("TOPLEFT", QuestDropDown, "BOTTOMLEFT", 0, -22) -TournamentDropDown:SetPoint("TOPLEFT", LootDropDown, "TOPRIGHT", 17, 0) +TournamentDropDown:SetPoint("TOPLEFT", ToggleKeyDropDown, "TOPRIGHT", 17, 0) EquipReward:SetPoint("TOPLEFT", LootDropDown, "BOTTOMLEFT", 16, -10) ShowRewardText:SetPoint("TOPLEFT", EquipReward, "BOTTOMLEFT", 0, -10) ToDarkMoon:SetPoint("TOPLEFT", ShowRewardText, "BOTTOMLEFT", 0, -10) @@ -137,6 +139,7 @@ OptionsPanel.refresh = function() EquipReward:SetChecked(ptable.TempConfig.autoequip) Debug:SetChecked(ptable.TempConfig.debug) TrivialQuests:SetChecked(ptable.TempConfig.trivial) + CompleteOnly:SetChecked(ptable.TempConfig.completeonly) ShowQuestLevel:SetChecked(ptable.TempConfig.questlevel) ShowWatchLevel:SetChecked(ptable.TempConfig.watchlevel) ShareQuests:SetChecked(ptable.TempConfig.questshare) -- 1.7.9.5 From f7835ece59455637d2c4a6d13563ca24373876e5 Mon Sep 17 00:00:00 2001 From: "shubert.aleksandr" Date: Thu, 19 Dec 2013 16:24:56 +0400 Subject: [PATCH 11/14] toggle key setting doesn't save --- ui/main_options.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/main_options.lua b/ui/main_options.lua index d46347a..5119f37 100644 --- a/ui/main_options.lua +++ b/ui/main_options.lua @@ -84,7 +84,7 @@ local ShowWatchLevel = newCheckbox("WatchLevel", L["watchlevel"], "watchlevel") -- Auto toggle key local ToggleKeyConst = {NONE_KEY, ALT_KEY, CTRL_KEY, SHIFT_KEY} -local ToggleKeyDropDown = newDropDown(L["togglekey"], "ToggleKeyDropDown", ToggleKeyConst, "ToggleKeyConst") +local ToggleKeyDropDown = newDropDown(L["togglekey"], "ToggleKeyDropDown", ToggleKeyConst, "togglekey") -- Quest types to handle local QuestConst = {L["questTypeAll"], L["questTypeList"], L["questTypeExceptDaily"]} local QuestDropDown = newDropDown(L["questTypeLabel"], "QuestDropDown", QuestConst, "all") -- self:GetID() == 1 @@ -145,7 +145,7 @@ OptionsPanel.refresh = function() ShareQuests:SetChecked(ptable.TempConfig.questshare) UIDropDownMenu_SetSelectedID(ToggleKeyDropDown, ptable.TempConfig.togglekey) - UIDropDownMenu_SetText(ToggleKeyDropDown, ToggleKeyConst[ptable.TempConfig.togglekey]) + UIDropDownMenu_SetText(ToggleKeyDropDown, ToggleKeyConst[ptable.TempConfig.togglekey]) MakeACopy = true end -- 1.7.9.5 From 3fbf38255dcbbdfdff4dab04ba42a6952c5e4de3 Mon Sep 17 00:00:00 2001 From: Alex Shubert Date: Thu, 6 Feb 2014 21:02:49 +0400 Subject: [PATCH 12/14] removed p1 & p2 - looks like they are not used --- AutoTurnIn.lua | 2 -- 1 file changed, 2 deletions(-) diff --git a/AutoTurnIn.lua b/AutoTurnIn.lua index 81dd124..c647f41 100644 --- a/AutoTurnIn.lua +++ b/AutoTurnIn.lua @@ -162,8 +162,6 @@ function AutoTurnIn:IsIgnoredQuest(quest) return false end -local p1 = {[true]=L["enabled"], [false]=L["disabled"]} -local p2 = {[true]=L["all"], [false]=L["list"]} function AutoTurnIn:ConsoleComand(arg) arg = strlower(arg) if (#arg == 0) then -- 1.7.9.5 From 5f483a5563bf2e5c189f1d992ec1a5e3ce7060b0 Mon Sep 17 00:00:00 2001 From: Alex Shubert Date: Fri, 7 Feb 2014 20:12:15 +0400 Subject: [PATCH 13/14] default locale for ptBR --- loc/localization_EN.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/loc/localization_EN.lua b/loc/localization_EN.lua index 8ce112e..54a0ab9 100644 --- a/loc/localization_EN.lua +++ b/loc/localization_EN.lua @@ -6,6 +6,7 @@ local replaceTable = { ["esES"]=true, ["esMX"]=true, ["zhTW"]=true, + ["ptBR"]=true, ["zhCN"]=true } if (replaceTable[GetLocale()]) then -- 1.7.9.5 From 3274c08e7938235dd075a1b52667f027eadf4775 Mon Sep 17 00:00:00 2001 From: Alex Shubert Date: Wed, 12 Feb 2014 15:13:41 +0400 Subject: [PATCH 14/14] register for event --- AutoTurnIn.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/AutoTurnIn.lua b/AutoTurnIn.lua index c647f41..c4c40ae 100644 --- a/AutoTurnIn.lua +++ b/AutoTurnIn.lua @@ -108,6 +108,7 @@ function AutoTurnIn:RegisterGossipEvents() self:RegisterEvent("QUEST_PROGRESS") self:RegisterEvent("QUEST_COMPLETE") self:RegisterEvent("QUEST_LOG_UPDATE") + self:RegisterEvent("QUEST_ACCEPTED") end function AutoTurnIn:QUEST_LOG_UPDATE() -- 1.7.9.5