@@ -129,6 +129,19 @@ public override void SetupCommands()
129
129
AddLaunchCommand ( new Command ( "Config#Nemesis" , "Config Nemesis" , "Configures Nemesis." , imgIcon , ConfigNemesis , true ) ) ;
130
130
}
131
131
132
+ strCommand = GetPandoraLaunchCommand ( ) ;
133
+ Trace . TraceInformation ( "Pandora Command: {0} (IsNull={1})" , strCommand , ( strCommand == null ) ) ;
134
+ if ( ( strCommand != null ) && ( File . Exists ( strCommand ) ) )
135
+ {
136
+ imgIcon = File . Exists ( strCommand ) ? Icon . ExtractAssociatedIcon ( strCommand ) . ToBitmap ( ) : null ;
137
+ AddLaunchCommand ( new Command ( "Pandora" , "Launch Pandora" , "Launches Pandora." , imgIcon , LaunchPandora , true ) ) ;
138
+ }
139
+ else
140
+ {
141
+ imgIcon = null ;
142
+ AddLaunchCommand ( new Command ( "Config#Pandora" , "Config Pandora" , "Configures Pandora." , imgIcon , ConfigPandora , true ) ) ;
143
+ }
144
+
132
145
strCommand = GetBSLaunchCommand ( ) ;
133
146
Trace . TraceInformation ( "BodySlide Command: {0} (IsNull={1})" , strCommand , ( strCommand == null ) ) ;
134
147
if ( ( strCommand != null ) && ( File . Exists ( strCommand ) ) )
@@ -236,6 +249,15 @@ private void LaunchNemesis()
236
249
Launch ( strCommand , null ) ;
237
250
}
238
251
252
+ private void LaunchPandora ( )
253
+ {
254
+ Trace . TraceInformation ( "Launching Pandora" ) ;
255
+ Trace . Indent ( ) ;
256
+ string strCommand = GetPandoraLaunchCommand ( ) ;
257
+ Trace . TraceInformation ( "Command: " + strCommand ) ;
258
+ Launch ( strCommand , null ) ;
259
+ }
260
+
239
261
private void LaunchBS ( )
240
262
{
241
263
Trace . TraceInformation ( "Launching BodySlide" ) ;
@@ -489,6 +511,44 @@ private string GetNemesisLaunchCommand()
489
511
return strNemesis ;
490
512
}
491
513
514
+ /// <summary>
515
+ /// Gets the Pandora launch command.
516
+ /// </summary>
517
+ /// <returns>The Pandora launch command.</returns>
518
+ private string GetPandoraLaunchCommand ( )
519
+ {
520
+ string strPandora = string . Empty ;
521
+
522
+ if ( EnvironmentInfo . Settings . SupportedTools [ GameMode . ModeId ] . ContainsKey ( "Pandora" ) )
523
+ {
524
+ strPandora = EnvironmentInfo . Settings . SupportedTools [ GameMode . ModeId ] [ "Pandora" ] ;
525
+ if ( ! string . IsNullOrWhiteSpace ( strPandora ) && ( ( strPandora . IndexOfAny ( Path . GetInvalidPathChars ( ) ) >= 0 ) || ! Directory . Exists ( strPandora ) ) )
526
+ {
527
+ strPandora = string . Empty ;
528
+ EnvironmentInfo . Settings . SupportedTools [ GameMode . ModeId ] [ "Pandora" ] = string . Empty ;
529
+ EnvironmentInfo . Settings . Save ( ) ;
530
+ }
531
+ }
532
+
533
+ if ( string . IsNullOrEmpty ( strPandora ) )
534
+ {
535
+ string strPandoraPath = Path . Combine ( GameMode . GameModeEnvironmentInfo . InstallationPath , @"Data\Pandora_Engine" ) ;
536
+ if ( Directory . Exists ( strPandoraPath ) )
537
+ {
538
+ strPandora = Path . GetDirectoryName ( strPandoraPath ) ;
539
+ EnvironmentInfo . Settings . SupportedTools [ GameMode . ModeId ] [ "Pandora" ] = strPandora ;
540
+ EnvironmentInfo . Settings . Save ( ) ;
541
+ }
542
+ }
543
+
544
+ if ( ! string . IsNullOrEmpty ( strPandora ) )
545
+ {
546
+ strPandora = Path . Combine ( strPandora , "Pandora Behaviour Engine+.exe" ) ;
547
+ }
548
+
549
+ return strPandora ;
550
+ }
551
+
492
552
/// <summary>
493
553
/// Gets the BodySlide launch command.
494
554
/// </summary>
@@ -650,6 +710,10 @@ public override void ConfigCommand(string p_strCommandID)
650
710
ConfigNemesis ( ) ;
651
711
break ;
652
712
713
+ case "Pandora" :
714
+ ConfigPandora ( ) ;
715
+ break ;
716
+
653
717
default :
654
718
break ;
655
719
}
@@ -835,6 +899,36 @@ private void ConfigNemesis()
835
899
}
836
900
}
837
901
902
+ private void ConfigPandora ( )
903
+ {
904
+ string p_strToolName = "Pandora" ;
905
+ string p_strExecutableName = "Pandora Behaviour Engine+.exe" ;
906
+ string p_strToolID = "Pandora" ;
907
+ Trace . TraceInformation ( string . Format ( "Configuring {0}" , p_strToolName ) ) ;
908
+ Trace . Indent ( ) ;
909
+
910
+ FolderBrowserDialog fbd = new FolderBrowserDialog ( ) ;
911
+ fbd . Description = string . Format ( "Select the folder where the {0} executable is located." , p_strToolName ) ;
912
+ fbd . ShowNewFolderButton = false ;
913
+
914
+ fbd . ShowDialog ( ) ;
915
+
916
+ string strPath = fbd . SelectedPath ;
917
+
918
+ if ( ! string . IsNullOrEmpty ( strPath ) )
919
+ if ( Directory . Exists ( strPath ) )
920
+ {
921
+ string strExecutablePath = Path . Combine ( strPath , p_strExecutableName ) ;
922
+
923
+ if ( ! string . IsNullOrWhiteSpace ( strExecutablePath ) && File . Exists ( strExecutablePath ) )
924
+ {
925
+ EnvironmentInfo . Settings . SupportedTools [ GameMode . ModeId ] [ p_strToolID ] = strPath ;
926
+ EnvironmentInfo . Settings . Save ( ) ;
927
+ OnChangedToolPath ( new EventArgs ( ) ) ;
928
+ }
929
+ }
930
+ }
931
+
838
932
private void ConfigBS ( )
839
933
{
840
934
string p_strToolName = "BS2" ;
0 commit comments