getId
getId: (Widget) -> numberThe packed component id, (group << 16) | component; a dynamic widget's is its component's.
chatboxPanelManager:getContainerWidget()
client:getScriptActiveWidget()
client:getFocusedInputFieldWidget()| Method | Returns | Description |
|---|---|---|
getId() | number | The packed component id, (group << 16) | component; a dynamic widget's is its component's. |
getIndex() | number | The slot in the component's children, -1 for a component. |
getType() | number | The widget type (WidgetType). |
setType(number) | () | Sets the widget type. |
getContentType() | number | The content type. |
setContentType(number) | Widget | Sets the content type. |
getClickMask() | number | The click mask (WidgetConfig flags) the widget itself carries. |
setClickMask(number) | Widget | Sets the click mask. |
isIf3() | boolean | Whether the widget is an IF3 (scripted) widget. |
getParent() | Widget? | The parent widget, or nil (a root of the top-level interface, or an interface that is not open). A dynamic widget's parent is its compone… |
getParentId() | number | The parent's id: the widget's own parent component, else the component its interface is mounted on, else -1. |
getChild(number) | Widget? | Slot index of [getChildren]: nil for an empty slot, a negative index, one past the end, or a dynamic widget (whose own children array… |
getChildren() | { n: number, [number]: Widget? }? | The widget's own children array, slot-indexed with holes; nil when it is empty. A component's holds every dynamic widget of it, those cre… |
getDynamicChildren() | {Widget} | The dynamic widgets whose parent is this one, without holes: a component's own (those not created under a dynamic layer), or a dynamic laye… |
setChildren({ n: number, [number]: Widget? }?) | () | Replaces the children array, for the arrays Bento can apply to the client's vector: nil drops it, and an array keeps, drops or pads what… |
getStaticChildren() | {Widget} | The components whose parent is this one (none for a dynamic widget). |
getNestedChildren() | {Widget} | The root components of the interface mounted on this component. |
createChild(number, number) | Widget | (Widget, number, number) -> Widget: Creates a dynamic child of type in slot index (-1: after the last), as the client's CC_CREATE d… |
createChild(number) | Widget | |
deleteAllChildren() | () | Empties every slot of the widget's own children array, keeping its length: getChildren() then answers holes and createChild(-1, ...) st… |
isHidden() | boolean | Whether the widget or any ancestor (through the mount of its interface) is hidden; a widget outside the top-level interface with no parent… |
isSelfHidden() | boolean | Whether the widget's own hidden flag is set. |
setHidden(boolean) | Widget | Sets the widget's own hidden flag. |
getCanvasLocation() | Point | Where the widget was last drawn on the canvas, as the client's draw loop records it ((-1, -1) before its first draw; a hidden widget keep… |
getBounds() | Rectangle | The canvas area the widget covers: [getCanvasLocation] (the draw record once the layer points install, the layout before) and its laid-ou… |
contains(Point) | boolean | Whether point is inside [getBounds] (the draw record's place once the layer points install, the layout's before). |
getWidth() | number | The laid-out width. |
setWidth(number) | () | Sets the laid-out width (the next revalidate() recomputes it from the original). |
getHeight() | number | The laid-out height. |
setHeight(number) | () | Sets the laid-out height. |
getRelativeX() | number | The laid-out x, relative to the parent. |
setRelativeX(number) | () | Sets the laid-out x. |
getRelativeY() | number | The laid-out y, relative to the parent. |
setRelativeY(number) | () | Sets the laid-out y. |
getOriginalX() | number | The x before the position mode applies. |
setOriginalX(number) | Widget | Sets the x the position mode applies to; revalidate() makes it take effect. |
getOriginalY() | number | The y before the position mode applies. |
setOriginalY(number) | Widget | Sets the y the position mode applies to. |
getOriginalWidth() | number | The width before the width mode applies. |
setOriginalWidth(number) | Widget | Sets the width the width mode applies to. |
getOriginalHeight() | number | The height before the height mode applies. |
setOriginalHeight(number) | Widget | Sets the height the height mode applies to. |
setPos(number, number) | Widget | (Widget, number, number) -> Widget: Sets the original x and y. |
setPos(number, number, number, number) | Widget | |
setSize(number, number) | Widget | (Widget, number, number) -> Widget: Sets the original width and height. |
setSize(number, number, number, number) | Widget | |
getXPositionMode() | number | The x position mode (WidgetPositionMode). |
setXPositionMode(number) | Widget | Sets the x position mode. |
getYPositionMode() | number | The y position mode. |
setYPositionMode(number) | Widget | Sets the y position mode. |
getWidthMode() | number | The width mode (WidgetSizeMode). |
setWidthMode(number) | Widget | Sets the width mode. |
getHeightMode() | number | The height mode. |
setHeightMode(number) | Widget | Sets the height mode. |
revalidate() | () | Lays the widget out again against its parent (size, then position). |
revalidateScroll() | () | revalidate(), then the children against the scroll size. |
getScrollX() | number | The scroll x. |
setScrollX(number) | Widget | Sets the scroll x. |
getScrollY() | number | The scroll y. |
setScrollY(number) | Widget | Sets the scroll y. |
getScrollWidth() | number | The scrollable width. |
setScrollWidth(number) | Widget | Sets the scrollable width. |
getScrollHeight() | number | The scrollable height. |
setScrollHeight(number) | Widget | Sets the scrollable height. |
getText() | string | The text. |
setText(string) | Widget | Sets the text. |
getTextColor() | number | The text colour, RGB. |
setTextColor(number) | Widget | Sets the text colour, RGB. |
getFontId() | number | The font id. |
getFont() | FontTypeFace? | The font the text is drawn in, nil when the font id is -1 or names no font of the game's font archive (as the client's: it loads none). |
setFontId(number) | Widget | Sets the font id. |
getTextShadowed() | boolean | Whether the text is drawn with a shadow. |
setTextShadowed(boolean) | Widget | Sets whether the text is drawn with a shadow. |
getLineHeight() | number | The line height. |
setLineHeight(number) | Widget | Sets the line height. |
getXTextAlignment() | number | The horizontal text alignment (WidgetTextAlignment). |
setXTextAlignment(number) | Widget | Sets the horizontal text alignment. |
getYTextAlignment() | number | The vertical text alignment. |
setYTextAlignment(number) | Widget | Sets the vertical text alignment. |
getName() | string | The name (the op base: what menu entries name the widget by). |
setName(string) | Widget | Sets the name. |
getTargetVerb() | string | The target verb (Use targets). |
setTargetVerb(string) | () | Sets the target verb. |
getOpacity() | number | The opacity, 0 (opaque) to 255. |
setOpacity(number) | Widget | Sets the opacity. |
getSpriteId() | number | The sprite id. |
setSpriteId(number) | Widget | Sets the sprite id. |
getSpriteTiling() | boolean | Whether the sprite tiles. |
setSpriteTiling(boolean) | Widget | Sets whether the sprite tiles. |
getBorderType() | number | The border type (the sprite outline thickness). |
setBorderType(number) | () | Sets the border type. |
isFilled() | boolean | Whether a rectangle is filled. |
setFilled(boolean) | Widget | Sets whether a rectangle is filled. |
getModelId() | number | The model id. |
setModelId(number) | Widget | Sets the model id. |
getModelType() | number | The model type (WidgetModelType). |
setModelType(number) | Widget | Sets the model type. |
getAnimationId() | number | The model's animation id. |
setAnimationId(number) | Widget | Sets the model's animation id. |
getRotationX() | number | The model's x rotation, 0..2047. |
setRotationX(number) | Widget | Sets the model's x rotation. |
getRotationY() | number | The model's y rotation, 0..2047. |
setRotationY(number) | Widget | Sets the model's y rotation. |
getRotationZ() | number | The model's z rotation, 0..2047. |
setRotationZ(number) | Widget | Sets the model's z rotation. |
getModelZoom() | number | The model zoom. |
setModelZoom(number) | Widget | Sets the model zoom. |
getItemId() | number | The item the widget shows, -1 for none. |
setItemId(number) | Widget | Sets the item the widget shows. |
getItemQuantity() | number | The item quantity. |
setItemQuantity(number) | Widget | Sets the item quantity. |
getItemQuantityMode() | number | The item quantity mode (when the quantity is drawn). |
setItemQuantityMode(number) | Widget | Sets the item quantity mode. |
getActions() | { n: number, [number]: string? }? | The menu ops, nil for an unset one; nil when there are none. Holes are nil and the array carries n, its length: walk it `for i = 1,… |
setAction(number, string?) | () | Sets menu op index, 0-based (the ops grow to hold it; nil empties it). Indices past 31 raise: the client's menu reads no more, and the… |
clearActions() | () | Drops the menu ops: getActions() answers nil after. The sub-ops stay. |
setSubOp(number, number, string?) | () | Sets sub-op subop of menu op index (both 0-based), growing the sub-op table to hold it; indices past 31 raise (the client's menu reads… |
interact(string) | boolean | Choose option, one of the widget's menu ops ("Withdraw-1", "Close"; "" for its first), through the virtual mouse. The scheduler moves t… |
interactOp(number, number?) | boolean | Press menu op op of the widget (1-based, a CC_OP identifier: action index + 1) through the virtual mouse, childIndex the menu entry's… |
pressButton(MenuAction) | boolean | Press an if1 button of this widget: menuAction is MenuAction.WIDGET_TYPE_1 ("ok"), WIDGET_CLOSE, WIDGET_TYPE_4 (a toggle), `WIDGET_… |
hasListener() | boolean | Whether the widget's listeners run. |
setHasListener(boolean) | Widget | Sets whether the widget's listeners run (a listener setter does not). |
getNoClickThrough() | boolean | Whether clicks pass through the widget to what is under it (false) or stop. |
setNoClickThrough(boolean) | () | Sets whether clicks stop at the widget. |
getNoScrollThrough() | boolean | Whether scrolling stops at the widget. |
setNoScrollThrough(boolean) | () | Sets whether scrolling stops at the widget. |
getDragDeadZone() | number | The drag dead zone, in pixels. |
setDragDeadZone(number) | () | Sets the drag dead zone. |
getDragDeadTime() | number | The drag dead time, in client cycles. |
setDragDeadTime(number) | () | Sets the drag dead time. |
getDragParent() | Widget? | The container the widget can be dragged in, when one is set. |
getOnOpListener() | {number | string}? | The op listener: the script id, then its arguments; nil when unset. |
getOnKeyListener() | {number | string}? | The key listener. |
getOnLoadListener() | {number | string}? | The load listener (run when the interface loads). |
getOnInvTransmitListener() | {number | string}? | The inventory-transmit listener. |
getOnVarTransmitListener() | {number | string}? | The var-transmit listener. |
getVarTransmitTrigger() | {number}? | The vars the var-transmit listener runs for, nil when it runs for any. |
setOnOpListener((((ScriptEvent) -> ()) | number)?, ...any) | () | Sets the op listener: the script id then its arguments, a function first, or nothing (cleared). hasListener must be set for it to run. A… |
setOnDialogAbortListener((((ScriptEvent) -> ()) | number)?, ...any) | () | Sets the dialog-abort listener. |
setOnKeyListener((((ScriptEvent) -> ()) | number)?, ...any) | () | Sets the key listener. |
setOnMouseOverListener((((ScriptEvent) -> ()) | number)?, ...any) | () | Sets the mouse-over listener. |
setOnMouseRepeatListener((((ScriptEvent) -> ()) | number)?, ...any) | () | Sets the mouse-repeat listener. |
setOnMouseLeaveListener((((ScriptEvent) -> ()) | number)?, ...any) | () | Sets the mouse-leave listener. |
setOnTimerListener((((ScriptEvent) -> ()) | number)?, ...any) | () | Sets the timer listener (every client cycle). |
setOnTargetEnterListener((((ScriptEvent) -> ()) | number)?, ...any) | () | Sets the target-enter listener. |
setOnTargetLeaveListener((((ScriptEvent) -> ()) | number)?, ...any) | () | Sets the target-leave listener. |
setOnClickListener((((ScriptEvent) -> ()) | number)?, ...any) | () | Sets the click listener (the first cycle the mouse is held on the widget). |
setOnHoldListener((((ScriptEvent) -> ()) | number)?, ...any) | () | Sets the hold listener (every cycle but the first the mouse is held). |
setOnReleaseListener((((ScriptEvent) -> ()) | number)?, ...any) | () | Sets the release listener. |
setOnDragListener((((ScriptEvent) -> ()) | number)?, ...any) | () | Sets the drag listener. |
setOnDragCompleteListener((((ScriptEvent) -> ()) | number)?, ...any) | () | Sets the drag-complete listener. |
setOnScrollWheelListener((((ScriptEvent) -> ()) | number)?, ...any) | () | Sets the scroll-wheel listener. |
setOnVarTransmitListener((((ScriptEvent) -> ()) | number)?, ...any) | () | Sets the var-transmit listener. |
| Method | Returns | Description |
|---|---|---|
ChatboxPanelManager.getContainerWidget | Widget? | The chatbox's message layer, which a panel builds its widgets in. |
Client.getDraggedOnWidget | Widget? | The widget under the dragged one that takes a drop (its config has WidgetConfig.DRAG_ON), as the client found it this cycle; nil when the… |
Client.getDraggedWidget | Widget? | The draggable widget a mouse press landed on (the client's clicked widget), from the press until the release, whether or not the drag has b… |
Client.getFocusedInputFieldWidget | Widget? | The widget whose input field has the keyboard focus (a field the game types into instead of the chatbox), or nil when none has it. |
Client.getScriptActiveWidget | Widget? | The widget the running script's cc_* instructions act on (the script VM's active component register: the component cc_find found or `cc… |
Client.getSelectedWidget | Widget? | The widget in target mode (the selected spell, or the inventory slot of a "Use" item); nil when none is, or it is gone. |
Client.getWidget | Widget? | (Client, number) -> Widget?: The widget with packed id id (group << 16 | child), or nil when its interface is not loaded. Raises when… |
Client.getWidgetRoots | {Widget} | The top-level interface's root components. |
MenuEntry.getWidget | Widget? | The widget the entry acts on (a CC_OP, WIDGET_TARGET, WIDGET_CONTINUE, ...): client:getWidget(getParam1()), or its dynamic child `g… |
MenuOptionClicked.getWidget | Widget? | The widget the clicked entry acts on (getMenuEntry():getWidget()), or nil. |
ScriptEvent.getSource | Widget? | The widget the WIDGET_ID and WIDGET_INDEX sentinels name. |
ScriptEvent.getTarget | Widget? | The drag-complete target, nil when there is none. |
ScriptEventBuilder.getSource | Widget? | The widget the WIDGET_ID and WIDGET_INDEX sentinels name. |
ScriptEventBuilder.getTarget | Widget? | The drag-complete target. |
WidgetItem.getWidget | Widget? | The widget drawing it. |
WidgetQuery.collect | { Widget } | Every match, as handles. Consumes the query. |
WidgetQuery.first | Widget? | The first match, as a handle. Consumes the query. |
getIdgetId: (Widget) -> numberThe packed component id, (group << 16) | component; a dynamic widget's is its component's.
getIndexgetIndex: (Widget) -> numberThe slot in the component's children, -1 for a component.
getTypegetType: (Widget) -> numberThe widget type (WidgetType).
setTypesetType: (Widget, number) -> ()Sets the widget type.
getContentTypegetContentType: (Widget) -> numberThe content type.
setContentTypesetContentType: (Widget, number) -> WidgetSets the content type.
getClickMaskgetClickMask: (Widget) -> numberThe click mask (WidgetConfig flags) the widget itself carries.
setClickMasksetClickMask: (Widget, number) -> WidgetSets the click mask.
isIf3isIf3: (Widget) -> booleanWhether the widget is an IF3 (scripted) widget.
getParentgetParent: (Widget) -> Widget?The parent widget, or nil (a root of the top-level interface, or an interface that is not open). A dynamic widget's parent is its component (client:getWidget(getParentId())).
getParentIdgetParentId: (Widget) -> numberThe parent's id: the widget's own parent component, else the component its interface is mounted on, else -1.
getChildgetChild: (Widget, number) -> Widget?Slot index of [getChildren]: nil for an empty slot, a negative index, one past the end, or a dynamic widget (whose own children array is empty). Raises when index is not an int: nil, a fraction, NaN, inf or past int32.
getChildrengetChildren: (Widget) -> { n: number, [number]: Widget? }?The widget's own children array, slot-indexed with holes; nil when it is empty. A component's holds every dynamic widget of it, those created under a dynamic layer included (they record the layer as their dynamic parent); a dynamic widget's is always empty (nil). A child's [getIndex] is its slot here.
getDynamicChildrengetDynamicChildren: (Widget) -> {Widget}The dynamic widgets whose parent is this one, without holes: a component's own (those not created under a dynamic layer), or a dynamic layer's.
setChildrensetChildren: (Widget, { n: number, [number]: Widget? }?) -> ()Replaces the children array, for the arrays Bento can apply to the client's vector: nil drops it, and an array keeps, drops or pads what the widget has (each entry the widget slot i holds now, or nil where it is empty). Any other array (one that moves or adopts a widget) raises. A static layer only.
getStaticChildrengetStaticChildren: (Widget) -> {Widget}The components whose parent is this one (none for a dynamic widget).
getNestedChildrengetNestedChildren: (Widget) -> {Widget}The root components of the interface mounted on this component.
createChildcreateChild: ((Widget, number, number) -> Widget) & ((Widget, number) -> Widget)(Widget, number, number) -> Widget: Creates a dynamic child of type in slot index (-1: after the last), as the client's CC_CREATE does; an occupied slot is replaced.
(Widget, number) -> Widget: Creates a dynamic child of type after the last.
deleteAllChildrendeleteAllChildren: (Widget) -> ()Empties every slot of the widget's own children array, keeping its length: getChildren() then answers holes and createChild(-1, ...) starts at slot 0. A dynamic widget's own array is empty, so on one this changes nothing.
isHiddenisHidden: (Widget) -> booleanWhether the widget or any ancestor (through the mount of its interface) is hidden; a widget outside the top-level interface with no parent is hidden.
isSelfHiddenisSelfHidden: (Widget) -> booleanWhether the widget's own hidden flag is set.
setHiddensetHidden: (Widget, boolean) -> WidgetSets the widget's own hidden flag.
getCanvasLocationgetCanvasLocation: (Widget) -> PointWhere the widget was last drawn on the canvas, as the client's draw loop records it ((-1, -1) before its first draw; a hidden widget keeps where it was drawn last): the draw record, once the overlay layer points install in the client; before them (a test VM, the host process), the place its layout gives, which is where a widget drawn this frame was drawn.
getBoundsgetBounds: (Widget) -> RectangleThe canvas area the widget covers: [getCanvasLocation] (the draw record once the layer points install, the layout before) and its laid-out size.
containscontains: (Widget, Point) -> booleanWhether point is inside [getBounds] (the draw record's place once the layer points install, the layout's before).
getWidthgetWidth: (Widget) -> numberThe laid-out width.
setWidthsetWidth: (Widget, number) -> ()Sets the laid-out width (the next revalidate() recomputes it from the original).
getHeightgetHeight: (Widget) -> numberThe laid-out height.
setHeightsetHeight: (Widget, number) -> ()Sets the laid-out height.
getRelativeXgetRelativeX: (Widget) -> numberThe laid-out x, relative to the parent.
setRelativeXsetRelativeX: (Widget, number) -> ()Sets the laid-out x.
getRelativeYgetRelativeY: (Widget) -> numberThe laid-out y, relative to the parent.
setRelativeYsetRelativeY: (Widget, number) -> ()Sets the laid-out y.
getOriginalXgetOriginalX: (Widget) -> numberThe x before the position mode applies.
setOriginalXsetOriginalX: (Widget, number) -> WidgetSets the x the position mode applies to; revalidate() makes it take effect.
getOriginalYgetOriginalY: (Widget) -> numberThe y before the position mode applies.
setOriginalYsetOriginalY: (Widget, number) -> WidgetSets the y the position mode applies to.
getOriginalWidthgetOriginalWidth: (Widget) -> numberThe width before the width mode applies.
setOriginalWidthsetOriginalWidth: (Widget, number) -> WidgetSets the width the width mode applies to.
getOriginalHeightgetOriginalHeight: (Widget) -> numberThe height before the height mode applies.
setOriginalHeightsetOriginalHeight: (Widget, number) -> WidgetSets the height the height mode applies to.
setPossetPos: ((Widget, number, number) -> Widget) & ((Widget, number, number, number, number) -> Widget)(Widget, number, number) -> Widget: Sets the original x and y.
(Widget, number, number, number, number) -> Widget: Sets the original x and y and their position modes.
setSizesetSize: ((Widget, number, number) -> Widget) & ((Widget, number, number, number, number) -> Widget)(Widget, number, number) -> Widget: Sets the original width and height.
(Widget, number, number, number, number) -> Widget: Sets the original width and height and their size modes.
getXPositionModegetXPositionMode: (Widget) -> numberThe x position mode (WidgetPositionMode).
setXPositionModesetXPositionMode: (Widget, number) -> WidgetSets the x position mode.
getYPositionModegetYPositionMode: (Widget) -> numberThe y position mode.
setYPositionModesetYPositionMode: (Widget, number) -> WidgetSets the y position mode.
getWidthModegetWidthMode: (Widget) -> numberThe width mode (WidgetSizeMode).
setWidthModesetWidthMode: (Widget, number) -> WidgetSets the width mode.
getHeightModegetHeightMode: (Widget) -> numberThe height mode.
setHeightModesetHeightMode: (Widget, number) -> WidgetSets the height mode.
revalidaterevalidate: (Widget) -> ()Lays the widget out again against its parent (size, then position).
revalidateScrollrevalidateScroll: (Widget) -> ()revalidate(), then the children against the scroll size.
getScrollXgetScrollX: (Widget) -> numberThe scroll x.
setScrollXsetScrollX: (Widget, number) -> WidgetSets the scroll x.
getScrollYgetScrollY: (Widget) -> numberThe scroll y.
setScrollYsetScrollY: (Widget, number) -> WidgetSets the scroll y.
getScrollWidthgetScrollWidth: (Widget) -> numberThe scrollable width.
setScrollWidthsetScrollWidth: (Widget, number) -> WidgetSets the scrollable width.
getScrollHeightgetScrollHeight: (Widget) -> numberThe scrollable height.
setScrollHeightsetScrollHeight: (Widget, number) -> WidgetSets the scrollable height.
getTextgetText: (Widget) -> stringThe text.
setTextsetText: (Widget, string) -> WidgetSets the text.
getTextColorgetTextColor: (Widget) -> numberThe text colour, RGB.
setTextColorsetTextColor: (Widget, number) -> WidgetSets the text colour, RGB.
getFontIdgetFontId: (Widget) -> numberThe font id.
getFontgetFont: (Widget) -> FontTypeFace?The font the text is drawn in, nil when the font id is -1 or names no font of the game's font archive (as the client's: it loads none).
setFontIdsetFontId: (Widget, number) -> WidgetSets the font id.
getTextShadowedgetTextShadowed: (Widget) -> booleanWhether the text is drawn with a shadow.
setTextShadowedsetTextShadowed: (Widget, boolean) -> WidgetSets whether the text is drawn with a shadow.
getLineHeightgetLineHeight: (Widget) -> numberThe line height.
setLineHeightsetLineHeight: (Widget, number) -> WidgetSets the line height.
getXTextAlignmentgetXTextAlignment: (Widget) -> numberThe horizontal text alignment (WidgetTextAlignment).
setXTextAlignmentsetXTextAlignment: (Widget, number) -> WidgetSets the horizontal text alignment.
getYTextAlignmentgetYTextAlignment: (Widget) -> numberThe vertical text alignment.
setYTextAlignmentsetYTextAlignment: (Widget, number) -> WidgetSets the vertical text alignment.
getNamegetName: (Widget) -> stringThe name (the op base: what menu entries name the widget by).
setNamesetName: (Widget, string) -> WidgetSets the name.
getTargetVerbgetTargetVerb: (Widget) -> stringThe target verb (Use targets).
setTargetVerbsetTargetVerb: (Widget, string) -> ()Sets the target verb.
getOpacitygetOpacity: (Widget) -> numberThe opacity, 0 (opaque) to 255.
setOpacitysetOpacity: (Widget, number) -> WidgetSets the opacity.
getSpriteIdgetSpriteId: (Widget) -> numberThe sprite id.
setSpriteIdsetSpriteId: (Widget, number) -> WidgetSets the sprite id.
getSpriteTilinggetSpriteTiling: (Widget) -> booleanWhether the sprite tiles.
setSpriteTilingsetSpriteTiling: (Widget, boolean) -> WidgetSets whether the sprite tiles.
getBorderTypegetBorderType: (Widget) -> numberThe border type (the sprite outline thickness).
setBorderTypesetBorderType: (Widget, number) -> ()Sets the border type.
isFilledisFilled: (Widget) -> booleanWhether a rectangle is filled.
setFilledsetFilled: (Widget, boolean) -> WidgetSets whether a rectangle is filled.
getModelIdgetModelId: (Widget) -> numberThe model id.
setModelIdsetModelId: (Widget, number) -> WidgetSets the model id.
getModelTypegetModelType: (Widget) -> numberThe model type (WidgetModelType).
setModelTypesetModelType: (Widget, number) -> WidgetSets the model type.
getAnimationIdgetAnimationId: (Widget) -> numberThe model's animation id.
setAnimationIdsetAnimationId: (Widget, number) -> WidgetSets the model's animation id.
getRotationXgetRotationX: (Widget) -> numberThe model's x rotation, 0..2047.
setRotationXsetRotationX: (Widget, number) -> WidgetSets the model's x rotation.
getRotationYgetRotationY: (Widget) -> numberThe model's y rotation, 0..2047.
setRotationYsetRotationY: (Widget, number) -> WidgetSets the model's y rotation.
getRotationZgetRotationZ: (Widget) -> numberThe model's z rotation, 0..2047.
setRotationZsetRotationZ: (Widget, number) -> WidgetSets the model's z rotation.
getModelZoomgetModelZoom: (Widget) -> numberThe model zoom.
setModelZoomsetModelZoom: (Widget, number) -> WidgetSets the model zoom.
getItemIdgetItemId: (Widget) -> numberThe item the widget shows, -1 for none.
setItemIdsetItemId: (Widget, number) -> WidgetSets the item the widget shows.
getItemQuantitygetItemQuantity: (Widget) -> numberThe item quantity.
setItemQuantitysetItemQuantity: (Widget, number) -> WidgetSets the item quantity.
getItemQuantityModegetItemQuantityMode: (Widget) -> numberThe item quantity mode (when the quantity is drawn).
setItemQuantityModesetItemQuantityMode: (Widget, number) -> WidgetSets the item quantity mode.
getActionsgetActions: (Widget) -> { n: number, [number]: string? }?The menu ops, nil for an unset one; nil when there are none. Holes are nil and the array carries n, its length: walk it for i = 1, ops.n. table.find stops at the first hole, so search it with your own contains(ops, x) that walks to n.
setActionsetAction: (Widget, number, string?) -> ()Sets menu op index, 0-based (the ops grow to hold it; nil empties it). Indices past 31 raise: the client's menu reads no more, and the op table is the client's allocation.
clearActionsclearActions: (Widget) -> ()Drops the menu ops: getActions() answers nil after. The sub-ops stay.
setSubOpsetSubOp: (Widget, number, number, string?) -> ()Sets sub-op subop of menu op index (both 0-based), growing the sub-op table to hold it; indices past 31 raise (the client's menu reads no more).
interactinteract: (Widget, string) -> booleanChoose option, one of the widget's menu ops ("Withdraw-1", "Close"; "" for its first), through the virtual mouse. The scheduler moves the virtual mouse onto the widget and clicks, and the menu entry it runs is that op of this widget (a dynamic child's index as its first param). false when the widget is gone, or it has no such op (getActions(), the text as the menu shows it).
interactOpinteractOp: (Widget, number, number?) -> booleanPress menu op op of the widget (1-based, a CC_OP identifier: action index + 1) through the virtual mouse, childIndex the menu entry's first param (the widget's own index when omitted, -1 for a component). The scheduler moves the virtual mouse onto the widget and clicks, and the entry it runs is that op (CC_OP_LOW_PRIORITY past op 5, as the menu has it); the item id comes from the widget's own item. false when the widget is gone. Raises for an op outside 1..10. interact(option) names the op by its text instead.
pressButtonpressButton: (Widget, MenuAction) -> booleanPress an if1 button of this widget: menuAction is MenuAction.WIDGET_TYPE_1 ("ok"), WIDGET_CLOSE, WIDGET_TYPE_4 (a toggle), WIDGET_TYPE_5 (a select) or WIDGET_CONTINUE, as the widget's menu entry names it (an old interface's button; interact(option) presses a CC_OP op, which every current interface uses). false when the widget is gone, or menuAction is another type.
hasListenerhasListener: (Widget) -> booleanWhether the widget's listeners run.
setHasListenersetHasListener: (Widget, boolean) -> WidgetSets whether the widget's listeners run (a listener setter does not).
getNoClickThroughgetNoClickThrough: (Widget) -> booleanWhether clicks pass through the widget to what is under it (false) or stop.
setNoClickThroughsetNoClickThrough: (Widget, boolean) -> ()Sets whether clicks stop at the widget.
getNoScrollThroughgetNoScrollThrough: (Widget) -> booleanWhether scrolling stops at the widget.
setNoScrollThroughsetNoScrollThrough: (Widget, boolean) -> ()Sets whether scrolling stops at the widget.
getDragDeadZonegetDragDeadZone: (Widget) -> numberThe drag dead zone, in pixels.
setDragDeadZonesetDragDeadZone: (Widget, number) -> ()Sets the drag dead zone.
getDragDeadTimegetDragDeadTime: (Widget) -> numberThe drag dead time, in client cycles.
setDragDeadTimesetDragDeadTime: (Widget, number) -> ()Sets the drag dead time.
getDragParentgetDragParent: (Widget) -> Widget?The container the widget can be dragged in, when one is set.
getOnOpListenergetOnOpListener: (Widget) -> {number | string}?The op listener: the script id, then its arguments; nil when unset.
getOnKeyListenergetOnKeyListener: (Widget) -> {number | string}?The key listener.
getOnLoadListenergetOnLoadListener: (Widget) -> {number | string}?The load listener (run when the interface loads).
getOnInvTransmitListenergetOnInvTransmitListener: (Widget) -> {number | string}?The inventory-transmit listener.
getOnVarTransmitListenergetOnVarTransmitListener: (Widget) -> {number | string}?The var-transmit listener.
getVarTransmitTriggergetVarTransmitTrigger: (Widget) -> {number}?The vars the var-transmit listener runs for, nil when it runs for any.
setOnOpListenersetOnOpListener: (Widget, (((ScriptEvent) -> ()) | number)?, ...any) -> ()Sets the op listener: the script id then its arguments, a function first, or nothing (cleared). hasListener must be set for it to run. A function, here or in any setOn*Listener, is an error on a client whose table has the ScriptEvent_execute site off: nothing there would run it.
setOnDialogAbortListenersetOnDialogAbortListener: (Widget, (((ScriptEvent) -> ()) | number)?, ...any) -> ()Sets the dialog-abort listener.
setOnKeyListenersetOnKeyListener: (Widget, (((ScriptEvent) -> ()) | number)?, ...any) -> ()Sets the key listener.
setOnMouseOverListenersetOnMouseOverListener: (Widget, (((ScriptEvent) -> ()) | number)?, ...any) -> ()Sets the mouse-over listener.
setOnMouseRepeatListenersetOnMouseRepeatListener: (Widget, (((ScriptEvent) -> ()) | number)?, ...any) -> ()Sets the mouse-repeat listener.
setOnMouseLeaveListenersetOnMouseLeaveListener: (Widget, (((ScriptEvent) -> ()) | number)?, ...any) -> ()Sets the mouse-leave listener.
setOnTimerListenersetOnTimerListener: (Widget, (((ScriptEvent) -> ()) | number)?, ...any) -> ()Sets the timer listener (every client cycle).
setOnTargetEnterListenersetOnTargetEnterListener: (Widget, (((ScriptEvent) -> ()) | number)?, ...any) -> ()Sets the target-enter listener.
setOnTargetLeaveListenersetOnTargetLeaveListener: (Widget, (((ScriptEvent) -> ()) | number)?, ...any) -> ()Sets the target-leave listener.
setOnClickListenersetOnClickListener: (Widget, (((ScriptEvent) -> ()) | number)?, ...any) -> ()Sets the click listener (the first cycle the mouse is held on the widget).
setOnHoldListenersetOnHoldListener: (Widget, (((ScriptEvent) -> ()) | number)?, ...any) -> ()Sets the hold listener (every cycle but the first the mouse is held).
setOnReleaseListenersetOnReleaseListener: (Widget, (((ScriptEvent) -> ()) | number)?, ...any) -> ()Sets the release listener.
setOnDragListenersetOnDragListener: (Widget, (((ScriptEvent) -> ()) | number)?, ...any) -> ()Sets the drag listener.
setOnDragCompleteListenersetOnDragCompleteListener: (Widget, (((ScriptEvent) -> ()) | number)?, ...any) -> ()Sets the drag-complete listener.
setOnScrollWheelListenersetOnScrollWheelListener: (Widget, (((ScriptEvent) -> ()) | number)?, ...any) -> ()Sets the scroll-wheel listener.
setOnVarTransmitListenersetOnVarTransmitListener: (Widget, (((ScriptEvent) -> ()) | number)?, ...any) -> ()Sets the var-transmit listener.