| aaba4f1e |
Poul Sander |
2023-07-25 13:34 |
1 |
/* |
| aaba4f1e |
Poul Sander |
2023-07-25 13:34 |
2 |
=========================================================================== |
| aaba4f1e |
Poul Sander |
2023-07-25 13:34 |
3 |
blockattack - Block Attack - Rise of the Blocks |
| aaba4f1e |
Poul Sander |
2023-07-25 13:34 |
4 |
Copyright (C) 2005-2023 Poul Sander |
| aaba4f1e |
Poul Sander |
2023-07-25 13:34 |
5 |
|
| aaba4f1e |
Poul Sander |
2023-07-25 13:34 |
6 |
This program is free software: you can redistribute it and/or modify |
| aaba4f1e |
Poul Sander |
2023-07-25 13:34 |
7 |
it under the terms of the GNU General Public License as published by |
| aaba4f1e |
Poul Sander |
2023-07-25 13:34 |
8 |
the Free Software Foundation, either version 2 of the License, or |
| aaba4f1e |
Poul Sander |
2023-07-25 13:34 |
9 |
(at your option) any later version. |
| aaba4f1e |
Poul Sander |
2023-07-25 13:34 |
10 |
|
| aaba4f1e |
Poul Sander |
2023-07-25 13:34 |
11 |
This program is distributed in the hope that it will be useful, |
| aaba4f1e |
Poul Sander |
2023-07-25 13:34 |
12 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| aaba4f1e |
Poul Sander |
2023-07-25 13:34 |
13 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| aaba4f1e |
Poul Sander |
2023-07-25 13:34 |
14 |
GNU General Public License for more details. |
| aaba4f1e |
Poul Sander |
2023-07-25 13:34 |
15 |
|
| aaba4f1e |
Poul Sander |
2023-07-25 13:34 |
16 |
You should have received a copy of the GNU General Public License |
| aaba4f1e |
Poul Sander |
2023-07-25 13:34 |
17 |
along with this program. If not, see http://www.gnu.org/licenses/ |
| aaba4f1e |
Poul Sander |
2023-07-25 13:34 |
18 |
|
| aaba4f1e |
Poul Sander |
2023-07-25 13:34 |
19 |
Source information and contacts persons can be found at |
| aaba4f1e |
Poul Sander |
2023-07-25 13:34 |
20 |
https://www.blockattack.net |
| aaba4f1e |
Poul Sander |
2023-07-25 13:34 |
21 |
=========================================================================== |
| aaba4f1e |
Poul Sander |
2023-07-25 13:34 |
22 |
*/ |
| aaba4f1e |
Poul Sander |
2023-07-25 13:34 |
23 |
|
| aaba4f1e |
Poul Sander |
2023-07-25 13:34 |
24 |
#pragma once |
| aaba4f1e |
Poul Sander |
2023-07-25 13:34 |
25 |
|
| aaba4f1e |
Poul Sander |
2023-07-25 13:34 |
26 |
#include <string> |
| a0c212cb |
Poul Sander |
2023-08-13 16:10 |
27 |
#include <vector> |
| aaba4f1e |
Poul Sander |
2023-07-25 13:34 |
28 |
|
| 883f5498 |
Poul Sander |
2023-11-01 20:58 |
29 |
enum class ImgScale { |
| 883f5498 |
Poul Sander |
2023-11-01 20:58 |
30 |
Stretch, |
| 883f5498 |
Poul Sander |
2023-11-01 20:58 |
31 |
Tile, |
| 883f5498 |
Poul Sander |
2023-11-01 20:58 |
32 |
Resize, |
| 883f5498 |
Poul Sander |
2023-11-01 20:58 |
33 |
Cut |
| 883f5498 |
Poul Sander |
2023-11-01 20:58 |
34 |
}; |
| 081d847a |
Poul Sander |
2023-07-29 19:59 |
35 |
|
| 081d847a |
Poul Sander |
2023-07-29 19:59 |
36 |
struct BackGroundData { |
| 173b1d55 |
Poul Sander |
2023-09-23 21:29 |
37 |
std::string name = "standard"; |
| 081d847a |
Poul Sander |
2023-07-29 19:59 |
38 |
std::string background_sprite = ""; |
| 081d847a |
Poul Sander |
2023-07-29 19:59 |
39 |
std::string background_sprite_16x9 = ""; |
| 6444412c |
Poul Sander |
2023-07-30 22:07 |
40 |
int tileMoveSpeedX = 0; //Move the tiled background every X milliseconds. 0 disables it. |
| 6444412c |
Poul Sander |
2023-07-30 22:07 |
41 |
int tileMoveSpeedY = 0; //Move the tiled background every X milliseconds. 0 disables it. |
| 081d847a |
Poul Sander |
2023-07-29 19:59 |
42 |
ImgScale background_scale = ImgScale::Stretch; |
| 081d847a |
Poul Sander |
2023-07-29 19:59 |
43 |
}; |
| 081d847a |
Poul Sander |
2023-07-29 19:59 |
44 |
|
| 2660ccea |
Poul Sander |
2023-09-22 19:25 |
45 |
|
| a0c212cb |
Poul Sander |
2023-08-13 16:10 |
46 |
struct DecorationData { |
| a0c212cb |
Poul Sander |
2023-08-13 16:10 |
47 |
std::string name = "smilies"; |
| a0c212cb |
Poul Sander |
2023-08-13 16:10 |
48 |
std::vector<std::string> decoration_sprites = {"smileys0", "smileys1", "smileys2", "smileys3"}; |
| a0c212cb |
Poul Sander |
2023-08-13 16:10 |
49 |
}; |
| a0c212cb |
Poul Sander |
2023-08-13 16:10 |
50 |
|
| aaba4f1e |
Poul Sander |
2023-07-25 13:34 |
51 |
struct Theme { |
| aaba4f1e |
Poul Sander |
2023-07-25 13:34 |
52 |
std::string theme_name = "standard"; |
| aaba4f1e |
Poul Sander |
2023-07-25 13:34 |
53 |
std::string back_board = "back_board"; // Can also be "back_board_sample_snow" or "trans_cover" |
| 173b1d55 |
Poul Sander |
2023-09-23 21:29 |
54 |
BackGroundData background; //Serialized as background.background_name |
| a0c212cb |
Poul Sander |
2023-08-13 16:10 |
55 |
DecorationData decoration; |
| aaba4f1e |
Poul Sander |
2023-07-25 13:34 |
56 |
}; |
| aaba4f1e |
Poul Sander |
2023-07-25 13:34 |
57 |
|
| 2660ccea |
Poul Sander |
2023-09-22 19:25 |
58 |
struct ThemeFileData { |
| 2660ccea |
Poul Sander |
2023-09-22 19:25 |
59 |
std::vector<BackGroundData> background_data; |
| 00759e5a |
Poul Sander |
2023-09-24 20:01 |
60 |
std::vector<DecorationData> decoration_data; |
| 2660ccea |
Poul Sander |
2023-09-22 19:25 |
61 |
std::vector<Theme> themes; |
| 2660ccea |
Poul Sander |
2023-09-22 19:25 |
62 |
}; |
| 2660ccea |
Poul Sander |
2023-09-22 19:25 |
63 |
|
| 66d6174b |
Poul Sander |
2024-01-13 22:45 |
64 |
void ThemesFillMissingFields(Theme& theme); |
| 66d6174b |
Poul Sander |
2024-01-13 22:45 |
65 |
|
| 66d6174b |
Poul Sander |
2024-01-13 22:45 |
66 |
void ThemesAddOrReplace(const Theme& theme); |
| 66d6174b |
Poul Sander |
2024-01-13 22:45 |
67 |
|
| c8e0251f |
Poul Sander |
2024-02-07 21:38 |
68 |
|
| aaba4f1e |
Poul Sander |
2023-07-25 13:34 |
69 |
/** |
| aaba4f1e |
Poul Sander |
2023-07-25 13:34 |
70 |
* @brief returns a theme from a list |
| aaba4f1e |
Poul Sander |
2023-07-25 13:34 |
71 |
* @return A copy of a theme |
| aaba4f1e |
Poul Sander |
2023-07-25 13:34 |
72 |
*/ |
| 51c4029b |
Poul Sander |
2023-11-15 16:11 |
73 |
Theme ThemesGetNext(); |
| 081d847a |
Poul Sander |
2023-07-29 19:59 |
74 |
|
| 081d847a |
Poul Sander |
2023-07-29 19:59 |
75 |
/** |
| 081d847a |
Poul Sander |
2023-07-29 19:59 |
76 |
* @brief getTheme returns a specific theme |
| 081d847a |
Poul Sander |
2023-07-29 19:59 |
77 |
* @param theme_number |
| 7602f86d |
Poul Sander |
2024-01-10 21:39 |
78 |
* @return A reference to the theme. The referance is valid until the next call to a "Themes*" function |
| 081d847a |
Poul Sander |
2023-07-29 19:59 |
79 |
*/ |
| 7602f86d |
Poul Sander |
2024-01-10 21:39 |
80 |
Theme& ThemesGet(size_t theme_number); |
| 68c75938 |
Poul Sander |
2023-11-13 23:03 |
81 |
|
| 68c75938 |
Poul Sander |
2023-11-13 23:03 |
82 |
/** |
| 68c75938 |
Poul Sander |
2023-11-13 23:03 |
83 |
* @brief Saves the themes starting with "custom_slot_" to "custom_themes.json" |
| 68c75938 |
Poul Sander |
2023-11-13 23:03 |
84 |
* |
| 68c75938 |
Poul Sander |
2023-11-13 23:03 |
85 |
*/ |
| 68c75938 |
Poul Sander |
2023-11-13 23:03 |
86 |
void ThemesSaveCustomSlots(); |
| 7602f86d |
Poul Sander |
2024-01-10 21:39 |
87 |
|
| 7602f86d |
Poul Sander |
2024-01-10 21:39 |
88 |
/** |
| 7602f86d |
Poul Sander |
2024-01-10 21:39 |
89 |
* Returns the index of a given file. |
| 7602f86d |
Poul Sander |
2024-01-10 21:39 |
90 |
* Returns 0 if it does not exist or is the standard theme. |
| 7602f86d |
Poul Sander |
2024-01-10 21:39 |
91 |
*/ |
| 7602f86d |
Poul Sander |
2024-01-10 21:39 |
92 |
size_t ThemeGetNumber(const std::string& name); |
| 66d6174b |
Poul Sander |
2024-01-13 22:45 |
93 |
|
| de41f458 |
Poul Sander |
2024-01-29 20:53 |
94 |
BackGroundData ThemesGetNextBackground(const std::string& current); |
| de41f458 |
Poul Sander |
2024-01-29 20:53 |
95 |
|
| 5b5139a9 |
Poul Sander |
2024-02-21 20:32 |
96 |
std::string ThemesGetNextBoardBackground(const std::string& current); |
| 5b5139a9 |
Poul Sander |
2024-02-21 20:32 |
97 |
|
| 5b5139a9 |
Poul Sander |
2024-02-21 20:32 |
98 |
void ThemesInitCustomBackgrounds(); |