MV Yanfly Message Backlog -- how to run common event on backlog close?

Hi!

I'm using Yanfly's Message Backlog so my player can review past text they may have missed.

It's basic, but works fine. However, I need to run a common event upon exiting out of the backlog, to reinstate certain HUD elements that I remove before opening the backlog.

Would anyone be familiar enough with the plugin to help me figure out where I can add in the script call for a common event right after closing? I don't want to post the code here since of course Yanfly has these behind a paywall now.

Thank you!
depends how you hide the HUD and how it's made.

if you use a switch, you can toggle this fairly easy to hide and show.
so you can make a switch state with on and off.

use that state inside the message log with switch ON and call it
same with hiding it, or a parallel switch state that automatically disable
once the HUD is active or hiding, so you can control you HUD on the fly.
depends how you hide the HUD and how it's made.

Thanks @ShadowDragon, I'm controlling the HUD with a simple switch as you suggest.

It's easy enough to disable the HUD before showing the chatlog. But I'm not skilled enough to know where in the plugin I could turn the switch back on.

The chatlog is exited with either Escape, or action key. What might I look for in the plugin for a place where I can turn a switch back on?

Thanks!
depends, if you have the Input.isTriggers("cancel") than you can place it
below it, but without knowing your plugin, it's hard to know as there is
also "isOpen" and "isClosed" so if you have a chat that uses those.
you can place the switch is ON in the "isOpen" function and switch OFF
in the "isClosed" option.

but that depends on your plugin you use. but you can control it ingame,
if you do it there.
depends, if you have the Input.isTriggers("cancel") than you can place it
below it, but without knowing your plugin, it's hard to know as there is
also "isOpen" and "isClosed" so if you have a chat that uses those.
you can place the switch is ON in the "isOpen" function and switch OFF
in the "isClosed" option.

I found this function, would it seem like this is the right place to set the switch?

Code:
Window_MessageBacklog.prototype.processCancel = function() {
  SoundManager.playCancel();
  this.fullDeactivate();
};

If so, what exactly would I put in this function? I've worked with script calls but are they the same if they're in a plugin?

In order to turn switch 1007 on, should I include:

$gameSwitches.value(1007) == true;

I tried this and it doesn't seem to work, but I know I'm doing something wrong somewhere. I'm just trying to figure it out myself.
If so, what exactly would I put in this function? I've worked with script calls but are they the same if they're in a plugin?
the js in a plugin is the same as the js you use in a script section of an editor. all the scriptcalls will still work

In order to turn switch 1007 on, should I include:

$gameSwitches.value(1007) == true;

I tried this and it doesn't seem to work, but I know I'm doing something wrong somewhere. I'm just trying to figure it out myself.
that doesnt set that switch to be true. that checks if its true. you want $gameSwitches.setValue(), not value()
Got it! I found the two functions that close it out on either Esc and Action, and it works!

Thanks so much all.

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/yanfly-message-backlog-how-to-run-common-event-on-backlog-close.170784/