steam_helper: Update the format of the generated libraryfolders.vdf.

The old 1-indexed format:
	"1" 	"Z:\\home\\ivyl\\.local\\share\\Steam"

Changes to new 0-indexed one:
	"0"
	{
		"path"		"Z:\\home\\ivyl\\.local\\share\\Steam"
	}

that is used by Steam on Windows.
This commit is contained in:
Arkadiusz Hiler 2023-04-26 18:15:55 +03:00
parent f0b5a6fe97
commit 6d63c73c54

View file

@ -1314,7 +1314,7 @@ static void setup_steam_files(void)
const char *steam_install_path = getenv("STEAM_COMPAT_CLIENT_INSTALL_PATH"); const char *steam_install_path = getenv("STEAM_COMPAT_CLIENT_INSTALL_PATH");
const char *steam_library_paths = getenv("STEAM_COMPAT_LIBRARY_PATHS"); const char *steam_library_paths = getenv("STEAM_COMPAT_LIBRARY_PATHS");
const char *start, *end, *next; const char *start, *end, *next;
unsigned int i, index = 1; unsigned int i, index = 0;
std::string contents; std::string contents;
char idx_str[10]; char idx_str[10];
@ -1352,7 +1352,7 @@ static void setup_steam_files(void)
} }
} }
contents += std::string("\t\"") + idx_str + "\" \t\"" + s + "\"\n"; contents += std::string("\t\"") + idx_str + "\"\n\t{\n\t\t\"path\"\t\t\"" + s + "\"\n\t}\n";
} }
else else
{ {
@ -1394,7 +1394,7 @@ static void setup_steam_files(void)
} }
} }
contents += std::string("\t\"") + idx_str + "\" \t\"" + s + "\"\n"; contents += std::string("\t\"") + idx_str + "\"\n\t{\n\t\t\"path\"\t\t\"" + s + "\"\n\t}\n";
} }
else else
{ {