NQualityOfLife.XML.Replace - Niilo007/RimWorld-NQoL GitHub Wiki
<Operation Class="NQualityOfLife.XML.Replace">
<xpath>string</xpath>
<toVar>string</toVar> <!-- Optional -->
<count>string</count> <!-- Optional -->
<value>
</value>
<done Class="PatchOperation"> <!-- Optional -->
</done>
<error Class="PatchOperation"> <!-- Optional -->
</error>
</Operation>
Used to select the matching nodes that you wish to replace. Supports variables.
Apply variables to the xpath
and to the text contained in value
?
The xpath
gets stored in this variable if provided.
The count
of nodes that matched the xpath
gets stored in this variable if provided.
The patch operation to perform when this one has completed successfully.
The patch operation to perform if this one fails or errors.
<Operation Class="NQualityOfLife.XML.PatchIfEnabledAndExists">
<settingKey>NiilosQoL_Settings_Disable_Plant_Rest</settingKey>
<xpath>Defs/ThingDef[thingClass="Plant"]/thingClass</xpath>
<toVar>{plantThingClass}</toVar>
<enabledAndExists Class="NQualityOfLife.XML.Replace">
<xpath>{plantThingClass}</xpath>
<value>
<thingClass>NQualityOfLife.Plants.Plant_NoRest</thingClass>
</value>
</enabledAndExists>
<doesNotExist Class="NQualityOfLife.XML.Log">
<warning>NQoL [W] - Failed to find any thing with class 'Plant' to change to 'Plant_NoRest'! This means that the patch has no affect. This is un-expected behaviour, and should be reported as a bug, with a modlist / log. (NiilosQoL_Settings_Disable_Plant_Rest)</warning>
</doesNotExist>
</Operation>