OpenXcom
1.0
Open-source clone of the original X-Com
src
Battlescape
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
37
class
ActionMenuItem
:
public
InteractiveSurface
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);
49
~ActionMenuItem
();
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
}
OpenXcom::ActionMenuItem::getAction
BattleActionType getAction() const
Gets the assigned action.
Definition:
ActionMenuItem.cpp:104
OpenXcom::Action
Container for all the information associated with a given user action, like mouse clicks...
Definition:
Action.h:32
OpenXcom::ActionMenuItem::draw
void draw()
Redraws it.
Definition:
ActionMenuItem.cpp:136
OpenXcom::State
A game state that receives user input and reacts accordingly.
Definition:
State.h:44
OpenXcom::InteractiveSurface
Surface that the user can interact with.
Definition:
InteractiveSurface.h:37
OpenXcom::Text
Text string displayed on screen.
Definition:
Text.h:40
OpenXcom::ActionMenuItem
A class that represents a single box in the action popup menu on the battlescape. ...
Definition:
ActionMenuItem.h:37
OpenXcom::ActionMenuItem::getTUs
int getTUs() const
Gets the assigned action TUs.
Definition:
ActionMenuItem.cpp:113
OpenXcom::ActionMenuItem::ActionMenuItem
ActionMenuItem(int id, Game *game, int x, int y)
Creates a new ActionMenuItem.
Definition:
ActionMenuItem.cpp:36
OpenXcom::ActionMenuItem::mouseIn
void mouseIn(Action *action, State *state)
Processes a mouse hover in event.
Definition:
ActionMenuItem.cpp:149
OpenXcom::ActionMenuItem::~ActionMenuItem
~ActionMenuItem()
Cleans up the ActionMenuItem.
Definition:
ActionMenuItem.cpp:74
OpenXcom::ActionMenuItem::mouseOut
void mouseOut(Action *action, State *state)
Processes a mouse hover out event.
Definition:
ActionMenuItem.cpp:163
OpenXcom::ActionMenuItem::setPalette
void setPalette(SDL_Color *colors, int firstcolor, int ncolors)
Sets the palettes.
Definition:
ActionMenuItem.cpp:124
OpenXcom::Game
The core of the game engine, manages the game's entire contents and structure.
Definition:
Game.h:41
OpenXcom::ActionMenuItem::setAction
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
OpenXcom::Frame
Fancy frame border thing used for windows and other elements.
Definition:
Frame.h:28
OpenXcom
Definition:
BaseInfoState.cpp:40
Generated by
1.8.14