19 #ifndef OPENXCOM_SELLSTATE_H
20 #define OPENXCOM_SELLSTATE_H
22 #include "../Engine/State.h"
23 #include "../Menu/OptionsBaseState.h"
29 enum SellType { SELL_SOLDIER, SELL_CRAFT, SELL_ITEM, SELL_SCIENTIST, SELL_ENGINEER };
50 Text *_txtTitle, *_txtSales, *_txtFunds, *_txtItem, *_txtQuantity, *_txtSell, *_txtValue, *_txtSpaceUsed;
52 std::vector<int> _qtys;
53 std::vector<Soldier*> _soldiers;
54 std::vector<Craft*> _crafts;
55 std::vector<std::string> _items;
56 size_t _sel, _itemOffset;
57 int _total, _hasSci, _hasEng;
59 Timer *_timerInc, *_timerDec;
60 Uint8 _color, _color2, _color3, _colorAmmo;
61 OptionsOrigin _origin;
67 enum SellType getType(
size_t selected)
const;
69 size_t getItemIndex(
size_t selected)
const;
71 size_t getCraftIndex(
size_t selected)
const;
void lstItemsMousePress(Action *action)
Handler for pressing-down a mouse-button in the list.
Definition: SellState.cpp:525
Container for all the information associated with a given user action, like mouse clicks...
Definition: Action.h:34
SellState(Game *game, Base *base, OptionsOrigin origin=OPT_GEOSCAPE)
Creates the Sell state.
Definition: SellState.cpp:58
void lstItemsRightArrowPress(Action *action)
Handler for pressing a Decrease arrow in the list.
Definition: SellState.cpp:487
A game state that receives user input and reacts accordingly.
Definition: State.h:44
Box with a coloured border and custom background.
Definition: Window.h:42
Timer used to run code in fixed intervals.
Definition: Timer.h:37
List of Text's split into columns.
Definition: TextList.h:42
void btnOkClick(Action *action)
Handler for clicking the OK button.
Definition: SellState.cpp:294
void think()
Runs the timers.
Definition: SellState.cpp:272
Text string displayed on screen.
Definition: Text.h:41
void lstItemsLeftArrowClick(Action *action)
Handler for clicking an Increase arrow in the list.
Definition: SellState.cpp:472
Sell/Sack screen that lets the player sell any items in a particular base.
Definition: SellState.h:44
void decrease()
Decreases the quantity of an item by one.
Definition: SellState.cpp:684
void btnCancelClick(Action *action)
Handler for clicking the Cancel button.
Definition: SellState.cpp:440
void lstItemsRightArrowRelease(Action *action)
Handler for releasing a Decrease arrow in the list.
Definition: SellState.cpp:497
void updateItemStrings()
Updates the quantity-strings of the selected item.
Definition: SellState.cpp:694
void lstItemsRightArrowClick(Action *action)
Handler for clicking a Decrease arrow in the list.
Definition: SellState.cpp:510
void increase()
Increases the quantity of an item by one.
Definition: SellState.cpp:615
Represents a player base on the globe.
Definition: Base.h:47
Coloured button with a text label.
Definition: TextButton.h:40
~SellState()
Cleans up the Sell state.
Definition: SellState.cpp:263
The core of the game engine, manages the game's entire contents and structure.
Definition: Game.h:44
void lstItemsLeftArrowRelease(Action *action)
Handler for releasing an Increase arrow in the list.
Definition: SellState.cpp:459
void changeByValue(int change, int dir)
Changes the quantity of an item by the given value.
Definition: SellState.cpp:627
void lstItemsLeftArrowPress(Action *action)
Handler for pressing an Increase arrow in the list.
Definition: SellState.cpp:449