-
Notifications
You must be signed in to change notification settings - Fork 11
Code Documentation
Last updated March 1st 2023
LunaKit is a C++ add-on to Super Mario Odyssey, built off of CraftyBoss's ImGui ExLaunch Base Repo. This program is designed to be extremely modular and customizable for adding or editing its features. Every major element of LunaKit will be covered in this documentation wiki page, please refer to the table of contents below OR click the links in the code itself to jump straight to that part of the documentation
The DevGuiManager (LunaKit Manager) is the root class that controls every other part of LunaKit. Edits to this class are required to add nearly any new features, including new windows and home bar tabs.
This class is a singleton, meaning there is only one static instance of it that exists at all times (initalized in the game's GameSystem::init function, hook found in main.cpp)
Jump to table of contents
LunaKit's current version is found at the very top of the DevGuiManager header as LUNAKITVERSION
It is recommended this string is updated to a new value any time a new feature/major change is added (new window, new feature, major overhaul, ect.) This is not just as a note of current version for developers!! The current version is used to make sure the LunaKit save data is never using outdated information and causing issues.
Jump to table of contents
Update this! In the process of replacing manual copy-paste-y constructor and push with template factory function
Jump to table of contents
Update this! In the process of replacing manual copy-paste-y constructor and push with template factory function
Jump to table of contents
The manager runs two seperate update functions during a frame, update() and updateDisplay(). Here are the key differences between these functions:
update(): Update is called every frame off of the HakoniwaSequence hook, mainly used to execute code that affects the game. A good example of this is setting a boolean on clicking a box in updateDisplay(), and then handling that interaction in update(). In the update function, you have no control over the ImGui display and it is not recommended to try and use anything from the ImGui library in this function. It's worth noting that home menu tabs do NOT have standard update functions, everything set by those tabs should be run during the display update. This function is always called every frame, even if the interface is closed
updateDisplay(): This function is called far later during ImGui's drawing process and is responsible for rendering every window, home menu tab, and everything else visual. Most features share updateDisplay functions that are called off of the manager including Windows, Home Tabs, and Categories. You can add your own code into this through classes that inherit from these classes and override their updateDisplay functions. This function is not called if the interface is closed (hiding the windows with the left stick does not count as closed, code will still be run)
Jump to table of contents
Anchoring is a system handled by the manager that controls how the windows are displayed.
There are four different anchor positions:
- Top
- Bottom
- Left
- Right
Window positions and sizes are refreshed any time that refreshAnchor() or setAnchorType() is called, the exact positioning of these windows is determined based on the Window's setupAnchor() function. Each window has can either be anchored or non-anchored, as well as having total anchor pages. The amount of pages determines the size of the window, the larger the number the more room will be given (proportional to total open windows/pages) More detail given at Anchored vs. Non-anchored in the Window Documentation.
Jump to table of contents
LunaKit created by Amethyst-szs
A Mario Odyssey tool built off Dear ImGui for developers, level builders, glitch hunters, and everyone in-between