]> git.rm.cloudns.org Git - xonotic/netradiant.git/commitdiff
fix merge
authorThomas Debesse <dev@illwieckz.net>
Mon, 25 May 2020 23:37:54 +0000 (01:37 +0200)
committerThomas Debesse <dev@illwieckz.net>
Mon, 25 May 2020 23:37:54 +0000 (01:37 +0200)
libs/gtkutil/xorrectangle.cpp
radiant/camwindow.cpp
radiant/entity.cpp
radiant/filterbar.cpp
radiant/mainframe.cpp
radiant/map.cpp
radiant/select.cpp
radiant/selection.cpp
radiant/xywindow.cpp

index e7012328d104a9df2c68916465cfbed088f85496..b9b15faf8c688afdec684a66a73e32152594f3fa 100644 (file)
@@ -63,6 +63,10 @@ void XORRectangle::set(rectangle_t rectangle)
                                glMatrixMode( GL_PROJECTION );
                                glLoadIdentity();
                                glOrtho( 0, width, 0, height, -100, 100 );
+
+                               glMatrixMode( GL_MODELVIEW );
+                               glLoadIdentity();
+
                                glPolygonMode( GL_FRONT_AND_BACK, GL_FILL );
                                glDisable( GL_DEPTH_TEST );
 
index bbcf851ba21aad795569e5da532fc194af67f270..cc907200868cc3ba1140c11c80385bd9644685a2 100644 (file)
@@ -1432,13 +1432,21 @@ FreeCaller<void(const Callback<void(bool)>&), ShowStatsExport> g_show_stats_call
 Callback<void(const Callback<void(bool)> &)> g_show_stats_callback( g_show_stats_caller );
 ToggleItem g_show_stats( g_show_stats_callback );
 */
-BoolExportCaller g_show_stats_caller( g_camwindow_globals_private.m_showStats );
-ToggleItem g_show_stats( g_show_stats_caller );
+
 void ShowStatsToggle(){
        g_camwindow_globals_private.m_showStats ^= 1;
-       g_show_stats.update();
+//     g_show_stats.update();
        UpdateAllWindows();
 }
