查看“︁Lua接口/客户端函数索引”︁的源代码
来自天龙知识库
←
Lua接口/客户端函数索引
跳到导航
跳到搜索
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
__NOTOC__ <div class="lua-reference"> [[首页|首页]] · [[Lua接口/客户端函数索引|客户端接口]] · [[Lua接口/客户端窗口操作|窗口操作]] · [[Lua接口/客户端事件|客户端事件]] <div class="lua-index-head"> <div role="heading" aria-level="2" class="lua-title">客户端 Lua 接口</div> <div>面向客户端脚本的接口参考:全局函数与对象方法。客户端脚本负责界面与本地表现,实际数据以服务器下发为准。</div> <div class="lua-sub-lg">213 个全局函数 · 64 个对象类(1344 个方法)· 338 个客户端事件 · 230 个界面脚本</div> </div> == 调用方式 == * 全局函数直接按名称调用,例如 <code>ShowSystemInfo("文本")</code>。 * 对象方法要先取得对象再用冒号调用,例如 <code>local n = DataPool:GetFriendCount()</code>。 * <code>this</code> 是当前窗口对象,脚本里的 <code>this:RegisterEvent("事件名")</code>、<code>this:Show()</code> 属于[[Lua接口/客户端窗口操作|窗口操作]]。 * 事件名在[[Lua接口/客户端事件|客户端事件]]中查阅。 == 全局函数 == 共 213 个,直接作为全局名调用,全部函数见[[Lua接口/客户端函数索引/全局函数|全局函数清单]]。清单里每个函数名都可点进独立页,查看参数含义、返回值与脚本中的真实调用。 {| class="wikitable" ! scope="col" class="lua-w18" | 分组 ! scope="col" class="lua-w10" | 函数数 ! scope="col" | 说明 |- | [[Lua接口/客户端函数索引/全局函数|界面与提示]] | 77 | CallScriptString、CloseAllWindow、CloseBooth、CloseFangDaohao 等 |- | [[Lua接口/客户端函数索引/全局函数|角色、物品与对象]] | 17 | AcceptRide、AskDetailByGuid、AskEquipDetial、AskEvaluateAndLevelup 等 |- | [[Lua接口/客户端函数索引/全局函数|系统与设置]] | 17 | ClearAllTimer、KillTimer、PlaySound、QuitApplication 等 |- | [[Lua接口/客户端函数索引/全局函数|其他]] | 102 | AnswerLevelUpCode、AutoHit、AutoRunToTarget、AxTrace 等 |} == 对象方法 == 对象方法按对象分组;对象名就是脚本里冒号前使用的名称。共 35 个对象类、1200 个方法。每个方法名都可点进独立页,查看参数含义、返回值与脚本中的真实调用。 {| class="wikitable" ! scope="col" class="lua-w26" | 对象 ! scope="col" | |- | [[Lua接口/客户端函数索引/DataPool|DataPool]] | <small class="lua-muted">实现类 DataPool · 181 个方法</small> |- | [[Lua接口/客户端函数索引/Pet|Pet]] | <small class="lua-muted">实现类 Pet · 163 个方法</small> |- | [[Lua接口/客户端函数索引/PlayerShop|PlayerShop]] | <small class="lua-muted">实现类 PlayerShop · 87 个方法</small> |- | [[Lua接口/客户端函数索引/Player|Player]] | <small class="lua-muted">实现类 PlayerMySelf · 75 个方法</small> |- | [[Lua接口/客户端函数索引/GameProduceLogin|GameProduceLogin]] | <small class="lua-muted">实现类 CGameProduce_Login · 69 个方法</small> |- | [[Lua接口/客户端函数索引/LifeAbility|LifeAbility]] | <small class="lua-muted">实现类 LifeAbility · 61 个方法</small> |- | [[Lua接口/客户端函数索引/Guild|Guild]] | <small class="lua-muted">实现类 Guild · 54 个方法</small> |- | [[Lua接口/客户端函数索引/TargetPet|TargetPet]] | <small class="lua-muted">实现类 TargetPet · 48 个方法</small> |- | [[Lua接口/客户端函数索引/GuildLeague|GuildLeague]] | <small class="lua-muted">实现类 GuildLeague · 47 个方法</small> |- | [[Lua接口/客户端函数索引/City|City]] | <small class="lua-muted">实现类 CityTable · 45 个方法</small> |- | [[Lua接口/客户端函数索引/Talk|Talk]] | <small class="lua-muted">实现类 Talk · 43 个方法</small> |- | [[Lua接口/客户端函数索引/Target|Target]] | <small class="lua-muted">实现类 Character · 38 个方法</small> |- | [[Lua接口/客户端函数索引/SystemSetup|SystemSetup]] | <small class="lua-muted">实现类 SystemSetup · 36 个方法</small> |- | [[Lua接口/客户端函数索引/StallSale|StallSale]] | <small class="lua-muted">实现类 StallSale · 28 个方法</small> |- | [[Lua接口/客户端函数索引/SuperTooltips|SuperTooltips]] | <small class="lua-muted">实现类 SuperTooltips · 27 个方法</small> |- | [[Lua接口/客户端函数索引/PlayerPackage|PlayerPackage]] | <small class="lua-muted">实现类 PlayerPackage · 25 个方法</small> |- | [[Lua接口/客户端函数索引/Exchange|Exchange]] | <small class="lua-muted">实现类 Exchange · 24 个方法</small> |- | [[Lua接口/客户端函数索引/StallBuy|StallBuy]] | <small class="lua-muted">实现类 StallBuy · 19 个方法</small> |- | [[Lua接口/客户端函数索引/Bank|Bank]] | <small class="lua-muted">实现类 Bank · 17 个方法</small> |- | [[Lua接口/客户端函数索引/NpcShop|NpcShop]] | <small class="lua-muted">实现类 NpcShop · 16 个方法</small> |- | [[Lua接口/客户端函数索引/Friend|Friend]] | <small class="lua-muted">实现类 Friend · 16 个方法</small> |- | [[Lua接口/客户端函数索引/CActionItem|CActionItem]] | <small class="lua-muted">实现类 CActionItem · 13 个方法</small> |- | [[Lua接口/客户端函数索引/FindFriendDataPool|FindFriendDataPool]] | <small class="lua-muted">实现类 CFindFriendDataPool · 10 个方法</small> |- | [[Lua接口/客户端函数索引/PetInviteFriend|PetInviteFriend]] | <small class="lua-muted">实现类 PetInviteFriend · 9 个方法</small> |- | [[Lua接口/客户端函数索引/FriendSearcher|FriendSearcher]] | <small class="lua-muted">实现类 FriendSearcher · 8 个方法</small> |- | [[Lua接口/客户端函数索引/AbilityTeacher|AbilityTeacher]] | <small class="lua-muted">实现类 AbilityTeacher · 7 个方法</small> |- | [[Lua接口/客户端函数索引/CommisionShop|CommisionShop]] | <small class="lua-muted">实现类 CommisionShop · 7 个方法</small> |- | [[Lua接口/客户端函数索引/MissionReply|MissionReply]] | <small class="lua-muted">实现类 MissionReply · 6 个方法</small> |- | [[Lua接口/客户端函数索引/StallBbs|StallBbs]] | <small class="lua-muted">实现类 StallBbs · 5 个方法</small> |- | [[Lua接口/客户端函数索引/Blog|Blog]] | <small class="lua-muted">实现类 Blog · 3 个方法</small> |- | [[Lua接口/客户端函数索引/GemCarve|GemCarve]] | <small class="lua-muted">实现类 GemCarve · 3 个方法</small> |- | [[Lua接口/客户端函数索引/Sound|Sound]] | <small class="lua-muted">实现类 CSoundSystemFMod · 3 个方法</small> |- | [[Lua接口/客户端函数索引/Helper|Helper]] | <small class="lua-muted">实现类 CHelperSystem · 3 个方法</small> |- | [[Lua接口/客户端函数索引/GemMelting|GemMelting]] | <small class="lua-muted">实现类 GemMelting · 2 个方法</small> |- | [[Lua接口/客户端函数索引/Variable|Variable]] | <small class="lua-muted">实现类 CVariableSystem · 2 个方法</small> |} 窗口控件类(29 个类、144 个方法)见[[Lua接口/客户端窗口操作|客户端窗口操作]],其中的方法同样各有独立页。 == 界面脚本 == 界面上的每个功能面板(钱庄、宝石镶嵌、摆摊、珍兽…)都由 <code>Data/Interface/</code> 下的一个 <code>.lua</code> 脚本负责,共 234 个。哪个界面对应哪个脚本、它监听哪些命令、用到哪些接口,见[[Lua接口/客户端界面索引|客户端界面索引]]。 == 约定 == * 参数个数与类型由实现体推断:客户端实现没有结构化注释块,类型来自 <code>args[n].Is/Get*</code> 或 <code>lua_is*/lua_to*</code> 的取值点,取不到类型的参数会缺失。 * **独立页的标题是「归属:名称」**:全局函数直接是函数名,对象方法是 <code>对象名:方法名</code>,窗口控件方法是 <code>控件类:方法名</code>。同名方法可能存在于多个类(如 <code>Show</code> 同属 <code>Window</code> 与 <code>CUIWindowItem</code>),因此必须带归属前缀才能唯一定位。 * 返回项数来自 <code>return n</code>,<code>return 0</code> 表示无返回值(赋值接收得到 nil)。 * 每行下方标注的是**实现体所在的源码文件**,可按函数名回查核对;不标行号,避免源码改动后失效。 * 数字 0 与 -1 在 Lua 条件判断中都是真值,判断成功必须用明确比较。 * 客户端函数只影响本机界面与本地数据,不改变服务器状态。 * 未在游戏内执行验证,编号类参数与取值需按本服实机确认。 </div>
返回
Lua接口/客户端函数索引
。
导航菜单
页面操作
页面
讨论
阅读
查看源代码
历史
页面操作
页面
讨论
更多
工具
个人工具
创建账号
登录
导航
首页
最近更改
随机页面
MediaWiki帮助
特殊页面
搜索
工具
链入页面
相关更改
页面信息