hengyang_client/lua_probject/extend_project/extend/majiang/jinxi/EXPlayerInfoView.lua

57 lines
1.6 KiB
Lua
Raw Normal View History

2025-04-01 10:48:36 +08:00
local PlayerInfoView = require("Game.View.PlayerInfoView")
2025-05-19 16:21:21 +08:00
local PlayerInfoView2 = require("Game.View.PlayerInfoView2")
2025-04-01 10:48:36 +08:00
local M = {}
function M.new(view, mainView)
2025-04-21 18:55:46 +08:00
if mainView._room.room_config.people_num == 2 then
2025-05-19 16:21:21 +08:00
setmetatable(M, { __index = PlayerInfoView2 })
2025-04-21 18:55:46 +08:00
else
setmetatable(M, { __index = PlayerInfoView })
end
2025-04-08 20:57:50 +08:00
local self = setmetatable({}, { __index = M })
2025-04-01 10:48:36 +08:00
self._view = view
self._main_view = mainView
self:init()
return self
end
function M:init()
2025-05-19 16:21:21 +08:00
PlayerInfoView2.init(self)
2025-04-01 10:48:36 +08:00
end
2025-04-09 13:53:34 +08:00
function M:ShowInteraction(type, str)
2025-04-01 10:48:36 +08:00
if type == 3 then
Voice.DownLoad(str, function(clip)
2025-04-09 13:53:34 +08:00
if (clip) then
2025-04-01 10:48:36 +08:00
self:ShowMaskVoice(clip.length)
GameApplication.Instance:PlayVoice(clip)
end
end)
elseif type == 4 then
self:SetChat(str)
elseif type == 2 then
local chat_index = tonumber(str)
2025-04-09 13:53:34 +08:00
self._main_view:PlayChatSound(self._player.self_user.sex, chat_index)
2025-04-01 10:48:36 +08:00
local language, index = self._main_view:GetChatMsgLanguage(chat_index)
self:SetChat(self._main_view.Fix_Msg_Chat[index])
elseif type == 1 then
2025-04-09 13:53:34 +08:00
self:SetBiaoqing("ui://Chat/" .. str)
2025-04-01 10:48:36 +08:00
end
end
function M:UpdateRemainCard(card_num, hide)
if hide then
2025-04-09 13:53:34 +08:00
self._view:GetController("show_remain").selectedIndex = 0
2025-04-01 10:48:36 +08:00
else
2025-04-09 13:53:34 +08:00
self._view:GetController("show_remain").selectedIndex = 1
2025-04-01 10:48:36 +08:00
end
self._view:GetChild("com_remain"):GetChild("tex_remain").text = card_num
end
function M:FillData(player)
2025-05-19 16:21:21 +08:00
PlayerInfoView2.FillData(self, player)
2025-04-01 10:48:36 +08:00
end
return M