Beispiel #1
0
        public override void WritePage(UdnManifest Manifest, string OutputPath)
        {
            using (UdnWriter Writer = new UdnWriter(OutputPath))
            {
                Writer.WritePageHeader(Name, PageCrumbs, Name);

                // Tooltip/description
                Writer.WriteLine(Tooltip);

                if (Pins != null && Pins.Count() > 0)
                {
                    // Visualization of the node
                    Writer.EnterRegion("graph");
                    Writer.EnterObject("BlueprintNode");
                    if (CompactName != null)
                    {
                        Writer.WriteParamLiteral("type", "compact");
                        Writer.WriteParamLiteral("title", CompactName);
                    }
                    else
                    {
                        Writer.WriteParamLiteral("type", NodeType);
                        Writer.WriteParamLiteral("title", Name);
                    }
                    Writer.EnterParam("inputs");
                    WritePinObjects(Writer, Pins.Where(x => x.bInputPin));
                    Writer.LeaveParam();
                    Writer.EnterParam("outputs");
                    WritePinObjects(Writer, Pins.Where(x => !x.bInputPin && x.GetTypeText() != "delegate"));

                    if (bShowAddPin)
                    {
                        Writer.EnterObject("BlueprintPin");
                        Writer.WriteParamLiteral("type", "addpin");
                        Writer.WriteParamLiteral("id", "AddPin");
                        Writer.WriteParamLiteral("title", "Add pin");
                        Writer.LeaveObject();
                    }

                    Writer.LeaveParam();
                    Writer.LeaveObject();
                    Writer.LeaveRegion();

                    // Inputs
                    Writer.EnterSection("inputs", "Inputs");
                    Writer.WriteObject("MemberIconListHeadBlank");
                    WritePins(Writer, Pins.Where(x => x.bInputPin));
                    Writer.WriteObject("MemberIconListTail");
                    Writer.LeaveSection();

                    // Outputs
                    Writer.EnterSection("outputs", "Outputs");
                    Writer.WriteObject("MemberIconListHeadBlank");
                    WritePins(Writer, Pins.Where(x => !x.bInputPin));
                    Writer.WriteObject("MemberIconListTail");
                    Writer.LeaveSection();
                }
            }
        }
Beispiel #2
0
        public void WriteListSection(UdnWriter Writer, string SectionId, string SectionTitle, Dictionary <string, string> Descriptions)
        {
            if (NodeList.Count > 0)
            {
                // Create the list items
                List <MetadataListItem> ListItems = new List <MetadataListItem>();
                CreateListItems(NodeList, APIDocTool.Icons.GetMetadataIconsForType(Type), Descriptions, false, ListItems);

                // Enter the section and list
                Writer.EnterSection(SectionId, SectionTitle);
                Writer.WriteObject("MetadataListHead");

                // Write the items
                foreach (MetadataListItem ListItem in ListItems)
                {
                    Writer.EnterObject("MetadataListItem");
                    Writer.WriteParam("icon", ListItem.Icon);
                    Writer.WriteParam("name", ListItem.Name);
                    Writer.EnterParam("value");
                    for (int Idx = 0; Idx < ListItem.Values.Count; Idx++)
                    {
                        Writer.WriteLine("{0}{1}  ", ListItem.Values[Idx], (Idx + 1 < ListItem.Values.Count) ? ", " : "");
                    }
                    Writer.LeaveParam();
                    Writer.WriteParam("desc", ListItem.Description);
                    Writer.LeaveObject();
                }

                // Leave the section and list
                Writer.WriteObject("MetadataListTail");
                Writer.LeaveSection();
            }
        }
Beispiel #3
0
        public void WriteListItem(UdnWriter Writer)
        {
            bool OutputPage = ShouldOutputPage();

            // Enter the object
            Writer.EnterObject(OutputPage? "VariableListItem" : "VariableListItemNoLink");

            // Get all the icons
            List <Icon> Icons = new List <Icon>();

            Icons.Add(APIDocTool.Icons.Variable[(int)Protection]);
            if (IsStatic)
            {
                Icons.Add(APIDocTool.Icons.StaticVariable);
            }
            if (MetadataDirective != null)
            {
                Icons.Add(APIDocTool.Icons.ReflectedVariable);
                Icons.AddRange(MetadataDirective.Icons);
            }
            Writer.WriteParam("icons", Icons);

            // Write the type
            Writer.WriteParam("type", AbbreviatedType);
            Writer.WriteParam("name", Name);
            if (OutputPage)
            {
                Writer.WriteParam("link", "[RELATIVE:" + LinkPath + "]");
            }
            Writer.WriteParam("description", BriefDescription);

            // Leave the object
            Writer.LeaveObject();
        }
Beispiel #4
0
        public void WritePin(UdnWriter Writer)
        {
            Writer.EnterObject("ActionPinListItem");

            Writer.EnterParam("icons");

            var PinType = GetTypeText();

            if (PinType == "exec")
            {
                Writer.WriteRegion("input_exec", "");
            }
            else if (bIsArray)
            {
                Writer.WriteRegion("input_array " + PinType, "");
            }
            else
            {
                Writer.WriteRegion("input_variable " + PinType, "");
            }
            Writer.LeaveParam();

            Writer.WriteParamLiteral("name", Name);
            Writer.WriteParamLiteral("type", TypeText);
            Writer.WriteParam("tooltip", Tooltip);
            Writer.WriteParamLiteral("id", GetId());
            Writer.LeaveObject();
        }
