-void QE_entityCountChanged(){
- g_numentities = int(g_entityCount.get() );
- QE_UpdateStatusBar();
-}
-
-bool ConfirmModified( const char* title ){
- if ( !Map_Modified( g_map ) ) {
- return true;
- }
-
- auto result = ui::alert( MainFrame_getWindow(), "The current map has changed since it was last saved.\nDo you want to save the current map before continuing?", title, ui::alert_type::YESNOCANCEL, ui::alert_icon::Question );
- if ( result == ui::alert_response::CANCEL ) {
- return false;
- }
- if ( result == ui::alert_response::YES ) {
- if ( Map_Unnamed( g_map ) ) {
- return Map_SaveAs();
- }
- else
- {
- return Map_Save();
- }
- }
- return true;
-}
-
-void bsp_init(){
- build_set_variable( "RadiantPath", AppPath_get() );
- build_set_variable( "ExecutableType", RADIANT_EXECUTABLE );
- build_set_variable( "EnginePath", EnginePath_get() );
- build_set_variable( "UserEnginePath", g_qeglobals.m_userEnginePath.c_str() );
- build_set_variable( "MonitorAddress", ( g_WatchBSP_Enabled ) ? "127.0.0.1:39000" : "" );
- build_set_variable( "GameName", gamename_get() );
-
- StringBuffer ExtraQ3map2Args;
- // extra pakpaths
- for ( int i = 0; i < g_pakPathCount; i++ ) {
- if ( g_strcmp0( g_strPakPath[i].c_str(), "") ) {
- ExtraQ3map2Args.push_string( " -fs_pakpath \"" );
- ExtraQ3map2Args.push_string( g_strPakPath[i].c_str() );
- ExtraQ3map2Args.push_string( "\"" );
- }
- }
-
- // extra switches
- if ( g_disableEnginePath ) {
- ExtraQ3map2Args.push_string( " -fs_nobasepath " );
- }
-
- if ( g_disableHomePath ) {
- ExtraQ3map2Args.push_string( " -fs_nohomepath " );
- }
-
- build_set_variable( "ExtraQ3map2Args", ExtraQ3map2Args.c_str() );
-
- const char* mapname = Map_Name( g_map );
- StringOutputStream name( 256 );
- name << StringRange( mapname, path_get_filename_base_end( mapname ) ) << ".bsp";
-
- build_set_variable( "MapFile", mapname );
- build_set_variable( "BspFile", name.c_str() );