NQualityOfLife.XML.AddOrReplaceIfExists - Niilo007/RimWorld-NQoL GitHub Wiki
<Operation Class="NQualityOfLife.XML.AddOrReplaceIfExists">
<xpath>string</xpath>
<toVar>string</toVar> <!-- Optional -->
<value>
</value>
<doesNotExist Class="PatchOperation"> <!-- Optional -->
</doesNotExist>
<done Class="PatchOperation"> <!-- Optional -->
</done>
<error Class="PatchOperation"> <!-- Optional -->
</error>
</Operation>
- If
<toVar>
is provided, the given<xpath>
is saved to it.- Variable names must begin and end with '
{
' & '}
'
- Variable names must begin and end with '
Supports variables.
Apply variables to the xpath
and to the text contained in value
?
The xpath
gets stored in this variable if provided.
tba
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.AddOrReplaceIfExists">
<xpath>
Defs/ResearchProjectDef
[defName[contains(text(),"Net")]]
[defName[contains(text(),"Fish")]]
[not(defName="NQoL_Trapping_Research")]
</xpath>
<value>
<researchViewX>2.00</researchViewX>
<researchViewY>4.80</researchViewY>
</value>
<doesNotExist Class="NQualityOfLife.XML.Log">
<warning>Did not find any fish trap researches to patch!</warning>
<debug>true</debug>
</doesNotExist>
</Operation>