Friday Night Funkin' Cookbook
Friday Night Funkin' CookbookExpertCustom Menu

Custom Menu

Reading time: 1 minute

cautionCaution

This is a preview feature, not in current builds (only in a playtest preview build)

When enabling your mod, you might have an entirely custom menu you want to send the user to. Accomplishing this is simple, but requires a module. A very simple setup would be as follows:

import funkin.modding.module.Module;
import funkin.InitState;

import funkin.ui.MusicBeatState;

class TestMenu extends MusicBeatState {
  // Empty... you should put some code here
}

// A module is needed, specifically for the modules onCreate event

class Test extends Module
{
  public function new()
  {
    super("Test", 0);
  }

  var titleState:Bool = false;

  public override function onCreate(event:ScriptEvent):Void
  {
    super.onCreate(event);

    if (!titleState)
    {
        // Tells the game to go to our menu instead of the TitleState!
        InitState.customTitleState = new TestMenu();
        titleState = true; // if this was called again, just so it doesn't get created once more. (It shouldn't)
    }
  }
}

Now upon loading the game with your mod in the enabled list, you'll load the custom menu you specified. TitleState will not be reached, and you will now be in charge of where the user goes.

Quick Menu

You'll know it works because you're sent to that menu, but you'll also notice the quick menu (or quick panel), which will allow for you (and your players) to go between your mod and the original base game.

Specifically, you should avoid using 'tab' as a keybind as that is the quick menu open key.


Contributors:
Kade-gtihub
Last modified:
Created:
Category:  Expert
Tags: