The Battle for Wesnoth  1.13.10+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 - 2017 by David White <dave@whitevine.net>
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 #pragma once
21 
23 
24 namespace editor {
25 
26 class editor_toolkit;
27 
30 
31 /** Palette where the terrain to be drawn can be selected. */
32 class terrain_palette : public editor_palette<t_translation::terrain_code> {
33 
34 public:
35 
37  editor_toolkit &toolkit);
38 
39  const gamemap& map() const { return gui_.get_map(); }
40 
41  virtual void setup(const config& cfg);
42 
45 
48 
49  virtual std::string get_help_string();
50 
51 private:
52 
53  virtual void select_bg_item(const std::string& item_id);
54  virtual void select_fg_item(const std::string& item_id);
55 
57 
58  virtual void draw_item(const t_translation::terrain_code& terrain, surface& item_image, std::stringstream& tooltip_text);
59 
60 };
61 
62 }
std::vector< char_t > string
virtual const std::string & get_id(const t_translation::terrain_code &terrain)
const t_translation::terrain_code & get_selected_bg_terrain()
Palette where the terrain to be drawn can be selected.
const t_translation::terrain_code & selected_fg_item() const
General purpose widgets.
A terrain string which is converted to a terrain is a string with 1 or 2 layers the layers are separa...
Definition: translation.hpp:55
virtual void setup(const config &cfg)
Setup the internal data structure.
const t_translation::terrain_code & get_selected_fg_terrain()
const gamemap & map() const
void select_bg_item(const t_translation::terrain_code &terrain)
virtual std::string get_help_string()
Encapsulates the map of the game.
Definition: map.hpp:34
Manage the empty-palette in the editor.
Definition: action.cpp:29
void select_fg_item(const t_translation::terrain_code &terrain)
static const ::config * terrain
The terrain used to create the cache.
Definition: minimap.cpp:133
terrain_palette(editor_display &gui, const config &cfg, editor_toolkit &toolkit)
const gamemap & get_map() const
Definition: display.hpp:92
virtual void draw_item(const t_translation::terrain_code &terrain, surface &item_image, std::stringstream &tooltip_text)
A config object defines a single node in a WML file, with access to child nodes.
Definition: config.hpp:93
const t_translation::terrain_code & selected_bg_item() const