Lua scripting related requests
Author |
Message |
ZaneZimer
Joined: 2016-06-19 21:33:37 Posts: 384 Location: Columbus area, OH, USA
|
Would it be possible to have more than 12 SideBarButtons?
|
2017-03-29 13:35:16 |
|
 |
Henri Beauchamp
Joined: 2009-03-17 18:42:51 Posts: 5912
|
Actually, the current code may already deal with up to 20 buttons... All you have to do is copy the skins/default/xui/en-us/panel_lua_sidebar.xml file into a skins/default/xui/en-us/ subdirectory of the viewers data storage (~/.secondlife/ directory under Linux, some SecondLife directory in the program data path for Windows, etc) and edit it to add more buttons to it... The edited file will override the viewer's bundled one (and since "panel_lua_sidebar.xml" does not exist in other v1 viewers, this won't be a problem for them; v2+ viewers use "en" instead of "en-us", so it won't be an issue at all either, for any XUI file override you could put inside skins/default/xui/en-us/). Here is the file for the full 20 buttons: You can easily adapt it, by removing the buttons you don't want (remove the higher numbers first, since the code would stop looking for buttons as soon as one is missing in the series from "btn1" to "btn20").
|
2017-03-29 15:20:42 |
|
 |
ZaneZimer
Joined: 2016-06-19 21:33:37 Posts: 384 Location: Columbus area, OH, USA
|
Awesome. I'll give it a try later on today and post my results. 
|
2017-03-29 16:01:43 |
|
 |
ZaneZimer
Joined: 2016-06-19 21:33:37 Posts: 384 Location: Columbus area, OH, USA
|
It works as you described with one small 'tweak'. The panel needs to have its height adjusted: It appears each button is 28 + 2 pixels, so 20 buttons requires a height of 600. If this height is not adjusted some buttons are not 'clickable', as the panel is too small for them even though they are visible.
|
2017-03-29 17:44:20 |
|
 |
Henri Beauchamp
Joined: 2009-03-17 18:42:51 Posts: 5912
|
Correct. And fixed/edited in my former post. Also, obviously using that many buttons present the risk that some of them will go out of the screen area, if the viewer window is shrank down too much.
|
2017-03-29 19:14:58 |
|
 |
ZaneZimer
Joined: 2016-06-19 21:33:37 Posts: 384 Location: Columbus area, OH, USA
|
Yes, I have considered that. As with any such customization, I consider them at 'the user's own risk'. 
|
2017-03-30 13:49:38 |
|
 |
ZaneZimer
Joined: 2016-06-19 21:33:37 Posts: 384 Location: Columbus area, OH, USA
|
The OnAgentPush() supplies the 'pusher_id' and the new IsAvatar() and isObject() methods will presumably operate on that to determine what the id represents. Is there any way to determine a name or some info about the avatar or object causing the push? I have yet to encounter a push since coding up my 'alert' but it says something like 'A push from an <avatar|object> of <type> with <magnitude> was detected'. I was thinking it would be nice to have the name of said 'offender'. I think I can use a SLURL for the avatar but I don't think there is a corresponding 'path' for object.
|
2017-04-06 22:41:36 |
|
 |
Henri Beauchamp
Joined: 2009-03-17 18:42:51 Posts: 5912
|
'pusher_id' is always an avatar name (the pusher itself or the owner of the object doing the push). I will add an avatar name (and a group name) resolver function, however such a resolving is asynchronous (when the avatar or group name is not yet cached by the viewer), so the function may return an empty string and would have to be retried (e.g. with CallbackAfter()) to get the name... As for object names, there is no caching scheme implemented in the viewer and here again, it would require an asynchronous operation. Not sure it's worth it...
|
2017-04-06 23:32:13 |
|
 |
ZaneZimer
Joined: 2016-06-19 21:33:37 Posts: 384 Location: Columbus area, OH, USA
|
Ah, I had not realized this. You should only add them if you feel they are useful. Since I didn't quite understand how the event callback worked, I made assumptions. I can certainly just construct a SLURL out of the id prior to my 'print'. That will get me what I want, I think.
|
2017-04-07 02:54:04 |
|
 |
ZaneZimer
Joined: 2016-06-19 21:33:37 Posts: 384 Location: Columbus area, OH, USA
|
I haven't isolated a pattern yet, but there might be something wrong with the new Lua pie menu functionality. First, when I stop the automation script the pie menu doesn't always revert to default. I was trying to use pie menu type 4, slice 1 to add a simple, clickable SendChat() greeting. Second, sometimes stopping or loading a new script causes the viewer to crash. I will try to provide more details as I learn them. In OnLogin(), I have:
|
2017-04-09 19:31:41 |
|
|
Who is online |
Users browsing this forum: No registered users and 110 guests |
|
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
|
|