插件中文资料库
中文说明、玩家点评、适用场景和替代推荐,方便快速判断是否适合你。
- 界面布局、头像框、姓名板和动作条优化
LibSharedVariables 插件下载与使用指南
本页整理了 LibSharedVariables 的功能用途、适用人群、安装方法和常见问题,方便玩家快速判断是否需要安装。
适合谁用
LibSharedVariables 是一款 数据代理 / 运行库 类插件,适合需要优化界面、提升操作效率或补充游戏信息提示的魔兽世界玩家。
基本信息
- 插件作者:NosinkD
- 插件分类:数据代理 / 运行库
- 适配版本:1.15.8,2.5.5
- 累计下载:5,702
安装方法
- 点击上方下载按钮获取 LibSharedVariables插件文件。
- 解压后将插件文件夹放入 World of Warcraft/_retail_/Interface/AddOns 目录。
- 重启游戏或在角色界面点击插件,确认 LibSharedVariables 已启用。
- 如果插件不生效,请检查版本是否匹配,或关闭同类冲突插件后重试。
使用建议
LibSharedVariables 安装后建议先在角色界面确认已启用,进入游戏后根据插件提供的命令、小地图按钮或设置面板进行调整。如遇到报错,可先单独启用该插件排查冲突。
LibSharedVariables 常见问题
LibSharedVariables 适合需要 数据代理 / 运行库 类功能的玩家,特别是希望提升游戏便利性、界面管理或战斗信息获取效率的用户。
下载后解压到 Interface/AddOns 目录,然后重启游戏并在角色界面启用插件。
常见原因是目录多套一层、游戏版本不匹配、依赖插件缺失或同类插件冲突。
可以查看本页的替代插件推荐和相关插件区域,按下载量和分类选择同类工具。
插件 AI 问答
可以问:这个插件正式服能用吗、和 DBM 冲突吗、怎么设置、有没有替代插件。
LibSharedVariables 是一个插件依赖库,为其他插件提供数据或功能支持。
插件用途
LibSharedVariables 主要面向需要数据代理功能的玩家,用来改善游戏体验、减少重复操作或补充默认界面没有直接提供的信息。
适用场景
- 插件库、数据接口或依赖支持
使用建议
安装后建议先在角色选择界面或插件管理器中确认已启用,再进入游戏测试是否与现有整合包、WA 和其他插件冲突。如遇报错,可以先禁用同类插件排查。
LibSharedVariables-1.0
LibSharedVariables-1.0 is a lightweight storage helper for World of Warcraft addons.
It provides a merged db proxy view over per-character and account-wide saved variables,
with optional defaults for each scope and automatic table creation.
Features
- Merged read view across character DB, account DB, and optional defaults.
- Automatic creation of global saved variable tables (
<name>PCDBand<name>DB). - Smart write routing based on existing key ownership/default scope.
- Reusable handles by addon name (calling
Loadagain refreshes references/defaults). - Simple helper methods (
Get,Set) andpairs()support on mergeddb.
Quick Start
local LSV = LibStub("LibSharedVariables-1.0")
if not LSV then return end
local defaults = {
profileVersion = 1,
minimap = true,
}
local defaultsPC = {
firstRun = true,
}
local function handleOnLoad(db, handle)
if db.firstRun then
print("Welcome on this character")
db.firstRun = false
end
handle.accountDB.lastLoadedAt = date("%Y-%m-%d %H:%M:%S")
end
local handle = LSV:Load("MyAddon", defaults, defaultsPC, handleOnLoad)
Read and Write Behavior
Read lookup order for db[key] is:
- Character DB (
<name>PCDB) - Account DB (
<name>DB) - Character defaults (
defaultsPC) - Account defaults (
defaults)
Write behavior for db[key] = value:
- If key already exists in character DB, write to character DB.
- Else if key exists in
defaultsPC, write to character DB. - Else if key exists in
defaults, write to account DB. - Else write to character DB.
This allows account-style defaults and character-style defaults to naturally map to the expected persistence scope.
OnLoad Callback
LSV:Load("MyAddon", defaults, defaultsPC, function(db, handle)
if db.firstRun then
print("Welcome on this character")
db.firstRun = false
end
-- handle.accountDB and handle.charDB are direct table references
end)
Iteration
You can iterate merged keys using pairs(db). Duplicate keys are returned once,
respecting read precedence.
for key, value in pairs(db) do
print(key, value)
end
API
lib:Load(name, defaults?, defaultsPC?, onLoad?) -> handlehandle.db[key](merged reads/writes via metatable)handle:Get(key, default?) -> valuehandle:Set(key, value) -> value
handle fields:
handle.namehandle.accountDBhandle.charDBhandle.defaultshandle.defaultsPChandle.db
Notes
namemust be a non-empty string.onLoad, when provided, must be a function.- Calling
Loadagain with the samenamereuses the existing handle and refreshes DB table references/defaults. - Ensure your addon TOC declares matching saved variable names for persistence.
License
- GPL-3.0 - see LICENSE.
用户评价
暂无 / 5,0 条评价相关推荐
继续看看这些内容