Difference between revisions of "Extra Strings (MenuQue)"
imported>Kyoma m (Spelling) |
imported>Kyoma m |
||
Line 1: | Line 1: | ||
== Using Extra Strings with MenuQue == | == Using Extra Strings with MenuQue == | ||
MenuQue allows the loading of additional | 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 == | == Methods == | ||
Line 6: | Line 6: | ||
===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 '''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"> | ||
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 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 | 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"> |
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.