RMMV Help with Press Okay Yanfly Options core Fullscreen [YANFLY OPTIONS CORE]

Dungeonmind

Lvl 4000 Humanoid
Veteran
Joined
Sep 2, 2013
Messages
572
Reaction score
426
First Language
English
Primarily Uses
RMMV
Hey RM Community. I recently have decided to add a fullscreen option to the option menu and I am currently using yanfly options core and found this test value for an almost perfect full screen option ONLY they didn't include a press okay code with it I been trying to fiddle with it so my code in there is not really working it just keeps opening the game into fullscreen then back out again. (in and out when I press okay, left an right work fine.)

JavaScript:
{"Name":"\\i[1044]Fullscreen","---Settings---":"","HelpDesc":"\"Toggle between fullscreen or windowed mode.\"","Symbol":"fullscreen","ShowHide":"\"show = true;\"","Enable":"\"enabled = true;\"","Ext":"\"ext = 0;\"","---Functions---":"","MakeCommandCode":"\"this.addCommand(name, symbol, enabled, ext);\"","DrawItemCode":"\"var rect = this.itemRectForText(index);\\nvar statusWidth = this.statusWidth();\\nvar titleWidth = rect.width - statusWidth;\\nthis.resetTextColor();\\nthis.changePaintOpacity(this.isCommandEnabled(index));\\nthis.drawOptionsName(index);\\nthis.drawOptionsOnOff(index);\"","ProcessOkCode":"\"var index = this.index();\\nvar symbol = this.commandSymbol(index);\\nvar value = this.getConfigValue(symbol);\\nvar value = $gameSwitches.value(182);\\n\\n$gameSwitches.setValue(182, !value);\\nthis.changeValue(symbol, !value);\\nif (value === true) {\\nGraphics._requestFullScreen();\\n} else {\\nGraphics._cancelFullScreen();\\n};\"","CursorRightCode":"\"var index = this.index();\\nvar symbol = this.commandSymbol(index);\\nvar value = this.getConfigValue(symbol);\\nthis.changeValue(symbol, true);\\nGraphics._requestFullScreen();\"","CursorLeftCode":"\"var index = this.index();\\nvar symbol = this.commandSymbol(index);\\nvar value = this.getConfigValue(symbol);\\nthis.changeValue(symbol, false);\\nGraphics._cancelFullScreen();\"","DefaultConfigCode":"\"ConfigManager[symbol] = false;\"","SaveConfigCode":"\"config[symbol] = ConfigManager[symbol];\"","LoadConfigCode":"\"if (config[symbol] !== undefined) {\\n  ConfigManager[symbol] = !!config[symbol];\\n}\\nif (ConfigManager[symbol]) Graphics._requestFullScreen();\\nelse Graphics._cancelFullScreen();\""}

Copy all that code left to right and paste it and add as a new option to the options core plugin via edit text

So yeah I guess in order for someone to help me they would need to have knowledge of how yanflys options core for RPG Maker MV works.
 

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
2,957
Reaction score
2,292
First Language
EN
Primarily Uses
RMMZ
I dug up an old post of mine with a similar solution:
:kaohi: Oh, not sure why I didn't put anything for the "Process OK" part. This seems to work for me, though~
JavaScript:
var index = this.index();
var symbol = this.commandSymbol(index);
var value = this.getConfigValue(symbol);
this.changeValue(symbol, !value);
if (value) Graphics._cancelFullScreen();
else Graphics._requestFullScreen();
Little explanation: !value means "not value", i.e. it's false if value is true, and vice versa. :kaophew:

Here's my plaintext version including the above "Process OK Code":
Code:
{"Name":"\\i[0]Fullscreen","---Settings---":"","HelpDesc":"\"Toggle between fullscreen or windowed mode.\"","Symbol":"fullscreen","ShowHide":"\"show = true;\"","Enable":"\"enabled = true;\"","Ext":"\"ext = 0;\"","---Functions---":"","MakeCommandCode":"\"this.addCommand(name, symbol, enabled, ext);\"","DrawItemCode":"\"var rect = this.itemRectForText(index);\\nvar statusWidth = this.statusWidth();\\nvar titleWidth = rect.width - statusWidth;\\nthis.resetTextColor();\\nthis.changePaintOpacity(this.isCommandEnabled(index));\\nthis.drawOptionsName(index);\\nthis.drawOptionsOnOff(index);\"","ProcessOkCode":"\"var index = this.index();\\nvar symbol = this.commandSymbol(index);\\nvar value = this.getConfigValue(symbol);\\nthis.changeValue(symbol, !value);\\nif (value) Graphics._cancelFullScreen();\\nelse Graphics._requestFullScreen();\"","CursorRightCode":"\"var index = this.index();\\nvar symbol = this.commandSymbol(index);\\nvar value = this.getConfigValue(symbol);\\nthis.changeValue(symbol, true);\\nGraphics._requestFullScreen();\"","CursorLeftCode":"\"var index = this.index();\\nvar symbol = this.commandSymbol(index);\\nvar value = this.getConfigValue(symbol);\\nthis.changeValue(symbol, false);\\nGraphics._cancelFullScreen();\"","DefaultConfigCode":"\"ConfigManager[symbol] = false;\"","SaveConfigCode":"\"config[symbol] = ConfigManager[symbol];\"","LoadConfigCode":"\"if (config[symbol] !== undefined) {\\n  ConfigManager[symbol] = !!config[symbol];\\n}\\nif (ConfigManager[symbol]) Graphics._requestFullScreen();\\nelse Graphics._cancelFullScreen();\""}
:kaopride:
Just tested it and it still seems to work for me. :kaopride:
 

