MZ Custom Window Help (SOLVED)

Ok so now I know it will since you've confirmed it but I'm still not sure why the this.opacity = 255; didn't effect the sprites when I set it to 0. It only made the rectangle invisible but not the contents, its not a concern if I can get it to work properly.
View attachment 250678
I don't see any attachment. I'd need to either see the error messages / screenshots or need the functional plugin with its plugin commands etc. so I can test it myself.
I thought prototypes were a rpgmaker thing. When little I learned using those learning apps in javascript I don't remember seeing anything on prototypes but classes, objects and functions yes. I will definitely study more.
No. Prototypes are an essential part of js and the backbone of how all objects work. When you create an Array, or an Object, it is build based on the Array and Object prototypes. Class is an easier way to create prototypes. Everything RPGMV/Z does inside the game is javascript.
Ok I understand what you're saying about how it changes it for all windows, but did I needed to add this entire function to my plugin or was it an example you used to try to explain to me what I was missing? Was I suppose to add this.updateOpen() and close to my Scene_Map.prototype.start function?

1673589666510.png
No, that was me showing you the original function your class is meant to inherit. You can include this entire function by simply using super.update(), as you're now correctly doing inside your function.
So what I took from this is that the class I made Window_ActorHUD extends WindowBase essentially updates 60 times a second....If so why would I even need the update(){super.update();}?
If it's attached to an object that updates its children (sprites, windows, scenes), yes.
You need the super.update() call to keep the function you see above existing and included in your update, because that function links further functions and has its own code which is crucial to keep a lot of the things a window can do alive.
The window you're extends another object to inherit its properties.
It's like buying a car and then adding another display & autoparking to it. But to do so, you cannot just rip out and remove all the electrics that kept the motor functioning, the displays going and allowed the entire car to work.

For instance, the Window_Base's update function contains the Window update function.
This is the Window update function:
1673756618094.png

This is the function that allows sprites attached to your window to also be updated, just like the scene updates your windows. If you override this function, you strip your new window of the ability to update & show any sprites or windows attached to it.
I did copy and pasted your example but the open close still doesn't work....This is the whole code:

Code:
//PLUGIN VARIABLES
const openWindow = Scene_Map.prototype.start;
let hudWidth = 200;
let hudHeight = 55;
const floor = Math.floor;
var newCharacterGraphic =  '';
//WINDOW CONTAINERS
Scene_Map.prototype.start = function() {
    openWindow.call(this);
    //THIS FUNCTIONS VARIABLES
    let x = eval(LadyLegend.PlayerHud._HUDx) == 0 ? 0 : eval(LadyLegend.PlayerHud._HUDx) == Graphics.width ? Graphics.width-hudWidth : Graphics.width/2-hudWidth/2;
    let y = eval(LadyLegend.PlayerHud._HUDy) == 0 ? 0 : Graphics.height-hudHeight;
    //WINDOW PARAMETERS
    this.actorHud = new Window_ActorHUD(new Rectangle(x, y, hudWidth, hudHeight));
    //OPACITY OF THE WINDOW BOXES
    this.actorHud.opacity = 255;

    //CREATES THE WINDOWS THE GRAPHICS ATTACH TO
    this.addChildAt(this.actorHud,1);
}
//GRAPHICS
class Window_ActorHUD extends Window_Base {
    //GRAPHICS/ANIMATIONS SETTINGS
    constructor(rect) {
        super(rect);
        //LEFT/RIGHT BACKGROUND GRAPHIC POSITION
        this.sidesBackground = new Sprite(ImageManager.loadPicture(LadyLegend.PlayerHud._HUDsb));
        this.sidesBackground.anchor.set(0.5);
        this.sidesBackground.x = eval(LadyLegend.PlayerHud._HUDx) == 0 ? hudWidth/1.5 :hudWidth-hudWidth/1.5;
        this.sidesBackground.y = eval(LadyLegend.PlayerHud._HUDy) == 0 ? hudHeight : 0;
        if(eval(LadyLegend.PlayerHud._HUDx) > hudWidth) this.sidesBackground.scale.x *= -1;
        if(eval(LadyLegend.PlayerHud._HUDx) == '0' || LadyLegend.PlayerHud._HUDgx == Graphics.width) this.addChildAt(this.sidesBackground,1);
        //CENTER BACKGROUND GRAPHIC POSITION
        this.centerBackground = new Sprite(ImageManager.loadPicture(LadyLegend.PlayerHud._HUDcb));
        this.centerBackground.anchor.set(0.5);
        this.centerBackground.x = eval(LadyLegend.PlayerHud._HUDx)-hudWidth*1.45;
        this.centerBackground.y = eval(LadyLegend.PlayerHud._HUDy) == 0 ? hudHeight : 0;
        if(eval(LadyLegend.PlayerHud._HUDx) == Graphics.width/2)this.addChildAt(this.centerBackground,1);
        //CHARACTER GRAPHIC POSITIONS
        this.characterGraphic = new Sprite(ImageManager.loadPicture($gameParty.leader()._name));
        this.characterGraphic.anchor.set(0.5);
        this.characterGraphic.x = eval(LadyLegend.PlayerHud._HUDx) == 0 ? hudWidth/4.2 : eval(LadyLegend.PlayerHud._HUDx) == Graphics.width ? hudWidth-hudWidth/4.2: hudWidth/2 ;
        this.characterGraphic.y = eval(LadyLegend.PlayerHud._HUDy) == 0 ? hudHeight : 0 ;
        if(eval(LadyLegend.PlayerHud._HUDx) < hudWidth) this.characterGraphic.scale.x *= -1;

        //ANIMATION FRAMES
        if(LadyLegend.PlayerHud._HUDaf == 'true') {
            this.animation = [    
            [0,0],
            [1,0],
            [2,0],
            [1,0]
        ];
        //ANIMATION SPEED SETTINGS
        this.animationSpeed = 60/15;
        this.tick = 0;
        this.frame = 0;
    }
    else {
        this.animation = [    
            [0,0],
        ]
        this.animationSpeed = 60/15;
        this.tick = 0;
        this.frame = 0;
    }
    };
    //CROP SIZE SETUP FOR ANIMATED GLOBAL GRAPHIC
    async calcSize(width, height) {
        return [
            floor(64),
            floor(64),
        ];  
    };
    //ANIMATED GRAPHIC CROPPED AND DISPLAYED
    setFrame(characterGraphic, x, y) {
       this.calcSize(characterGraphic.bitmap.width, characterGraphic.bitmap.height).then(f => {  
            x *= f[0];
            y *= f[1];
            characterGraphic.setFrame(x, y, f[0], f[1]);
            this.addChildAt(this.characterGraphic,3);
        })
    }
    update() {
        this.processOpenCloseButton();
        super.update();
        this.changeCharacterGraphics();
        this.processAnimationTicks();
        this.drawPartyLeaderStateIcon();  
    }
   
    processOpenCloseButton() {
        if(Input.isTriggered('ok')) {
            if(this.isOpen()) {
                this.close;
            } else {
                this.open;
            }
        }
    }
   
    changeCharacterGraphics() {  
        if (newCharacterGraphic != $gameParty.leader()._name) {
            newCharacterGraphic = $gameParty.leader()._name;
            this.removeChild(this.characterGraphic);
            this.characterGraphic = new Sprite(ImageManager.loadPicture(newCharacterGraphic));
            this.characterGraphic.anchor.set(0.5);
            this.characterGraphic.x = eval(LadyLegend.PlayerHud._HUDx) == 0 ? hudWidth/4.2 : eval(LadyLegend.PlayerHud._HUDx) == Graphics.width ? hudWidth-hudWidth/4.2 : hudWidth/2;
            this.characterGraphic.y = eval(LadyLegend.PlayerHud._HUDy) == 0 ? hudHeight : 0;
            if(eval(LadyLegend.PlayerHud._HUDx) < hudWidth) this.characterGraphic.scale.x *= -1;
        }
    }
   
    processAnimationTicks() {
        this.tick+=this.animationSpeed;
        if(this.tick>=60) {
            this.tick=0
            this.setFrame(this.characterGraphic, this.animation[this.frame][0], this.animation[this.frame][1]);
            this.frame++;
            if(this.frame>=this.animation.length) this.frame=0;
        };  
    }
   
    drawPartyLeaderStateIcon() {
        if($gameParty.leader().states().length != 0) this.drawIcon($dataStates[$gameParty.leader()._states].iconIndex, eval(LadyLegend.PlayerHud._HUDix), eval(LadyLegend.PlayerHud._HUDiy));
    }
}
I'd need the plugin file with the additional Plugin Settings to take a look. There's some stuff I don't know why you used it, and I'd have to check out what it causes to happen.

For instance, instead of addWindow(), you've used addChildAt()
1673756802031.png

but doing so doesn't add the window you've created to the window layer and I don't know why you've decided not to do so.
1673756878963.png


I also don't know what works, what's displayed, if you're -for example- loading sprites that require loadlisteners, etc.
I'd need screenshots, error messages, or the plugin code ready for me to test ingame.

I also don't know why you're removing and adding sprites here:
1673757013462.png

If you want to change the image that's shown, you can just leave the sprite be and update its bitmap texture.
e.g.
JavaScript:
    changeCharacterGraphics() {   
        if (newCharacterGraphic != $gameParty.leader()._name) {
            newCharacterGraphic = $gameParty.leader()._name;
            const image = ImageManager.loadPicture(newCharacterGraphic);
            this.characterGraphic.bitmap = image;
        }
    }
I did get the button to work by testing a switch but I remapped my core button for my personal project. For the most part I'm not trying to use many plugins or any at all from others is my ultimate goal because of that whole compatibility issue that halts not just my own but many peoples projects. So I thought I'd try my hand in it considering I'm a quick learner but I understand the problem if I want others to use the plugin which I do so I really only have one question about that. You know how the "ok" has like 3 buttons mapped to it(Z, Spacebar,Enter), how to I target the spacebar "ok" press?
You cannot, by default. The Input Check does not check what "ok" button is pressed, just that one of the three buttons is pressed.
If you don't care about compatibility and accept that this will invasivly affect other plugins and the default functionality, you could do this:
JavaScript:
Input.keyMapper[32] = "space";
at the start of your plugin.
This remaps the space key (code 32) away from ok and to a new keyword "space".
And then you can ise Input.isTriggered("space") to check if the spacebar is triggered.
This will prevent the spacebar from every working as an "ok" button, though.

Outside of my plugin, short of creating your own input system, that's the only way to be able to check for the spacebar.
The test didn't work and I tried to using an event to see if it would close my window both hide and close didn't work..
SceneManager._scene._Window_ActorHUD.hide()
I also tried it as a plugin command

View attachment 250682
I'm not sure what you're doing there?

Why are you using Window_ActorHud? I thought, according to your code, the window is stored as actorHud in the scene?
1673757766747.png
I don't see any attachment. I'd need to either see the error messages / screenshots or need the functional plugin with its plugin commands etc. so I can test it myself.

There was no error this.opacity only effects that blue window below. It make the window invisible but not the contents. Maybe because you said I used addChild instead of addWindow, but I'm not concerned its not a problem I decided to use it as a place holder for users to design a place there own graphics. I just didn't understand why it behaved that way.
Screenshot 2023-01-15 at 8.43.52 AM.png


No. Prototypes are an essential part of js and the backbone of how all objects work. When you create an Array, or an Object, it is build based on the Array and Object prototypes. Class is an easier way to create prototypes. Everything RPGMV/Z does inside the game is javascript.

Ok so I must've skipped something when studying.One day I'll be on here giving advice just wait and see.

No, that was me showing you the original function your class is meant to inherit. You can include this entire function by simply using super.update(), as you're now correctly doing inside your function.

