The Battle for Wesnoth
1.19.4+dev
overlay.hpp
Go to the documentation of this file.
1
/*
2
Copyright (C) 2003 - 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
#pragma once
17
18
#include "
halo.hpp
"
19
20
struct
overlay
21
{
22
23
overlay
(
const
std::string& img,
24
const
std::string& halo_img,
25
const
std::string& overlay_team_name,
26
const
std::string& item_id,
27
const
bool
fogged,
28
float
submerge
,
29
float
item_z_order = 0)
30
:
image
(img)
31
,
halo
(halo_img)
32
,
team_name
(overlay_team_name)
33
,
name
()
34
,
id
(item_id)
35
,
halo_handle
()
36
,
visible_in_fog
(fogged)
37
,
submerge
(
submerge
)
38
,
z_order
(item_z_order)
39
{}
40
41
42
overlay
(
const
config
& cfg)
43
:
image
(cfg[
"image"
])
44
,
halo
(cfg[
"halo"
])
45
,
team_name
(cfg[
"team_name"
])
46
,
name
(cfg[
"name"
].t_str())
47
,
id
(cfg[
"id"
])
48
,
halo_handle
()
49
,
visible_in_fog
(cfg[
"visible_in_fog"
].to_bool())
50
,
submerge
(cfg[
"submerge"
].to_double(0))
51
,
z_order
(cfg[
"z_order"
].to_double(0))
52
{
53
}
54
55
std::string
image
;
56
std::string
halo
;
57
std::string
team_name
;
58
t_string
name
;
59
std::string
id
;
60
61
halo::handle
halo_handle
;
62
bool
visible_in_fog
;
63
float
submerge
;
64
float
z_order
;
65
66
};
config
A config object defines a single node in a WML file, with access to child nodes.
Definition:
config.hpp:172
t_string
Definition:
tstring.hpp:128
halo.hpp
halo
Definition:
halo.cpp:39
halo::handle
std::shared_ptr< halo_record > handle
Definition:
halo.hpp:31
image
Functions to load and save images from/to disk.
Definition:
image_modifications.cpp:36
overlay
Definition:
overlay.hpp:21
overlay::overlay
overlay(const std::string &img, const std::string &halo_img, const std::string &overlay_team_name, const std::string &item_id, const bool fogged, float submerge, float item_z_order=0)
Definition:
overlay.hpp:23
overlay::image
std::string image
Definition:
overlay.hpp:55
overlay::team_name
std::string team_name
Definition:
overlay.hpp:57
overlay::submerge
float submerge
Definition:
overlay.hpp:63
overlay::halo_handle
halo::handle halo_handle
Definition:
overlay.hpp:61
overlay::z_order
float z_order
Definition:
overlay.hpp:64
overlay::name
t_string name
Definition:
overlay.hpp:58
overlay::overlay
overlay(const config &cfg)
Definition:
overlay.hpp:42
overlay::id
std::string id
Definition:
overlay.hpp:59
overlay::halo
std::string halo
Definition:
overlay.hpp:56
overlay::visible_in_fog
bool visible_in_fog
Definition:
overlay.hpp:62
Generated by
1.9.1