Difference between revisions of "LlOpenFloater"

From Second Life Wiki
Jump to navigation Jump to search
m
m (Reverted edits by Panterapolnocy Resident (talk) to last revision by Rider Linden)
Line 13: Line 13:
|func_footnote=This function requires a privileged experience.
|func_footnote=This function requires a privileged experience.
|spec=
|spec=
The llOpenFloater function will send a request to the viewer requesting that it open a new floater with the provided title on the viewer.  This function must be called from a script running within an attachment.  The script must also have been compiled as part of an '''PRIVILEGED''' experience.  
The llOpenFloater function will send a request to the viewer requesting that it open a new floater with the provided title on the viewer.  This function must be called from a script running within an attachment.  The script must also have been compiled as part of an PRIVILEGED experience.  


If the request was successfully sent to the viewer this function will return 0.
If the request was successfully sent to the viewer this function will return 0.
Line 42: Line 42:
{{!}}}
{{!}}}
|caveats
|caveats
|examples=<source lang="lsl2">string gTitle = "Second Life Wiki: Recent Changes";
|examples
string gUrl = "https://wiki.secondlife.com/wiki/Special:RecentChanges";
list gParams = [];
 
default
{
    touch_start(integer total_number)
    {
        key person = llDetectedKey(0);
        if (llGetAttached())
        {
            llSay(0, "Touched by " + llKey2Name(person));
            llRequestExperiencePermissions(person, "");
        }
        else
        {
            llInstantMessage(person, "This function must be called from a script running within an attachment");
        }
    }
 
    experience_permissions(key agent_id)
    {
        string returnMessage;
        integer errorTest = llOpenFloater(gTitle, gUrl, gParams);
        if (errorTest == 0)
        {
            returnMessage += "Opening floater '" + gTitle + "'...";
        }
        else
        {
            returnMessage = "Opening floater failed: ";
            if (errorTest == NOT_EXPERIENCE)
            {
                returnMessage += "The script is not complied as part of an experience, or the experience is not privileged.";
            }
            else if (errorTest == NOT_ATTACHMENT)
            {
                returnMessage += "There was an issue finding the object, or the object is not an attachment.";
            }
            else if (errorTest == BAD_AGENT)
            {
                returnMessage += "There was an issue finding the owner.";
            }
            else if (errorTest == NOT_EXPERIENCE_PERMISSIONS)
            {
                returnMessage += "There was some other issue with the experience permissions.";
            }
            else
            {
                returnMessage += "Reason id: " + (string)errorTest;
            }
        }
        llSay(0, returnMessage);
    }
 
    experience_permissions_denied(key agent_id, integer reason)
    {
        llSay(0, "Experience permissions denied for " + llKey2Name(agent_id) + ": " + llGetExperienceErrorMessage(reason));
    }
}</source>
|spec
|spec
|helpers
|helpers

Revision as of 14:29, 11 May 2021

Summary

Function: integer llOpenFloater( string title, string url, list params );

Returns an integer Error code, or 0 if no error.

• string title Title for floater window
• string url URL to open in window
• list params Options to apply to floater

This function requires a privileged experience.

Specification

The llOpenFloater function will send a request to the viewer requesting that it open a new floater with the provided title on the viewer. This function must be called from a script running within an attachment. The script must also have been compiled as part of an PRIVILEGED experience.

If the request was successfully sent to the viewer this function will return 0.

In the event of an error the return value will be one of the values from the following table:

Constant Val Description
NOT_EXPERIENCE -1 The script is not complied as part of an experience, or the experience is not privileged.
NOT_ATTACHMENT -2 There was an issue finding the object, or the object is not an attachment.
BAD_AGENT -3 There was an issue finding the owner.
NOT_EXPERIENCE_PERMISSIONS -4 There was some other issue with the experience permissions.

Examples

Deep Notes

Search JIRA for related Issues

Signature

function integer llOpenFloater( string title, string url, list params );