Starfinder Playlist
Page 1 of 2 12 Last
  1. #1

    Handler to pick up URL clicks

    Is it possible to have a handler that reacts when a URL is clicked? In the code, it seems that the way a URL is triggered is using an Interface.openWindow("url", "https://blah") call, but when when I register an onWindowOpened handler, these dont trigger. I assume because they are not opening windows within FG, but triggering something outside. Is there a way to set up a handler that will pick up when the URL is opened and allow modifications to it before triggering?

    Reason:
    Syrinscape Online uses URL links to trigger its online player, but it requires a unique authentication code to be included in the URL. This means I can make a module of soundlinks for just me, but it wouldnt work for anyone else. I am building an extension with the goal of being able to take a URL being triggered, checking if its a syrinscape online URL, and appending the authentication code. This would then make it possible to design a generic module with all the syrinscape online links and the auth code would be stored in the DB.

    The other alternative I've thought of is to test for the Syrinscape Online module being loaded, then having it go through the db and rewrite all the links. This would require upfront processing, but would only need to be done once.
    For support with any of my extensions, visit my #mattekure-stuff channel on Rob2e's discord https://discord.gg/rob2e

  2. #2
    hmm, my first idea doesnt seem like it will work, and my second idea may also not be possible. I've figured out how to get the text from the module entries, but I cant get the actual url values contained within the link tag, it just returns the text of the name.
    For support with any of my extensions, visit my #mattekure-stuff channel on Rob2e's discord https://discord.gg/rob2e

  3. #3
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,362
    Based off your posts in the Syrinscape module thread it sounds like you got this working?
    Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!

  4. #4
    Sort of. I'm still learning my way around the code, but I am making progress. Its certainly making me think through the issues in different ways as I learn what is and isnt possible to do.
    For support with any of my extensions, visit my #mattekure-stuff channel on Rob2e's discord https://discord.gg/rob2e

  5. #5
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,362
    Quote Originally Posted by mattekure View Post
    ...but I cant get the actual url values contained within the link tag, it just returns the text of the name.
    How are you trying to do this? At the database level or within text?
    Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!

  6. #6
    My attempts to get the URL were at the module DB level. I have a module with all of the links stored in story entries using the <link class="url" recordname="actual URL I need">Name of sound linked</link>. When I drill down through the DB nodes, I can get access to the final formatted text node, but any attempt to get at the info within just returns the text of the Name of the sounds. getValue and getText dont return the xml, they just return the actual text. But what I need access to is the contents of the recordname within the link tag.

    This type of link works fine for the older syrinscape players as they will trigger when the link is clicked. But this doesnt work for the newer Syrinscape Online player because each URI has to have a unique authentication code appended. Its easy enough to make a module for myself with the authentication code included, but making it so others can use it requires me to manipulate the URI so that it contains the authentication code when triggered.

    So my process that sort of works is to not include the data within the module as story entries. Instead, I crafted my own xml structure within the modules db.xml which I can access programatically with the values stored as strings. Then I can append the authentication code, and generate a clickable trigger.
    For support with any of my extensions, visit my #mattekure-stuff channel on Rob2e's discord https://discord.gg/rob2e

  7. #7
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,362
    Quote Originally Posted by mattekure View Post
    getValue and getText dont return the xml, they just return the actual text. But what I need access to is the contents of the recordname within the link tag.
    Something MW put me onto recently - have you tried something like the following: sClassName, sRecordName = DB.getValue(dbnode, "link", "", ""); or sClassName, sRecordName = DB.getValue(dbnode, "shortcut", "", "");
    Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!

  8. #8
    neither of those return anything. I think its because the <text type=formattedtext"> is the final node in that path. It has no children nodes. Instead, its value contains multiple linklists and links, but they are not uniquely identified.
    For support with any of my extensions, visit my #mattekure-stuff channel on Rob2e's discord https://discord.gg/rob2e

  9. #9
    Ooh, Celestian got me straightened out on getting the raw xml from the formatted text. now I can see about my original idea.
    For support with any of my extensions, visit my #mattekure-stuff channel on Rob2e's discord https://discord.gg/rob2e

  10. #10
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,362
    Quote Originally Posted by mattekure View Post
    Ooh, Celestian got me straightened out on getting the raw xml from the formatted text.
    How did he do it?
    Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
DICE PACKS BUNDLE

Log in

Log in