GameMaker / FoundryPLANT

1 stars 0 forks source link

Equivalent of the ALT-1, etc. hotkey in v8+ #21

Open steveculshaw opened 2 years ago

steveculshaw commented 2 years ago

Is there an equivalent of the ALT-1, etc. hotkey in v8+ ?

Or any plans to update module to current Foundry release ?

GameMaker commented 2 years ago

Hi Steve - thanks for reaching out!

My game dissolved a few years ago, and I assumed this wasn't in use by anyone else - so thanks for checking it out! :)

I didn't plan to update to current Foundry, but if it's important to your game, let me know, and I'll see how much work it would take. I think the API changed quite a bit, so it might take some refactoring. I know a lot of it was unfinished, too, so it probably needs some cleaning up.

By hotkeys, do you mean specifically the ones that change the macro bar page? Or do you want to remap other keyboard shortcuts?

steveculshaw commented 2 years ago

Hi there Aaron

I was looking through your code ... my JavaScript is pretty basic, I'm a C# / SQL coder :-)

Anyhow, spotted what I think is the function that handles the ALT keyboard shortcuts ... $(document).keydown(function (e) {

Then cut & pasted a couple of the UI actions into a standard Foundry macro ... ui.sidebar.activateTab("chat"); ui.sidebar.activateTab("combat");

And success ... well good enough for me :-)

I'm not sure of the implications of not having the isGM guard clause, and the shouldEat. Ooh, more reading ... seems the isGM is either limiting to a GM, or toggling the target tab. Not getting what the case 191 option is doing ???

Many thanks for writing the module

SteveC.

steveculshaw commented 2 years ago

Only other thing I'd like to do is turn my simple cut & paste into a macro into a proper module so I can share it with my players ?

GameMaker commented 2 years ago

Hey, well done!

Yes, isGM was used as a guard to determine how the Player Needs window was drawn. A player can see the status of their own items, but the GM can see all players' requests, as well as who requested them.

"191" is the ASCII keycode for the '/' character. I don't know if you ever got a chance to use the whole module before it became obsolete, but one of the features was having a "cheat sheet". You could write a journal entry with some basic stuff, like how to roll dice, how to bring up your character sheet, how to whisper to the DM, etc., and then they could press Alt+/ to bring it up as a hotkey. (I chose that because it's the "?" key as well.) The rest of that block is about finding the journal entry and displaying it. (You could specify the name of the Journal Entry in the module settings.)

Making modules is a little more involved, but if you ask around on the Foundry discord there are some great folks who can help, and you're welcome to use this (or any other github repo with a more current module) as reference.

GL!

steveculshaw commented 2 years ago

Ah ha ... many thanks again @GameMaker