Dungeonmind

Lvl 4000 Humanoid
Veteran
Joined
Sep 2, 2013
Messages
572
Reaction score
426
First Language
English
Primarily Uses
RMMV
I dug up an old post of mine with a similar solution:

Just tested it and it still seems to work for me. :kaopride:

Unfortunately it does the exact same thing my code did. (in and out of fullscreen loop when pressing ok.)

Thanks for even trying for me though.
 
Last edited:

Zero_G

Veteran
Veteran
Joined
Mar 28, 2020
Messages
98
Reaction score
60
First Language
English
Primarily Uses
RMVXA
You have triacontane's StartUpFullScreen, as an alternative. This puts an option in the options menu to set if the game starts with full screen or not. Also adds a "Shutdown" option in the main menu to exit the game, but that's optional.

And if you want, attached is a modified version by me that, starts the game in fullscreen by default if no configuration file is found (for example first load of the game)
 

Attachments

  • StartUpFullScreen.js
    9 KB · Views: 0
Last edited:

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
2,957
Reaction score
2,292
First Language
EN
Primarily Uses
RMMZ
@Dungeonmind - I'm guessing it's a plugin conflict, then, because it worked OK for me in a v1.6.2 project with only YEP_OptionsCore v1.02 active. :kaoslp:
 

Dungeonmind

Lvl 4000 Humanoid
Veteran
Joined
Sep 2, 2013
Messages
572
Reaction score
426
First Language
English
Primarily Uses
RMMV
I'm guessing it's a plugin conflict, then, because it worked OK for me in a v1.6.2 project with only YEP_OptionsCore v1.02 active.

Nope, I tested in a blank project v1.6.2 and still have that window issue. I am using a Mac but I have never seen plugins do that before.

You have triacontane's StartUpFullScreen, as an alternative. This puts an option in the options menu to set if the game starts with full screen or not. Also adds a "Shutdown" option in the main menu to exit the game, but that's optional.

And if you want, attached is a modified version by me that, starts the game in fullscreen by default if no configuration file is found (for example first load of the game)

Sorry but that doesn't help me at all because I need to keep the Options Core plugin as I use it for many other options in my game that are vital.
 
Last edited:

Zero_G

Veteran
Veteran
Joined
Mar 28, 2020
Messages
98
Reaction score
60
First Language
English
Primarily Uses
RMVXA
And can't you disable the yep fullscreen plugin, while keeping the core plugin and using triacontane's StartUpFullScreen?
 

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
2,957
Reaction score
2,292
First Language
EN
Primarily Uses
RMMZ
@Zero_G - Yanfly's Options Core redefines the layout and behaviour of the options scene: all available commands must be redefined for the new structure (typically through the Options Core plugin parameters). Also, I think triacontane's plugin only affects fullscreen on game boot, rather than allowing it to toggle mid-game? :kaoswt:

@Dungeonmind - assuming you haven't edited your project's core scripts, I guess it's because you are using a Mac. Maybe a security feature? I'm curious if you can achieve a persistent fullscreen by any of these methods:
  1. In-game: press F4 (RPG Maker's default fullscreen toggle).

  2. In-game: press F8 to open the console, type Graphics._switchFullScreen(), press Enter (scripted toggle).

  3. Add a "fullscreen": true line to your project's manifest file, package.json, e.g.
    JavaScript:
    {
        "name": "",
        "main": "index.html",
        "js-flags": "--expose-gc",
        "window": {
            "title": "",
            "toolbar": false,
            "width": 816,
            "height": 624,
            "icon": "icon/icon.png",
            "fullscreen": true
        }
    }
    Note that this should cause the game to start in fullscreen and, for me at least, effectively disables the F4 toggle. You can use the Mac equivalent of Alt+F4 (Cmd+W?) to exit.
I get the impression that MacOS is much less back-compatible than Windows; if you haven't already, you might want to experiment with updating your NW.js version as mentioned here:
 

Latest Threads

Latest Posts

Latest Profile Posts

Of course, I bought a handful of games on the Steam Black Friday sale. Will I try them? Will I complete any? Who knows...
I don't really have any neat updates today about how I screwed up programming... But if you want to observe the intensenes of me programming, then you can check out my stream :)
New Weapons.gif
No more spam from me today, I promise! Just wanted to upload this, people have been giving me feedback that my weapon sprites (which were RTP) clashed badly with my battlers for ages, so today I finally took the plunge and updated them! Really happy with how they came out :D :D
So Facebook fraudulently took money from me. They even went through my PayPal accounts to find a card that had the money on it. Thinking about deleting my Facebook account because this doesn't happen on twitter, not even close.
Today the 2nd part of the RPGMakergame "A Thief's voyage" came out.


Go show DutchPowerCreations some love.

Forum statistics

Threads
116,995
Messages
1,103,692
Members
152,894
Latest member
NinjaBunny
Top