The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
terrain_palettes.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2003 - 2016 by David White <[email protected]>
3  Part of the Battle for Wesnoth Project http://www.wesnoth.org/
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY.
11 
12  See the COPYING file for more details.
13 */
14 
15 /**
16  * Manage the terrain-palette in the editor.
17  * Note: this is a near-straight rip from the old editor.
18 */
19 
20 #ifndef TERRAIN_PALETTES_H_INCLUDED
21 #define TERRAIN_PALETTES_H_INCLUDED
22 
23 #include "editor_palettes.hpp"
24 
25 namespace editor {
26 
29 
30 /** Palette where the terrain to be drawn can be selected. */
31 class terrain_palette : public editor_palette<t_translation::t_terrain> {
32 
33 public:
34 
36  mouse_action** active_mouse_action);
37 
38  const gamemap& map() const { return gui_.get_map(); }
39 
40  virtual void setup(const config& cfg);
41 
44 
47 
48  virtual std::string get_help_string();
49 
50 private:
51 
52  virtual void select_bg_item(const std::string& item_id);
53  virtual void select_fg_item(const std::string& item_id);
54 
55  virtual const std::string& get_id(const t_translation::t_terrain& terrain);
56 
57  virtual void draw_item(const t_translation::t_terrain& terrain, surface& item_image, std::stringstream& tooltip_text);
58 
59 };
60 
61 }
62 #endif
const t_translation::t_terrain & selected_bg_item() const
terrain_palette(editor_display &gui, const config &cfg, mouse_action **active_mouse_action)
Palette where the terrain to be drawn can be selected.
General purpose widgets.
virtual void setup(const config &cfg)
Setup the internal data structure.
const gamemap & map() const
const t_translation::t_terrain & selected_fg_item() const
virtual std::string get_help_string()
Encapsulates the map of the game.
Definition: map.hpp:37
Manage the empty-palette in the editor.
Definition: action.cpp:28
static const ::config * terrain
The terrain used to create the cache.
Definition: minimap.cpp:135
A terrain string which is converted to a terrain is a string with 1 or 2 layers the layers are separa...
Definition: translation.hpp:47
void select_fg_item(const t_translation::t_terrain &terrain)
const t_translation::t_terrain & get_selected_bg_terrain()
void select_bg_item(const t_translation::t_terrain &terrain)
virtual void draw_item(const t_translation::t_terrain &terrain, surface &item_image, std::stringstream &tooltip_text)
const gamemap & get_map() const
Definition: display.hpp:92
A mouse action receives events from the controller, and responds to them by creating an appropriate e...
A config object defines a single node in a WML file, with access to child nodes.
Definition: config.hpp:83
GLsizei const GLcharARB ** string
Definition: glew.h:4503
virtual const std::string & get_id(const t_translation::t_terrain &terrain)
const t_translation::t_terrain & get_selected_fg_terrain()