FG Spreadshirt Swag
Page 2 of 2 First 12
  1. #11
    Quote Originally Posted by S Ferguson View Post
    What would the handler function look like in it's barest possible form? For some reason I'm drawing a blank on how to implement the DB.isReadOnly() command into my inline script.

    Regards,
    SF

    The code I have so far is:

    function onInit()
    update();
    onLockChanged()
    DB.addHandler(DB.getPath(getDatabaseNode(), "locked"), "onUpdate", onLockChanged);
    end

    function onClose()
    DB.removeHandler(DB.getPath(getDatabaseNode(), "locked"), "onUpdate", onLockChanged);
    end

    function onLockChanged()

    if npc_notes then
    npc_notes.update();
    end
    ...
    end

    The update function just does some bookkeeping. I'm working with NPC Notes in this particular example.
    The line you want is:
    Code:
    local bReadOnly = WindowManager.getReadOnlyState(getDatabaseNode());
    and then use the bReadOnly variable. Looking at your code it should probably go into the onLockChanged() function. Then you could have something like:
    Code:
    tab.setReadOnly(bReadOnly);
    for each tab.

    Cheers
    Dulux-Oz

    √(-1) 2^3 Σ Π
    ...And it was Delicious!


    Alpha-Geek
    ICT Professional
    GMing Since 1982
    NSW, Australia, UTC +10
    LinkedIn Profile: www.linkedin.com/in/mjblack

    Watch our games on Twitch: www.twitch.tv/dulux_oz

    Support Me on Patreon: www.patreon.com/duluxoz

    Past Games, etc, on my YouTube Channel: www.youtube.com/c/duluxoz

  2. #12
    Much obliged.

    Regards,
    SF
    Aliens.... Go fig?

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