1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 |
-- Sentinel category values applicable to any ZO_PrioritizedVisibility instance.
ZO_PRIORITIZED_VISIBILITY_CATEGORIES =
{
NONE = 0 ,
ALL = 2 ^ ( ZO_INTEGER_53_MAX_BITS - 1 ) , -- Highest order bit that can be combined with lower bits without an overflow condition.
}
end
-- Returns true if this object info is neither hidden by request nor a member of any of the specified suppressed categories.
return not ( self . requestedHidden or ZO_FlagHelpers . MasksShareAnyFlag ( self . categoryFlags , suppressedCategoriesMask ) )
end
-- Returns true if this object info has a higher priority than the specified object info.
end
end
end
end
end
-- Returns true if this object info has requested to be hidden.
end
-- Shows or hides the underlying object or control.
end
-- Sets or clears the request to hide flag.
end
end
end
-- 'object' can be a control or an object that implements a 'SetHidden' method.
-- Note that objects are immediately hidden when added.
-- Add all objects to the sentinel "All" category.
categoryFlags = ZO_FlagHelpers . SetMaskFlag ( categoryFlags or ZO_PRIORITIZED_VISIBILITY_CATEGORIES . NONE , ZO_PRIORITIZED_VISIBILITY_CATEGORIES . ALL )
self . registeredObjects [ object ] = PrioritizedVisibilityObjectInfo : New ( object , priority , categoryFlags , descriptor )
-- Create any suppressed category descriptor tables for this object's category
-- flag(s) that do not already exist.
end
end
end
-- Returns the object info associated with the specified object.
return objectInfo
end
-- Returns true if any of the specified category or categories is/are suppressed.
end
-- Returns true if the specified object is the highest priority object that has
-- requested to be shown and is not a member of any suppressed categories.
end
-- Returns true if the specified object is the highest priority object that has
-- requested to show and which is not a member of any suppressed categories.
return self . highestPriorityVisibleObject and object == self . highestPriorityVisibleObject : GetObject ( )
end
-- Sets or clears the specified category as suppressed.
-- Note that 'descriptor' should be a globally unique identifier of the system issuing the request.
return false
end
-- Add or remove descriptor for this suppressed category.
if suppressed then
else
end
-- Update the suppressed category mask.
self . suppressedCategoriesMask = ZO_FlagHelpers . SetMaskFlag ( self . suppressedCategoriesMask , categoryFlag )
else
self . suppressedCategoriesMask = ZO_FlagHelpers . ClearMaskFlag ( self . suppressedCategoriesMask , categoryFlag )
end
-- The suppressed categories changed; evaluate the new, highest priority visible object.
end
return true
end
-- Suppresses or unsuppresses the specified categories.
-- Note that 'descriptor' should be a globally unique identifier of the system issuing the request.
-- Iterate over all registered categories.
end
return true
end
-- If 'suppressed' is true, suppresses the specified categories and unsuppresses all other categories;
-- otherwise this unsuppresses the specified categories and suppresses all other categories.
-- Note that 'descriptor' should be a globally unique identifier of the system issuing the request.
-- Iterate over all registered categories.
local suppressCategory
if suppressed then
-- Suppress the category if specified in the mask; otherwise unsuppress the category.
else
-- Unsuppress the category if specified in the mask; otherwise suppress the category.
end
end
return true
end
-- Requests to show or hide the specified object or control.
-- Note that a request to show is granted once the object is
-- the highest priority object that requested to show and is
-- not a member of any suppressed category.
return
end
-- Update the requested hidden flag for this object.
-- Choose the new, highest priority, visible and unsuppressed object.
end
-- Rebuilds the prioritized objects array in order of highest to lowest priority.
end
end
-- New objects have been registered; update the prioritized object array.
end
-- Evaluate objects in order of highest to lowest priority
-- until an object that is valid for showing is found.
local highestPriorityVisibleObject = nil
-- This object has requested to show and is not a
-- member of any suppressed categories.
highestPriorityVisibleObject = objectInfo
break
end
end
local highestPriorityVisibleObjectChanged = self . highestPriorityVisibleObject ~= highestPriorityVisibleObject
if highestPriorityVisibleObjectChanged then
local newObjectInfo = highestPriorityVisibleObject
-- Hide the previously highest priority visible object.
end
-- Assign the new highest priority visible object.
-- Show the new highest priority visible object.
end
end
end |