-
Notifications
You must be signed in to change notification settings - Fork 11
/
ConditionEvaluator.cs
57 lines (42 loc) · 1.97 KB
/
ConditionEvaluator.cs
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
using Dalamud.Game.ClientState.Conditions;
using DeathRecap.UI;
namespace DeathRecap;
public class ConditionEvaluator(DeathRecapPlugin plugin) {
private static bool LookupPartyMember(uint actorId) {
for (var i = 0; i < 8; i++)
if (Service.PartyList[i]?.ObjectId is { } id)
if (actorId == id)
return true;
return false;
}
public bool ShouldCapture(uint actorId) {
if (plugin.Configuration.Others.Capture)
return true;
if (plugin.Configuration.Self.Capture && actorId == Service.ObjectTable[0]?.GameObjectId)
return true;
if (plugin.Configuration.Party.Capture && LookupPartyMember(actorId))
return true;
return false;
}
public NotificationStyle GetNotificationType(uint actorId) {
if (actorId == Service.ObjectTable[0]?.GameObjectId) {
if (plugin.Configuration.Self.OnlyInstances && !Service.Condition[ConditionFlag.BoundByDuty])
return NotificationStyle.None;
if (plugin.Configuration.Self.DisableInPvp && Service.ClientState.IsPvP)
return NotificationStyle.None;
return plugin.Configuration.Self.NotificationStyle;
}
if (LookupPartyMember(actorId)) {
if (plugin.Configuration.Party.OnlyInstances && !Service.Condition[ConditionFlag.BoundByDuty])
return NotificationStyle.None;
if (plugin.Configuration.Party.DisableInPvp && Service.ClientState.IsPvP)
return NotificationStyle.None;
return plugin.Configuration.Party.NotificationStyle;
}
if (plugin.Configuration.Others.OnlyInstances && !Service.Condition[ConditionFlag.BoundByDuty])
return NotificationStyle.None;
if (plugin.Configuration.Others.DisableInPvp && Service.ClientState.IsPvP)
return NotificationStyle.None;
return plugin.Configuration.Others.NotificationStyle;
}
}