|
UFO: Alien Invasion
|
"Base inventory" is one of the container nodes. It allow to see and drag and drop soldier items from a base to soldier equipments. More...
#include "../ui_main.h"#include "../ui_parse.h"#include "../ui_behaviour.h"#include "../ui_actions.h"#include "../ui_dragndrop.h"#include "../ui_tooltip.h"#include "../ui_nodes.h"#include "../ui_input.h"#include "../ui_render.h"#include "../ui_lua.h"#include "ui_node_baseinventory.h"#include "ui_node_model.h"#include "ui_node_container.h"#include "ui_node_abstractnode.h"#include "ui_node_abstractscrollable.h"#include "../../cl_shared.h"#include "../../cgame/cl_game.h"#include "../../input/cl_keys.h"#include "../../cl_inventory.h"#include "../../../common/scripts_lua.h"
Go to the source code of this file.
Data Structures | |
| struct | containerItemIterator_t |
Macros | |
| #define | EXTRADATA_TYPE baseInventoryExtraData_t |
| #define | EXTRADATA(node) |
| #define | EXTRADATACONST(node) |
| #define | CII_AMMOONLY 0x01 |
| Flag for containerItemIterator_t (CII) groupSteps. | |
| #define | CII_WEAPONONLY 0x02 |
| #define | CII_AVAILABLEONLY 0x04 |
| #define | CII_NOTAVAILABLEONLY 0x08 |
| #define | CII_IMPLANTONLY 0x10 |
| #define | CII_END 0x80 |
Functions | |
| bool | CL_BattlescapeRunning (void) |
| Check whether we already have actors spawned on the battlefield. | |
| static Item * | UI_ContainerNodeGetExistingItem (const uiNode_t *node, const objDef_t *item, const itemFilterTypes_t filterType) |
| Searches if there is an item at location (x/y) in a scrollable container. You can also provide an item to search for directly (x/y is ignored in that case). | |
| static void | UI_ContainerItemIteratorNext (containerItemIterator_t *iterator) |
| Compute the next itemID. | |
| static void | UI_ContainerItemIteratorInit (containerItemIterator_t *iterator, const uiNode_t *const node) |
| Use a container node to init an item iterator. | |
| static void | UI_BaseInventoryNodeUpdateScroll (uiNode_t *node) |
| Update display of scroll buttons. | |
| static int | UI_BaseInventoryNodeDrawItems (uiNode_t *node, const objDef_t *highlightType) |
| Draw the base inventory. | |
| static void | UI_BaseInventoryNodeDraw2 (uiNode_t *node, const objDef_t *highlightType) |
| Draw the inventory of the base. | |
| static Item * | UI_BaseInventoryNodeGetItem (const uiNode_t *const node, int mouseX, int mouseY, int *contX, int *contY) |
| static void | UI_ContainerNodeAutoPlace (uiNode_t *node, int mouseX, int mouseY) |
| Try to autoplace an item at a position when right-click was used in the inventory. | |
| void | UI_RegisterBaseInventoryNode (uiBehaviour_t *behaviour) |
Variables | |
| cvar_t * | cl_selected |
| static int | dragInfoFromX = -1 |
| static int | dragInfoFromY = -1 |
| static const Item * | dragInfoIC |
| static const vec3_t | scale = {3.5, 3.5, 3.5} |
| static const vec4_t | colorDefault = {1, 1, 1, 1} |
| static const vec4_t | colorLoadable = {0.5, 1, 0.5, 1} |
| static const vec4_t | colorDisabledHiden = {0.5, 0.5, 0.5, 0.5} |
| static const vec4_t | colorDisabledLoadable = {0.5, 0.25, 0.25, 1.0} |
| static int | oldMouseX = 0 |
| static int | oldMouseY = 0 |
"Base inventory" is one of the container nodes. It allow to see and drag and drop soldier items from a base to soldier equipments.
Definition in file ui_node_baseinventory.cpp.
| #define CII_AMMOONLY 0x01 |
Flag for containerItemIterator_t (CII) groupSteps.
Definition at line 94 of file ui_node_baseinventory.cpp.
Referenced by UI_ContainerItemIteratorInit(), and UI_ContainerItemIteratorNext().
| #define CII_AVAILABLEONLY 0x04 |
Definition at line 96 of file ui_node_baseinventory.cpp.
Referenced by UI_ContainerItemIteratorInit(), and UI_ContainerItemIteratorNext().
| #define CII_END 0x80 |
Definition at line 99 of file ui_node_baseinventory.cpp.
Referenced by UI_ContainerItemIteratorInit(), and UI_ContainerItemIteratorNext().
| #define CII_IMPLANTONLY 0x10 |
Definition at line 98 of file ui_node_baseinventory.cpp.
Referenced by UI_ContainerItemIteratorInit(), and UI_ContainerItemIteratorNext().
| #define CII_NOTAVAILABLEONLY 0x08 |
Definition at line 97 of file ui_node_baseinventory.cpp.
Referenced by UI_ContainerItemIteratorInit(), and UI_ContainerItemIteratorNext().
| #define CII_WEAPONONLY 0x02 |
it mean any soldier equipment, else ammo
Definition at line 95 of file ui_node_baseinventory.cpp.
Referenced by UI_ContainerItemIteratorInit(), and UI_ContainerItemIteratorNext().
| #define EXTRADATA | ( | node | ) |
Definition at line 53 of file ui_node_baseinventory.cpp.
Referenced by UI_BaseInventoryNodeDraw2(), UI_BaseInventoryNodeDrawItems(), UI_BaseInventoryNodeUpdateScroll(), and UI_ContainerNodeAutoPlace().
| #define EXTRADATA_TYPE baseInventoryExtraData_t |
Definition at line 52 of file ui_node_baseinventory.cpp.
| #define EXTRADATACONST | ( | node | ) |
Definition at line 54 of file ui_node_baseinventory.cpp.
Referenced by UI_BaseInventoryNodeGetItem(), UI_ContainerItemIteratorInit(), and UI_ContainerNodeGetExistingItem().
|
extern |
Check whether we already have actors spawned on the battlefield.
true when we are in battlefield and have soldiers spawned (game is running) Definition at line 82 of file cl_battlescape.cpp.
References cl.
Referenced by CL_ActorInvMove(), CL_ActorNext_f(), CL_ActorPrev_f(), CL_ActorSelect_f(), CL_HudRadarDown_f(), CL_HudRadarUp_f(), CL_NextRound_f(), CL_SelectDown_f(), HUD_ActorWoundData_f(), HUD_UpdateActorLoad_f(), uiContainerNode::onDndFinished(), SCR_DrawCursor(), UI_ContainerNodeAutoPlace(), UI_ContainerNodeAutoPlace(), UI_ContainerNodeDrawDropPreview(), UI_DrawFree(), and UI_KeyPressed().
Draw the inventory of the base.
Definition at line 402 of file ui_node_baseinventory.cpp.
References ALIGN_UL, uiNode_t::box, EXTRADATA, uiBox_t::pos, R_FontDrawString(), uiBox_t::size, UI_BaseInventoryNodeDrawItems(), UI_BaseInventoryNodeUpdateScroll(), UI_GetNodeScreenPos(), UI_PopClipRect(), UI_PushClipRect(), and va().
Referenced by uiBaseInventoryNode::draw().
Draw the base inventory.
Definition at line 249 of file ui_node_baseinventory.cpp.
References _, ALIGN_LC, ALIGN_UL, objDef_t::ammos, uiNode_t::box, C_UNIT, colorDefault, colorDisabledHiden, colorDisabledLoadable, colorLoadable, csi, Item::def(), EXTRADATA, GAME_ItemIsUseable(), Item::getAmount(), INVSH_GetItemByIDX(), objDef_t::isAmmo(), objDef_t::isLoadableInWeapon(), containerItemIterator_t::itemFound, containerItemIterator_t::itemID, LONGLINES_WRAP, objDef_t::name, objDef_t::numAmmos, R_FontTextSize(), scale, Item::setDef(), uiBox_t::size, objDef_t::sx, objDef_t::sy, UI_ContainerItemIteratorInit(), UI_ContainerItemIteratorNext(), UI_ContainerNodeGetExistingItem(), UI_DrawItem(), UI_DrawString(), UI_GetNodeAbsPos(), va(), Vector2Copy, and objDef_t::weapon.
Referenced by UI_BaseInventoryNodeDraw2().
|
static |
Definition at line 474 of file ui_node_baseinventory.cpp.
References _, objDef_t::ammos, uiNode_t::box, C_UNIT, csi, EXTRADATACONST, GAME_ItemIsUseable(), Item::getX(), Item::getY(), INVSH_GetItemByIDX(), containerItemIterator_t::itemFound, containerItemIterator_t::itemID, LONGLINES_WRAP, objDef_t::name, NONE, objDef_t::numAmmos, R_FontTextSize(), uiBox_t::size, objDef_t::sx, objDef_t::sy, UI_ContainerItemIteratorInit(), UI_ContainerItemIteratorNext(), UI_ContainerNodeGetExistingItem(), UI_GetNodeAbsPos(), Vector2Copy, and objDef_t::weapon.
Referenced by uiBaseInventoryNode::drawTooltip(), uiBaseInventoryNode::onMouseDown(), and UI_ContainerNodeAutoPlace().
Update display of scroll buttons.
| [in] | node | Context node |
Definition at line 218 of file ui_node_baseinventory.cpp.
References EXTRADATA, UI_ExecuteEventActions(), and UI_ExecuteLuaEventScript().
Referenced by uiBaseInventoryNode::onScroll(), UI_BaseInventoryNodeDraw2(), and UI_ContainerNodeAutoPlace().
|
static |
Use a container node to init an item iterator.
Definition at line 174 of file ui_node_baseinventory.cpp.
References CII_AMMOONLY, CII_AVAILABLEONLY, CII_END, CII_IMPLANTONLY, CII_NOTAVAILABLEONLY, CII_WEAPONONLY, EXTRADATACONST, containerItemIterator_t::filterEquipType, containerItemIterator_t::groupID, containerItemIterator_t::groupSteps, containerItemIterator_t::itemID, containerItemIterator_t::node, and UI_ContainerItemIteratorNext().
Referenced by UI_BaseInventoryNodeDrawItems(), and UI_BaseInventoryNodeGetItem().
|
static |
Compute the next itemID.
Definition at line 117 of file ui_node_baseinventory.cpp.
References CII_AMMOONLY, CII_AVAILABLEONLY, CII_END, CII_IMPLANTONLY, CII_NOTAVAILABLEONLY, CII_WEAPONONLY, csi, containerItemIterator_t::filterEquipType, GAME_ItemIsUseable(), containerItemIterator_t::groupID, containerItemIterator_t::groupSteps, objDef_t::implant, INV_ItemMatchesFilter(), INVSH_GetItemByIDX(), objDef_t::isAmmo(), objDef_t::isArmour(), objDef_t::isMisc, containerItemIterator_t::itemFound, containerItemIterator_t::itemID, containerItemIterator_t::node, objDef_t::numWeapons, UI_ContainerNodeGetExistingItem(), and objDef_t::weapon.
Referenced by UI_BaseInventoryNodeDrawItems(), UI_BaseInventoryNodeGetItem(), and UI_ContainerItemIteratorInit().
Try to autoplace an item at a position when right-click was used in the inventory.
| [in] | node | The context node |
| [in] | mouseX | X mouse coordinates. |
| [in] | mouseY | Y mouse coordinates. |
Definition at line 630 of file ui_node_baseinventory.cpp.
References CL_BattlescapeRunning(), cl_selected, Com_DPrintf(), DEBUG_CLIENT, EXTRADATA, UI_BaseInventoryNodeGetItem(), UI_BaseInventoryNodeUpdateScroll(), UI_ContainerNodeAutoPlaceItem(), and ui_inventory.
Referenced by uiBaseInventoryNode::onMouseDown(), and uiContainerNode::onMouseDown().
|
static |
Searches if there is an item at location (x/y) in a scrollable container. You can also provide an item to search for directly (x/y is ignored in that case).
| [in] | node | Context node |
| [in] | item | Item requested |
| [in] | filterType | Filter used. |
Definition at line 82 of file ui_node_baseinventory.cpp.
References Com_Printf(), EXTRADATACONST, INV_SearchInInventoryWithFilter(), and ui_inventory.
Referenced by UI_BaseInventoryNodeDrawItems(), UI_BaseInventoryNodeGetItem(), and UI_ContainerItemIteratorNext().
| void UI_RegisterBaseInventoryNode | ( | uiBehaviour_t * | behaviour | ) |
Definition at line 771 of file ui_node_baseinventory.cpp.
References Com_RegisterConstInt(), uiBehaviour_t::extends, EXTRADATA_TYPE, uiBehaviour_t::extraDataSize, FILTER_AIRCRAFT, FILTER_CRAFTITEM, FILTER_DISASSEMBLY, FILTER_DUMMY, FILTER_S_ARMOUR, FILTER_S_HEAVY, FILTER_S_IMPLANT, FILTER_S_MISC, FILTER_S_PRIMARY, FILTER_S_SECONDARY, FILTER_UGVITEM, uiBehaviour_t::lua_SWIG_typeinfo, uiBehaviour_t::manager, uiBehaviour_t::name, UI_RegisterExtradataNodeProperty, UI_SWIG_TypeQuery(), V_BOOL, V_INT, and V_UI_ACTION.
|
extern |
Definition at line 73 of file cl_main.cpp.
Referenced by CL_ActorUpdate_f(), CL_ChangeSkin_f(), CL_InitLocal(), UI_ContainerNodeAutoPlace(), and UI_ContainerNodeAutoPlace().
|
static |
Definition at line 240 of file ui_node_baseinventory.cpp.
Referenced by UI_BaseInventoryNodeDrawItems(), UI_ContainerNodeDrawGrid(), and UI_ContainerNodeDrawSingle().
|
static |
Definition at line 242 of file ui_node_baseinventory.cpp.
Referenced by UI_BaseInventoryNodeDrawItems().
|
static |
Definition at line 243 of file ui_node_baseinventory.cpp.
Referenced by UI_BaseInventoryNodeDrawItems(), and UI_ContainerNodeDrawSingle().
|
static |
Definition at line 241 of file ui_node_baseinventory.cpp.
Referenced by UI_BaseInventoryNodeDrawItems(), UI_ContainerNodeDrawGrid(), and UI_ContainerNodeDrawSingle().
|
static |
self cache for drag item
Definition at line 63 of file ui_node_baseinventory.cpp.
Referenced by uiContainerNode::onDndFinished(), uiBaseInventoryNode::onMouseDown(), and uiContainerNode::onMouseDown().
|
static |
Definition at line 64 of file ui_node_baseinventory.cpp.
Referenced by uiContainerNode::onDndFinished(), uiBaseInventoryNode::onMouseDown(), and uiContainerNode::onMouseDown().
|
static |
The current invList pointer (only used for ignoring the dragged item for finding free space right now)
Definition at line 70 of file ui_node_baseinventory.cpp.
Referenced by uiBaseInventoryNode::onCapturedMouseMove(), uiContainerNode::onCapturedMouseMove(), uiContainerNode::onDndMove(), uiBaseInventoryNode::onMouseDown(), uiContainerNode::onMouseDown(), UI_ContainerNodeDrawDropPreview(), and UI_ContainerNodeDrawFreeSpace().
|
static |
Definition at line 656 of file ui_node_baseinventory.cpp.
Referenced by uiBaseInventoryNode::onCapturedMouseMove(), uiContainerNode::onCapturedMouseMove(), uiBaseInventoryNode::onMouseDown(), and uiContainerNode::onMouseDown().
|
static |
Definition at line 657 of file ui_node_baseinventory.cpp.
Referenced by uiBaseInventoryNode::onCapturedMouseMove(), uiContainerNode::onCapturedMouseMove(), uiVScrollbarNode::onCapturedMouseMove(), uiBaseInventoryNode::onMouseDown(), uiContainerNode::onMouseDown(), and UI_VScrollbarNodeAction().
|
static |
Definition at line 238 of file ui_node_baseinventory.cpp.
Referenced by BuildFacelights(), BuildVertexNormals(), CalcTextureSize(), uiBarNode::draw(), uiImageNode::draw(), uiItemNode::draw(), ExportLightmap(), FpUcurveSc_d(), FpUcurveSc_f(), GatherSampleLight(), GatherSampleSunlight(), LET_Appear(), LM_AddModel(), M_AddToSampleBuffer(), Matrix4x4_CreateFromQuakeEntity(), Matrix4x4_Invert_Simple(), Matrix4x4_Normalize(), Matrix4x4_Normalize3(), Matrix4x4_TransformPositivePlane(), Matrix4x4_TransformStandardPlane(), uiModelNode::onLoading(), R_Draw2DMapMarkers(), R_Draw3DMapMarkers(), R_DrawFlareSurfaces(), R_ModelAutoScale(), R_SphereRender(), R_Transform(), SV_ModLoadAliasMD2Model(), UI_BaseInventoryNodeDrawItems(), UI_ContainerNodeDrawDropPreview(), UI_ContainerNodeDrawGrid(), UI_ContainerNodeDrawSingle(), UI_DrawDragAndDrop(), UI_DrawItem(), UI_DrawNormImage(), UI_InitModelInfoView(), UI_RegisterModelNode(), UI_Transform(), uiModelNode_t_set_scale(), VectorClampMA(), VectorMA(), and WindingCenter().