Skip to content

Commit

Permalink
Merge pull request #285 from leg883/patch-51
Browse files Browse the repository at this point in the history
Update QuestLog.lua
  • Loading branch information
Wetxius committed Aug 25, 2016
2 parents e633dde + 0a1532d commit a26bcf5
Showing 1 changed file with 19 additions and 24 deletions.
43 changes: 19 additions & 24 deletions ShestakUI/Modules/Quests/QuestLog.lua
Expand Up @@ -20,32 +20,27 @@ end)
----------------------------------------------------------------------------------------
-- Ctrl+Click to abandon a quest or Alt+Click to share a quest(by Suicidal Katt)
----------------------------------------------------------------------------------------
hooksecurefunc("QuestMapLogTitleButton_OnClick", function(self, button)
if IsModifiedClick() then
if IsControlKeyDown() then
QuestMapQuestOptions_AbandonQuest(self.questID)
AbandonQuest()
if QuestLogPopupDetailFrame:IsShown() then
HideUIPanel(QuestLogPopupDetailFrame)
end
for i = 1, STATICPOPUP_NUMDIALOGS do
local frame = _G["StaticPopup"..i]
if (frame.which == "ABANDON_QUEST" or frame.which == "ABANDON_QUEST_WITH_ITEMS") and frame:IsVisible() then StaticPopup_OnClick(frame, 1) end
end
elseif IsAltKeyDown() then
if GetQuestLogPushable() then
QuestMapQuestOptions_ShareQuest(self.questID)
end
end
hooksecurefunc("QuestMapLogTitleButton_OnClick", function(self)
local questLogIndex = GetQuestLogIndexByID(self.questID)
if IsControlKeyDown() then
QuestMapQuestOptions_AbandonQuest(self.questID)
elseif IsAltKeyDown() and GetQuestLogPushable(questLogIndex) then
QuestMapQuestOptions_ShareQuest(self.questID)
end
end)

hooksecurefunc(QUEST_TRACKER_MODULE, "OnBlockHeaderClick", function(_, block)
if IsModifiedClick() then
if IsControlKeyDown() then
AbandonQuest()
elseif IsAltKeyDown() then
QuestObjectiveTracker_ShareQuest(_, block.questLogIndex)
hooksecurefunc(QUEST_TRACKER_MODULE, "OnBlockHeaderClick", function(block)
local questLogIndex = block.questLogIndex
if IsControlKeyDown() then
local items = GetAbandonQuestItems()
if items then
StaticPopup_Hide("ABANDON_QUEST")
StaticPopup_Show("ABANDON_QUEST_WITH_ITEMS", GetAbandonQuestName(), items)
else
StaticPopup_Hide("ABANDON_QUEST_WITH_ITEMS")
StaticPopup_Show("ABANDON_QUEST", GetAbandonQuestName())
end
elseif IsAltKeyDown() and GetQuestLogPushable(questLogIndex) then
QuestLogPushQuest(questLogIndex)
end
end)
end)

0 comments on commit a26bcf5

Please sign in to comment.