Prepare for future development#1
Open
binyamin555 wants to merge 8 commits into
Open
Conversation
Now that I think about it, I should've probably made a different project for testing.. Because now the mod template is not really a template anymore
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains some updates, including:
PlayerNamefor now)The new modding system tracks the currently executing mod by updating the current mod before and after every call to any function provided by the mod.
For example, before running
CreateMod,mod->OnStartandmod->OnUpdate, we set the currently executing mod to that mod. This allows up to track which mod subscribes to which events, and so allow us to automatically unsubscribe from events.The new modding system is declared inside the
ee::modding::corenamespace and introduces:ModManager- Manages existing and loads new mods.ModInstance- An internal structure that holds information about the mod, such as resources and the lifetime object.Mod- This class represents the lifetime of the mod and should be subclasses by each mod.Loader- Represents an abstract loader. A loader is an object that loads all mods given a path to a directory.The core of the system is defined in
include/modding/core.handsrc/modding/core.cpp. These 2 files contain the functions:GetCurrentlyRunningMod- Get the mod which is currently running in the current thread.SetCurrentlyRunningMod- Set the currently running mod to the given mod. This function only changes a context state. It does NOT cause any function inside the mod itself to be called. This function is internal toEELibraryand should not be exposed/called outside of it.Things that still need to be done: