Skip to content

Commit

Permalink
* Add an option to hide hidden quests
Browse files Browse the repository at this point in the history
* Remove leftovers from unused optional addons
  • Loading branch information
azuraji committed Nov 27, 2022
1 parent b64564b commit 31a3832
Show file tree
Hide file tree
Showing 12 changed files with 154 additions and 117 deletions.
5 changes: 5 additions & 0 deletions MonkeyBuddy/MonkeyBuddy.lua
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,11 @@ MonkeyBuddyQuest_CheckButtons[MONKEYBUDDY_QUEST_WORKCOMPLETE] = {
strVar = "m_bWorkComplete",
pSlashCommand = MonkeyQuestSlash_CmdWorkComplete
};
MonkeyBuddyQuest_CheckButtons[MONKEYBUDDY_QUEST_HIDEHIDDENQUESTS] = {
id = 23,
strVar = "m_bHideHiddenQuests",
pSlashCommand = MonkeyQuestSlash_CmdHideHiddenQuests
};


-- this array is used to init the colour buttons
Expand Down
2 changes: 1 addition & 1 deletion MonkeyBuddy/MonkeyBuddy.toc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## Interface: 100002
## Title: MonkeyBuddy v10.0.2.2
## Title: MonkeyBuddy v10.0.2.3
## Notes: Helps you configure your MonkeyMods. (http://www.toctastic.net/)
## Notes-deDE: Hilft Euch beim Einstellen Euer MonkeyMods. (http://www.toctastic.net/)
## Author: Trentin, Jim-Bim, azuraji
Expand Down
9 changes: 7 additions & 2 deletions MonkeyBuddy/MonkeyBuddy.xml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@

<Frame name="MonkeyBuddyFrame" toplevel="true" frameStrata="MEDIUM" movable="true" enableMouse="true" hidden="true" parent="UIParent" inherits="BackdropTemplate">
<Size>
<AbsDimension x="700" y="625"/>
<AbsDimension x="700" y="700"/>
</Size>
<Anchors>
<Anchor point="CENTER"/>
Expand Down Expand Up @@ -353,6 +353,11 @@
<Anchor point="TOPLEFT" relativeTo="MonkeyBuddyQuestCheck21" relativePoint="BOTTOMLEFT" />
</Anchors>
</CheckButton>
<CheckButton name="MonkeyBuddyQuestCheck23" inherits="MonkeyBuddyCheckButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="MonkeyBuddyQuestCheck22" relativePoint="BOTTOMLEFT" />
</Anchors>
</CheckButton>

<Button name="MonkeyBuddyQuestColour1" inherits="MonkeyBuddyQuestColourButtonTemplate">
<Anchors>
Expand Down Expand Up @@ -458,7 +463,7 @@
<Anchors>
<Anchor point="BOTTOM">
<Offset>
<AbsDimension x="0" y="8" />
<AbsDimension x="0" y="-70" />
</Offset>
</Anchor>
</Anchors>
Expand Down
5 changes: 3 additions & 2 deletions MonkeyBuddy/localization.lua
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ MONKEYBUDDY_QUEST_SHOWNOOBTIPS = "Show helpful tooltips for Noobs";
MONKEYBUDDY_QUEST_SHOWZONEHIGHLIGHT = "Show quest zone highlighting";
MONKEYBUDDY_QUEST_SHOWQUESTLEVEL = "Show the quest levels";
MONKEYBUDDY_QUEST_WORKCOMPLETE = "Enable >work complete< sound";
MONKEYBUDDY_QUEST_HIDEHIDDENQUESTS = "Hide quests hidden in Blizzard's quest log";

