UFO: Alien Invasion
|
#include <ui_node_container.h>
Inherits uiLocatedNode.
Inherited by uiBaseInventoryNode.
Public Member Functions | |
void | draw (uiNode_t *node) override |
Main function to draw a container node. More... | |
void | drawTooltip (const uiNode_t *node, int x, int y) const override |
Custom tooltip for container node. More... | |
void | initNode (uiNode_t *node) override |
void | onMouseDown (uiNode_t *node, int x, int y, int button) override |
void | onMouseUp (uiNode_t *node, int x, int y, int button) override |
void | onCapturedMouseMove (uiNode_t *node, int x, int y) override |
void | onLoading (uiNode_t *node) override |
void | onLoaded (uiNode_t *node) override |
Calculates the size of a container node and links the container into the node (uses the invDef_t shape bitmask to determine the size) More... | |
bool | onDndEnter (uiNode_t *node) override |
Call when a DND enter into the node. More... | |
bool | onDndMove (uiNode_t *node, int x, int y) override |
Call into the target when the DND hover it. More... | |
void | onDndLeave (uiNode_t *node) override |
Call when a DND enter into the node. More... | |
bool | onDndFinished (uiNode_t *node, bool isDroped) override |
Call into the source when the DND end. More... | |
![]() | |
virtual void | drawOverWindow (uiNode_t *node) |
virtual void | doLayout (uiNode_t *node) |
Call to update the node layout. This common code revalidates the node tree. More... | |
virtual void | onSizeChanged (uiNode_t *node) |
Callback stub. More... | |
virtual void | onLeftClick (uiNode_t *node, int x, int y) |
virtual void | onRightClick (uiNode_t *node, int x, int y) |
virtual void | onMiddleClick (uiNode_t *node, int x, int y) |
virtual bool | onScroll (uiNode_t *node, int deltaX, int deltaY) |
virtual void | onMouseMove (uiNode_t *node, int x, int y) |
virtual bool | onMouseLongPress (uiNode_t *node, int x, int y, int button) |
Send mouse event when a pressed mouse button is dragged. More... | |
virtual void | onMouseEnter (uiNode_t *node) |
virtual void | onMouseLeave (uiNode_t *node) |
virtual void | onCapturedMouseLost (uiNode_t *node) |
virtual bool | onStartDragging (uiNode_t *node, int startX, int startY, int currentX, int currentY, int button) |
Send mouse event when a pressed mouse button is dragged. More... | |
virtual bool | onDndDrop (uiNode_t *node, int x, int y) |
virtual void | onFocusGained (uiNode_t *node) |
virtual void | onFocusLost (uiNode_t *node) |
virtual bool | onKeyPressed (uiNode_t *node, unsigned int key, unsigned short unicode) |
virtual bool | onKeyReleased (uiNode_t *node, unsigned int key, unsigned short unicode) |
virtual void | getClientPosition (uiNode_t const *node, vec2_t position) |
virtual int | getCellWidth (uiNode_t *node) |
virtual int | getCellHeight (uiNode_t *node) |
![]() | |
virtual void | clone (uiNode_t const *source, uiNode_t *clone) |
virtual void | initNodeDynamic (uiNode_t *node) |
virtual void | deleteNode (uiNode_t *node) |
virtual void | onWindowOpened (uiNode_t *node, linkedList_t *params) |
virtual void | onWindowClosed (uiNode_t *node) |
virtual void | onWindowActivate (uiNode_t *node) |
virtual void | onActivate (uiNode_t *node) |
Activate the node. Can be used without the mouse (ie. a button will execute onClick) More... | |
virtual void | onPropertyChanged (uiNode_t *node, const value_t *property) |
virtual | ~uiNode () |
Definition at line 35 of file ui_node_container.h.
Main function to draw a container node.
Reimplemented from uiLocatedNode.
Definition at line 581 of file ui_node_container.cpp.
References CID_EQUIP, uiNode_t::color, Item::def(), DND_ITEM, EXTRADATA, UI_ContainerNodeDrawDropPreview(), UI_ContainerNodeDrawFreeSpace(), UI_ContainerNodeDrawGrid(), UI_ContainerNodeDrawSingle(), UI_DNDGetItem(), UI_DNDGetType(), UI_DNDIsDragging(), UI_DNDIsTargetNode(), and UI_IsScrollContainerNode().
Custom tooltip for container node.
[in] | node | Node we request to draw tooltip |
[in] | x,y | Position of the mouse |
Reimplemented from uiLocatedNode.
Definition at line 654 of file ui_node_container.cpp.
References Item::getX(), Item::getY(), MAX_VAR, Q_strcat(), UI_ContainerNodeGetItemAtPosition(), UI_DrawTooltip(), and UI_GetItemTooltip().
call to initialize the node structure and extradata structure
Reimplemented from uiNode.
Definition at line 877 of file ui_node_container.cpp.
References EXTRADATA, and uiNode::initNode().
Referenced by uiBaseInventoryNode::initNode().
Mouse move event in the node when captured
Reimplemented from uiLocatedNode.
Definition at line 819 of file ui_node_container.cpp.
References oldMouseX, oldMouseY, UI_DNDDragItem(), and UI_MouseRelease().
|
overridevirtual |
Call when a DND enter into the node.
Reimplemented from uiLocatedNode.
Definition at line 892 of file ui_node_container.cpp.
References DND_ITEM, EXTRADATA, UI_DNDGetSourceNode(), UI_DNDGetType(), and UI_IsScrollContainerNode().
|
overridevirtual |
Call into the source when the DND end.
Reimplemented from uiLocatedNode.
Definition at line 989 of file ui_node_container.cpp.
References Item::ammoDef(), CL_ActorInvMove(), CL_BattlescapeRunning(), Item::def(), dragInfoFromX, dragInfoFromY, dragInfoToX, dragInfoToY, EXTRADATACONST, Item::getAmmoLeft(), Inventory::getItemAtPos(), invDef_s::id, INV_LoadWeapon(), INV_MoveItem(), INV_SearchInInventoryWithFilter(), INV_UnloadWeapon(), objDef_s::isAmmo(), Item::isWeapon(), K_SHIFT, Key_IsDown(), uiNode_t::lua_onChange, MAX_FILTERTYPES, uiNode_t::onChange, Item::rotated, selActor, UI_DNDGetItem(), UI_DNDGetTargetNode(), UI_ExecuteEventActions(), UI_ExecuteLuaEventScript(), UI_IsScrollContainerNode(), and objDef_s::weapons.
Call when a DND enter into the node.
Reimplemented from uiLocatedNode.
Definition at line 980 of file ui_node_container.cpp.
References dragInfoToX, and dragInfoToY.
Call into the target when the DND hover it.
We calculate the position of the top-left corner of the dragged item in oder to compensate for the centered-drawn cursor-item. Or to be more exact, we calculate the relative offset from the cursor location to the middle of the top-left square of the item.
Reimplemented from uiLocatedNode.
Definition at line 902 of file ui_node_container.cpp.
References C_UNIT, Inventory::canHoldItem(), Inventory::containsItem(), Item::def(), dragInfoIC, dragInfoToX, dragInfoToY, EXTRADATA, Inventory::findSpace(), Inventory::getItemAtPos(), invDef_s::id, INV_DOES_NOT_FIT, invDef_s::isEquipDef(), invDef_s::isFloorDef(), objDef_s::isLoadableInWeapon(), mousePosX, mousePosY, SHAPE_BIG_MAX_HEIGHT, SHAPE_BIG_MAX_WIDTH, invDef_s::single, objDef_s::sx, objDef_s::sy, UI_DNDGetItem(), UI_GetNodeAbsPos(), and UI_IsScrollContainerNode().
Calculates the size of a container node and links the container into the node (uses the invDef_t
shape bitmask to determine the size)
[in,out] | node | The node to get the size for |
Reimplemented from uiNode.
Definition at line 384 of file ui_node_container.cpp.
References uiNode_t::box, C_UNIT, EXTRADATA, i, INVSH_GetInventoryDefinitionByID(), uiNode_t::name, name, Q_strstart(), invDef_s::shape, SHAPE_BIG_MAX_HEIGHT, SHAPE_BIG_MAX_WIDTH, uiBox_t::size, and UI_IsScrollContainerNode().
Called before script initialization, initialized default values
Reimplemented from uiNode.
Definition at line 883 of file ui_node_container.cpp.
References uiNode_t::color, and EXTRADATA.
Mouse button down event in the node
Reimplemented from uiLocatedNode.
Definition at line 828 of file ui_node_container.cpp.
References Item::def(), dragInfoFromX, dragInfoFromY, EXTRADATA, objDef_s::idx, K_MOUSE1, K_MOUSE2, oldMouseX, oldMouseY, UI_ContainerNodeAutoPlace(), UI_ContainerNodeGetItemAtPosition(), UI_DNDAbort(), UI_DNDIsDragging(), UI_ExecuteEventActions(), UI_ExecuteLuaEventScript(), and UI_SetMouseCapture().
Mouse button up event in the node
Reimplemented from uiLocatedNode.
Definition at line 865 of file ui_node_container.cpp.
References K_MOUSE1, UI_DNDDrop(), UI_DNDIsDragging(), UI_GetMouseCapture(), and UI_MouseRelease().