Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Suggestion: Add Images To #RLV Folder Browser #1032

Open
PerfidiaHancroft opened this issue Mar 31, 2024 · 2 comments
Open

Feature Suggestion: Add Images To #RLV Folder Browser #1032

PerfidiaHancroft opened this issue Mar 31, 2024 · 2 comments

Comments

@PerfidiaHancroft
Copy link

PerfidiaHancroft commented Mar 31, 2024

I was trying to navigate someone's #RLV folder and they... Well, they did not do a great job setting it up. As I was trying to figure out just what the heck some of these things were I lamented "oh if only there were a picture". Then I thought "hey, why isn't there a picture?"

So that's my suggestion. 'Kay, thanks, bye!

What? What do you mean "How"?

Well, If one were to create a folder inside the desired #RLV folder - something like this:

#RLV
  Restraints
    Binders
      +DHB Latex 05
         img:d0e2d55b-c4d7-3768-a633-0840c25ddc27  (that's the UUID of the image for the item in this folder)

Adding a new sub-folder named img:uuid where img is simply a tag to let the script know what we're doing, and uuid is the key of the texture to be displayed.

Then add a much fancier and more streamlined version of something like this to the item level of the #RLV folder browser:

    listen(integer ch, string name, key id, string msg)
    {
        list tmpList = llParseString2List(msg, ":");
        if(llList2String(tmpList, 0) == "img")
        {
            string image = (string)llList2Key(tmpList, 1);
            string addThisToTheFolderPopup = "\n\n\t\t\t\[http://secondlife.com/app/image/" + image + "/2 Click for a preview";
	    llDialog(userKey, dialogText + addThisToTheFolderPopup, dialogButtons, dialogChannel);
        }        
    }

Which will give you something like this - https://i.imgur.com/cmTmalB.png - which does indeed let the menu user click the link and see the image as a web page.

It would be necessary to have the script not display the img: uuid either in the llDialog text or as a button, else you get this - https://i.imgur.com/ldMzeLw.png

And of course this will still require effort on the collar wearer's part, but I was able to make it work - independently of the collar of course cause I just ain't that smart :) - so I feel like it's technically within the realms of possibility.

If it's of any help - and everyone promises not to laugh at it :) - here's the lame test code I threw together to test this:

default
{
    state_entry()
    {
        llListen(1, "", llGetOwner(), "");
    }

    listen(integer ch, string name, key id, string msg)
    {
        list tmpList = llParseString2List(msg, [":"],[""]);
        if(llList2String(tmpList, 0) == "img")
        {
            string image = (string)llList2Key(tmpList, 1);

            string popup = "\n\n[Folder Browser]\n\n" +
            "Legend:\n" +
            "▢ = Nothing in the folder is worn, or any subfolders\n" +
            "▣ = All items in either this folder or its subfolder are worn\n" +
            "◑ = Some items are worn in this folder, or its subfolders\n\n" +
            "Currently browsing path: ◑ /Restraints/Binders/+DHB Latex 05\n\n\t\t\t\t" +
            "[http://secondlife.com/app/image/" + image + "/2 Preview]";    
// the trailing 2 after the UUID specifies an image size of 320x240
// see https://community.secondlife.com/forums/topic/75880-i-need-to-http-get-textures-to-my-web-server/#comment-729264
// for more information.

            llDialog(llGetOwner(), popup, ["- Rem Items", "^ UP", "Locks", " ", " ", "+ Add Items"], 0);
        }        
    }
    
    touch_start(integer total_number)
    {   // I cheated and just hardcoded the folder name manually rather 
        // than write all the code needed to do it for real :)
        llOwnerSay("@getinv:Restraints/Binders/+DHB Latex 05=1");   
    }
}

I just dropped that in a prim and away it went. Of course if you - for some reason - use my script above, you'll need to match the folder structure in your #RLV folder to make it work or modify the path in the @getinv command to match your setup.

Thanks for everything you guys do to make my Second Life more difficult - yes, from me that IS a compliment :)

@Medea-Destiny
Copy link
Collaborator

Hey Perfidia, this is a nice idea, though the setup would be a hassle. Given we now have folder images in SL, the better option would be if we had an RLV command to fetch those, along the lines @folderimage:(path)=(channel). I don't know if that's something Marine and/or Kitty plan to introduce for RLV/RLVa, but perhaps we should be encouraging them to do so.

@PerfidiaHancroft
Copy link
Author

That would be great if it's possible. I think that's part of what prompted me to think about it, I'm just far too low on the "make computers do things" scale to have a smidgeon of a clue how to do it, but am just barely - let's say "clever enough" for lack of a more accurate term - to figure out a way to do it using LSL.

Setup would indeed be a problem. In the back of my head I was thinking a tool that the collar user would drop an image into, then it creates a folder named "img:textureUUID" that the user could simply move to the appropriate #RLV sub folder. Lacks elegance, but so do I :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants