1 QuestHelper_File
["hidden.lua"] = "Development Version"
2 QuestHelper_Loadtime
["hidden.lua"] = GetTime()
4 do return end -- bzzzzt
6 local function HiddenReason(obj
)
8 for i
, j
in pairs(obj
.after
) do
9 if i
.watched
and not i
:Known() then
11 depends
= QHFormat("DEPENDS_ON_SINGLE", i
:Reason(true))
12 elseif type(depends
) == "string" then
21 if type(depends
) == "string" then
24 return QHFormat("DEPENDS_ON_COUNT", depends
), false
28 if obj
.user_ignore
== nil then
29 if obj
.filter_level
and QuestHelper_Pref
.filter_level
then
30 return QHText("FILTERED_LEVEL"), true, "level"
33 if obj
.filter_zone
and QuestHelper_Pref
.filter_zone
then
34 return QHText("FILTERED_ZONE"), true, "zone"
37 if obj
.filter_done
and QuestHelper_Pref
.filter_done
then
38 return QHText("FILTERED_COMPLETE"), true, "done"
41 if obj
.filter_blocked
and QuestHelper_Pref
.filter_blocked
then
42 return QHText("FILTERED_BLOCKED"), true, "blocked"
45 if obj
.filter_watched
and QuestHelper_Pref
.filter_watched
then
46 return QHText("FILTERED_UNWATCHED"), true, "watched"
48 elseif obj
.user_ignore
then
49 return QHText("FILTERED_USER"), true
52 return QHText("FILTERED_UNKNOWN"), false
55 function QuestHelper
:PopulateHidden(menu
)
58 for obj
in pairs(self
.to_add
) do
59 if not obj
:Known() then
60 reason
, can_show
, filter
= HiddenReason(obj
)
63 local item
= self
:CreateMenuItem(menu
, obj
:Reason(true))
64 local menu2
= self
:CreateMenu()
65 item
:SetSubmenu(menu2
)
67 local item2
= self
:CreateMenuItem(menu2
, reason
)
70 local menu3
= self
:CreateMenu()
71 item2
:SetSubmenu(menu3
)
72 local item3
= self
:CreateMenuItem(menu3
, QHText("HIDDEN_SHOW"))
73 item3
:SetFunction(function (obj
) obj
.user_ignore
= false end, obj
)
76 item3
= self
:CreateMenuItem(menu3
, QHFormat("DISABLE_FILTER", QHText("FILTER_"..string.upper(filter
))))
77 item3
:SetFunction(function (filter
) QuestHelper_Pref
["filter_"..filter
] = false end, filter
)
80 -- I'd add an option to adjust the level filter, but I can't tell what value would be required.
86 self
:CreateMenuItem(menu
, QHText("HIDDEN_NONE"))
90 function QuestHelper
:ShowHidden()
91 local menu
= self
:CreateMenu()
93 self
:CreateMenuTitle(menu
, QHText("HIDDEN_TITLE"))
94 self
:PopulateHidden(menu
)