Monster Hunter Rise
0 of 0

File information

Last updated

Original upload

Created by

Bolt

Uploaded by

BoltTheMan

Virus scan

Safe to use

About this mod

A user-friendly IMGUI inspired API for drawing in-game settings menus for REF mods in MHRise

Requirements
Permissions and credits
Changelogs
WAHOOO
This was a tricky project for sure
This bad boy has so much black magic in it. *Slaps the GitHub Repo*


Anyways:


~What Does It Do?~
Well, not much on its own.
But in the hands of mod authors, settings menus can be added directly to the in-game options menu through a simple API.
The API functions are very similar to imgui, with a few caveats*




~What Do I Have To Do?~
Just install the mod like any other REFramework mod.
If you don't know how to do that, this probably shouldn't be your first rodeo.
Once in the right place, it should automatically add a "Mods" category to the options menu.
Then simply by using other supported REF mods, settings will show up there.




For Mod Authors:
Download the example mod implementation from the files and that should get you started pretty easily.
For more API detail you can look at the GitHub page.
I promise it's almost as easy to use as the built in imgui functions, and it'll be really cool to see the community add menus!
Just require the package and use the API like imgui.
You can optionally check to see if the user has the package installed, and optionally support the menus so you don't have to force people to install it. But it'd be nice if you could still mark this as a required file.

I ask that you don't redistribute this mod along with your mods, at convenient as that'd be.
I worked hard on this, but also I might need to update things here, and you wouldn't want conflicting versions in various mods.
Do let me know if you release a mod using this menu so I can add it to the list of supported mods!


Limitations*
Unfortunately, because this uses the games own menus, we're limited to what the game can do natively.
There's no advanced drawing functionality obviously.
It only mimics an imgui, really the "draw" functions are callbacks to grab data from the games UI, you can have dynamic menus but try not to do anything too crazy.
It won't be a good fit for every mod, but if all you need is some simple settings, please consider it!




~Credits~
Thanks to Stracker for (making cool mods but also [without permission]) letting me reference one of their mods for the coroutines and system message prompts. And also like, actually adding the coroutines to REF.
And of course, thanks to praydog for all the work they do on REFramework, and for giving some guidance on this.

Contributions:
raffRun - Auto wrapping tooltips
Stracker - Finding a way to read GUID data from pointers within lua
HookedBehemoth - Implemented Stracker's findings



Discord: Bolt#6265
GitHub: https://github.com/BoltManGuy/MHR-InGame-ModMenu-API



Mods Using This Menu:




Ramblings and Fun-Facts:
I got a lot of dumb stuff to say because this project took it's toll on me.
This was one of the most difficult challenges I've had in recent memory, other than making a rhythm game for a 48 hour game jam ?
The game really does not want you doing this and will crash at every chance if you aren't doing things perfectly.
Forget to add_ref that array? Crash. Strings? Crash. Option data? Crash.
Call the update function from anywhere within the games ui functions? Crash.
Don't have data filled for options that dont even need it? Crash.
I digress, but I must've crashed the game nearly a hundred times.
But I think all this made it a particularly engaging challenge, I haven't been this glued to a project in a while. It always felt tantalizingly close to working, but always having some major issue to overcome.



Some interesting notes:
The mod tab in the category list is actually a copy of the save data tab because there's no way to add additional types, so I swap out the data based on the scroll list index.
For a good while I was co-opting the advanced graphics settings menu as a means of getting sub menus working and it almost worked until I found out they basically hard coded that menu to only have five items in the list for some reason... and of course the game crashes if you set it to another other than 5.
Plus for some god forsaken reason the sliders don't receive mouse input in that menu, so eventually I just found the right combination of things to call to be able to turn options into buttons kinda and swap out the data and repaint the thing so it switches submenus without ever actually changing menu.
And the logic for all this was unavoidably complex..

Due to a limitation of REF I actually wrote a small C++ plugin to go along with this that's sole purpose is to take a pointer to a GUID and dereference it so I can get the data out of it. Without this, the entire thing wouldn't work as there'd be no way to override the games localized strings properly.
It wasn't too bad, but setting up the C++ project with lua and sol2 was dreadful.. The guides barely helped.
Similarly, for some reason I couldn't set GUID values to objects in REF, but was able to get around this by directly writing the data using write_dword at the right offsets.

At the end of the day I think the result is really cool.
I almost don't care if anyone uses it as just seeing it working was reward enough, but I think people will like this.

Feel free to suggest features I guess, but I am definitely going to be lazy after all this.
That's probably about it for now, hope you enjoy!