Skip to content

Commit 84d2c61

Browse files
committed
Add buttons to close the editor.
1 parent 3a14f27 commit 84d2c61

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

src/editor/src/editor.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,11 +159,14 @@ editor_on_keyboard_button_pressed(
159159
void
160160
editor_on_keyboard_button_released(
161161
void* game_instance, struct te_game_manager* game_manager, enum te_keyboard_button button, te_keyboard_modifiers modifiers) {
162-
(void)game_manager;
163162
(void)modifiers;
164163

165164
te_editor* editor = game_instance;
166165
editor_camera_on_keyboard_button_released(editor->editor_camera, button);
166+
167+
if (button == TE_KB_ESCAPE) {
168+
window_close(game_manager_get_window(game_manager));
169+
}
167170
}
168171

169172
void
@@ -183,8 +186,10 @@ editor_on_gamepad_button_pressed(void* game_instance, struct te_game_manager* ga
183186
void
184187
editor_on_gamepad_button_released(void* game_instance, struct te_game_manager* game_manager, enum te_gamepad_button button) {
185188
(void)game_instance;
186-
(void)game_manager;
187-
(void)button;
189+
190+
if (button == TE_GB_BUTTON_RIGHT) {
191+
window_close(game_manager_get_window(game_manager));
192+
}
188193
}
189194

190195
void

0 commit comments

Comments
 (0)