Difference between revisions of "InsertXML"

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search
imported>Kyoma
m
imported>Kyoma
m
Line 1: Line 1:
{{Function
A command added by [[:Category: MenuQue|MenuQue]].
|origin = OBSE
|summary = Inserts an xml file or string into an existing menu.
|name = InsertXML
|returnVal = success
|returnType = bool
|arguments =
  {{FunctionArgument
  |Name = xmlString
  |Type = formatString
  }}


'''Syntax:'''
(success:bool) InsertXML contentAndComponent:formatString menuType:int


}}
Inserts the xml file or xml content into the given menu. The component follows the content separated from it by a pipe character (i.e. <tt>some_file.xml|background</tt>). If calling from the console, replace the pipe character with the '@' character.


[[category: MenuQue]]
== 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 ==
* The filepath is relative to Data\Menus\Prefabs
* The component path can be omitted to insert at the menu's top-level
 
==See also==
[[InsertXMLTemplate]]
 
[[Category: MenuQue]]
 
<!-- Begin Search Terms
Insert
XML
End Search Terms -->

Revision as of 09:04, 5 March 2011

A command added by MenuQue.

Syntax:

(success:bool) InsertXML contentAndComponent:formatString menuType:int

Inserts the xml file or xml content into the given menu. The component follows the content separated from it by a pipe character (i.e. some_file.xml|background). If calling from the console, replace the pipe character with the '@' character.

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

  • The filepath is relative to Data\Menus\Prefabs
  • The component path can be omitted to insert at the menu's top-level

See also

InsertXMLTemplate