Where is the isOpen() method?

Status
Not open for further replies.

GE_Peter

Villager
Member
Joined
Dec 13, 2016
Messages
28
Reaction score
3
First Language
English
Primarily Uses
RMMV
In the main engine code, in Window_Base there is this method:

Window_Base.prototype.open = function() {
if (!this.isOpen()) {
this._opening = true;
}
this._closing = false;
};


I tried looking for the isOpen() method to see exactly what it was checking, but even a search of all .js files comes up with nothing. Does anyone know where isOpen() is defined?
 

TSR

The Northern Frog
Veteran
Joined
Nov 14, 2019
Messages
215
Reaction score
163
First Language
French
Primarily Uses
RMMV
it's a javascript default method. return true if the object window is open...
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,338
Reaction score
1,495
First Language
English
Primarily Uses
RMMV
It's not a javascript default method, but it is one of the functions of rpg_core.js:

Code:
/**
 * Returns true if the window is completely open (openness == 255).
 *
 * @method isOpen
 */
Window.prototype.isOpen = function() {
    return this._openness >= 255;
};
 

TSR

The Northern Frog
Veteran
Joined
Nov 14, 2019
Messages
215
Reaction score
163
First Language
French
Primarily Uses
RMMV
lol, so true! :guffaw:
Guess I need some rest... :headshake:
 

GE_Peter

Villager
Member
Joined
Dec 13, 2016
Messages
28
Reaction score
3
First Language
English
Primarily Uses
RMMV
Aha, there it is in rpg_core! Not only that, it really helps with what I'm trying to do.

I googled JavaScript default and pixi.js functions, and thought I searched the rpg maker files properly. I even found a todo note to some dev called Ivan that was accidentally left in rpg_scenes.js, but not isOpen.

Anyway, that was poor global searching on my part, thanks a lot for your help!


*edit*
still failing at searches today... where the heck is the 'mark as solved' button?
 
Last edited:

Restart

Veteran
Veteran
Joined
Mar 15, 2019
Messages
523
Reaction score
410
First Language
English
Primarily Uses
RMMV
In the main engine code, in Window_Base there is this method:

Window_Base.prototype.open = function() {
if (!this.isOpen()) {
this._opening = true;
}
this._closing = false;
};


I tried looking for the isOpen() method to see exactly what it was checking, but even a search of all .js files comes up with nothing. Does anyone know where isOpen() is defined?
A neat trick for solving this in the future: use the chrome debugger and put a breakpoint just before the .isopen, then when it hits the breakpoint, advance step-by-step into the .isOpen function that gets called
 

GE_Peter

Villager
Member
Joined
Dec 13, 2016
Messages
28
Reaction score
3
First Language
English
Primarily Uses
RMMV
Great tip, thanks!
 

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
6,978
Reaction score
4,730
First Language
Dutch
Primarily Uses
RMXP

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.

 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

When you realize @Kupotepo is a champion among RM Web users, and it all makes sense now:
Worst nightmare this morning, tried to get 20 minutes of work done on my project before heading to work and got hit with a POWER SURGE. Restarted my computer and the project was CORRUPTED, luckily I made a back up a few days ago so I only lost 4 days of work but still
Ami
what the other name of Elixir?

many games are use that,i want name it different.
What does your project folder look like?
I was told that an iPhone can provide a personal internet hotspot...You learn something new everyday!

Forum statistics

Threads
100,459
Messages
976,187
Members
132,082
Latest member
nwr
Top