Beispiel #5
0
        public void WriteListItem(UdnWriter Writer, bool bWithType)
        {
            // Enter the object
            Writer.EnterObject(bWithType? "FunctionListItemWithType" : "FunctionListItem");

            // Get all the icons
            List <Icon> ItemIcons = new List <Icon> {
                Icons.Function[(int)Protection]
            };

            if (IsStatic)
            {
                ItemIcons.Add(Icons.StaticFunction);
            }
            if (IsVirtual)
            {
                ItemIcons.Add(Icons.VirtualFunction);
            }
            if (MetadataDirective != null)
            {
                ItemIcons.Add(Icons.ReflectedFunction);
                ItemIcons.AddRange(MetadataDirective.Icons);
            }
            Writer.WriteParam("icons", ItemIcons);

            // Write the return type
            Writer.WriteParam("type", Markdown.Truncate(ReturnType, 12, "..."));

            // Write the name
            if (Parameters.Count == 0)
            {
                Writer.WriteParam("name", Name + "()");
                Writer.WriteParam("arguments", "");
            }
            else
            {
                Writer.WriteParam("name", Name);
                Writer.EnterParam("arguments");
                if (Parameters.Count > 0)
                {
                    Writer.WriteEscapedLine("(  ");
                    for (int Idx = 0; Idx < Parameters.Count; Idx++)
                    {
                        string Separator  = (Idx + 1 == Parameters.Count) ? "" : ",";
                        string Definition = Markdown.Truncate(APIMember.RemoveElaborations(Parameters[Idx].Definition), 35, "...");
                        Writer.WriteLine(UdnWriter.TabSpaces + Definition + Separator + "  ");
                    }
                    Writer.WriteEscapedLine(")  ");
                }
                Writer.LeaveParam();
            }

            // Write the other parameters
            Writer.WriteParam("link", "[RELATIVE:" + LinkPath + "]");
            Writer.WriteParam("description", BriefDescription);

            // Leave the object
            Writer.LeaveObject();
        }
Beispiel #6
0
        public void WriteListItem(UdnWriter Writer)
        {
            // Enter the object
            Writer.EnterObject("FunctionListItem");

            // Get all the icons
            List <Icon> ItemIcons = new List <Icon> {
                Icons.Function[(int)Protection]
            };

            if (IsStatic)
            {
                ItemIcons.Add(Icons.StaticFunction);
            }
            if (IsVirtual)
            {
                ItemIcons.Add(Icons.VirtualFunction);
            }
            if (MetadataDirective != null)
            {
                ItemIcons.Add(Icons.ReflectedFunction);
                ItemIcons.AddRange(MetadataDirective.Icons);
            }
            Writer.WriteParam("icons", ItemIcons);

            // Write the name
            Writer.WriteParam("name", Name);
            Writer.WriteParam("link", "[RELATIVE:" + LinkPath + "]");

            // Add the parameter section if need be
            Writer.EnterParam("arguments");
            if (Parameters.Count > 0)
            {
                Writer.WriteEscapedLine("(  ");
                for (int Idx = 0; Idx < Parameters.Count; Idx++)
                {
                    string Separator  = (Idx + 1 == Parameters.Count) ? "" : ",";
                    string Definition = Markdown.Truncate(Parameters[Idx].GetAbbreviatedDefinition(), 35, "...");
                    Writer.WriteLine(UdnWriter.TabSpaces + Definition + Separator + "  ");
                }
                Writer.WriteEscapedLine(")  ");
            }
            Writer.LeaveParam();

            // Write the description
            Writer.WriteParam("description", BriefDescription);

            // Leave the object
            Writer.LeaveObject();
        }
Beispiel #7
0
        public static void WriteHierarchy(UdnWriter Writer, APIHierarchyNode RootNode, string Id)
        {
            Writer.WriteLine("<table class=\"{0}\" cellspacing=\"0\" id=\"{1}\">", RootNode.bShowButton ? "hierarchy-table-collapsed" : "hierarchy-table", Id);
            for (int Idx = 0; Idx < RootNode.Children.Count; Idx++)
            {
                APIHierarchyNode Node    = RootNode.Children[Idx];
                string           ChildId = String.Format("{0}_{1}", Id, Idx + 1);

                // Write the start of the row
                Writer.WriteLine("<tr>");

                // Write the button or spacer
                Writer.EnterTag("<td class=\"hierarchy-button-cell\">");
                if (Node.Children.Count == 0 || !Node.bShowButton)
                {
                    Writer.WriteObject("HierarchySpacer");
                }
                else
                {
                    Writer.EnterObject("HierarchyButton");
                    Writer.WriteParamLiteral("id", ChildId);
                    Writer.LeaveObject();
                }
                Writer.LeaveTag("</td>");

                // Write the label
                Writer.EnterTag("<td class=\"hierarchy-label-cell\">");
                if (Node.LinkPath == null)
                {
                    Writer.WriteObject("HierarchyLabel", "name", Node.Label);
                }
                else
                {
                    Writer.WriteObject("HierarchyLabelLinked", "name", Node.Label, "link", "[RELATIVE:" + Node.LinkPath + "]");
                }

                // Write the contents row
                if (Node.Children.Count > 0)
                {
                    WriteHierarchy(Writer, Node, ChildId);
                }
                Writer.LeaveTag("</td>");

                // Write the end of the row
                Writer.WriteLine("</tr>");
            }
            Writer.WriteLine("</table>");
        }
        public void WritePin(UdnWriter Writer)
        {
            // Get all the icons
            List <Icon> ItemIcons = new List <Icon>();

            if (bIsArray)
            {
                ItemIcons.Add(Icons.ArrayVariablePinIcons[GetPinCategory()]);
            }
            else
            {
                ItemIcons.Add(Icons.VariablePinIcons[GetPinCategory()]);
            }

            Writer.EnterObject("ActionPinListItem");
            Writer.WriteParam("icons", ItemIcons);
            Writer.WriteParamLiteral("name", Name);
            Writer.WriteParamLiteral("type", TypeText);
            Writer.WriteParam("tooltip", Tooltip);
            Writer.WriteParamLiteral("id", GetId());
            Writer.LeaveObject();
        }
