forked from FelipeRenault/gamechanger
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsettings_schema.py
More file actions
150 lines (150 loc) · 6.51 KB
/
Copy pathsettings_schema.py
File metadata and controls
150 lines (150 loc) · 6.51 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
# CONFIG_SCHEMA describes the editor UI only: labels, layout, widget types,
# and conditions. It intentionally does not contain default values.
# CONFIG_DEFAULTS in config_manager.py is the single source of defaults.
CONFIG_SCHEMA = [
{
"section": "players",
"label": "Players",
"type": "player_list",
"item_fields": [
{"type": "text", "label": "Name", "key": "name"},
{"type": "number", "label": "Starting score", "key": "starting_score"},
{"type": "number", "label": "Starting slide", "key": "starting_slide"},
{"type": "checkbox", "label": "Can win", "key": "can_win"},
],
},
{
"section": "slides",
"label": "Slides",
"type": "slide_list",
"fields": [
{
"type": "group",
"group_label": "### Slide buttons",
"group_key": "buttons",
"fields": [
{"type": "checkbox", "label": "Slide buttons", "key": "slide"},
{"type": "checkbox", "label": "Settings button", "key": "settings"},
],
},
{
"type": "group",
"group_label": "### Slide shortcuts",
"group_key": "shortcuts",
"description": (
"The keys \"C\" and \"R\" are reserved and can't be used, even with modifiers. "
"Punctuation keys like \".\" and \",\" aren't currently supported. "
"[Documentation](https://docs.streamlit.io/develop/api-reference/widgets/st.button) (parameter `shortcut`)."
),
"fields": [
{"type": "text", "label": "Previous slide key", "key": "slide_previous"},
{"type": "text", "label": "Next slide key", "key": "slide_next"},
{"type": "text", "label": "Open settings key", "key": "settings"},
],
},
{
"type": "group",
"group_label": "### Slide sounds",
"group_key": "sounds",
"fields": [
{"type": "checkbox", "label": "Slide sound", "key": "slide"},
],
},
],
},
{
"section": "scoreboard",
"label": "Scoreboard",
"type": "section",
"fields": [
{"type": "checkbox", "label": "Show scoreboard", "key": "enabled"},
{
"type": "group",
"group_label": "### Scoreboard buttons",
"group_key": "buttons",
"condition": lambda values: values.get("enabled", False),
"fields": [
{"type": "checkbox", "label": "Points buttons", "key": "points"},
],
},
{
"type": "group",
"group_label": "### Scoreboard sounds",
"group_key": "sounds",
"condition": lambda values: values.get("enabled", False),
"layout": "columns",
"columns": [
[
{"type": "checkbox", "label": "Gain points sound", "key": "gain_points"},
{
"type": "number",
"label": "Gain sound delay (seconds)",
"key": "gain_points_delay_seconds",
"step": 0.1,
"condition": lambda values: values.get("gain_points", True),
},
],
[
{"type": "checkbox", "label": "Lose points sound", "key": "lose_points"},
{
"type": "number",
"label": "Lose sound delay (seconds)",
"key": "lose_points_delay_seconds",
"step": 0.1,
"condition": lambda values: values.get("lose_points", True),
},
],
],
},
{
"type": "group",
"group_label": "### Scoreboard shortcuts",
"group_key": "shortcuts",
"condition": lambda values: values.get("enabled", False),
"description": (
"Point shortcuts are assigned by player order. Press a number key "
"such as 1, 2, 3, and so on to add one point to that player. "
"Press Shift+number, such as Shift+1 or Shift+2, to remove one point. \n"
"Change the Points Modifier key to use a modifier other than Shift. "
"Allowed modifiers: Alt, Ctrl, Cmd, Meta, Mod, Option, Shift. "
"[Documentation](https://docs.streamlit.io/develop/api-reference/widgets/st.button) (parameter `shortcut`). \n"
"Enable Invert point shortcuts to reverse that behavior, making the "
"number key remove points and modifier+number add points instead."
),
"fields": [
{"type": "text", "label": "Points Modifier key", "key": "points_modifier"},
{"type": "checkbox", "label": "Invert point shortcuts modifier", "key": "points_inverted"},
],
},
],
},
{
"section": "winner",
"label": "Winner Screen",
"type": "section",
"fields": [
{"type": "checkbox", "label": "Enable winner screen", "key": "enabled"},
{
"type": "group",
"group_label": "### Single winner",
"group_key": "single",
"condition": lambda values: values.get("enabled", False),
"fields": [
{"type": "text", "label": "Title", "key": "title"},
{"type": "text", "label": "Score text", "key": "score_text"},
],
},
{
"type": "group",
"group_label": "### Multiple winners (Tie)",
"group_key": "multiple",
"condition": lambda values: values.get("enabled", False),
"fields": [
{"type": "text", "label": "Title", "key": "title"},
{"type": "text", "label": "Separator", "key": "separator"},
{"type": "text", "label": "Score text", "key": "score_text"},
],
},
],
},
]