/// <summary> /// Paint a line given the 2 points /// </summary> /// <param name="points"></param> private void makeLine(LinkedList <Pair <double, double> > points) { NWN2Toolset.NWN2.Views.NWN2AreaViewer viewer = getAreaViewer(); NWN2Toolset.NWN2ToolsetMainForm mainForm = NWN2Toolset.NWN2ToolsetMainForm.App; NWN2GameArea area = viewer.Area; TRN trn = new SFX.YATT.DAL.TRN(new System.IO.BinaryReader(area.TerrainResource.GetStream(false)), area.Name); Pair <Pair <double, double>, Pair <double, double> > resultPair = findUpperAndLower(points); Pair <double, double> upper = resultPair.X; Pair <double, double> lower = resultPair.Y; trn = ApplyLine(area, trn, upper, lower); System.IO.Stream stream = area.TerrainResource.GetStream(true); System.IO.BinaryWriter writer = new System.IO.BinaryWriter(stream); trn.Save(writer); stream.Flush(); stream.Close(); areaViewer.SaveContents(true, OEIShared.UI.OEIMessageBoxResult.OK); mainForm.WaitForPanelsToSave(); mainForm.CloseViewer(areaViewer, true); }
/// <summary> /// Save the area given /// </summary> /// <param name="area">The area we want to save</param> private void SaveAreaTerrain(NWN2AreaViewer area) { area.SaveTerrain(true); area.SaveContents(true,OEIShared.UI.OEIMessageBoxResult .YesToAll ); }
/// <summary> /// Save the area given /// </summary> /// <param name="area">The area we want to save</param> private void SaveAreaTerrain(NWN2AreaViewer area) { area.SaveTerrain(true); area.SaveContents(true, OEIShared.UI.OEIMessageBoxResult.YesToAll); }