]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - radiant/entity.cpp
add a feature shift-k to assign killtarget, not target like ctrl-k
[xonotic/netradiant.git] / radiant / entity.cpp
index 52be82feed93405b0189f86754661886690b72cd..a572539e65bde0cfd9ba8e557bdda038335792f6 100644 (file)
@@ -258,7 +258,8 @@ void Entity_connectSelected()
   {
     GlobalEntityCreator().connectEntities(
       GlobalSelectionSystem().penultimateSelected().path(),
-      GlobalSelectionSystem().ultimateSelected().path()
+      GlobalSelectionSystem().ultimateSelected().path(),
+      0
     );
   }
   else
@@ -267,6 +268,22 @@ void Entity_connectSelected()
   }
 }
 
+void Entity_killconnectSelected()
+{
+  if(GlobalSelectionSystem().countSelected() == 2)
+  {
+    GlobalEntityCreator().connectEntities(
+      GlobalSelectionSystem().penultimateSelected().path(),
+      GlobalSelectionSystem().ultimateSelected().path(),
+      1
+    );
+  }
+  else
+  {
+    globalErrorStream() << "entityKillConnectSelected: exactly two instances must be selected\n";
+  }
+}
+
 AABB Doom3Light_getBounds(const AABB& workzone)
 {
   AABB aabb(workzone);
@@ -618,6 +635,7 @@ 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, "_Connect", "ConnectSelection");
+  create_menu_item_with_mnemonic(menu, "_KillConnect", "KillConnectSelection");
   create_menu_item_with_mnemonic(menu, "_Select Color...", "EntityColor");
   create_menu_item_with_mnemonic(menu, "_Normalize Color...", "NormalizeColor");
 }
@@ -632,6 +650,7 @@ void Entity_Construct()
   GlobalCommands_insert("EntityColor", FreeCaller<Entity_setColour>(), Accelerator('K'));
   GlobalCommands_insert("NormalizeColor", FreeCaller<Entity_normalizeColor>());
   GlobalCommands_insert("ConnectSelection", FreeCaller<Entity_connectSelected>(), Accelerator('K', (GdkModifierType)GDK_CONTROL_MASK));
+  GlobalCommands_insert("KillConnectSelection", FreeCaller<Entity_killconnectSelected>(), Accelerator('K', (GdkModifierType)(GDK_SHIFT_MASK)));
   GlobalCommands_insert("GroupSelection", FreeCaller<Entity_groupSelected>());
   GlobalCommands_insert("UngroupSelection", FreeCaller<Entity_ungroupSelected>());