修改字牌

master
罗家炜 2025-04-01 13:56:18 +08:00
parent 623618f78e
commit ec8e4f9cd5
8 changed files with 194 additions and 197 deletions

View File

@ -341,8 +341,11 @@ function M:UpdateFamilyRoom(fgCtr, id)
list_room:SetVirtual() list_room:SetVirtual()
local list_gamePlay = self._view:GetChild('list_gamePlay') local list_gamePlay = self._view:GetChild('list_gamePlay')
list_gamePlay:SetVirtual() list_gamePlay:SetVirtual()
local playList = DataManager.groups:get(id).playList local playList = self._group.playList
local roomList = DataManager.groups:get(id).rooms local roomList = self._group.rooms
print("=========================playList,rooms")
pt(playList)
pt(roomList)
list_room.itemRenderer = function(index, obj) list_room.itemRenderer = function(index, obj)
if index < #roomList then if index < #roomList then
-- local config = ExtendManager.GetExtendConfig(roomList[index + 1].pid) -- local config = ExtendManager.GetExtendConfig(roomList[index + 1].pid)
@ -351,13 +354,13 @@ function M:UpdateFamilyRoom(fgCtr, id)
-- obj:GetChild('Label_gameRule').title = gamePlay -- obj:GetChild('Label_gameRule').title = gamePlay
obj:GetChild('game_type').text = string.format("房间-%s", roomList[index + 1].id) obj:GetChild('game_type').text = string.format("房间-%s", roomList[index + 1].id)
obj:GetChild('btn_joinGame'):GetController('type').selectedIndex = 1 obj:GetChild('btn_joinGame'):GetController('type').selectedIndex = 1
obj:GetChild('btn_joinGame').onClick:Add(function() obj:GetChild('btn_joinGame').onClick:Set(function()
ViewUtil.ShowModalWait(self._root_view, "匹配房间中", 'join_room') ViewUtil.ShowModalWait(self._root_view, "匹配房间中", 'join_room')
local roomCtr = ControllerManager.GetController(RoomController) local roomCtr = ControllerManager.GetController(RoomController)
roomCtr:PublicJoinRoom( roomCtr:PublicJoinRoom(
Protocol.WEB_FG_MATCH_ROOM, Protocol.WEB_FG_JOIN_ROOM,
roomList[index + 1].id, roomList[index + 1].id,
true, false,
function(response) function(response)
ViewUtil.CloseModalWait('join_room') ViewUtil.CloseModalWait('join_room')
if (response.ReturnCode == -1) then if (response.ReturnCode == -1) then
@ -374,7 +377,7 @@ function M:UpdateFamilyRoom(fgCtr, id)
end end
end, end,
id, id,
playList[index + 1].id roomList[index + 1].pid
) )
end) end)
else else
@ -384,7 +387,7 @@ function M:UpdateFamilyRoom(fgCtr, id)
-- obj:GetChild('Label_gameRule').title = gamePlay -- obj:GetChild('Label_gameRule').title = gamePlay
obj:GetChild('game_type').text = playList[index - #roomList + 1].name obj:GetChild('game_type').text = playList[index - #roomList + 1].name
obj:GetChild('btn_joinGame'):GetController('type').selectedIndex = 0 obj:GetChild('btn_joinGame'):GetController('type').selectedIndex = 0
obj:GetChild('btn_joinGame').onClick:Add(function() obj:GetChild('btn_joinGame').onClick:Set(function()
ViewUtil.ShowModalWait(self._root_view, "匹配房间中", 'join_room') ViewUtil.ShowModalWait(self._root_view, "匹配房间中", 'join_room')
local roomCtr = ControllerManager.GetController(RoomController) local roomCtr = ControllerManager.GetController(RoomController)
fgCtr:FG_ChangeFag(id, DataManager.SelfUser.acc, 777777, function() fgCtr:FG_ChangeFag(id, DataManager.SelfUser.acc, 777777, function()
@ -436,6 +439,7 @@ function M:UpdateFamilyRoom(fgCtr, id)
end) end)
end) end)
end end
print("=======================why", list_room.numItems, #playList, #roomList)
list_room.numItems = #playList + #roomList list_room.numItems = #playList + #roomList
list_gamePlay.numItems = #playList + 1 list_gamePlay.numItems = #playList + 1
end end
@ -535,7 +539,6 @@ function M:OnUpdate()
ViewUtil.ErrorTip(res.ReturnCode, string.format('删除房间-%s失败', self._group.rooms[i].id)) ViewUtil.ErrorTip(res.ReturnCode, string.format('删除房间-%s失败', self._group.rooms[i].id))
else else
self._roomNum = #self._group.rooms self._roomNum = #self._group.rooms
self._group.update_room = false
end end
end end
) )

View File

@ -106,7 +106,7 @@ end
function M:Show() function M:Show()
BaseView.Show(self) BaseView.Show(self)
-- self:QuickLogin() self:QuickLogin()
end end
local function __goto_lobby(response) local function __goto_lobby(response)

View File