+typedef FreeCaller<void(), ShowStatsToggle> ShowStatsToggleCaller;
+void ShowStatsExport( const Callback<void(bool)> & importer ){
+       importer( g_camwindow_globals_private.m_showStats );
+}
+typedef FreeCaller<void(const Callback<void(bool)> &), ShowStatsExport> ShowStatsExportCaller;
+
+ShowStatsExportCaller g_show_stats_caller;
+Callback<void(const Callback<void(bool)> &)> g_show_stats_callback( g_show_stats_caller );
+ToggleItem g_show_stats( g_show_stats_callback );
 
 void CamWnd::Cam_Draw(){
        glViewport( 0, 0, m_Camera.width, m_Camera.height );
index 765ac6e78fa5c828936625cd0b398a1c5702bff1..d865161c3dadb854364cc6a5c390a517521d2fbd 100644 (file)
@@ -602,17 +602,20 @@ void Entity_registerPreferencesPage(){
 }
 */
 
-void ShowLightRadiiExport( const BoolImportCallback& importer ){
-       importer( GlobalEntityCreator().getLightRadii() );
-}
-typedef FreeCaller1<const BoolImportCallback&, ShowLightRadiiExport> ShowLightRadiiExportCaller;
-ShowLightRadiiExportCaller g_show_lightradii_caller;
-ToggleItem g_show_lightradii_item( g_show_lightradii_caller );
-void ToggleShowLightRadii(){
+void ShowLightRadiiToggle(){
        GlobalEntityCreator().setLightRadii( !GlobalEntityCreator().getLightRadii() );
-       g_show_lightradii_item.update();
        UpdateAllWindows();
 }
+typedef FreeCaller<void(), ShowLightRadiiToggle> ShowLightRadiiToggleCaller;
+void ShowLightRadiiExport( const Callback<void(bool)> & importer ){
+       GlobalEntityCreator().getLightRadii();
+}
+typedef FreeCaller<void(const Callback<void(bool)> &), ShowLightRadiiExport> ShowLightRadiiExportCaller;
+
+ShowLightRadiiExportCaller g_show_lightradii_caller;
+Callback<void(const Callback<void(bool)> &)> g_show_lightradii_callback( g_show_lightradii_caller );
+ToggleItem g_show_lightradii( g_show_lightradii_callback );
+
 void Entity_constructMenu( ui::Menu menu ){
        create_menu_item_with_mnemonic( menu, "_Regroup", "GroupSelection" );
        create_menu_item_with_mnemonic( menu, "_Ungroup", "UngroupSelection" );
@@ -633,7 +636,7 @@ void Entity_Construct(){
        GlobalCommands_insert( "GroupSelection", makeCallbackF(Entity_groupSelected) );
        GlobalCommands_insert( "UngroupSelection", makeCallbackF(Entity_ungroupSelected) );
 
-       GlobalToggles_insert( "ShowLightRadiuses", FreeCaller<ToggleShowLightRadii>(), ToggleItem::AddCallbackCaller( g_show_lightradii_item ) );
+       GlobalToggles_insert( "ShowLightRadiuses", makeCallbackF( ShowLightRadiiToggle ), ToggleItem::AddCallbackCaller( g_show_lightradii ) );
 
        GlobalPreferenceSystem().registerPreference( "SI_Colors5", make_property_string( g_entity_globals.color_entity ) );
        GlobalPreferenceSystem().registerPreference( "LastLightIntensity", make_property_string( g_iLastLightIntensity ) );
index 3b51d6d03c0524f549a8203031dacfd09642bdcd..d6d9e8ed05fb592d04cc4e5db52630d43a8bb10d 100644 (file)
@@ -207,6 +207,13 @@ ui::Toolbar create_filter_toolbar(){
 //                     gtk_toolbar_set_show_arrow( toolbar, TRUE );
                        toolbar.show();
 
+
+                       auto space = [&]() {
+                               auto btn = ui::ToolItem::from(gtk_separator_tool_item_new());
+                               btn.show();
+                               toolbar.add(btn);
+                       };
+
                        g_signal_connect( G_OBJECT( toolbar ), "enter_notify_event", G_CALLBACK( ToggleActions0 ), 0 );
 
                        toolbar_append_toggle_button( toolbar, "World (ALT + 1)", "f-world.png", "FilterWorldBrushes" );
@@ -231,7 +238,7 @@ ui::Toolbar create_filter_toolbar(){
                        space();
 
                        {
-                               auto button = toolbar_append_toggle_button( filter_toolbar, "Areaportals (ALT + 3)\nRightClick: toggle tex\n\tnoDraw\n\tnoDrawNonSolid", "f-areaportal.png", "FilterAreaportals" );
+                               auto button = toolbar_append_toggle_button( 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 );
                        }
 
@@ -266,7 +273,7 @@ ui::Toolbar create_filter_toolbar(){
                        toolbar_append_toggle_button( toolbar, "Models (SHIFT + M)", "f-models.png", "FilterModels" );
 
                        {
-                               auto button = toolbar_append_toggle_button( filter_toolbar, "Triggers (CTRL + SHIFT + T)\nRightClick: tex Trigger", "f-triggers.png", "FilterTriggers" );
+                               auto button = toolbar_append_toggle_button( 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 );
                        }
 
index 86c7c677553c512274a386f5cd6db1819ae5aac5..7860a5b98e0f44b7aab5e899be91aff9b532caeb 100644 (file)
@@ -2561,13 +2561,11 @@ ui::Toolbar create_main_toolbar( MainFrame::EViewStyle style ){
        space();
 
        ComponentModes_constructToolbar( toolbar );
-       gtk_toolbar_append_space( toolbar );
 
        if ( style == MainFrame::eRegular || style == MainFrame::eRegularLeft ) {
                space();
 
                XYWnd_constructToolbar( toolbar );
-               gtk_toolbar_append_space( toolbar );
        }
 
        space();
@@ -2577,19 +2575,16 @@ ui::Toolbar create_main_toolbar( MainFrame::EViewStyle style ){
        space();
 
        Manipulators_constructToolbar( toolbar );
-       gtk_toolbar_append_space( toolbar );
 
        if ( g_Layout_enablePatchToolbar.m_value ) {
                space();
 
                Patch_constructToolbar( toolbar );
-               gtk_toolbar_append_space( toolbar );
        }
 
        space();
 
        toolbar_append_toggle_button( toolbar, "Texture Lock (SHIFT + T)", "texture_lock.png", "TogTexLock" );
-       gtk_toolbar_append_space( toolbar );
 
        space();
 
@@ -3417,8 +3412,7 @@ void Layout_constructPreferences( PreferencesPage& page ){
                );
        page.appendCheckBox(
                "", "Main Toolbar",
-               LatchedBoolImportCaller( g_Layout_enableMainToolbar ),
-               BoolExportCaller( g_Layout_enableMainToolbar.m_latched )
+               make_property( g_Layout_enableMainToolbar )
                );
        if ( !string_empty( g_pGameDescription->getKeyValue( "no_patch" ) ) ) {
                page.appendCheckBox(
index f71ee94e49e3fb83cfa31daa942a0b39b1b239e8..b545c32be11581aa945abfa88ffaa66dfca3adc5 100644 (file)
@@ -1318,9 +1318,15 @@ void ConstructRegionStartpoint( scene::Node* startpoint, const Vector3& region_m
  */
 bool region_active = false;
 
-BoolExportCaller g_region_caller( region_active );
+ConstReferenceCaller<bool, void(const Callback<void(bool)> &), PropertyImpl<bool>::Export> g_region_caller( region_active );
+
 ToggleItem g_region_item( g_region_caller );
 
+/*void Map_ToggleRegion(){
+       region_active = !region_active;
+       g_region_item.update();
+}*/
+
 Vector3 region_mins( g_MinWorldCoord, g_MinWorldCoord, g_MinWorldCoord );
 Vector3 region_maxs( g_MaxWorldCoord, g_MaxWorldCoord, g_MaxWorldCoord );
 
@@ -2271,7 +2277,7 @@ void Map_Construct(){
        GlobalCommands_insert( "RegionSetXY", makeCallbackF(RegionXY) );
        GlobalCommands_insert( "RegionSetBrush", makeCallbackF(RegionBrush) );
        //GlobalCommands_insert( "RegionSetSelection", makeCallbackF(RegionSelected), Accelerator( 'R', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) );
-       GlobalCommands_insert( "RegionSetSelection", ToggleItem::AddCallbackCaller( g_region_item ), Accelerator( 'R', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) );
+       GlobalToggles_insert( "RegionSetSelection", makeCallbackF(RegionSelected), ToggleItem::AddCallbackCaller( g_region_item ), Accelerator( 'R', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) );
 
        GlobalPreferenceSystem().registerPreference( "LastMap", make_property_string( g_strLastMap ) );
        GlobalPreferenceSystem().registerPreference( "LoadLastMap", make_property_string( g_bLoadLastMap ) );
index e0daa5fb66fb91e53576a06a95a261821f0206bb..adae13d7931851ca7a2a4de36cb264bf4ae53dba 100644 (file)
@@ -719,7 +719,8 @@ inline void hide_node( scene::Node& node, bool hide ){
 
 bool g_nodes_be_hidden = false;
 
-BoolExportCaller g_hidden_caller( g_nodes_be_hidden );
+ConstReferenceCaller<bool, void(const Callback<void(bool)> &), PropertyImpl<bool>::Export> g_hidden_caller( g_nodes_be_hidden );
+
 ToggleItem g_hidden_item( g_hidden_caller );
 
 class HideSelectedWalker : public scene::Graph::Walker
@@ -781,8 +782,8 @@ void Select_ShowAllHidden(){
 }
 
 void Hide_registerCommands(){
-       GlobalCommands_insert( "ShowHidden", FreeCaller<Select_ShowAllHidden>(), Accelerator( 'H', (GdkModifierType)GDK_SHIFT_MASK ) );
-       GlobalToggles_insert( "HideSelected", FreeCaller<HideSelected>(), ToggleItem::AddCallbackCaller( g_hidden_item ), Accelerator( 'H' ) );
+       GlobalCommands_insert( "ShowHidden", makeCallbackF( Select_ShowAllHidden ), Accelerator( 'H', (GdkModifierType)GDK_SHIFT_MASK ) );
+       GlobalToggles_insert( "HideSelected", makeCallbackF( HideSelected ), ToggleItem::AddCallbackCaller( g_hidden_item ), Accelerator( 'H' ) );
 }
 
 
index 7bbcb10aed58269849f0776353cb1cf970da14b6..1bf60618169173a9c7bda1ed111223462ec60a87 100644 (file)
@@ -3747,7 +3747,7 @@ void SelectionSystem_constructPage( PreferenceGroup& group ){
        SelectionSystem_constructPreferences( page );
 }
 void SelectionSystem_registerPreferencesPage(){
-       PreferencesDialog_addSettingsPage( FreeCaller1<PreferenceGroup&, SelectionSystem_constructPage>() );
+       PreferencesDialog_addSettingsPage( FreeCaller<void(PreferenceGroup&), SelectionSystem_constructPage>() );
 }
 
 
@@ -3767,7 +3767,7 @@ void SelectionSystem_Construct(){
 
        GlobalShaderCache().attachRenderable( getSelectionSystem() );
 
-       GlobalPreferenceSystem().registerPreference( "PreferPointEntsIn2D", BoolImportStringCaller( getSelectionSystem().m_bPreferPointEntsIn2D ), BoolExportStringCaller( getSelectionSystem().m_bPreferPointEntsIn2D ) );
+       GlobalPreferenceSystem().registerPreference( "PreferPointEntsIn2D", make_property_string( getSelectionSystem().m_bPreferPointEntsIn2D ) );
        SelectionSystem_registerPreferencesPage();
 }
 
index 1f5938ac81b9f482b4bad0ffef056a14e9c05a2e..4af0c3a1dd5ef7cf6517f127d058d9476aa5ef0a 100644 (file)
@@ -2768,7 +2768,6 @@ EntityClassMenu g_EntityClassMenu;
 // Names
 void ShowNamesToggle(){
        GlobalEntityCreator().setShowNames( !GlobalEntityCreator().getShowNames() );
-//     g_show_names.update();
        XY_UpdateAllWindows();
 }
 
@@ -2783,7 +2782,6 @@ typedef FreeCaller<void(const Callback<void(bool)> &), ShowNamesExport> ShowName
 // Angles
 void ShowAnglesToggle(){
        GlobalEntityCreator().setShowAngles( !GlobalEntityCreator().getShowAngles() );
-//     g_show_angles.update();
        XY_UpdateAllWindows();
 }
 
@@ -2797,7 +2795,6 @@ typedef FreeCaller<void(const Callback<void(bool)> &), ShowAnglesExport> ShowAng
 // Blocks
 void ShowBlocksToggle(){
        g_xywindow_globals_private.show_blocks ^= 1;
-//     g_show_blocks.update();
        XY_UpdateAllWindows();
 }
 
@@ -2812,7 +2809,6 @@ typedef FreeCaller<void(const Callback<void(bool)> &), ShowBlocksExport> ShowBlo
 // Coordinates
 void ShowCoordinatesToggle(){
        g_xywindow_globals_private.show_coordinates ^= 1;
-//     g_show_coordinates.update();
        XY_UpdateAllWindows();
 }
 
@@ -2827,7 +2823,6 @@ typedef FreeCaller<void(const Callback<void(bool)> &), ShowCoordinatesExport> Sh
 // Outlines
 void ShowOutlineToggle(){
        g_xywindow_globals_private.show_outline ^= 1;
-//     g_show_outline.update();
        XY_UpdateAllWindows();
 }
 
@@ -2842,7 +2837,6 @@ typedef FreeCaller<void(const Callback<void(bool)> &), ShowOutlineExport> ShowOu
 // Axes
 void ShowAxesToggle(){
        g_xywindow_globals_private.show_axis ^= 1;
-//     g_show_axes.update();
        XY_UpdateAllWindows();
 }
 typedef FreeCaller<void(), ShowAxesToggle> ShowAxesToggleCaller;
@@ -2856,7 +2850,6 @@ typedef FreeCaller<void(const Callback<void(bool)> &), ShowAxesExport> ShowAxesE
 // Workzone
 void ShowWorkzoneToggle(){
        g_xywindow_globals_private.d_show_work ^= 1;
-//     g_show_workzone.update();
        XY_UpdateAllWindows();
 }
 typedef FreeCaller<void(), ShowWorkzoneToggle> ShowWorkzoneToggleCaller;
@@ -2880,7 +2873,6 @@ void Texdef_ToggleMoveLock(){
 // Size
 void ShowSizeToggle(){
        g_xywindow_globals_private.m_bSizePaint = !g_xywindow_globals_private.m_bSizePaint;
-//     g_show_size_item.update();
        XY_UpdateAllWindows();
 }
 typedef FreeCaller<void(), ShowSizeToggle> ShowSizeToggleCaller;
@@ -2891,27 +2883,25 @@ typedef FreeCaller<void(const Callback<void(bool)> &), ShowSizeExport> ShowSizeE
 
 // Crosshair
 void ShowCrosshairToggle(){
-       g_bCrossHairs ^= 1;
-//     g_show_crosshair_item.update();
+       g_xywindow_globals_private.g_bCrossHairs ^= 1;
        XY_UpdateAllWindows();
 }
 typedef FreeCaller<void(), ShowCrosshairToggle> ShowCrosshairToggleCaller;
 void ShowCrosshairExport( const Callback<void(bool)> & importer ){
-       importer( g_bCrossHairs );
+       importer( g_xywindow_globals_private.g_bCrossHairs );
 }
 typedef FreeCaller<void(const Callback<void(bool)> &), ShowCrosshairExport> ShowCrosshairExportCaller;
 
 // Grid
 void ShowGridToggle(){
        g_xywindow_globals_private.d_showgrid = !g_xywindow_globals_private.d_showgrid;
-//     g_show_grid_item.update();
        XY_UpdateAllWindows();
 }
-typedef FreeCaller<void(), ShowGridTToggle> ShowGridTToggleCaller;
+typedef FreeCaller<void(), ShowGridToggle> ShowGridToggleCaller;
 void ShowGridTExport( const Callback<void(bool)> & importer ){
        importer( g_xywindow_globals_private.d_showgrid );
 }
-typedef FreeCaller<void(const Callback<void(bool)> &), ShowSizeExport> ShowSizeExportCaller;
+typedef FreeCaller<void(const Callback<void(bool)> &), ShowSizeExport> ShowGridExportCaller;
 
 
 ShowNamesExportCaller g_show_names_caller;
@@ -2956,9 +2946,9 @@ ToggleItem g_show_grid( g_show_grid_callback );
 
 
 void XYShow_registerCommands(){
-       GlobalToggles_insert( "ToggleSizePaint", FreeCaller<ToggleShowSizeInfo>(), ToggleItem::AddCallbackCaller( g_show_size_item ), Accelerator( 'J' ) );
-       GlobalToggles_insert( "ToggleCrosshairs", FreeCaller<ToggleShowCrosshair>(), ToggleItem::AddCallbackCaller( g_show_crosshair_item ), Accelerator( 'X', (GdkModifierType)GDK_SHIFT_MASK ) );
-       GlobalToggles_insert( "ToggleGrid", FreeCaller<ToggleShowGrid>(), ToggleItem::AddCallbackCaller( g_show_grid_item ), Accelerator( '0' ) );
+       GlobalToggles_insert( "ToggleSizePaint", ShowSizeToggleCaller(), ToggleItem::AddCallbackCaller( g_show_size ), Accelerator( 'J' ) );
+       GlobalToggles_insert( "ToggleCrosshairs", ShowCrosshairToggleCaller(), ToggleItem::AddCallbackCaller( g_show_crosshair ), Accelerator( 'X', (GdkModifierType)GDK_SHIFT_MASK ) );
+       GlobalToggles_insert( "ToggleGrid", ShowGridToggleCaller(), ToggleItem::AddCallbackCaller( g_show_grid ), Accelerator( '0' ) );
 
        GlobalToggles_insert( "ShowAngles", ShowAnglesToggleCaller(), ToggleItem::AddCallbackCaller( g_show_angles ) );
        GlobalToggles_insert( "ShowNames", ShowNamesToggleCaller(), ToggleItem::AddCallbackCaller( g_show_names ) );