The Battle for Wesnoth
1.17.14+dev
overlay.hpp
Go to the documentation of this file.
1
/*
2
Copyright (C) 2003 - 2022
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
halo::handle
handle
,
26
const
std::string& overlay_team_name,
27
const
std::string& item_id,
28
const
bool
fogged,
29
float
submerge
,
30
float
item_z_order = 0)
31
:
image
(img)
32
,
halo
(halo_img)
33
,
team_name
(overlay_team_name)
34
,
id
(item_id)
35
,
halo_handle
(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
};
overlay::z_order
float z_order
Definition:
overlay.hpp:64
t_string
Definition:
tstring.hpp:128
overlay::halo_handle
halo::handle halo_handle
Definition:
overlay.hpp:61
overlay::visible_in_fog
bool visible_in_fog
Definition:
overlay.hpp:62
halo.hpp
overlay::overlay
overlay(const std::string &img, const std::string &halo_img, halo::handle handle, 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
Definition:
overlay.hpp:20
overlay::id
std::string id
Definition:
overlay.hpp:59
overlay::submerge
float submerge
Definition:
overlay.hpp:63
overlay::name
t_string name
Definition:
overlay.hpp:58
overlay::halo
std::string halo
Definition:
overlay.hpp:56
halo
Definition:
display.hpp:45
image
Functions to load and save images from/to disk.
Definition:
image_modifications.cpp:35
overlay::team_name
std::string team_name
Definition:
overlay.hpp:57
config
A config object defines a single node in a WML file, with access to child nodes.
Definition:
config.hpp:60
halo::handle
std::shared_ptr< halo_record > handle
Definition:
halo.hpp:31
overlay::overlay
overlay(const config &cfg)
Definition:
overlay.hpp:42
overlay::image
std::string image
Definition:
overlay.hpp:55
Generated by
1.8.13