]> git.rm.cloudns.org Git - xonotic/netradiant.git/commitdiff
Merge commit 'dce6730b39a2e6484015e483c46edbe93054f6a0' into garux-merge
authorThomas Debesse <dev@illwieckz.net>
Mon, 25 May 2020 18:01:54 +0000 (20:01 +0200)
committerThomas Debesse <dev@illwieckz.net>
Mon, 25 May 2020 18:01:54 +0000 (20:01 +0200)
12 files changed:
1  2 
libs/scenelib.h
plugins/entity/entity.cpp
radiant/brushmanip.cpp
radiant/camwindow.cpp
radiant/csg.cpp
radiant/filterbar.cpp
radiant/filters.cpp
radiant/mainframe.cpp
radiant/patch.h
radiant/patchmanip.cpp
radiant/select.cpp
radiant/surfacedialog.cpp

diff --cc libs/scenelib.h
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc radiant/csg.cpp
index 4ecbf5cc10d6f2ddde4b00c6c2c685e67d1f0000,1b824b6abedc8f5e0e1199fc841803bb9cd55271..374384b35608c1dc5c84088c176727c1374ede37
@@@ -566,15 -608,17 +606,19 @@@ class SubtractBrushesFromUnselected : p
  const brush_vector_t& m_brushlist;
  std::size_t& m_before;
  std::size_t& m_after;
+ mutable bool m_eraseParent;
  public:
  SubtractBrushesFromUnselected( const brush_vector_t& brushlist, std::size_t& before, std::size_t& after )