Got it.

If it's attached to an object that updates its children (sprites, windows, scenes), yes.
You need the super.update() call to keep the function you see above existing and included in your update, because that function links further functions and has its own code which is crucial to keep a lot of the things a window can do alive.
The window you're extends another object to inherit its properties.
It's like buying a car and then adding another display & autoparking to it. But to do so, you cannot just rip out and remove all the electrics that kept the motor functioning, the displays going and allowed the entire car to work.

For instance, the Window_Base's update function contains the Window update function.
This is the Window update function:
View attachment 250728
This is the function that allows sprites attached to your window to also be updated, just like the scene updates your windows. If you override this function, you strip your new window of the ability to update & show any sprites or windows attached to it.

I looked over what you wrote and understand how you are using the update function now and agree it is much more readable your way. My way was reallllly old school, this isn't my first time learning javascript I tried about 10 years ago.

I'd need the plugin file with the additional Plugin Settings to take a look. There's some stuff I don't know why you used it, and I'd have to check out what it causes to happen.

For instance, instead of addWindow(), you've used addChildAt()
View attachment 250729
but doing so doesn't add the window you've created to the window layer and I don't know why you've decided not to do so.
View attachment 250730

I also don't know what works, what's displayed, if you're -for example- loading sprites that require loadlisteners, etc.
I'd need screenshots, error messages, or the plugin code ready for me to test ingame.

I also don't know why you're removing and adding sprites here:
View attachment 250731
If you want to change the image that's shown, you can just leave the sprite be and update its bitmap texture.
e.g.
JavaScript:
    changeCharacterGraphics() { 
        if (newCharacterGraphic != $gameParty.leader()._name) {
            newCharacterGraphic = $gameParty.leader()._name;
            const image = ImageManager.loadPicture(newCharacterGraphic);
            this.characterGraphic.bitmap = image;
        }
    }


Here's my full plugin: You might want to put a copy of Reids SV_Battler png in the pictures folder and rename it Reid if you want the full effect. I used $gameParty.leader()._Name; to get the pictures so name something in the pictures file Reid. It animates still pictures on and off unless you uncheck animate graphic.


Code:
/** /*:
 * @target MZ
 *
 * @author LadyLegend
 * @plugindesc Player Heads Up Display
 *
 * @help
 *
 * @param ====READY=GET=SET=GO!====
 *
 * @param ----- INFORMATION -------
 *
 * @param Finished Setup?
 * @parent ----- INFORMATION -------
 * @desc Removes All Placeholder Boxes.
 * @type boolean
 * @default false
 *
 * @param ------ GRAPHICS -------
 *
 * @param Side Backgrounds
 * @parent ------ GRAPHICS -------
 * @desc Left/Right Bacground Picture
 * @type file
 * @dir /img/pictures
 * @default PlayerLeftHud
 *
 * @param Center Background
 * @parent ------ GRAPHICS -------
 * @desc If Player is Near the HUD Will
 * Become Transparent.
 * @type file
 * @dir /img/pictures
 * @default PlayerCenterHud
 *
 * @param Character Face
 * @parent ------ GRAPHICS -------
 * @desc Enter Filename Without Extension (i.e: .png)
 * or Database Record. Animation Supported: 4 Frames.
 * @type text
 * @default $gameParty.leader()._Name;
 *
 * @param Animate Face?
 * @parent ------ GRAPHICS -------
 * @desc This will Crop Graphic, 64x64 at Frame 1,1 on a
 * SV_Battler template.
 * @type boolean
 * @on Yes
 * @off
 * @default false
 *
 * @param Status Gauges
 * @parent ------ GRAPHICS -------
 * @desc Select All Gauges. Match the Gauge List Positions
 * to the Gauge Variable List's Positions.
 * @type file[]
 * @dir /img/pictures
 * @default HPGauge
 *
 * @param ------- POSITIONS --------
 *
 * @param State Icon X
 * @parent ------- POSITIONS --------
 * @type number
 * @desc Horizontal Position of States  Icon
 * Within the HUD.
 * @default 0
 *
 * @param State Icon Y
 * @parent ------- POSITIONS --------
 * @desc Vertical Position of State Icon
 * Within the HUD.
 * @type number
 * @default 0
 *
 * @param HUD: TOP/BOTTOM
 * @parent ------- POSITIONS --------
 * @desc Align HUD to Top/Bottom of Screen.
 * @type select
 * @option Top
 * @value 0
 * @option Bottom
 * @value Graphics.height
 * @default 0
 *
 * @param HUD: LEFT/CENTER/RIGHT
 * @parent ------- POSITIONS --------
 * @desc Align HUD to Left/Center/Right of Screen.
 * @type select
 * @option Left
 * @value 0
 * @option Center
 * @value Graphics.width/2
 * @option Right
 * @value Graphics.width
 * @default 0
 *
 * @command open
 *
 *
*/
;

