RMMV Any reason this doesn't change the text?

Morpheus

Jack-of-Trades
Veteran
Joined
Mar 14, 2012
Messages
231
Reaction score
85
First Language
english
Primarily Uses
N/A
JavaScript:
Window_ShopCommand.prototype.makeCommandList = function() {
    this.addCommand(TextManager.buy,    'buy');
    //this.addCommand(TextManager.sell,   'sell',   !this._purchaseOnly);
    this.addCommand(TextManager.cancel, 'finish');
};
It correctly removes the sell option but for some reason doesn't change 'cancel' to 'finish'.
 

SeaPhoenix

Veteran
Veteran
Joined
May 14, 2015
Messages
251
Reaction score
232
First Language
English
Primarily Uses
RMMV
It looks like you changed the original
Code:
this.addCommand(TextManager.cancel, 'cancel');
to
Code:
this.addCommand(TextManager.cancel, 'finish');
The text that's shown in the game is the first argument in the function above (TextManager.cancel, which refers to whatever you have in the Database > Terms > Cancel). The second argument, which was originally 'cancel' but which you changed to 'finish', is actually a symbol that's called by the setHandler function in rpg_scenes.js to perform an action (i.e., act as a Cancel button).

So unless you actually created a new setHandler function for 'finish' your new code won't do anything (and may show an error in the console when you select it) and the term in the database for 'Cancel' will still be used.

Long story short, if you just want to change the text in this particular screen to 'Finish' and retain its functionality as the 'Cancel' button, do this:

Code:
this.addCommand('Finish', 'cancel');
Alternatively, if you want every menu to show 'Finish' instead of 'Cancel', stick to the original Javascript code but change the term in the Database instead.
 

Morpheus

Jack-of-Trades
Veteran
Joined
Mar 14, 2012
Messages
231
Reaction score
85
First Language
english
Primarily Uses
N/A
It looks like you changed the original
Code:
this.addCommand(TextManager.cancel, 'cancel');
to
Code:
this.addCommand(TextManager.cancel, 'finish');
The text that's shown in the game is the first argument in the function above (TextManager.cancel, which refers to whatever you have in the Database > Terms > Cancel). The second argument, which was originally 'cancel' but which you changed to 'finish', is actually a symbol that's called by the setHandler function in rpg_scenes.js to perform an action (i.e., act as a Cancel button).

So unless you actually created a new setHandler function for 'finish' your new code won't do anything (and may show an error in the console when you select it) and the term in the database for 'Cancel' will still be used.

Long story short, if you just want to change the text in this particular screen to 'Finish' and retain its functionality as the 'Cancel' button, do this:

Code:
this.addCommand('Finish', 'cancel');
Alternatively, if you want every menu to show 'Finish' instead of 'Cancel', stick to the original Javascript code but change the term in the Database instead.
Big OOF from me, been working with MV for a long time and never realized I could change the shop text in the editor. :rolleyes: Thank you...
 

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

Latest Threads

Latest Posts

Latest Profile Posts

People3_5 and People3_8 added!

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.

Forum statistics

Threads
105,868
Messages
1,017,085
Members
137,585
Latest member
Reversinator
Top