Skip to content

Commit d50e283

Browse files
committed
added /*DIR PATCHER*/ to the list of tags that can be remplaced
1 parent d9d9088 commit d50e283

24 files changed

+4527
-4082
lines changed

DemoProject/Assets/Hash's_Things/EditDistributor/Editor/EditDistributorBuilder.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,15 +239,15 @@ void OnGUI()
239239
StorePage = EditorGUILayout.TextField("StorePage ", StorePage);
240240

241241
//preparing the paterns to feed in the search and remplace algo
242-
searchPatterns = new string[] { @"/*AVATAR AUTHOR*/", @"/*StoreLink*/", @"/*AVATAR NAME*/", @"/*PACKAGE NAME*/", @"/*DIR PREFAB*/" };
242+
searchPatterns = new string[] { @"/*AVATAR AUTHOR*/", @"/*StoreLink*/", @"/*AVATAR NAME*/", @"/*PACKAGE NAME*/", @"/*DIR PREFAB*/", @"/*DIR PATCHER*/" };
243243
if (NameOverwriteTickBox) {
244244
if (string.IsNullOrEmpty(DistributionNameOverwriteText))
245245
{
246246
//string is empty, don't even try, just wait for the error
247247
}
248-
else replacementValues = new string[] { CreatorName, StorePage, DistributionNameOverwriteText, PackageName, "Assets" + CommunFonctions.GetRelativePathToAssets(Path.Combine(CommunFonctions.GoUpNDirs(CustomfbxPath, 3), DistributionNameOverwriteText, "prefab")) };
248+
else replacementValues = new string[] { CreatorName, StorePage, DistributionNameOverwriteText, PackageName, "Assets" + CommunFonctions.GetRelativePathToAssets(Path.Combine(CommunFonctions.GoUpNDirs(CustomfbxPath, 3), DistributionNameOverwriteText, "prefab")), EditorWindowPath };
249249
}
250-
else replacementValues = new string[] { CreatorName, StorePage, Path.GetFileNameWithoutExtension(OGfbxPath), PackageName, "Assets" + CommunFonctions.GetRelativePathToAssets(Path.Combine(CommunFonctions.GoUpNDirs(CustomfbxPath, 2), "prefab")) };
250+
else replacementValues = new string[] { CreatorName, StorePage, Path.GetFileNameWithoutExtension(OGfbxPath), PackageName, "Assets" + CommunFonctions.GetRelativePathToAssets(Path.Combine(CommunFonctions.GoUpNDirs(CustomfbxPath, 2), "prefab")), EditorWindowPath };
251251

252252
}
253253
}

DemoProject/Assets/Hash's_Things/EditDistributor/Editor/PatcherTemplate.cs

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ void OnGUI()
3030
GUIStyle boldLabelStyle = new GUIStyle(EditorStyles.boldLabel);
3131
using (new GUILayout.VerticalScope(EditorStyles.helpBox))
3232
{
33-
33+
3434
EditorGUILayout.Space(20);
3535

3636
EditorGUILayout.BeginHorizontal();
@@ -112,6 +112,8 @@ void OnGUI()
112112
else
113113
{
114114
debugMessage = 6;//it workey
115+
DeleteAllFilesInDirectory(Path.Combine(GoUpNDirs(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), 1), "LocalLow", "VRChat", "VRChat", "OSC"));
116+
115117
}
116118

117119
arguments = "\"" + currentOGfbxPath + "\" \"" + FBXDiffFile + "\" \"" + currentCustomfbxPath + "\"";
@@ -124,6 +126,7 @@ void OnGUI()
124126
else
125127
{
126128
debugMessage = 6;//it workey
129+
DeleteAllFilesInDirectory(Path.Combine(GoUpNDirs(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), 1), "LocalLow", "VRChat", "VRChat", "OSC"));
127130
}
128131

129132

@@ -293,4 +296,33 @@ private void ShowDebugMessages(string currentOGfbxPath, string FBXDiffFile, stri
293296
GUILayout.Label("arguments fed to hpatchz: " + currentOGfbxPath + "\" \"" + FBXDiffFile + "\" \"" + currentCustomfbxPath + "\"");
294297
}
295298

299+
public static void DeleteAllFilesInDirectory(string directoryPath)
300+
{
301+
try
302+
{
303+
// Check if the directory exists
304+
if (Directory.Exists(directoryPath))
305+
{
306+
// Get all files in the directory
307+
string[] files = Directory.GetFiles(directoryPath);
308+
309+
// Delete each file
310+
foreach (string filePath in files)
311+
{
312+
File.Delete(filePath);
313+
UnityEngine.Debug.Log($"File deleted: {filePath}");
314+
}
315+
316+
UnityEngine.Debug.Log("Deletion process completed successfully.");
317+
}
318+
else
319+
{
320+
UnityEngine.Debug.Log("Directory does not exist.");
321+
}
322+
}
323+
catch (Exception ex)
324+
{
325+
UnityEngine.Debug.Log($"An error occurred: {ex.Message}");
326+
}
327+
}
296328
}

DemoProject/Library/ArtifactDB

0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

DemoProject/Library/Bee/backend1.traceevents

Lines changed: 1361 additions & 1305 deletions
Large diffs are not rendered by default.

DemoProject/Library/Bee/fullprofile.json

Lines changed: 1791 additions & 1692 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)