private void DrawChildLines(Structures.LinkedEntityRenderProp Properties, ushort TargetSlotID) { ushort slotID = Properties.EditorObject.SlotID; int NodeCount = Properties.EditorObject.attributesMap["nodeCount"].ValueEnum; int ControlTag = Properties.EditorObject.attributesMap["buttonTag"].ValueEnum; int ChildCount = Properties.EditorObject.attributesMap["childCount"].ValueEnum; List <Classes.Scene.EditorEntity> ChildPoints = new List <Classes.Scene.EditorEntity>(); ushort CurrentTargetSlotID = (ushort)(TargetSlotID + 1); for (int i = 0; i < ChildCount; i++) { bool DoesTargetExist = Methods.Solution.CurrentSolution.Entities.Entities.Exists(x => x.SlotID == TargetSlotID && x.Name == "Platform"); if (DoesTargetExist) { var Target1 = Methods.Solution.CurrentSolution.Entities.Entities.Where(x => x.SlotID == TargetSlotID && x.Name == "Platform").First(); ChildPoints.Add(Target1); } TargetSlotID = (ushort)(TargetSlotID + 1); } if (ChildPoints != null && ChildPoints.Any()) { foreach (var Child in ChildPoints) { DrawCenteredLinkArrow(Properties.Graphics, Properties.EditorObject, Child, Color.Red); } } }
public override void Draw(Structures.LinkedEntityRenderProp properties) { ushort slotID = properties.EditorObject.SlotID; ushort targetSlotID = (ushort)(properties.EditorObject.SlotID + 1); Int32 bezCtrlAngle = properties.EditorObject.attributesMap["bezCtrlAngle"].ValueInt32; Int32 bezCtrlLength = properties.EditorObject.attributesMap["bezCtrlLength"].ValueInt32; var currentEntity = properties.EditorObject; var beanstalkPaths = Methods.Solution.CurrentSolution.Entities.Entities.Where(e => e.SlotID == targetSlotID); if (beanstalkPaths != null && beanstalkPaths.Any()) { // some destinations seem to be duplicated, so we must loop foreach (var tp in beanstalkPaths) { if (tp.Object.Name.ToString() == "Beanstalk") { Point Start = new Point(currentEntity.Position.X.High, currentEntity.Position.Y.High); Point End = new Point(tp.Position.X.High, tp.Position.Y.High); properties.Graphics.DrawLine(Start.X, Start.Y, End.X, End.Y, Color.ForestGreen, 4); } } } properties.EditorObject.DrawBase(properties.Graphics); }
public override void Draw(Structures.LinkedEntityRenderProp properties) { properties.EditorObject.DrawBase(properties.Graphics); ushort slotID = properties.EditorObject.SlotID; ushort targetSlotID = (ushort)(properties.EditorObject.SlotID + 1); //if (goProperty == 1 && destinationTag == 0) return; // probably just a destination // this is the start of a WarpDoor, find its partner(s) var nodePaths = Methods.Solution.CurrentSolution.Entities.Entities.Where(e => e.SlotID == targetSlotID); if (nodePaths != null && nodePaths.ToList().Exists(x => x.Entity.Object.Name.Name == "PlatformNode")) { properties.EditorObject.DrawBase(properties.Graphics); // some destinations seem to be duplicated, so we must loop foreach (var tp in nodePaths) { DrawCenteredLinkArrow(properties.Graphics, properties.EditorObject, tp); } } else { properties.EditorObject.DrawBase(properties.Graphics); } }
public override void Draw(Structures.LinkedEntityRenderProp properties) { ushort slotID = properties.EditorObject.SlotID; ushort targetSlotID = (ushort)(properties.EditorObject.SlotID + 1); int type = (int)properties.EditorObject.attributesMap["type"].ValueEnum; properties.EditorObject.DrawBase(properties.Graphics); var beanstalkPaths = Methods.Solution.CurrentSolution.Entities.Entities.Where(e => e.SlotID == targetSlotID); if (beanstalkPaths != null && beanstalkPaths.Any()) { // some destinations seem to be duplicated, so we must loop foreach (var tp in beanstalkPaths) { if (tp.Object.Name.ToString() == "CableWarp") { if (tp.AttributeExists("type", RSDKv5.AttributeTypes.ENUM)) { int targetType = (int)tp.attributesMap["type"].ValueEnum; if (targetType == 1 || targetType == 2) { DrawCenteredLinkArrow(properties.Graphics, properties.EditorObject, tp); } } } } } }
private ushort DrawNodeLines(Structures.LinkedEntityRenderProp Properties) { ushort SlotID = Properties.EditorObject.SlotID; int NodeCount = Properties.EditorObject.attributesMap["nodeCount"].ValueEnum - 1; ushort TargetSlotID = SlotID; ushort TargetSlotIDNext = SlotID; ManiacEditor.Classes.Scene.EditorEntity FirstNode = null; ManiacEditor.Classes.Scene.EditorEntity LastNode = null; List <Tuple <Classes.Scene.EditorEntity, Classes.Scene.EditorEntity> > NodePairPoints = new List <Tuple <Classes.Scene.EditorEntity, Classes.Scene.EditorEntity> >(); if (Methods.Solution.CurrentSolution.Entities.Entities.Exists(x => x.SlotID > SlotID && x.Name == "PlatformNode")) { FirstNode = Methods.Solution.CurrentSolution.Entities.Entities.Where(x => x.SlotID > SlotID && x.Name == "PlatformNode").First(); TargetSlotID = FirstNode.SlotID; TargetSlotIDNext = (ushort)(FirstNode.SlotID + 1); int Remainder = (NodeCount % 2 == 1 ? 1 : 0); for (int i = 0; i < NodeCount;) { bool DoesTarget1Exist = Methods.Solution.CurrentSolution.Entities.Entities.Exists(x => x.SlotID == TargetSlotID && x.Name == "PlatformNode"); bool DoesTarget2Exist = Methods.Solution.CurrentSolution.Entities.Entities.Exists(x => x.SlotID == TargetSlotIDNext && x.Name == "PlatformNode"); if (DoesTarget1Exist && DoesTarget2Exist) { var Target1 = Methods.Solution.CurrentSolution.Entities.Entities.Where(x => x.SlotID == TargetSlotID && x.Name == "PlatformNode").First(); var Target2 = Methods.Solution.CurrentSolution.Entities.Entities.Where(x => x.SlotID == TargetSlotIDNext && x.Name == "PlatformNode").First(); NodePairPoints.Add(new Tuple <Classes.Scene.EditorEntity, Classes.Scene.EditorEntity>(Target1, Target2)); i++; } TargetSlotID = (ushort)(TargetSlotID + 1); TargetSlotIDNext = (ushort)(TargetSlotIDNext + 1); } } if (NodePairPoints != null && NodePairPoints.Any()) { foreach (var NodePair in NodePairPoints) { DrawCenteredLinkArrow(Properties.Graphics, NodePair.Item1, NodePair.Item2); LastNode = NodePair.Item2; } if (LastNode != null && FirstNode != null) { DrawCenteredLinkArrow(Properties.Graphics, LastNode, FirstNode); TargetSlotID = LastNode.SlotID; } } return(TargetSlotID); }
public override void Draw(Structures.LinkedEntityRenderProp Properties) { Properties.EditorObject.DrawBase(Properties.Graphics); var result = DrawNodeLines(Properties); DrawChildLines(Properties, result); }
public override void Draw(Structures.LinkedEntityRenderProp properties) { ushort slotID = properties.EditorObject.SlotID; ushort targetSlotID = (ushort)(properties.EditorObject.SlotID + 1); uint ButtonTag = properties.EditorObject.GetAttribute("tag").ValueUInt8; var tagged = Methods.Solution.CurrentSolution.Entities.Entities.ToList().Where(e => e.SlotID > slotID && e.Entity.AttributeExists("buttonTag", RSDKv5.AttributeTypes.ENUM)); var triggers = tagged.Where(e => e.Entity.GetAttribute("buttonTag").ValueEnum == ButtonTag); if (triggers != null && triggers.Any()) { DrawCenteredLinkArrow(properties.Graphics, properties.EditorObject, triggers.First()); } properties.EditorObject.DrawBase(properties.Graphics); }
public static void DrawLinked(DevicePanel d, Classes.Scene.EditorEntity _entity) { if (ProgramBase.IsDebug) { Call(); } else { try { Call(); } catch (Exception ex) { string note = "This object will no longer render it's linked render until reloaded!"; string error = string.Format("Linked Entity Rendering Error on Object {0}:{1}{2}{1}{3}{1}{1}{4})", _entity.Object.Name.Name, Environment.NewLine, ex.Message, ex.StackTrace, note); MessageBox.Show(error); _entity.DoesLinkedRenderHaveErrors = true; } } void Call() { if (!_entity.DoesLinkedRenderHaveErrors) { var structure = new Structures.LinkedEntityRenderProp(d, _entity); if (_entity.CurrentLinkedRender == null) { LinkedRenderer renderer = LinkedEntityRenderers.Where(t => t.GetObjectName() == _entity.Object.Name.Name.ToString()).FirstOrDefault(); _entity.CurrentLinkedRender = renderer; } if (_entity.CurrentLinkedRender != null) { _entity.CurrentLinkedRender.Draw(structure); } } } }
public override void Draw(Structures.LinkedEntityRenderProp properties) { ushort slotID = properties.Object.SlotID; ushort targetSlotID = (ushort)(properties.Object.SlotID + 1); properties.EditorObject.DrawBase(properties.Graphics); //if (goProperty == 1 && destinationTag == 0) return; // probably just a destination // this is the start of a WarpDoor, find its partner(s) var tornadoPaths = properties.Object.Object.Entities.Where(e => e.SlotID == targetSlotID); if (tornadoPaths != null && tornadoPaths.Any()) { // some destinations seem to be duplicated, so we must loop foreach (var tp in tornadoPaths) { DrawLinkArrow(properties.Graphics, properties.Object, tp); } } }
public override void Draw(Structures.LinkedEntityRenderProp properties) { ushort slotID = properties.EditorObject.SlotID; int childCount = properties.EditorObject.GetAttribute("childCount").ValueEnum; ushort[] targetSlotIDs = new ushort[childCount]; for (int i = 0; i < childCount; i++) { targetSlotIDs[i] = (ushort)(slotID + (i + 1)); } var tagged = Methods.Solution.CurrentSolution.Entities.Entities.ToList().Where(e => targetSlotIDs.Contains(e.SlotID)); if (tagged != null && tagged.Any()) { foreach (var t in tagged) { DrawCenteredLinkArrow(properties.Graphics, properties.EditorObject, t); } } properties.EditorObject.DrawBase(properties.Graphics); }
public override void Draw(Structures.LinkedEntityRenderProp properties) { int goProperty = properties.EditorObject.GetAttribute("go").ValueEnum; int destinationTag = properties.EditorObject.GetAttribute("destinationTag").ValueEnum; byte tag = properties.EditorObject.GetAttribute("tag").ValueUInt8; properties.EditorObject.DrawBase(properties.Graphics); if (destinationTag == 0) { return; // probably just a destination } // this is the start of a WarpDoor, find its partner(s) var warpDoors = Methods.Solution.CurrentSolution.Entities.Entities.Where(e => e.GetAttribute("tag").ValueUInt8 == destinationTag); if (warpDoors != null && warpDoors.Any()) { // some destinations seem to be duplicated, so we must loop foreach (var wd in warpDoors) { DrawLinkArrow(properties.Graphics, properties.EditorObject, wd); } } }
public override void Draw(Structures.LinkedEntityRenderProp properties) { byte TransportTubeType = properties.EditorObject.GetAttribute("type").ValueUInt8; ushort slotID = properties.EditorObject.SlotID; ushort targetSlotID = (ushort)(properties.EditorObject.SlotID + 1); if ((TransportTubeType == 2 || TransportTubeType == 4)) { var transportTubePaths = Methods.Solution.CurrentSolution.Entities.Entities.Where(e => e.SlotID == targetSlotID && e.Name == "TransportTube"); if (transportTubePaths != null && transportTubePaths.Any()) { foreach (var ttp in transportTubePaths) { int destinationType = ttp.GetAttribute("type").ValueUInt8; if (destinationType == 3) { DrawLinkArrowTransportTubes(properties.Graphics, properties.EditorObject, ttp, 3, TransportTubeType); } else if (destinationType == 4) { DrawLinkArrowTransportTubes(properties.Graphics, properties.EditorObject, ttp, 4, TransportTubeType); } else if (destinationType == 2) { DrawLinkArrowTransportTubes(properties.Graphics, properties.EditorObject, ttp, 2, TransportTubeType); } else { DrawLinkArrowTransportTubes(properties.Graphics, properties.EditorObject, ttp, 1, TransportTubeType); } } } } properties.EditorObject.DrawBase(properties.Graphics); }
public virtual void Draw(Structures.LinkedEntityRenderProp properties) { }