Skip to content

Instantly share code, notes, and snippets.

@Wetxius
Created September 20, 2017 17:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Wetxius/fa3aedf161f3926e6e694e876180a141 to your computer and use it in GitHub Desktop.
Save Wetxius/fa3aedf161f3926e6e694e876180a141 to your computer and use it in GitHub Desktop.
D:\GitHub\ShestakUI\ShestakUI\Modules\Quests\QuestLog.lua
local T, C, L, _ = unpack(select(2, ...))
----------------------------------------------------------------------------------------
-- Quest level
----------------------------------------------------------------------------------------
hooksecurefunc("QuestLogQuests_Update", function()
for i, button in pairs(QuestMapFrame.QuestsFrame.Contents.Titles) do
if button:IsShown() then
local link = GetQuestLink(button.questID)
if link then
local level = strmatch(link, "quest:%d+:(%d+)")
local title = button.Text:GetText()
if level and title then
local height = button.Text:GetHeight()
button.Text:SetFormattedText("[%d] %s", level, title)
button.Check:SetPoint("LEFT", button.Text, button.Text:GetWrappedWidth() + 2, 0)
button:SetHeight(button:GetHeight() - height + button.Text:GetHeight())
end
end
end
end
end)
----------------------------------------------------------------------------------------
-- Ctrl+Click to abandon a quest or Alt+Click to share a quest(by Suicidal Katt)
----------------------------------------------------------------------------------------
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(self, block)
local questLogIndex = block.id
SetAbandonQuest()
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment