From ad1f5ac8906316f8e90355a4ebdbf33400758080 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Tue, 19 Mar 2024 15:32:47 +0200 Subject: search xml file in the lib, if path is not full; add test lua floater scripts --- indra/llui/llluafloater.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llluafloater.cpp b/indra/llui/llluafloater.cpp index 36dd0d58bd..27ae85c844 100644 --- a/indra/llui/llluafloater.cpp +++ b/indra/llui/llluafloater.cpp @@ -254,9 +254,15 @@ void LLLuaFloater::post(const LLSD &data) void LLLuaFloater::showLuaFloater(const LLSD &data) { std::filesystem::path fs_path(data["xml_path"].asString()); - + std::string path = fs_path.lexically_normal().string(); + if (!fs_path.is_absolute()) + { + std::string lib_path = gDirUtilp->getExpandedFilename(LL_PATH_SCRIPTS, "lua"); + path = (std::filesystem::path(lib_path) / path).u8string(); + } + LLLuaFloater *floater = new LLLuaFloater(data); - floater->buildFromFile(fs_path.lexically_normal().string()); + floater->buildFromFile(path); floater->openFloater(floater->getKey()); } -- cgit v1.2.3