PDA

View Full Version : Anybody know how to populate the hotkeys from an extension?



Minty23185Fresh
January 15th, 2023, 16:20
Yes. Yes. I know. I am being very lazy and asking for help from someone who has already done this.

I have an extension that I use to comb and clean text that I am importing from PDF into Fantasy Grounds.

There are several chat box slash commands that I've programmed the functionality for that my extension recognizes and processes. For each new project I enter them in by hand and populate the Hot Keys with them. I am considering adding more slash commands and so I'm thinking it's about time to try to prepopulate the Hot Keys programmatically when the extension loads.

Is this possible, and would you be willing to share your expertise with me? (Just tell me what ruleset .lua file to change is probably sufficient.)
(If you have a free extension that does it and wanted to share it with me that would be wonderful.)

I could do this myself, but I am being lazy. I just want to get it done. I don't want to wade through the process of finding out where and what to change.

Thanks in advance for any help you're willing to share with me.

superteddy57
January 15th, 2023, 17:45
I don't believe so as the hotkey bar isn't something accessible from the ruleset code. You could create a tool button in the sidebar that will have buttons that will push the slash command. The other option on how I would approach this is setup a story entry with a chat frame with the slash command inside as it sends it to chat. This is how I approach adding die rolls to story entries and reference manual pages.

Minty23185Fresh
January 15th, 2023, 18:16
@superteddy57
Thank you very much for the help.

A couple years ago I read something to the effect that the hot keys were not accessible, just as you’ve said. But I couldn’t find the post again.

I think that once defined, the hot key assignments are saved in their own .xml, or in the DB.xml. (Hopefully!?) If that’s the case I’ll just manually copy that data from project to project.

Thanks again.

Minty23185Fresh
January 15th, 2023, 18:26
Ah. Here it is.
campaigns\...\usersettings\hotkeys_host.xml

Zacchaeus
January 15th, 2023, 19:05
See video forty two here :) https://www.fantasygrounds.com/forums/showthread.php?55797-How-do-I-in-Unity

Minty23185Fresh
January 15th, 2023, 19:38
See video forty two here :) https://www.fantasygrounds.com/forums/showthread.php?55797-How-do-I-in-Unity

Thanks Zacchaeus. That is the method I currently use: For a series like a complete season of Adventurers League modules it's really handy to create a "Template" campaign.
The video helped me understand what the "session" xml files were all about. I’ll gander at the rest of your videos, there's always something for me to learn.

damned
January 15th, 2023, 22:35
Not from within FG but a simple batch command in your OS can help you set this up each time.