mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-19 23:03:51 +02:00
Path.Join()
This commit is contained in:
@@ -83,7 +83,7 @@ namespace VRCX
|
||||
public string CustomCssPath()
|
||||
{
|
||||
var output = string.Empty;
|
||||
var filePath = Path.Combine(Program.AppDataDirectory, "custom.css");
|
||||
var filePath = Path.Join(Program.AppDataDirectory, "custom.css");
|
||||
if (File.Exists(filePath))
|
||||
output = filePath;
|
||||
return output;
|
||||
@@ -92,7 +92,7 @@ namespace VRCX
|
||||
public string CustomScriptPath()
|
||||
{
|
||||
var output = string.Empty;
|
||||
var filePath = Path.Combine(Program.AppDataDirectory, "custom.js");
|
||||
var filePath = Path.Join(Program.AppDataDirectory, "custom.js");
|
||||
if (File.Exists(filePath))
|
||||
output = filePath;
|
||||
return output;
|
||||
|
||||
@@ -171,7 +171,7 @@ namespace VRCX
|
||||
|
||||
public async Task CropAllPrints(string ugcFolderPath)
|
||||
{
|
||||
var folder = Path.Combine(GetUGCPhotoLocation(ugcFolderPath), "Prints");
|
||||
var folder = Path.Join(GetUGCPhotoLocation(ugcFolderPath), "Prints");
|
||||
var files = Directory.GetFiles(folder, "*.png", SearchOption.AllDirectories);
|
||||
foreach (var file in files)
|
||||
{
|
||||
@@ -210,9 +210,9 @@ namespace VRCX
|
||||
|
||||
public async Task<string> SavePrintToFile(string url, string ugcFolderPath, string monthFolder, string fileName)
|
||||
{
|
||||
var folder = Path.Combine(GetUGCPhotoLocation(ugcFolderPath), "Prints", MakeValidFileName(monthFolder));
|
||||
var folder = Path.Join(GetUGCPhotoLocation(ugcFolderPath), "Prints", MakeValidFileName(monthFolder));
|
||||
Directory.CreateDirectory(folder);
|
||||
var filePath = Path.Combine(folder, MakeValidFileName(fileName));
|
||||
var filePath = Path.Join(folder, MakeValidFileName(fileName));
|
||||
if (File.Exists(filePath))
|
||||
return null;
|
||||
|
||||
@@ -223,9 +223,9 @@ namespace VRCX
|
||||
|
||||
public async Task<string> SaveStickerToFile(string url, string ugcFolderPath, string monthFolder, string fileName)
|
||||
{
|
||||
var folder = Path.Combine(GetUGCPhotoLocation(ugcFolderPath), "Stickers", MakeValidFileName(monthFolder));
|
||||
var folder = Path.Join(GetUGCPhotoLocation(ugcFolderPath), "Stickers", MakeValidFileName(monthFolder));
|
||||
Directory.CreateDirectory(folder);
|
||||
var filePath = Path.Combine(folder, MakeValidFileName(fileName));
|
||||
var filePath = Path.Join(folder, MakeValidFileName(fileName));
|
||||
if (File.Exists(filePath))
|
||||
return null;
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace VRCX
|
||||
{
|
||||
// 004 = hideAvatar
|
||||
// 005 = showAvatar
|
||||
var filePath = Path.Combine(GetVRChatAppDataLocation(), @$"LocalPlayerModerations\{currentUserId}-show-hide-user.vrcset");
|
||||
var filePath = Path.Join(GetVRChatAppDataLocation(), @$"LocalPlayerModerations\{currentUserId}-show-hide-user.vrcset");
|
||||
if (!File.Exists(filePath))
|
||||
return null;
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace VRCX
|
||||
|
||||
public short GetVRChatUserModeration(string currentUserId, string userId)
|
||||
{
|
||||
var filePath = Path.Combine(GetVRChatAppDataLocation(), @$"LocalPlayerModerations\{currentUserId}-show-hide-user.vrcset");
|
||||
var filePath = Path.Join(GetVRChatAppDataLocation(), @$"LocalPlayerModerations\{currentUserId}-show-hide-user.vrcset");
|
||||
if (!File.Exists(filePath))
|
||||
return 0;
|
||||
|
||||
@@ -58,7 +58,7 @@ namespace VRCX
|
||||
|
||||
public bool SetVRChatUserModeration(string currentUserId, string userId, int type)
|
||||
{
|
||||
var filePath = Path.Combine(GetVRChatAppDataLocation(), @$"LocalPlayerModerations\{currentUserId}-show-hide-user.vrcset");
|
||||
var filePath = Path.Join(GetVRChatAppDataLocation(), @$"LocalPlayerModerations\{currentUserId}-show-hide-user.vrcset");
|
||||
if (!File.Exists(filePath))
|
||||
return false;
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace VRCX
|
||||
public string ReadConfigFile()
|
||||
{
|
||||
var path = GetVRChatAppDataLocation();
|
||||
var configFile = Path.Combine(path, "config.json");
|
||||
var configFile = Path.Join(path, "config.json");
|
||||
if (!Directory.Exists(path) || !File.Exists(configFile))
|
||||
{
|
||||
return string.Empty;
|
||||
@@ -21,7 +21,7 @@ namespace VRCX
|
||||
public void WriteConfigFile(string json)
|
||||
{
|
||||
var path = GetVRChatAppDataLocation();
|
||||
var configFile = Path.Combine(path, "config.json");
|
||||
var configFile = Path.Join(path, "config.json");
|
||||
File.WriteAllText(configFile, json);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user