示例#1
0
// 設定保存
void CEqualizer::SaveSettings() const
{
	::WritePrivateProfileInt(TEXT("Settings"),TEXT("Enable"),m_fEnable,m_szIniFileName);
	::WritePrivateProfileInt(TEXT("Settings"),TEXT("WindowLeft"),m_WindowPosition.x,m_szIniFileName);
	::WritePrivateProfileInt(TEXT("Settings"),TEXT("WindowTop"),m_WindowPosition.y,m_szIniFileName);
	WritePreset(TEXT("Settings"),TEXT("CurSetting"),&m_CurSettings);

	::WritePrivateProfileInt(TEXT("Preset"),TEXT("Count"),NUM_CUSTOM_PRESETS,m_szIniFileName);
	for (int i=0;i<NUM_CUSTOM_PRESETS;i++) {
		TCHAR szName[16];
		::wsprintf(szName,TEXT("Preset%d"),i);
		WritePreset(TEXT("Preset"),szName,&m_CustomPresetList[i]);
	}
}
bool ExportPresetFromGraph(USubstanceGraphInstance* GraphInstance)
{
	check(GraphInstance != NULL);
	preset_t Preset;
	FString Data;
	
	Preset.ReadFrom(GraphInstance->Instance);
	WritePreset(Preset, Data);
	FString PresetFileName = SubstanceEditor::Helpers::ExportPresetFile(Preset.mLabel);
	if (PresetFileName.Len())
	{
		return FFileHelper::SaveStringToFile(Data, *PresetFileName);
	}

	return false;
}