MONKEYBUDDY_QUEST_QUESTTITLECOLOUR = "Quest Titles";
MONKEYBUDDY_QUEST_HEADEROPENCOLOUR = "Open Zone Headers";
Expand Down Expand Up @@ -227,7 +228,7 @@ MONKEYBUDDY_QUEST_QUESTTITLECOLOUR = "Titre des Qu\195\170tes";
MONKEYBUDDY_QUEST_HEADEROPENCOLOUR = "Ouvrir le nom des zones";
MONKEYBUDDY_QUEST_HEADERCLOSEDCOLOUR = "Fermer le nom des zones";
MONKEYBUDDY_QUEST_OVERVIEWCOLOUR = "Vues d\'ensemble des Qu\195\170tes";
MONKEYBUDDY_QUEST_SPECIALOBJECTIVECOLOUR = "Objectifs Spéciaux";
MONKEYBUDDY_QUEST_SPECIALOBJECTIVECOLOUR = "Objectifs Sp�ciaux";
MONKEYBUDDY_QUEST_INITIALOBJECTIVECOLOUR = "Objectifs \195\160 0%";
MONKEYBUDDY_QUEST_MIDOBJECTIVECOLOUR = "Objectifs \195\160 50%";
MONKEYBUDDY_QUEST_COMPLETEOBJECTIVECOLOUR = "Objectifs \195\160 <100%";
Expand Down Expand Up @@ -268,4 +269,4 @@ MONKEYBUDDY_CLOCK_MINUTESLIDER = "Réglage Minute";
-- bindings
BINDING_NAME_MONKEYBUDDY_OPEN = "Ouvrir/Fermer la fenêtre de configuration";

end
end
2 changes: 1 addition & 1 deletion MonkeyLibrary/MonkeyLibrary.toc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## Interface: 100002
## Title: MonkeyLibrary v10.0.2
## Title: MonkeyLibrary v10.0.2.3
## Notes: Common files and functions for MonkeyMods. (http://www.toctastic.net/)
## Notes-deDE: Gemeinsame Dateien und Funktionen fuer MonkeyMods. (http://www.toctastic.net/)
## Author: Trentin ([email protected])
Expand Down
198 changes: 117 additions & 81 deletions MonkeyQuest/MonkeyQuest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,6 @@ function MonkeyQuest_OnLoad(self)
MonkeyQuestSlash_Init();
MonkeyQuestOptions();

-- overriding of tooltip functions
MonkeyQuest_OLD_aftt_setName = aftt_setName;
aftt_setName = MonkeyQuest_NEW_aftt_setName;

-- this will catch mobs needed for quests
self:RegisterEvent('UPDATE_MOUSEOVER_UNIT');
end
Expand Down Expand Up @@ -525,14 +521,30 @@ function MonkeyQuest_Refresh(MBDaily)
local tmpQuestLogSelection = C_QuestLog.GetSelectedQuest();

local iNumEntries, iNumQuests = C_QuestLog.GetNumQuestLogEntries();

local visibleQuestsEffectiveCount = 0

for i = 1, iNumEntries, 1 do
local questInfo = C_QuestLog.GetInfo(i)

if (questInfo.isHeader == false) then
if (MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bHideHiddenQuests == false or questInfo.isHidden == false) then
visibleQuestsEffectiveCount = visibleQuestsEffectiveCount + 1
end
end
end

iNumQuests = visibleQuestsEffectiveCount

local DQCompleted = GetDailyQuestsCompleted();
-- local DQCompleted = GetDailyQuestsCompleted();
--local DQMax = GetMaxDailyQuests();

MonkeyQuestTitleText:SetTextHeight(MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_iFontHeight + 2);
-- set the title, with or without the number of quests

if (MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bShowNumQuests == true) then


if (MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bHideTitle == false) then
if (MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bShowDailyNumQuests == false) then
MonkeyQuestTitleText:SetText(MONKEYQUEST_TITLE .. " " .. iNumQuests .. "/" .. MAX_QUESTLOG_QUESTS);
Expand Down Expand Up @@ -560,12 +572,6 @@ function MonkeyQuest_Refresh(MBDaily)
end
end


-- update the BIB text
if (BIB_MonkeyQuestButton_GetButtonText) then
BIB_MonkeyQuestButton_GetButtonText();
end


MonkeyQuest.m_iNumEntries = iNumEntries;

Expand All @@ -582,17 +588,42 @@ function MonkeyQuest_Refresh(MBDaily)

