优化聊天气泡文档
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
// ============================================================================
|
||||
// SubGameHooks.template.js —— 子游戏接入入口(复制为 codes/SubGameHooks.js 后填实现)
|
||||
// 平台契约文件(00/01/02 转发壳)会把同名平台接口转发到这里。只需实现【本游戏需要的】hook,
|
||||
// 未实现的接口由转发壳走平台默认(B)或空操作(A)。严格 ES5。
|
||||
// 未实现的接口由转发壳走空操作(A)/平台默认返回值(B)/模板默认 UI 渲染(D)。严格 ES5。
|
||||
// 接口清单与默认值见 spec §9 / 文档 06。
|
||||
// ============================================================================
|
||||
|
||||
@@ -199,8 +199,21 @@ var SubGameHooks = window.SubGameHooks || {};
|
||||
// [B] getMaxPlayerCount(roomtype):获取房间最大玩家数量;无 hook 时默认:return Game_Config.Max.PlayerCnt || 4。
|
||||
// SubGameHooks.getMaxPlayerCount = function (roomtype) { /* ... */ };
|
||||
|
||||
// [B] updatePlayerInfoUI(targetSeat):更新玩家信息 UI;无 hook 时默认:return false(让平台默认处理)。
|
||||
// [D] updatePlayerInfoUI(targetSeat):更新指定座位玩家信息 UI;无 hook 时模板提供【可变人数】默认渲染
|
||||
// (头像/昵称/分数随人数 2/3/4 贴合各玩家,布局见 01 的 Game_Modify.PLAYER_INFO_LAYOUT)。子游戏可用 hook 完全接管。
|
||||
// SubGameHooks.updatePlayerInfoUI = function (targetSeat) { /* ... */ };
|
||||
|
||||
// ===== Game_Modify.*(桌面聊天/语音气泡,3) =====
|
||||
// 以下接口无 hook 时,模板提供【可变人数】默认渲染(气泡随人数贴合各玩家,布局见 01 的 Game_Modify.BUBBLE_LAYOUT)。
|
||||
|
||||
// [D] ShowChat(seat, text):显示桌面文字聊天气泡(seat 为绝对座位)。
|
||||
// SubGameHooks.ShowChat = function (seat, text) { /* ... */ };
|
||||
|
||||
// [D] gameui_play_voice(uiIndex):播放桌面语音气泡(uiIndex 为相对显示位序)。
|
||||
// SubGameHooks.gameui_play_voice = function (uiIndex) { /* ... */ };
|
||||
|
||||
// [D] gameui_stop_voice(uiIndex):停止桌面语音气泡。
|
||||
// SubGameHooks.gameui_stop_voice = function (uiIndex) { /* ... */ };
|
||||
|
||||
window.SubGameHooks = SubGameHooks;
|
||||
if (typeof module !== 'undefined' && module.exports) { module.exports = SubGameHooks; }
|
||||
|
||||
Reference in New Issue
Block a user