|
1 | 1 | export interface Layout {
|
| 2 | + /** |
| 3 | + * Layout configurations for the app window. |
| 4 | + * For example, where the app is displayed on the monitor. |
| 5 | + */ |
2 | 6 | window: WindowLayout;
|
3 |
| - streams: Array<StreamLayout>; |
| 7 | + /** |
| 8 | + * Layout configurations for each game stream window. |
| 9 | + * For example, where and how the "main" or "room" streams are displayed. |
| 10 | + */ |
| 11 | + items: Array<ItemLayout>; |
4 | 12 | }
|
5 | 13 |
|
6 | 14 | /**
|
7 | 15 | * Layout configuration for the app window.
|
| 16 | + * Coordinates are relative to the monitor screen. |
8 | 17 | */
|
9 | 18 | export interface WindowLayout {
|
| 19 | + /** |
| 20 | + * The x-coordinate of the app, in pixels. |
| 21 | + * This is the leftmost edge of the app. |
| 22 | + * This is the absolute position on the monitor screen. |
| 23 | + */ |
10 | 24 | x: number;
|
| 25 | + /** |
| 26 | + * The y-coordinate of the app, in pixels. |
| 27 | + * This is the topmost edge of the app. |
| 28 | + * This is the absolute position on the monitor screen. |
| 29 | + */ |
11 | 30 | y: number;
|
| 31 | + /** |
| 32 | + * The width of the app, in pixels. |
| 33 | + */ |
12 | 34 | width: number;
|
| 35 | + /** |
| 36 | + * The height of the app, in pixels. |
| 37 | + */ |
13 | 38 | height: number;
|
14 | 39 | }
|
15 | 40 |
|
16 | 41 | /**
|
17 | 42 | * Layout configuration for a game stream.
|
| 43 | + * Coordinates are relative to the grid item container. |
18 | 44 | */
|
19 |
| -export interface StreamLayout { |
| 45 | +export interface ItemLayout { |
20 | 46 | /**
|
21 | 47 | * Game-specific identifier for the stream.
|
22 | 48 | * For example, "percWindow" for the active spells stream.
|
| 49 | + * For the main catch-all stream, use "main" instead of empty string. |
23 | 50 | */
|
24 | 51 | id: string;
|
25 | 52 | /**
|
26 | 53 | * Title to display for the stream in the app.
|
| 54 | + * For example, "Active Spells" or "Inventory". |
27 | 55 | */
|
28 | 56 | title: string;
|
29 | 57 | /**
|
30 | 58 | * Whether the stream is displayed in the app.
|
31 | 59 | * When false then this stream's content can be redirected to
|
32 |
| - * another stream window using the `whenHiddenStreamToId` property. |
| 60 | + * another stream window using the `whenHiddenRedirectToId` property. |
33 | 61 | */
|
34 | 62 | visible: boolean;
|
35 | 63 | /**
|
@@ -59,31 +87,36 @@ export interface StreamLayout {
|
59 | 87 | textFont: string;
|
60 | 88 | /**
|
61 | 89 | * The font size to use for the stream content, in pixels.
|
| 90 | + * Example: 12. |
62 | 91 | */
|
63 | 92 | textSize: number;
|
64 | 93 | /**
|
65 | 94 | * The color of the text in the stream content.
|
| 95 | + * Can be color names (e.g. 'blue') or hex codes ('#00FF00'). |
66 | 96 | */
|
67 | 97 | foregroundColor: string;
|
68 | 98 | /**
|
69 | 99 | * The color of the background in the stream content.
|
| 100 | + * Can be color names (e.g. 'blue') or hex codes ('#00FF00'). |
70 | 101 | */
|
71 | 102 | backgroundColor: string;
|
72 | 103 | /**
|
73 | 104 | * When this stream is not visible, redirect its content to another stream.
|
74 | 105 | * If that stream is also not visible, then it continues to be redirected
|
75 | 106 | * until either a visible stream in the chain is found or not.
|
76 | 107 | *
|
77 |
| - * Example Scenario |
78 |
| - * ---------------- |
79 |
| - * When StreamA is hidden it redirects to StreamB. |
80 |
| - * When StreamB is hidden it redirects to STreamC. |
81 |
| - * When StreamC is hidden it does not redirect anywhere. |
| 108 | + * Example Scenarios |
| 109 | + * ----------------- |
| 110 | + * Given the following configuration: |
| 111 | + * - When StreamA is hidden it redirects to StreamB. |
| 112 | + * - When StreamB is hidden it redirects to StreamC. |
| 113 | + * - When StreamC is hidden it does not redirect anywhere. |
82 | 114 | *
|
83 |
| - * When all streams are visible then their content is displayed as normal. |
84 |
| - * When StreamA is hidden, its content is redirected to StreamB. |
85 |
| - * When StreamB is also hidden, both StreamA and StreamB redirect to StreamC. |
86 |
| - * When StreamC is also hidden, no content is displayed. |
| 115 | + * Then: |
| 116 | + * - When all streams are visible, their content is displayed as normal. |
| 117 | + * - When StreamA is hidden, its content is redirected to StreamB. |
| 118 | + * - When StreamB is also hidden, both StreamA and StreamB redirect to StreamC. |
| 119 | + * - When StreamC is also hidden, no content is displayed. |
87 | 120 | */
|
88 |
| - whenHiddenStreamToId?: string; |
| 121 | + whenHiddenRedirectToId?: string | null; |
89 | 122 | }
|
0 commit comments