class EntityGroupSelected : public scene::Graph::Walker
{
- NodeSmartReference group;
+ NodeSmartReference group, worldspawn;
//typedef std::pair<NodeSmartReference, NodeSmartReference> DeletionPair;
//Stack<DeletionPair> deleteme;
public:
- EntityGroupSelected(const scene::Path &p): group(p.top().get())
+ EntityGroupSelected(const scene::Path &p): group(p.top().get()), worldspawn(Map_FindOrInsertWorldspawn(g_map))
{
}
bool pre(const scene::Path& path, scene::Instance& instance) const
NodeSmartReference child(path.top().get());
NodeSmartReference parent(path.parent().get());
- if(path.size() >= 3 && parent != Map_FindOrInsertWorldspawn(g_map))
+ if(path.size() >= 3 && parent != worldspawn)
{
NodeSmartReference parentparent(path[path.size() - 3].get());
{
GlobalEntityCreator().connectEntities(
GlobalSelectionSystem().penultimateSelected().path(),
- GlobalSelectionSystem().ultimateSelected().path()
+ GlobalSelectionSystem().ultimateSelected().path(),
+ 0
);
}
else
}
}
+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);
EntityClass* entityClass = GlobalEntityClassManager().findOrInsert(name, true);
- bool isModel = string_equal_nocase(name, "misc_model")
- || string_equal_nocase(name, "misc_gamemodel")
+ bool isModel = (string_compare_nocase_n(name, "misc_", 5) == 0 && string_equal_nocase(name + string_length(name) - 5, "model")) // misc_*model (also misc_model)
|| string_equal_nocase(name, "model_static")
|| (GlobalSelectionSystem().countSelected() == 0 && string_equal_nocase(name, "func_static"));
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");
}
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>());