PatchOperationReplace - solaris0115/RimWorldModGuide GitHub Wiki
๋์์ ๊ฐ์ ์์ ํฉ๋๋ค. ๊ฒฝ๋ก๋ก ์ง์ ๋ ๋ง๋จ ๋
ธ๋๋ฅผ ํต์งธ๋ก ๊ต์ฒดํฉ๋๋ค.
์ฃผ๋ก ๋ค๋ฅธ ๋ชจ๋์ ์คํจ์ ๋ณ๊ฒฝํ๊ฑฐ๋ ๋ฐ์ดํฐ๋ฅผ ๊ต์ฒดํ ๋ ์ฐ์
๋๋ค.
*/ExampleDef[defName="Example"]/exampleNode๊ณผ ๊ฐ์ด ์ง์ ๋๋ฉด exampleNodeํ๊ทธ๋ฅผ ์ง์ฐ๊ณ Value์ฌ์ด์ ๊ฐ์ผ๋ก ์์ ํ ๊ต์ฒดํฉ๋๋ค.
<ExampleDef>
<defName>Example</defName>
<exampleNode>Some text</exampleNode>
<exampleList />
</ExampleDef>
<Operation Class="PatchOperationReplace">
<xpath>*/ExampleDef[defName="Example"]/exampleNode</xpath>
<value>
<anotherExample>An alternate node</anotherExample>
</value>
</Operation>
<ExampleDef>
<defName>Example</defName>
<anotherExample>An alternate node</anotherExample>
<exampleList />
</ExampleDef>
๋ง์ฝ ์ ํต์ด ์กด์ฌํ๋ค๋ฉด ์ ํต์ ๊ทธ๋ํฝ์ ๋ณด(์คํจ)์ ๊ต์ฒดํ๋ ๋ช
๋ น์ ์ํํฉ๋๋ค.
<Operation Class="PatchOperationSequence">
<success>Always</success>
<operations>
<li Class="PatchOperationTest">
<xpath>Defs/ThingDef[defName = "FermentingBarrel"]</xpath>
</li>
<li Class="PatchOperationReplace">
<xpath>*/ThingDef[defName="FermentingBarrel"]/graphicData</xpath>
<value>
<graphicData>
<texPath>Things/Building/Furniture/RGK_orcB</texPath>
<graphicClass>Graphic_Multi</graphicClass>
<shaderType>CutoutComplex</shaderType>
<damageData>
<rect>(0.05,0.1,0.9,0.9)</rect>
</damageData>
<shadowData>
<volume>(0.75, 0.35, 0.33)</volume>
</shadowData>
<drawSize>(2,2)</drawSize>
</graphicData>
</value>
</li>
</operations>
</Operation>
๋ถ๋ชจ ์ ์๋ฅผ ๊ณ ๋ คํ์ฌ ๊ต์ฒดํด์ผํฉ๋๋ค.