feature_flags - ryzom/ryzomcore GitHub Wiki


title: NeL GUI Feature Flags description: published: true date: 2023-03-01T05:23:24.699Z tags: editor: markdown dateCreated: 2023-02-16T05:36:35.294Z

Feature flags allow developers to include alternative UI descriptions in a single XML file. This is useful for having different branding between releases, as well as for hiding optional game features.

Usage

Main Feature Flag

The precompiler variable RYZOM_CLIENT_UI_FEATURE_FLAG sets the main feature flag. Examples values for this flag are ryzomcore, ryzomclassic and ryzomforge.

(TODO) You may configure this option under .nel/config.json for the quick start package or under your manual CMake build options.

This variable is automatically set in the UiFeatureFlags array in the config file by default. It can be overridden for development and testing purposes, if needed. In general, for production, using the precompiler variable is advised to avoid unnecessary repository branches. This variable must not go in client_default.cfg, only in client.cfg.

Subfeature Flags

In login_config.xml, outgame_config.xml, or config.xml, add subfeature flags as needed in the following format. Flags are sticky accross parsing, and need to be reset if necessary.

<if flags="ryzomforge" />
  <flag name="contexticons" value="true" />
<elseif flags="ryzomclassic" />
  <flag name="contexticons" value="false" />
<endif />

Condition Expressions

The <if />, <elseif />, <else />, and <endif /> XML tags are defined for use with feature flags. Flag expressions must follow the same format as the following sample expression. It is recommended to use subfeature flags where possible, and the main feature flag only for branding adjustments.

contexticons | (!ryzomcore & ryzomclassic)

All sibling XML nodes, and their child nodes, that fall within disabled blocks are dropped entirely by the interface parser.

Example

  <if flags="ryzomclassic" />
    <ctrl type="button" button_type="push_button" id="but_quit" posref="TR TR" x="-30" y="-30"
								tx_normal="quit_over.tga" tx_over="quit_over.tga" tx_pushed="quit_over.tga"
								color="255 255 255 0" col_over="255 255 255 255" col_pushed="255 255 255 0"
								onclick_l="login_quit" />
  <else />
    <ctrl style="log_button" id="but_exit" posparent="windows" posref="BR BR" y="6"
          onclick_l="login_quit" hardtext="uiExitLogin" />
  <endif />
⚠️ **GitHub.com Fallback** ⚠️