魔兽科普汇聚WoW玩家们专属综合资讯门户网站!

LibNAddOn

LibNAddOn 是一个插件依赖库,为其他插件提供数据或功能支持。

免费下载 举报 收藏插件
插件详情

插件中文资料库

中文说明、玩家点评、适用场景和替代推荐,方便快速判断是否适合你。

玩家一句话点评
LibNAddOn 适合需要运行库、界面增强或玩法辅助的玩家,建议结合自己的职业和版本先测试再长期使用。
适用场景
  • 日常任务、练级和满级玩法辅助
  • 界面体验优化和信息展示增强
  • 副本前先测试兼容性,确认不报错后再长期使用

LibNAddOn 插件下载与使用指南

本页整理了 LibNAddOn 的功能用途、适用人群、安装方法和常见问题,方便玩家快速判断是否需要安装。

适合谁用

LibNAddOn 是一款 运行库 类插件,适合需要优化界面、提升操作效率或补充游戏信息提示的魔兽世界玩家。

基本信息

  • 插件作者:nazuraki
  • 插件分类:运行库
  • 适配版本:12.0.7
  • 累计下载:9,734

安装方法

  1. 点击上方下载按钮获取 LibNAddOn插件文件。
  2. 解压后将插件文件夹放入 World of Warcraft/_retail_/Interface/AddOns 目录。
  3. 重启游戏或在角色界面点击插件,确认 LibNAddOn 已启用。
  4. 如果插件不生效,请检查版本是否匹配,或关闭同类冲突插件后重试。

使用建议

LibNAddOn 安装后建议先在角色界面确认已启用,进入游戏后根据插件提供的命令、小地图按钮或设置面板进行调整。如遇到报错,可先单独启用该插件排查冲突。

LibNAddOn 常见问题

这个插件适合哪些玩家?

LibNAddOn 适合需要 运行库 类功能的玩家,特别是希望提升游戏便利性、界面管理或战斗信息获取效率的用户。

下载后怎么安装?

下载后解压到 Interface/AddOns 目录,然后重启游戏并在角色界面启用插件。

为什么插件不显示或不生效?

常见原因是目录多套一层、游戏版本不匹配、依赖插件缺失或同类插件冲突。

有没有类似插件可以替代?

可以查看本页的替代插件推荐和相关插件区域,按下载量和分类选择同类工具。

插件 AI 问答

可以问:这个插件正式服能用吗、和 DBM 冲突吗、怎么设置、有没有替代插件。

LibNAddOn 是一个插件依赖库,为其他插件提供数据或功能支持。

插件用途

LibNAddOn 主要面向需要运行库功能的玩家,用来改善游戏体验、减少重复操作或补充默认界面没有直接提供的信息。

适用场景

  • 插件库、数据接口或依赖支持

使用建议

安装后建议先在角色选择界面或插件管理器中确认已启用,再进入游戏测试是否与现有整合包、WA 和其他插件冲突。如遇报错,可以先禁用同类插件排查。

LibNAddOn

LibNAddON is an addOn for bootstrapping other addOns. It provides a single global function that takes a table of options, detailed below.

Usage

List it in your .toc:

```World of Warcraft Addon Data

Dependencies: LibNAddOn

A minimal example:

lua ---@class MyAddOn: AddOn local myAddOn = LibNAddOn(…)

The `---@class MyAddOn: AddOn` annotation types your namespace for the Lua language
server. Files other than the setup file import the namespace with:

lua ---@type MyAddOn local myAddOn = select(2, …)

## Options

Options can be specified by passing them to the function as table values:

lua local ADDON_NAME = … ---@class MyAddOn: AddOn local myAddOn = select(2, …) LibNAddOn{ name = ADDON_NAME, addOn = myAddOn, db = { name = "MyAddOnDB", defaults = { version = 1, -- initial values }, }, settings = { { title = "MyAddon", fields = { { name = "setting name", typ = "checkbox", default = 1, table = function(db) return db.settings end, key = "settingName", label = "basic setting", tooltip = "select value", }, { name = "setting name", typ = "slider", -- everything from checkbox, plus: min = 1, max = 10, step = 1, }, { name = "setting name", typ = "dropdown", -- everything from checkbox, plus: options = {"Option 1", "Option 2"}, }, }, }, }, slashCommands = { myAddonName = {"/command1", "/command2"}, }, compartmentFn = "MY_ADDON_COMPARTMENT_CLICK", api = MyAPI, ui = LibNUI, }

`api` and `ui` will link the respective globals by those names to `myAddOn.api` and `myAddOn.ui`.

Most of the options can also simply be specified in the .toc:

X-NUI-DB: MyAddOnDB

X-NUI-DB-VERSION: 1

X-NUI-COMMANDS: /myaddon, /myaddon1

X-NUI-COMPARTMENT: MyAddOn_OnAddonCompartmentClick

X-NUI-API: SomeApi

X-NUI-UI: LibNUI

Settings can't be expressed in the `.toc` either; with the vararg form, register them with
`RegisterSettings` at file-load time (it queues the registration for `ADDON_LOADED`):

lua ---@class MyAddOn: AddOn local myAddOn = LibNAddOn(…)

myAddOn:RegisterSettings{ { title = "MyAddon", fields = { -- same field definitions as the settings option above }, }, }

You can't set database defaults this way, but since it calls `MigrateDB` on load of your addon
when the database doesn't exist (as the versions don't match), you can initialize your db then:

lua local myAddOn = LibNAddOn(…)

function myAddOn:MigrateDB() if not self.db.version then -- initialize db end end ```

