From ce159226974229b0cfacba072e0401f5fdb28826 Mon Sep 17 00:00:00 2001 From: Mattia Basaglia Date: Sat, 25 Jul 2015 11:36:20 +0200 Subject: [PATCH] Add a menu item to remove selected brushes and patches from their entity --- radiant/entity.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/radiant/entity.cpp b/radiant/entity.cpp index ab3243b0..008c4d3b 100644 --- a/radiant/entity.cpp +++ b/radiant/entity.cpp @@ -117,7 +117,6 @@ void Scene_EntitySetClassname_Selected( const char* classname ){ GlobalSceneGraph().traverse( EntitySetClassnameSelected( classname ) ); } - void Entity_ungroupSelected(){ if ( GlobalSelectionSystem().countSelected() < 1 ) { return; @@ -144,6 +143,14 @@ void Entity_ungroupSelected(){ } } +void Entity_ungroupSelectedPrimitives(){ + if ( GlobalSelectionSystem().countSelected() < 1 ) { + return; + } + + UndoableCommand undo( "ungroupSelectedPrimitives" ); + Scene_parentSelectedBrushesToEntity( GlobalSceneGraph(), *Map_FindWorldspawn( g_map )); +} class EntityFindSelected : public scene::Graph::Walker { @@ -570,6 +577,7 @@ void Entity_registerPreferencesPage(){ void Entity_constructMenu( GtkMenu* menu ){ create_menu_item_with_mnemonic( menu, "_Regroup", "GroupSelection" ); create_menu_item_with_mnemonic( menu, "_Ungroup", "UngroupSelection" ); + create_menu_item_with_mnemonic( menu, "Re_move from Entity", "UngroupSelectedPrimitives" ); create_menu_item_with_mnemonic( menu, "_Connect", "ConnectSelection" ); create_menu_item_with_mnemonic( menu, "_KillConnect", "KillConnectSelection" ); create_menu_item_with_mnemonic( menu, "_Select Color...", "EntityColor" ); @@ -588,6 +596,8 @@ void Entity_Construct(){ GlobalCommands_insert( "KillConnectSelection", FreeCaller(), Accelerator( 'K', (GdkModifierType)( GDK_SHIFT_MASK ) ) ); GlobalCommands_insert( "GroupSelection", FreeCaller() ); GlobalCommands_insert( "UngroupSelection", FreeCaller() ); + GlobalCommands_insert( "UngroupSelectedPrimitives", FreeCaller() ); + GlobalPreferenceSystem().registerPreference( "SI_Colors5", Vector3ImportStringCaller( g_entity_globals.color_entity ), Vector3ExportStringCaller( g_entity_globals.color_entity ) ); GlobalPreferenceSystem().registerPreference( "LastLightIntensity", IntImportStringCaller( g_iLastLightIntensity ), IntExportStringCaller( g_iLastLightIntensity ) ); -- 2.39.2