补充新界面人物头像信息随游戏状态改变

master
罗家炜 2025-04-24 17:33:39 +08:00
parent b6670a1db7
commit c713edf178
1 changed files with 24 additions and 6 deletions

View File

@ -25,11 +25,12 @@ function M:InitView(url)
self._gps_style = 1 self._gps_style = 1
self._full = true self._full = true
UIPackage.AddPackage("extend/majiang/nancheng/ui/Extend_MJ_NanCheng") UIPackage.AddPackage("extend/majiang/nancheng/ui/Extend_MJ_NanCheng")
if self._room.room_config.people_num == 2 then -- if self._room.room_config.people_num == 2 then
MJMainView.InitView(self, "ui://Main_Majiang/Main_new_" .. room.room_config.people_num) -- MJMainView.InitView(self, "ui://Main_Majiang/Main_new_" .. room.room_config.people_num)
else -- else
MJMainView.InitView(self, "ui://Main_Majiang/Main_" .. room.room_config.people_num .. "_s2") -- MJMainView.InitView(self, "ui://Main_Majiang/Main_" .. room.room_config.people_num .. "_s2")
end -- end
MJMainView.InitView(self, string.format("ui://Main_Majiang/Main_new_%d_jiangxi", room.room_config.people_num))
self._hu_tip = HuTipView.new(self) self._hu_tip = HuTipView.new(self)
self._view:GetChild('wanfa_text').text = room.room_config.people_num .. '人个旧麻将 ' .. room.score_times .. '' self._view:GetChild('wanfa_text').text = room.room_config.people_num .. '人个旧麻将 ' .. room.score_times .. ''
@ -49,6 +50,11 @@ function M:InitView(url)
self.jing = self._view:GetChild('jing') self.jing = self._view:GetChild('jing')
self._state.onChanged:Add(function()
print("==============================UpdatePlayerInfoView1")
self:UpdatePlayerInfoView()
end)
local showNextCtr = self._view:GetController('showNext') local showNextCtr = self._view:GetController('showNext')
local ShowNextConfrimCtr = self._view:GetController('showNextConfrim') local ShowNextConfrimCtr = self._view:GetController('showNextConfrim')
local showNextList = self._view:GetChild('list_showNext') local showNextList = self._view:GetChild('list_showNext')
@ -212,12 +218,24 @@ function M:InitPlayerInfoView()
self._player_info = {} self._player_info = {}
local _player_info = self._player_info local _player_info = self._player_info
for i = 1, self._room.room_config.people_num do for i = 1, self._room.room_config.people_num do
local tem = self._view:GetChild("player_info" .. i) local tem = self._view:GetChild(string.format("player_info%d_%d", i, (self._state.selectedIndex % 2) + 1))
_player_info[i] = PlayerInfoView.new(tem, self) _player_info[i] = PlayerInfoView.new(tem, self)
tem.visible = false tem.visible = false
end end
end end
function M:UpdatePlayerInfoView()
self._player_info = {}
local _player_info = self._player_info
local list = self._room.player_list
for i = 1, self._room.room_config.people_num do
local tem = self._view:GetChild(string.format("player_info%d_%d", i, (self._state.selectedIndex % 2) + 1))
_player_info[i] = PlayerInfoView.new(tem, self)
_player_info[i]:FillData(list[i])
end
end
function M:NewMJPlayerCardInfoView(view, index) function M:NewMJPlayerCardInfoView(view, index)
if index == 1 then if index == 1 then
return MJPlayerSelfCardInfoView.new(view, self) return MJPlayerSelfCardInfoView.new(view, self)