20 #include "../Engine/InteractiveSurface.h" 43 Surface *_grid, *_items, *_selection;
49 int _groundOffset, _animFrame;
50 std::map<int, std::map<int, int> > _stackLevel;
51 std::vector<std::pair<int, int> > _grenadeIndicators;
61 Inventory(
Game *game,
int width,
int height,
int x = 0,
int y = 0,
bool base =
false);
65 void setPalette(SDL_Color *colors,
int firstcolor = 0,
int ncolors = 256);
Container for all the information associated with a given user action, like mouse clicks...
Definition: Action.h:32
BattleItem * getSelectedItem() const
Gets the currently selected item.
Definition: Inventory.cpp:402
void showWarning(const std::string &msg)
Shows a warning message.
Definition: Inventory.cpp:1019
A game state that receives user input and reacts accordingly.
Definition: State.h:44
Timer used to run code in fixed intervals.
Definition: Timer.h:35
static bool overlapItems(BattleUnit *unit, BattleItem *item, RuleInventory *slot, int x=0, int y=0)
Checks for item overlap.
Definition: Inventory.cpp:355
Surface that the user can interact with.
Definition: InteractiveSurface.h:37
void arrangeGround(bool alterOffset=true)
Arranges items on the ground.
Definition: Inventory.cpp:857
void drawPrimers()
Show priming warnings on grenades.
Definition: Inventory.cpp:1027
void setTuMode(bool tu)
Sets the inventory's Time Unit mode.
Definition: Inventory.cpp:111
Interactive view of an inventory.
Definition: Inventory.h:39
void drawGrid()
Draws the inventory grid.
Definition: Inventory.cpp:139
Represents a single item in the battlescape.
Definition: BattleItem.h:37
void setSelectedUnit(BattleUnit *unit)
Sets the inventory's selected unit.
Definition: Inventory.cpp:120
Coloured box with text inside that fades out after it is displayed.
Definition: WarningMessage.h:33
bool canBeStacked(BattleItem *itemA, BattleItem *itemB)
Checks if two items can be stacked on one another.
Definition: Inventory.cpp:990
Element that is blit (rendered) onto the screen.
Definition: Surface.h:38
bool unload()
Unloads the selected weapon.
Definition: Inventory.cpp:805
Inventory(Game *game, int width, int height, int x=0, int y=0, bool base=false)
Creates a new inventory view at the specified position and size.
Definition: Inventory.cpp:57
void drawItems()
Draws the inventory items.
Definition: Inventory.cpp:219
void think()
Handles timers.
Definition: Inventory.cpp:450
BattleItem * getMouseOverItem() const
Gets the mouse over item.
Definition: Inventory.cpp:433
void setPalette(SDL_Color *colors, int firstcolor=0, int ncolors=256)
Sets the inventory's palette.
Definition: Inventory.cpp:95
The core of the game engine, manages the game's entire contents and structure.
Definition: Game.h:41
~Inventory()
Cleans up the inventory.
Definition: Inventory.cpp:79
Number digits displayed on the screen.
Definition: NumberText.h:29
void blit(Surface *surface)
Blits the inventory onto another surface.
Definition: Inventory.cpp:460
void setMouseOverItem(BattleItem *item)
Sets the mouse over item.
Definition: Inventory.cpp:442
void setSelectedItem(BattleItem *item)
Sets the currently selected item.
Definition: Inventory.cpp:411
void mouseClick(Action *action, State *state)
Special handling for mouse clicks.
Definition: Inventory.cpp:509
void draw()
Draws the inventory.
Definition: Inventory.cpp:130
Represents a moving unit in the battlescape, player controlled or AI controlled it holds info about i...
Definition: BattleUnit.h:59
Definition: BaseInfoState.cpp:40
bool fitItem(RuleInventory *newSlot, BattleItem *item, std::string &warning)
Attempts to place an item in an inventory slot.
Definition: Inventory.cpp:951
void mouseOver(Action *action, State *state)
Special handling for mouse hovers.
Definition: Inventory.cpp:475
Represents a specific section of the inventory, containing information like available slots and scree...
Definition: RuleInventory.h:42