Beispiel #9
0
        public void WriteListItem(UdnWriter Writer, bool bWithType)
        {
            // Enter the object
            Writer.EnterObject(bWithType? "FunctionListItemWithType" : "FunctionListItem");

            // Get all the icons
            List<Icon> ItemIcons = new List<Icon>{ Icons.Function[(int)Protection] };
            if (IsStatic)
            {
                ItemIcons.Add(Icons.StaticFunction);
            }
            if (IsVirtual)
            {
                ItemIcons.Add(Icons.VirtualFunction);
            }
            if (MetadataDirective != null)
            {
                ItemIcons.Add(Icons.ReflectedFunction);
                ItemIcons.AddRange(MetadataDirective.Icons);
            }
            Writer.WriteParam("icons", ItemIcons);

            // Write the return type
            Writer.WriteParam("type", Markdown.Truncate(ReturnType, 12, "..."));

            // Write the name
            if(Parameters.Count == 0)
            {
                Writer.WriteParam("name", Name + "()");
                Writer.WriteParam("arguments", "");
            }
            else
            {
                Writer.WriteParam("name", Name);
                Writer.EnterParam("arguments");
                if (Parameters.Count > 0)
                {
                    Writer.WriteEscapedLine("(  ");
                    for (int Idx = 0; Idx < Parameters.Count; Idx++)
                    {
                        string Separator = (Idx + 1 == Parameters.Count) ? "" : ",";
                        string Definition = Markdown.Truncate(APIMember.RemoveElaborations(Parameters[Idx].Definition), 35, "...");
                        // Fix spacing around pointer/reference punctuation to match Epic code standards.
                        if (Definition != null)
                        {
                            Definition = Definition.Replace(" *", "*").Replace(" &", "&");
                        }
                        Writer.WriteLine(UdnWriter.TabSpaces + Definition + Separator + "  ");
                    }
                    Writer.WriteEscapedLine(")  ");
                }
                Writer.LeaveParam();
            }

            // Write the other parameters
            Writer.WriteParam("link", "[RELATIVE:" + LinkPath + "]");
            Writer.WriteParam("description", BriefDescription);

            // Leave the object
            Writer.LeaveObject();
        }
