Участник
- Статус
- Оффлайн
- Регистрация
- 2 Фев 2020
- Сообщения
- 819
- Реакции
- 378
Как вместо
этой залупы(CSIDL_APPDATA - сохранение кфг в аппдату) сохранять кфг в папку ксго
Код:
static TCHAR path[MAX_PATH];
std::string folder, file;
if (SUCCEEDED(SHGetFolderPath(NULL, CSIDL_APPDATA, NULL, 0, path)))
{
folder = std::string(path) + "\\csgohvh\\";
file = std::string(path) + "\\csgohvh\\cfg.ini";
}
CreateDirectory(folder.c_str(), NULL);
char value_l[32] = { '\0' };
for (auto value : ints)
{
GetPrivateProfileString(name, value->name.c_str(), "", value_l, 32, file.c_str());
*value->value = atoi(value_l);
}
for (auto value : floats)
{
GetPrivateProfileString(name, value->name.c_str(), "", value_l, 32, file.c_str());
*value->value = atof(value_l);
}
for (auto value : bools)
{
GetPrivateProfileString(name, value->name.c_str(), "", value_l, 32, file.c_str());
*value->value = !strcmp(value_l, "true");
}