From 286f784ecfc056c9d0e1e540a99999c3899ba20e Mon Sep 17 00:00:00 2001 From: Garux Date: Wed, 28 Feb 2018 13:15:05 +0300 Subject: [PATCH] * Entity Inspector->smartedit->color chooser sets actual key, was always _color --- radiant/entityinspector.cpp | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/radiant/entityinspector.cpp b/radiant/entityinspector.cpp index a20b9449..2093839d 100644 --- a/radiant/entityinspector.cpp +++ b/radiant/entityinspector.cpp @@ -255,17 +255,15 @@ void update(){ gtk_entry_set_text( GTK_ENTRY( m_entry.m_entry.m_entry ), value.c_str() ); } typedef MemberCaller UpdateCaller; -void browse( const BrowsedPathEntry::SetPathCallback& setPath ){ - //const char *filename = misc_model_dialog( gtk_widget_get_toplevel( GTK_WIDGET( m_entry.m_entry.m_frame ) ) ); - - /* hijack BrowsedPathEntry to call colour chooser */ - Entity_setColour(); - -// if ( filename != 0 ) { -// setPath( filename ); -// apply(); -// } - update(); +void browse( const BrowsedPathEntry::SetPathCallback& setPath ){ /* hijack BrowsedPathEntry to call colour chooser */ + Vector3 color( 1, 1, 1 ); + string_parse_vector3( gtk_entry_get_text( GTK_ENTRY( m_entry.m_entry.m_entry ) ), color ); + if( color_dialog( gtk_widget_get_toplevel( GTK_WIDGET( m_entry.m_entry.m_frame ) ), color ) ){ + char buffer[64]; + sprintf( buffer, "%g %g %g", color[0], color[1], color[2] ); + gtk_entry_set_text( GTK_ENTRY( m_entry.m_entry.m_entry ), buffer ); + apply(); + } } typedef MemberCaller1 BrowseCaller; };