mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
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
26 lines
620 B
C++
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
|