]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - radiant/entity.cpp
Merge commit '5a8c27d93c0c57243722ade7aa3ca1f696de46f2' into garux-merge
[xonotic/netradiant.git] / radiant / entity.cpp
index ffc8af303bb65c1b59694d3bc14b3aad9b640855..765ac6e78fa5c828936625cd0b398a1c5702bff1 100644 (file)
@@ -575,7 +575,7 @@ const char *misc_model_dialog( ui::Widget parent ){
        }
        return 0;
 }
-
+/*
 struct LightRadii {
        static void Export(const EntityCreator &self, const Callback<void(bool)> &returnz) {
                returnz(self.getLightRadii());
@@ -600,8 +600,19 @@ void Entity_constructPage( PreferenceGroup& group ){
 void Entity_registerPreferencesPage(){
        PreferencesDialog_addDisplayPage( makeCallbackF(Entity_constructPage) );
 }
+*/
 
-
+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(){
+       GlobalEntityCreator().setLightRadii( !GlobalEntityCreator().getLightRadii() );
+       g_show_lightradii_item.update();
+       UpdateAllWindows();
+}
 void Entity_constructMenu( ui::Menu menu ){
        create_menu_item_with_mnemonic( menu, "_Regroup", "GroupSelection" );
        create_menu_item_with_mnemonic( menu, "_Ungroup", "UngroupSelection" );
@@ -622,10 +633,12 @@ 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 ) );
+
        GlobalPreferenceSystem().registerPreference( "SI_Colors5", make_property_string( g_entity_globals.color_entity ) );
        GlobalPreferenceSystem().registerPreference( "LastLightIntensity", make_property_string( g_iLastLightIntensity ) );
 
-       Entity_registerPreferencesPage();
+//     Entity_registerPreferencesPage();
 }
 
 void Entity_Destroy(){