MonkeyQuest_RefreshQuestItemList();

--local watchItemIndex = 0;

if (MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bMinimized == false) then
local questInfo, title
local visibleQuestsCount
local questHeaders = {}

for i = 1, iNumEntries, 1 do
questInfo = C_QuestLog.GetInfo(i)

if (questInfo.isHeader) then
if (visibleQuestsCount and visibleQuestsCount > 0) then
questHeaders[title] = visibleQuestsCount
end

title = questInfo.title
visibleQuestsCount = 0
else
if (questInfo.isHidden == false) then
visibleQuestsCount = visibleQuestsCount + 1
end
end
end

-- last header group

if (visibleQuestsCount and visibleQuestsCount > 0) then
questHeaders[title] = visibleQuestsCount
end


for i = 1, iNumEntries, 1 do
-- questInfo.title the title text of the quest, may be a header (ex. Wetlands)
-- questInfo.level the level of the quest
-- questTagInfo.tagName the tag on the quest (ex. COMPLETED)
--local strQuestLogTitleText, strQuestLevel, strQuestTag, suggestedGroup, isHeader, isCollapsed, isComplete, isDaily = C_QuestLog.GetTitleForLogIndex(i);

local questInfo = C_QuestLog.GetInfo(i)
questInfo = C_QuestLog.GetInfo(i)
--print(questInfo.title, questInfo.isHeader, questInfo.questID)
local suggestedGroup = questInfo.suggestedGroup
local isComplete = C_QuestLog.IsComplete(questInfo.questID)
Expand All @@ -614,88 +645,85 @@ function MonkeyQuest_Refresh(MBDaily)
MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_aQuestList[questInfo.title] = {};
MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_aQuestList[questInfo.title].m_bChecked = true;
end

if (questInfo.isHeader) then

if (MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_aQuestList[questInfo.title].m_bChecked == true) then
if (MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bNoHeaders == false or
MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bShowHidden == true or
MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bAlwaysHeaders == true) then

strMonkeyQuestBody = strMonkeyQuestBody ..
format(MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_strHeaderOpenColour .. "%s|r",
"- " .. questInfo.title) .. "\n";
if (questInfo.isHeader) then
if (MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bHideHiddenQuests == false or questHeaders[questInfo.title]) then
if (MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_aQuestList[questInfo.title].m_bChecked == true) then
if (MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bNoHeaders == false or
MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bShowHidden == true or
MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bAlwaysHeaders == true) then

_G["MonkeyQuestButton" .. iButtonId .. "Text"]:SetText(strMonkeyQuestBody);
_G["MonkeyQuestButton" .. iButtonId .. "Text"]:Show();
_G["MonkeyQuestButton" .. iButtonId]:Show();
strMonkeyQuestBody = strMonkeyQuestBody .. format(MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_strHeaderOpenColour .. "%s|r", "- " .. questInfo.title) .. "\n";

-- set the bg colour
_G["MonkeyQuestButton" .. iButtonId .. "Texture"]:SetVertexColor(0.0, 0.0, 0.0, 0.0);

_G["MonkeyQuestButton" .. iButtonId].m_iQuestIndex = i;
_G["MonkeyQuestButton" .. iButtonId].id = iButtonId;

_G["MonkeyQuestHideButton" .. iButtonId]:Hide();
_G["MonkeyQuestHideButton" .. iButtonId].m_strQuestLogTitleText = questInfo.title;

iButtonId = iButtonId + 1;

strMonkeyQuestBody = "";
end
else
if (MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bShowHidden == true or
MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bAlwaysHeaders == true) then
_G["MonkeyQuestButton" .. iButtonId .. "Text"]:SetText(strMonkeyQuestBody);
_G["MonkeyQuestButton" .. iButtonId .. "Text"]:Show();
_G["MonkeyQuestButton" .. iButtonId]:Show();

