NQualityOfLife.XML.PatchIfEnabled - Niilo007/RimWorld-NQoL GitHub Wiki

PatchIfEnabled

Related:


XML

<Operation Class="NQualityOfLife.XML.PatchIfEnabled">
    <settingKey>string</settingKey>
    <anySetting>
        <li>string</li>
    </anySetting>
    <applyVariables>bool</applyVariables> <!-- true -->
    <debugAlwaysEnabled>bool</debugAlwaysEnabled> <!-- false -->
    <enabled Class="PatchOperation">

    </enabled>
    <disabled Class="PatchOperation">

    </disabled>
    <done Class="PatchOperation"> <!-- Optional -->

    </done>
    <error Class="PatchOperation"> <!-- Optional -->

    </error>
</Operation>

Usage

Does not currently support using settings from other mods, but this is a planned feature.


Errors


Examples

Used In Example:

<Operation Class="NQualityOfLife.XML.PatchIfEnabled">
    <settingKey>NiilosQoL_Settings_Research_Changes_A</settingKey>
    <enabled Class="PatchOperationSequence">
        <operations>
            <li Class="PatchOperationAdd">
                <xpath>Defs</xpath>
                <value>
                    <ResearchProjectDef ParentName="NQoL_Progression_Project">
                        <defName>NQoL_Trapping_Research</defName>
                        <label>trapping</label>
                        <description>Learn how to make simple traps.</description>
                        <baseCost>50</baseCost>
                        <techLevel>Neolithic</techLevel>
                        <tags>
                            <li>ClassicStart</li>
                            <li>TribalStart</li>
                        </tags>
                        <researchViewX>0.00</researchViewX>
                        <researchViewY>4.80</researchViewY>
                    </ResearchProjectDef>
                </value>
            </li>
        </operations>
    </enabled>
</Operation>

Used In Example:

<Operation Class="NQualityOfLife.XML.PatchIfEnabled">
    <anySetting>
        <li>NiilosQoL_Settings_Gizmo_FindBed</li>
        <li>NiilosQoL_Settings_Gizmo_Trader_Best_Negotiator</li>
        <li>NiilosQoL_Settings_Gizmo_Doctor_With_Best_Surgery</li>
    </anySetting>
    <debugAlwaysEnabled>false</debugAlwaysEnabled>
    <enabled Class="PatchOperationSequence">
        <operations>
            <li Class="NQualityOfLife.XML.Add">
                <xpath>Defs/ThingDef[@Name="BasePawn"]/comps</xpath>
                <value>
                    <li><compClass>NQualityOfLife.UI_.CompExtraGizmos</compClass></li>
                </value>
                <error Class="NQualityOfLife.XML.Log">
                    <warning>Failed to add 'NQualityOfLife.UI_.CompExtraGizmos' to 'Defs/ThingDef[@Name="BasePawn"]/comps' for what ever reason! (NiilosQoL_Settings_Gizmo_FindBed, NiilosQoL_Settings_Gizmo_Trader_Best_Negotiator, NiilosQoL_Settings_Gizmo_Doctor_With_Best_Surgery)</warning>
                </error>
            </li>
        </operations>
    </enabled>
</Operation>

⚠️ **GitHub.com Fallback** ⚠️