@@ -625,15 +625,15 @@ public static GUIContent[] GetDCCOptions(){
625
625
FindDCCInstalls ( ) ;
626
626
}
627
627
628
+ // store the selected app
629
+ var prevSelection = instance . dccOptionPaths [ instance . selectedDCCApp ] ;
630
+
628
631
// remove options that no longer exist
629
632
List < string > pathsToDelete = new List < string > ( ) ;
630
633
List < string > namesToDelete = new List < string > ( ) ;
631
634
for ( int i = 0 ; i < instance . dccOptionPaths . Count ; i ++ ) {
632
635
var dccPath = instance . dccOptionPaths [ i ] ;
633
636
if ( ! File . Exists ( dccPath ) ) {
634
- if ( i == instance . selectedDCCApp ) {
635
- instance . selectedDCCApp = instance . GetPreferredDCCApp ( ) ;
636
- }
637
637
namesToDelete . Add ( instance . dccOptionNames [ i ] ) ;
638
638
pathsToDelete . Add ( dccPath ) ;
639
639
}
@@ -645,6 +645,13 @@ public static GUIContent[] GetDCCOptions(){
645
645
instance . dccOptionNames . Remove ( str ) ;
646
646
}
647
647
648
+ // set the selected DCC app to the previous selection
649
+ instance . selectedDCCApp = instance . dccOptionPaths . IndexOf ( prevSelection ) ;
650
+ if ( instance . selectedDCCApp < 0 ) {
651
+ // find preferred app if previous selection no longer exists
652
+ instance . selectedDCCApp = instance . GetPreferredDCCApp ( ) ;
653
+ }
654
+
648
655
if ( instance . dccOptionPaths . Count <= 0 ) {
649
656
instance . selectedDCCApp = 0 ;
650
657
return new GUIContent [ ] {
@@ -659,7 +666,6 @@ public static GUIContent[] GetDCCOptions(){
659
666
instance . dccOptionPaths [ i ]
660
667
) ;
661
668
}
662
-
663
669
return optionArray ;
664
670
}
665
671
0 commit comments