forked from chickensoft-games/GodotTestDriver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
RichTextLabelDriver.cs
48 lines (43 loc) · 1.47 KB
/
RichTextLabelDriver.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
namespace Chickensoft.GodotTestDriver.Drivers;
using System;
using Godot;
using JetBrains.Annotations;
/// <summary>
/// Driver for the <see cref="RichTextLabel"/> control.
/// </summary>
/// <typeparam name="T">RichTextLabel type.</typeparam>
[PublicAPI]
public class RichTextLabelDriver<T> : ControlDriver<T> where T : RichTextLabel
{
/// <summary>
/// Creates a new generic RichTextLabelDriver.
/// </summary>
/// <param name="producer">Producer that creates a RichTextLabel subclass.</param>
/// <param name="description">Driver description.</param>
public RichTextLabelDriver(Func<T> producer, string description = "") : base(producer, description)
{
}
/// <summary>
/// The current text of the label.
/// </summary>
public string Text => PresentRoot.Text;
/// <summary>
/// Returns true if the label has bbcode enabled.
/// </summary>
public bool IsBbcodeEnabled => PresentRoot.BbcodeEnabled;
}
/// <summary>
/// Driver for the <see cref="RichTextLabel"/> control.
/// </summary>
[PublicAPI]
public sealed class RichTextLabelDriver : RichTextLabelDriver<RichTextLabel>
{
/// <summary>
/// Creates a new RichTextLabelDriver.
/// </summary>
/// <param name="producer">Producer that creates a RichTextLabel subclass.</param>
/// <param name="description">Driver description.</param>
public RichTextLabelDriver(Func<RichTextLabel> producer, string description = "") : base(producer, description)
{
}
}