@ -17,7 +17,8 @@ end
function M:ShowHuTip(card_list) function M:ShowHuTip(card_list)
printlog("ShowHuTip") printlog("ShowHuTip")
local tingList = CardCheck.MuiltiplteCaculateTingPai(card_list, true, DataManager.CurrenRoom.room_config.Qidui, DataManager.CurrenRoom.room_config.Laizi) local tingList = CardCheck.MuiltiplteCaculateTingPai(card_list, true, DataManager.CurrenRoom.room_config.Qidui,
DataManager.CurrenRoom.room_config.Laizi)
if #tingList > 0 then if #tingList > 0 then
if DataManager.CurrenRoom.laiziInfo and #DataManager.CurrenRoom.laiziInfo > 0 then if DataManager.CurrenRoom.laiziInfo and #DataManager.CurrenRoom.laiziInfo > 0 then
for i = 1, #DataManager.CurrenRoom.laiziInfo do for i = 1, #DataManager.CurrenRoom.laiziInfo do
@ -26,7 +27,6 @@ function M:ShowHuTip(card_list)
end end
end end
end end
end end
self._mainView._hu_tip:FillData(tingList) self._mainView._hu_tip:FillData(tingList)
end end
@ -44,7 +44,6 @@ function M:UpdateHandCard(getcard, mp)
if obj.card:GetController("laizi") then if obj.card:GetController("laizi") then
obj.card:GetController("laizi").selectedIndex = 1 obj.card:GetController("laizi").selectedIndex = 1
end end
end end
else else
if obj.card.GetController then if obj.card.GetController then
@ -53,11 +52,8 @@ function M:UpdateHandCard(getcard, mp)
end end
end end
end end
end end
end end
end end
@ -73,7 +69,8 @@ function M:UpdateHandCard(getcard, mp)
local btn = _carViewList[i].card local btn = _carViewList[i].card
local card = self:GetCard(btn) local card = self:GetCard(btn)
list_remove(card_list, card) list_remove(card_list, card)
local tingList = CardCheck.MuiltiplteCaculateTingPai(card_list, true, DataManager.CurrenRoom.room_config.Qidui, DataManager.CurrenRoom.room_config.Laizi) local tingList = CardCheck.MuiltiplteCaculateTingPai(card_list, true,
DataManager.CurrenRoom.room_config.Qidui, DataManager.CurrenRoom.room_config.Laizi)
if #tingList > 0 then if #tingList > 0 then
local count = 0 local count = 0
for j = 1, #tingList do for j = 1, #tingList do
@ -109,7 +106,6 @@ function M:UpdateHandCard(getcard, mp)
end end
self._out_card = false self._out_card = false
end end
end end
function M:__OnClickHandCard(context) function M:__OnClickHandCard(context)
@ -190,6 +186,7 @@ function M:CheckPlayerOnlineState()
end end
return true return true
end end
function M:Clear(bskip) function M:Clear(bskip)
--self._ctr_state.selectedIndex = 0 --self._ctr_state.selectedIndex = 0
self._area_fz_list.x = self._src_fz_list.x self._area_fz_list.x = self._src_fz_list.x
@ -208,6 +205,6 @@ function M:Clear(bskip)
self._carViewList[i].card:Dispose() self._carViewList[i].card:Dispose()
end end
self._carViewList = {} self._carViewList = {}
end end
return M return M

View File

@ -56,8 +56,6 @@ function M:init()
if _gamectr then if _gamectr then
_gamectr:AddEventListener(GameEvent.MJModifySzie, handler(self, self.SetMJSize)) _gamectr:AddEventListener(GameEvent.MJModifySzie, handler(self, self.SetMJSize))
end end
end end
function M:SetMJSize(zS) function M:SetMJSize(zS)
@ -119,12 +117,12 @@ function M:GetPrefix()
end end
function M:fillCard(obj, pos_str, card, use3d) function M:fillCard(obj, pos_str, card, use3d)
if self._current_card_type == 2 and (use3d == nil or use3d == true) then if self._current_card_type == 2 and (use3d == nil or use3d == true) then
obj.icon = 'ui://MajiangCard3d/' .. 'b' .. pos_str .. card obj.icon = 'ui://MajiangCard3d/' .. 'b' .. pos_str .. card
else else
obj.icon = 'ui://Main_Majiang/' .. self:GetPrefix() .. pos_str .. card obj.icon = 'ui://Main_Majiang/' .. self:GetPrefix() .. pos_str .. card
end end
print("================================fillCard", obj, pos_str, card, use3d, obj.icon)
end end
function M:getBackCard(card) function M:getBackCard(card)

View File

@ -47,7 +47,6 @@ function M:init()
elseif _data.size == 1 then elseif _data.size == 1 then
self._area_handcard_list:SetScale(1, 1) self._area_handcard_list:SetScale(1, 1)
self._area_fz_list:SetScale(1, 1) self._area_fz_list:SetScale(1, 1)
elseif _data.size == 2 then elseif _data.size == 2 then
self._area_handcard_list:SetScale(0.8, 0.8) self._area_handcard_list:SetScale(0.8, 0.8)
self._area_fz_list:SetScale(0.8, 0.8) self._area_fz_list:SetScale(0.8, 0.8)
@ -60,6 +59,7 @@ function M:setHandCardPos(btn_card, i, getcard)
end end
function M:UpdateHandCard(getcard, mp) function M:UpdateHandCard(getcard, mp)
print("======================main", getcard, mp)
if self.outcard_button then if self.outcard_button then
self.outcard_button:Dispose() self.outcard_button:Dispose()
self.outcard_button = nil self.outcard_button = nil
@ -130,7 +130,6 @@ function M:UpdateHandCard(getcard,mp)
end end
else else
for i = 0, (#cards) - 1 do for i = 0, (#cards) - 1 do
local mp_card = UIPackage.CreateObject("Main_Majiang", "Mp_self_card" .. b3d) local mp_card = UIPackage.CreateObject("Main_Majiang", "Mp_self_card" .. b3d)
-- mp_card.icon = UIPackage.GetItemURL("Main_Majiang", "202_" .. cards[i+1]) -- mp_card.icon = UIPackage.GetItemURL("Main_Majiang", "202_" .. cards[i+1])
self:fillCard(mp_card, "202_", cards[i + 1]) self:fillCard(mp_card, "202_", cards[i + 1])

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 MiB

After

Width:  |  Height:  |  Size: 1.5 MiB