Beispiel #10
0
        public override void WritePage(UdnManifest Manifest, string OutputPath)
        {
            using (UdnWriter Writer = new UdnWriter(OutputPath))
            {
                Writer.WritePageHeader(Name, PageCrumbs, Name);

                // Tooltip/description
                Writer.WriteLine(Tooltip);

                if (Pins != null && Pins.Count() > 0)
                {
                    // Visualization of the node
                    Writer.EnterRegion("graph");
                    Writer.EnterObject("BlueprintNode");
                    if (CompactName != null)
                    {
                        Writer.WriteParamLiteral("type", "compact");
                        Writer.WriteParamLiteral("title", CompactName);
                    }
                    else
                    {
                        Writer.WriteParamLiteral("type", NodeType);
                        Writer.WriteParamLiteral("title", Name);
                    }
                    Writer.EnterParam("inputs");
                    WritePinObjects(Writer, Pins.Where(x => x.bInputPin));
                    Writer.LeaveParam();
                    Writer.EnterParam("outputs");
                    WritePinObjects(Writer, Pins.Where(x => !x.bInputPin));

                    if (bShowAddPin)
                    {
                        Writer.EnterObject("BlueprintPin");
                        Writer.WriteParamLiteral("type", "addpin");
                        Writer.WriteParamLiteral("id", "AddPin");
                        Writer.WriteParamLiteral("title", "Add pin");
                        Writer.LeaveObject();
                    }

                    Writer.LeaveParam();
                    Writer.LeaveObject();
                    Writer.LeaveRegion();

                    // Inputs
                    Writer.EnterSection("inputs", "Inputs");
                    Writer.WriteObject("MemberIconListHeadBlank");
                    WritePins(Writer, Pins.Where(x => x.bInputPin));
                    Writer.WriteObject("MemberIconListTail");
                    Writer.LeaveSection();

                    // Outputs
                    Writer.EnterSection("outputs", "Outputs");
                    Writer.WriteObject("MemberIconListHeadBlank");
                    WritePins(Writer, Pins.Where(x => !x.bInputPin));
                    Writer.WriteObject("MemberIconListTail");
                    Writer.LeaveSection();
                }
            }
        }
        public void WriteListItem(UdnWriter Writer)
        {
            // Enter the object
            Writer.EnterObject("FunctionListItem");

            // Get all the icons
            List<Icon> ItemIcons = new List<Icon>{ Icons.Function[(int)Protection] };
            if (IsStatic)
            {
                ItemIcons.Add(Icons.StaticFunction);
            }
            if (IsVirtual)
            {
                ItemIcons.Add(Icons.VirtualFunction);
            }
            if (MetadataDirective != null)
            {
                ItemIcons.Add(Icons.ReflectedFunction);
                ItemIcons.AddRange(MetadataDirective.Icons);
            }
            Writer.WriteParam("icons", ItemIcons);

            // Write the name
            Writer.WriteParam("name", Name);
            Writer.WriteParam("link", "[RELATIVE:" + LinkPath + "]");

            // Add the parameter section if need be
            Writer.EnterParam("arguments");
            if (Parameters.Count > 0)
            {
                Writer.WriteEscapedLine("(  ");
                for (int Idx = 0; Idx < Parameters.Count; Idx++)
                {
                    string Separator = (Idx + 1 == Parameters.Count) ? "" : ",";
                    string Definition = Markdown.Truncate(Parameters[Idx].GetAbbreviatedDefinition(), 35, "...");
                    Writer.WriteLine(UdnWriter.TabSpaces + Definition + Separator + "  ");
                }
                Writer.WriteEscapedLine(")  ");
            }
            Writer.LeaveParam();

            // Write the description
            Writer.WriteParam("description", BriefDescription);

            // Leave the object
            Writer.LeaveObject();
        }
Beispiel #12
0
        public override void WritePage(UdnManifest Manifest, string OutputPath)
        {
            using (UdnWriter Writer = new UdnWriter(OutputPath))
            {
                Writer.WritePageHeader(Name, PageCrumbs, Name);

                // Tooltip/description - Write this as interleaved text and notes
                foreach (TooltipLine TTL in TooltipData)
                {
                    switch (TTL.Type)
                    {
                    case TooltipLine.LineType.Normal:
                        Writer.WriteLine(TTL.Text);
                        break;

                    case TooltipLine.LineType.Note:
                        Writer.EnterRegion("note");
                        Writer.WriteLine(TTL.Text);
                        Writer.LeaveRegion();
                        break;

                    default:
                        //Error? Ignore this entry for now.
                        break;
                    }
                }

                if (Pins != null && Pins.Count() > 0)
                {
                    // Visualization of the node
                    Writer.EnterRegion("graph");
                    Writer.EnterObject("BlueprintNode");
                    if (CompactName != null)
                    {
                        Writer.WriteParamLiteral("type", "compact");
                        Writer.WriteParamLiteral("title", CompactName);
                    }
                    else
                    {
                        Writer.WriteParamLiteral("type", NodeType);
                        Writer.WriteParamLiteral("title", Name);
                    }
                    Writer.EnterParam("inputs");
                    WritePinObjects(Writer, Pins.Where(x => x.bInputPin));
                    Writer.LeaveParam();
                    Writer.EnterParam("outputs");
                    WritePinObjects(Writer, Pins.Where(x => !x.bInputPin && x.GetTypeText() != "delegate"));

                    if (bShowAddPin)
                    {
                        Writer.EnterObject("BlueprintPin");
                        Writer.WriteParamLiteral("type", "addpin");
                        Writer.WriteParamLiteral("id", "AddPin");
                        Writer.WriteParamLiteral("title", "Add pin");
                        Writer.LeaveObject();
                    }

                    Writer.LeaveParam();
                    Writer.LeaveObject();
                    Writer.LeaveRegion();

                    // Inputs
                    Writer.EnterSection("inputs", "Inputs");
                    Writer.WriteObject("MemberIconListHeadBlank");
                    WritePins(Writer, Pins.Where(x => x.bInputPin));
                    Writer.WriteObject("MemberIconListTail");
                    Writer.LeaveSection();

                    // Outputs
                    Writer.EnterSection("outputs", "Outputs");
                    Writer.WriteObject("MemberIconListHeadBlank");
                    // TODO: Remove this hack and reinstate the one-line version once UE-16475 is resolved.
                    bool bAlreadyWroteOutputDelegate = false;
                    for (int i = 0; i < Pins.Count; ++i)
                    {
                        APIActionPin Pin = Pins[i];
                        if (!Pin.bInputPin)
                        {
                            if (Pin.GetTypeText() == "delegate")
                            {
                                if (bAlreadyWroteOutputDelegate)
                                {
                                    continue;
                                }
                                bAlreadyWroteOutputDelegate = true;
                            }
                            Pin.WritePin(Writer);
                        }
                    }
                    //WritePins(Writer, Pins.Where(x => !x.bInputPin));
                    Writer.WriteObject("MemberIconListTail");
                    Writer.LeaveSection();
                }
            }
        }
