Lua接口/客户端函数索引/Friend:修订间差异

来自天龙知识库
跳到导航跳到搜索
雪舞留言 | 贡献
新建客户端 Lua 接口页:全局函数、对象方法、窗口操作与客户端事件
 
Waylee留言 | 贡献
新建客户端 Lua 接口页:全局函数、对象方法、窗口操作与客户端事件
 
(未显示1个用户的5个中间版本)
第1行: 第1行:
__NOTOC__
__NOTOC__
<div class="lua-reference" style="max-width:1200px;margin:0 auto;line-height:1.8;color:#29343a;font-family:Arial,'Microsoft YaHei','PingFang SC',sans-serif;letter-spacing:0;overflow-wrap:anywhere;">
<div class="lua-reference">
[[首页|首页]] · [[Lua接口/客户端函数索引|客户端接口]] · [[Lua接口/客户端函数索引/Friend|Friend]] · [[Lua接口/客户端窗口操作|窗口操作]] · [[Lua接口/客户端事件|客户端事件]]
[[首页|首页]] · [[Lua接口/客户端函数索引|客户端接口]] · [[Lua接口/客户端函数索引/Friend|Friend]] · [[Lua接口/客户端窗口操作|窗口操作]] · [[Lua接口/客户端事件|客户端事件]]


<div style="padding:14px 0;border-top:3px solid #287568;">
<div class="lua-lead">
<div role="heading" aria-level="2" style="font-size:22px;font-weight:bold;color:#193d37;">Friend 对象方法</div>
<div role="heading" aria-level="2" class="lua-h1">Friend 对象方法</div>
<div style="margin-top:6px;color:#657078;">实现类 <code style="white-space:normal;overflow-wrap:anywhere;">Friend</code> · 16 个方法 · 脚本使用 47 处</div>
<div class="lua-sub">实现类 <code>Friend</code> · 16 个方法</div>
</div>
</div>
<div style="margin:10px 0;padding:10px 12px;border-left:3px solid #9a7940;background:#faf7f0;font-size:13px;color:#5f5136;">本页参数与返回值由客户端 C++ 绑定源码自动推断(参数取自 <code>args[n]</code> 与 <code>lua_is*</code> 的实际取值点,返回项数取自 <code>return n</code>),<b>未经运行验证</b>;用途摘要按实现体归纳,仅供参考。</div>
== 调用方式 ==
== 调用方式 ==
调用形式:<code style="white-space:normal;overflow-wrap:anywhere;">Friend:AskTeam()</code>
对象方法以 <code>Friend:方法名(参数)</code> 形式调用,例如 <code>Friend:GetCurrentTeam()</code>。各方法的参数见下表,点方法名进入独立页。
对象名 <code style="white-space:normal;overflow-wrap:anywhere;">Friend</code> 是全局对象,可直接使用。
对象名 <code>Friend</code> 是全局对象,可直接使用。


