Activated texture layers can be set from mod file.

This commit is contained in:
Kalle Bladin
2016-06-14 14:00:21 -04:00
parent 88555a1e1b
commit 627b8e635b
3 changed files with 21 additions and 9 deletions
@@ -146,7 +146,7 @@ namespace openspace {
std::vector<properties::BoolProperty>& dest)
{
for (size_t i = 0; i < tileProviders.size(); i++) {
bool enabled = i == 0; // Only enable first layer
bool enabled = tileProviders[i].isActive;
std::string name = tileProviders[i].name;
dest.push_back(properties::BoolProperty(name, name, enabled));
}
@@ -90,15 +90,17 @@ namespace openspace {
// Create TileProviders for all textures within this category
for (size_t i = 0; i < texturesDict.size(); i++) {
std::string name, path;
// Default to enabled = true on case it's not defined in the dictionary
bool enabled = true;
std::string dictKey = std::to_string(i + 1);
ghoul::Dictionary texDict = texturesDict.value<ghoul::Dictionary>(dictKey);
texDict.getValue("Name", name);
texDict.getValue("FilePath", path);
texDict.getValue("Enabled", enabled);
std::shared_ptr<TileProvider> tileProvider = initProvider(path, initData);
bool enabled = dest.size() == 0; // Only enable first layer
//bool enabled = dest.size() == 0; // Only enable first layer
dest.push_back({ name, tileProvider, enabled });
}
}