Beispiel #13
0
        public override void WritePage(UdnManifest Manifest, string OutputPath)
        {
            using (UdnWriter Writer = new UdnWriter(OutputPath))
            {
                Writer.WritePageHeader(Name, PageCrumbs, Name);

                // Tooltip/description - Write this as interleaved text and notes
                foreach (TooltipLine TTL in TooltipData)
                {
                    switch (TTL.Type)
                    {
                    case TooltipLine.LineType.Normal:
                        Writer.WriteLine(TTL.Text);
                        break;

                    case TooltipLine.LineType.Note:
                        Writer.EnterRegion("note");
                        Writer.WriteLine(TTL.Text);
                        Writer.LeaveRegion();
                        break;

                    default:
                        //Error? Ignore this entry for now.
                        break;
                    }
                }

                if (Pins != null && Pins.Count() > 0)
                {
                    // Visualization of the node
                    Writer.EnterRegion("graph");
                    Writer.EnterObject("BlueprintNode");
                    if (CompactName != null)
                    {
                        Writer.WriteParamLiteral("type", "compact");
                        Writer.WriteParamLiteral("title", CompactName);
                    }
                    else
                    {
                        Writer.WriteParamLiteral("type", NodeType);
                        Writer.WriteParamLiteral("title", Name);
                    }
                    Writer.EnterParam("inputs");
                    WritePinObjects(Writer, Pins.Where(x => x.bInputPin));
                    Writer.LeaveParam();
                    Writer.EnterParam("outputs");
                    WritePinObjects(Writer, Pins.Where(x => !x.bInputPin && x.GetTypeText() != "delegate"));

                    if (bShowAddPin)
                    {
                        Writer.EnterObject("BlueprintPin");
                        Writer.WriteParamLiteral("type", "addpin");
                        Writer.WriteParamLiteral("id", "AddPin");
                        Writer.WriteParamLiteral("title", "Add pin");
                        Writer.LeaveObject();
                    }

                    Writer.LeaveParam();
                    Writer.LeaveObject();
                    Writer.LeaveRegion();

                    // Inputs
                    Writer.EnterSection("inputs", "Inputs");
                    Writer.WriteObject("MemberIconListHeadBlank");
                    WritePins(Writer, Pins.Where(x => x.bInputPin));
                    Writer.WriteObject("MemberIconListTail");
                    Writer.LeaveSection();

                    // Outputs
                    Writer.EnterSection("outputs", "Outputs");
                    Writer.WriteObject("MemberIconListHeadBlank");
                    WritePins(Writer, Pins.Where(x => !x.bInputPin));
                    Writer.WriteObject("MemberIconListTail");
                    Writer.LeaveSection();
                }
            }
        }
		public void WritePin(UdnWriter Writer)
		{
			Writer.EnterObject("ActionPinListItem");
			
			Writer.EnterParam("icons");

			var PinType = GetTypeText();
			if (PinType == "exec")
			{
				Writer.WriteRegion("input_exec","");
			}
			else if (bIsArray)
			{
				Writer.WriteRegion("input_array " + PinType, "");
			}
			else
			{
				Writer.WriteRegion("input_variable " + PinType, "");
			}
			Writer.LeaveParam();

			Writer.WriteParamLiteral("name", Name);
			Writer.WriteParamLiteral("type", TypeText);
			Writer.WriteParam("tooltip", Tooltip);
			Writer.WriteParamLiteral("id", GetId());
			Writer.LeaveObject();
		}
		public void WriteObject(UdnWriter Writer, bool bDrawLabels)
		{
			Writer.EnterObject("BlueprintPin");
			Writer.WriteParamLiteral("type", GetTypeText() + (bIsArray ? " array" : ""));
			Writer.WriteParamLiteral("id", GetId());

			if (bShowPinLabel && bDrawLabels)
			{
				Writer.WriteParamLiteral("title",  Name);
			}

			var DefaultValueElements = DefaultValue.Replace('(',' ').Replace(')',' ').Split(',');
			switch (GetTypeText())
			{
				case "byte":
					Writer.WriteParamLiteral("value", (DefaultValueElements[0].Length > 0 ? DefaultValueElements[0] : "0"));
					break;

				case "class":
					if (bShowAssetPicker)
					{
						Writer.WriteParamLiteral("value", "Select Class");
					}
					break;

				case "float":
					Writer.WriteParamLiteral("value", (DefaultValueElements[0].Length > 0 ? DefaultValueElements[0] : "0.0"));
					break;

				case "integer":
					Writer.WriteParamLiteral("value", (DefaultValueElements[0].Length > 0 ? DefaultValueElements[0] : "0"));
					break;

				case "object":
					if (bShowAssetPicker)
					{
						Writer.WriteParamLiteral("value", "Select Asset");
					}
					break;

				case "rotator":
					Writer.WriteParamLiteral("yaw", (DefaultValueElements[0].Length > 0 ? DefaultValueElements[0] : "0.0"));
					Writer.WriteParamLiteral("pitch", (DefaultValueElements.Length > 1 ? DefaultValueElements[1] : "0.0"));
					Writer.WriteParamLiteral("roll", (DefaultValueElements.Length > 2 ? DefaultValueElements[2] : "0.0"));
					break;

				case "linearcolor":
					float r = (DefaultValueElements[0].Length > 0 ? float.Parse(DefaultValueElements[0].Split('=')[1]) : 0) * 255;
					float g = (DefaultValueElements.Length > 1 ? float.Parse(DefaultValueElements[1].Split('=')[1]) : 0) * 255;
					float b = (DefaultValueElements.Length > 2 ? float.Parse(DefaultValueElements[2].Split('=')[1]) : 0) * 255;

					Writer.WriteParamLiteral("r", ((int)r).ToString());
					Writer.WriteParamLiteral("g", ((int)g).ToString());
					Writer.WriteParamLiteral("b", ((int)b).ToString());
					break;

				case "vector2d struct":
					Writer.WriteParamLiteral("x", (DefaultValueElements[0].Length > 0 ? DefaultValueElements[0].Split('=')[1] : "0.0"));
					Writer.WriteParamLiteral("y", (DefaultValueElements.Length > 1 ? DefaultValueElements[1].Split('=')[1] : "0.0"));
					break;

				case "vector":
					Writer.WriteParamLiteral("x", (DefaultValueElements[0].Length > 0 ? DefaultValueElements[0] : "0.0"));
					Writer.WriteParamLiteral("y",(DefaultValueElements.Length > 1 ? DefaultValueElements[1] : "0.0"));
					Writer.WriteParamLiteral("z",(DefaultValueElements.Length > 2 ? DefaultValueElements[2] : "0.0"));
					break;

				default:
					Writer.WriteParamLiteral("value", DefaultValue);
					break;
			}

			Writer.LeaveObject();
		}
