Page 2 of 2 First 12

Thread: Images on Maps

  1. #11

    Join Date
    Jan 2015
    Location
    Grand Rapids, MI
    Posts
    134
    But that would also remove it from the Host and Client correct? I am just trying to hide this from players.

  2. #12
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Denver, Colorado, USA (for a bit)
    Posts
    22,352
    Quote Originally Posted by Tielc View Post
    But that would also remove it from the Host and Client correct? I am just trying to hide this from players.
    See my edit.


    FG Product Development status: Pathfinder Playtest Ruleset and add-ons: In development. Pathfinder Bestiary, Pathfinder Bestiary 2, Pathfinder Bestiary 3 (in store).

    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!

  3. #13

    Join Date
    Jan 2015
    Location
    Grand Rapids, MI
    Posts
    134
    Quote Originally Posted by Trenloe View Post
    Remove the whole section relevant to the token button/class. That is, remove this:

    Code:
    {
    icon="button_tokencase",
    icon_down="button_tokencase_down",
    tooltipres="sidebar_tooltip_token",
    class="tokenbag",
    subdock = true,
    },
    Best to make a copy of the whole "live" entry and rename it "live-player" and remove the above section just from this.

    Then you'll need to modify the buildDesktop() function towards the top of that file (data_desktop,lua) to check for GM or player and use DesktopManager.registerDockShortcuts for either "live" or "player-live". There's a User.isHost() section in that function, so you can modify as needed.
    Okay, sorry to hassle you with this. Is there a way with lua files to do a merge or join like there is with the xml files? I would rather just make a minor modification instead of mass-changing this part of the load process either with a modified onInit().

  4. #14
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Denver, Colorado, USA (for a bit)
    Posts
    22,352
    data_desktop.lua is a global script package defined in base.xml with the script name of Desktop Therefore, you can access functions and variables in that package with Desktop.XXXXX - where XXXXX is a function or variable. You can use the same approach to override functions and variables.

    You could try something like this in an extension:

    Code:
    function onInit()
    
    	if not User.isHost() then
    		Desktop.aCoreDesktopDock = my_aCoreDesktopDock;
    	end
    
    end
    
    my_aCoreDesktopDock = 
    {
    	["local"] =
    	{
    		{
    			icon="button_library",
    			icon_down="button_library_down",
    			tooltipres="sidebar_tooltip_library",
    			class="library",
    			subdock = true,
    		},
    	},
    	["live"] =
    	{
    		{
    			icon="button_library",
    			icon_down="button_library_down",
    			tooltipres="sidebar_tooltip_library",
    			class="library",
    			subdock = true,
    		},
    	},
    };


    FG Product Development status: Pathfinder Playtest Ruleset and add-ons: In development. Pathfinder Bestiary, Pathfinder Bestiary 2, Pathfinder Bestiary 3 (in store).

    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!

  5. #15

    Join Date
    Jan 2015
    Location
    Grand Rapids, MI
    Posts
    134
    Thank you so much for the help! I ran into an issue trying to put the the script into a lua file, not sure what was going on there, kept getting empty file. Either way, I was able to add it to the script of the xml file. I've attached it for reference should anyone come across this later wanting to accomplish the same thing.

    I have the lua file included and commented out the includefile in the xml. Not sure what I was doing wrong there.

    And for reference, the tokens still appear on maps for the players, but the button is gone as desired.
    Attached Files Attached Files

  6. #16
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Denver, Colorado, USA (for a bit)
    Posts
    22,352
    LUA files need to be in a <script> entry in the extension.xml file.

    See here: https://www.fantasygrounds.com/refdoc/script.xcp and also a lot of extensions for examples.


    FG Product Development status: Pathfinder Playtest Ruleset and add-ons: In development. Pathfinder Bestiary, Pathfinder Bestiary 2, Pathfinder Bestiary 3 (in store).

    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)

Posting Permissions

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

Log in

Log in