The Battle for Wesnoth
1.19.4+dev
editor
palette
item_palette.hpp
Go to the documentation of this file.
1
/*
2
Copyright (C) 2012 - 2024
3
by Fabian Mueller <fabianmueller5@gmx.de>
4
Part of the Battle for Wesnoth Project https://www.wesnoth.org/
5
6
This program is free software; you can redistribute it and/or modify
7
it under the terms of the GNU General Public License as published by
8
the Free Software Foundation; either version 2 of the License, or
9
(at your option) any later version.
10
This program is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY.
12
13
See the COPYING file for more details.
14
*/
15
16
/**
17
* Manage the item-palette in the editor.
18
*/
19
20
#pragma once
21
22
#include "
editor/palette/editor_palettes.hpp
"
23
#include "
overlay.hpp
"
24
class
game_config_view
;
25
26
namespace
editor
{
27
28
class
editor_toolkit;
29
30
//std::string get_selected_terrain();
31
32
/** Palette where the terrain to be drawn can be selected. */
33
class
item_palette
:
public
editor_palette
<overlay> {
34
public
:
35
36
item_palette
(
editor_display
&
gui
,
37
const
game_config_view
& cfg,
38
editor_toolkit
&toolkit);
39
40
virtual
void
setup
(
const
game_config_view
& cfg);
41
42
virtual
std::string
get_help_string
();
43
44
private
:
45
46
virtual
const
std::string&
get_id
(
const
overlay
&
item
);
47
48
virtual
void
setup_item
(
49
const
overlay
&
item
,
50
texture
& item_base_image,
51
texture
& item_overlay_image,
52
std::stringstream&
tooltip
53
);
54
};
55
56
}
editor::editor_display
Definition:
editor_display.hpp:24
editor::editor_palette
Definition:
editor_palettes.hpp:27
editor::editor_toolkit
Definition:
editor_toolkit.hpp:27
editor::item_palette
Palette where the terrain to be drawn can be selected.
Definition:
item_palette.hpp:33
editor::item_palette::get_help_string
virtual std::string get_help_string()
Definition:
item_palette.cpp:30
editor::item_palette::get_id
virtual const std::string & get_id(const overlay &item)
Definition:
item_palette.cpp:92
editor::item_palette::item_palette
item_palette(editor_display &gui, const game_config_view &cfg, editor_toolkit &toolkit)
Definition:
item_palette.cpp:85
editor::item_palette::setup
virtual void setup(const game_config_view &cfg)
Setup the internal data structure.
Definition:
item_palette.cpp:35
editor::item_palette::setup_item
virtual void setup_item(const overlay &item, texture &item_base_image, texture &item_overlay_image, std::stringstream &tooltip)
Setup item image and tooltip.
Definition:
item_palette.cpp:59
game_config_view
A class grating read only view to a vector of config objects, viewed as one config with all children ...
Definition:
game_config_view.hpp:31
texture
Wrapper class to encapsulate creation and management of an SDL_Texture.
Definition:
texture.hpp:33
editor_palettes.hpp
tooltip
std::string tooltip
Shown when hovering over an entry in the filter's drop-down list.
Definition:
manager.cpp:204
editor
Manage the empty-palette in the editor.
Definition:
action.cpp:31
gui
General purpose widgets.
Definition:
tristate_button.cpp:30
help::item
std::pair< std::string, unsigned > item
Definition:
help_impl.hpp:411
overlay.hpp
overlay
Definition:
overlay.hpp:21
Generated by
1.9.1