Markable Proxy
Overview
The Markable_proxy component acts as a wrapper that forwards marking operations (e.g., Mark, SetMarkable, HasMarked) to a referenced entity's markable component. It also dynamically applies or removes the "markable_proxy" tag on its own entity based on the value of canbemarked, ensuring consistent tagging without requiring direct tag management elsewhere.
Dependencies & Tags
- Referenced Components:
markable(expected on theproxyentity) - Tags Added/Removed: Dynamically adds/removes the
"markable_proxy"tag onself.instdepending oncanbemarked.
Properties
| Property | Type | Default Value | Description |
|---|---|---|---|
inst | GObject | nil | The entity instance this component is attached to. |
proxy | GObject? | nil | Optional target entity whose markable component is delegated to. |
canbemarked | boolean | inferred from onmarkable | Controls whether the "markable_proxy" tag is added (true) or removed (false). Set via the class initializer function. |
Main Functions
Mark(doer)
- Description: Delegates the
Markcall to the referencedproxyentity'smarkablecomponent, if it exists. - Parameters:
doer: The entity performing the marking action (typically a player or NPC).
SetMarkable(markable)
- Description: Updates the internal
canbemarkedstate and delegatesSetMarkableto theproxy'smarkablecomponent. This also triggers theonmarkablecallback, which updates the"markable_proxy"tag. - Parameters:
markable: A boolean indicating whether the proxy entity should now be markable.
HasMarked(doer)
- Description: Delegates the
HasMarkedcall to the referencedproxyentity'smarkablecomponent, if it exists. Returnsnilif no proxy ormarkablecomponent is available. - Parameters:
doer: The entity to check for a prior marking.
Events & Listeners
None.