1 QuestHelper_File
["hidden.lua"] = "Development Version"
3 local function HiddenReason(obj
)
5 for i
, j
in pairs(obj
.after
) do
6 if i
.watched
and not i
:Known() then
8 depends
= QHFormat("DEPENDS_ON_SINGLE", i
:Reason(true))
9 elseif type(depends
) == "string" then
18 if type(depends
) == "string" then
21 return QHFormat("DEPENDS_ON_COUNT", depends
), false
25 if obj
.user_ignore
== nil then
26 if obj
.filter_level
and QuestHelper_Pref
.filter_level
then
27 return QHText("FILTERED_LEVEL"), true, "level"
30 if obj
.filter_zone
and QuestHelper_Pref
.filter_zone
then
31 return QHText("FILTERED_ZONE"), true, "zone"
34 if obj
.filter_done
and QuestHelper_Pref
.filter_done
then
35 return QHText("FILTERED_COMPLETE"), true, "done"
38 if obj
.filter_blocked
and QuestHelper_Pref
.filter_blocked
then
39 return QHText("FILTERED_BLOCKED"), true, "blocked"
41 elseif obj
.user_ignore
then
42 return QHText("FILTERED_USER"), true
45 return QHText("FILTERED_UNKNOWN"), false
48 function QuestHelper
:PopulateHidden(menu
)
51 for obj
in pairs(self
.to_add
) do
52 if not obj
:Known() then
53 reason
, can_show
, filter
= HiddenReason(obj
)
56 local item
= self
:CreateMenuItem(menu
, obj
:Reason(true))
57 local menu2
= self
:CreateMenu()
58 item
:SetSubmenu(menu2
)
60 local item2
= self
:CreateMenuItem(menu2
, reason
)
63 local menu3
= self
:CreateMenu()
64 item2
:SetSubmenu(menu3
)
65 local item3
= self
:CreateMenuItem(menu3
, QHText("HIDDEN_SHOW"))
66 item3
:SetFunction(function (obj
) obj
.user_ignore
= false end, obj
)
69 item3
= self
:CreateMenuItem(menu3
, QHFormat("DISABLE_FILTER", QHText("FILTER_"..string.upper(filter
))))
70 item3
:SetFunction(function (filter
) QuestHelper_Pref
["filter_"..filter
] = false end, filter
)
73 -- I'd add an option to adjust the level filter, but I can't tell what value would be required.
79 self
:CreateMenuItem(menu
, QHText("HIDDEN_NONE"))
83 function QuestHelper
:ShowHidden()
84 local menu
= self
:CreateMenu()
86 self
:CreateMenuTitle(menu
, QHText("HIDDEN_TITLE"))
87 self
:PopulateHidden(menu
)