Page 2 of 2 First 12
  1. #11
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Newcastle, UK (for a bit)
    Posts
    24,608
    Oh - and is the GM removing the link or a player?
    FG Con 16 Fantasy Grounds Online RPG Convention - Friday April 24th to Sunday April 26th, 2020
    Register at www.fg-con.com for all the latest info.

    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!

  2. #12
    dulux-oz's Avatar
    Join Date
    Jan 2012
    Location
    Australia
    Posts
    4,056
    Blog Entries
    14
    Quote Originally Posted by Trenloe View Post
    After using that, if you close and re-open the window has the link gone? I'm wondering if it is a refresh issue.

    Also try removing the link, closing FG and going back in and see if the link is still there?

    I had a recent issue where changing the icon of a button was only refreshing if you closed FG and opened it again. JPG fixed that specific issue in 3.0.3.
    Yup, tired that as well - still a no go

    GM
    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

    Read my FG Blog here.

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

    Support Ongoing Video, Ruleset & Extension Development: via PayPal (Send To: [email protected])

    YouTube Channel/Tutorial Playlists: www.youtube.com/c/duluxoz

  3. #13
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Newcastle, UK (for a bit)
    Posts
    24,608
    In the table entry that Nickademus references the linkfield (resultlink) is hidden if there is no link to it (setVisible(false)) and set to visible if there is link data, this is done via the updateDisplay function. Perhaps you could do something like that? Of course, the main issue here is that there is no obvious link icon to drag a link to.
    Code:
    	<windowclass name="table_result">
    		<margins control="0,0,0,2" />
    		<script>
    			function onInit()
    				registerMenuItem(Interface.getString("table_menu_linkdelete"), "erase", 8);
    				updateDisplay();
    			end
    			
    			function onMenuSelection(selection)
    				if selection == 8 then
    					resultlink.setValue();
    				end
    			end
    			
    			function updateDisplay()
    				local bLink = not resultlink.isEmpty();
    				resultlink.setVisible(bLink);
    			end
    			
    			function onDrop(x, y, draginfo)
    				if draginfo.isType("shortcut") then
    					resultlink.setValue(draginfo.getShortcutData());
    					return true;
    				end
    			end
    		</script>
    		<sheetdata>
    			<genericcontrol name="leftanchor">
    				<bounds>0,2,0,20</bounds>
    				<disabled />
    			</genericcontrol>
    			<genericcontrol name="base">
    				<anchored position="over" />
    				<script>
    					function onDrop(x, y, draginfo)
    						return window.onDrop(x, y, draginfo);
    					end
    				</script>
    			</genericcontrol>
    			<link_tableresult name="resultlink">
    				<anchored>
    					<top offset="2" />
    					<left parent="leftanchor" anchor="right" relation="relative" offset="5" />
    				</anchored>
    				<invisible />
    				<script>
    					function onValueChanged()
    						window.updateDisplay();
    					end
    					function onDrop(x, y, draginfo)
    						return window.onDrop(x, y, draginfo);
    					end
    				</script>
    			</link_tableresult>
    FG Con 16 Fantasy Grounds Online RPG Convention - Friday April 24th to Sunday April 26th, 2020
    Register at www.fg-con.com for all the latest info.

    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. #14
    I just tried it on my machine, by modifying the table record to test setValue() specifically. It's working as expected.

    Looking at your code again, I think the problem is that you do not have "return true" at the end of your onDrop function. What I think is happening is that the value is actually being cleared in your onDrop event handler. However, since there is no return value, FG continues to process the drop event normally, which means that the link gets set again by the built-in windowreferencefield code.

    Regards,
    JPG

  5. #15
    dulux-oz's Avatar
    Join Date
    Jan 2012
    Location
    Australia
    Posts
    4,056
    Blog Entries
    14
    Quote Originally Posted by Moon Wizard View Post
    I think the problem is that you do not have "return true" at the end of your onDrop function.
    That was it - thanks Moon.

    As always, its the little things that trip you up the most

    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

    Read my FG Blog here.

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

    Support Ongoing Video, Ruleset & Extension Development: via PayPal (Send To: [email protected])

    YouTube Channel/Tutorial Playlists: www.youtube.com/c/duluxoz

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