== 方法列表 ==
== 方法列表 ==
{| class="wikitable" style="width:100%;table-layout:fixed;border-collapse:collapse;font-size:13px;"
{| class="wikitable"
! scope="col" style="text-align:left;background:#edf3f2;padding:8px;width:34%;" | 方法
! scope="col" class="lua-w46" | 方法
! scope="col" style="text-align:left;background:#edf3f2;padding:8px;" | 说明
! scope="col" | 说明
|-
|-
| style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | <code style="white-space:normal;overflow-wrap:anywhere;">Friend:AskTeam()</code><br /><small style="color:#657078;">无参数 · 无返回值 · 脚本使用 2 处</small>
| <code>[[Lua接口/客户端/Friend/AskTeam|Friend:AskTeam]](string)</code><br /><small class="lua-muted">无返回值</small>
| style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | 读取客户端本地数据<br /><small style="color:#657078;">Game/Interface/GMGameInterface_Script_Friend.cpp L146</small>
| 读取客户端本地数据<br /><small class="lua-muted">Game/Interface/GMGameInterface_Script_Friend.cpp</small>
|-
|-
| style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | <code style="white-space:normal;overflow-wrap:anywhere;">Friend:CallOf(string)</code><br /><small style="color:#657078;">string · 无返回值 · 脚本使用 3 处</small>
| <code>[[Lua接口/客户端/Friend/CallOf|Friend:CallOf]](string)</code><br /><small class="lua-muted">无返回值</small>
| style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | 读取客户端本地数据<br /><small style="color:#657078;">Game/Interface/GMGameInterface_Script_Friend.cpp L212</small>
| 读取客户端本地数据<br /><small class="lua-muted">Game/Interface/GMGameInterface_Script_Friend.cpp</small>
|-
|-
| style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | <code style="white-space:normal;overflow-wrap:anywhere;">Friend:Close()</code><br /><small style="color:#657078;">无参数 · 无返回值 · 脚本使用 6 处</small>
| <code>[[Lua接口/客户端/Friend/Close|Friend:Close]]()</code><br /><small class="lua-muted">无返回值</small>
| style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | 触发客户端事件 GE_TOGLE_FRIEND_INFO;读取客户端本地数据<br /><small style="color:#657078;">Game/Interface/GMGameInterface_Script_Friend.cpp L69</small>
| 触发客户端事件 GE_TOGLE_FRIEND_INFO;读取客户端本地数据<br /><small class="lua-muted">Game/Interface/GMGameInterface_Script_Friend.cpp</small>
|-
|-
| style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | <code style="white-space:normal;overflow-wrap:anywhere;">Friend:EnumName(number, string)</code><br /><small style="color:#657078;">number, string · 1 个返回值</small>
| <code>[[Lua接口/客户端/Friend/EnumName|Friend:EnumName]](number, string)</code><br /><small class="lua-muted">1 个返回值</small>
| style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | 读取客户端本地数据<br /><small style="color:#657078;">Game/Interface/GMGameInterface_Script_Friend.cpp L112</small>
| 读取客户端本地数据<br /><small class="lua-muted">Game/Interface/GMGameInterface_Script_Friend.cpp</small>
|-
|-
| style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | <code style="white-space:normal;overflow-wrap:anywhere;">Friend:GetCurrentSelect()</code><br /><small style="color:#657078;">无参数 · 1 个返回值 · 脚本使用 6 处</small>
| <code>[[Lua接口/客户端/Friend/GetCurrentSelect|Friend:GetCurrentSelect]]()</code><br /><small class="lua-muted">1 个返回值</small>
| style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | 实现体未体现明确的外部效果<br /><small style="color:#657078;">Game/Interface/GMGameInterface_Script_Friend.cpp L40</small>
| 实现体未体现明确的外部效果<br /><small class="lua-muted">Game/Interface/GMGameInterface_Script_Friend.cpp</small>
|-
|-
| style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | <code style="white-space:normal;overflow-wrap:anywhere;">Friend:GetCurrentTeam()</code><br /><small style="color:#657078;">无参数 · 1 个返回值 · 脚本使用 6 处</small>
| <code>[[Lua接口/客户端/Friend/GetCurrentTeam|Friend:GetCurrentTeam]]()</code><br /><small class="lua-muted">1 个返回值</small>
| style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | 读取客户端本地数据<br /><small style="color:#657078;">Game/Interface/GMGameInterface_Script_Friend.cpp L52</small>
| 读取客户端本地数据<br /><small class="lua-muted">Game/Interface/GMGameInterface_Script_Friend.cpp</small>
|-
|-
| style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | <code style="white-space:normal;overflow-wrap:anywhere;">Friend:GetHistroyData(number, number, number, string)</code><br /><small style="color:#657078;">number, number, number, string · 1 个返回值 · 脚本使用 3 处</small>
| <code>[[Lua接口/客户端/Friend/GetHistroyData|Friend:GetHistroyData]](number, number, number, string)</code><br /><small class="lua-muted">1 个返回值</small>
| style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | 读取客户端本地数据<br /><small style="color:#657078;">Game/Interface/GMGameInterface_Script_Friend.cpp L178</small>
| 读取客户端本地数据<br /><small class="lua-muted">Game/Interface/GMGameInterface_Script_Friend.cpp</small>
|-
|-
| style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | <code style="white-space:normal;overflow-wrap:anywhere;">Friend:GetHistroyNumber(number, number)</code><br /><small style="color:#657078;">number, number · 1 个返回值 · 脚本使用 1 处</small>
| <code>[[Lua接口/客户端/Friend/GetHistroyNumber|Friend:GetHistroyNumber]](number, number)</code><br /><small class="lua-muted">1 个返回值</small>
| style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | 读取客户端本地数据<br /><small style="color:#657078;">Game/Interface/GMGameInterface_Script_Friend.cpp L168</small>
| 读取客户端本地数据<br /><small class="lua-muted">Game/Interface/GMGameInterface_Script_Friend.cpp</small>
|-
|-
| style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | <code style="white-space:normal;overflow-wrap:anywhere;">Friend:InviteTeam()</code><br /><small style="color:#657078;">无参数 · 无返回值 · 脚本使用 2 处</small>
| <code>[[Lua接口/客户端/Friend/InviteTeam|Friend:InviteTeam]](string)</code><br /><small class="lua-muted">无返回值</small>
| style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | 读取客户端本地数据<br /><small style="color:#657078;">Game/Interface/GMGameInterface_Script_Friend.cpp L156</small>
| 读取客户端本地数据<br /><small class="lua-muted">Game/Interface/GMGameInterface_Script_Friend.cpp</small>
|-
|-
| style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | <code style="white-space:normal;overflow-wrap:anywhere;">Friend:IsMoodInHead()</code><br /><small style="color:#657078;">无参数 · 1 个返回值 · 脚本使用 1 处</small>
| <code>[[Lua接口/客户端/Friend/IsMoodInHead|Friend:IsMoodInHead]]()</code><br /><small class="lua-muted">1 个返回值</small>
| style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | 读取客户端本地数据<br /><small style="color:#657078;">Game/Interface/GMGameInterface_Script_Friend.cpp L251</small>
| 读取客户端本地数据<br /><small class="lua-muted">Game/Interface/GMGameInterface_Script_Friend.cpp</small>
|-
|-
| style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | <code style="white-space:normal;overflow-wrap:anywhere;">Friend:IsPlayerIsFriend()</code><br /><small style="color:#657078;">无参数 · 1 个返回值 · 脚本使用 6 处</small>
| <code>[[Lua接口/客户端/Friend/IsPlayerIsFriend|Friend:IsPlayerIsFriend]](string)</code><br /><small class="lua-muted">1 个返回值</small>
| style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | 读取客户端本地数据<br /><small style="color:#657078;">Game/Interface/GMGameInterface_Script_Friend.cpp L264</small>
| 读取客户端本地数据<br /><small class="lua-muted">Game/Interface/GMGameInterface_Script_Friend.cpp</small>
|-
|-
| style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | <code style="white-space:normal;overflow-wrap:anywhere;">Friend:OpenGrouping()</code><br /><small style="color:#657078;">无参数 · 无返回值 · 脚本使用 2 处</small>
| <code>[[Lua接口/客户端/Friend/OpenGrouping|Friend:OpenGrouping]](string, string)</code><br /><small class="lua-muted">无返回值</small>
| style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | 触发客户端事件 GE_SHOW_CONTEXMENU;读取客户端本地数据<br /><small style="color:#657078;">Game/Interface/GMGameInterface_Script_Friend.cpp L75</small>
| 触发客户端事件 GE_SHOW_CONTEXMENU;读取客户端本地数据<br /><small class="lua-muted">Game/Interface/GMGameInterface_Script_Friend.cpp</small>
|-
|-
| style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | <code style="white-space:normal;overflow-wrap:anywhere;">Friend:OpenMenu()</code><br /><small style="color:#657078;">无参数 · 无返回值 · 脚本使用 1 处</small>
| <code>[[Lua接口/客户端/Friend/OpenMenu|Friend:OpenMenu]](string, string)</code><br /><small class="lua-muted">无返回值</small>
| style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | 触发客户端事件 GE_SHOW_CONTEXMENU;读取客户端本地数据<br /><small style="color:#657078;">Game/Interface/GMGameInterface_Script_Friend.cpp L94</small>
| 触发客户端事件 GE_SHOW_CONTEXMENU;读取客户端本地数据<br /><small class="lua-muted">Game/Interface/GMGameInterface_Script_Friend.cpp</small>
|-
|-
| style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | <code style="white-space:normal;overflow-wrap:anywhere;">Friend:SetCurrentSelect(number)</code><br /><small style="color:#657078;">number · 无返回值 · 脚本使用 6 处</small>
| <code>[[Lua接口/客户端/Friend/SetCurrentSelect|Friend:SetCurrentSelect]](number)</code><br /><small class="lua-muted">无返回值</small>
| style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | 实现体未体现明确的外部效果<br /><small style="color:#657078;">Game/Interface/GMGameInterface_Script_Friend.cpp L33</small>
| 实现体未体现明确的外部效果<br /><small class="lua-muted">Game/Interface/GMGameInterface_Script_Friend.cpp</small>
|-
|-
| style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | <code style="white-space:normal;overflow-wrap:anywhere;">Friend:SetCurrentTeam(number)</code><br /><small style="color:#657078;">number · 无返回值 · 脚本使用 1 处</small>
| <code>[[Lua接口/客户端/Friend/SetCurrentTeam|Friend:SetCurrentTeam]](number)</code><br /><small class="lua-muted">无返回值</small>
| style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | 实现体未体现明确的外部效果<br /><small style="color:#657078;">Game/Interface/GMGameInterface_Script_Friend.cpp L45</small>
| 实现体未体现明确的外部效果<br /><small class="lua-muted">Game/Interface/GMGameInterface_Script_Friend.cpp</small>
|-
|-
| style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | <code style="white-space:normal;overflow-wrap:anywhere;">Friend:ViewFeel()</code><br /><small style="color:#657078;">无参数 · 无返回值 · 脚本使用 1 处</small>
| <code>[[Lua接口/客户端/Friend/ViewFeel|Friend:ViewFeel]]()</code><br /><small class="lua-muted">无返回值</small>
| style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | 读取客户端本地数据<br /><small style="color:#657078;">Game/Interface/GMGameInterface_Script_Friend.cpp L235</small>
| 读取客户端本地数据<br /><small class="lua-muted">Game/Interface/GMGameInterface_Script_Friend.cpp</small>
|}
|}


