//save current map public void SaveMap(string filePath, bool currentMap) { if (MapSaveAble()) { if (currentMap) { MapSystemWorld.WorldSave(filePath + " //cursave.world", true); } else { string saveName = string.Format("{0}Maps//{1}.world", filePath, Path.GetFileNameWithoutExtension(Map.Instance.SourceMapVirtualFileName)); MapSystemWorld.MapSave(saveName, true); } } }
public bool WorldSave(string fileName) { EControl worldSavingWindow = null; //world saving window { worldSavingWindow = ControlDeclarationManager.Instance.CreateControl( "Gui\\WorldSavingWindow.gui"); if (worldSavingWindow != null) { worldSavingWindow.Text = fileName; controlManager.Controls.Add(worldSavingWindow); } RenderScene(); } GameWindow gameWindow = null; foreach (EControl control in controlManager.Controls) { gameWindow = control as GameWindow; if (gameWindow != null) { break; } } if (gameWindow != null) { gameWindow.OnBeforeWorldSave(); } bool result = MapSystemWorld.WorldSave(fileName); if (worldSavingWindow != null) { worldSavingWindow.SetShouldDetach(); } return(result); }