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
217
Reaction score
165
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,369
Reaction score
1,537
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
217
Reaction score
165
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
7,001
Reaction score
4,743
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

ESAMarathon on Twitch, now streaming "Eat Girl". Yep, that's the title of a game... Apparently it's a Pacman knockoff.... Which is of course the only logical conclusion one would get from a name like "Eat Girl". :kaopride: I can't believe anybody would think anything else! :kaoback:
Super stoked i just finished my first town in my project, by finished i mean i can always add more decorative aesthetics and the NPCs don't talk yet but the mapping is complete and all the important chess pieces are present!
My brain: Hey, I have an idea how to make the transition to the main story quest in The Wastes more natural!
Me: Good!
My brain: You need to remake the hotel you start out in, it's not realistic enough.
Me: Ok... This was unexpected, but I can do it.
My brain: Now make each hotel floor 5 times as large to match the main part. Oh, you also need to make a bunch of new npcs to fill in the space on these maps.
Me: Crap.
Should be able to release Haxe MV/MZ next weekend.
It look that somehow MZ tracks are messed up (for example battle4 is obviously a theme, castle2 is a ship, ship1 is a scene and so on..). Maybe they just named them after with some ambiguity.

Forum statistics

Threads
100,618
Messages
977,838
Members
132,228
Latest member
zhengdddddd
Top