The Battle for Wesnoth  1.15.9+dev
item_palette.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2012 - 2018 by Fabian Mueller <fabianmueller5@gmx.de>
3  Part of the Battle for Wesnoth Project https://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 item-palette in the editor.
17  */
18 
19 #pragma once
20 
22 #include "overlay.hpp"
23 class game_config_view;
24 
25 namespace editor {
26 
27 class editor_toolkit;
28 
29 //std::string get_selected_terrain();
30 
31 /** Palette where the terrain to be drawn can be selected. */
32 class item_palette : public editor_palette<overlay> {
33 public:
34 
36  const game_config_view& cfg,
37  editor_toolkit &toolkit);
38 
39  virtual void setup(const game_config_view& cfg);
40 
41  virtual std::string get_help_string();
42 
43 private:
44 
45  virtual const std::string& get_id(const overlay& item);
46 
47  virtual void draw_item(const overlay& item, surface& image, std::stringstream& tooltip_text);
48 
49 };
50 
51 }
virtual void draw_item(const overlay &item, surface &image, std::stringstream &tooltip_text)
virtual const std::string & get_id(const overlay &item)
General purpose widgets.
virtual void setup(const game_config_view &cfg)
Setup the internal data structure.
item_palette(editor_display &gui, const game_config_view &cfg, editor_toolkit &toolkit)
Manage the empty-palette in the editor.
Definition: action.cpp:29
Palette where the terrain to be drawn can be selected.
virtual std::string get_help_string()
Functions to load and save images from/to disk.
std::pair< std::string, unsigned > item
Definition: help_impl.hpp:407