|
Page 1 of 1
|
[ 9 posts ] |
|
Author |
Message |
g0rd0ngrfr33mailgr
Joined: 2011-09-27 11:18:31 Posts: 193
|
It's often useful to have an extra chat bar. It took me an afternoon, but I managed to do it! In your automation.lua file, just add a button like so: | | | | Code: SideBarButton(10, "c", "MakeDialog('Lua chat bar', 'Type your text', '', 'Say', 'Shout', 'Whisper', 'SendChat(GetDialogInput(),[[normal]]);DialogClose()', 'SendChat(GetDialogInput(),[[shout]]); DialogClose()', 'SendChat(GetDialogInput(),[[whisper]]);DialogClose()')", "Lua Chat Bar (almost)") | | | | |
|
2023-12-20 23:50:14 |
|
|
RossoAms
Joined: 2023-10-03 14:07:30 Posts: 53
|
| | | | g0rd0ngrfr33mailgr wrote: It's often useful to have an extra chat bar. It took me an afternoon, but I managed to do it! In your automation.lua file, just add a button like so: | | | | Code: SideBarButton(10, "c", "MakeDialog('Lua chat bar', 'Type your text', '', 'Say', 'Shout', 'Whisper', 'SendChat(GetDialogInput(),[[normal]]);DialogClose()', 'SendChat(GetDialogInput(),[[shout]]); DialogClose()', 'SendChat(GetDialogInput(),[[whisper]]);DialogClose()')", "Lua Chat Bar (almost)") | | | | |
| | | | |
Hey nice, thanks!
|
2023-12-21 12:20:09 |
|
|
g0rd0ngrfr33mailgr
Joined: 2011-09-27 11:18:31 Posts: 193
|
A better version, using a custom Lua floater. First, add a "floater_lua_chat2.xml" file to your custom skins directory ("~/.secondlife/skins/default/xui/en-us/" under Linux and "%appdata%\SecondLife\skins\default\xui\en-us\" under Windows) containing the following XUI floater definition: Then modify your automation.lua script in order to contain the following: | | | | Code: function OnLuaFloaterOpen(name, parameter) print("Opened floater: " .. name .. " with parameter: " .. parameter) end
function OnLuaFloaterClose(name, parameter) print("Closed floater: " .. name .. " - Parameter: " .. parameter) end
function OnLuaFloaterAction(name, control, value) print("Floater: " .. name .. " - Control: " .. control .. " - Value: " .. value) if value ~= "" and (string.find(control, "list") or string.find(control, "inventory")) then local values = GetLuaFloaterValues(name, control) local i for i = 1, #values, 1 do print(" --> value #" .. i .. " = " .. values[i]) end end if name == "chat2" and control == "textedit1" then SetLuaFloaterCommand("chat2","button1","SendChat(GetLuaFloaterValue(GetFloaterName(),'textedit1'),[[normal]])") SetLuaFloaterCommand("chat2","button2","SendChat(GetLuaFloaterValue(GetFloaterName(),'textedit1'),[[shout]])") SetLuaFloaterCommand("chat2","button3","SendChat(GetLuaFloaterValue(GetFloaterName(),'textedit1'),[[whisper]])") end end
| | | | |
Also, add/modify a button in the automation.lua script to look like I stole Henri's custom floater and kept only the relevant bits, and I hope I did them well. Texts starting with "/" are sent as plain text (i.e. one can't send gestures with that) and I don't know why, but, compared to the previous version, the length of the chat is much larger (1023 characters, as many as the viewer's proper chat bar). If anyone can make this better, feel free to tell me how Thanks, Henri, for Lua!
|
2024-01-16 19:18:27 |
|
|
RossoAms
Joined: 2023-10-03 14:07:30 Posts: 53
|
Nice revision! My skins however, using Linux, are in $INSTALLDIR/skins, not in any dot-directory in $HOME.
|
2024-01-17 10:13:48 |
|
|
g0rd0ngrfr33mailgr
Joined: 2011-09-27 11:18:31 Posts: 193
|
Yes, true. But you can create a folder ~/.secondlife/skins/default/xui/en-us and put the file there. From what Henri has said, I understand that the viewer looks in both directories for floaters. That one's own contributions should be in their home directory, while the viewer itself, as it comes from upstream, should be at $INSTALLDIR. That way, when a new major version comes and you uninstall the old major version before installing the new major version, or if you want to have both for any reason (say, a stable version and a development version), your own scripts and floaters and whatnot won't be lost or they'll be accessible from both versions.
|
2024-01-17 11:20:41 |
|
|
Henri Beauchamp
Joined: 2009-03-17 18:42:51 Posts: 5759
|
For overrides (modifications of the skin), and additions (such as Lua floaters), you should use the skin override feature, that is install your custom files in the ~/.secondlife/skins/ sub-directory; it ensures that your modifications will stay in force after viewer updates and upgrades, or reinstallation from scratch...
|
2024-01-17 11:30:23 |
|
|
RossoAms
Joined: 2023-10-03 14:07:30 Posts: 53
|
Can I just create it in ~/.cool_vl then, as I start the viewer after export SECONDLIFE_USER_DIR="/home/mich/.cool_vl"? Creating a ~/.secondlife directory while there is no current Unix version of that viewer just feels odd.
|
2024-01-17 11:44:59 |
|
|
Henri Beauchamp
Joined: 2009-03-17 18:42:51 Posts: 5759
|
Yes, the SECONDLIFE_USER_DIR environment variable override is accounted for in the cool_vl_viewer wrapper script.
|
2024-01-17 13:08:43 |
|
|
RossoAms
Joined: 2023-10-03 14:07:30 Posts: 53
|
Okay thanks for the explanation.
|
2024-01-17 13:14:45 |
|
|
|
Page 1 of 1
|
[ 9 posts ] |
|
Who is online |
Users browsing this forum: No registered users and 1 guest |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum
|
|