CrabUI
Loading...
Searching...
No Matches
Other Props.cs
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Reflection;
5using System.Diagnostics;
6using System.Runtime.CompilerServices;
7using System.IO;
8
9using Barotrauma;
10using Microsoft.Xna.Framework;
11using Microsoft.Xna.Framework.Input;
12using Microsoft.Xna.Framework.Graphics;
13
14using System.Xml;
15using System.Xml.Linq;
16
17namespace CrabUI
18{
19 public partial class CUIComponent
20 {
21 //HACK This is potentially cursed
22 /// <summary>
23 /// Arbitrary data
24 /// </summary>
25 public object Data { get; set; }
26 protected bool disabled;
27 /// <summary>
28 /// Usually means - non interactable, e.g. unclickable gray button
29 /// </summary>
30 [CUISerializable]
31 public virtual bool Disabled
32 {
33 get => disabled;
34 set => disabled = value;
35 }
36 /// <summary>
37 /// Some props (like visible) are autopassed to all new childs
38 /// see PassPropsToChild
39 /// </summary>
40 [CUISerializable] public bool ShouldPassPropsToChildren { get; set; } = true;
41 /// <summary>
42 /// Don't inherit parent Visibility
43 /// </summary>
44 [CUISerializable] public bool IgnoreParentVisibility { get; set; }
45 /// <summary>
46 /// Don't inherit parent IgnoreEvents
47 /// </summary>
48 [CUISerializable] public bool IgnoreParentEventIgnorance { get; set; }
49 /// <summary>
50 /// Don't inherit parent ZIndex
51 /// </summary>
52 [CUISerializable] public bool IgnoreParentZIndex { get; set; }
53 [CUISerializable] public bool IgnoreParentTransparency { get; set; }
54
55 /// <summary>
56 /// Invisible components are not drawn, but still can be interacted with
57 /// </summary>
58 [CUISerializable]
59 public bool Visible
60 {
61 get => CUIProps.Visible.Value;
62 set => CUIProps.Visible.SetValue(value);
63 }
64 /// <summary>
65 /// Won't react to mouse events
66 /// </summary>
67 [CUISerializable]
68 public bool IgnoreEvents
69 {
70 get => CUIProps.IgnoreEvents.Value;
71 set => CUIProps.IgnoreEvents.SetValue(value);
72 }
73
74 /// <summary>
75 /// Visible + !IgnoreEvents
76 /// </summary>
77 public bool Revealed
78 {
79 get => CUIProps.Revealed.Value;
80 set => CUIProps.Revealed.SetValue(value);
81 }
82 }
83}
bool IgnoreParentEventIgnorance
Don't inherit parent IgnoreEvents.
virtual bool Disabled
Usually means - non interactable, e.g. unclickable gray button.
bool Revealed
Visible + !IgnoreEvents.
CUIComponentProps CUIProps
Just a wrapper for CUIProps idk how to separate them better.
Definition CUIProps.cs:27
bool IgnoreParentZIndex
Don't inherit parent ZIndex.
bool IgnoreParentVisibility
Don't inherit parent Visibility.
object Data
Arbitrary data.
bool Visible
Invisible components are not drawn, but still can be interacted with.
bool IgnoreEvents
Won't react to mouse events.
bool ShouldPassPropsToChildren
Some props (like visible) are autopassed to all new childs see PassPropsToChild.