PDA

View Full Version : Opening a frame from a button?



Ogedei
February 21st, 2017, 15:40
I will post this stating I am pretty new to this whole Fantasy Grounds thing.

I am working with MoreCore at the moment and an existing Extension for the Conan RPG.

If I had a button control and I wanted to be able to drag and drop a node from the DB, so that clicking on the button opened a frame to display that entry, how would one go about doing that?

At present, I can drag and drop onto the buttoncontrol and see and pull the data from the node, but I am at a loss on how I would, then go about displaying this in a frame that pops open.

I am sure I am doing this the hard way, so if you are reading this and wondering to yourself. WTF?! Feel free to show me the light.

If I am not totally insane, I would love some input on how to open a window from Lua.

Thanks!

Moon Wizard
February 21st, 2017, 17:57
You should use the "windowreferencefield" object to store and open links. It's basically a button linked to a "link" data field, so that it opens the "link" when you press the button. You'll see it used all the time throughout all the rulesets. The graphics are just customized for each game system. Plus, there are template examples in CoreRPG, such as "linkcontrol" and "linkfield" that already predefine graphics and sizes for windowreference control/field objects.

Every "link" is a combination of a data path and a window class. The data path tells FG where the data for the record should come from, and the window class tells FG which windowclass definition to use to display the data.

Hope that helps. Let us know if you have any other questions.

Cheers,
JPG

Ogedei
February 21st, 2017, 18:06
Thanks very much. I am not surprised this exists, I just. Could. Not. Find. it. hahhaha. I am quite sure it is all throughout the systems. I have a look through Core and MoreCore for something and couldn't find it. I do see it is a basic level control, just never came across it for some reason!

I will give this a try tonight or tomorrow whenever I get time.

Ogedei
February 22nd, 2017, 01:33
Worked beautifully! Much thanks!

damned
February 22nd, 2017, 02:17
Hey Ogedei - we wanna see what your working on :)
Do share!

Ogedei
February 22nd, 2017, 02:49
Hey. Nothing to really publish at this time, although getting there.

I am extending the Jolly GM's Conan skin of More Core. Just adding more Conan specific stuff, such as a character sheet, where the bulk of my work has gone. I had hoped to record a publishable video demo of it yesterday but the quality was abysmal.

I can drop the link here and you can take a look.

https://www.youtube.com/watch?v=4HMJkPnsNps

Adding reference links next to all the rollers now.

18001

damned
February 22nd, 2017, 03:03
Very good Ogedei :)

Ogedei
February 22nd, 2017, 03:04
It's coming along. I'll take what I have considering Friday was my first start at Fantasy Grounds.

LordEntrails
February 22nd, 2017, 15:22
It's coming along. I'll take what I have considering Friday was my first start at Fantasy Grounds.
Nice:) Glad to have you in the community and will keep and eye on what else you work on in the future!