Kelsidavis-WoWee/include/addons/toc_parser.hpp
Kelsi e21f808714 feat: support SavedVariablesPerCharacter for per-character addon data
Implement the SavedVariablesPerCharacter TOC directive that many addons
use to store different settings per character (Bartender, Dominos,
MoveAnything, WeakAuras, etc.). Without this, all characters share the
same addon data file.

Per-character files are stored as <AddonName>.<CharacterName>.lua.saved
alongside the existing account-wide <AddonName>.lua.saved files. The
character name is resolved from the player GUID at world entry time.

Changes:
- TocFile::getSavedVariablesPerCharacter() parses the TOC directive
- AddonManager loads/saves per-character vars alongside account-wide vars
- Character name set from game handler before addon loading
2026-03-21 02:46:21 -07:00

26 lines
620 B
C++

#pragma once
#include <optional>
#include <string>
#include <unordered_map>
#include <vector>
namespace wowee::addons {
struct TocFile {
std::string addonName;
std::string basePath;
std::unordered_map<std::string, std::string> directives;
std::vector<std::string> files;
std::string getTitle() const;
std::string getInterface() const;
bool isLoadOnDemand() const;
std::vector<std::string> getSavedVariables() const;
std::vector<std::string> getSavedVariablesPerCharacter() const;
};
std::optional<TocFile> parseTocFile(const std::string& tocPath);
} // namespace wowee::addons