Difference between revisions of "InsertXML"
Jump to navigation
Jump to search
imported>Kyoma (New page: {{Function |origin = OBSE |summary = Inserts an xml file or string into an existing menu. |name = InsertXML |returnVal = success |returnType = bool |arguments = {{FunctionArgument...) |
imported>Kyoma m |
||
(3 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
A command added by [[:Category: MenuQue|MenuQue]]. | |||
'''Syntax:''' | |||
(success:bool) InsertXML contentAndComponent:formatString menuType:int | |||
Inserts the xmlFile or xmlString into the given menu. The format string consists of two parts, each seperated by a pipe character. First the <tt>xmlFile</tt> or <tt>xmlString</tt> you wish to insert. Then the component path where it is to be inserted. | |||
== Examples == | |||
string_var text | |||
... | |||
InsertXML "some_special_icon.xml|magic_icons", 1004 | |||
if (InsertXML "custom_file.xml", 1004) | |||
;there were no errors during the inserting process | |||
endif | |||
set text to sv_Construct "<rect name=%qbackground_fix%q> <x> 10 </x> <y> 20 </y> </rect>" | |||
InsertXML "%z|background", text, 1001 ;insert the content of the string directly, no files involved | |||
== Notes == | |||
* If calling from the console, replace the pipe character with the '@' character. | |||
* The component path can be omitted, in which case it gets inserted at top-level | |||
* The filepath is relative to Data\Menus\Prefabs | |||
==See also== | |||
[[InsertXMLTemplate]] | |||
[[Category: MenuQue]] | |||
<!-- Begin Search Terms | |||
Insert | |||
XML | |||
End Search Terms --> |
Latest revision as of 10:44, 5 March 2011
A command added by MenuQue.
Syntax:
(success:bool) InsertXML contentAndComponent:formatString menuType:int
Inserts the xmlFile or xmlString into the given menu. The format string consists of two parts, each seperated by a pipe character. First the xmlFile or xmlString you wish to insert. Then the component path where it is to be inserted.
Examples[edit | edit source]
string_var text ... InsertXML "some_special_icon.xml|magic_icons", 1004 if (InsertXML "custom_file.xml", 1004) ;there were no errors during the inserting process endif set text to sv_Construct "<rect name=%qbackground_fix%q> <x> 10 </x> <y> 20 </y> </rect>" InsertXML "%z|background", text, 1001 ;insert the content of the string directly, no files involved
Notes[edit | edit source]
- If calling from the console, replace the pipe character with the '@' character.
- The component path can be omitted, in which case it gets inserted at top-level
- The filepath is relative to Data\Menus\Prefabs
See also[edit | edit source]