第69行: 第68行:
== 脚本中的调用 ==
== 脚本中的调用 ==
以下是该对象在客户端界面脚本里的调用点(整理为注释,便于检索):
以下是该对象在客户端界面脚本里的调用点(整理为注释,便于检索):
<pre style="white-space:pre-wrap;overflow-wrap:anywhere;font-size:13px;line-height:1.7;padding:12px;background:#f5f7f8;border:1px solid #dbe3e6;">-- Friend:AskTeam  ← ContexMenu/ContexMenu.lua
<pre>-- ContexMenu/ContexMenu.lua
-- Friend:CallOf  ← MessageBox_Other/MessageBox_Other.lua
-- MessageBox_Other/MessageBox_Other.lua
-- Bank:Close  ← Bank/Bank.lua
-- ContexMenu/ContexMenu.lua
-- ChannelCustomization_Province:GetCurrentSelect  ← ChannelCustomization/ChannelCustomization.lua</pre>
-- ContexMenu/ContexMenu.lua</pre>




</div>
</div>

2026年9月19日 (六) 17:00的最新版本

首页 · 客户端接口 · Friend · 窗口操作 · 客户端事件

Friend 对象方法
实现类 Friend · 16 个方法

调用方式

对象方法以 Friend:方法名(参数) 形式调用,例如 Friend:GetCurrentTeam()。各方法的参数见下表,点方法名进入独立页。 对象名 Friend 是全局对象,可直接使用。

