MZ Need to add a conditional to 'Message Timer' Plugin

Hi all!
I'd like to see if someone would be capable of adding a conditional to Galv's Message Timer plugin!
Specifically a '$gameMessage.isBusy || $gameMessage.isChoice' conditional.

The reason is that Galv's plugin actually has an issue when you are using the Default MZ Plugin "Text Picture" to show some text onscreen as a picture (like a variable in the HUD).
It causes the timer to endlessly run, even though there's no ShowMessage or Choice onscreen



So I'd just like to ask if someone knows how to add a conditional edit/snippet that only starts the timer
IF $gameMessage.isBusy || $gameMessage.isChoice

-I guess an activation switch might do it too, but a conditional would be best because it would automatically stop the Global Timer from running unless a message window or Choice is onscreen, which is the current problem.

Note, the plugin does have a 'turn invisible ON/OFF' command, but that doesn't actually deactivate the timer, it just turns invisible and will still affect the next message by having the timer already going before the message can even start.

Plugin:
Have you tried this?
1693796595794.png
@AquaEcho
Sadly it did not help T-T

2023-09-04 00_47_30-GalvTimer.png

2023-09-04 00_49_17-D__temp rpg MZ directory_GalvMessageTimer_js_plugins_GALV_MessageTimerMZ.j...png


It really seems like it should work though!?
I made a quick blank sample project with just Galv's plugin (with your edited line) and the Text to picture plugin, and a map that has an event that runs the text to picture command to illustrate. Might be helpful in testing.
I'll see if I can jam that conditional in a few more sections to see if anything happens!
Could you add parentheses so it's
$gameMessage.isBusy()
and
$gameMessage.isChoice()
Could you add parentheses so it's
$gameMessage.isBusy()
and
$gameMessage.isChoice()
Okay, that ended up being the solution, but on a different line!

So for this plugin, the only change needed seems to be



1. Make a new line after line 176 and paste this code:
Code:
if($gameMessage.isBusy() || $gameMessage.isChoice()){
2. And then after line 181 make new line and paste this:
Code:
}

So the final result looks like this:

Code:
Game_Message.prototype.startMessageTimer = function(seconds) {
    if($gameMessage.isBusy() || $gameMessage.isChoice()){
    Galv.mTimer.autoCancelled = false;
    const frames = seconds ? Math.round(seconds * 60) : -2;
    this._messageTimerMax = frames;
    this._messageTimer = frames;
    }
};

Now it doesn't seem to run repeatedly outside of messages or choices!
I'll be sure to let Galv know you figured it out! 😊
This thread is being closed due to being solved. If you do need it reopened, report it to let us know why. Thank you!

Original thread: https://forums.rpgmakerweb.com/threads/need-to-add-a-conditional-to-message-timer-plugin.160886/