summaryrefslogtreecommitdiff
path: root/indra/newview/llmaterialeditor.cpp
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2024-11-26 12:05:25 +0800
committerErik Kundiman <erik@megapahit.org>2024-11-26 12:05:25 +0800
commita40795bd6ffcfff71bead4869d79cf5a73d5a7af (patch)
tree6c4c1fbb421f737c0b62fcda51ca7ca0ce8294f4 /indra/newview/llmaterialeditor.cpp
parent30842e230e2b3d365e8415f0350f8d10ce8b0637 (diff)
parentd65fb7cec8ce36ce7f6ff082f8d04bdd8bc0208c (diff)
Merge remote-tracking branch 'secondlife/release/2024.09-ExtraFPS' into 2024.09-ExtraFPS
Diffstat (limited to 'indra/newview/llmaterialeditor.cpp')
-rw-r--r--indra/newview/llmaterialeditor.cpp22
1 files changed, 13 insertions, 9 deletions
diff --git a/indra/newview/llmaterialeditor.cpp b/indra/newview/llmaterialeditor.cpp
index dde238eddb..1e3a328464 100644
--- a/indra/newview/llmaterialeditor.cpp
+++ b/indra/newview/llmaterialeditor.cpp
@@ -1976,21 +1976,21 @@ void LLMaterialEditor::loadMaterialFromFile(const std::string& filename, S32 ind
return;
}
- LLMaterialEditor* me = (LLMaterialEditor*)LLFloaterReg::getInstance("material_editor");
-
if (index >= 0)
{
// Prespecified material
+ LLMaterialEditor* me = (LLMaterialEditor*)LLFloaterReg::getInstance("material_editor");
me->loadMaterial(model_in, filename, index);
}
else if (model_in.materials.size() == 1)
{
- // Only one, just load it
+ // Only one material, just load it
+ LLMaterialEditor* me = (LLMaterialEditor*)LLFloaterReg::getInstance("material_editor");
me->loadMaterial(model_in, filename, 0);
}
else
{
- // Promt user to select material
+ // Multiple materials, Promt user to select material
std::list<std::string> material_list;
std::vector<tinygltf::Material>::const_iterator mat_iter = model_in.materials.begin();
std::vector<tinygltf::Material>::const_iterator mat_end = model_in.materials.end();
@@ -2008,15 +2008,19 @@ void LLMaterialEditor::loadMaterialFromFile(const std::string& filename, S32 ind
}
}
- material_list.push_back(me->getString("material_batch_import_text"));
+ material_list.push_back(LLTrans::getString("material_batch_import_text"));
LLFloaterComboOptions::showUI(
- [me, model_in, filename](const std::string& option, S32 index)
+ [model_in, filename](const std::string& option, S32 index)
{
- me->loadMaterial(model_in, filename, index);
+ if (index >= 0) // -1 on cancel
+ {
+ LLMaterialEditor* me = (LLMaterialEditor*)LLFloaterReg::getInstance("material_editor");
+ me->loadMaterial(model_in, filename, index);
+ }
},
- me->getString("material_selection_title"),
- me->getString("material_selection_text"),
+ LLTrans::getString("material_selection_title"),
+ LLTrans::getString("material_selection_text"),
material_list
);
}