Anonymous

Mod Creation/Mod Context API Reference: Difference between revisions

From Melvor Idle
Line 841: Line 841:
ctx.patch(TownshipResource, 'amount').get(() => 999999);</nowiki>
ctx.patch(TownshipResource, 'amount').get(() => 999999);</nowiki>


==== PropertyPatch.set(setter: (o: undefined, value: any) => void): void ====
==== PropertyPatch.set(setter: (value: any) => void): void ====


Execute the provided function when a setter property is accessed.
Execute the provided function when a setter property is accessed.
Line 847: Line 847:
'''Parameters'''
'''Parameters'''


<code>setter: (o: undefined, value: any) => any</code> The getter function to be executed, with the <code>value</code> argument containing the value being set. The <code>o</code> argument is currently a placeholder and is unused.
<code>setter: (value: any) => any</code> The getter function to be executed, with the <code>value</code> argument containing the value being set.


'''Example'''
'''Example'''
91

edits