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