skip one confirmation button press SRD_StatDistribution

thalesgal

Veteran
Veteran
Joined
Dec 23, 2016
Messages
195
Reaction score
45
First Language
Portuguese
Primarily Uses
RMMV
Hello guys,
I would like to ask your help to change a simple thing in this plugin:

stat plugin chages.jpg

- I know that doing this the only way to exit the window will be pressing the cancel button on the keyboard.
It´s ok for me


I'm asking for this because I would like to skip the "Spend" button press step.


That´s it! Thank you very much in advance for help me!

Here is the plugin:
http://sumrndm.site/stat-distribution/
 
Last edited:

Aloe Guvner

Walrus
Veteran
Joined
Sep 28, 2017
Messages
1,628
Reaction score
1,115
First Language
English
Primarily Uses
RMMV
FYI from SRD's terms of use:

– You are NOT allowed to redistribute these Plugins.
Better to remove the attachment & code from your post and just put a link to the plugin. It has the added benefit of always linking to the most updated version (it won't be different here, but it's good advice in general)
 

thalesgal

Veteran
Veteran
Joined
Dec 23, 2016
Messages
195
Reaction score
45
First Language
Portuguese
Primarily Uses
RMMV
Please, it's possible to do that? I'm not good with code so I need some help.

Thank you in advance.
 

thalesgal

Veteran
Veteran
Joined
Dec 23, 2016
Messages
195
Reaction score
45
First Language
Portuguese
Primarily Uses
RMMV
Sorry guys! Please, anyone can help me?
 

thalesgal

Veteran
Veteran
Joined
Dec 23, 2016
Messages
195
Reaction score
45
First Language
Portuguese
Primarily Uses
RMMV
Bump. I don´t know how to do this on my own. :asad:
 

thalesgal

Veteran
Veteran
Joined
Dec 23, 2016
Messages
195
Reaction score
45
First Language
Portuguese
Primarily Uses
RMMV
Hello!! Please let me know, does it´s something very hard to do? Because if it is, then I will find another way, may be another plugin.

Thank you in advance!
 

Aloe Guvner

Walrus
Veteran
Joined
Sep 28, 2017
Messages
1,628
Reaction score
1,115
First Language
English
Primarily Uses
RMMV
Hey I'll take a look tonight. Any extra considerations or weird behaviors? Seems pretty straightforward
 

thalesgal

Veteran
Veteran
Joined
Dec 23, 2016
Messages
195
Reaction score
45
First Language
Portuguese
Primarily Uses
RMMV
@Aloe Guvner Hello!!! Thank you for your help!!
Any extra considerations or weird behaviors?
No, the plugin works perfectly. In my case, this change is only to facilitate the mechanism for the user. Because my game is for mobile, and it's kind of weird that step of pressing the "spend" button.
 

Aloe Guvner

Walrus
Veteran
Joined
Sep 28, 2017
Messages
1,628
Reaction score
1,115
First Language
English
Primarily Uses
RMMV
When the player presses "Finish", what would happen? They return to the main menu?

Edit:
Here's the code, add as a new plugin directly below SRD_StatDistribution
The following modifications are done:
  1. The command window no longer appears
  2. The distribution window is auto selected
  3. Pressing "Finish" from the distribution exits the scene
  4. Pressing cancel from the distribution window also exits the scene
  5. PageUp & PageDown switches actors in the distribution window
Code:
/*:
 * @plugindesc Modifies SRD_StatDistribution to remove the command window
*  ALOE_SRD_StatDistribution_Mod
 * @author Aloe Guvner
 *
 * @help
 * The following modifications are done:
 * 1. The command window no longer appears
 * 2. The distribution window is auto selected
 * 3. Pressing "Finish" from the distribution exits the scene
 * 4. Pressing cancel from the distribution window also exist the scene
 * 5. PageUp & PageDown switches actors in the distribution window
 *
 */

(function(){
    
/** Overwrite this method to create the window but not add it visually to the scene */
Scene_Distribute.prototype.createCommandWindow = function() {
    const wy = this._helpWindow.height;
    this._commandWindow = new Window_DistributeCommand(0, wy);
    this._commandWindow.setHelpWindow(this._helpWindow);
};

var Scene_Distribute_distributeFinish = Scene_Distribute.prototype.distributeFinish;
Scene_Distribute.prototype.distributeFinish = function() {
    Scene_Distribute_distributeFinish.call(this);
    this.popScene();
};

var Scene_Distribute_distributeCancel = Scene_Distribute.prototype.distributeCancel;
Scene_Distribute.prototype.distributeCancel = function() {
    Scene_Distribute_distributeCancel.call(this);
    this.popScene();
};

var Scene_Distribute_create = Scene_Distribute.prototype.create;
Scene_Distribute.prototype.create = function() {
    Scene_Distribute_create.call(this);
    this.commandSpend();
};

var Scene_Distribute_createDistributeWindow = Scene_Distribute.prototype.createDistributeWindow;
Scene_Distribute.prototype.createDistributeWindow = function() {
    Scene_Distribute_createDistributeWindow.call(this);
    this._distributeWindow.setHandler('pagedown', this.distributeNextActor.bind(this));
    this._distributeWindow.setHandler('pageup',   this.distributePreviousActor.bind(this));
};

Scene_Distribute.prototype.distributeNextActor = function() {
    this._distributeWindow.restartInfo();
    this.distributeEnd();
    this.nextActor();
    this.commandSpend();
};

Scene_Distribute.prototype.distributePreviousActor = function() {
    this._distributeWindow.restartInfo();
    this.distributeEnd();
    this.previousActor();
    this.commandSpend();
};

})();
 
Last edited:

thalesgal

Veteran
Veteran
Joined
Dec 23, 2016
Messages
195
Reaction score
45
First Language
Portuguese
Primarily Uses
RMMV
Wonderful!! I'd give you a thousand likes if I could. It worked perfectly!
Thank you very much, this was very important to me!
 

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

Latest Threads

Latest Profile Posts

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.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,867
Messages
1,017,062
Members
137,575
Latest member
akekaphol101
Top