2026-03-20 11:12:07 -07:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "addons/lua_engine.hpp"
|
|
|
|
|
#include "addons/toc_parser.hpp"
|
|
|
|
|
#include <memory>
|
|
|
|
|
#include <string>
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
|
|
namespace wowee::addons {
|
|
|
|
|
|
|
|
|
|
class AddonManager {
|
|
|
|
|
public:
|
|
|
|
|
AddonManager();
|
|
|
|
|
~AddonManager();
|
|
|
|
|
|
|
|
|
|
bool initialize(game::GameHandler* gameHandler);
|
|
|
|
|
void scanAddons(const std::string& addonsPath);
|
|
|
|
|
void loadAllAddons();
|
|
|
|
|
bool runScript(const std::string& code);
|
2026-03-20 11:23:38 -07:00
|
|
|
void fireEvent(const std::string& event, const std::vector<std::string>& args = {});
|
2026-03-20 12:07:22 -07:00
|
|
|
void update(float deltaTime);
|
2026-03-20 11:12:07 -07:00
|
|
|
void shutdown();
|
|
|
|
|
|
|
|
|
|
const std::vector<TocFile>& getAddons() const { return addons_; }
|
|
|
|
|
LuaEngine* getLuaEngine() { return &luaEngine_; }
|
|
|
|
|
bool isInitialized() const { return luaEngine_.isInitialized(); }
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
LuaEngine luaEngine_;
|
|
|
|
|
std::vector<TocFile> addons_;
|
|
|
|
|
|
|
|
|
|
bool loadAddon(const TocFile& addon);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace wowee::addons
|