UFO: Alien Invasion
|
Go to the source code of this file.
Data Structures | |
class | uiContainerNode |
struct | containerExtraData_s |
extradata for container widget More... | |
Macros | |
#define | C_UNIT 25 |
One unit in the containers is 25x25. More... | |
Typedefs | |
typedef struct containerExtraData_s | containerExtraData_t |
extradata for container widget More... | |
Functions | |
void | UI_RegisterContainerNode (uiBehaviour_t *behaviour) |
void | UI_DrawItem (uiNode_t *node, const vec3_t org, const Item *item, int x, int y, const vec3_t scale, const vec4_t color) |
Draws an item to the screen. More... | |
void | UI_ContainerNodeUpdateEquipment (Inventory *inv, const equipDef_t *ed) |
Fills the ground container of the ui_inventory with unused items from a given equipment definition. More... | |
uiNode_t * | UI_GetContainerNodeByContainerIDX (const uiNode_t *const parent, const int index) |
Search a child container node by the given container id. More... | |
void | UI_ContainerNodeAutoPlaceItem (uiNode_t *node, Item *ic) |
Try to autoplace an item from a container. More... | |
void | UI_GetItemTooltip (const Item &item, char *tooltipText, size_t stringMaxLength) |
Generate tooltip text for an item. More... | |
Variables | |
Inventory * | ui_inventory |
#define C_UNIT 25 |
One unit in the containers is 25x25.
Definition at line 28 of file ui_node_container.h.
Referenced by uiContainerNode::onDndMove(), uiContainerNode::onLoaded(), UI_BaseInventoryNodeDrawItems(), UI_BaseInventoryNodeGetItem(), UI_ContainerNodeDrawDropPreview(), UI_ContainerNodeDrawFreeSpace(), UI_ContainerNodeGetItemAtPosition(), and UI_DrawItem().
typedef struct containerExtraData_s containerExtraData_t |
extradata for container widget
Try to autoplace an item from a container.
[in] | node | The context node |
[in] | ic | An item from the node container |
Definition at line 687 of file ui_node_container.cpp.
References Item::ammoDef(), CID_ARMOUR, CID_BACKPACK, CID_BELT, CID_EQUIP, CID_HEADGEAR, CID_HOLSTER, CID_IMPLANT, CID_LEFT, CID_RIGHT, Item::def(), EXTRADATA, Item::getAmmoLeft(), objDef_s::headgear, i, invDef_s::id, objDef_s::idx, objDef_s::implant, INV_LoadWeapon(), INV_MoveItem(), INV_UnloadWeapon(), INVDEF, objDef_s::isAmmo(), Item::isArmour(), Item::isWeapon(), lengthof, uiNode_t::lua_onChange, NONE, uiNode_t::onChange, uiNode_t::parent, uiNode_t::root, targetNode, UI_ContainerNodeAddItem(), UI_ExecuteEventActions(), UI_ExecuteLuaEventScript(), UI_GetContainerNodeByContainerIDX(), UI_GetNode(), and objDef_s::weapons.
Referenced by UI_ContainerNodeAutoPlace().
void UI_ContainerNodeUpdateEquipment | ( | Inventory * | inv, |
const equipDef_t * | ed | ||
) |
Fills the ground container of the ui_inventory with unused items from a given equipment definition.
ui_inventory
pointer must be set [in,out] | inv | The inventory to add the unused items from ed to |
[in] | ed | The equipment definition to get the used items from that should be added to the ground container of inv |
Definition at line 102 of file ui_node_container.cpp.
References InventoryInterface::addToInventory(), CID_EQUIP, cls, csi, Item::def(), FILTER_AIRCRAFT, GAME_ItemIsUseable(), Inventory::getEquipContainer(), client_static_s::i, i, objDef_s::idx, INVDEF, INVSH_GetItemByIDX(), lengthof, MAX_CONTAINERS, Mem_Dup, Mem_Free, NONE, equipDef_s::numItems, csi_s::numODs, and Inventory::setContainer().
Referenced by GAME_GetImportData(), and GAME_UpdateInventory().
void UI_DrawItem | ( | uiNode_t * | node, |
const vec3_t | org, | ||
const Item * | item, | ||
int | x, | ||
int | y, | ||
const vec3_t | scale, | ||
const vec4_t | color | ||
) |
Draws an item to the screen.
[in] | node | Context node |
[in] | org | Node position on the screen (pixel). Single nodes: Use the center of the node. |
[in] | item | The item to draw. |
[in] | x,y | Position in container. Set both to -1 if it's drawn in a single container. |
[in] | scale | |
[in] | color |
Definition at line 149 of file ui_node_container.cpp.
References modelInfo_t::angles, C_UNIT, modelInfo_t::center, objDef_s::center, modelInfo_t::color, Com_Printf(), Item::def(), GAME_GetModelForItem(), objDef_s::id, objDef_s::image, Item::mustReload(), modelInfo_t::name, OBJZERO, modelInfo_t::origin, Q_strnull(), R_Color(), R_DrawModelDirect(), Item::rotated, modelInfo_t::scale, objDef_s::scale, objDef_s::sx, objDef_s::sy, UI_DrawModelNode(), UI_DrawNormImageByName(), Vector4Copy, VectorCopy, VectorNegate, VectorScale, and objDef_s::weapon.
Referenced by uiItemNode::draw(), UI_BaseInventoryNodeDrawItems(), UI_ContainerNodeDrawDropPreview(), UI_ContainerNodeDrawGrid(), UI_ContainerNodeDrawSingle(), and UI_DrawDragAndDrop().
Search a child container node by the given container id.
Definition at line 290 of file ui_node_container.cpp.
References INVDEF, invDef_s::name, and UI_GetNode().
Referenced by UI_ContainerNodeAutoPlaceItem().
Generate tooltip text for an item.
[in] | item | The item we want to generate the tooltip text for. |
[in,out] | tooltipText | Pointer to a string the information should be written into. |
[in] | stringMaxLength | Max. string size of tooltipText . |
Definition at line 247 of file ui_node_container.cpp.
References _, Item::ammoDef(), Com_sprintf(), Item::def(), GAME_ItemIsUseable(), Item::getAmmoLeft(), Item::getAmount(), i, Item::isWeapon(), objDef_s::name, objDef_s::numWeapons, Q_strcat(), and objDef_s::weapons.
Referenced by uiBaseInventoryNode::drawTooltip(), and uiContainerNode::drawTooltip().
void UI_RegisterContainerNode | ( | uiBehaviour_t * | behaviour | ) |
Definition at line 1072 of file ui_node_container.cpp.
References EXTRADATA_TYPE, uiBehaviour_t::extraDataSize, uiBehaviour_t::lua_SWIG_typeinfo, uiBehaviour_t::manager, uiBehaviour_t::name, UI_RegisterExtradataNodeProperty, UI_SWIG_TypeQuery(), V_INT, and V_UI_ACTION.
Inventory* ui_inventory |
Definition at line 62 of file ui_node_container.cpp.
Referenced by CL_ActorSelect(), uiBaseInventoryNode::draw(), GAME_ActorSelect_f(), GAME_GetImportData(), GAME_UpdateInventory(), UI_ContainerNodeAutoPlace(), and UI_ContainerNodeGetExistingItem().