-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGUIManifest.cpp
44 lines (37 loc) · 1.22 KB
/
GUIManifest.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include "GUIManifest.h"
#include "ResourceManager.h"
namespace Mio {
void GUIManifest::Save() {
ResourceManager::SaveManifest(shared_from_this());
}
void GUIManifest::RemoveUI(const std::string&name) {
ResourceManager::RemoveUI(shared_from_this(), name);
for (auto&it: sManager) {
it->RemoveUIElement(name);
}
}
void GUIManifest::RemoveUI(const UUid&uid) {
ResourceManager::RemoveUI(shared_from_this(), uid);
for (auto&it: sManager) {
it->RemoveUIElement(uid);
}
}
void GUIManifest::TryRemoveManager(const std::string&name) {
for (auto it = sManager.begin(); it != sManager.end(); ++it) {
if ((*it)->cName == name) {
sManager.erase(it);
return;
}
}
}
void GUIManifest::TryAddManager(const std::shared_ptr<UIManager>&manager) {
if (std::find(sManager.begin(), sManager.end(), manager) == sManager.end()) {
sManager.push_back(manager);
}
}
GUIManifest::GUIManifest() = default;
GUIManifest::GUIManifest(const std::string&name, const std::string&dir) {
sName = name;
SavePath = dir + "/" + sName;
}
}