strMonkeyQuestBody = strMonkeyQuestBody ..
format(MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_strHeaderClosedColour .. "%s|r",
"+ " .. questInfo.title) .. "\n";
-- set the bg colour
_G["MonkeyQuestButton" .. iButtonId .. "Texture"]:SetVertexColor(0.0, 0.0, 0.0, 0.0);

_G["MonkeyQuestButton" .. iButtonId].m_iQuestIndex = i;
_G["MonkeyQuestButton" .. iButtonId].id = iButtonId;

_G["MonkeyQuestHideButton" .. iButtonId]:Hide();
_G["MonkeyQuestHideButton" .. iButtonId].m_strQuestLogTitleText = questInfo.title;

_G["MonkeyQuestButton" .. iButtonId .. "Text"]:SetText(strMonkeyQuestBody);
_G["MonkeyQuestButton" .. iButtonId .. "Text"]:Show();
_G["MonkeyQuestButton" .. iButtonId]:Show();
iButtonId = iButtonId + 1;

strMonkeyQuestBody = "";
end
else
if (MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bShowHidden == true or
MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bAlwaysHeaders == true) then

-- set the bg colour
_G["MonkeyQuestButton" .. iButtonId .. "Texture"]:SetVertexColor(0.0, 0.0, 0.0, 0.0);

_G["MonkeyQuestButton" .. iButtonId].m_iQuestIndex = i;
_G["MonkeyQuestButton" .. iButtonId].id = iButtonId;

_G["MonkeyQuestHideButton" .. iButtonId]:Hide();
_G["MonkeyQuestHideButton" .. iButtonId].m_strQuestLogTitleText = questInfo.title;

iButtonId = iButtonId + 1;

strMonkeyQuestBody = "";
strMonkeyQuestBody = strMonkeyQuestBody .. format(MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_strHeaderClosedColour .. "%s|r", "+ " .. questInfo.title) .. "\n";

_G["MonkeyQuestButton" .. iButtonId .. "Text"]:SetText(strMonkeyQuestBody);
_G["MonkeyQuestButton" .. iButtonId .. "Text"]:Show();
_G["MonkeyQuestButton" .. iButtonId]:Show();

-- set the bg colour
_G["MonkeyQuestButton" .. iButtonId .. "Texture"]:SetVertexColor(0.0, 0.0, 0.0, 0.0);

_G["MonkeyQuestButton" .. iButtonId].m_iQuestIndex = i;
_G["MonkeyQuestButton" .. iButtonId].id = iButtonId;

_G["MonkeyQuestHideButton" .. iButtonId]:Hide();
_G["MonkeyQuestHideButton" .. iButtonId].m_strQuestLogTitleText = questInfo.title;

iButtonId = iButtonId + 1;

strMonkeyQuestBody = "";
end
-- keep looping through the list until we find the next header
bNextHeader = true;
end
-- keep looping through the list until we find the next header
bNextHeader = true;
end
else
-- check if the user even wants this displayed
if ((MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_aQuestList[questInfo.title].m_bChecked == true or
MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bShowHidden) and
(MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bHideCompletedQuests == false or
(MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bHideCompletedQuests == true and not isComplete) or
MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bShowHidden)) then
if ((MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_aQuestList[questInfo.title].m_bChecked == true or MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bShowHidden)
and ( MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bHideCompletedQuests == false
or (MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bHideCompletedQuests == true and not isComplete)
or MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bShowHidden)
and (MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bHideHiddenQuests == false or questInfo.isHidden == false)) then

-- the user has this quest checked off or he's showing all quests anyways, so we show it (currently on :Hide)
--getglobal("MonkeyQuestHideButton" .. iButtonId):Hide();

if ( MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bShowHidden ) then
_G["MonkeyQuestHideButton" .. iButtonId]:Hide();
else
_G["MonkeyQuestHideButton" .. iButtonId]:Hide();
end
-- if (MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bShowHidden) then
-- _G["MonkeyQuestHideButton" .. iButtonId]:Hide();
-- else
-- _G["MonkeyQuestHideButton" .. iButtonId]:Hide();
-- end

