Difference between revisions of "Extra Strings (MenuQue)"

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search
imported>Kyoma
(Initial content)
 
imported>Kyoma
m
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
== Using Extra Strings with MenuQue ==
== Using Extra Strings with MenuQue ==
MenuQue allows the loading of additional strings.xml files. Useful as a central source of strings easy to access and translate. When the game loads up the string.xml file it will also load any .xml file found in Oblivion\Data\Menus\Strings.
MenuQue allows the loading of additional '''strings.xml''' files. Useful as a central source of strings that are easy to access and translate. When the game loads up the '''strings.xml''' file it will also load any .xml file found in Oblivion\Data\Menus\Strings.


== Methodes ==
== Methods ==
There are two methodes for these additional strings to be added. Under the same section as the normal strings or under their own uniquely named section. How it is handled depends on how the element is defined in the .xml, the name of the file itself is irrelevant.
There are two methods for these additional strings to be added. Under the same section as the normal strings or under their own uniquely named section. How it is handled depends on how the element is defined in the .xml, the name of the file itself is irrelevant.


===Normal===
===Normal===
To get the additional strings under the default section the name of the element should be "Strings" (which is the same as in string.xml). Because name collision can become a problem it is recommended you give your strings some sort of prefix. It is not required though. Here is an example of how the file should look like
To get the additional strings under the default section the name of the element should be "Strings" (which is the same as in '''strings.xml'''). It is recommended (but not required) to give the strings some sort of prefix to help avoid name collision. Here is an example of how the file should look like, using a prefix of '''Exp'''.
<pre>
<pre>
<rect name="Strings">
<rect name="Strings">
<_Exp_earned> You've earned some points. </_Exp_earned>
<_Exp_earned> You have gained some points </_Exp_earned>
<_Exp_rested> You're now rested and will earn more points. </_Exp_rested>
<_Exp_rested> You are now well rested and will gain more points. </_Exp_rested>
<_Exp_levelup> You've got enough points to buy something new. </_Exp_levelup>
<_Exp_levelup> You have gained enough points to levelup. </_Exp_levelup>
</rect>
</rect>
</pre>Accessing these strings from within other parts of the UI is the same as with the normal ones, namely:
</pre>Accessing these strings from within other parts of the UI is the same as with the normal ones, namely:
Line 18: Line 18:


===Unique===
===Unique===
To get the additional strings under a unique section the name of the element should be something other than "Strings". The preferred methode for when there are alot of additional strings as it avoids name collision as a whole. The name doesn't even have to include "Strings" Here is an example of how the file should look like
To get the additional strings under a unique section the name of the element should be something other than "Strings". The preferred methode for larger collections of strings as it helps avoid name collision in general. The name doesn't have to include "Strings". Here is an example of how the file should look like, using a section named '''Exp'''.
<pre>
<pre>
<rect name="Exp">
<rect name="Exp">
<_earned> You've earned some points. </_earned>
<_earned> You have gained some points </_earned>
<_rested> You're now rested and will earn more points. </_rested>
<_rested> You are now well rested and will gain more points. </_rested>
<_levelup> You've got enough points to buy something new. </_levelup>
<_levelup> You have gained enough points to levelup. </_levelup>
</rect>
</rect>
</pre>Accessing these strings from within other parts of the UI is alot like with the normal ones with the exception you need to specify the section you wish to use:
</pre>Accessing these strings from within other parts of the UI is alot like with the normal ones with the exception you need to specify the section you wish to use:
Line 30: Line 30:


== Notes ==
== Notes ==
* Should a name collision occure then the first string found will be used.
* When two strings (their names) collide with each other the first one found will be used.
* The extra files should have a similar layout as the strings.xml file.
* The extra files should have a similar layout as the strings.xml file.
* All traits should start with an underscore.
== See Also ==
*[[Extra_Fonts_(MenuQue)|Extra Fonts]]


[[Category:MenuQue]]
[[Category:MenuQue]]

Latest revision as of 04:59, 7 March 2011

Using Extra Strings with MenuQue[edit | edit source]

MenuQue allows the loading of additional strings.xml files. Useful as a central source of strings that are easy to access and translate. When the game loads up the strings.xml file it will also load any .xml file found in Oblivion\Data\Menus\Strings.

Methods[edit | edit source]

There are two methods for these additional strings to be added. Under the same section as the normal strings or under their own uniquely named section. How it is handled depends on how the element is defined in the .xml, the name of the file itself is irrelevant.

Normal[edit | edit source]

To get the additional strings under the default section the name of the element should be "Strings" (which is the same as in strings.xml). It is recommended (but not required) to give the strings some sort of prefix to help avoid name collision. Here is an example of how the file should look like, using a prefix of Exp.

<rect name="Strings">
	<_Exp_earned> You have gained some points </_Exp_earned>
	<_Exp_rested> You are now well rested and will gain more points. </_Exp_rested>
	<_Exp_levelup> You have gained enough points to levelup. </_Exp_levelup>
</rect>

Accessing these strings from within other parts of the UI is the same as with the normal ones, namely:

<string> <copy src="strings()" trait="_Exp_earned" /> </string>

To access them through script use the mqGetMenuGlobalStringValue function like this

set myString to mqGetMenuGlobalStringValue "_Exp_earned"

Unique[edit | edit source]

To get the additional strings under a unique section the name of the element should be something other than "Strings". The preferred methode for larger collections of strings as it helps avoid name collision in general. The name doesn't have to include "Strings". Here is an example of how the file should look like, using a section named Exp.

<rect name="Exp">
	<_earned> You have gained some points </_earned>
	<_rested> You are now well rested and will gain more points. </_rested>
	<_levelup> You have gained enough points to levelup. </_levelup>
</rect>

Accessing these strings from within other parts of the UI is alot like with the normal ones with the exception you need to specify the section you wish to use:

<string> <copy src="strings(Exp)" trait="_earned" /> </string>

To access them through script use the mqGetMenuGlobalStringValue function like this

set myString to mqGetMenuGlobalStringValue "Exp\_earned"

Notes[edit | edit source]

  • When two strings (their names) collide with each other the first one found will be used.
  • The extra files should have a similar layout as the strings.xml file.
  • All traits should start with an underscore.

See Also[edit | edit source]