-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Expand file tree
/
Copy pathCommandsList.js
More file actions
388 lines (371 loc) · 9.47 KB
/
CommandsList.js
File metadata and controls
388 lines (371 loc) · 9.47 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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
// @flow
import { t } from '@lingui/macro';
import { type MessageDescriptor } from '../Utils/i18n/MessageDescriptor.flow';
export type CommandName =
| 'QUIT_APP'
| 'OPEN_PROJECT_MANAGER'
| 'LAUNCH_NEW_PREVIEW'
| 'LAUNCH_DEBUG_PREVIEW'
| 'LAUNCH_NETWORK_PREVIEW'
| 'HOT_RELOAD_PREVIEW'
| 'LAUNCH_PREVIEW_WITH_DIAGNOSTIC_REPORT'
| 'OPEN_DIAGNOSTIC_REPORT'
| 'OPEN_HOME_PAGE'
| 'CREATE_NEW_PROJECT'
| 'OPEN_PROJECT'
| 'SAVE_PROJECT'
| 'SAVE_PROJECT_AS'
| 'CLOSE_PROJECT'
| 'EXPORT_GAME'
| 'INVITE_COLLABORATORS'
| 'OPEN_RECENT_PROJECT'
| 'OPEN_COMMAND_PALETTE'
| 'RESTART_IN_GAME_EDITOR'
| 'OPEN_PROJECT_PROPERTIES'
| 'OPEN_PROJECT_LOADING_SCREEN'
| 'OPEN_PROJECT_VARIABLES'
| 'OPEN_PLATFORM_SPECIFIC_ASSETS_DIALOG'
| 'OPEN_PROJECT_RESOURCES'
| 'OPEN_SEARCH_EXTENSIONS_DIALOG'
| 'OPEN_GLOBAL_SEARCH'
| 'OPEN_LAYOUT'
| 'OPEN_EXTERNAL_EVENTS'
| 'OPEN_EXTERNAL_LAYOUT'
| 'OPEN_EXTENSION'
| 'OPEN_SCENE_PROPERTIES'
| 'OPEN_SCENE_VARIABLES'
| 'OPEN_OBJECTS_PANEL'
| 'OPEN_OBJECT_GROUPS_PANEL'
| 'OPEN_PROPERTIES_PANEL'
| 'TOGGLE_INSTANCES_PANEL'
| 'TOGGLE_LAYERS_PANEL'
| 'SCENE_EDITOR_UNDO'
| 'SCENE_EDITOR_REDO'
| 'DELETE_INSTANCES'
| 'TOGGLE_WINDOW_MASK'
| 'TOGGLE_GRID'
| 'OPEN_SETUP_GRID'
| 'EDIT_LAYER_EFFECTS'
| 'EDIT_LAYER'
| 'EDIT_OBJECT'
| 'EDIT_OBJECT_BEHAVIORS'
| 'EDIT_OBJECT_EFFECTS'
| 'EDIT_OBJECT_VARIABLES'
| 'EDIT_OBJECT_GROUP'
| 'ADD_STANDARD_EVENT'
| 'ADD_SUBEVENT'
| 'ADD_LOCAL_VARIABLE'
| 'ADD_COMMENT_EVENT'
| 'TOGGLE_EVENT_DISABLED'
| 'TOGGLE_CONDITION_INVERTED'
| 'CHOOSE_AND_ADD_EVENT'
| 'MOVE_EVENTS_IN_NEW_GROUP'
| 'EVENTS_EDITOR_UNDO'
| 'EVENTS_EDITOR_REDO'
| 'DELETE_SELECTION'
| 'SEARCH_EVENTS'
| 'OPEN_EXTENSION_SETTINGS'
| 'OPEN_PROFILE'
| 'OPEN_PREFERENCES'
| 'OPEN_ABOUT'
| 'OPEN_LANGUAGE'
| 'OPEN_VERSION_HISTORY'
| 'OPEN_DEBUGGER'
| 'OPEN_MEMORY_TRACKER_REGISTRY';
export const commandAreas = {
GENERAL: (t`General`: any),
IDE: (t`IDE`: any),
PROJECT: (t`Project`: any),
SCENE: (t`Scene`: any),
EVENTS: (t`Events`: any),
};
type CommandArea = $Keys<typeof commandAreas>;
type CommandMetadata = {|
area: CommandArea,
displayText: MessageDescriptor,
noShortcut?: boolean, // If true, command won't show up in shortcuts list
ghost?: boolean, // If true, command won't show up in palette
handledByElectron?: boolean, // If true, command shortcut is handled by Electron in desktop app
|};
const commandsList: { [CommandName]: CommandMetadata } = {
// General commands
QUIT_APP: {
area: 'GENERAL',
displayText: t`Close GDevelop`,
handledByElectron: true,
},
OPEN_PROJECT_MANAGER: {
area: 'IDE',
displayText: t`Open project manager`,
handledByElectron: true,
},
OPEN_PROFILE: {
area: 'IDE',
displayText: t`Open My Profile`,
},
LAUNCH_NEW_PREVIEW: { area: 'PROJECT', displayText: t`Launch new preview` },
LAUNCH_DEBUG_PREVIEW: {
area: 'PROJECT',
displayText: t`Launch preview with debugger and profiler`,
},
LAUNCH_NETWORK_PREVIEW: {
area: 'PROJECT',
displayText: t`Launch network preview over WiFi/LAN`,
},
HOT_RELOAD_PREVIEW: {
area: 'PROJECT',
displayText: t`Apply changes to the running preview`,
},
LAUNCH_PREVIEW_WITH_DIAGNOSTIC_REPORT: {
area: 'PROJECT',
displayText: t`Launch preview with diagnostic report`,
},
OPEN_DIAGNOSTIC_REPORT: {
area: 'PROJECT',
displayText: t`Show diagnostic report`,
},
OPEN_HOME_PAGE: { area: 'IDE', displayText: t`Show Home` },
CREATE_NEW_PROJECT: {
area: 'GENERAL',
displayText: t`Create a new project`,
handledByElectron: true,
},
OPEN_PROJECT: {
area: 'GENERAL',
displayText: t`Open project`,
handledByElectron: true,
},
SAVE_PROJECT: {
area: 'GENERAL',
displayText: t`Save project`,
handledByElectron: true,
},
SAVE_PROJECT_AS: {
area: 'GENERAL',
displayText: t`Save project as...`,
handledByElectron: true,
},
CLOSE_PROJECT: {
area: 'GENERAL',
displayText: t`Close project`,
handledByElectron: true,
},
EXPORT_GAME: {
area: 'PROJECT',
displayText: t`Export game`,
handledByElectron: true,
},
INVITE_COLLABORATORS: {
area: 'PROJECT',
displayText: t`Invite collaborators`,
handledByElectron: true,
},
OPEN_RECENT_PROJECT: {
area: 'GENERAL',
displayText: t`Open recent project...`,
},
OPEN_COMMAND_PALETTE: {
area: 'IDE',
displayText: t`Open command palette`,
ghost: true,
},
RESTART_IN_GAME_EDITOR: {
area: 'IDE',
displayText: t`Restart 3D editor`,
},
// Project manager commands
OPEN_PROJECT_PROPERTIES: {
area: 'PROJECT',
displayText: t`Open project properties`,
},
OPEN_PROJECT_LOADING_SCREEN: {
area: 'PROJECT',
displayText: t`Edit loading screen`,
},
OPEN_PROJECT_VARIABLES: {
area: 'PROJECT',
displayText: t`Edit global variables`,
},
OPEN_PLATFORM_SPECIFIC_ASSETS_DIALOG: {
area: 'PROJECT',
displayText: t`Open project icons`,
},
OPEN_PROJECT_RESOURCES: {
area: 'PROJECT',
displayText: t`Open project resources`,
},
OPEN_SEARCH_EXTENSIONS_DIALOG: {
area: 'PROJECT',
displayText: t`Search/import extensions`,
},
OPEN_GLOBAL_SEARCH: {
area: 'IDE',
displayText: t`Global search (search in project)`,
},
// Tab-opening commands
OPEN_LAYOUT: { area: 'IDE', displayText: t`Open scene...` },
OPEN_EXTERNAL_EVENTS: {
area: 'IDE',
displayText: t`Open external events...`,
},
OPEN_EXTERNAL_LAYOUT: {
area: 'IDE',
displayText: t`Open external layout...`,
},
OPEN_EXTENSION: { area: 'IDE', displayText: t`Open extension...` },
// Scene editor commands
OPEN_SCENE_PROPERTIES: {
area: 'SCENE',
displayText: t`Open scene properties`,
},
OPEN_SCENE_VARIABLES: {
area: 'SCENE',
displayText: t`Open scene variables`,
},
// Scene editor toolbar commands
OPEN_OBJECTS_PANEL: {
area: 'SCENE',
displayText: t`Toggle Objects Panel`,
},
OPEN_OBJECT_GROUPS_PANEL: {
area: 'SCENE',
displayText: t`Toggle Object Groups Panel`,
},
OPEN_PROPERTIES_PANEL: {
area: 'SCENE',
displayText: t`Toggle Properties Panel`,
},
TOGGLE_INSTANCES_PANEL: {
area: 'SCENE',
displayText: t`Toggle Instances List Panel`,
},
TOGGLE_LAYERS_PANEL: {
area: 'SCENE',
displayText: t`Toggle Layers Panel`,
},
SCENE_EDITOR_UNDO: {
area: 'SCENE',
displayText: t`Undo the last changes`,
noShortcut: true,
},
SCENE_EDITOR_REDO: {
area: 'SCENE',
displayText: t`Redo the last changes`,
noShortcut: true,
},
DELETE_INSTANCES: {
area: 'SCENE',
displayText: t`Delete the selected instances from the scene`,
noShortcut: true,
},
TOGGLE_WINDOW_MASK: { area: 'SCENE', displayText: t`Toggle mask` },
TOGGLE_GRID: { area: 'SCENE', displayText: t`Toggle grid` },
OPEN_SETUP_GRID: { area: 'SCENE', displayText: t`Setup grid` },
// Layers list commands
EDIT_LAYER_EFFECTS: {
area: 'SCENE',
displayText: t`Edit layer effects...`,
},
EDIT_LAYER: {
area: 'SCENE',
displayText: t`Edit layer...`,
},
// Objects list commands
EDIT_OBJECT: { area: 'SCENE', displayText: t`Edit object...` },
EDIT_OBJECT_BEHAVIORS: {
area: 'SCENE',
displayText: t`Edit object behaviors...`,
},
EDIT_OBJECT_EFFECTS: {
area: 'SCENE',
displayText: t`Edit object effects...`,
},
EDIT_OBJECT_VARIABLES: {
area: 'SCENE',
displayText: t`Edit object variables...`,
},
// Object groups list commands
EDIT_OBJECT_GROUP: { area: 'SCENE', displayText: t`Edit object group...` },
// Events editor toolbar commands
ADD_STANDARD_EVENT: {
area: 'EVENTS',
displayText: t`Add a new empty event`,
},
ADD_SUBEVENT: {
area: 'EVENTS',
displayText: t`Add a sub-event to the selected event`,
},
ADD_LOCAL_VARIABLE: {
area: 'EVENTS',
displayText: t`Add a local variable to the selected event`,
},
ADD_COMMENT_EVENT: { area: 'EVENTS', displayText: t`Add a comment` },
TOGGLE_EVENT_DISABLED: {
area: 'EVENTS',
displayText: t`Toggle disabled event`,
},
TOGGLE_CONDITION_INVERTED: {
area: 'EVENTS',
displayText: t`Toggle inverted condition`,
},
CHOOSE_AND_ADD_EVENT: {
area: 'EVENTS',
displayText: t`Choose and add an event...`,
},
MOVE_EVENTS_IN_NEW_GROUP: {
area: 'EVENTS',
displayText: t`Move events into a new group`,
},
EVENTS_EDITOR_UNDO: {
area: 'EVENTS',
displayText: t`Undo the last changes`,
noShortcut: true,
},
EVENTS_EDITOR_REDO: {
area: 'EVENTS',
displayText: t`Redo the last changes`,
noShortcut: true,
},
DELETE_SELECTION: {
area: 'EVENTS',
displayText: t`Delete the selected event(s)`,
noShortcut: true,
},
SEARCH_EVENTS: {
area: 'EVENTS',
displayText: t`Search in events`,
noShortcut: true,
},
OPEN_EXTENSION_SETTINGS: {
area: 'EVENTS',
displayText: t`Open extension settings`,
},
// IDE commands
OPEN_PREFERENCES: {
area: 'IDE',
displayText: t`Open preferences`,
},
OPEN_ABOUT: {
area: 'IDE',
displayText: t`Open "About GDevelop" (version)`,
},
OPEN_LANGUAGE: {
area: 'IDE',
displayText: t`Change language`,
},
// Project commands
OPEN_VERSION_HISTORY: {
area: 'PROJECT',
displayText: t`Open version history`,
},
OPEN_DEBUGGER: {
area: 'PROJECT',
displayText: t`Open debugger`,
},
// Debug commands
OPEN_MEMORY_TRACKER_REGISTRY: {
area: 'IDE',
displayText: t`Open memory tracker registry`,
},
};
export default commandsList;