EntityCopyingVisitor visitor( *Node_getEntity( node ) );
- entity->forEachKeyValue( visitor );
+ //entity->forEachKeyValue( visitor );
NodeSmartReference child( path.top().get() );
NodeSmartReference parent( path.parent().get() );
- Node_getTraversable( parent )->erase( child );
+ //Node_getTraversable( parent )->erase( child );
if ( Node_getTraversable( child ) != 0
&& Node_getTraversable( node ) != 0
&& node_is_group( node ) ) {
parentBrushes( child, node );
}
Node_getTraversable( parent )->insert( node );
+ /* must do this after inserting node, otherwise problem: targeted + having model + not loaded b4 new entities aren't selectable normally + rendered only while 0 0 0 is rendered */
+ entity->forEachKeyValue( visitor );
+ Node_getTraversable( parent )->erase( child );
}
}
};
const scene::Path& path = GlobalSelectionSystem().ultimateSelected().path();
Entity* entity = Node_getEntity( path.top() );
+ if( entity == 0 && path.size() == 3 ){
+ entity = Node_getEntity( path.parent() );
+ }
+
if ( entity != 0 ) {
const char* strColor = entity->getKeyValue( "_color" );
if ( !string_empty( strColor ) ) {
if ( GlobalSelectionSystem().countSelected() != 0 ) {
const scene::Path& path = GlobalSelectionSystem().ultimateSelected().path();
Entity* entity = Node_getEntity( path.top() );
+
+ if( entity == 0 && path.size() == 3 ){
+ entity = Node_getEntity( path.parent() );
+ }
+
if ( entity != 0 ) {
const char* strColor = entity->getKeyValue( "_color" );
if ( !string_empty( strColor ) ) {
delete this;
}
void apply(){
- Scene_EntitySetKeyValue_Selected_Undoable( m_key.c_str(), gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( m_check ) ) ? "1" : "0" );
+ Scene_EntitySetKeyValue_Selected_Undoable( m_key.c_str(), gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( m_check ) ) ? "1" : "" );
}
typedef MemberCaller<BooleanAttribute, &BooleanAttribute::apply> ApplyCaller;
static gint EntityInspector_clearKeyValueKB( GtkEntry* widget, GdkEventKey* event, gpointer data ){
if ( event->keyval == GDK_Delete ) {
- // Get current selection text
- StringOutputStream key( 64 );
- key << gtk_entry_get_text( g_entityKeyEntry );
-
- if ( strcmp( key.c_str(), "classname" ) != 0 ) {
- StringOutputStream command;
- command << "entityDeleteKey -key " << key.c_str();
- UndoableCommand undo( command.c_str() );
- Scene_EntitySetKeyValue_Selected( key.c_str(), "" );
- }
+ EntityInspector_clearKeyValue();
return TRUE;
}
return FALSE;
}
static gint EntityClassList_keypress( GtkWidget* widget, GdkEventKey* event, gpointer data ){
- unsigned int code = gdk_keyval_to_upper( event->keyval );
-
if ( event->keyval == GDK_Return ) {
EntityClassList_createEntity();
return TRUE;
}
// select the entity that starts with the key pressed
+/*
+ unsigned int code = gdk_keyval_to_upper( event->keyval );
if ( code <= 'Z' && code >= 'A' && event->state == 0 ) {
GtkTreeView* view = g_entityClassList;
GtkTreeModel* model;
return TRUE;
}
+*/
return FALSE;
}
static gint EntityEntry_keypress( GtkEntry* widget, GdkEventKey* event, gpointer data ){
if ( event->keyval == GDK_Return ) {
if ( widget == g_entityKeyEntry ) {
- gtk_entry_set_text( g_entityValueEntry, "" );
+ //gtk_entry_set_text( g_entityValueEntry, "" );
gtk_window_set_focus( GTK_WINDOW( gtk_widget_get_toplevel( GTK_WIDGET( widget ) ) ), GTK_WIDGET( g_entityValueEntry ) );
}
else
GtkListStore* store = gtk_list_store_new( 2, G_TYPE_STRING, G_TYPE_POINTER );
GtkTreeView* view = GTK_TREE_VIEW( gtk_tree_view_new_with_model( GTK_TREE_MODEL( store ) ) );
- gtk_tree_view_set_enable_search( GTK_TREE_VIEW( view ), FALSE );
+ //gtk_tree_view_set_enable_search( GTK_TREE_VIEW( view ), FALSE );
gtk_tree_view_set_headers_visible( view, FALSE );
g_signal_connect( G_OBJECT( view ), "button_press_event", G_CALLBACK( EntityClassList_button_press ), 0 );
g_signal_connect( G_OBJECT( view ), "key_press_event", G_CALLBACK( EntityClassList_keypress ), 0 );