]> git.xonotic.org Git - xonotic/netradiant.git/blobdiff - radiant/entity.cpp
Radiant:
[xonotic/netradiant.git] / radiant / entity.cpp
index 6926b76d2387991f0db98d3e4fd9c3fa8b65426a..ff82b7ab087469b2b3a2542db14e08aa17a869a0 100644 (file)
@@ -490,6 +490,9 @@ void Entity_normalizeColor(){
                                                         g_entity_globals.color_entity[1],
                                                         g_entity_globals.color_entity[2] );
 
+                                       StringOutputStream command( 256 );
+                                       command << "entityNormalizeColour " << buffer;
+                                       UndoableCommand undo( command.c_str() );
                                        Scene_EntitySetKeyValue_Selected( "_color", buffer );
                                }
                        }
@@ -499,10 +502,8 @@ void Entity_normalizeColor(){
 
 void Entity_setColour(){
        if ( GlobalSelectionSystem().countSelected() != 0 ) {
-               bool normalize = false;
                const scene::Path& path = GlobalSelectionSystem().ultimateSelected().path();
                Entity* entity = Node_getEntity( path.top() );
-
                if ( entity != 0 ) {
                        const char* strColor = entity->getKeyValue( "_color" );
                        if ( !string_empty( strColor ) ) {
@@ -511,21 +512,15 @@ void Entity_setColour(){
                                        g_entity_globals.color_entity = rgb;
                                }
                        }
-
-                       if ( g_pGameDescription->mGameType == "doom3" ) {
-                               normalize = false;
-                       }
-
                        if ( color_dialog( GTK_WIDGET( MainFrame_getWindow() ), g_entity_globals.color_entity ) ) {
-                               if ( normalize ) {
-                                       NormalizeColor( g_entity_globals.color_entity );
-                               }
-
                                char buffer[128];
                                sprintf( buffer, "%g %g %g", g_entity_globals.color_entity[0],
                                                 g_entity_globals.color_entity[1],
                                                 g_entity_globals.color_entity[2] );
 
+                               StringOutputStream command( 256 );
+                               command << "entitySetColour " << buffer;
+                               UndoableCommand undo( command.c_str() );
                                Scene_EntitySetKeyValue_Selected( "_color", buffer );
                        }
                }