OpenXcom  1.0
Open-source clone of the original X-Com
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
ActionMenuItem.h
1 /*
2  * Copyright 2010-2014 OpenXcom Developers.
3  *
4  * This file is part of OpenXcom.
5  *
6  * OpenXcom is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * OpenXcom is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with OpenXcom. If not, see <http://www.gnu.org/licenses/>.
18  */
19 #ifndef OPENXCOM_ACTIONMENUITEM_H
20 #define OPENXCOM_ACTIONMENUITEM_H
21 
22 #include "../Engine/InteractiveSurface.h"
23 #include "BattlescapeGame.h"
24 
25 namespace OpenXcom
26 {
27 
28 class Game;
29 class Font;
30 class Language;
31 class Text;
32 class Frame;
33 
40 {
41 private:
42  bool _highlighted;
43  BattleActionType _action;
44  int _tu;
45  Frame *_frame;
46  Text *_txtDescription, *_txtAcc, *_txtTU;
47 public:
49  ActionMenuItem(int id, Game *game, int x, int y);
53  void setAction(BattleActionType action, std::wstring description, std::wstring accuracy, std::wstring timeunits, int tu);
55  BattleActionType getAction() const;
57  int getTUs() const;
59  void setPalette(SDL_Color *colors, int firstcolor, int ncolors);
61  void draw();
63  void mouseIn(Action *action, State *state);
65  void mouseOut(Action *action, State *state);
66 
67 };
68 
69 }
70 
71 #endif
Container for all the information associated with a given user action, like mouse clicks...
Definition: Action.h:34
void draw()
Redraws it.
Definition: ActionMenuItem.cpp:132
int getTUs() const
Gets the assigned action TUs.
Definition: ActionMenuItem.cpp:109
A game state that receives user input and reacts accordingly.
Definition: State.h:44
BattleActionType getAction() const
Gets the assigned action.
Definition: ActionMenuItem.cpp:100
Surface that the user can interact with.
Definition: InteractiveSurface.h:39
Text string displayed on screen.
Definition: Text.h:41
A class that represents a single box in the action popup menu on the battlescape. ...
Definition: ActionMenuItem.h:39
ActionMenuItem(int id, Game *game, int x, int y)
Creates a new ActionMenuItem.
Definition: ActionMenuItem.cpp:36
void setAction(BattleActionType action, std::wstring description, std::wstring accuracy, std::wstring timeunits, int tu)
Assigns an action to it.
Definition: ActionMenuItem.cpp:86
void mouseIn(Action *action, State *state)
Processes a mouse hover in event.
Definition: ActionMenuItem.cpp:145
~ActionMenuItem()
Cleans up the ActionMenuItem.
Definition: ActionMenuItem.cpp:70
void mouseOut(Action *action, State *state)
Processes a mouse hover out event.
Definition: ActionMenuItem.cpp:159
void setPalette(SDL_Color *colors, int firstcolor, int ncolors)
Sets the palettes.
Definition: ActionMenuItem.cpp:120
The core of the game engine, manages the game's entire contents and structure.
Definition: Game.h:44
Fancy frame border thing used for windows and other elements.
Definition: Frame.h:30