1 QuestHelper_File
["hidden.lua"] = "Development Version"
2 QuestHelper_Loadtime
["hidden.lua"] = GetTime()
4 local function HiddenReason(obj
)
6 for i
, j
in pairs(obj
.after
) do
7 if i
.watched
and not i
:Known() then
9 depends
= QHFormat("DEPENDS_ON_SINGLE", i
:Reason(true))
10 elseif type(depends
) == "string" then
19 if type(depends
) == "string" then
22 return QHFormat("DEPENDS_ON_COUNT", depends
), false
26 if obj
.user_ignore
== nil then
27 if obj
.filter_level
and QuestHelper_Pref
.filter_level
then
28 return QHText("FILTERED_LEVEL"), true, "level"
31 if obj
.filter_zone
and QuestHelper_Pref
.filter_zone
then
32 return QHText("FILTERED_ZONE"), true, "zone"
35 if obj
.filter_done
and QuestHelper_Pref
.filter_done
then
36 return QHText("FILTERED_COMPLETE"), true, "done"
39 if obj
.filter_blocked
and QuestHelper_Pref
.filter_blocked
then
40 return QHText("FILTERED_BLOCKED"), true, "blocked"
43 if obj
.filter_watched
and QuestHelper_Pref
.filter_watched
then
44 return QHText("FILTERED_UNWATCHED"), true, "watched"
46 elseif obj
.user_ignore
then
47 return QHText("FILTERED_USER"), true
50 return QHText("FILTERED_UNKNOWN"), false
53 function QuestHelper
:PopulateHidden(menu
)
56 for obj
in pairs(self
.to_add
) do
57 if not obj
:Known() then
58 reason
, can_show
, filter
= HiddenReason(obj
)
61 local item
= self
:CreateMenuItem(menu
, obj
:Reason(true))
62 local menu2
= self
:CreateMenu()
63 item
:SetSubmenu(menu2
)
65 local item2
= self
:CreateMenuItem(menu2
, reason
)
68 local menu3
= self
:CreateMenu()
69 item2
:SetSubmenu(menu3
)
70 local item3
= self
:CreateMenuItem(menu3
, QHText("HIDDEN_SHOW"))
71 item3
:SetFunction(function (obj
) obj
.user_ignore
= false end, obj
)
74 item3
= self
:CreateMenuItem(menu3
, QHFormat("DISABLE_FILTER", QHText("FILTER_"..string.upper(filter
))))
75 item3
:SetFunction(function (filter
) QuestHelper_Pref
["filter_"..filter
] = false end, filter
)
78 -- I'd add an option to adjust the level filter, but I can't tell what value would be required.
84 self
:CreateMenuItem(menu
, QHText("HIDDEN_NONE"))
88 function QuestHelper
:ShowHidden()
89 local menu
= self
:CreateMenu()
91 self
:CreateMenuTitle(menu
, QHText("HIDDEN_TITLE"))
92 self
:PopulateHidden(menu
)