auto vbox2 = create_dialog_vbox( 0, 4 );
frame.add(vbox2);
+ const char* engine;
+ #if defined( WIN32 )
+ engine = g_pGameDescription->getRequiredKeyValue( "engine_win32" );
+ #elif defined( __linux__ ) || defined ( __FreeBSD__ )
+ engine = g_pGameDescription->getRequiredKeyValue( "engine_linux" );
+ #elif defined( __APPLE__ )
+ engine = g_pGameDescription->getRequiredKeyValue( "engine_macos" );
+ #else
+ #error "unsupported platform"
+ #endif
+ StringOutputStream text( 256 );
+ text << "Select directory, where game executable sits (typically \"" << engine << "\")\n";
+ GtkLabel* label = GTK_LABEL( gtk_label_new( text.c_str() ) );
+ gtk_widget_show( GTK_WIDGET( label ) );
+ gtk_container_add( GTK_CONTAINER( vbox2 ), GTK_WIDGET( label ) );
+
{
- PreferencesPage preferencesPage( *this, vbox2 );
- Paths_constructPreferences( preferencesPage );
+ PreferencesPage page( *this, vbox2 );
+ Paths_constructBasicPreferences( page );
}
- return ui::Window(create_simple_modal_dialog_window( "Engine Path Not Found", m_modal, frame ));
+ return ui::Window(create_simple_modal_dialog_window( "Engine Path Configuration", m_modal, frame ));
}
};
g_restart_required.push_back( staticName );
}
-void PreferencesDialog_showDialog(){
- //if ( ConfirmModified( "Edit Preferences" ) && g_Preferences.DoModal() == eIDOK ) {
- if ( g_Preferences.DoModal() == eIDOK ) {
+bool PreferencesDialog_isRestartRequired(){
+ return !g_restart_required.empty();
+}
+
+void PreferencesDialog_restartIfRequired(){
- if ( !g_restart_required.empty() ) {
- StringOutputStream message( 256 );
+ if ( !g_restart_required.empty() ) {
+ StringOutputStream message( 256 );
- message << "Preference changes require a restart:\n";
+ message << "Preference changes require a restart:\n\n";
+
- for ( std::vector<const char*>::iterator i = g_restart_required.begin(); i != g_restart_required.end(); ++i )
- {
- message << ( *i ) << '\n';
- }
+ for ( std::vector<const char*>::iterator i = g_restart_required.begin(); i != g_restart_required.end(); ++i )
+ {
+ message << ( *i ) << '\n';
+ }
- ui::alert( MainFrame_getWindow(), message.c_str() );
+
+ message << "\nRestart now?";
+
+ auto ret = ui::alert( MainFrame_getWindow(), message.c_str(), "Restart " RADIANT_NAME "?", ui::alert_type::YESNO, ui::alert_icon::Question );
+
- g_restart_required.clear();
+ g_restart_required.clear();
+
+ if ( ret == ui::alert_response::YES ) {
+ g_GamesDialog.m_bSkipGamePromptOnce = true;
+ Radiant_Restart();
}
}
}
CGameDialog() :
m_sGameFile( "" ),
- m_bGamePrompt( true ),
+ m_bGamePrompt( false ),
+ m_bSkipGamePromptOnce( false ),
m_bForceLogConsole( false ){
}
virtual ~CGameDialog();
ui::Widget m_notebook{ui::null};
- virtual ~PrefsDlg() {
+ virtual ~PrefsDlg(){
+ if (m_rc_path) {
- g_string_free( m_rc_path, true );
+ g_string_free( m_rc_path, true );
+ }
+ if (m_inipath) {
- g_string_free( m_inipath, true );
- }
+ g_string_free( m_inipath, true );
+ }
+}
/*!
path for global settings
};
void TextureBrowser_ShowDirectory( TextureBrowser& textureBrowser, const char* directory ){
+ textureBrowser.m_searchedTags = false;
if ( TextureBrowser_showWads() ) {
+ g_TextureBrowser_currentDirectory = directory;
+ TextureBrowser_heightChanged( textureBrowser );
+
Archive* archive = GlobalFileSystem().getArchive( directory );
- ASSERT_NOTNULL( archive );
+ if ( archive != nullptr )
+ {
LoadShaderVisitor visitor;
archive->forEachFile( Archive::VisitorFunc( visitor, Archive::eFiles, 0 ), "textures/" );
+
+ // Doom3-like dds/ prefix (used by DarkPlaces).
+ archive->forEachFile( Archive::VisitorFunc( visitor, Archive::eFiles, 0 ), "dds/textures/" );
+ }
+ else if ( extension_equal_i( path_get_extension( directory ), "wad" ) )
+ {
+ globalErrorStream() << "Failed to load " << directory << "\n";
+ }
}
else
{
gboolean TextureBrowser_button_press( ui::Widget widget, GdkEventButton* event, TextureBrowser* textureBrowser ){
if ( event->type == GDK_BUTTON_PRESS ) {
+ gtk_widget_grab_focus( widget );
if ( event->button == 3 ) {
- if ( GlobalTextureBrowser().m_tags ) {
+ if ( textureBrowser->m_tags ) {
textureBrowser->m_rmbSelected = true;
TextureBrowser_Selection_MouseDown( *textureBrowser, event->state, static_cast<int>( event->x ), static_cast<int>( event->y ) );