Difference between revisions of "Extra Strings (MenuQue)"
imported>Kyoma (Initial content) |
imported>Kyoma m (Spelling) |
||
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 | MenuQue allows the loading of additional <tt>strings.xml</tt> files. Useful as a central source of strings that are easy to access and translate. When the game loads up the <tt>strings.xml</tt> file it will also load any .xml file found in Oblivion\Data\Menus\Strings. | ||
== | == Methods == | ||
There are two | 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 | To get the additional strings under the default section the name of the element should be "Strings" (which is the same as in <tt>strings.xml</tt>). 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 <tt>Exp</tt>. | ||
<pre> | <pre> | ||
<rect name="Strings"> | <rect name="Strings"> | ||
<_Exp_earned> You | <_Exp_earned> You have gained some points </_Exp_earned> | ||
<_Exp_rested> You | <_Exp_rested> You are now well rested and will gain more points. </_Exp_rested> | ||
<_Exp_levelup> You | <_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 | 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 <tt>Exp</tt>. | ||
<pre> | <pre> | ||
<rect name="Exp"> | <rect name="Exp"> | ||
<_earned> You | <_earned> You have gained some points </_earned> | ||
<_rested> You | <_rested> You are now well rested and will gain more points. </_rested> | ||
<_levelup> You | <_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 == | ||
* | * 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]] |
Revision as of 04:57, 7 March 2011
Using Extra Strings with MenuQue
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
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
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
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
- 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.