OpenXcom  1.0
Open-source clone of the original X-Com
MiniMapView.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 "Position.h"
22 
23 namespace OpenXcom
24 {
25 
26 class Game;
27 class Camera;
28 class SavedBattleGame;
29 class SurfaceSet;
30 
35 {
36  Game * _game;
37  Camera * _camera;
38  SavedBattleGame * _battleGame;
39  int _frame;
40  SurfaceSet * _set;
41  // these two are required for right-button scrolling on the minimap
42  bool _isMouseScrolling;
43  bool _isMouseScrolled;
44  int _xBeforeMouseScrolling, _yBeforeMouseScrolling;
45  int _mouseScrollX, _mouseScrollY;
46  Position _posBeforeMouseScrolling, _cursorPosition;
47  Uint32 _mouseScrollingStartTime;
48  int _totalMouseMoveX, _totalMouseMoveY;
49  bool _mouseMovedOverThreshold;
51  void mousePress(Action *action, State *state);
53  void mouseClick(Action *action, State *state);
55  void mouseOver(Action *action, State *state);
57  void mouseIn(Action *action, State *state);
58 public:
60  MiniMapView(int w, int h, int x, int y, Game * game, Camera * camera, SavedBattleGame * battleGame);
62  void draw();
64  int up();
66  int down();
68  void animate();
69  void stopScrolling(Action *action);
70 };
71 
72 }
Container for all the information associated with a given user action, like mouse clicks...
Definition: Action.h:32
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
Class handling camera movement, either by mouse or by events on the battlescape.
Definition: Camera.h:33
void animate()
Updates the minimap animation.
Definition: MiniMapView.cpp:399
int down()
Changes the displayed minimap level.
Definition: MiniMapView.cpp:174
Container of a set of surfaces.
Definition: SurfaceSet.h:35
void draw()
Draws the minimap.
Definition: MiniMapView.cpp:60
int up()
Changes the displayed minimap level.
Definition: MiniMapView.cpp:163
MiniMapView is the class used to display the map in the MiniMapState.
Definition: MiniMapView.h:34
MiniMapView(int w, int h, int x, int y, Game *game, Camera *camera, SavedBattleGame *battleGame)
Creates the MiniMapView.
Definition: MiniMapView.cpp:52
The battlescape data that gets written to disk when the game is saved.
Definition: SavedBattleGame.h:47
The core of the game engine, manages the game&#39;s entire contents and structure.
Definition: Game.h:41
Easy handling of X-Y-Z coordinates.
Definition: Position.h:28
Definition: BaseInfoState.cpp:40