From: Thomas Debesse Date: Mon, 22 Feb 2021 22:34:28 +0000 (+0100) Subject: Merge commit '87d5b6efe557ee73b613c030cca2374dd23bc1be' into garux-merge X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=e155ebe99481333af4a7660d174db490e2a75fb5;p=xonotic%2Fnetradiant.git Merge commit '87d5b6efe557ee73b613c030cca2374dd23bc1be' into garux-merge --- e155ebe99481333af4a7660d174db490e2a75fb5 diff --cc include/ientity.h index dd3f253c,5c09d2c4..797e00a1 --- a/include/ientity.h +++ b/include/ientity.h @@@ -124,9 -123,11 +124,11 @@@ virtual void setCounter( Counter* count virtual void connectEntities( const scene::Path& e1, const scene::Path& e2, int index ) = 0; virtual void setLightRadii( bool lightRadii ) = 0; -virtual bool getLightRadii() = 0; +virtual bool getLightRadii() const = 0; virtual void setShowNames( bool showNames ) = 0; virtual bool getShowNames() = 0; + virtual void setShowTargetNames( bool showNames ) = 0; + virtual bool getShowTargetNames() = 0; virtual void setShowAngles( bool showAngles ) = 0; virtual bool getShowAngles() = 0; diff --cc plugins/entity/entity.cpp index a251bde5,0dd32115..77ad8143 --- a/plugins/entity/entity.cpp +++ b/plugins/entity/entity.cpp @@@ -367,10 -374,11 +374,11 @@@ void Entity_Construct( EGameType gameTy Static::instance().m_nameKey = "targetname"; } - GlobalPreferenceSystem().registerPreference( "SI_ShowNames", BoolImportStringCaller( g_showNames ), BoolExportStringCaller( g_showNames ) ); - GlobalPreferenceSystem().registerPreference( "SI_ShowTargetNames", BoolImportStringCaller( g_showTargetNames ), BoolExportStringCaller( g_showTargetNames ) ); - GlobalPreferenceSystem().registerPreference( "SI_ShowAngles", BoolImportStringCaller( g_showAngles ), BoolExportStringCaller( g_showAngles ) ); - GlobalPreferenceSystem().registerPreference( "NewLightStyle", BoolImportStringCaller( g_newLightDraw ), BoolExportStringCaller( g_newLightDraw ) ); - GlobalPreferenceSystem().registerPreference( "LightRadiuses", BoolImportStringCaller( g_lightRadii ), BoolExportStringCaller( g_lightRadii ) ); + GlobalPreferenceSystem().registerPreference( "SI_ShowNames", make_property_string( g_showNames ) ); ++ GlobalPreferenceSystem().registerPreference( "SI_ShowTargetNames", make_property_string( g_showTargetNames ) ); + GlobalPreferenceSystem().registerPreference( "SI_ShowAngles", make_property_string( g_showAngles ) ); + GlobalPreferenceSystem().registerPreference( "NewLightStyle", make_property_string( g_newLightDraw ) ); + GlobalPreferenceSystem().registerPreference( "LightRadiuses", make_property_string( g_lightRadii ) ); Entity_InitFilters(); LightType lightType = LIGHTTYPE_DEFAULT; diff --cc radiant/xywindow.cpp index 62e4c61c,ee957abe..ccc5f5e7 --- a/radiant/xywindow.cpp +++ b/radiant/xywindow.cpp @@@ -2846,24 -2826,41 +2846,37 @@@ void unrealise() EntityClassMenu g_EntityClassMenu; - -- -void ShowNamesExport( const BoolImportCallback& importer ){ - importer( GlobalEntityCreator().getShowNames() ); -} -typedef FreeCaller1 ShowNamesExportCaller; -ShowNamesExportCaller g_show_names_caller; -ToggleItem g_show_names( g_show_names_caller ); +// Names void ShowNamesToggle(){ GlobalEntityCreator().setShowNames( !GlobalEntityCreator().getShowNames() ); - g_show_names.update(); XY_UpdateAllWindows(); } -void ShowTargetNamesExport( const BoolImportCallback& importer ){ - importer( GlobalEntityCreator().getShowTargetNames() ); +typedef FreeCaller ShowNamesToggleCaller; + +void ShowNamesExport( const Callback & importer ){ + importer( GlobalEntityCreator().getShowNames() ); } -typedef FreeCaller1 ShowTargetNamesExportCaller; -ShowTargetNamesExportCaller g_show_targetnames_caller; -ToggleItem g_show_targetnames( g_show_targetnames_caller ); + +typedef FreeCaller &), ShowNamesExport> ShowNamesExportCaller; + ++// TargetNames + void ShowTargetNamesToggle(){ + GlobalEntityCreator().setShowTargetNames( !GlobalEntityCreator().getShowTargetNames() ); - g_show_targetnames.update(); + XY_UpdateAllWindows(); + } + -void ShowAnglesExport( const BoolImportCallback& importer ){ - importer( GlobalEntityCreator().getShowAngles() ); ++typedef FreeCaller ShowTargetNamesToggleCaller; ++ ++void ShowTargetNamesExport( const Callback & importer ){ ++ importer( GlobalEntityCreator().getShowTargetNames() ); + } -typedef FreeCaller1 ShowAnglesExportCaller; -ShowAnglesExportCaller g_show_angles_caller; -ToggleItem g_show_angles( g_show_angles_caller ); ++ ++typedef FreeCaller &), ShowTargetNamesExport> ShowTargetNamesExportCaller; ++ +// Angles void ShowAnglesToggle(){ GlobalEntityCreator().setShowAngles( !GlobalEntityCreator().getShowAngles() ); - g_show_angles.update(); XY_UpdateAllWindows(); } @@@ -2952,93 -2931,44 +2965,98 @@@ void Texdef_ToggleMoveLock() } */ -BoolExportCaller g_show_size_caller( g_xywindow_globals_private.m_bSizePaint ); -ToggleItem g_show_size_item( g_show_size_caller ); -void ToggleShowSizeInfo(){ +// Size +void ShowSizeToggle(){ g_xywindow_globals_private.m_bSizePaint = !g_xywindow_globals_private.m_bSizePaint; - g_show_size_item.update(); XY_UpdateAllWindows(); } +typedef FreeCaller ShowSizeToggleCaller; +void ShowSizeExport( const Callback & importer ){ + importer( g_xywindow_globals_private.m_bSizePaint ); +} +typedef FreeCaller &), ShowSizeExport> ShowSizeExportCaller; -BoolExportCaller g_show_crosshair_caller( g_bCrossHairs ); -ToggleItem g_show_crosshair_item( g_show_crosshair_caller ); -void ToggleShowCrosshair(){ - g_bCrossHairs ^= 1; - g_show_crosshair_item.update(); +// Crosshair +void ShowCrosshairToggle(){ + g_xywindow_globals_private.g_bCrossHairs ^= 1; XY_UpdateAllWindows(); } +typedef FreeCaller ShowCrosshairToggleCaller; +void ShowCrosshairExport( const Callback & importer ){ + importer( g_xywindow_globals_private.g_bCrossHairs ); +} +typedef FreeCaller &), ShowCrosshairExport> ShowCrosshairExportCaller; -BoolExportCaller g_show_grid_caller( g_xywindow_globals_private.d_showgrid ); -ToggleItem g_show_grid_item( g_show_grid_caller ); -void ToggleShowGrid(){ +// Grid +void ShowGridToggle(){ g_xywindow_globals_private.d_showgrid = !g_xywindow_globals_private.d_showgrid; - g_show_grid_item.update(); XY_UpdateAllWindows(); } +typedef FreeCaller ShowGridToggleCaller; +void ShowGridTExport( const Callback & importer ){ + importer( g_xywindow_globals_private.d_showgrid ); +} +typedef FreeCaller &), ShowSizeExport> ShowGridExportCaller; + + +ShowNamesExportCaller g_show_names_caller; +Callback &)> g_show_names_callback( g_show_names_caller ); +ToggleItem g_show_names( g_show_names_callback ); + ++ShowTargetNamesExportCaller g_show_targetnames_caller; ++Callback &)> g_show_targetnames_callback( g_show_targetnames_caller ); ++ToggleItem g_show_targetnames( g_show_targetnames_callback ); ++ +ShowAnglesExportCaller g_show_angles_caller; +Callback &)> g_show_angles_callback( g_show_angles_caller ); +ToggleItem g_show_angles( g_show_angles_callback ); + +ShowBlocksExportCaller g_show_blocks_caller; +Callback &)> g_show_blocks_callback( g_show_blocks_caller ); +ToggleItem g_show_blocks( g_show_blocks_callback ); + +ShowCoordinatesExportCaller g_show_coordinates_caller; +Callback &)> g_show_coordinates_callback( g_show_coordinates_caller ); +ToggleItem g_show_coordinates( g_show_coordinates_callback ); + +ShowOutlineExportCaller g_show_outline_caller; +Callback &)> g_show_outline_callback( g_show_outline_caller ); +ToggleItem g_show_outline( g_show_outline_callback ); + +ShowAxesExportCaller g_show_axes_caller; +Callback &)> g_show_axes_callback( g_show_axes_caller ); +ToggleItem g_show_axes( g_show_axes_callback ); + +ShowWorkzoneExportCaller g_show_workzone_caller; +Callback &)> g_show_workzone_callback( g_show_workzone_caller ); +ToggleItem g_show_workzone( g_show_workzone_callback ); + +ShowSizeExportCaller g_show_size_caller; +Callback &)> g_show_size_callback( g_show_size_caller ); +ToggleItem g_show_size( g_show_size_callback ); + +ShowCrosshairExportCaller g_show_crosshair_caller; +Callback &)> g_show_crosshair_callback( g_show_crosshair_caller ); +ToggleItem g_show_crosshair( g_show_crosshair_callback ); + +ShowGridExportCaller g_show_grid_caller; +Callback &)> g_show_grid_callback( g_show_grid_caller ); +ToggleItem g_show_grid( g_show_grid_callback ); void XYShow_registerCommands(){ - GlobalToggles_insert( "ToggleSizePaint", FreeCaller(), ToggleItem::AddCallbackCaller( g_show_size_item ), Accelerator( 'J' ) ); - GlobalToggles_insert( "ToggleCrosshairs", FreeCaller(), ToggleItem::AddCallbackCaller( g_show_crosshair_item ), Accelerator( 'X', (GdkModifierType)GDK_SHIFT_MASK ) ); - GlobalToggles_insert( "ToggleGrid", FreeCaller(), 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", FreeCaller(), ToggleItem::AddCallbackCaller( g_show_angles ) ); - GlobalToggles_insert( "ShowNames", FreeCaller(), ToggleItem::AddCallbackCaller( g_show_names ) ); - GlobalToggles_insert( "ShowTargetNames", FreeCaller(), ToggleItem::AddCallbackCaller( g_show_targetnames ) ); - GlobalToggles_insert( "ShowBlocks", FreeCaller(), ToggleItem::AddCallbackCaller( g_show_blocks ) ); - GlobalToggles_insert( "ShowCoordinates", FreeCaller(), ToggleItem::AddCallbackCaller( g_show_coordinates ) ); - GlobalToggles_insert( "ShowWindowOutline", FreeCaller(), ToggleItem::AddCallbackCaller( g_show_outline ) ); - GlobalToggles_insert( "ShowAxes", FreeCaller(), ToggleItem::AddCallbackCaller( g_show_axes ) ); - GlobalToggles_insert( "ShowWorkzone", FreeCaller(), ToggleItem::AddCallbackCaller( g_show_workzone ) ); + GlobalToggles_insert( "ShowAngles", ShowAnglesToggleCaller(), ToggleItem::AddCallbackCaller( g_show_angles ) ); + GlobalToggles_insert( "ShowNames", ShowNamesToggleCaller(), ToggleItem::AddCallbackCaller( g_show_names ) ); ++ GlobalToggles_insert( "ShowTargetNames", ShowTargetNamesToggleCaller(), ToggleItem::AddCallbackCaller( g_show_targetnames ) ); + GlobalToggles_insert( "ShowBlocks", ShowBlocksToggleCaller(), ToggleItem::AddCallbackCaller( g_show_blocks ) ); + GlobalToggles_insert( "ShowCoordinates", ShowCoordinatesToggleCaller(), ToggleItem::AddCallbackCaller( g_show_coordinates ) ); + GlobalToggles_insert( "ShowWindowOutline", ShowOutlineToggleCaller(), ToggleItem::AddCallbackCaller( g_show_outline ) ); + GlobalToggles_insert( "ShowAxes", ShowAxesToggleCaller(), ToggleItem::AddCallbackCaller( g_show_axes ) ); + GlobalToggles_insert( "ShowWorkzone", ShowWorkzoneToggleCaller(), ToggleItem::AddCallbackCaller( g_show_workzone ) ); } void XYWnd_registerShortcuts(){