Only show enemy name in battle when current target?

G'morning, y'all,

This is a question with the same context as the question I asked just a day or so ago.

I am creating front-view puzzle-like battles in which troops are made up of a series of overlapping parts that can be individually targeted, and which are affected by invisible states caused by player actions, which change how the troop works as a whole. I've mostly got this to work as intended, and I've developed workarounds for a few issues this battle format causes.

With that context out of the way, there's one small visual issue that I don't have a good workaround for, though. When the player has an ability ready to target enemies, many of the names overlap with one another because of how the image y-dimensions are scaled, like so (please excuse the crappy placeholders):

Reference3.png



I have a bad workaround for this issue: I can make a copy of each enemy with a blank name so that no name appears at all, and the player only gets the white shading as a visual guide.

So I'd like to ask if anyone knows of some script idea, option, or plugin, (or if I'm missing something entirely), that would let me restrict visible names to only the current target.

Thanks, y'all.
Check your plugins - by default, those names aren't displayed at all.
Ah, whoops, I didn't realize that YEP Battle Core had these parameters 'visual enemy select' and 'show enemy name' which were default set to true. I completely missed that it was different from no plugin, somehow.

I guess my question still stands, although I have a much easier way to do my bad workaround by just changing the latter parameter to false, but now this is a plugin question.
I'll post an update to this because a friend was able to arrive at a solution.

It looks like the appearance of the text is controlled by the Window_EnemyVisualSelect class in the YEP_BattleEngineCore.js plugin. It's not clear to me what else this controls, but I only currently need the white shading (from the default game) and the enemy name.

As it turns out,
Code:
this._battler.isSelected()
is already called elsewhere, so by setting the update to only be visible when isSelected is true (after if (!this._battler) return; in the Window_EnemyVisualSelect.prototype.update function) gives me exactly what I'm looking for:
Code:
this.visible = this._battler.isSelected();

I am not sure what else this will affect. But I figured I'd post this here in case anyone else went searching for a possible solution, decides to test this, or wants to comment on it.

Original thread: https://forums.rpgmakerweb.com/threads/only-show-enemy-name-in-battle-when-current-target.172821/