(() => {

    PluginManager.registerCommand('PlayerHud','open',args => {

    })

    var Imported = Imported || {};
    Imported.PlayerHud = true;
    var LadyLegend = LadyLegend || {};
    LadyLegend.PlayerHud = LadyLegend.PlayerHud || {};
    LadyLegend.parameters = PluginManager.parameters('PlayerHud');
    //REMOVES WINDOW BOX/OPACITY
    LadyLegend.PlayerHud._HUDfs    = String(LadyLegend.parameters['Finished Setup?']);
    //GRAPHICS
    LadyLegend.PlayerHud._HUDsb    = String(LadyLegend.parameters['Side Backgrounds']);
    LadyLegend.PlayerHud._HUDcb    = String(LadyLegend.parameters['Center Background']);
    LadyLegend.PlayerHud._HUDrb    = String(LadyLegend.parameters['Right Background']);
    LadyLegend.PlayerHud._HUDcf    = String(LadyLegend.parameters['Character Face']);
    LadyLegend.PlayerHud._HUDaf    = String(LadyLegend.parameters['Animate Face?']);
    LadyLegend.PlayerHud._HUDsg    = String(LadyLegend.parameters['Status Gauges']);
    LadyLegend.PlayerHud._HUDgv    = String(LadyLegend.parameters['Gauge Variables?']);
    //POSITIONS
    LadyLegend.PlayerHud._HUDgx  = String(LadyLegend.parameters['Gauge X']);
    LadyLegend.PlayerHud._HUDgy  = String(LadyLegend.parameters['Gauge Y']);
    LadyLegend.PlayerHud._HUDix  = String(LadyLegend.parameters['State Icon X']);
    LadyLegend.PlayerHud._HUDiy  = String(LadyLegend.parameters['State Icon Y']);
    LadyLegend.PlayerHud._HUDy    = String(LadyLegend.parameters['HUD: TOP/BOTTOM']);
    LadyLegend.PlayerHud._HUDx    = String(LadyLegend.parameters['HUD: LEFT/CENTER/RIGHT']);



//PLUGIN VARIABLES
const openWindow = Scene_Map.prototype.start;
let hudWidth = 200;
let hudHeight = 55;
const floor = Math.floor;
var newCharacterGraphic =  '';
//WINDOW CONTAINERS
Scene_Map.prototype.start = function() {
    openWindow.call(this);
    //THIS FUNCTIONS VARIABLES
    let x = eval(LadyLegend.PlayerHud._HUDx) == 0 ? 0 : eval(LadyLegend.PlayerHud._HUDx) == Graphics.width ? Graphics.width-hudWidth : Graphics.width/2-hudWidth/2;
    let y = eval(LadyLegend.PlayerHud._HUDy) == 0 ? 0 : Graphics.height-hudHeight;
    //WINDOW PARAMETERS
    this.actorHud = new Window_ActorHUD(new Rectangle(x, y, hudWidth, hudHeight));
    //OPACITY OF THE WINDOW BOXES
    this.actorHud.opacity = 255;

    //CREATES THE WINDOWS THE GRAPHICS ATTACH TO
    this.addChildAt(this.actorHud,1);
}


//GRAPHICS
class Window_ActorHUD extends Window_Base {
    //GRAPHICS/ANIMATIONS SETTINGS
    constructor(rect) {
        super(rect);
        //LEFT/RIGHT BACKGROUND GRAPHIC POSITION
        this.sidesBackground = new Sprite(ImageManager.loadPicture(LadyLegend.PlayerHud._HUDsb));
        this.sidesBackground.anchor.set(0.5);
        this.sidesBackground.x = eval(LadyLegend.PlayerHud._HUDx) == 0 ? hudWidth/1.5 :hudWidth-hudWidth/1.5;
        this.sidesBackground.y = eval(LadyLegend.PlayerHud._HUDy) == 0 ? hudHeight : 0;
        if(eval(LadyLegend.PlayerHud._HUDx) > hudWidth) this.sidesBackground.scale.x *= -1;
        if(eval(LadyLegend.PlayerHud._HUDx) == '0' || LadyLegend.PlayerHud._HUDgx == Graphics.width) this.addChildAt(this.sidesBackground,1);
        //CENTER BACKGROUND GRAPHIC POSITION
        this.centerBackground = new Sprite(ImageManager.loadPicture(LadyLegend.PlayerHud._HUDcb));
        this.centerBackground.anchor.set(0.5);
        this.centerBackground.x = eval(LadyLegend.PlayerHud._HUDx)-hudWidth*1.45;
        this.centerBackground.y = eval(LadyLegend.PlayerHud._HUDy) == 0 ? hudHeight : 0;
        if(eval(LadyLegend.PlayerHud._HUDx) == Graphics.width/2)this.addChildAt(this.centerBackground,1);
        //CHARACTER GRAPHIC POSITIONS
        this.characterGraphic = new Sprite(ImageManager.loadPicture($gameParty.leader()._name));
        this.characterGraphic.anchor.set(0.5);
        this.characterGraphic.x = eval(LadyLegend.PlayerHud._HUDx) == 0 ? hudWidth/4.2 : eval(LadyLegend.PlayerHud._HUDx) == Graphics.width ? hudWidth-hudWidth/4.2: hudWidth/2 ;
        this.characterGraphic.y = eval(LadyLegend.PlayerHud._HUDy) == 0 ? hudHeight : 0 ;
        if(eval(LadyLegend.PlayerHud._HUDx) < hudWidth) this.characterGraphic.scale.x *= -1;

        //ANIMATION FRAMES
        if(LadyLegend.PlayerHud._HUDaf == 'true') {
            this.animation = [    
            [0,0],
            [1,0],
            [2,0],
            [1,0]
        ];
        //ANIMATION SPEED SETTINGS
        this.animationSpeed = 60/15;
        this.tick = 0;
        this.frame = 0;
    }
    else {
        this.animation = [    
            [0,0],
        ]
        this.animationSpeed = 60/15;
        this.tick = 0;
        this.frame = 0;
    }
    };
    //CROP SIZE SETUP FOR ANIMATED GLOBAL GRAPHIC
    async calcSize(width, height) {
        return [
            floor(64),
            floor(64),
        ];  
    };
    //ANIMATED GRAPHIC CROPPED AND DISPLAYED
    setFrame(characterGraphic, x, y) {
       this.calcSize(characterGraphic.bitmap.width, characterGraphic.bitmap.height).then(f => {  
            x *= f[0];
            y *= f[1];
            characterGraphic.setFrame(x, y, f[0], f[1]);
            this.addChildAt(this.characterGraphic,3);
        })
    }
    update() {
        this.processOpenCloseButton();
        super.update();
        this.changeCharacterGraphics();
        this.processAnimationTicks();
        this.drawPartyLeaderStateIcon();  
    }
   
    processOpenCloseButton() {
        if(Input.isTriggered('ok')) {
            $gameSwitches.setValue(1,true);
            if(this.isOpen()) {
                this.close;
            } else {
                this.open;
            }
        }
    }
   
    changeCharacterGraphics() {  
        if (newCharacterGraphic != $gameParty.leader()._name) {
            newCharacterGraphic = $gameParty.leader()._name;
            this.removeChild(this.characterGraphic);
            this.characterGraphic = new Sprite(ImageManager.loadPicture(newCharacterGraphic));
            this.characterGraphic.anchor.set(0.5);
            this.characterGraphic.x = eval(LadyLegend.PlayerHud._HUDx) == 0 ? hudWidth/4.2 : eval(LadyLegend.PlayerHud._HUDx) == Graphics.width ? hudWidth-hudWidth/4.2 : hudWidth/2;
            this.characterGraphic.y = eval(LadyLegend.PlayerHud._HUDy) == 0 ? hudHeight : 0;
            if(eval(LadyLegend.PlayerHud._HUDx) < hudWidth) this.characterGraphic.scale.x *= -1;
        }
    }
   
    processAnimationTicks() {
        this.tick+=this.animationSpeed;
        if(this.tick>=60) {
            this.tick=0
            this.setFrame(this.characterGraphic, this.animation[this.frame][0], this.animation[this.frame][1]);
            this.frame++;
            if(this.frame>=this.animation.length) this.frame=0;
        };  
    }
   
    drawPartyLeaderStateIcon() {
        if($gameParty.leader().states().length != 0) this.drawIcon($dataStates[$gameParty.leader()._states].iconIndex, eval(LadyLegend.PlayerHud._HUDix), eval(LadyLegend.PlayerHud._HUDiy));
    }
}  
//End of Plugin
})();



