Thread: Creating a new window on desktop
-
July 5th, 2019, 22:15 #1
- Join Date
- Jun 2019
- Posts
- 71
Creating a new window on desktop
I am attempting to create a new window for the desktop when you load a campaign. So I defined a new windowclass in the desktop_classes.xml and set a new framedef in the graphics_frames.xml. From the FG docs, I couldn't find if there was something else I needed to do in order for it to show up. Right now, it just has some dummy string_label in the sheetdata tag. Just trying to get it to draw first.
EDIT: Seems I am missing quite a few things. Premature posting. My apologies.
ThanksLast edited by Ranzarok; July 5th, 2019 at 22:36.
-
July 5th, 2019, 22:20 #2
- Join Date
- Jun 2019
- Posts
- 71
I think maybe I have it figured out. Will delete post if I do.
-
July 6th, 2019, 05:14 #3
Better yet - please post the full files/code
-
July 6th, 2019, 08:09 #4
- Join Date
- Jun 2019
- Posts
- 71
Sure. I am sure this is FG 101 for most of you but if you want to see it here ya go.
I created a new panel on the desktop (that's the part I was missing), created some new art for the panel, added the Doom and Momentum buttons. Right now, it is using basicnumber tags for the pool numbers. Next thing I have to do is create the functionality for both the Doom Pool and the Group Momentum Pool and a way for the player generated Momentum total to be added to the group Momentum if the player chooses to bank it. Long way to go, but learning along the way.
windowclass in my desktop_classes.xml
Code:<windowclass name="doom_tracker"> <noclose /> <sizelimits> <dynamic /> <minimum width="200" height="400" /> </sizelimits> <sheetdata> <genericcontrol name="dtbase"> <bounds>1,1,99,199</bounds> <icon>doomtracker</icon> </genericcontrol> <button_dtmom name="dtmomentum"> <bounds>19,20,62,62</bounds> </button_dtmom> <basicnumber name="gmompool"> <bounds>25,70,20,20</bounds> </basicnumber> <button_dtdoom name="dtdoom"> <bounds>19,120,62,62</bounds> </button_dtdoom> <basicnumber name="gdoompool"> <bounds>55,110,20,20</bounds> </basicnumber> </sheetdata> </windowclass>
Code:<!-- Buttons for Doom Tracker --> <template name="button_dtmom" merge="join"> <buttoncontrol> <icon normal="button_dtmomentum" pressed="button_dtmomentum_down" /> <script> function onButtonPress() local msg = {font = "msgfont", icon = "momentumicon"}; msg.text = " You need to make this spend a Momentum from the Group Pool and subtract it from the total. "; Comm.deliverChatMessage(msg); end </script> </buttoncontrol> </template> <template name="button_dtdoom" merge="join"> <buttoncontrol> <icon normal="button_dtdoom" pressed="button_dtdoom_down" /> <script> function onButtonPress() local msg = {font = "msgfont", icon = "doomicon"}; msg.text = " You need to make this spend a Doom from the Doom Pool and subtract it from the total. "; Comm.deliverChatMessage(msg); end </script> </buttoncontrol> </template>
Code:<panel name="doom_tracker" modes="host,client"> <class>doom_tracker</class> <bounds>400,-350,100,200</bounds> <dynamic /> <locked /> </panel>
Last edited by Ranzarok; July 6th, 2019 at 08:12. Reason: added image
-
July 6th, 2019, 09:20 #5
-
July 7th, 2019, 05:38 #6
Very much so! Love seeing new things that could be huge improvements to other systems.
-
July 8th, 2019, 19:29 #7
- Join Date
- Jun 2019
- Posts
- 71
I've found out that creating the window the way I have described still doesn't get me what I need. Only having done the above, the window shows up when I launch FG campaign but it is unbound, so I can't get data from or send data to it. On start up the console reports the node as nil.
I've went through Jeffery Redding's extension tutorial, the FG documentation and tried things but to no avail. I have even looked at MoreCore's dicepool windowclass and the onInit call but still get the error. Any help would be appreciated.
I put this in to get the nil notification
Code:<windowclass name="doomtracker"> <noclose /> <sizelimits> <dynamic /> <minimum width="200" height="400" /> </sizelimits> <script> function onInit() Debug.console("self", self); Debug.console("getDatabaseNode", self.getDatabaseNode()); end </script>
Code:<windowclass name="doomtracker"> <noclose /> <sizelimits> <dynamic /> <minimum width="200" height="400" /> </sizelimits> <script> function onInit() DoomTracker.registerControl(self); end function onClose() DoomTracker.registerControl(nil); end </script> <sheetdata> <genericcontrol name="dtbase"> <bounds>1,1,99,199</bounds> <icon>doomtracker</icon> </genericcontrol> <button_dtmom name="dtmomentum"> <bounds>19,20,62,62</bounds> </button_dtmom> <basicnumber name="gmompool"> <bounds>25,70,20,20</bounds> </basicnumber> <button_dtdoom name="dtdoom"> <bounds>19,120,62,62</bounds> </button_dtdoom> <basicnumber name="gdoompool"> <bounds>55,110,20,20</bounds> </basicnumber> </sheetdata> </windowclass>
-
July 8th, 2019, 20:11 #8
How are you opening the window?
---
Fantasy Grounds AD&D Reference Bundle, AD&D Adventure Bundle 1, AD&D Adventure Bundle 2
Documentation for AD&D 2E ruleset.
Custom Maps (I2, S4, T1-4, Barrowmaze,Lost City of Barakus)
Note: Please do not message me directly on this site, post in the forums or ping me in FG's discord.
-
July 8th, 2019, 20:22 #9
- Join Date
- Jun 2019
- Posts
- 71
Thanks for the reply
Through the desktop_panels.xml (I was opening with a "/" in the chat window but wanted to open when FG loaded the campaign, so I did this
Code:<panel name="doomtracker" modes="host,client"> <class>doomtracker</class> <bounds>400,-350,100,200</bounds> <dynamic /> <locked /> </panel>
-
July 8th, 2019, 23:29 #10
Hi Ranzarok
In terms of creating a new window etc - if you are looking at MoreCore objects - then the locations is an example of a new window and data type.
But you are also looking at making it a new desktop object that is always there like the Chat Window?
I didnt write any of the DicePool stuff - that was ianmward but he also released it as a CoreRPG extension so you can see the code without having to search your way through everything.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks