adapt: adapt GMLIB v0.12.6

This commit is contained in:
Tsubasa6848
2024-05-26 07:22:41 +08:00
Unverified
parent acf4d5f9c2
commit 884a35fedc
10 changed files with 110 additions and 173 deletions
+34 -3
View File
@@ -1,9 +1,40 @@
#pragma once
#include <ll/api/plugin/NativePlugin.h>
#include "Config.h"
#include "Global.h"
namespace InventoryCheck {
[[nodiscard]] auto getSelfPluginInstance() -> ll::plugin::NativePlugin&;
using namespace GMLIB::Files::I18n;
class Entry {
public:
static std::unique_ptr<Entry>& getInstance();
Entry(ll::plugin::NativePlugin& self) : mSelf(self) {}
[[nodiscard]] ll::plugin::NativePlugin& getSelf() const { return mSelf; }
/// @return True if the plugin is loaded successfully.
bool load();
/// @return True if the plugin is enabled successfully.
bool enable();
/// @return True if the plugin is disabled successfully.
bool disable();
/// @return True if the plugin is unloaded successfully.
bool unload();
Config& getConfig();
LangI18n& getI18n();
private:
ll::plugin::NativePlugin& mSelf;
std::optional<Config> mConfig;
std::optional<LangI18n> mI18n;
};
} // namespace InventoryCheck