summaryrefslogtreecommitdiff
path: root/indra/newview/llluamanager.cpp
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2023-09-14 21:21:03 +0100
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2023-09-14 21:21:03 +0100
commita870b767337d0f9c54953189f99a77ca06d634a4 (patch)
treef053c5b9ef8583f8778ae0d7f4aa6713d29d9db0 /indra/newview/llluamanager.cpp
parent110e442bc335b88fc3e52ea83f52cb46514dd0a7 (diff)
DRTVWR-589 - lua support parameter to UI commands
Diffstat (limited to 'indra/newview/llluamanager.cpp')
-rw-r--r--indra/newview/llluamanager.cpp19
1 files changed, 16 insertions, 3 deletions
diff --git a/indra/newview/llluamanager.cpp b/indra/newview/llluamanager.cpp
index 7045379964..1a1732aa5e 100644
--- a/indra/newview/llluamanager.cpp
+++ b/indra/newview/llluamanager.cpp
@@ -169,11 +169,24 @@ int lua_env_setting_event(lua_State *L)
int lua_run_ui_command(lua_State *L)
{
- std::string func_name = lua_tostring(L,1);
- LL_WARNS("LUA") << "running ui func " << func_name << LL_ENDL;
+ int top = lua_gettop(L);
+ std::string func_name;
+ if (top >= 1)
+ {
+ func_name = lua_tostring(L,1);
+ }
+ std::string parameter;
+ if (top >= 2)
+ {
+ parameter = lua_tostring(L,2);
+ }
+ LL_WARNS("LUA") << "running ui func " << func_name << " parameter " << parameter << LL_ENDL;
LLSD event;
event["function"] = func_name;
- event["parameter"] = LLSD();
+ if (!parameter.empty())
+ {
+ event["parameter"] = parameter;
+ }
sUIListener.call(event);
return 1;