@@ -46,6 +46,18 @@ private static void TryRedrawTextWindowBackground(WindowFilterType filterType)
46
46
GameSystem . Instance . MainUIController . TryRedrawTextWindowBackground ( windowFilterTextureName ) ;
47
47
}
48
48
49
+ private static string ExpandHome ( string s )
50
+ {
51
+ if ( s . Length > 0 && s . StartsWith ( "~" ) )
52
+ {
53
+ return Environment . GetEnvironmentVariable ( "HOME" ) + s . Remove ( 0 , 1 ) ;
54
+ }
55
+ else
56
+ {
57
+ return s ;
58
+ }
59
+ }
60
+
49
61
/// <summary>
50
62
/// Cycles and saves Console->MangaGamer->OG->Custom->Console...
51
63
/// </summary>
@@ -417,7 +429,7 @@ public static string GetLogFolder()
417
429
{
418
430
// Higurashi 1-7 use the "HigurashiEp01_Data", which is one folder above the streamingAssets folder
419
431
// eg. C:\games\Steam\steamapps\common\Higurashi When They Cry\HigurashiEp01_Data, where log file would be output_log.txt
420
- return MODUtility . CombinePaths ( Application . streamingAssetsPath , ".." ) ;
432
+ return MODUtility . CombinePaths ( Application . streamingAssetsPath , "..\\ " ) ;
421
433
}
422
434
423
435
//eg. ~/Library/Logs/Unity, where log file would be Player.log
@@ -441,28 +453,31 @@ public static void ShowSaveFolder()
441
453
{
442
454
ShowFile ( MGHelper . GetSavePath ( ) ) ;
443
455
}
456
+ public static void ShowCompiledScripts ( )
457
+ {
458
+ ShowFile ( Path . Combine ( Application . streamingAssetsPath , "CompiledUpdateScripts" ) ) ;
459
+ }
444
460
445
461
//NOTE: paths might not open properly on windows if they contain backslashes
446
462
public static void ShowFile ( string path )
447
463
{
448
- Assets . Scripts . Core . Logger . Log ( $ "MOD ShowFile(): Showing [{ path } ]") ;
449
464
try
450
465
{
451
- switch ( MODUtility . GetPlatform ( ) )
452
- {
453
- case MODUtility . Platform . Windows :
454
- default :
455
- Process . Start ( "explorer" , path . Replace ( '/ ' , '\\ ' ) ) ;
466
+ switch ( MODUtility . GetPlatform ( ) )
467
+ {
468
+ case MODUtility . Platform . MacOS :
469
+ case MODUtility . Platform . Linux :
470
+ path = ExpandHome ( path . Replace ( '\\ ' , '/ ' ) ) ;
456
471
break ;
457
472
458
- case MODUtility . Platform . MacOS :
459
- Process . Start ( "open" , path . Replace ( '\\ ' , '/' ) ) ;
460
- break ;
461
-
462
- case MODUtility . Platform . Linux :
463
- Process . Start ( "xdg-open" , path . Replace ( '\\ ' , '/' ) ) ;
473
+ case MODUtility . Platform . Windows :
474
+ default :
475
+ path = path . Replace ( '/' , '\\ ' ) ;
464
476
break ;
465
477
}
478
+
479
+ Assets . Scripts . Core . Logger . Log ( $ "MOD ShowFile(): Showing [{ path } ]") ;
480
+ Application . OpenURL ( path ) ;
466
481
}
467
482
catch ( Exception e )
468
483
{
0 commit comments