Beispiel #16
0
        public void WriteListSection(UdnWriter Writer, string SectionId, string SectionTitle, Dictionary<string, string> Descriptions)
        {
            if (NodeList.Count > 0)
            {
                // Create the list items
                List<MetadataListItem> ListItems = new List<MetadataListItem>();
                CreateListItems(NodeList, APIDocTool.Icons.GetMetadataIconsForType(Type), Descriptions, false, ListItems);

                // Enter the section and list
                Writer.EnterSection(SectionId, SectionTitle);
                Writer.WriteObject("MetadataListHead");

                // Write the items
                foreach (MetadataListItem ListItem in ListItems)
                {
                    Writer.EnterObject("MetadataListItem");
                    Writer.WriteParam("icon", ListItem.Icon);
                    Writer.WriteParam("name", ListItem.Name);
                    Writer.EnterParam("value");
                    for (int Idx = 0; Idx < ListItem.Values.Count; Idx++)
                    {
                        Writer.WriteLine("{0}{1}  ", ListItem.Values[Idx], (Idx + 1 < ListItem.Values.Count) ? ", " : "");
                    }
                    Writer.LeaveParam();
                    Writer.WriteParam("desc", ListItem.Description);
                    Writer.LeaveObject();
                }

                // Leave the section and list
                Writer.WriteObject("MetadataListTail");
                Writer.LeaveSection();
            }
        }
        public static void WriteHierarchy(UdnWriter Writer, APIHierarchyNode RootNode, string Id)
        {
            Writer.WriteLine("<table class=\"{0}\" cellspacing=\"0\" id=\"{1}\">", RootNode.bShowButton ? "hierarchy-table-collapsed" : "hierarchy-table", Id);
            for(int Idx = 0; Idx < RootNode.Children.Count; Idx++)
            {
                APIHierarchyNode Node = RootNode.Children[Idx];
                string ChildId = String.Format("{0}_{1}", Id, Idx + 1);

                // Write the start of the row
                Writer.WriteLine("<tr>");

                // Write the button or spacer
                Writer.EnterTag("<td class=\"hierarchy-button-cell\">");
                if (Node.Children.Count == 0 || !Node.bShowButton)
                {
                    Writer.WriteObject("HierarchySpacer");
                }
                else
                {
                    Writer.EnterObject("HierarchyButton");
                    Writer.WriteParamLiteral("id", ChildId);
                    Writer.LeaveObject();
                }
                Writer.LeaveTag("</td>");

                // Write the label
                Writer.EnterTag("<td class=\"hierarchy-label-cell\">");
                if (Node.LinkPath == null)
                {
                    Writer.WriteObject("HierarchyLabel", "name", Node.Label);
                }
                else
                {
                    Writer.WriteObject("HierarchyLabelLinked", "name", Node.Label, "link", "[RELATIVE:" + Node.LinkPath + "]");
                }

                // Write the contents row
                if (Node.Children.Count > 0)
                {
                    WriteHierarchy(Writer, Node, ChildId);
                }
                Writer.LeaveTag("</td>");

                // Write the end of the row
                Writer.WriteLine("</tr>");
            }
            Writer.WriteLine("</table>");
        }
        public void WritePin(UdnWriter Writer)
        {
            // Get all the icons
            List<Icon> ItemIcons = new List<Icon>();
            if (bIsArray)
            {
                ItemIcons.Add(Icons.ArrayVariablePinIcons[GetPinCategory()]);
            }
            else
            {
                ItemIcons.Add(Icons.VariablePinIcons[GetPinCategory()]);
            }

            Writer.EnterObject("ActionPinListItem");
            Writer.WriteParam("icons", ItemIcons);
            Writer.WriteParamLiteral("name", Name);
            Writer.WriteParamLiteral("type", TypeText);
            Writer.WriteParam("tooltip", Tooltip);
            Writer.WriteParamLiteral("id", GetId());
            Writer.LeaveObject();
        }
		public override void WritePage(UdnManifest Manifest, string OutputPath)
		{
			using (UdnWriter Writer = new UdnWriter(OutputPath))
			{
				Writer.WritePageHeader(Name, PageCrumbs, Name);

				// Tooltip/description - Write this as interleaved text and notes
				foreach (TooltipLine TTL in TooltipData)
				{
					switch (TTL.Type)
					{
						case TooltipLine.LineType.Normal:
							Writer.WriteLine(TTL.Text);
							break;
						case TooltipLine.LineType.Note:
							Writer.EnterRegion("note");
							Writer.WriteLine(TTL.Text);
							Writer.LeaveRegion();
							break;
						default:
							//Error? Ignore this entry for now.
							break;
					}
				}

				if (Pins != null && Pins.Count() > 0)
				{
					// Visualization of the node
					Writer.EnterRegion("graph");
					Writer.EnterObject("BlueprintNode");
					if (CompactName != null)
					{
						Writer.WriteParamLiteral("type", "compact");
						Writer.WriteParamLiteral("title", CompactName);
					}
					else
					{
						Writer.WriteParamLiteral("type", NodeType);
						Writer.WriteParamLiteral("title", Name);
					}
					Writer.EnterParam("inputs");
					WritePinObjects(Writer, Pins.Where(x => x.bInputPin));
					Writer.LeaveParam();
					Writer.EnterParam("outputs");
					WritePinObjects(Writer, Pins.Where(x => !x.bInputPin && x.GetTypeText() != "delegate"));

					if (bShowAddPin)
					{
						Writer.EnterObject("BlueprintPin");
						Writer.WriteParamLiteral("type", "addpin");
						Writer.WriteParamLiteral("id", "AddPin");
						Writer.WriteParamLiteral("title", "Add pin");
						Writer.LeaveObject();
					}

					Writer.LeaveParam();
					Writer.LeaveObject();
					Writer.LeaveRegion();

					// Inputs
					Writer.EnterSection("inputs", "Inputs");
					Writer.WriteObject("MemberIconListHeadBlank");
					WritePins(Writer, Pins.Where(x => x.bInputPin));
					Writer.WriteObject("MemberIconListTail");
					Writer.LeaveSection();

					// Outputs
					Writer.EnterSection("outputs", "Outputs");
					Writer.WriteObject("MemberIconListHeadBlank");
					// TODO: Remove this hack and reinstate the one-line version once UE-16475 is resolved.
					bool bAlreadyWroteOutputDelegate = false;
					for (int i = 0; i < Pins.Count; ++i)
					{
						APIActionPin Pin = Pins[i];
						if (!Pin.bInputPin)
						{
							if (Pin.GetTypeText() == "delegate")
							{
								if (bAlreadyWroteOutputDelegate)
								{
									continue;
								}
								bAlreadyWroteOutputDelegate = true;
							}
							Pin.WritePin(Writer);
						}
					}
					//WritePins(Writer, Pins.Where(x => !x.bInputPin));
					Writer.WriteObject("MemberIconListTail");
					Writer.LeaveSection();
				}
			}
		}