You cannot, by default. The Input Check does not check what "ok" button is pressed, just that one of the three buttons is pressed.
If you don't care about compatibility and accept that this will invasivly affect other plugins and the default functionality, you could do this:
JavaScript:
Input.keyMapper[32] = "space";
at the start of your plugin.
This remaps the space key (code 32) away from ok and to a new keyword "space".
And then you can ise Input.isTriggered("space") to check if the spacebar is triggered.
This will prevent the spacebar from every working as an "ok" button, though.

Outside of my plugin, short of creating your own input system, that's the only way to be able to check for the spacebar.

I do understand that it may conflict with other plugins but does it completely crashes them or will one or the other button work depending on where the plugin is listed. If there is no way to tell I can put the remapping in an bool option and leave it up to the player to select a default button or script input to the use other plugin buttons(If that can even be done).


I'm not sure what you're doing there?

Why are you using Window_ActorHud? I thought, according to your code, the window is stored as actorHud in the scene?
View attachment 250738

I may have changed it. I initially had another Hud with this plugin but separated them to 2 separate plugins.
My bad, forgot the () in the example function I sent.

You're correct in that the close & open function only affects the message window, you need to use show & hide to also affect sprites & other elements linked to the window.

JavaScript:
    processOpenCloseButton() {
        if(Input.isTriggered('ok')) {
            if(this.visible) {
                this.hide();
            } else {
                this.show();
            }
        }
    }
Replace the processOpenCloseButton function with the above and it'll work.
My bad, forgot the () in the example function I sent.

You're correct in that the close & open function only affects the message window, you need to use show & hide to also affect sprites & other elements linked to the window.

JavaScript:
    processOpenCloseButton() {
        if(Input.isTriggered('ok')) {
            if(this.visible) {
                this.hide();
            } else {
                this.show();
            }
        }
    }
Replace the processOpenCloseButton function with the above and it'll work.

Hiding it works!... but show did not....

edit: Got it!!!! you had open and close before.. so when I changed it to hide and show I didn't t change the visible part!!!!!

Anyone AKA Godsend

Thank you too much!!!

I also learned so much from this that I feel confident working with windows now.

Original thread: https://forums.rpgmakerweb.com/threads/custom-window-help-solved.153796/