Пример #1
0
void App::LoadSettings()
{
    Helium::FilePath path;
    Helium::GetPreferencesDirectory( path );
    path += TXT("EditorSettings.json");

    if ( !path.Exists() )
    {
        return;
    }

    SettingsManagerPtr settingsManager = Reflect::SafeCast< SettingsManager >( Persist::ArchiveReader::ReadFromFile( path ) );
    if ( settingsManager.ReferencesObject() )
    {
        settingsManager->Clean();
        m_SettingsManager = settingsManager;
    }
    else
    {
        wxMessageBox( TXT( "Unfortunately, we could not parse your existing settings.  Your settings have been reset to defaults.  We apologize for the inconvenience." ), wxT( "Error" ), wxOK | wxCENTER | wxICON_ERROR );
    }
}
Пример #2
0
void App::LoadSettings()
{
	Helium::FilePath path;
	Helium::GetPreferencesDirectory( path );
	path += TXT("EditorSettings.json"); // Leaving this as XML for now until I can figure out why the well-formed .json file is not parsing. I suspect something subtle with translating maps with pointers.

	if ( !path.Exists() )
	{
		return;
	}

	SettingsManagerPtr settingsManager = Reflect::SafeCast< SettingsManager >( Persist::ArchiveReader::ReadFromFile( path ) );
	if ( settingsManager.ReferencesObject() )
	{
		settingsManager->Clean();
		m_SettingsManager = settingsManager;
	}
	else
	{
		wxMessageBox( TXT( "Unfortunately, we could not parse your existing settings.  Your settings have been reset to defaults.  We apologize for the inconvenience." ), wxT( "Error" ), wxOK | wxCENTER | wxICON_ERROR );
	}
}