方法列表

方法 说明
Friend:AskTeam(string)
无返回值
读取客户端本地数据
Game/Interface/GMGameInterface_Script_Friend.cpp
Friend:CallOf(string)
无返回值
读取客户端本地数据
Game/Interface/GMGameInterface_Script_Friend.cpp
Friend:Close()
无返回值
触发客户端事件 GE_TOGLE_FRIEND_INFO;读取客户端本地数据
Game/Interface/GMGameInterface_Script_Friend.cpp
Friend:EnumName(number, string)
1 个返回值
读取客户端本地数据
Game/Interface/GMGameInterface_Script_Friend.cpp
Friend:GetCurrentSelect()
1 个返回值
实现体未体现明确的外部效果
Game/Interface/GMGameInterface_Script_Friend.cpp
Friend:GetCurrentTeam()
1 个返回值
读取客户端本地数据
Game/Interface/GMGameInterface_Script_Friend.cpp
Friend:GetHistroyData(number, number, number, string)
1 个返回值
读取客户端本地数据
Game/Interface/GMGameInterface_Script_Friend.cpp
Friend:GetHistroyNumber(number, number)
1 个返回值
读取客户端本地数据
Game/Interface/GMGameInterface_Script_Friend.cpp
Friend:InviteTeam(string)
无返回值
读取客户端本地数据
Game/Interface/GMGameInterface_Script_Friend.cpp
Friend:IsMoodInHead()
1 个返回值
读取客户端本地数据
Game/Interface/GMGameInterface_Script_Friend.cpp
Friend:IsPlayerIsFriend(string)
1 个返回值
读取客户端本地数据
Game/Interface/GMGameInterface_Script_Friend.cpp
Friend:OpenGrouping(string, string)
无返回值
触发客户端事件 GE_SHOW_CONTEXMENU;读取客户端本地数据
Game/Interface/GMGameInterface_Script_Friend.cpp
Friend:OpenMenu(string, string)
无返回值
触发客户端事件 GE_SHOW_CONTEXMENU;读取客户端本地数据
Game/Interface/GMGameInterface_Script_Friend.cpp
Friend:SetCurrentSelect(number)
无返回值
实现体未体现明确的外部效果
Game/Interface/GMGameInterface_Script_Friend.cpp
Friend:SetCurrentTeam(number)
无返回值
实现体未体现明确的外部效果
Game/Interface/GMGameInterface_Script_Friend.cpp
Friend:ViewFeel()
无返回值
读取客户端本地数据
Game/Interface/GMGameInterface_Script_Friend.cpp


脚本中的调用

以下是该对象在客户端界面脚本里的调用点(整理为注释,便于检索):

-- ContexMenu/ContexMenu.lua
-- MessageBox_Other/MessageBox_Other.lua
-- ContexMenu/ContexMenu.lua
-- ContexMenu/ContexMenu.lua