]> git.xonotic.org Git - xonotic/netradiant.git/blobdiff - radiant/grid.cpp
Introduce Property<T> to simplify preferences system
[xonotic/netradiant.git] / radiant / grid.cpp
index be267002a7ec66508bfa6e8fc2259b7731161b1b..df1e1c1a2e0df41a3a0607f6813622a1f036c3f2 100644 (file)
@@ -134,10 +134,10 @@ void set(){
        setGridPower( m_id );
 }
 typedef MemberCaller<GridMenuItem, void(), &GridMenuItem::set> SetCaller;
-void active( const ImportExportCallback<bool>::Import_t& importCallback ){
+void active( const Callback<void(bool)> &importCallback ){
        importCallback( g_grid_power == m_id );
 }
-typedef MemberCaller<GridMenuItem, void(const ImportExportCallback<bool>::Import_t&), &GridMenuItem::active> ExportCaller;
+typedef MemberCaller<GridMenuItem, void(const Callback<void(bool)>&), &GridMenuItem::active> ExportCaller;
 };
 
 GridMenuItem g_gridMenu0125( GRIDPOWER_0125 );
@@ -254,7 +254,7 @@ void Grid_construct(){
 
        g_grid_default = GridDefault_forGridPower( GRIDPOWER_8 );
 
-       GlobalPreferenceSystem().registerPreference( "GridDefault", IntImportStringCaller( g_grid_default ), IntExportStringCaller( g_grid_default ) );
+       GlobalPreferenceSystem().registerPreference( "GridDefault", make_property_string( g_grid_default ) );
 
        g_grid_power = GridPower_forGridDefault( g_grid_default );
        g_gridsize = GridSize_forGridPower( g_grid_power );