Call Enter button

Jackiefly

Villager
Member
Joined
Jun 21, 2016
Messages
14
Reaction score
1
First Language
English
Primarily Uses
Hi there. I'm using a menu plugin In-game and I need to touch Enter button in my keyboard to enter to the sub-menus but the problem is I'm making the game for Phone so, there's a way to call the enter button when I touch the sub-menu Icon?


Now, one of the categories is something like this:


Scene_Menu.prototype.setIndex1 = function() {
        this._currentIndex = 0;
        this.cancelScaling();
        if(touchpadControl)SoundManager.playCursor();


This is one of the menu plugins of  Soul X Regalia, there's an option inside the plugin which let you touch the screen to select the categories but only that, it's not working to enter to that category.


I've tryed to put a push under that line:


Scene_Menu.prototype.setIndex1 = function() {
        this._currentIndex = 0;
        this.cancelScaling();
        if(touchpadControl)SoundManager.playCursor();


        SceneManager.push(Scene_Status);


And it works but only for the normal sub-menus by default in-game, but for something external like an enemy book or a quest plugin does not work, so the only solution (I think) is make a call


to the enter button, saying to the code that when the category is touched, force to use the Enter button.
 

Lantiz

PunyMagus
Veteran
Joined
Dec 29, 2012
Messages
723
Reaction score
1,074
First Language
Portuguese
Primarily Uses
Other
I know it's the learning forum, but maybe this plugin can help you somehow:





Now if you really want to learn how to trigger a button, probabbly (dint check so well, I'm in not very motivated latelly... sorry about that :/ )


it's going to be something like this, i guess...
 


Window_Selectable.prototype.processHandling = function() {
//if (this.isOpenAndActive()) { //commented the line so you know what changed... not sure tho as I said before xD
if (this.isOkEnabled() && this.isOkTriggered()) {
this.processOk();
} else if (this.isCancelEnabled() && this.isCancelTriggered()) {
this.processCancel();
} else if (this.isHandled('pagedown') && Input.isTriggered('pagedown')) {
this.processPagedown();
} else if (this.isHandled('pageup') && Input.isTriggered('pageup')) {
this.processPageup();
}
//}
};


Took this from rpg_windows.js
You can check the source, maybe you find it better [:
 
Last edited by a moderator:

Jackiefly

Villager
Member
Joined
Jun 21, 2016
Messages
14
Reaction score
1
First Language
English
Primarily Uses
I know it's the learning forum, but maybe this plugin can help you somehow:





Now if you really want to learn how to trigger a button, probabbly (dint check so well, I'm in not very motivated latelly... sorry about that :/ )


it's going to be something like this, i guess...
 



Window_Selectable.prototype.processHandling = function() {
//if (this.isOpenAndActive()) { //commented the line so you know what changed... not sure tho as I said before xD
if (this.isOkEnabled() && this.isOkTriggered()) {
this.processOk();
} else if (this.isCancelEnabled() && this.isCancelTriggered()) {
this.processCancel();
} else if (this.isHandled('pagedown') && Input.isTriggered('pagedown')) {
this.processPagedown();
} else if (this.isHandled('pageup') && Input.isTriggered('pageup')) {
this.processPageup();
}
//}
};


Took this from rpg_windows.js
You can check the source, maybe you find it better [:
The plugin is not what I'm searching for, it does not trigger the Enter button, and the code from the Windows.js not working..... I'm thinking about find where is the logic of the action button, I mean, the button enter only triggers a logic for an action button, so, It will be good find where is this logic... but no idea about where is it.
 

Lantiz

PunyMagus
Veteran
Joined
Dec 29, 2012
Messages
723
Reaction score
1,074
First Language
Portuguese
Primarily Uses
Other
Oh I see....


I know the plugin is not exactly what you are lokoing for, but as you stated the problem is so the sub menu could work on phones, the plugin removes the need for the command activation, which means: if the user touch the submenu it's going to be activated without the need to activate the main menu.


The codes related to processing the touch are those from Window_Selectable class:

  • processHandling
  • processTouch
  • onTouch
  • activate
  • processOk

I'm not sure about how do you want to change it tho...


Also, Maybe the plugins you are using are changing the default behavior, I'm not aware of those
 

Jackiefly

Villager
Member
Joined
Jun 21, 2016
Messages
14
Reaction score
1
First Language
English
Primarily Uses
Oh I see....


I know the plugin is not exactly what you are lokoing for, but as you stated the problem is so the sub menu could work on phones, the plugin removes the need for the command activation, which means: if the user touch the submenu it's going to be activated without the need to activate the main menu.


The codes related to processing the touch are those from Window_Selectable class:

  • processHandling
  • processTouch
  • onTouch
  • activate
  • processOk

I'm not sure about how do you want to change it tho...


Also, Maybe the plugins you are using are changing the default behavior, I'm not aware of those
I fixed everything I could. I just used a push.Scene in each part and the external parts as the enemy book I had to use an object with an event...but well, it's working. Thanks for everything
 

Lantiz

PunyMagus
Veteran
Joined
Dec 29, 2012
Messages
723
Reaction score
1,074
First Language
Portuguese
Primarily Uses
Other
Nice.


Sorry I could not be of much help.


Anyway, good luck.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

He mad, but he cute :kaopride:

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!

Forum statistics

Threads
106,036
Messages
1,018,461
Members
137,821
Latest member
Capterson
Top