Beispiel #20
0
		public override void WritePage(UdnManifest Manifest, string OutputPath)
		{
			using (UdnWriter Writer = new UdnWriter(OutputPath))
			{
				Writer.WritePageHeader(Name, PageCrumbs, Name);

				// Tooltip/description - Write this as interleaved text and notes
				foreach (TooltipLine TTL in TooltipData)
				{
					switch (TTL.Type)
					{
						case TooltipLine.LineType.Normal:
							Writer.WriteLine(TTL.Text);
							break;
						case TooltipLine.LineType.Note:
							Writer.EnterRegion("note");
							Writer.WriteLine(TTL.Text);
							Writer.LeaveRegion();
							break;
						default:
							//Error? Ignore this entry for now.
							break;
					}
				}

				if (Pins != null && Pins.Count() > 0)
				{
					// Visualization of the node
					Writer.EnterRegion("graph");
					Writer.EnterObject("BlueprintNode");
					if (CompactName != null)
					{
						Writer.WriteParamLiteral("type", "compact");
						Writer.WriteParamLiteral("title", CompactName);
					}
					else
					{
						Writer.WriteParamLiteral("type", NodeType);
						Writer.WriteParamLiteral("title", Name);
					}
					Writer.EnterParam("inputs");
					WritePinObjects(Writer, Pins.Where(x => x.bInputPin));
					Writer.LeaveParam();
					Writer.EnterParam("outputs");
					WritePinObjects(Writer, Pins.Where(x => !x.bInputPin && x.GetTypeText() != "delegate"));

					if (bShowAddPin)
					{
						Writer.EnterObject("BlueprintPin");
						Writer.WriteParamLiteral("type", "addpin");
						Writer.WriteParamLiteral("id", "AddPin");
						Writer.WriteParamLiteral("title", "Add pin");
						Writer.LeaveObject();
					}

					Writer.LeaveParam();
					Writer.LeaveObject();
					Writer.LeaveRegion();

					// Inputs
					Writer.EnterSection("inputs", "Inputs");
					Writer.WriteObject("MemberIconListHeadBlank");
					WritePins(Writer, Pins.Where(x => x.bInputPin));
					Writer.WriteObject("MemberIconListTail");
					Writer.LeaveSection();

					// Outputs
					Writer.EnterSection("outputs", "Outputs");
					Writer.WriteObject("MemberIconListHeadBlank");
					WritePins(Writer, Pins.Where(x => !x.bInputPin));
					Writer.WriteObject("MemberIconListTail");
					Writer.LeaveSection();
				}
			}
		}
Beispiel #21
0
		public void WriteListItem(UdnWriter Writer)
		{
			bool OutputPage = ShouldOutputPage();

			// Enter the object
			Writer.EnterObject(OutputPage? "VariableListItem" : "VariableListItemNoLink");

			// Get all the icons
			List<Icon> Icons = new List<Icon>();
			Icons.Add(APIDocTool.Icons.Variable[(int)Protection]);
			if (IsStatic)
			{
				Icons.Add(APIDocTool.Icons.StaticVariable);
			}
			if (MetadataDirective != null)
			{
				Icons.Add(APIDocTool.Icons.ReflectedVariable);
				Icons.AddRange(MetadataDirective.Icons);
			}
			Writer.WriteParam("icons", Icons);

			// Write the type
			Writer.WriteParam("type", AbbreviatedType);
			Writer.WriteParam("name", Name);
			if(OutputPage)
			{
				Writer.WriteParam("link", "[RELATIVE:" + LinkPath + "]");
			}
			Writer.WriteParam("description", BriefDescription);

			// Leave the object
			Writer.LeaveObject();
		}
Beispiel #22
0
        public void WriteObject(UdnWriter Writer, bool bDrawLabels)
        {
            Writer.EnterObject("BlueprintPin");
            Writer.WriteParamLiteral("type", GetTypeText() + (bIsArray ? " array" : ""));
            Writer.WriteParamLiteral("id", GetId());

            if (bShowPinLabel && bDrawLabels)
            {
                Writer.WriteParamLiteral("title", Name);
            }

            var DefaultValueElements = DefaultValue.Replace('(', ' ').Replace(')', ' ').Split(',');

            switch (GetTypeText())
            {
            case "byte":
                Writer.WriteParamLiteral("value", (DefaultValueElements[0].Length > 0 ? DefaultValueElements[0] : "0"));
                break;

            case "class":
                if (bShowAssetPicker)
                {
                    Writer.WriteParamLiteral("value", "Select Class");
                }
                break;

            case "float":
                Writer.WriteParamLiteral("value", (DefaultValueElements[0].Length > 0 ? DefaultValueElements[0] : "0.0"));
                break;

            case "integer":
                Writer.WriteParamLiteral("value", (DefaultValueElements[0].Length > 0 ? DefaultValueElements[0] : "0"));
                break;

            case "object":
                if (bShowAssetPicker)
                {
                    Writer.WriteParamLiteral("value", "Select Asset");
                }
                break;

            case "rotator":
                Writer.WriteParamLiteral("yaw", (DefaultValueElements[0].Length > 0 ? DefaultValueElements[0] : "0.0"));
                Writer.WriteParamLiteral("pitch", (DefaultValueElements.Length > 1 ? DefaultValueElements[1] : "0.0"));
                Writer.WriteParamLiteral("roll", (DefaultValueElements.Length > 2 ? DefaultValueElements[2] : "0.0"));
                break;

            case "linearcolor":
                float r = (DefaultValueElements[0].Length > 0 ? float.Parse(DefaultValueElements[0].Split('=')[1]) : 0) * 255;
                float g = (DefaultValueElements.Length > 1 ? float.Parse(DefaultValueElements[1].Split('=')[1]) : 0) * 255;
                float b = (DefaultValueElements.Length > 2 ? float.Parse(DefaultValueElements[2].Split('=')[1]) : 0) * 255;

                Writer.WriteParamLiteral("r", ((int)r).ToString());
                Writer.WriteParamLiteral("g", ((int)g).ToString());
                Writer.WriteParamLiteral("b", ((int)b).ToString());
                break;

            case "vector2d struct":
                Writer.WriteParamLiteral("x", (DefaultValueElements[0].Length > 0 ? DefaultValueElements[0].Split('=')[1] : "0.0"));
                Writer.WriteParamLiteral("y", (DefaultValueElements.Length > 1 ? DefaultValueElements[1].Split('=')[1] : "0.0"));
                break;

            case "vector":
                Writer.WriteParamLiteral("x", (DefaultValueElements[0].Length > 0 ? DefaultValueElements[0] : "0.0"));
                Writer.WriteParamLiteral("y", (DefaultValueElements.Length > 1 ? DefaultValueElements[1] : "0.0"));
                Writer.WriteParamLiteral("z", (DefaultValueElements.Length > 2 ? DefaultValueElements[2] : "0.0"));
                break;

            default:
                Writer.WriteParamLiteral("value", DefaultValue);
                break;
            }

            Writer.LeaveObject();
        }