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