Kitcoonfood
Based on game build 714014 | Last updated: 2026-03-08
Overview
Kitcoonfood is a UI widget that provides an interactive visual representation of the Kitcoon's food supply. It displays a floating animation of the food item and responds to user input (typically Accept control or click) to queue and execute feeding actions via the associated kit object. It extends the base Widget class and integrates with DST's UI animation and sound systems.
Usage example
local kitcoonfood = KitcoonFood(kit)
-- The widget is typically added as a child to another UI container
parent:AddChild(kitcoonfood)
-- Interaction happens automatically upon user input; no manual method calls required
Dependencies & tags
Components used: None identified.
Tags: None identified.
Properties
| Property | Type | Default Value | Description |
|---|---|---|---|
kit | object | — | Reference to the Kitcoon component or object that owns this food bag; provides TryQueueEat(), Eat() methods. |
anim | UIAnim | — | Child widget that displays the animated food asset. |
animstate | AnimState | — | Controls animation state (bank, build, playback, effects) for the food animation. |
onclick | function | — | Callback triggered on user acceptance input to attempt feeding. |
Main functions
OnGainFocus()
- Description: Handles focus gain events, delegating to the base widget class. Typically called when the UI receives focus (e.g., menu activation).
- Parameters: None.
- Returns: Nothing.
OnControl(control, down)
- Description: Handles control input events. Checks for the
CONTROL_ACCEPTinput (e.g., Enter, A button) when the key is released (down == false) and triggers the feeding action. - Parameters:
control(string) — The control identifier (e.g.,"ACCEPT").
down(boolean) — Whether the control key is currently pressed (true) or released (false). - Returns:
trueif the base widget handled the control, otherwise proceeds to checkCONTROL_ACCEPT.
Events & listeners
- Listens to: None (no
inst:ListenForEventcalls found). - Pushes: None (no
inst:PushEventcalls found).