1 // Copyright (C) 2007 Ole Laursen
2 // Copyright (C) 2007, 2008, 2009 Ben Asselstine
4 // This program is free software; you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation; either version 3 of the License, or
7 // (at your option) any later version.
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Library General Public License for more details.
14 // You should have received a copy of the GNU General Public License
15 // along with this program; if not, write to the Free Software
16 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19 #ifndef EDITORBIGMAP_H
20 #define EDITORBIGMAP_H
23 #include <sigc++/signal.h>
24 #include <sigc++/trackable.h>
25 #include <sigc++/connection.h>
28 #include "input-events.h"
31 #include "GraphicsCache.h"
40 class UniquelyIdentified;
43 //! Scenario editor. Specializatoin of the BigMap class for the editor.
44 class EditorBigMap: public BigMap
65 void set_pointer(Pointer pointer, int size, Tile::Type terrain,
68 void mouse_button_event(MouseButtonEvent e);
69 void mouse_motion_event(MouseMotionEvent e);
70 void mouse_leave_event();
72 void toggleViewStylesOrTypes() { show_tile_types_instead_of_tile_styles =
73 !show_tile_types_instead_of_tile_styles;};
74 // something was selected
75 typedef std::vector<UniquelyIdentified*> map_selection_seq;
76 sigc::signal<void, map_selection_seq> objects_selected;
78 // emitted whenever the user moves the mouse to a new tile
79 sigc::signal<void, Vector<int> > mouse_on_tile;
81 // emitted when the map is changed by the user
82 sigc::signal<void, Rectangle> map_tiles_changed;
87 Vector<int> prev_mouse_pos, mouse_pos;
90 Tile::Type pointer_terrain;
92 int pointer_tile_style_id;
93 //! moving sets if we're moving objects on the map via the move button
94 Vector<int> moving_objects_from;
100 virtual void after_draw();
101 int tile_to_road_type(Vector<int> tile);
102 int tile_to_bridge_type(Vector<int> tile);
103 void change_map_under_cursor();
104 std::vector<Vector<int> > get_cursor_tiles();
105 Rectangle get_cursor_rectangle();
106 std::vector<Vector<int> > get_screen_tiles();
107 bool show_tile_types_instead_of_tile_styles;