-- update hide quests buttons
if (MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_aQuestList[questInfo.title].m_bChecked == true) then
_G["MonkeyQuestHideButton" .. iButtonId]:SetChecked(1);
else
_G["MonkeyQuestHideButton" .. iButtonId]:SetChecked(0);
end
-- -- update hide quests buttons
-- if (MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_aQuestList[questInfo.title].m_bChecked == true) then
-- _G["MonkeyQuestHideButton" .. iButtonId]:SetChecked(1);
-- else
-- _G["MonkeyQuestHideButton" .. iButtonId]:SetChecked(0);
-- end

_G["MonkeyQuestHideButton" .. iButtonId].m_strQuestLogTitleText = questInfo.title;
-- _G["MonkeyQuestHideButton" .. iButtonId].m_strQuestLogTitleText = questInfo.title;

local color = GetQuestDifficultyColor(questInfo.level);
local strQuestLink = GetQuestLink(questInfo.questID);
Expand Down Expand Up @@ -747,6 +775,14 @@ function MonkeyQuest_Refresh(MBDaily)
-- Emissary world quest
elseif (questTagInfo and questTagInfo.tagID == 128) then
strMonkeyQuestBody = strMonkeyQuestBody .. format("%s%s|r", strTitleColor, "[" .. questInfo.level .. "E] ");

-- Island quest
elseif (questTagInfo and questTagInfo.tagID == 254) then
strMonkeyQuestBody = strMonkeyQuestBody .. format("%s%s|r", strTitleColor, "[" .. questInfo.level .. "I] ");

-- Island weekly quest
elseif (questTagInfo and questTagInfo.tagID == 261) then
strMonkeyQuestBody = strMonkeyQuestBody .. format("%s%s|r", strTitleColor, "[" .. questInfo.level .. "Iw] ");

elseif (questTagInfo and questTagInfo.tagID == Enum.QuestTag.PvP) then
if (questInfo.frequency == Enum.QuestFrequency.Daily) then
Expand All @@ -773,7 +809,7 @@ function MonkeyQuest_Refresh(MBDaily)

-- Covenant Calling Quest
elseif (questTagInfo and questTagInfo.tagID == 271) then
strMonkeyQuestBody = strMonkeyQuestBody .. format("%s%s|r", strTitleColor, "[" .. questInfo.level .. "CQ] ");
strMonkeyQuestBody = strMonkeyQuestBody .. format("%s%s|r", strTitleColor, "[" .. questInfo.level .. "C] ");

else
strMonkeyQuestBody = strMonkeyQuestBody .. format("%s%s|r", strTitleColor, "[" .. questInfo.level .. "] ");
Expand Down
3 changes: 1 addition & 2 deletions MonkeyQuest/MonkeyQuest.toc
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
## Interface: 100002
## Title: MonkeyQuest v10.0.2.2
## Title: MonkeyQuest v10.0.2.3
## Notes: Displays your quests for quick viewing. (http://www.toctastic.net/)
## Notes-deDE: Stellt Quests in einer kompakten Uebersicht dar. (http://www.toctastic.net/)
## Author: Trentin, Jim-Bim, azuraji
## SavedVariables: MonkeyQuestConfig
## Dependencies: MonkeyLibrary
## OptionalDeps: aftt_extreme, BhaldieInfoBar
MonkeyQuest.xml
1 change: 1 addition & 0 deletions MonkeyQuest/MonkeyQuestDefs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ MONKEYQUEST_DEFAULT_COLOURTITLE = false;
MONKEYQUEST_DEFAULT_FONTHEIGHT = 12;
MONKEYQUEST_DEFAULT_FONT = 0;
MONKEYQUEST_DEFAULT_CRASHFONT = false;
MONKEYQUEST_DEFAULT_HIDEHIDDENQUESTS = false;
MONKEYQUEST_DEFAULT_CRASHBORDER = false;
MONKEYQUEST_DEFAULT_LOCKBIB = false;
MONKEYQUEST_DEFAULT_QUESTTITLECOLOUR = "|cFFFFFFFF";
Expand Down
Loading

0 comments on commit 31a3832

Please sign in to comment.