Quantcast

Darkmoon fairy autostart added

Alex Shubert [04-05-12 - 17:51]
Darkmoon fairy autostart added
Filename
AutoTurnIn.lua
localization_DE.lua
localization_EN.lua
localization_RU.lua
options.lua
diff --git a/AutoTurnIn.lua b/AutoTurnIn.lua
index 0924c20..2811075 100644
--- a/AutoTurnIn.lua
+++ b/AutoTurnIn.lua
@@ -203,6 +203,15 @@ function AutoTurnIn:GOSSIP_SHOW()

 	self:VarArgForActiveQuests(GetGossipActiveQuests())
 	self:VarArgForAvailableQuests(GetGossipAvailableQuests())
+
+	if (AutoTurnInCharacterDB.darkmoonautostart and (GetZoneText() == L["Darkmoon Island"]) and GetNumGossipActiveQuests() > 0) then
+		local options = {GetGossipOptions()}
+		for k, v in pairs(options) do
+			if ((v ~= "gossip") and strfind(v, "|cFF0008E8%(")) then
+				SelectGossipOption(math.floor(k / GetNumGossipOptions()) +1)
+			end
+		end
+	end
 end

 function AutoTurnIn:QUEST_DETAIL()
diff --git a/localization_DE.lua b/localization_DE.lua
index fd4b538..dcadc43 100644
--- a/localization_DE.lua
+++ b/localization_DE.lua
@@ -27,6 +27,9 @@ privateTable.L = setmetatable({

 	["DarkmoonTeleLabel"]="Dunkelmond-Jahrmarkt: Zurück zur Kanone!",
 	["Teleportologe Fosselbab"]="Teleportologist Fozlebub",
+	["DarkmoonAutoLabel"]="Dunkelmond-Jahrmarkt: Spiel starten!",
+	["Darkmoon Island"]="Dunkelmondinsel",
+
 	["rewardtext"]="Show quest reward text",
 	["togglekey"]="aktivieren/deaktivieren Taste",

diff --git a/localization_EN.lua b/localization_EN.lua
index cf761cf..ba4162a 100644
--- a/localization_EN.lua
+++ b/localization_EN.lua
@@ -24,6 +24,7 @@ privateTable.L = setmetatable({

 	["DarkmoonTeleLabel"]="Darkmoon: teleport to the cannon",
 	["DarkmoonFaireTeleport"]="Teleportologist Fozlebub",
+	["DarkmoonAutoLabel"]="Darkmoon: start the game!",

 	["rewardtext"]="Print quest reward text",
 	["togglekey"]="Enable/disable key",
diff --git a/localization_RU.lua b/localization_RU.lua
index dfb065d..c4a46b2 100644
--- a/localization_RU.lua
+++ b/localization_RU.lua
@@ -27,6 +27,8 @@ privateTable.L = setmetatable({

 	["DarkmoonTeleLabel"]="Ярмарка Новолуния: телепортация к пушке", -- darkmoon
 	["DarkmoonFaireTeleport"]="Телепортолог Фоцлебульб",
+	["DarkmoonAutoLabel"]="Ярмарка Новолуния: начинать игру",
+	["Darkmoon Island"]="Остров Новолуния",

 	["rewardtext"]="Показывать финальный текст задания",
 	["togglekey"]="Клавиша разового включения/отключения",
diff --git a/options.lua b/options.lua
index d7f0e67..25b8b37 100644
--- a/options.lua
+++ b/options.lua
@@ -88,6 +88,13 @@ DarkMoonCannon:SetScript("OnClick", function(self)
 	ptable.TempConfig.darkmoonteleport = self:GetChecked() == 1
 end)

+-- DarkmoonTeleport
+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)
+
 -- 'Show Reward Text' CheckBox
 local ShowRewardText = CreateFrame("CheckButton", O.."Reward", OptionsPanel, "OptionsCheckButtonTemplate")
 _G[ShowRewardText:GetName().."Text"]:SetText(L["rewardtext"])
@@ -126,7 +133,8 @@ 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)
+DarkMoonAutoStart:SetPoint("TOPLEFT", DarkMoonCannon, "BOTTOMLEFT", 0, -16)
+ShowRewardText:SetPoint("TOPLEFT", DarkMoonAutoStart, "BOTTOMLEFT", 0, -16)

 ToggleKeyLabel:SetPoint("BOTTOMLEFT", ToggleKeyDropDown, "TOPLEFT", 18, 0)
 ToggleKeyDropDown:SetPoint("TOPLEFT", ShowRewardText, "BOTTOMLEFT", -15, -30)