void AppSettings::WriteSettings(Interface *gi)
{
	TCHAR iniName[MAX_PATH];
	GetIniFileName(iniName);
	if (-1 != _taccess(iniName, 0))
	{
		SetIniValue(Name.c_str(), TEXT("NiVersion"), NiVersion.c_str(), iniName);
		SetIniValue(Name.c_str(), TEXT("NiUserVersion"), FormatString(TEXT("%d"), NiUserVersion).c_str(), iniName);
		SetIniValue(Name.c_str(), TEXT("NiUserVersion2"), FormatString(TEXT("%d"), NiUserVersion2).c_str(), iniName);
	}
}
Пример #2
0
void Exporter::writeKfConfig(Interface *i)
{
   TCHAR iniName[MAX_PATH];
   LPCTSTR pluginDir = i->GetDir(APP_PLUGCFG_DIR);
   PathCombine(iniName, pluginDir, _T("MaxNifTools.ini"));

   SetIniValue(KfExportSection, _T("IncludeHidden"), mExportHidden, iniName);
   SetIniValue(KfExportSection, _T("Lights"), mExportLights, iniName);
   SetIniValue(KfExportSection, _T("Cameras"), mExportCameras, iniName);
   SetIniValue(KfExportSection, _T("Transforms"), mExportTransforms, iniName);
   SetIniValue<float>(KfExportSection, _T("Priority"), mDefaultPriority, iniName);
}
Пример #3
0
void Exporter::writeConfig(Interface *i)
{
   if (mUseRegistry)
   {
      HKEY hKey;
      if (RegCreateKey(HKEY_CURRENT_USER, REGPATH, &hKey) != ERROR_SUCCESS)
         return;

      regSet(hKey, _T("npx_ver"), mVersion);
      regSet(hKey, _T("npx_tristrips"), mTriStrips);
      regSet(hKey, _T("npx_hidden"), mExportHidden);
      regSet(hKey, _T("npx_furn"), mExportFurn);
      regSet(hKey, _T("npx_lights"), mExportLights);
      regSet(hKey, _T("npx_vcolors"), mVertexColors);
      //	regSet(hKey, "npx_wthresh", mWeldThresh);
      regSet(hKey, _T("npx_tprefix"), mTexPrefix);
      regSet(hKey, _T("npx_coll"), mExportCollision);
      regSet(hKey, _T("npx_remap"), mRemapIndices);

      RegCloseKey(hKey);
   }
   else
   {
      TCHAR iniName[MAX_PATH];
      GetIniFileName(iniName);

      SetIniValue(NifExportSection, _T("GenerateStrips"), mTriStrips, iniName);    
      SetIniValue(NifExportSection, _T("IncludeHidden"), mExportHidden, iniName);
      SetIniValue(NifExportSection, _T("FurnatureMarkers"), mExportFurn, iniName);
      SetIniValue(NifExportSection, _T("Lights"), mExportLights, iniName);
      SetIniValue(NifExportSection, _T("VertexColors"), mVertexColors, iniName);
      SetIniValue(NifExportSection, _T("TexturePrefix"), mTexPrefix, iniName);
      SetIniValue(NifExportSection, _T("ExportCollision"), mExportCollision, iniName);
      SetIniValue(NifExportSection, _T("RemapIndices"), mRemapIndices, iniName);

      SetIniValue(NifExportSection, _T("ExportExtraNodes"), mExportExtraNodes, iniName);
      SetIniValue(NifExportSection, _T("ExportSkin"), mExportSkin, iniName);
      SetIniValue(NifExportSection, _T("UserPropBuffer"), mUserPropBuffer, iniName);
      SetIniValue(NifExportSection, _T("FlattenHierarchy"), mFlattenHierarchy, iniName);
      SetIniValue(NifExportSection, _T("RemoveUnreferencedBones"), mRemoveUnreferencedBones, iniName);
      SetIniValue(NifExportSection, _T("SortNodesToEnd"), mSortNodesToEnd, iniName);
      SetIniValue(NifExportSection, _T("SkeletonOnly"), mSkeletonOnly, iniName);
      SetIniValue(NifExportSection, _T("Cameras"), mExportCameras, iniName);
      SetIniValue(NifExportSection, _T("GenerateBoneCollision"), mGenerateBoneCollision, iniName);

      SetIniValue(NifExportSection, _T("ExportTransforms"), mExportTransforms, iniName);
      SetIniValue<int>(NifExportSection, _T("ExportType"), mExportType, iniName);     
      SetIniValue<float>(KfExportSection, _T("Priority"), mDefaultPriority, iniName);

      SetIniValue(NifExportSection, _T("MultiplePartitions"), mMultiplePartitions, iniName);
      SetIniValue<int>(NifExportSection, _T("BonesPerVertex"), mBonesPerVertex, iniName);     
      SetIniValue<int>(KfExportSection, _T("BonesPerPartition"), mBonesPerPartition, iniName);
      //SetIniValue(NifExportSection, "UseTimeTags", mUseTimeTags, iniName);

      SetIniValue(NifExportSection, _T("AllowAccum"), mAllowAccum, iniName);
      SetIniValue(NifExportSection, _T("CollapseTransforms"), mCollapseTransforms, iniName);
      SetIniValue(NifExportSection, _T("ZeroTransforms"), mZeroTransforms, iniName);
      SetIniValue(NifExportSection, _T("FixNormals"), mFixNormals, iniName);
      SetIniValue(NifExportSection, _T("TangentAndBinormalExtraData"), mTangentAndBinormalExtraData, iniName);
      SetIniValue(NifExportSection, _T("UseAlternateStripper"), mUseAlternateStripper, iniName);
      SetIniValue(NifExportSection, _T("TangentAndBinormalMethod"), mTangentAndBinormalMethod, iniName);
      SetIniValue(NifExportSection, _T("StartNifskopeAfterStart"), mStartNifskopeAfterStart, iniName);
      //SetIniValue(CollisionSection, "bhkScaleFactor", bhkScaleFactor, iniName);

      SetIniValue<std::wstring>(NifExportSection, _T("Creator"), mCreatorName, iniName);
      SetIniValue(NifExportSection, _T("GeneratePartitionStrips"), mTriPartStrips, iniName);

      SetIniValue(NifExportSection, _T("WeldVertexThresh"), mWeldThresh, iniName);
      SetIniValue(NifExportSection, _T("WeldVertexThresh"), mNormThresh, iniName);
      SetIniValue(NifExportSection, _T("WeldUVWThresh"), mUVWThresh, iniName);

	  SetIniValue<std::wstring>(NifExportSection, _T("RootType"), mRootType, iniName);
   }
}