@@ -21,10 +21,19 @@ public class PathSelectionComponent : MonoBehaviour
2121 private Toggle toggle ;
2222 private Text errorText ;
2323
24+ #if UNITY_EDITOR
25+ [ SerializeField ]
26+ private bool bypassConfigINI = false ;
27+ #endif
28+
2429 private void Start ( )
2530 {
31+ #if UNITY_EDITOR
32+ if ( ! bypassConfigINI )
33+ CheckConfigINI ( ) ;
34+ #else
2635 CheckConfigINI ( ) ;
27-
36+ #endif
2837 var savedPath = PlayerPrefs . GetString ( SavePathKey , string . Empty ) ;
2938 if ( savedPath != string . Empty )
3039 defaultMWDataPath = savedPath ;
@@ -57,12 +66,21 @@ private void Start()
5766 errorText . gameObject . AddComponent < Outline > ( ) ;
5867 errorText . enabled = false ;
5968
69+ // Load the game if the Data Files folder is here
6070 var path = Path . Combine ( System . Environment . CurrentDirectory , "Data Files" ) ;
6171 if ( Directory . Exists ( path ) )
6272 {
6373 LoadWorld ( path ) ;
6474 return ;
6575 }
76+
77+ // Or if it's already in the config.ini file.
78+ var tes = GetComponent < TESUnity > ( ) ;
79+ if ( Directory . Exists ( tes . dataPath ) )
80+ {
81+ LoadWorld ( tes . dataPath ) ;
82+ return ;
83+ }
6684 }
6785
6886 private void OnDestroy ( )
@@ -139,11 +157,13 @@ private void CheckConfigINI()
139157 case "AmbientOcclusion" : tes . ambientOcclusion = ParseBool ( value , tes . ambientOcclusion ) ; break ;
140158 case "AnimateLights" : tes . animateLights = ParseBool ( value , tes . animateLights ) ; break ;
141159 case "Bloom" : tes . bloom = ParseBool ( value , tes . bloom ) ; break ;
160+ case "MorrowindPath" : tes . dataPath = value ; break ;
142161 case "FollowHeadDirection" : tes . followHeadDirection = ParseBool ( value , tes . followHeadDirection ) ; break ;
143162 case "SunShadows" : tes . renderSunShadows = ParseBool ( value , tes . renderSunShadows ) ; break ;
144163 case "LightShadows" : tes . renderLightShadows = ParseBool ( value , tes . renderLightShadows ) ; break ;
145164 case "PlayMusic" : tes . playMusic = ParseBool ( value , tes . playMusic ) ; break ;
146165 case "RenderExteriorCellLights" : tes . renderExteriorCellLights = ParseBool ( value , tes . renderExteriorCellLights ) ; break ;
166+ case "WaterBackSideTransparent" : tes . waterBackSideTransparent = ParseBool ( value , tes . waterBackSideTransparent ) ; break ;
147167 case "RenderPath" :
148168 var renderPathID = ParseInt ( value , 0 ) ;
149169 if ( renderPathID == 1 || renderPathID == 3 )
0 commit comments