forked from MapStudioProject/MapStudio.UI
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathImGuiOwnershipObject.cs
More file actions
60 lines (56 loc) · 1.74 KB
/
Copy pathImGuiOwnershipObject.cs
File metadata and controls
60 lines (56 loc) · 1.74 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
using System.Numerics;
using ImGuiNET;
namespace MapStudio.UI
{
public class ImGuiOwnershipObject : ImGuiObject
{
private Vector4 _ownershipColor = Vector4.Zero;
public Vector4 OwnershipColor
{
get
{
return _ownershipColor;
}
set
{
_ownershipColor = value;
if (_ownershipColor != Vector4.Zero)
{
// Show that this owns something
OverrideColors[ImGuiCol.TitleBg] = _ownershipColor;
OverrideColors[ImGuiCol.TabUnfocusedActive] = _ownershipColor;
OverrideColors[ImGuiCol.TabActive] = _ownershipColor;
OverrideColors[ImGuiCol.TabHovered] = _ownershipColor;
}
else
{
OverrideColors.Remove(ImGuiCol.TitleBg);
OverrideColors.Remove(ImGuiCol.TabUnfocusedActive);
OverrideColors.Remove(ImGuiCol.TabActive);
OverrideColors.Remove(ImGuiCol.TabHovered);
}
}
}
private ImGuiOwnershipObject _owner;
public ImGuiOwnershipObject Owner
{
get
{
return _owner;
}
set
{
_owner = value;
if (_owner != null)
{
// Show that this is owned by something
OverrideColors[ImGuiCol.TitleBgActive] = _owner.OwnershipColor;
}
else
{
OverrideColors.Remove(ImGuiCol.TitleBgActive);
}
}
}
}
}