]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - radiant/map.cpp
radiant/q3map2: add option to disable engine path and home path
[xonotic/netradiant.git] / radiant / map.cpp
index 5523f431c60a114de44e52e5e372a9fb8fe04d04..5c91dfad8e183cec87712f376b31d2cf48dd2998 100644 (file)
@@ -833,9 +833,9 @@ void DoMapInfo(){
                        vbox.pack_start( scr, TRUE, TRUE, 0 );
 
                        {
-                               ui::ListStore store = ui::ListStore(gtk_list_store_new( 2, G_TYPE_STRING, G_TYPE_STRING ));
+                               auto store = ui::ListStore::from(gtk_list_store_new( 2, G_TYPE_STRING, G_TYPE_STRING ));
 
-                               auto view = ui::TreeView(ui::TreeModel(store ));
+                               auto view = ui::TreeView(ui::TreeModel::from(store._handle));
                                gtk_tree_view_set_headers_clickable(view, TRUE );
 
                                {
@@ -1540,7 +1540,27 @@ tryDecompile:
                output.push_string( EnginePath_get() );
                output.push_string( "\" -fs_homepath \"" );
                output.push_string( g_qeglobals.m_userEnginePath.c_str() );
-               output.push_string( "\" -fs_game " );
+               output.push_string( "\"" );
+
+               // extra pakpaths
+               for ( int i = 0; i < g_pakPathCount; i++ ) {
+                       if ( g_strcmp0( g_strPakPath[i].c_str(), "") ) {
+                               output.push_string( " -fs_pakpath \"" );
+                               output.push_string( g_strPakPath[i].c_str() );
+                               output.push_string( "\"" );
+                       }
+               }
+
+               // extra switches
+               if ( g_disableEnginePath ) {
+                       output.push_string( " -fs_nobasepath " );
+               }
+
+               if ( g_disableHomePath ) {
+                       output.push_string( " -fs_nohomepath " );
+               }
+
+               output.push_string( " -fs_game " );
                output.push_string( gamename_get() );
                output.push_string( " -convert -format " );
                output.push_string( Brush::m_type == eBrushTypeQuake3BP ? "map_bp" : "map" );
@@ -1788,7 +1808,7 @@ const char* getMapsPath(){
 
 const char* getLastFolderPath(){
        if (g_strLastFolder.empty()) {
-               GlobalPreferenceSystem().registerPreference( "LastFolder", CopiedStringImportStringCaller( g_strLastFolder ), CopiedStringExportStringCaller( g_strLastFolder ) );
+               GlobalPreferenceSystem().registerPreference( "LastFolder", make_property_string( g_strLastFolder ) );
                if (g_strLastFolder.empty()) {
                        g_strLastFolder = g_qeglobals.m_userGamePath;
                }
@@ -2161,16 +2181,16 @@ CopiedString g_strLastMap;
 bool g_bLoadLastMap = false;
 
 void Map_Construct(){
-       GlobalCommands_insert( "RegionOff", FreeCaller<void(), RegionOff>() );
-       GlobalCommands_insert( "RegionSetXY", FreeCaller<void(), RegionXY>() );
-       GlobalCommands_insert( "RegionSetBrush", FreeCaller<void(), RegionBrush>() );
-       GlobalCommands_insert( "RegionSetSelection", FreeCaller<void(), RegionSelected>(), Accelerator( 'R', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) );
+       GlobalCommands_insert( "RegionOff", makeCallbackF(RegionOff) );
+       GlobalCommands_insert( "RegionSetXY", makeCallbackF(RegionXY) );
+       GlobalCommands_insert( "RegionSetBrush", makeCallbackF(RegionBrush) );
+       GlobalCommands_insert( "RegionSetSelection", makeCallbackF(RegionSelected), Accelerator( 'R', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) );
 
-       GlobalPreferenceSystem().registerPreference( "LastMap", CopiedStringImportStringCaller( g_strLastMap ), CopiedStringExportStringCaller( g_strLastMap ) );
-       GlobalPreferenceSystem().registerPreference( "LoadLastMap", BoolImportStringCaller( g_bLoadLastMap ), BoolExportStringCaller( g_bLoadLastMap ) );
-       GlobalPreferenceSystem().registerPreference( "MapInfoDlg", WindowPositionImportStringCaller( g_posMapInfoWnd ), WindowPositionExportStringCaller( g_posMapInfoWnd ) );
+       GlobalPreferenceSystem().registerPreference( "LastMap", make_property_string( g_strLastMap ) );
+       GlobalPreferenceSystem().registerPreference( "LoadLastMap", make_property_string( g_bLoadLastMap ) );
+       GlobalPreferenceSystem().registerPreference( "MapInfoDlg", make_property<WindowPosition_String>( g_posMapInfoWnd ) );
 
-       PreferencesDialog_addSettingsPreferences( FreeCaller<void(PreferencesPage&), Map_constructPreferences>() );
+       PreferencesDialog_addSettingsPreferences( makeCallbackF(Map_constructPreferences) );
 
        GlobalEntityClassManager().attach( g_MapEntityClasses );
        Radiant_attachHomePathsObserver( g_MapModuleObserver );