Initial commit

This commit is contained in:
子沐呀
2025-04-19 14:34:17 +08:00
committed by GitHub
Unverified
commit 40646ce097
19 changed files with 1446 additions and 0 deletions
+6
View File
@@ -0,0 +1,6 @@
// This file will make your mod use LeviLamina's memory operators by default.
// This improves the memory management of your mod and is recommended to use.
#define LL_MEMORY_OPERATORS
#include "ll/api/memory/MemoryOperators.h" // IWYU pragma: keep
+32
View File
@@ -0,0 +1,32 @@
#include "mod/MyMod.h"
#include "ll/api/mod/RegisterHelper.h"
namespace my_mod {
MyMod& MyMod::getInstance() {
static MyMod instance;
return instance;
}
bool MyMod::load() {
getSelf().getLogger().debug("Loading...");
// Code for loading the mod goes here.
return true;
}
bool MyMod::enable() {
getSelf().getLogger().debug("Enabling...");
// Code for enabling the mod goes here.
return true;
}
bool MyMod::disable() {
getSelf().getLogger().debug("Disabling...");
// Code for disabling the mod goes here.
return true;
}
} // namespace my_mod
LL_REGISTER_MOD(my_mod::MyMod, my_mod::MyMod::getInstance());
+33
View File
@@ -0,0 +1,33 @@
#pragma once
#include "ll/api/mod/NativeMod.h"
namespace my_mod {
class MyMod {
public:
static MyMod& getInstance();
MyMod() : mSelf(*ll::mod::NativeMod::current()) {}
[[nodiscard]] ll::mod::NativeMod& getSelf() const { return mSelf; }
/// @return True if the mod is loaded successfully.
bool load();
/// @return True if the mod is enabled successfully.
bool enable();
/// @return True if the mod is disabled successfully.
bool disable();
// TODO: Implement this method if you need to unload the mod.
// /// @return True if the mod is unloaded successfully.
// bool unload();
private:
ll::mod::NativeMod& mSelf;
};
} // namespace my_mod