Repository navigation
Expand file tree
/
Copy pathConditions.lua
More file actions
785 lines (732 loc) · 26.2 KB
/
Copy pathConditions.lua
File metadata and controls
785 lines (732 loc) · 26.2 KB
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
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
-- Context discovery and ordered rule matching for PETAL.
local ADDON_NAME, PRIVATE = ...
local _G = _G
local APS = _G.PETAL
if not APS then
APS = CreateFrame("Frame")
_G.PETAL = APS
end
PRIVATE = type(PRIVATE) == "table" and PRIVATE or (APS.NS or {})
APS.NS = PRIVATE
local R = APS._runtime or {}
APS._runtime = R
local function secret(value)
return APS.IsSecret and APS:IsSecret(value) or false
end
local function safeCall(object, method, ...)
if not object or type(object[method]) ~= "function" then
return false
end
local ok, a, b, c, d, e, f = pcall(object[method], ...)
if not ok then
return false
end
return true, a, b, c, d, e, f
end
local function safeString(value)
if value == nil or secret(value) then
return nil
end
return type(value) == "string" and value or nil
end
local function safeNumber(value)
if value == nil or secret(value) then
return nil
end
local number = tonumber(value)
return number and number == number and number or nil
end
local function safeBool(value)
return not secret(value) and value == true
end
local function lower(value)
value = safeString(value)
return value and string.lower(value) or nil
end
local function arrayContains(list, wanted)
if type(list) ~= "table" or secret(list) or secret(wanted) then
return false
end
if not secret(wanted) and safeBool(list[wanted]) then
return true
end
local wantedString = lower(wanted)
for _, value in ipairs(list) do
if not secret(value) then
if value == wanted then
return true
end
if wantedString and lower(value) == wantedString then
return true
end
end
end
return false
end
local function anyValueMatches(values, matcher)
if type(values) ~= "table" or secret(values) then
return matcher(values)
end
if #values > 0 then
for index = 1, #values do
if matcher(values[index]) then
return true
end
end
return false
end
for _, value in pairs(values) do
if value and matcher(value) then
return true
end
end
return false
end
local function contextAlias(key)
key = lower(key)
if not key then
return nil
end
local aliases = {
party = "dungeon",
instance = "dungeon",
instances = "dungeon",
dungeon = "dungeon",
raid = "raid",
raids = "raid",
solo = "solo",
openworld = "solo",
open_world = "solo",
adventure = "solo",
adventures = "solo",
outdoor = "solo",
city = "city",
capital = "city",
town = "city",
neighborhood = "neighborhood",
neighbourhood = "neighborhood",
housing = "neighborhood",
house = "neighborhood",
outfit = "outfit",
profile = "profile",
}
return aliases[key] or key
end
local function getMapInfo(mapID)
if not mapID or not _G.C_Map then
return nil
end
local ok, info = safeCall(_G.C_Map, "GetMapInfo", mapID)
if ok and type(info) == "table" and not secret(info) then
return info
end
return nil
end
local function getMapID()
if _G.C_Map and type(_G.C_Map.GetBestMapForUnit) == "function" then
local ok, mapID = pcall(_G.C_Map.GetBestMapForUnit, "player")
mapID = ok and safeNumber(mapID) or nil
if mapID then
return mapID
end
end
if type(_G.GetCurrentMapAreaID) == "function" then
local ok, mapID = pcall(_G.GetCurrentMapAreaID)
return ok and safeNumber(mapID) or nil
end
return nil
end
local function getInstanceInfo()
local inInstance, instanceType
if type(_G.IsInInstance) == "function" then
local ok, inside, kind = pcall(_G.IsInInstance)
if ok then
inInstance = safeBool(inside)
instanceType = safeString(kind)
end
end
local info = {}
if type(_G.GetInstanceInfo) == "function" then
local ok, name, kind, difficultyID, difficultyName, maxPlayers, dynamicDifficulty,
isDynamic, instanceID, instanceGroupSize = pcall(_G.GetInstanceInfo)
if ok then
info.name = safeString(name)
info.type = safeString(kind) or instanceType
info.difficultyID = safeNumber(difficultyID)
info.difficultyName = safeString(difficultyName)
info.maxPlayers = safeNumber(maxPlayers)
info.instanceID = safeNumber(instanceID)
info.groupSize = safeNumber(instanceGroupSize)
info.dynamicDifficulty = safeBool(dynamicDifficulty)
info.isDynamic = safeBool(isDynamic)
end
end
instanceType = info.type or instanceType or "none"
if inInstance == nil then
inInstance = instanceType ~= "none" and instanceType ~= ""
end
return inInstance == true, instanceType, info
end
local function getGroupState()
local inGroup = false
local raid = false
if type(_G.IsInRaid) == "function" then
local ok, result = pcall(_G.IsInRaid)
raid = ok and safeBool(result)
end
if type(_G.IsInGroup) == "function" then
local ok, result = pcall(_G.IsInGroup)
inGroup = ok and safeBool(result)
end
return inGroup, raid
end
local function getNeighborhoodState()
local inNeighborhood = false
local neighborhoodID, neighborhoodName
local housing = _G.C_Housing
if housing then
for _, method in ipairs({ "IsOnNeighborhoodMap", "IsInsideHouseOrPlot", "IsInsideHouse" }) do
local ok, result = safeCall(housing, method)
if ok and safeBool(result) then
inNeighborhood = true
break
end
end
if type(housing.GetCurrentNeighborhoodGUID) == "function" then
local ok, value = safeCall(housing, "GetCurrentNeighborhoodGUID")
if ok and not secret(value) and value ~= nil then
neighborhoodID = value
inNeighborhood = true
end
end
end
if inNeighborhood and _G.C_HousingNeighborhood then
local ok, value = safeCall(_G.C_HousingNeighborhood, "GetNeighborhoodName")
if ok then
neighborhoodName = safeString(value)
end
end
return inNeighborhood, neighborhoodID, neighborhoodName
end
local function mapIsCity(mapInfo)
if type(mapInfo) ~= "table" or secret(mapInfo) then
return false
end
if safeBool(mapInfo.isCity) then
return true
end
local mapType = mapInfo.mapType
if mapType == nil or secret(mapType) then
return false
end
local mapTypes = _G.Enum and _G.Enum.UIMapType
if type(mapTypes) == "table" then
for name, value in pairs(mapTypes) do
if type(name) == "string" and string.find(string.lower(name), "city", 1, true) and value == mapType then
return true
end
end
end
-- City was represented as a distinct map type on some Dragonflight and
-- Midnight clients. Use the numeric fallback only when Enum is absent.
if not mapTypes and type(mapType) == "number" and mapType == 5 then
return true
end
return false
end
local function getResting()
if type(_G.IsResting) ~= "function" then
return false
end
local ok, result = pcall(_G.IsResting)
return ok and safeBool(result)
end
local function getEquipmentOutfit()
local result = {}
local sets = _G.C_EquipmentSet
if sets and type(sets.GetEquipmentSetIDs) == "function" and type(sets.GetEquipmentSetInfo) == "function" then
local ok, IDs = safeCall(sets, "GetEquipmentSetIDs")
if ok and type(IDs) == "table" and not secret(IDs) then
for _, setID in ipairs(IDs) do
if not secret(setID) then
local infoOK, a, b, c, d, e, f = safeCall(sets, "GetEquipmentSetInfo", setID)
if infoOK then
local info
if type(a) == "table" and not secret(a) then
info = a
else
info = { name = safeString(a), icon = b, isEquipped = safeBool(c), id = d or setID }
end
local equipped = info and (safeBool(info.isEquipped) or safeBool(info.isActive) or safeBool(info.equipped))
if equipped then
result.name = safeString(info.name or info.setName or info.title)
result.id = safeNumber(info.id or info.setID) or safeNumber(setID)
break
end
end
end
end
end
end
-- Some Retail builds expose the active transmog set separately from
-- equipment sets. These calls are optional and intentionally guarded.
local transmog = _G.C_Transmog
if not result.id and transmog then
for _, method in ipairs({ "GetActiveOutfitID", "GetActiveTransmogSetID", "GetActiveSetID" }) do
local ok, value = safeCall(transmog, method)
value = ok and safeNumber(value) or nil
if value then
result.id = value
break
end
end
end
return result
end
local function getSpec()
local result = {}
if type(_G.GetSpecialization) == "function" then
local ok, index = pcall(_G.GetSpecialization)
index = ok and safeNumber(index) or nil
result.index = index
if index and type(_G.GetSpecializationInfo) == "function" then
local infoOK, id, name, description, icon, role, classFile = pcall(_G.GetSpecializationInfo, index)
if infoOK then
result.id = safeNumber(id)
result.name = safeString(name)
result.role = safeString(role)
result.classFile = safeString(classFile)
result.icon = icon
end
end
end
return result
end
local function matchScalar(actual, expected)
if secret(actual) or secret(expected) then
return false
end
if type(expected) == "table" then
if not secret(actual) and not secret(expected[actual]) and expected[actual] == true then
return true
end
for key, value in pairs(expected) do
if type(key) ~= "number" and safeBool(value) and not secret(key) and matchScalar(actual, key) then
return true
end
end
return anyValueMatches(expected, function(value)
return matchScalar(actual, value)
end)
end
if type(expected) == "boolean" then
return actual == expected
end
if type(expected) == "number" then
return safeNumber(actual) == expected
end
if type(expected) == "string" then
return lower(actual) == lower(expected)
end
return actual == expected
end
local function matchContextToken(context, token)
local key = contextAlias(token)
if not key then
return false
end
if key == "any" or key == "all" or key == "everywhere" or key == "default" then
return true
end
if key == "outfit" then
return context.outfit ~= nil or context.outfitID ~= nil
end
if key == "profile" then
return context.profile ~= nil or context.profileKey ~= nil
end
return context[key] == true
end
local function matchField(context, key, expected)
key = contextAlias(key) or lower(key)
if key == "any" or key == "all" or key == "everywhere" then
return true
end
if key == "dungeon" or key == "raid" or key == "solo" or key == "city" or key == "neighborhood" then
if type(expected) == "boolean" then
return context[key] == expected
end
return expected == nil and context[key] == true or matchScalar(context[key], expected)
end
if key == "outfit" then
if type(expected) == "table" and not secret(expected) then
if expected.id or expected.outfitID then
if matchScalar(context.outfitID, expected.id or expected.outfitID) then
return true
end
end
if expected.name or expected.key then
return matchScalar(context.outfit, expected.name or expected.key)
end
end
return matchScalar(context.outfit, expected) or matchScalar(context.outfitID, expected)
end
if key == "profile" or key == "profilekey" then
return matchScalar(context.profile, expected) or matchScalar(context.profileKey, expected)
end
if key == "map" or key == "mapid" or key == "mapids" then
return matchScalar(context.mapID, expected)
end
if key == "instance" or key == "instancetype" then
return matchScalar(context.instanceType, expected)
end
if key == "difficulty" or key == "difficultyid" then
return matchScalar(context.difficultyID, expected)
end
if key == "zone" or key == "zonename" then
return matchScalar(context.zoneName, expected)
end
if key == "groupsize" then
local wanted = safeNumber(expected)
if wanted then
return context.groupSize == wanted
end
end
if key == "ingroup" then
return context.inGroup == (expected == true)
end
local actual = context[key]
if actual == nil and type(context.profile) == "table" then
actual = context.profile[key]
end
return matchScalar(actual, expected)
end
local function matchMapConditions(context, conditions)
if type(conditions) ~= "table" or secret(conditions) then
return true
end
for key, expected in pairs(conditions) do
if not secret(key) and not secret(expected) and expected ~= nil then
if not matchField(context, key, expected) then
return false
end
end
end
return true
end
local function activeContextTag(context)
if type(context) ~= "table" or secret(context) then return "openworld" end
if safeBool(context.neighborhood) or safeBool(context.housing) then
return "neighborhood"
end
local instanceType = lower(context.instanceType) or "none"
if instanceType == "raid" then
return "raid"
end
if instanceType == "party" or instanceType == "scenario" then
return "dungeon"
end
if safeBool(context.city) or safeBool(context.isCity) then
return "city"
end
-- Outdoor parties and raid groups deliberately remain open world. Arena,
-- battleground, PvP, and unknown instance types use the Everywhere
-- fallback because they are not literally open-world zones.
if safeBool(context.inInstance) or (instanceType ~= "none" and instanceType ~= "") then
return nil
end
return "openworld"
end
function APS:BuildContext()
local overrides = R.contextOverrides or {}
local inInstance, instanceType, instance = getInstanceInfo()
local inGroup, inRaidGroup = getGroupState()
local mapID = getMapID()
local mapInfo = getMapInfo(mapID)
local inNeighborhood, neighborhoodID, neighborhoodName = getNeighborhoodState()
local resting = getResting()
local city = mapIsCity(mapInfo) or resting
local isRaid = instanceType == "raid"
local isDungeon = instanceType == "party" or instanceType == "scenario"
local solo = not inInstance
local outfit = getEquipmentOutfit()
local spec = getSpec()
local context = {
inInstance = inInstance,
instanceType = instanceType,
instanceName = instance.name,
instanceID = instance.instanceID,
difficultyID = instance.difficultyID,
difficultyName = instance.difficultyName,
groupSize = instance.groupSize,
inGroup = inGroup,
inRaidGroup = inRaidGroup,
raid = isRaid,
dungeon = isDungeon,
solo = solo,
city = city,
neighborhood = inNeighborhood,
housing = inNeighborhood,
resting = resting,
mapID = mapID,
mapName = mapInfo and safeString(mapInfo.name) or nil,
zoneName = nil,
minimapZoneName = nil,
neighborhoodID = neighborhoodID,
neighborhoodName = neighborhoodName,
outfit = outfit.name,
outfitID = outfit.id,
specID = spec.id,
specName = spec.name,
role = spec.role,
classFile = spec.classFile,
profile = nil,
profileKey = nil,
generatedAt = APS.Now and APS:Now() or 0,
}
if type(_G.GetZoneText) == "function" then
local ok, value = pcall(_G.GetZoneText)
if ok then context.zoneName = safeString(value) end
end
if type(_G.GetMinimapZoneText) == "function" then
local ok, value = pcall(_G.GetMinimapZoneText)
if ok then context.minimapZoneName = safeString(value) end
end
-- Explicit overrides are useful for wardrobe systems that do not expose a
-- stable active-set API and for the UI's preview mode. They never enter
-- SavedVariables automatically.
for key, value in pairs(overrides) do
if not secret(key) and not secret(value) then
context[key] = value
end
end
if context.profile == nil and context.profileKey ~= nil then
context.profile = context.profileKey
elseif context.profileKey == nil and context.profile ~= nil then
context.profileKey = context.profile
end
local tag = activeContextTag(context)
context.activeContextTag = tag
context.activeTag = tag
context.neighborhood = tag == "neighborhood"
context.housing = context.neighborhood
context.raid = tag == "raid"
context.dungeon = tag == "dungeon"
context.city = tag == "city"
context.solo = tag == "openworld"
context.openworld = context.solo
-- Profile rules can also target a spec without needing a separate profile
-- provider. Keep profile itself opt-in so a rule for "profile" does not
-- accidentally match every character.
context.isCity = context.city
context.isRaid = context.raid
context.isDungeon = context.dungeon
context.isSolo = context.solo
context.isNeighborhood = context.neighborhood
context.hasOutfit = context.outfit ~= nil or context.outfitID ~= nil
return context
end
function APS:GetActiveContextTag(context)
context = context or self:BuildContext()
return activeContextTag(context)
end
APS.GetActiveTag = APS.GetActiveContextTag
function APS:ContextSignature(context)
context = context or self:BuildContext()
local fields = {
context.mapID, context.instanceType, context.instanceID,
context.difficultyID, context.groupSize, context.inGroup,
context.raid, context.dungeon, context.solo, context.city,
context.neighborhood, context.neighborhoodID, context.activeContextTag, context.outfit,
context.outfitID, context.profile, context.profileKey,
}
local pieces = {}
for index, value in ipairs(fields) do
if not secret(value) and value ~= nil then
pieces[index] = tostring(value)
else
pieces[index] = "?"
end
end
return table.concat(pieces, "|")
end
function APS:RuleMatches(rule, context)
if type(rule) ~= "table" or (not secret(rule.enabled) and rule.enabled == false) then
return false
end
context = context or self:BuildContext()
local explicitContext = rule.context
if explicitContext ~= nil then
if type(explicitContext) == "table" then
local all = rule.contextMode == "all" or rule.matchMode == "all"
local matched = all
if #explicitContext > 0 then
if all then
for _, token in ipairs(explicitContext) do
if not matchContextToken(context, token) then matched = false break end
end
else
matched = false
for _, token in ipairs(explicitContext) do
if matchContextToken(context, token) then matched = true break end
end
end
else
matched = matchMapConditions(context, explicitContext)
end
if not matched then return false end
elseif not matchContextToken(context, explicitContext) then
return false
end
end
local contexts = rule.contexts
if type(contexts) == "string" then
if not matchContextToken(context, contexts) then return false end
elseif type(contexts) == "table" and not secret(contexts) then
local all = rule.contextMode == "all" or rule.matchMode == "all"
local sawToken = false
local matched = all
if safeBool(contexts.any) or safeBool(contexts.all) or safeBool(contexts.everywhere) then
matched = true
end
for key, value in pairs(contexts) do
if not secret(key) and not secret(value) and type(key) == "string" and value ~= nil then
sawToken = true
if value == false then
if matchContextToken(context, key) then return false end
elseif value == true then
if all then
if not matchContextToken(context, key) then matched = false end
elseif matchContextToken(context, key) then
matched = true
end
end
end
end
if #contexts > 0 then
sawToken = true
matched = all
if not all then matched = false end
for _, token in ipairs(contexts) do
if all then
if not matchContextToken(context, token) then matched = false break end
elseif matchContextToken(context, token) then
matched = true break
end
end
end
if sawToken and not matched then return false end
end
if rule.excludeContexts or rule.notContexts then
local excluded = rule.excludeContexts or rule.notContexts
if type(excluded) == "string" then
if matchContextToken(context, excluded) then return false end
elseif type(excluded) == "table" then
for key, value in pairs(excluded) do
local token = type(key) == "number" and value or (value and key)
if token and matchContextToken(context, token) then return false end
end
end
end
if not matchMapConditions(context, rule.conditions or rule.when) then
return false
end
if rule.mapIDs or rule.mapIds then
if not arrayContains(rule.mapIDs or rule.mapIds, context.mapID) then return false end
end
if rule.instanceTypes then
if not arrayContains(rule.instanceTypes, context.instanceType) then return false end
end
if rule.difficultyIDs or rule.difficulties then
if not arrayContains(rule.difficultyIDs or rule.difficulties, context.difficultyID) then return false end
end
if rule.outfits then
if not matchField(context, "outfit", rule.outfits) then return false end
end
if rule.outfit ~= nil and not matchField(context, "outfit", rule.outfit) then
return false
end
if rule.profiles then
if not matchField(context, "profile", rule.profiles) then return false end
end
if rule.profile ~= nil and not matchField(context, "profile", rule.profile) then
return false
end
local minimumGroup = safeNumber(rule.minGroupSize)
if minimumGroup and (context.groupSize or 0) < minimumGroup then return false end
local maximumGroup = safeNumber(rule.maxGroupSize)
if maximumGroup and (context.groupSize or 0) > maximumGroup then return false end
return true
end
function APS:GetOrderedRules()
local db = self:GetDB()
local rules = db.rules
local ordered = {}
if type(rules) ~= "table" then
return ordered
end
if safeBool(db.tagMode) then
local byID = {}
for _, rule in ipairs(rules) do
if type(rule) == "table" and not secret(rule) then
local id = lower(rule.id or rule.key)
if id then byID[id] = rule end
end
end
-- This is also the context precedence. Non-tag rules (including
-- outfit and old custom records) stay in SavedVariables but do not
-- participate while the streamlined tag workflow is active.
for _, id in ipairs({ "neighborhood", "raids", "dungeons", "cities", "solo", "everywhere" }) do
local rule = byID[id]
if rule and (secret(rule.enabled) or rule.enabled ~= false) then
ordered[#ordered + 1] = rule
end
end
return ordered
end
for index, rule in ipairs(rules) do
if type(rule) == "table" and (secret(rule.enabled) or rule.enabled ~= false) then
ordered[#ordered + 1] = { rule = rule, index = index }
end
end
table.sort(ordered, function(left, right)
local a = safeNumber(left.rule.priority) or 0
local b = safeNumber(right.rule.priority) or 0
if a ~= b then return a > b end
local ao = safeNumber(left.rule.order) or left.index
local bo = safeNumber(right.rule.order) or right.index
if ao ~= bo then return ao < bo end
return left.index < right.index
end)
local result = {}
for _, entry in ipairs(ordered) do
result[#result + 1] = entry.rule
end
return result
end
function APS:GetActiveRule(context)
context = context or self:BuildContext()
local ordered = self:GetOrderedRules()
for _, rule in ipairs(ordered) do
if self:RuleMatches(rule, context) then
return rule, context
end
end
return nil, context
end
function APS:GetContext()
local context = self:BuildContext()
R.lastContext = context
R.lastContextSignature = self:ContextSignature(context)
return context
end
APS.GetCurrentContext = APS.GetContext
function APS:GetLastContext()
return R.lastContext
end
function APS:InvalidateContext()
R.lastContext = nil
R.lastContextSignature = nil
if self.RequestEvaluation then
self:RequestEvaluation(0.15, "context invalidated")
end
end