File information

Last updated

Original upload

Created by

ccld

Uploaded by

ccld

Virus scan

Safe to use

Tags for this mod

About this mod

SKSE plugin that provide an elegant interface to invoke mod function.

Requirements
Permissions and credits
Changelogs
SKSE plugin that provide an elegant interface to invoke mod function.

Motivation
Mods trend to add new functions to game. Some functions require manual triggering (e.g., toggle a feature, open a menu). In general, mod authors can use the following methods:
  • Hotkey: The fastest and most convenient method. But the number of keys is limited and it's hard to remember every hotkeys. Hotkey conflicts are a headache inducing issue.
  • Spell: Its advantage is that it can have a target (other methods can have target too but not intuitive). But equip/cast/unequip spell is boring.
  • MCM: It works, of course. But MCM is originally design for config... It's slow to open. And it has all MCM related issues. For example, it requires an ESP and a script.
Mod Function Menu (MFM) try to provide an unified entry point for invoking C++ mod function to (partially) solve the problems of above methods. For SKSE plugin authors, register function to MFM is easier than processing input event.

UI
MFM has a ImGui powered UI. It allows you to explore registered mod functions. It's similar to a file explorer.
It allows mod functions to be organized like folder/file. Click an entry can go into the sub-folder or invoke function. Click .. to back to parent folder.


Section
Section is used to organize config files by category. Currently there are two sections: Mod and Config.
  • Mod: Most mods should put their config files in this section to provide general functions.
  • Config: Design for re-load mods' config, for SKSE plugin authors who don't want write MCM or custom UI but want to support reload config without restart game.

Config Files
All mod functions are registered via config files at Data/SKSE/Plugins/ccld_ModFunctionMenu/ folder. The layout of config files is the same as showed in UI.

The design of config files decoupled dependency relationships between DLLs. Minimize changes to existing code if they want to support MFM.

Even if you don't understand C++ code, you can adjust menu layout by moving and renaming files.

Requirements

Installation
Use your mod manager.
Expand Requirements to see which mods utilize MFM! If you don't have idea, Toggle UI is a good MFM example. Install that mod to try MFM!

Usage

Press F1 to open MFM, press F1 or Esc to close.
Hotkey can be configured at Data/SKSE/Plugins/ccld_ModFunctionMenu.toml
Gamepad is supported but it's hotkey is disabled by default. Configure ccld_ModFunctionMenu.toml to enable it.

Font
Since v1.0.0, use font from ImGui Resources by default, user can change font by configuring ccld_ModFunctionMenu.toml

Translation
English and Chinese translation are included. UI text at Interface\Translations\ccld_ModFunctionMenu_english.txt, MFM entry can be translated by simply renaming toml file.

中文用户只需要在配置文件中设置 sLanguage = "chinese" 即可,无需覆盖英文的翻译文件。

Compatibility
Compiled with CommonLibSSE-NG, should work on SE/AE/VR theoretically.

Future Plan
Font support. Done in v1.0.0
Translation support. Done in v1.0.0
Improve UI style.
Message function type.
IED/OAR like welcome banner.

For developers
The mod function is a C++ function with extern "C" [[maybe_unused]] __declspec(dllexport) exported by SKSE plugin. Exporting functions is very simple, and there is basically no need to do anything extra. MFM uses GetModuleHandleW and GetProcAddress to find function. So you have to tell MFM your dll name and func name in config files.

See SDK for some useful information. Although you generally don't need the SDK, it has some references.
See here about how to export you functions. See here about how to write config files.

Credits
CharmedBaryon for CommonLibSSE-NG
powerofthree, the ImGui code is based on po3's PhotoMode and Dialogue History
slavicpotato1's Immersive Equipment Displays for ImGui code and input block code
Ershin for Open Animation Replacer
dTry for Wheeler
mlthelama for LamasTinyHUD

Source
  翻译: