I updated the Electron.js files and pushed a new build to steam, but the behavior still persists.
Viewing post in NekoGakuen SteamworksPlus comments
Well, let me ask... Did you also replace/update the resources\app\index.js file? The main changes I made were in index.js.
Alternatively, if you need help, you can send me your project at rabbitrabbitteaparty@gmail.com. You can remove some of your original assets/content first and send me a simplified version of the project containing only the plugins and other necessary files for testing.
I checked out the index.js file noticed you set F4 to toggle fullscreen (which I had actually disabled in my game). Pressing F4 causes fullscreen to work as intended.
I have a custom options menu which I use to toggle fullscreen, which uses an event that triggers a script (Graphics._requestFullScreen), and when I use that it minimizes when pressing escape.
Can I call your functions in index.js directly from an event?
Regarding the F4 toggle: if you want to disable the F4 key from toggling fullscreen mode, you can remove the following code from index.js:
const isF4 = input.key === "F4" && !input.alt && !input.control && !input.meta; if (isF4) { event.preventDefault(); toggleGameFullscreen(); return; }
Then, if you want to trigger fullscreen yourself, you can use the following code:
require("electron").ipcRenderer.send("setFullscreen");
or:
require("electron").ipcRenderer.send("toggleFullscreen"); This gets me 99% of the way there. Is there a way to check if fullscreen is enabled? When my options menu loads it checks to see if fullscreen is enabled and sets the on/off toggle accordingly, but without a way to check if the game is fullscreen on loading the menu this breaks.
I had implemented this with
$gameSwitches.setValue(48, Graphics._isFullScreen())
but obviously this is no longer setting the switch correctly with this new function.
Let me see... First, in your index.js, find the following code:
ipcMain.on( "toggleFullscreen", function () { toggleGameFullscreen(); } );
Then add this directly below it:
ipcMain.handle("isFullscreen", function () { return win ? win.isKiosk() : false; });
After that, you can use the following code in your game to check whether fullscreen is enabled and set the switch accordingly:
require("electron").ipcRenderer.invoke("isFullscreen").then(function(isFullscreen) { $gameSwitches.setValue(48, isFullscreen); });
This will set Switch 48 to ON when the game is in fullscreen mode, and OFF when it is not.