Quantcast

quest reward text optionally printed

Alex Shubert [03-18-12 - 20:11]
quest reward text optionally printed
Filename
AutoTurnIn.lua
localization_DE.lua
localization_EN.lua
localization_RU.lua
options.lua
diff --git a/AutoTurnIn.lua b/AutoTurnIn.lua
index 9c9223c..74d5121 100644
--- a/AutoTurnIn.lua
+++ b/AutoTurnIn.lua
@@ -144,8 +144,7 @@ function AutoTurnIn:GOSSIP_SHOW()
 				end
 			end
 		end
-	end
-
+	end

 	VarArgForActiveQuests(GetGossipActiveQuests())
 	VarArgForAvailableQuests(GetGossipAvailableQuests())
@@ -159,13 +158,19 @@ function AutoTurnIn:QUEST_DETAIL()
 	end
 end

-function AutoTurnIn:QUEST_PROGRESS()
+function AutoTurnIn:QUEST_PROGRESS()
     if (AutoTurnInCharacterDB.all or L.quests[GetTitleText()]) and IsQuestCompletable() then
 		CompleteQuest()
     end
 end

 function AutoTurnIn:QUEST_COMPLETE()
+	if (AutoTurnInCharacterDB.showrewardtext) then
+		local gossip = UnitName("target")
+		self:Print(gossip)
+		self:Print(GetRewardText())
+	end
+
 	local quest = L.quests[GetTitleText()]
     if AutoTurnInCharacterDB.all or quest then
 		local index, money = 0, 0;
diff --git a/localization_DE.lua b/localization_DE.lua
index 95f4b99..ec21c9c 100644
--- a/localization_DE.lua
+++ b/localization_DE.lua
@@ -25,7 +25,8 @@ privateTable.L = setmetatable({
 	["tournamentPurse"]="Geldbeutel des Champions",  -- 45724

 	["DarkmoonTeleLabel"]="Dunkelmond-Jahrmarkt: Zurück zur Kanone!",
-	["Teleportologe Fosselbab"]="Teleportologist Fozlebub"},
+	["Teleportologe Fosselbab"]="Teleportologist Fozlebub",
+	["rewardtext"]="Show quest reward text"},
 	{__index = function(table, index) return index end})

 privateTable.L.quests = {
diff --git a/localization_EN.lua b/localization_EN.lua
index ecd8209..24843bd 100644
--- a/localization_EN.lua
+++ b/localization_EN.lua
@@ -22,7 +22,9 @@ privateTable.L = setmetatable({
 	["tournamentPurse"]="Champion's Purse",  -- 45724

 	["DarkmoonTeleLabel"]="Darkmoon: teleport to the cannon",
-	["DarkmoonFaireTeleport"]="Teleportologist Fozlebub"},
+	["DarkmoonFaireTeleport"]="Teleportologist Fozlebub",
+
+	["rewardtext"]="print quest reward text"},
 	{__index = function(table, index) return index end})

 privateTable.L.quests = {
diff --git a/localization_RU.lua b/localization_RU.lua
index 57981a9..1d22176 100644
--- a/localization_RU.lua
+++ b/localization_RU.lua
@@ -25,7 +25,9 @@ privateTable.L = setmetatable({
 	["tournamentPurse"]="Кошелек чемпиона",  -- 45724

 	["DarkmoonTeleLabel"]="Ярмарка Новолуния: телепортация к пушке", -- darkmoon
-	["DarkmoonFaireTeleport"]="Телепортолог Фоцлебульб"},
+	["DarkmoonFaireTeleport"]="Телепортолог Фоцлебульб",
+
+	["rewardtext"]="Показывать финальный текст задания"},
 	{__index = function(table, index) return index end})

 privateTable.L.quests = {
diff --git a/options.lua b/options.lua
index 2acf07d..f33d9a5 100644
--- a/options.lua
+++ b/options.lua
@@ -95,6 +95,13 @@ DarkMoonCannon:SetScript("OnClick", function(self)
 	TempConfig.darkmoonteleport = self:GetChecked() == 1
 end)

+-- 'Enable' CheckBox
+local ShowRewardText = CreateFrame("CheckButton", O.."Reward", OptionsPanel, "OptionsCheckButtonTemplate")
+_G[ShowRewardText:GetName().."Text"]:SetText(L["rewardtext"])
+ShowRewardText:SetScript("OnClick", function(self)
+	TempConfig.showrewardtext = self:GetChecked() == 1
+end)
+
 -- Control placement
 title:SetPoint("TOPLEFT", 16, -16)
 subText:SetPoint("TOPLEFT", title, "BOTTOMLEFT", 0, -8)
@@ -102,10 +109,11 @@ Enable:SetPoint("TOPLEFT", subText, "BOTTOMLEFT", 0, -16)
 QuestLabel:SetPoint("BOTTOMLEFT", QuestDropDown, "TOPLEFT", 18, 0)
 QuestDropDown:SetPoint("TOPLEFT", Enable, "BOTTOMLEFT", -15, -35)
 LootLabel:SetPoint("BOTTOMLEFT", LootDropDown, "TOPLEFT", 18, 0)
-LootDropDown:SetPoint("TOPLEFT", QuestDropDown, "BOTTOMLEFT", 0, -35)
+LootDropDown:SetPoint("TOPLEFT", QuestDropDown, "BOTTOMLEFT", 0, -30)
 TournamentDropDownLabel:SetPoint("BOTTOMLEFT", TournamentDropDown, "TOPLEFT", 18, 0)
 TournamentDropDown:SetPoint("TOPLEFT", LootDropDown, "TOPRIGHT", 17, 0)
 DarkMoonCannon:SetPoint("TOPLEFT", LootDropDown, "BOTTOMLEFT", 16, -16)
+ShowRewardText:SetPoint("TOPLEFT", DarkMoonCannon, "BOTTOMLEFT", 0, -16)

 OptionsPanel.refresh = function()
 	TempConfig = CopyTable(AutoTurnInCharacterDB)
@@ -124,6 +132,7 @@ OptionsPanel.refresh = function()
 		UIDropDownMenu_DisableDropDown(TournamentDropDown)
 	end
 	DarkMoonCannon:SetChecked(TempConfig.darkmoonteleport)
+	ShowRewardText:SetChecked(TempConfig.showrewardtext)
 end

 OptionsPanel.default = function()