-
Notifications
You must be signed in to change notification settings - Fork 8
4. "Code_Menu_Options.xml"
This file serves as both an enumeration of the interactable contents of the generated menu, as well as an interface through which to minorly tweak the settings of individual lines. Nodes within this file are arranged in a loose hierarchy, wherein a central codeMenu node contains one codeMenuPage node for each page which exists within the menu. Each page node in turn contains a collection of nodes representing the various lines it contains, with the specific type of any given line node corresponding to its type in-game.
Any given line node may have its default value changed, which determines the value the lines are initialized to on startup as well as the value they'll be returned to when they're reset. This process is slightly different between line types, with specific instructions being as follows:
In the case of Selection and Toggle type lines in particular, you'll see something like this:
<codeMenuSelection name="Endless Friendlies Mode: %s">
<defaultOption index="0" editable="true" />
<option value="OFF" />
<option value="All Stay" />
<option value="Winner Stays" />
<option value="Loser Stays" />
<option value="Rotation" />
</codeMenuSelection>
Here, the option nodes represent the set of distinct options the line allows you to select from. The defaultOption node's index attribute indicates which of these options the menu will default to on startup, as well as which value the line will return to when its selection is reset. For the purposes of the index field, the option nodes are numbered top to bottom, with the top-most option being index 0. So for instance, if in this example I wanted the line to default to the "Winner Stays" option, I'd edit the defaultOption line like so...
<codeMenuSelection name="Endless Friendlies Mode: %s">
<defaultOption index="2" editable="true" />
<option value="OFF" />
<option value="All Stay" />
<option value="Winner Stays" />
<option value="Loser Stays" />
<option value="Rotation" />
</codeMenuSelection>
... then make sure to save my changes before re-running the menu builder to rebake the menu with the change applied!
For Floating and Integer type lines, you'll instead see something like this:
<codeMenuFloat name="Hitstun Multiplier: %.3f">
<minValue value="0.000000" />
<defaultValue value="0.400000" editable="true" />
<maxValue value="999.000000" />
</codeMenuFloat>
Here, the minValue and maxValue nodes' value attributes indicate the lower and upper bounds of the line's value. Similarly, the defaultValue node's value attribute indicates the line's default value. To edit this value, simply replace its value with one of your choice, ensuring its value remains between the given minimum and maximum values (the menu builder will forcibly clamp the value to within that range if you don't). So for example, if I wanted to set the default value to 1.0 instead of 0.4, I'd edit the defaultValue line like so:
<codeMenuFloat name="Hitstun Multiplier: %.3f">
<minValue value="0.000000" />
<defaultValue value="1.000000" editable="true" />
<maxValue value="999.000000" />
</codeMenuFloat>
... then save and re-run the menu builder to bake my change into a fresh copy of the menu!
Any given line node may have any of the following optional attributes attached to it to affect its behavior:
Enabling this attribute prevents its value from being reset in any way other than selecting it and pressing the "Reset Selection" button! This effectively renders the line unable to be reset through indirect means (eg. by pressing the "Reset Page" button), and is useful for lines whose values you want to stick around through resets not directly aimed at it; hence "sticky".
Enabling this attribute will render the line unable to be interacted with via the in-game Code Menu interface, and gray out its text to indicate that it cannot be changed. Use this for lines whose values you want players to be able to see, but unable to directly alter. Can be used alongside the sticky attribute as well, rendering the line functionally immune to being reset!
This attribute can be thought of as an escalation of the above: enabling it will render the line both un-interactable and invisible to the player! Very importantly, lines with this attribute enabled are still present from a data perspective, and thus codes which rely on their existence may continue to reference or change its values as necessary; they simply aren't shown to the player and cannot be interacted with via the Code Menu. May also be used alongside the sticky attribute to make the line immune to being reset.
This attribute supersedes all other attributes, and removes the line from the menu completely when enabled. This differs crucially from the hidden attribute in that lines marked excluded are not present from a data perspective. They are removed from the Menu's .cmnu file entirely; and thus, codes which rely on them will cease to function properly! Useful for eliminating lines which relate to codes that your build doesn't utilize. Note: lines can be easily re-included in a build by disabling this attribute.
To bake any changes you make in this document into a fresh menu, simply save this document and re-run the Menu Builder program. The program will read through this document for any changes and apply them, then regenerate this file based on the final state of the built Menu. As such, you can know whether or not a change was properly applied to the Menu by checking that change is still present in the regenerated document after re-running the program!