Cool VL Viewer forum

View unanswered posts | View active topics It is currently 2025-06-17 15:23:23



Reply to topic  [ 1 post ] 
Group notifications manager 
Author Message

Joined: 2011-09-27 11:18:31
Posts: 241
Reply with quote
It's 90% Henri's work and 10% mine, lol, since he helped all the way, but here it is:
Image

All group notifications are not shown in the top-right corner, but instead feed the scroll list in the floater, which opens automatically to show them. By clicking on a line and the first button "show", the notification is printed in local chat and also in a Lua notification box (green) in the top-right. The second button "Clear" clears the scroll list entirely.

First, we make the floater ~/.secondlife/cvlv-skins/default/xui/en-us/floater_lua_gnm.xml:
Code:
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<floater name="lua_floater_gnm" title="Group Notifications Manager"
 can_close="true" can_drag_on_left="false" can_minimize="true" can_resize="true" width="650" height="340" min_width="700" min_height="250">
    <scroll_list name="list1" multi_select="true" background_visible="true" draw_border="true" draw_stripes="true" draw_heading="true" left="12" right="-12" width="700" top="-20" bottom="20" height="180" follows="left|top|right">
        <column name="col0" label="Group name" width="70" />
        <column name="col1" label="Time" width="56" />
        <column name="col2" label="Sender" width="70" />
        <column name="col3" label="Subject" width="100" />
        <column name="col4" label="Message" dynamicwidth="true" />
        <column name="col5" label="Inventory" width="20" />
    </scroll_list>
        <button name="button1" label="Show" font="SansSerif" left="12" bottom="0" width="42" height="20" follows="bottom|right" />
        <button name="button2" label="Clear" font="SansSerif" left_delta="56" bottom_delta="0" width="42" height="20" follows="bottom|right" />
</floater>


Then in the automation script automation.lua:
Code:
function OnLuaFloaterAction(name, control, value)
if name == "gnm" and control == "button1" then
          local line = GetLuaFloaterListLine("gnm", "list1")
          local message = line.col1 ..", " .. line.col0 ..", " .. line.col2 .. ", " .. line.col3 ..": \n " .. line.col5 .." \n " .. line.col4
          print(message)
          OpenNotification(1,message)
      end
      if name == "gnm" and control == "button2" then SetLuaFloaterValue("gnm", "list1", "") end
end


and
Code:
function OnGroupNotification(group_name, group_id, dialog_id, timestamp, sender, subject, message, inventory)
    local notice
    notice = "<BOLD>" .. group_name .. "|" .. GetTimeStamp(-7,'%H:%M:%S') .. "|" .. sender .. "|" .. "<ITALIC>" .. subject .. "|" .. message .. "|" .. inventory
    OpenLuaFloater("gnm")
    SetLuaFloaterValue("gnm", "list1", notice)
    CancelNotification(dialog_id)
end


2025-04-21 12:22:19
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 1 post ] 

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

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software.