diff options
| author | Andrey Lihatskiy <alihatskiy@productengine.com> | 2026-04-01 19:50:33 +0300 |
|---|---|---|
| committer | Andrey Lihatskiy <alihatskiy@productengine.com> | 2026-04-01 19:50:33 +0300 |
| commit | f5908eddc683dd705d334c88377139e39bbfb54f (patch) | |
| tree | 75c0ff026fe13c0a507a4527b697aa212736998d /indra/newview/llviewerinventory.cpp | |
| parent | d045f9aa32789a35628aced166145c182751acbf (diff) | |
| parent | f209affdfdf271098843ba400d7a75b00f827233 (diff) | |
Merge branch 'project/lua_editor' into marchcat/devlinux-slua
# Conflicts:
# indra/llcommon/llstl.h
# indra/newview/app_settings/settings.xml
Diffstat (limited to 'indra/newview/llviewerinventory.cpp')
| -rw-r--r-- | indra/newview/llviewerinventory.cpp | 18 |
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); } |
