MZ (SOLVED!) Remove Actor Choose window for items that target actors in party

Is there a way to remove that window with items, that target one of party members? I just want it to let me choose the actor from menu below, not to open a separate menu for choosing an actor
I also use VisuMZ free plugins, if that's has to do something with it
image.png
You might want to specify you're talking about in battle, which is not immediately obvious from your heavily customized display until one notices the little greyed out "Escape" hiding behind the window.

I had an entire reply typed up regarding the Item scene you get to from the main Menu.

I also use VisuMZ free plugins, if that's has to do something with it
It must have something to do with it, or some other plugins or modifications you have.

If you make a test project with the default engine (which I strongly encourage you to just keep around) and look at how using items in battle works, when you select Item it's supposed to turn off the status window (that part displaying the actors' faces).

Original code below:
Code:
Scene_Battle.prototype.commandItem = function() {
    this._itemWindow.refresh();
    this._itemWindow.show();
    this._itemWindow.activate();
    this._statusWindow.hide();
    this._actorCommandWindow.hide();
};

Note how it hides the status and command windows.

Then, when it displays the window targeting the actors for the item, it's positioned in the exact same place as the original status window so it looks like you're returning to that for the targeting step - it's pretty seamless.

So somehow the way you have your project set up does not do that, and instead is keeping those windows active and overlaying all the new stuff on top of them. And it has the item target window in a completely different place.

You need to look through your plugins and their parameters, see if it's an option you can turn off, move the window, whatever.

Just as an aside, this is an example of why it's very common advice to do plenty of tutorials and practice projects using the default engine so that you understand how it works and which things are modifications from your plugins. 😉
Okay, I will look into it further.
Bump, still stuck on it. Notion on how that function is called might help a bit
It's called by selecting the command "Item" in battle.
No-no, I mean, how it's called in the js code for mz (I guess it's rmmz_scenes/windows)
It's never called explicitly.

It's called by Window_MenuStatus.processOk() when the window's cursor is at the appropriate index. e.g. by selecting the command "Item".

Edit: Hah, or Window_ActorCommand.processOk(), y'know, one of those things.
So this, I believe?

Window_MenuStatus.prototype.processOk = function() {
Window_StatusBase.prototype.processOk.call(this);
const actor = this.actor(this.index());
$gameParty.setMenuActor(actor);
};
So is this related to Window_StatusBase?
That's for the pause menu; the battle version is Window_ActorCommand. It runs through the usual handler sequence. The battle scene binds its commandItem method (which Turan mentioned earlier) as a handler for the actor command symbol item in the usual way (rmmz_scenes.js):
JavaScript:
Scene_Battle.prototype.createActorCommandWindow = function() {
    const rect = this.actorCommandWindowRect();
    const commandWindow = new Window_ActorCommand(rect);
// ...
    commandWindow.setHandler("item", this.commandItem.bind(this));
A couple of possible options for what you're actually asking:
  1. Move Window_BattleActor to the same position as Window_BattleStatus. By default both windows are initialised with Scene_Battle#statusWindowRect, i.e. they have the same X, Y, width, and height; they also draw their items identically.

    You've clearly done something different somewhere: check your plugin settings! If it's a runtime position modification then you should make sure to also apply the new position to the scene's _actorWindow instance.

  2. Define and assign a new intermediate handler for the item command of Window_BattleStatus to redirect its ok/cancel symbols to those of the original Window_BattleStatus/Window_BattleActor.

    This would also require you to change which window receives focus when proceeding to actor target selection (Scene_Battle#onSelectAction).

    Like Turan said, the item window ought to be hidden during target selection, so you'd need to figure that out too.
Option 1 (undo the unwanted change) should be far easier and has a much lower risk of breaking stuff. Any code changes should be implemented as a plugin rather than a core script edit. On top of all the usual reasons, most of this stuff probably cannot work if applied before VisuStella's plugins are loaded.
I freaking managed to do it, thanks to ya guys
If some lost soul is going to suffer the same issue, find this line in rmmz_scenes

Scene_Battle.prototype.actorWindowRect = function() {
return this.statusWindowRect();
};

You can edit it here, but better to put it in separate js file, and edit it in notepad+ or whatever. What you have to do is replace the second line with coordinates, so it could look like something like this (replace numbers with numbers you need)

Scene_Battle.prototype.actorWindowRect = function() {
const ww = 383;
const wh = 244;
const wx = 60;
const wy = 383;
return new Rectangle(wx, wy, ww, wh);
};
As mentioned, there's some other issue here because the positions ought to match by default. But I guess if it works, it works. 😴

Yea, put it in a separate .js file and import that as a plugin. That lets you easily track, maintain, enable/disable, and/or port the edit as needed, and prevents it from being erased if/when you update your project's core scripts. It also saves headaches for anyone helping you with future support queries.

You can add a header with @target MZ, to prevent the "may not be compatible with MZ" Plugin Manager message. E.g.
JavaScript:
/*:
 * @target MZ
 * @plugindesc Change position of battle actor selection window.
 * @author Jobhob
 * @url https://forums.rpgmakerweb.com/threads/162482/
 * @help Hi!
 */
// Override!
Scene_Battle.prototype.actorWindowRect = function() {
  const ww = 383;
  const wh = 244;
  const wx = 60;
  const wy = 383;
  return new Rectangle(wx, wy, ww, wh);
};
You can edit this however you like, it's just for demonstration purposes~

Original thread: https://forums.rpgmakerweb.com/threads/solved-remove-actor-choose-window-for-items-that-target-actors-in-party.162482/