Greetings all!
I am having an issue that I've been completely stumped on this afternoon.
What I am trying to do is create a title command button that opens up an external URL, so a player can quickly see the latest patch notes.
------------------
This can be accomplished with the following JS code using VisuStella's Core Engine:
However, after selecting the option on the title screen that runs the above code using the confirm/select key on my keyboard, the following happens:
1. The URL opens in a new browser tab just fine.
2. I alt-tab or click to get back into the game.
3. Keyboard functionality is partially lost. I can move between options with the arrow keys or joystick, but I cannot select any options with the confirm key.
4. The only way I can regain the functionally of the confirm/select key is to click on a title screen option with my mouse (For example, clicking Load Game). After Scene_Load opens, I now have the functionality of select/confirm returned to me, and the game operates as normal.
-------------------
Does anyone know why keyboard functionality is being lost when opening an external website from the game, and how I could go about preventing this from happening / changing the above code so that this does not happen?
Note: This is not being done through a Title Picture Button, but a Title Command. The reason is because Title Picture Buttons are not selectable using gamepad input.
Note 2: If I run the following code:
Immediately after the VisuMZ code shared above, then keyboard functionality is never lost. However, this causes the title screen to reload itself when the button is selected, which doesn't look the greatest, so it's not an ideal solution. Just sharing this here in case this knowledge has any value in the discussion.
I am having an issue that I've been completely stumped on this afternoon.
What I am trying to do is create a title command button that opens up an external URL, so a player can quickly see the latest patch notes.
------------------
This can be accomplished with the following JS code using VisuStella's Core Engine:
const url = "put your URL here";VisuMZ.openURL(url);However, after selecting the option on the title screen that runs the above code using the confirm/select key on my keyboard, the following happens:
1. The URL opens in a new browser tab just fine.
2. I alt-tab or click to get back into the game.
3. Keyboard functionality is partially lost. I can move between options with the arrow keys or joystick, but I cannot select any options with the confirm key.
4. The only way I can regain the functionally of the confirm/select key is to click on a title screen option with my mouse (For example, clicking Load Game). After Scene_Load opens, I now have the functionality of select/confirm returned to me, and the game operates as normal.
-------------------
Does anyone know why keyboard functionality is being lost when opening an external website from the game, and how I could go about preventing this from happening / changing the above code so that this does not happen?
Note: This is not being done through a Title Picture Button, but a Title Command. The reason is because Title Picture Buttons are not selectable using gamepad input.
Note 2: If I run the following code:
SceneManager.push(Scene_Title);Immediately after the VisuMZ code shared above, then keyboard functionality is never lost. However, this causes the title screen to reload itself when the button is selected, which doesn't look the greatest, so it's not an ideal solution. Just sharing this here in case this knowledge has any value in the discussion.