PatchOperationReplace - solaris0115/RimWorldModGuide GitHub Wiki

PatchOperationReplace

๋Œ€์ƒ์˜ ๊ฐ’์„ ์ˆ˜์ •ํ•ฉ๋‹ˆ๋‹ค. ๊ฒฝ๋กœ๋กœ ์ง€์ •๋œ ๋ง๋‹จ ๋…ธ๋“œ๋ฅผ ํ†ต์งธ๋กœ ๊ต์ฒดํ•ฉ๋‹ˆ๋‹ค.
์ฃผ๋กœ ๋‹ค๋ฅธ ๋ชจ๋“œ์˜ ์Šคํ‚จ์„ ๋ณ€๊ฒฝํ•˜๊ฑฐ๋‚˜ ๋ฐ์ดํ„ฐ๋ฅผ ๊ต์ฒดํ• ๋•Œ ์“ฐ์ž…๋‹ˆ๋‹ค.

*/ExampleDef[defName="Example"]/exampleNode๊ณผ ๊ฐ™์ด ์ง€์ •๋˜๋ฉด exampleNodeํƒœ๊ทธ๋ฅผ ์ง€์šฐ๊ณ  Value์‚ฌ์ด์˜ ๊ฐ’์œผ๋กœ ์™„์ „ํžˆ ๊ต์ฒดํ•ฉ๋‹ˆ๋‹ค.

์˜ˆ์‹œ 1

<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>

์˜ˆ์‹œ2

๋งŒ์•ฝ ์ˆ ํ†ต์ด ์กด์žฌํ•œ๋‹ค๋ฉด ์ˆ ํ†ต์˜ ๊ทธ๋ž˜ํ”ฝ์ •๋ณด(์Šคํ‚จ)์„ ๊ต์ฒดํ•˜๋Š” ๋ช…๋ น์„ ์ˆ˜ํ–‰ํ•ฉ๋‹ˆ๋‹ค. 
	<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>

์ฃผ์˜์‚ฌํ•ญ

๋ถ€๋ชจ ์ •์˜๋ฅผ ๊ณ ๋ คํ•˜์—ฌ ๊ต์ฒดํ•ด์•ผํ•ฉ๋‹ˆ๋‹ค.

โš ๏ธ **GitHub.com Fallback** โš ๏ธ