Daniele Bartolini 4 дней назад
Родитель
Сommit
bcc5a3f8b4

+ 1 - 0
docs/changelog.rst

@@ -17,6 +17,7 @@ Changelog
 * Tools: added the ability to reset properties to default by right-clicking on them.
 * Tools: the Level Editor will now automatically open a new temporary project when the Projects List is empty.
 * Tools: the game will now be killed if it takes to long to exit when testing it from the Level Editor.
+* Tools: added the ability to unselect all objects with ``Shift+Ctrl+A`` keyboard shortcut.
 * Runtime: Linux: switched to Vulkan for rendering.
 * Runtime: added support to stencil testing in shaders.
 * Data Compile: resource packages are now LZ4-compressed.

+ 11 - 5
tools/core/database_editor.vala

@@ -9,11 +9,12 @@ public class DatabaseEditor
 {
 	public const GLib.ActionEntry[] actions =
 	{
-		{ "undo",      on_undo,      null,   null },
-		{ "redo",      on_redo,      null,   null },
-		{ "duplicate", on_duplicate, null,   null },
-		{ "delete",    on_delete,    null,   null },
-		{ "add",       on_add,       "(ss)", null },
+		{ "undo",        on_undo,        null,   null },
+		{ "redo",        on_redo,        null,   null },
+		{ "duplicate",   on_duplicate,   null,   null },
+		{ "delete",      on_delete,      null,   null },
+		{ "add",         on_add,         "(ss)", null },
+		{ "select_none", on_select_none, null,   null },
 	};
 
 	public UndoRedo _undo_redo;
@@ -108,6 +109,11 @@ public class DatabaseEditor
 		}
 	}
 
+	public void on_select_none(GLib.SimpleAction action, GLib.Variant? param)
+	{
+		clear_selection();
+	}
+
 	public void clear_selection()
 	{
 		_selection.clear();

+ 1 - 0
tools/level_editor/level_editor.vala

@@ -775,6 +775,7 @@ public class LevelEditorApplication : Gtk.Application
 		this.set_accels_for_action("database.redo", new string[] { "<Shift><Primary>Z" });
 		this.set_accels_for_action("database.duplicate", new string[] { "<Primary>D" });
 		this.set_accels_for_action("database.delete", new string[] { "Delete" });
+		this.set_accels_for_action("database.select_none", new string[] { "<Shift><Primary>A" });
 
 		this.set_accels_for_action("app.tool(0)", new string[] { "Q" });
 		this.set_accels_for_action("app.tool(1)", new string[] { "W" });

+ 4 - 0
tools/level_editor/menus.vala

@@ -225,6 +225,10 @@ public GLib.Menu make_database_editor_menu()
 	mi.set_detailed_action("database.delete");
 	ms.append_item(mi);
 
+	mi = new GLib.MenuItem("Select None", null);
+	mi.set_detailed_action("database.select_none");
+	ms.append_item(mi);
+
 	menu.append_section(null, ms);
 
 	return menu;