Skip to content

Commit 6b6aa5b

Browse files
Merge pull request #12 from CSGALS/focus-extension
Add IFocusMenuExtension extension
2 parents e5381ed + bf4f13d commit 6b6aa5b

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
namespace CSSUniversalMenuAPI.Extensions;
2+
3+
/// <summary>
4+
/// Allow a menu or a notification to be presented to a player, but without taking focus from the player. <br/>
5+
/// This should be used when you want to present a menu to a player who may not be expecting it, such as votes.
6+
/// </summary>
7+
public interface IFocusMenuExtension
8+
{
9+
/// <summary>
10+
/// When <c>true</c>, the menu shall open in a state where the player can see it, or see a notification,
11+
/// but require further action to be manipulate. It is expected that this would be a key that requires pressing
12+
/// to toggle the menu.<br/>
13+
///<br/>
14+
/// Implementations should default this value to <c>true</c>.
15+
/// </summary>
16+
bool OpenWithFocus { get; set; }
17+
18+
/// <summary>
19+
/// Returns whether or not the player's input is to be received by this menu if it were visible. <br/>
20+
/// Whether the menu is being occluded by another menu should have no bearing on this value.
21+
/// </summary>
22+
bool HasFocus { get; }
23+
24+
/// <summary>
25+
/// Returns whether or not this menu's input has never been focused, enabling scenarios such as timing out a menu if
26+
/// it has received no interaction from the player.
27+
/// </summary>
28+
bool NeverHadFocus { get; }
29+
}

0 commit comments

Comments
 (0)