mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-16 18:12:10 +00:00
NEW: Official filament color selection approved
- Add a filament picker dialog for official color selection - Enable displaying multiple filament colors in the picker dialog and preview sidebar - Introduce two new config options: - `filament_multi_colors` - `filament_color_types` to both the application config and the 3MF config jira: STUDIO-12346 Change-Id: I66f8c1ec9147df4f5948c8a329c1737551280e63 (cherry picked from commit 522dc0bbca49033a1ba9725ca7f6c3ea729691a6)
This commit is contained in:
@@ -683,8 +683,11 @@ std::string AppConfig::load()
|
||||
m_filament_presets = iter.value().get<std::vector<std::string>>();
|
||||
} else if (iter.key() == "filament_colors") {
|
||||
m_filament_colors = iter.value().get<std::vector<std::string>>();
|
||||
}
|
||||
else {
|
||||
} else if(iter.key() == "filament_multi_colors") {
|
||||
m_filament_multi_colors = iter.value().get<std::vector<std::string>>();
|
||||
} else if(iter.key() == "filament_color_types") {
|
||||
m_filament_color_types = iter.value().get<std::vector<std::string>>();
|
||||
} else {
|
||||
if (iter.value().is_string())
|
||||
m_storage[it.key()][iter.key()] = iter.value().get<std::string>();
|
||||
else {
|
||||
@@ -768,6 +771,13 @@ void AppConfig::save()
|
||||
for (const auto &filament_color : m_filament_colors) {
|
||||
j["app"]["filament_colors"].push_back(filament_color);
|
||||
}
|
||||
for (const auto &filament_multi_color : m_filament_multi_colors) {
|
||||
j["app"]["filament_multi_colors"].push_back(filament_multi_color);
|
||||
}
|
||||
|
||||
for (const auto &filament_color_type : m_filament_color_types) {
|
||||
j["app"]["filament_color_types"].push_back(filament_color_type);
|
||||
}
|
||||
|
||||
for (const auto &cali_info : m_printer_cali_infos) {
|
||||
json cali_json;
|
||||
@@ -803,7 +813,7 @@ void AppConfig::save()
|
||||
} else if (category.first == "presets") {
|
||||
json j_filament_array;
|
||||
for(const auto& kvp : category.second) {
|
||||
if (boost::starts_with(kvp.first, "filament") && kvp.first != "filament_colors") {
|
||||
if (boost::starts_with(kvp.first, "filament") && kvp.first != "filament_colors" && kvp.first != "filament_multi_colors" && kvp.first != "filament_color_types") {
|
||||
j_filament_array.push_back(kvp.second);
|
||||
} else {
|
||||
j[category.first][kvp.first] = kvp.second;
|
||||
|
||||
Reference in New Issue
Block a user