<Operation Class="NQualityOfLife.XML.PatchIfExists">
<xpath>string</xpath>
<probe>string</probe>
<toVar>string</toVar> <!-- Optional -->
<count>string</count> <!-- Optional -->
<exists Class="PatchOperation"/>
<doesNotExist Class="PatchOperation"/>
<bothExist Class="PatchOperation"/>
<onlyProbeExists Class="PatchOperation"/>
<onlyXpathExists Class="PatchOperation"/>
<bothDoNotExist Class="PatchOperation"/>
<oneOrBothMissing Class="PatchOperation"/>
<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 '
{
' & '}
'
<Operation Class="NQualityOfLife.XML.PatchIfExists">
<xpath>Defs/ResearchProjectDef[label[contains(text(),"gunsmithing")] or defName="Gunsmithing"]/prerequisites/li[text()="Machining"]</xpath>
<exists Class="PatchOperationRemove">
<xpath>Defs/ResearchProjectDef[label[contains(text(),"gunsmithing")] or defName="Gunsmithing"]/prerequisites/li[text()="Machining"]</xpath>
</exists>
<doesNotExist Class="NQualityOfLife.XML.Log">
<warning>Tried to remove 'Machining' from the 'prerequisites' of 'Gunsmithing' but it was not there! A conflicting research overhaul mod may be active.</warning>
</doesNotExist>
</Operation>
<Operation Class="NQualityOfLife.XML.PatchIfExists">
<xpath>Defs/ResearchProjectDef[tab="VanillaExpanded"]</xpath>
<probe>Defs/ResearchTabDef[defName="VanillaExpanded"]</probe>
<onlyProbeExists Class="PatchOperationRemove">
<xpath>Defs/ResearchTabDef[defName="VanillaExpanded"]</xpath>
</onlyProbeExists>
</Operation>
<Operation Class="NQualityOfLife.XML.PatchIfExists">
<xpath>Defs/ResearchProjectDef[defName="VHGE_GasExtraction"]</xpath>
<probe>Defs/ResearchProjectDef[defName="Electricity"]</probe>
<bothExist Class="NQualityOfLife.XML.AddDeep">
<xpath>Defs/ResearchProjectDef[defName="Electricity"]</xpath>
<value>
<prerequisites/>
</value>
<deepValue>
<li>VHGE_GasExtraction</li>
</deepValue>
</bothExist>
<onlyProbeExists Class="NQualityOfLife.XML.AddDeep">
<xpath>Defs/ResearchProjectDef[defName="Electricity"]</xpath>
<value>
<prerequisites/>
</value>
<deepValue>
<li>Smithing</li>
</deepValue>
</onlyProbeExists>
<bothDoNotExist Class="NQualityOfLife.XML.Log">
<error>Both: 'Electricity' and 'VHGE_GasExtraction' were missing!</error>
</bothDoNotExist>
</Operation>