How to add fullscreen in the Yep_Options Cores?

Hello guys!

I don't know how to work this 🙁

Anyone can help this solve? because i want to this fullscreen in the Yep_Options Cores T_T

i have SRD_FullscreenToggleOption for added in Yep_Options Cores


I'm sorry because my english is bad if you understand this as well... 🙂
It seems SRD's plugin doesn't automatically add it to Yanfly's Options Core, regardless of the order. Since the fullscreen code is built into the engine (F4 during play) you won't need SRD's plugin for this.

To make the game go full-screen:
Code:
Graphics._requestFullScreen();
To undo full-screen and return to windowed mode:
Code:
Graphics._cancelFullScreen();
So, you can copy one of the default on/off options (e.g. Always Dash) and add these lines to the code for cursor right (on) and cursor left (off). 🙂

Here's my plaintext version of the option (for use in the Text tab) in case it helps:
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":"\"\"","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();\""}
Thank you! 🙂
Thank you for the code. I have an additional question: I have the code working but the default is fullscreen and I want the default to be windowed for now. How can I change the code? I've tried and thought it had to be either "Enable" or "Default Config Code" but I can't seem to get it correctly.
Thank you for the code. I have an additional question: I have the code working but the default is fullscreen and I want the default to be windowed for now. How can I change the code? I've tried and thought it had to be either "Enable" or "Default Config Code" but I can't seem to get it correctly.
It'd be more helpful to see exactly what you're working with, e.g. a plaintext copy of your option (Text tab when editing a plugin parameter's value), like I provided in my post. 😅

The default plugin parameter values of Yanfly's Options Core used to have an oversight where Default Config is ignored: it applies the default value, but then Load Config always overwrites that based on the saved settings...if it finds no saved value for the option, it gets set to !!undefined, i.e. false. Depending on your setup, you might be seeing the effects of this. (Not sure if that's been "fixed" since I last checked.) 😴

The plaintext example I posted previously features different Load Config code: it has a check for an undefined value, to ensure the default setting is only overwritten if it exists in the file~
JavaScript:
if (config[symbol] !== undefined) {
  ConfigManager[symbol] = !!config[symbol];
}
if (ConfigManager[symbol]) Graphics._requestFullScreen();
else Graphics._cancelFullScreen();
It'd be more helpful to see exactly what you're working with, e.g. a plaintext copy of your option (Text tab when editing a plugin parameter's value), like I provided in my post. 😅

The default plugin parameter values of Yanfly's Options Core used to have an oversight where Default Config is ignored: it applies the default value, but then Load Config always overwrites that based on the saved settings...if it finds no saved value for the option, it gets set to !!undefined, i.e. false. Depending on your setup, you might be seeing the effects of this. (Not sure if that's been "fixed" since I last checked.) 😴

The plaintext example I posted previously features different Load Config code: it has a check for an undefined value, to ensure the default setting is only overwritten if it exists in the file~
JavaScript:
if (config[symbol] !== undefined) {
  ConfigManager[symbol] = !!config[symbol];
}
if (ConfigManager[symbol]) Graphics._requestFullScreen();
else Graphics._cancelFullScreen();
Thanks! I started with exactly the same code you had in your previous example, but your insight helped me. Thanks again!
I have the problem that when copying this into the yanfly plugin menu, it can be only toggled by using the arrow keys, but ignores the Enter key and Mouseclicks. I tried to fix that by copying the part for the "Process Ok code" from the Dash command, which had the effect of making it look like it reacts to being clicked, however without actually toggling the screen.

Is there a possibility to make the option clickable?
👋 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. 😮‍💨

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();\""}
😤
👋 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. 😮‍💨

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();\""}
😤

Thank you very much! With CSXs' Exit, Yanfly's option core and now this, finally my game has the basic amenities to be playable comfortably.
After choosing the option in game the characters seem to move in the direction that was pushed all by themselves.

@Katarn, please refrain from necro-posting in a thread. Necro-posting is posting in a thread that has not had posting activity in over 30 days. You can review our forum rules here. Thank you.

Feel free to start a new thread of your own if you're having trouble with something. Sounds like an input/gamepad issue to me, but that's just a wild guess.

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-add-fullscreen-in-the-yep_options-cores.109232/