pau-tomas / gb-studio-plugins

A set of experimental plugins for GB Studio
94 stars 10 forks source link

Feature request: printer 'on success' event #14

Open LordRembo opened 9 months ago

LordRembo commented 9 months ago

Since there is an error event, is it possible to also add a 'success' or 'done' event? That would enable devs to put up a 'printing now…' graphic and hide it when the print is done. Like what the Game Boy Camera does when you print a picture. My workaround at the moment, is to play around with timers, which is not ideal.

pau-tomas commented 2 months ago

I started a branch with a new version of the plugin that includes the success path. https://github.com/pau-tomas/gb-studio-plugins/tree/wip/print_bg_v2

image

However using a "Printing now..." dialogue won't work very well. Getting a bit technical: what the plugin does is copying what's in the background to the GB window layer and then printing what's in that layer. Dialogues in GB Studio use the window layer, so the moment the plugin starts running the dialogue will be replaced with the background tiles.

LordRembo commented 2 months ago

Sweet! Thanks for looking into it. An additional 'done printing' event could be useful to know when to start allowing dialogues again. Although, I'm assuming the background gets sent to the printer somewhat instantly, so maybe waiting a couple frames would be enough to be able to use dialogues again? All in all, I think it's okay that the dialogue has limits. A dialogue is not a very interesting way to indicate a success event anyway, because it blocks the flow of the game in a way the game maker has no control over (the user has to hit A to confirm/close the dialog). Showing a sprite gives the game maker more options, as they can set any visual indication they want and retain full control of the flow of the game and other interactions. So they can continue letting the game run as stuff is printing.

pau-tomas commented 2 months ago

Although, I'm assuming the background gets sent to the printer somewhat instantly, so maybe waiting a couple frames would be enough to be able to use dialogues again?

On the contrary, the process of sending the background to the printer is pretty slow and everything is blocked while the Print plugin is running so nothing else can happen during that time.

A dialogue is not a very interesting way to indicate a success event anyway, because it blocks the flow of the game in a way the game maker has no control over (the user has to hit A to confirm/close the dialog).

Technically you could use a non-modal dialogue (with the Advance Dialogue plugin) and that won't require pressing any button to advance, but then it'll be replaced by the background immediately after calling the Print Background plugin so it won't be very useful. Using a sprite should work fine.