Details

The following will be added to your addon namespace myAddOn:

function Print(…)

Prints any passed arguments, with <ADDON_NAME>: prepended.

an EventListener

Adds a lightweight hidden frame on _eventListener and two functions:

registerEvent(eventName, handlerFn?, idx?)

If no handler function is given, hooks up the event to call myAddOn.EVENT_NAME().

If a handler function is provided, hooks up the event to call it, bound to the addon.

If idx is specified, inserts the handler at the specific index. Generally used to make sure the handler is called before other previously registered handlers (by passing 1 as the idx).

unregisterEvent(eventName, handlerFn?)

If handlerFn is provided, removes the specified callback.

If handlerFn is not provided, removes all callbacks.

delay(ms, fn)

One-shot debounce timer: calls fn (a function, or the name of a method on the addon) after ms milliseconds. Only one timer is active per addon — a second call replaces the pending callback.

after(ms, fn)

Fires fn once after ms milliseconds. Unlike delay, supports any number of concurrent timers.

An event handler for ADDON_LOADED

Calls myAddOn.onLoad when the event is fired for ADDON_NAME.

If myAddOn.onLogin is defined, registers for the event PLAYER_ENTERING_WORLD, calling myAddOn.onLogin if it was a login or reload event.

Globals

Links most of the global wow functions, including convenience wrappers for some.

myAddOn.Colors

Contains various color-related constants and convenience functions:

  • rgba(r, g, b, a) -- converts hex r/g/b values, returning a WoW Color table representation
  • alpha(color, alpha) -- returns a copy of the Color with the new alpha value

myAddOn.lua

For the purposes of the descriptions below:

  • List refers to a table with numeric keys and a size
  • Map refers to a table with string keys
  • Set refers to a table whose keys are the member values, each mapped to true, e.g. if aSet[key] then ... Generally for Lists the code uses ipairs, while Maps use pairs.

Includes various convenience methods for working with Lists, Maps, Sets, Strings, and tables in general:

  • Select(key) - returns a function that transforms a provided table to a value by selecting the given key
  • lists.values(...) - creates a new list with the values from the provided lists
  • lists.generate(func, num, start?) - generate an list by calling a function 1..n times with the index
  • lists.map(tbl, func) - return a new table by transforming each value by the given function
  • lists.find(tbl, val) - find a value in a list, returning the index. If val is a function it will be called with each value, returning the index for which it returns true
  • lists.prepend(list, ...) - prepend values to a list
  • maps.merge(tgt, ...) - merge multiple tables into the first one, overwriting existing keys
  • maps.fill(tgt, ...) - fill the destination table from the source tables, without overwriting existing keys
  • maps.map(map, func) - return a new table by transforming each value by the given function
  • maps.toMap(map, func) - return a new table by mapping each value by the given function
  • maps.any(map, func) - return true if the function returns true for any value in the table
  • maps.anyKey(map, func) - return true if the function returns true for any key in the table
  • sets.Set(list) - create a Set from a list of values, e.g. Set{123, 456} -- {[123] = true, [456] = true}
  • sets.values(tbl) - return the values of a table as a Set
  • strings.startsWith(str, start) - returns true if str starts with start
  • strings.split(token, str) - returns a List of the substrings in str that are separated by token

Also includes the Class function for defining inheritable, instantiatable objects.

CurseForge: https://www.curseforge.com/wow/addons/libnaddon

用户评价

暂无 / 5,0 条评价
免费插件下载后可以评价;付费插件 / WA 购买后可以评价;委托订单完成后可以评价。
暂无评价。

相关推荐

继续看看这些内容

全站搜索