summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerinventory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llviewerinventory.cpp')
-rw-r--r--indra/newview/llviewerinventory.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp
index efa3f5cd1e..53d87e2869 100644
--- a/indra/newview/llviewerinventory.cpp
+++ b/indra/newview/llviewerinventory.cpp
@@ -72,6 +72,7 @@
#include "llhttpretrypolicy.h"
#include "llsettingsvo.h"
#include "llinventorylistener.h"
+#include "llviewerassetupload.h"
LLInventoryListener sInventoryListener;
@@ -1715,6 +1716,7 @@ void create_new_item(const std::string& name,
std::function<void(const LLUUID&)> created_cb = nullptr)
{
std::string desc;
+ U8 subtype = NO_INV_SUBTYPE;
LLViewerAssetType::generateDescriptionFor(asset_type, desc);
next_owner_perm = (next_owner_perm) ? next_owner_perm : PERM_MOVE | PERM_TRANSFER;
@@ -1726,6 +1728,20 @@ void create_new_item(const std::string& name,
{
cb = new LLBoostFuncInventoryCallback(create_script_cb);
next_owner_perm = LLFloaterPerms::getNextOwnerPerms("Scripts");
+
+ LLViewerRegion* region = gAgent.getRegion();
+ if (region && region->simulatorFeaturesReceived())
+ {
+ // *TODO* Setting the subtype for the script will cause the server to select
+ // either the LSL or Lua default script. We should perhaps allow the user to
+ // select which type of script they want to create.
+ LLSD simulatorFeatures;
+ region->getSimulatorFeatures(simulatorFeatures);
+ if (simulatorFeatures["LuaScriptsEnabled"].asBoolean())
+ {
+ subtype = SST_LUA;
+ }
+ }
break;
}
@@ -1768,7 +1784,7 @@ void create_new_item(const std::string& name,
desc,
asset_type,
inv_type,
- NO_INV_SUBTYPE,
+ subtype,
next_owner_perm,
cb);
}