-       : m_brushlist( brushlist ), m_before( before ), m_after( after ){
+       : m_brushlist( brushlist ), m_before( before ), m_after( after ), m_eraseParent( false ){
  }
 +
  bool pre( const scene::Path& path, scene::Instance& instance ) const {
-       return true;
+       if ( path.top().get().visible() ) {
+               return true;
+       }
+       return false;
  }
 +
  void post( const scene::Path& path, scene::Instance& instance ) const {
        if ( path.top().get().visible() ) {
                Brush* brush = Node_getBrush( path.top() );
index 424280ce2f9da105cbe6b710b0e2832819e13d9d,6317fa4711653411e5cba77c54f89e0c2a4db98e..af2c829d31c070ecc91423044c95b13a48391a13
@@@ -13,7 -11,9 +13,7 @@@
  #include "gtkutil/accelerator.h"
  #include "generic/callback.h"
  
+ #include "entity.h"
 -
 -
  int ToggleActions = 0;
  int ButtonNum = 0;
  
@@@ -152,8 -147,17 +152,18 @@@ gboolean Trigger_button_press( ui::Widg
        return FALSE;
  }
  
 -gboolean Detail_button_press( GtkWidget *widget, GdkEventButton *event, gpointer data ){
+ gboolean Func_Groups_button_press( GtkWidget *widget, GdkEventButton *event, gpointer data ){
+       if ( event->button == 3 && event->type == GDK_BUTTON_PRESS ) {
+               UndoableCommand undo( "create func_group" );
+               Entity_createFromSelection( "func_group", g_vector3_identity );
+               ToggleActions = 0;
+               return TRUE;
+       }
+       return FALSE;
+ }
 +
 +gboolean Detail_button_press( ui::Widget widget, GdkEventButton *event, gpointer data ){
        if ( event->button == 3 && event->type == GDK_BUTTON_PRESS ) {
                GlobalCommands_find( "MakeDetail" ).m_callback();
                ToggleActions = 0;
@@@ -173,78 -176,59 +183,86 @@@ gboolean Structural_button_press( ui::W
  }
  
  
 -GtkToolbar* create_filter_toolbar(){
 -                      GtkToolbar* filter_toolbar = GTK_TOOLBAR( gtk_toolbar_new() );
 -                      gtk_widget_show( GTK_WIDGET( filter_toolbar ) );
 -                      g_signal_connect( G_OBJECT( filter_toolbar ), "enter_notify_event", G_CALLBACK( ToggleActions0 ), 0 );
 +ui::Toolbar create_filter_toolbar(){
 +                      auto filter_toolbar = ui::Toolbar::from( gtk_toolbar_new() );
 +                      gtk_orientable_set_orientation( GTK_ORIENTABLE(filter_toolbar), GTK_ORIENTATION_HORIZONTAL );
 +                      gtk_toolbar_set_style( filter_toolbar, GTK_TOOLBAR_ICONS );
 +                      filter_toolbar.show();
  
 -                      GtkToggleButton* button;
  
 -                      toolbar_append_toggle_button( filter_toolbar, "World (ALT + 1)", "f-world.png", "FilterWorldBrushes" );
 +                      auto space = [&]() {
 +                              auto btn = ui::ToolItem::from(gtk_separator_tool_item_new());
 +                                      btn.show();
 +                                      filter_toolbar.add(btn);
 +                      };
  
 -                      button = toolbar_append_toggle_button( filter_toolbar, "Structural (CTRL + SHIFT + D)\nRightClick: MakeStructural", "f-structural.png", "FilterStructural" );
 -                      g_signal_connect( G_OBJECT( button ), "button_press_event", G_CALLBACK( Structural_button_press ), 0 );
 +                      g_signal_connect( G_OBJECT( filter_toolbar ), "enter_notify_event", G_CALLBACK( ToggleActions0 ), 0 );
  
 -                      button = toolbar_append_toggle_button( filter_toolbar, "Details (CTRL + D)\nRightClick: MakeDetail", "f-details.png", "FilterDetails" );
 -                      g_signal_connect( G_OBJECT( button ), "button_press_event", G_CALLBACK( Detail_button_press ), 0 );
 +                      toolbar_append_toggle_button( filter_toolbar, "World (ALT + 1)", "f-world.png", "FilterWorldBrushes" );
 +
 +                      {
 +                              auto button = toolbar_append_toggle_button( filter_toolbar, "Structural (CTRL + SHIFT + D)\nRightClick: MakeStructural", "f-structural.png", "FilterStructural" );
 +                              g_signal_connect( G_OBJECT( button ), "button_press_event", G_CALLBACK( Structural_button_press ), 0 );
 +                      }
  
 -                      button = toolbar_append_toggle_button( filter_toolbar, "Func_Groups\nRightClick: create func_group", "f-funcgroups.png", "FilterFuncGroups" );
 -                      g_signal_connect( G_OBJECT( button ), "button_press_event", G_CALLBACK( Func_Groups_button_press ), 0 );
 +                      {
 +                              auto button = toolbar_append_toggle_button( filter_toolbar, "Details (CTRL + D)\nRightClick: MakeDetail", "f-details.png", "FilterDetails" );
 +                              g_signal_connect( G_OBJECT( button ), "button_press_event", G_CALLBACK( Detail_button_press ), 0 );
 +                      }
  
--                      toolbar_append_toggle_button( filter_toolbar, "Patches (CTRL + P)", "patch_wireframe.png", "FilterPatches" );
 -                      gtk_toolbar_append_space( GTK_TOOLBAR( filter_toolbar ) );
++                      {
++                              auto button = toolbar_append_toggle_button( filter_toolbar, "Func_Groups\nRightClick: create func_group", "f-funcgroups.png", "FilterFuncGroups" );
++                              g_signal_connect( G_OBJECT( button ), "button_press_event", G_CALLBACK( Func_Groups_button_press ), 0 );
 -                      button = toolbar_append_toggle_button( filter_toolbar, "Areaportals (ALT + 3)\nRightClick: toggle tex\n\tnoDraw\n\tnoDrawNonSolid", "f-areaportal.png", "FilterAreaportals" );
 -                      g_signal_connect( G_OBJECT( button ), "button_press_event", G_CALLBACK( Areaportals_button_press ), 0 );
++                              toolbar_append_toggle_button( filter_toolbar, "Patches (CTRL + P)", "patch_wireframe.png", "FilterPatches" );
++                      }
 +                      space();
  
 +                      {
 +                              auto button = toolbar_append_toggle_button( filter_toolbar, "Areaportals (ALT + 3)\nRightClick: toggle tex\n\tnoDraw\n\tnoDrawNonSolid", "f-areaportal.png", "FilterAreaportals" );
 +                              g_signal_connect( G_OBJECT( button ), "button_press_event", G_CALLBACK( Areaportals_button_press ), 0 );
 +                      }
  
                        toolbar_append_toggle_button( filter_toolbar, "Translucent (ALT + 4)", "f-translucent.png", "FilterTranslucent" );
  
 -                      button = toolbar_append_toggle_button( filter_toolbar, "Liquids (ALT + 5)\nRightClick: toggle tex\n\twaterCaulk\n\tlavaCaulk\n\tslimeCaulk", "f-liquids.png", "FilterLiquids" );
 -                      g_signal_connect( G_OBJECT( button ), "button_press_event", G_CALLBACK( Liquids_button_press ), 0 );
 +                      {
 +                              auto button = toolbar_append_toggle_button( filter_toolbar, "Liquids (ALT + 5)\nRightClick: toggle tex\n\twaterCaulk\n\tlavaCaulk\n\tslimeCaulk", "f-liquids.png", "FilterLiquids" );
 +                              g_signal_connect( G_OBJECT( button ), "button_press_event", G_CALLBACK( Liquids_button_press ), 0 );
 +                      }
  
 -                      button = toolbar_append_toggle_button( filter_toolbar, "Caulk (ALT + 6)\nRightClick: tex Caulk", "f-caulk.png", "FilterCaulk" );
 -                      g_signal_connect( G_OBJECT( button ), "button_press_event", G_CALLBACK( Caulk_button_press ), 0 );
 +                      {
 +                              auto button = toolbar_append_toggle_button( filter_toolbar, "Caulk (ALT + 6)\nRightClick: tex Caulk", "f-caulk.png", "FilterCaulk" );
 +                              g_signal_connect( G_OBJECT( button ), "button_press_event", G_CALLBACK( Caulk_button_press ), 0 );
 +                      }
  
 -                      button = toolbar_append_toggle_button( filter_toolbar, "Clips (ALT + 7)\nRightClick: toggle tex\n\tplayerClip\n\tweapClip", "f-clip.png", "FilterClips" );
 -                      g_signal_connect( G_OBJECT( button ), "button_press_event", G_CALLBACK( Clip_button_press ), 0 );
 +                      {
 +                              auto button = toolbar_append_toggle_button( filter_toolbar, "Clips (ALT + 7)\nRightClick: toggle tex\n\tplayerClip\n\tweapClip", "f-clip.png", "FilterClips" );
 +                              g_signal_connect( G_OBJECT( button ), "button_press_event", G_CALLBACK( Clip_button_press ), 0 );
 +                      }
  
 -                      button = toolbar_append_toggle_button( filter_toolbar, "HintsSkips (CTRL + H)\nRightClick: toggle tex\n\thint\n\thintLocal\n\thintSkip", "f-hint.png", "FilterHintsSkips" );
 -                      g_signal_connect( G_OBJECT( button ), "button_press_event", G_CALLBACK( Hint_button_press ), 0 );
 +                      {
 +                              auto button = toolbar_append_toggle_button( filter_toolbar, "HintsSkips (CTRL + H)\nRightClick: toggle tex\n\thint\n\thintLocal\n\thintSkip", "f-hint.png", "FilterHintsSkips" );
 +                              g_signal_connect( G_OBJECT( button ), "button_press_event", G_CALLBACK( Hint_button_press ), 0 );
 +                      }
  
                        //toolbar_append_toggle_button( filter_toolbar, "Paths (ALT + 8)", "texture_lock.png", "FilterPaths" );
 -                      gtk_toolbar_append_space( GTK_TOOLBAR( filter_toolbar ) );
++
 +                      space();
++
                        toolbar_append_toggle_button( filter_toolbar, "Entities (ALT + 2)", "f-entities.png", "FilterEntities" );
                        toolbar_append_toggle_button( filter_toolbar, "Lights (ALT + 0)", "f-lights.png", "FilterLights" );
                        toolbar_append_toggle_button( filter_toolbar, "Models (SHIFT + M)", "f-models.png", "FilterModels" );
  
 -                      button = toolbar_append_toggle_button( filter_toolbar, "Triggers (CTRL + SHIFT + T)\nRightClick: tex Trigger", "f-triggers.png", "FilterTriggers" );
 -                      g_signal_connect( G_OBJECT( button ), "button_press_event", G_CALLBACK( Trigger_button_press ), 0 );
 +                      {
 +                              auto button = toolbar_append_toggle_button( filter_toolbar, "Triggers (CTRL + SHIFT + T)\nRightClick: tex Trigger", "f-triggers.png", "FilterTriggers" );
 +                              g_signal_connect( G_OBJECT( button ), "button_press_event", G_CALLBACK( Trigger_button_press ), 0 );
 +                      }
  
                        //toolbar_append_toggle_button( filter_toolbar, "Decals (SHIFT + D)", "f-decals.png", "FilterDecals" );
 -                      gtk_toolbar_append_space( GTK_TOOLBAR( filter_toolbar ) );
 +                      space();
                        toolbar_append_button( filter_toolbar, "InvertFilters", "f-invert.png", "InvertFilters" );
                        toolbar_append_button( filter_toolbar, "ResetFilters", "f-reset.png", "ResetFilters" );
                        return filter_toolbar;
  }
Simple merge
index 9c8784b55e5fe4e80512270dfbcb98461b89e114,4c8ddd7c2ce911fccf953ad9223addb8f9ab7814..99d499652de4b903449bdde58a80965ebaf9f20d
@@@ -2924,11 -2773,12 +2924,12 @@@ void MainFrame::Create()
  
        g_MainWindowActive.connect( window );
  
 -      GetPlugInMgr().Init( GTK_WIDGET( window ) );
 +      GetPlugInMgr().Init( window );
  
 -      GtkWidget* vbox = gtk_vbox_new( FALSE, 0 );
 -      gtk_container_add( GTK_CONTAINER( window ), vbox );
 -      gtk_widget_show( vbox );
 +      auto vbox = ui::VBox( FALSE, 0 );
 +      window.add(vbox);
 +      vbox.show();
+       gtk_container_set_focus_chain( GTK_CONTAINER( vbox ), NULL );
  
        global_accel_connect_window( window );
  
diff --cc radiant/patch.h
Simple merge
index e0ab819c6325be6b40f8b48b4af581bb7382a01e,b941e2ae5649919a7a1d56606489ed0f97d68efd..7a764976f4395ff34850c725bb19305707923533
@@@ -378,12 -420,22 +378,26 @@@ void Scene_PatchGetShader_Selected( sce
        }
  }
  
+ class PatchSelectByShader
+ {
+ const char* m_name;
+ public:
+ inline PatchSelectByShader( const char* name )
+       : m_name( name ){
+ }
+ void operator()( PatchInstance& patch ) const {
+       if ( shader_equal( patch.getPatch().GetShader(), m_name ) ) {
+               patch.setSelected( true );
+       }
+ }
+ };
  void Scene_PatchSelectByShader( scene::Graph& graph, const char* name ){
 -      Scene_forEachVisiblePatchInstance( PatchSelectByShader( name ) );
 +      Scene_forEachVisiblePatchInstance([&](PatchInstance &patch) {
 +              if (shader_equal(patch.getPatch().GetShader(), name)) {
 +                      patch.setSelected(true);
 +              }
 +      });
  }
  
  
Simple merge
Simple merge