Skip to content

XMLToggleablePatch

flango edited this page Mar 5, 2023 · 1 revision

×× Toggleable XML patches ××

Changes behavior of your XML patch depending on your mod's settings.

  • <settingsPath> - Path to your mod's settings in Namespace.Mod.ModSettings format.
  • <key> - Name of your bool field.
  • <trueOperation Class="..."> - Applied PatchOperation if the setting is true. (✔)
  • <falseOperation Class="..."> - Applied PatchOperation if the setting is false. (❌)

Performance impact: 🟩 None

Type: PatchOperation

XML Node: Patch/Operation


Example:

<?xml version="1.0" encoding="UTF-8"?>
<Patch>
    <Operation Class="flangoCore.XMLToggleablePatch">
        <settingsPath>YourModName.Controller.settings</settingsPath>
        <key>optionalPatchTest</key>
        <trueOperation Class="PatchOperationReplace">
            <xpath>Defs/ThingDef[defName="Test_MyCustomThing"]/description</xpath>
            <value>
                <description>My new description.</description>
            </value>
        </trueOperation>
    </Operation>
</Patch>

🦩 Home

🚧 - 404 Page not found.
🖼 - Preview needed.

🟡 - Works but has some TODOs.
🟠 - Basic functionality implemented.
🔴 - Not working properly.
❓ - Not tested.


--== XML ==--

💡 Abilities

General

Ability Givers

Equipment Abilities

🟡 Should recode some stuff 🟡

🌳 Skill Trees

🟠 WIP, work/kill XP gain not implemented 🟠

Defs

Comps

🏘 Buildings

⚙ Comps

🏹 Equipment

General

Weapons

Projectiles

🧪 Hediffs

🧍‍♂‍ Pawn behaviors

📊 Stats

🎲 Misc

🧔 Vanilla Expanded

✨ Debug (Dev Mode)


--== C# ==--

📂 Shared Classes

🧬 Patches


Clone this wiki locally