Lua接口/客户端/ChatChannel/AddChannel

来自天龙知识库
雪舞留言 | 贡献2026年9月19日 (六) 13:56的版本 (新建客户端 Lua 接口页:全局函数、对象方法、窗口操作与客户端事件)
跳到导航跳到搜索

首页 · 客户端接口 · 窗口操作

ChatChannel:AddChannel
读取客户端本地数据 · 实现于 CEGUISystem/UILuaControl.cpp

调用方式

ChatChannel:AddChannel(string, string, string) 控件方法由界面管理器创建的对象提供,没有固定的全局对象名:脚本里的 this 就是当前窗口,this 或持有的控件变量可直接以冒号调用。所属控件类 ChatChannel

界面脚本中共 4 处调用,实参个数出现过:3 个(4 处)。

参数

序号 类型 说明
1 string 调用点实参:strPrvType(3 处)、strChannelType(1 处)
2 string 调用点实参:CHANNEL_DATA[strPrvType][1](3 处)、CHANNEL_DATA[strChannelType][1](1 处)
3 string 调用点实参:strChannelName(1 处)、strPrvName1(1 处)、strPrvName2(1 处)

返回值

无返回值(实现体 return 0)。被赋给变量时得到 nil,与返回数字 0 不同。

实现体注释

以下注释取自实现体原文,仅收录可确认属原作者的部分:

  • 代码转化

脚本中的调用

以下是界面脚本里的真实调用点(同一形态只列一次):

-- ChatFrame/ChatFrame.lua
ChatChannel:AddChannel(strChannelType, CHANNEL_DATA[strChannelType][1], strChannelName)
-- ChatFrame/ChatFrame.lua
ChatChannel:AddChannel(strPrvType, CHANNEL_DATA[strPrvType][1], strPrvName1)
-- ChatFrame/ChatFrame.lua
ChatChannel:AddChannel(strPrvType, CHANNEL_DATA[strPrvType][1], strPrvName2)
-- ChatFrame/ChatFrame.lua
ChatChannel:AddChannel(strPrvType, CHANNEL_DATA[strPrvType][1], strPrvName3)

关联

  • 读取或修改客户端本地数据