44using UnityEditor ;
55using RustMapEditor . Variables ;
66using static RustMapEditor . Data . TerrainManager ;
7+ using RustMapEditor . Data ;
78
89namespace RustMapEditor . UI
910{
@@ -37,7 +38,7 @@ static void OpenPrefabsList()
3738 [ MenuItem ( "Rust Map Editor/Terrain Tools" , false , 2 ) ]
3839 public static void OpenTerrainTools ( )
3940 {
40- Selection . activeGameObject = land . gameObject ;
41+ Selection . activeGameObject = Land . gameObject ;
4142 }
4243
4344 [ MenuItem ( "Rust Map Editor/Links/Wiki" , false , 10 ) ]
@@ -128,12 +129,12 @@ public static void NewMapPanel()
128129
129130 public static void MapInfo ( )
130131 {
131- if ( land != null )
132+ if ( Land != null )
132133 {
133134 Elements . BoldLabel ( ToolTips . mapInfoLabel ) ;
134- GUILayout . Label ( "Size: " + land . terrainData . size . x ) ;
135- GUILayout . Label ( "HeightMap: " + land . terrainData . heightmapResolution + "x" + land . terrainData . heightmapResolution ) ;
136- GUILayout . Label ( "SplatMap: " + land . terrainData . alphamapResolution + "x" + land . terrainData . alphamapResolution ) ;
135+ GUILayout . Label ( "Size: " + Land . terrainData . size . x ) ;
136+ GUILayout . Label ( "HeightMap: " + Land . terrainData . heightmapResolution + "x" + Land . terrainData . heightmapResolution ) ;
137+ GUILayout . Label ( "SplatMap: " + Land . terrainData . alphamapResolution + "x" + Land . terrainData . alphamapResolution ) ;
137138 }
138139 }
139140
@@ -176,7 +177,7 @@ public static void EditorSettings()
176177 if ( Elements . ToolbarButton ( ToolTips . discardSettings ) )
177178 {
178179 SettingsManager . LoadSettings ( ) ;
179- ToolTips . rustDirectoryPath . text = SettingsManager . rustDirectory ;
180+ ToolTips . rustDirectoryPath . text = SettingsManager . RustDirectory ;
180181 }
181182 if ( Elements . ToolbarButton ( ToolTips . defaultSettings ) )
182183 SettingsManager . SetDefaultSettings ( ) ;
@@ -187,22 +188,26 @@ public static void EditorSettings()
187188 Elements . BeginToolbarHorizontal ( ) ;
188189 if ( Elements . ToolbarButton ( ToolTips . browseRustDirectory ) )
189190 {
190- var returnDirectory = EditorUtility . OpenFolderPanel ( "Browse Rust Directory" , SettingsManager . rustDirectory , "Rust" ) ;
191- SettingsManager . rustDirectory = String . IsNullOrEmpty ( returnDirectory ) ? SettingsManager . rustDirectory : returnDirectory ;
192- ToolTips . rustDirectoryPath . text = SettingsManager . rustDirectory ;
191+ var returnDirectory = EditorUtility . OpenFolderPanel ( "Browse Rust Directory" , SettingsManager . RustDirectory , "Rust" ) ;
192+ SettingsManager . RustDirectory = String . IsNullOrEmpty ( returnDirectory ) ? SettingsManager . RustDirectory : returnDirectory ;
193+ ToolTips . rustDirectoryPath . text = SettingsManager . RustDirectory ;
193194 }
194195 Elements . ToolbarLabel ( ToolTips . rustDirectoryPath ) ;
195196 Elements . EndToolbarHorizontal ( ) ;
196197
197198 Elements . MiniBoldLabel ( ToolTips . renderDistanceLabel ) ;
198199 EditorGUI . BeginChangeCheck ( ) ;
199- SettingsManager . prefabRenderDistance = Elements . ToolbarSlider ( ToolTips . prefabRenderDistance , SettingsManager . prefabRenderDistance , 0 , 5000f ) ;
200- SettingsManager . pathRenderDistance = Elements . ToolbarSlider ( ToolTips . pathRenderDistance , SettingsManager . pathRenderDistance , 0 , 5000f ) ;
200+ SettingsManager . PrefabRenderDistance = Elements . ToolbarSlider ( ToolTips . prefabRenderDistance , SettingsManager . PrefabRenderDistance , 0 , 5000f ) ;
201+ SettingsManager . PathRenderDistance = Elements . ToolbarSlider ( ToolTips . pathRenderDistance , SettingsManager . PathRenderDistance , 0 , 5000f ) ;
201202
202203 if ( EditorGUI . EndChangeCheck ( ) )
203- MapManager . SetCullingDistances ( SceneView . GetAllSceneCameras ( ) , SettingsManager . prefabRenderDistance , SettingsManager . pathRenderDistance ) ;
204+ MapManager . SetCullingDistances ( SceneView . GetAllSceneCameras ( ) , SettingsManager . PrefabRenderDistance , SettingsManager . PathRenderDistance ) ;
205+
206+ EditorGUI . BeginChangeCheck ( ) ;
207+ SettingsManager . WaterTransparency = Elements . ToolbarSlider ( ToolTips . waterTransparency , SettingsManager . WaterTransparency , 0f , 0.5f ) ;
208+ if ( EditorGUI . EndChangeCheck ( ) )
209+ SetWaterTransparency ( SettingsManager . WaterTransparency ) ;
204210
205- //MapEditorSettings.objectQuality = Elements.ToolbarIntSlider(ToolTips.objectQuality, MapEditorSettings.objectQuality, 0, 200);
206211 }
207212 #endregion
208213
@@ -249,7 +254,7 @@ public static void AssetBundle()
249254
250255 Elements . BeginToolbarHorizontal ( ) ;
251256 if ( Elements . ToolbarButton ( ToolTips . loadBundle ) )
252- AssetManager . Initialise ( SettingsManager . rustDirectory + SettingsManager . bundlePathExt ) ;
257+ AssetManager . Initialise ( SettingsManager . RustDirectory + SettingsManager . BundlePathExt ) ;
253258 if ( Elements . ToolbarButton ( ToolTips . unloadBundle ) )
254259 AssetManager . Dispose ( ) ;
255260 Elements . EndToolbarHorizontal ( ) ;
@@ -655,8 +660,8 @@ public static void AreaSelect()
655660 {
656661 Elements . MiniBoldLabel ( ToolTips . areaSelectLabel ) ;
657662
658- Elements . ToolbarMinMaxInt ( ToolTips . fromZ , ToolTips . toZ , ref AreaManager . Area . z0 , ref AreaManager . Area . z1 , 0 , land . terrainData . alphamapResolution ) ;
659- Elements . ToolbarMinMaxInt ( ToolTips . fromX , ToolTips . toX , ref AreaManager . Area . x0 , ref AreaManager . Area . x1 , 0 , land . terrainData . alphamapResolution ) ;
663+ Elements . ToolbarMinMaxInt ( ToolTips . fromZ , ToolTips . toZ , ref AreaManager . Area . z0 , ref AreaManager . Area . z1 , 0 , Land . terrainData . alphamapResolution ) ;
664+ Elements . ToolbarMinMaxInt ( ToolTips . fromX , ToolTips . toX , ref AreaManager . Area . x0 , ref AreaManager . Area . x1 , 0 , Land . terrainData . alphamapResolution ) ;
660665
661666 if ( Elements . ToolbarButton ( ToolTips . resetArea ) )
662667 AreaManager . Reset ( ) ;
@@ -851,6 +856,7 @@ public static void SelectPrefabPaths(PrefabsListTreeView treeView, ref bool show
851856 Elements . EndToolbarHorizontal ( ) ;
852857 }
853858 #endregion
859+
854860 #region CreateNewMap
855861 public static void NewMapOptions ( ref int mapSize , ref float landHeight , ref Layers layers , CreateMapWindow window )
856862 {
0 commit comments