diff --git a/lua_probject/base_project/Game/Controller/GroupMgrController.lua b/lua_probject/base_project/Game/Controller/GroupMgrController.lua index a879eb1b..94d56fcc 100644 --- a/lua_probject/base_project/Game/Controller/GroupMgrController.lua +++ b/lua_probject/base_project/Game/Controller/GroupMgrController.lua @@ -23,7 +23,8 @@ GroupMgrEvent = { OnFamilyRoomReflash = "OnFamilyRoomReflash", OnFamilyMemberOut = "OnFamilyMemberOut", OnRefNumberBan = "OnRefNumberBan", - OnRefShowStartRoom = "OnRefShowStartRoom" + OnRefShowStartRoom = "OnRefShowStartRoom", + OnRefNotice = "OnRefNotice" } GroupMgrController = { @@ -70,6 +71,7 @@ function GroupMgrController.new() self._eventmap[Protocol.WEB_FG_MEMBER_GAME_STATE] = self.OnMemberGameState self._eventmap[Protocol.FGMGR_EVT_Ref_NumberBan] = self.OnRefNumberBan self._eventmap[Protocol.FGMGR_EVT_SHOWSTART] = self.OnRefShowStartRoom + self._eventmap[Protocol.FWEb_EVT_UPDATENOTICE] = self.OnRefNotice -- self:connect(callback) return self @@ -166,6 +168,7 @@ function M:connect(host, groupId, callback) group.isvip = res.Data.isvip group.isWatch = res.Data.isWatch group.messageCount = res.Data.messageCount + group.isShow = res.Data.isShow group.joinsData = {} else self.code = SocketCode.ExceptionOnConnect @@ -672,6 +675,12 @@ function M:OnRefShowStartRoom(evt_data) DispatchEvent(self._dispatcher, GroupMgrEvent.OnRefShowStartRoom, evt_data) end +function M:OnRefNotice(evt_data) + local group = DataManager.groups:get(evt_data.groupId) + group.notice = evt_data.notice + DispatchEvent(self._dispatcher, GroupMgrEvent.OnRefNotice, evt_data) +end + function M:PopEvent() local _cacheEvent = self._cacheEvent if (_cacheEvent:Count() > 0) then diff --git a/lua_probject/base_project/Game/Protocol.lua b/lua_probject/base_project/Game/Protocol.lua index 568acc5b..25ba6b95 100644 --- a/lua_probject/base_project/Game/Protocol.lua +++ b/lua_probject/base_project/Game/Protocol.lua @@ -449,6 +449,8 @@ Protocol = { FGMGR_SET_SHOWSTART = "13012", --显示/隐藏一开始房间接收事件 FGMGR_EVT_SHOWSTART = "13013", + --推送亲友圈公告修改 + FWEb_EVT_UPDATENOTICE = "13014", --end::::::::::::::牌友圈协议:::::::::::::::::::: diff --git a/lua_probject/base_project/Game/View/Family/FamilAllRank.lua b/lua_probject/base_project/Game/View/Family/FamilAllRank.lua index d7f99e93..9ab05f7a 100644 --- a/lua_probject/base_project/Game/View/Family/FamilAllRank.lua +++ b/lua_probject/base_project/Game/View/Family/FamilAllRank.lua @@ -100,7 +100,7 @@ end function M:RoundListRenderer(index, obj) local rankTable = self.roundRanks - obj:GetChild('text_rank').text = index + obj:GetChild('text_rank').text = index + 1 obj:GetChild('text_id').text = rankTable[index + 1].rankTable obj:GetChild('text_name').text = rankTable[index + 1].nick obj:GetChild('text_other').text = rankTable[index + 1].round @@ -109,7 +109,7 @@ end function M:WinListRenderer(index, obj) local rankTable = self.winRanks - obj:GetChild('text_rank').text = index + obj:GetChild('text_rank').text = index + 1 obj:GetChild('text_id').text = rankTable[index + 1].rankTable obj:GetChild('text_name').text = rankTable[index + 1].nick obj:GetChild('text_other').text = rankTable[index + 1].win @@ -118,7 +118,7 @@ end function M:ScoreListRenderer(index, obj) local rankTable = self.scoreRanks - obj:GetChild('text_rank').text = index + obj:GetChild('text_rank').text = index + 1 obj:GetChild('text_id').text = rankTable[index + 1].rankTable obj:GetChild('text_name').text = rankTable[index + 1].nick obj:GetChild('text_other').text = rankTable[index + 1].score diff --git a/lua_probject/base_project/Game/View/Family/FamilyBanDesk.lua b/lua_probject/base_project/Game/View/Family/FamilyBanDesk.lua index 5afbecbb..435d0b76 100644 --- a/lua_probject/base_project/Game/View/Family/FamilyBanDesk.lua +++ b/lua_probject/base_project/Game/View/Family/FamilyBanDesk.lua @@ -189,8 +189,12 @@ local function list_BanedPlayersRenderer(index, obj, data, self, fatherIndex) local btn_delPlayer = obj:GetChild("btn_delPlayer") btn_delPlayer.onClick:Set(function() -- 删除玩家按钮 - self.changedIndex = fatherIndex - DelPalyer(data, player.uid, self) + local _curren_msg = MsgWindow.new(self._root_view, '是否确认删除该成员?', MsgWindow.MsgMode.OkAndCancel) + _curren_msg.onOk:Add(function() + self.changedIndex = fatherIndex + DelPalyer(data, player.uid, self) + end) + _curren_msg:Show() end) end @@ -215,7 +219,11 @@ local function list_banItemRenderer(index, obj, self) btn_del.onClick:Set(function() -- 删除整个桌子 - DelDesk(data, self) + local _curren_msg = MsgWindow.new(self._root_view, '是否确认删除该分组关系?', MsgWindow.MsgMode.OkAndCancel) + _curren_msg.onOk:Add(function() + DelDesk(data, self) + end) + _curren_msg:Show() end) list_BanedPlayers.itemRenderer = function(i, o) diff --git a/lua_probject/base_project/Game/View/Family/FamilyEventView.lua b/lua_probject/base_project/Game/View/Family/FamilyEventView.lua index 7e064430..d883429e 100644 --- a/lua_probject/base_project/Game/View/Family/FamilyEventView.lua +++ b/lua_probject/base_project/Game/View/Family/FamilyEventView.lua @@ -35,6 +35,7 @@ function M:AddListener() mgr_ctr:AddEventListener(GroupMgrEvent.OnFamilyRoomReflash, handler(self, self._evtOnFamilyRoomReflash)) mgr_ctr:AddEventListener(GroupMgrEvent.OnFamilyMemberOut, handler(self, self._evtOnFamilyMemberOut)) mgr_ctr:AddEventListener(GroupMgrEvent.OnRefShowStartRoom, handler(self, self._evtOnRefShowStartRoom)) + mgr_ctr:AddEventListener(GroupMgrEvent.OnRefNotice, handler(self, self._evtOnRefNotice)) print("家族添加监听") end @@ -59,7 +60,9 @@ function M:RemoveAll() mgr_ctr:RemoveEventListener(GroupMgrEvent.OnMemberState, handler(self, self._evtOnMemberState)) mgr_ctr:RemoveEventListener(GroupMgrEvent.OnFamilyRoomReflash, handler(self, self._evtOnFamilyRoomReflash)) mgr_ctr:RemoveEventListener(GroupMgrEvent.OnFamilyMemberOut, handler(self, self._evtOnFamilyMemberOut)) - mgr_ctr:RemoveEventListener(GroupMgrEvent.OnRefShowStartRoom, handler(self, self._evtOnRefShowStartRoom)) + mgr_ctr:RemoveEventListener(GroupMgrEvent.OnRefNotice, handler(self, self._evtOnRefShowStartRoom)) + mgr_ctr:RemoveEventListener(GroupMgrEvent.OnRefNotice, handler(self, self._evtOnRefNotice)) + print("家族去除监听") end @@ -409,4 +412,20 @@ function M:_evtOnRefShowStartRoom(...) self:UpdateFamilyRoom(nil, self._group.id) end +function M:_evtOnRefNotice(...) + local arg = { ... } + + local evt_data = arg[1] + + local view = ViewManager.GetCurrenView() + if view.class ~= "FamilyMainView" then + return + end + printlog("lingmeng _evtOnRefShowStartRoom", self._group.id, evt_data.groupId) + if self._group.id == nil or evt_data.groupId ~= self._group.id then + return + end + self:RefNotice(self._group.id) +end + return M diff --git a/lua_probject/base_project/Game/View/Family/FamilyMyFamily.lua b/lua_probject/base_project/Game/View/Family/FamilyMyFamily.lua index 1615fca0..a0b96bb4 100644 --- a/lua_probject/base_project/Game/View/Family/FamilyMyFamily.lua +++ b/lua_probject/base_project/Game/View/Family/FamilyMyFamily.lua @@ -140,6 +140,8 @@ function FamilyMyFamily:Close() end function FamilyMyFamily:Refalsh() + local group = DataManager.groups.groupMap[self.groupId] + self.family = DataManager.groups.groupMap[self.groupId] self.tex_fName.text = Utils.TextOmit(self.family.name, 6, "...") @@ -156,7 +158,10 @@ function FamilyMyFamily:Refalsh() self.showNumber = self.family.isShow if self.showNumber == 0 then self.cDisplayNumber.selectedIndex = 1 - self.tex_fNumber.text = "*" + if group.lev == 3 then + self.tex_fNumber.text = "*" + self.cDisplayNumber.selectedIndex = 0 + end elseif self.showNumber == 1 then self.cDisplayNumber.selectedIndex = 0 end diff --git a/lua_probject/base_project/Game/View/Family/FamilyMyfamilyList.lua b/lua_probject/base_project/Game/View/Family/FamilyMyfamilyList.lua index 52279ba1..3ddf6553 100644 --- a/lua_probject/base_project/Game/View/Family/FamilyMyfamilyList.lua +++ b/lua_probject/base_project/Game/View/Family/FamilyMyfamilyList.lua @@ -99,14 +99,17 @@ function FamilyMyfamilyList:Init() local tex_familyName = obj:GetChild("tex_familyName") local tex_familyNumber = obj:GetChild("tex_familyNumber") local btn_familyManage = obj:GetChild("btn_familyManage") + local btn_familyManage2 = obj:GetChild("btn_familyManage2") local btn_record = obj:GetChild("btn_record") local btn_rank = obj:GetChild("btn_rank") local loader_icon = obj:GetChild("loader_icon") + local ctr_groupLev = obj:GetController("groupLev") tex_familyId.text = group.id tex_familyName.emojies = EmojiDitc.EmojiesDitc tex_familyName.text = Utils.TextOmit(group.name, 6, "...") - tex_familyNumber.text = group.total_member_num + tex_familyNumber.text = group.isShow == 1 and group.total_member_num or "***" + ctr_groupLev.selectedIndex = group.lev < 3 and 1 or 0 ImageLoad.Load(group.o_portrait, loader_icon) btn_familyManage.onClick:Set(function() @@ -116,6 +119,13 @@ function FamilyMyfamilyList:Init() view:Show(group.id) end) + btn_familyManage2.onClick:Set(function() + --self:Close() + --self.FamilyView:OpenMyFamily(group.id) + local view = FamilyMyFamily.New() + view:Show(group.id) + end) + btn_record.onClick:Set(function() self:Close() self.FamilyView:FamilyRecord() diff --git a/lua_probject/base_project/Game/View/Family/FamilyNotice.lua b/lua_probject/base_project/Game/View/Family/FamilyNotice.lua index c8c06b99..f38c0079 100644 --- a/lua_probject/base_project/Game/View/Family/FamilyNotice.lua +++ b/lua_probject/base_project/Game/View/Family/FamilyNotice.lua @@ -27,7 +27,7 @@ function M.TryShow(data, callback) local group = data.group local noticeTime = Utils.LoadLocalFile(string.format("Family_%s_notice_time", group.id)) or 0 local noticeText = Utils.LoadLocalFile(string.format("Family_%s_notice_text", group.id)) or "" - if tonumber(os.date("%Y%m%d", tonumber(noticeTime))) - tonumber(os.date("%Y%m%d", os.time())) < -1 and group.notice and #group.notice > 0 and noticeText ~= group.notice then + if tonumber(os.date("%Y%m%d", tonumber(noticeTime))) - tonumber(os.date("%Y%m%d", os.time())) <= -1 or (group.notice and #group.notice > 0 and noticeText ~= group.notice) then Utils.SaveLocalFile(string.format("Family_%s_notice_time", group.id), os.time()) Utils.SaveLocalFile(string.format("Family_%s_notice_text", group.id), group.notice) local my = M.New(data, callback) diff --git a/lua_probject/base_project/Game/View/Family/FamilyNumberRecord.lua b/lua_probject/base_project/Game/View/Family/FamilyNumberRecord.lua index 25148872..615a60c6 100644 --- a/lua_probject/base_project/Game/View/Family/FamilyNumberRecord.lua +++ b/lua_probject/base_project/Game/View/Family/FamilyNumberRecord.lua @@ -240,17 +240,24 @@ function FamilyNumberRecord.New(root, page) return end local newReadType = 3 - self.readStatusNum - fgCtr:FG_SetGroupRecordReadStatus(group_id, GetPlatform(), self.military.list, newReadType - 1, self._tagId, - function(res) - pt(res) - if res.ReturnCode ~= 0 then - ViewUtil.ErrorTip(res.ReturnCode, "修改战绩阅读状态失败") - else - self.ctr_numberRecord.selectedIndex = 1 - self:OnClickNumberRank(group_id, self.rankNumber.uid, self.rankNumber.round) - self.military = { size = 0, list = {} } - end - end) + local _curren_msg = MsgWindow.new(self._root_view, newReadType == 1 and "确定要将选中的对局设置为未读" or "确定要将选中的对局设置为已读", + MsgWindow.MsgMode.OkAndCancel) + _curren_msg.onOk:Add(function() + fgCtr:FG_SetGroupRecordReadStatus(group_id, GetPlatform(), self.military.list, newReadType - 1, self._tagId, + function(res) + pt(res) + if res.ReturnCode ~= 0 then + ViewUtil.ErrorTip(res.ReturnCode, "修改战绩阅读状态失败") + else + self.ctr_numberRecord.selectedIndex = 1 + self:OnClickNumberRank(group_id, self.rankNumber.uid, self.rankNumber.round) + self.military = { size = 0, list = {} } + self:OnClickSortType() + ViewUtil.ErrorTip(-1, "设置成功") + end + end) + end) + _curren_msg:Show() end) self._view:GetChild('btn_allChooseReverse').onClick:Set(function() self._flag_allChooseReverse = self.records[self.gameTypeNum][self.readStatusNum].childNum @@ -404,6 +411,7 @@ function M:NumberRecordDetailRender() obj:GetChild('text_playName').emojies = EmojiDitc.EmojiesDitc obj:GetChild('text_playName').text = info.pname obj:GetChild('btn_lookRecord').onClick:Set(function() + -- self._view:GetChild('box_mumberTime').selectedIndex = self._view:GetController('day').selectedIndex self._viewList_recordDetail:RemoveChildrenToPool() for i = 1, tonumber(info.round) do local obj = self._viewList_recordDetail:AddItemFromPool() @@ -439,7 +447,7 @@ function M:NumberRecordDetailRender() resultDetailList.itemRenderer = function(index, obj) local resultInfo = info.totalScore[index + 1] ImageLoad.Load(resultInfo.portrait, obj:GetChild('btn_head')._iconObject) - obj:GetChild('text_name').text = resultInfo.nick + obj:GetChild('text_name').text = ViewUtil.stringEllipsis(resultInfo.nick) obj:GetChild('text_score').text = string.format("%s%s", resultInfo.score >= 0 and "+" or "", resultInfo .score) obj:GetController('colour').selectedIndex = resultInfo.score >= 0 and 1 or 0 diff --git a/lua_probject/base_project/Game/View/FamilyView.lua b/lua_probject/base_project/Game/View/FamilyView.lua index d2956254..b38ade8b 100644 --- a/lua_probject/base_project/Game/View/FamilyView.lua +++ b/lua_probject/base_project/Game/View/FamilyView.lua @@ -252,6 +252,22 @@ function M:init(url) end end) end) + + local list_familyNumber = self._view:GetChild('list_familyNumber') + if list_familyNumber then + list_familyNumber.scrollPane.onScroll:Set(function() + self._flag_falshMenberTime = true + self._data_falshMenberTime = 7 + end) + end + + local list_room = self._view:GetChild('list_room') + if list_room then + list_room.scrollPane.onScroll:Set(function() + self._flag_falshRoomTime = true + self._data_falshRoomTime = 20 + end) + end end function M:Reflash() @@ -280,7 +296,7 @@ function M:Reflash() end local btn = self.list_family:GetChildAt(chooseIndex - 1) btn.onClick:Call() - FamilyNotice.TryShow({ group = DataManager.groups.groupList[chooseIndex] }) + self:RefNotice(DataManager.groups.groupList[chooseIndex].id) else self:JoinFamily(true) self.btn_chatRoom.visible = false @@ -492,16 +508,18 @@ end function M:ReflashMember() self.members = SortMembers(self._group.members) - local list_familyNumber = self._view:GetChild('list_familyNumber') if list_familyNumber.itemRenderer == nil then return end - - if list_familyNumber.numItems == #self._group.members then - list_familyNumber:RefreshVirtualList() + if self._group.isShow == 1 or self._group.lev < 3 then + if list_familyNumber.numItems == #self._group.members then + list_familyNumber:RefreshVirtualList() + else + list_familyNumber.numItems = #self._group.members + end else - list_familyNumber.numItems = #self._group.members + list_familyNumber.numItems = 0 end end @@ -535,7 +553,11 @@ function M:ChangeNumber(fgCtr, group_id, limit, num, minus_only, sort_type) ImageLoad.Load(player.portrait, loader_icon) end --list_familyNumber.numItems = #self._group.members - list_familyNumber.numItems = #self.members + if self._group.isShow == 1 or self._group.lev < 3 then + list_familyNumber.numItems = #self.members + else + list_familyNumber.numItems = 0 + end self:ChangeOther() return 1 end @@ -891,6 +913,7 @@ end function M:OnUpdate() local fgCtr = ControllerManager.GetController(NewGroupController) local newTime = os.time() + local deltaTime = Time.deltaTime -- --12001事件 local func = self._mgr_ctr:PopEvent() if (func ~= nil) then @@ -945,7 +968,28 @@ function M:OnUpdate() self.lastTime = newTime if self._view:GetChild('list_familyNumber').itemRenderer then self.members = SortMembers(self._group.members) --local members = self._group.members - self._view:GetChild('list_familyNumber').numItems = #self.members + if self._group.isShow == 1 or self._group.lev < 3 then + self._view:GetChild('list_familyNumber').numItems = #self.members + else + self._view:GetChild('list_familyNumber').numItems = 0 + end + end + end + + if self._flag_falshMenberTime then + if self._data_falshMenberTime > 0 then + self._data_falshMenberTime = self._data_falshMenberTime - deltaTime + else + self._flag_falshMenberTime = false + self._view:GetChild('list_familyNumber').scrollPane:SetPosY(0, true) + end + end + if self._flag_falshRoomTime then + if self._data_falshRoomTime > 0 then + self._data_falshRoomTime = self._data_falshRoomTime - deltaTime + else + self._flag_falshRoomTime = false + self._view:GetChild('list_room').scrollPane:SetPosY(0, true) end end end @@ -1175,6 +1219,11 @@ function M:ReflashChatRoomRedPoint() tex_redPoint.text = tex end +function M:RefNotice(groupId) + local group = DataManager.groups:get(groupId) + FamilyNotice.TryShow({ group = group }) +end + function M:Show() ViewUtil.PlaySoundBg() Broadcast.AddListener(BroadcastEvent.OnJoinsChange, ReflashJoinsRedPoint, self) diff --git a/lua_probject/base_project/Game/View/Lobby/LobbyRecordView.lua b/lua_probject/base_project/Game/View/Lobby/LobbyRecordView.lua index 33312ce3..038a148c 100644 --- a/lua_probject/base_project/Game/View/Lobby/LobbyRecordView.lua +++ b/lua_probject/base_project/Game/View/Lobby/LobbyRecordView.lua @@ -111,7 +111,7 @@ function M:RecordDetailRenderer(index, obj, data) local score = data.totalScore[index + 1].score obj:GetController('colour').selectedIndex = score >= 0 and 1 or 0 obj:GetChild('text_score').text = string.format("%s%d", score >= 0 and "+" or "", score) - obj:GetChild('text_name').text = data.totalScore[index + 1].nick + obj:GetChild('text_name').text = ViewUtil.stringEllipsis(data.totalScore[index + 1].nick, 5) end function M:PlayerNameRenderer(index, obj) diff --git a/lua_probject/base_project/table/Table_Error_code.lua b/lua_probject/base_project/table/Table_Error_code.lua index e1e19328..eaf68ab5 100644 --- a/lua_probject/base_project/table/Table_Error_code.lua +++ b/lua_probject/base_project/table/Table_Error_code.lua @@ -42,7 +42,7 @@ Table_Error_code_Map = { [999] = { id = 999, note = "未知错误" }, [17] = { id = 17, note = "奖券不足" }, [53] = { id = 53, note = "与桌上玩家IP相同,进入房间失败" }, - [54] = { id = 54, note = "与桌上玩家距离过近,进入房间失败" }, + [54] = { id = 54, note = "加入房间失败,距离太近,无法进入房间" }, [55] = { id = 55, note = "GPS服务未开启,请开启GPS服务!" }, [56] = { id = 56, note = "不是亲友圈" }, [57] = { id = 57, note = "亲友圈不能退出" }, @@ -50,7 +50,7 @@ Table_Error_code_Map = { [61] = { id = 61, note = "手机号码已绑定玩家" }, [80] = { id = 80, note = "房间已删除" }, [81] = { id = 81, note = "是亲友圈房间" }, - [83] = { id = 83, note = "分数已被限制,请联系管理员" }, + [83] = { id = 83, note = "创建亲友圈房间失败,已达到积分限制,请联系亲友圈管理员" }, [1000] = { id = 1000, note = "已申请加入" }, [1001] = { id = 1001, note = "成员已存在" }, [1002] = { id = 1002, note = "成员不存在" }, diff --git a/lua_probject/extend_project/extend/majiang/fuzhou/EXMainView.lua b/lua_probject/extend_project/extend/majiang/fuzhou/EXMainView.lua index 52c8bb1b..5a55141a 100644 --- a/lua_probject/extend_project/extend/majiang/fuzhou/EXMainView.lua +++ b/lua_probject/extend_project/extend/majiang/fuzhou/EXMainView.lua @@ -67,31 +67,18 @@ function M:InitView(url) self.showNextCtr = self._view:GetController('showNext') self.showNextList = self._view:GetChild('list_showNext') self._view:GetChild('btn_showNext').onClick:Set(function() - coroutine.start(function() - local time = 0 - - ViewUtil:ShowModalWait2(0.01) - while not self._flag_getRemindCard do - if time > 20 then - break - end - coroutine.wait(0.05) + if self._flag_getRemindCard then + self.showNextCtr.selectedIndex = 1 + self.showNextList:SetVirtual() + self.showNextList.itemRenderer = function(index, obj) + local card = self.cardSet[index + 1] + self:FillShowCards(obj, card, self.cardMap[card]) + obj.data = { card = card } end - ViewUtil.CloseModalWait2() - if self._flag_getRemindCard then - self.showNextCtr.selectedIndex = 1 - self.showNextList:SetVirtual() - self.showNextList.itemRenderer = function(index, obj) - local card = self.cardSet[index + 1] - self:FillShowCards(obj, card, self.cardMap[card]) - obj.data = { card = card } - end - self.showNextList.numItems = #self.cardSet - time = time + 1 - else - self:reqResidueCard() - end - end) + self.showNextList.numItems = #self.cardSet + else + self:reqResidueCard() + end end) self._view:GetChild('btn_closeShow').onClick:Set(function() self.showNextCtr.selectedIndex = 0 diff --git a/lua_probject/extend_project/extend/majiang/jinxi/EXMainView.lua b/lua_probject/extend_project/extend/majiang/jinxi/EXMainView.lua index 7cf7677a..51b6577a 100644 --- a/lua_probject/extend_project/extend/majiang/jinxi/EXMainView.lua +++ b/lua_probject/extend_project/extend/majiang/jinxi/EXMainView.lua @@ -66,31 +66,18 @@ function M:InitView(url) self.showNextCtr = self._view:GetController('showNext') self.showNextList = self._view:GetChild('list_showNext') self._view:GetChild('btn_showNext').onClick:Set(function() - coroutine.start(function() - local time = 0 - - ViewUtil:ShowModalWait2(0.01) - while not self._flag_getRemindCard do - if time > 20 then - break - end - coroutine.wait(0.05) + if self._flag_getRemindCard then + self.showNextCtr.selectedIndex = 1 + self.showNextList:SetVirtual() + self.showNextList.itemRenderer = function(index, obj) + local card = self.cardSet[index + 1] + self:FillShowCards(obj, card, self.cardMap[card]) + obj.data = { card = card } end - ViewUtil.CloseModalWait2() - if self._flag_getRemindCard then - self.showNextCtr.selectedIndex = 1 - self.showNextList:SetVirtual() - self.showNextList.itemRenderer = function(index, obj) - local card = self.cardSet[index + 1] - self:FillShowCards(obj, card, self.cardMap[card]) - obj.data = { card = card } - end - self.showNextList.numItems = #self.cardSet - time = time + 1 - else - self:reqResidueCard() - end - end) + self.showNextList.numItems = #self.cardSet + else + self:reqResidueCard() + end end) self._view:GetChild('btn_closeShow').onClick:Set(function() self.showNextCtr.selectedIndex = 0 diff --git a/lua_probject/extend_project/extend/majiang/lichuan/EXMainView.lua b/lua_probject/extend_project/extend/majiang/lichuan/EXMainView.lua index 360aa05d..2575c90c 100644 --- a/lua_probject/extend_project/extend/majiang/lichuan/EXMainView.lua +++ b/lua_probject/extend_project/extend/majiang/lichuan/EXMainView.lua @@ -67,31 +67,18 @@ function M:InitView(url) self.showNextCtr = self._view:GetController('showNext') self.showNextList = self._view:GetChild('list_showNext') self._view:GetChild('btn_showNext').onClick:Set(function() - coroutine.start(function() - local time = 0 - - ViewUtil:ShowModalWait2(0.01) - while not self._flag_getRemindCard do - if time > 20 then - break - end - coroutine.wait(0.05) + if self._flag_getRemindCard then + self.showNextCtr.selectedIndex = 1 + self.showNextList:SetVirtual() + self.showNextList.itemRenderer = function(index, obj) + local card = self.cardSet[index + 1] + self:FillShowCards(obj, card, self.cardMap[card]) + obj.data = { card = card } end - ViewUtil.CloseModalWait2() - if self._flag_getRemindCard then - self.showNextCtr.selectedIndex = 1 - self.showNextList:SetVirtual() - self.showNextList.itemRenderer = function(index, obj) - local card = self.cardSet[index + 1] - self:FillShowCards(obj, card, self.cardMap[card]) - obj.data = { card = card } - end - self.showNextList.numItems = #self.cardSet - time = time + 1 - else - self:reqResidueCard() - end - end) + self.showNextList.numItems = #self.cardSet + else + self:reqResidueCard() + end end) self._view:GetChild('btn_closeShow').onClick:Set(function() self.showNextCtr.selectedIndex = 0 diff --git a/lua_probject/extend_project/extend/majiang/nancheng/EXMainView.lua b/lua_probject/extend_project/extend/majiang/nancheng/EXMainView.lua index b4101faf..290e1807 100644 --- a/lua_probject/extend_project/extend/majiang/nancheng/EXMainView.lua +++ b/lua_probject/extend_project/extend/majiang/nancheng/EXMainView.lua @@ -65,31 +65,18 @@ function M:InitView(url) self.showNextCtr = self._view:GetController('showNext') self.showNextList = self._view:GetChild('list_showNext') self._view:GetChild('btn_showNext').onClick:Set(function() - coroutine.start(function() - local time = 0 - - ViewUtil:ShowModalWait2(0.01) - while not self._flag_getRemindCard do - if time > 20 then - break - end - coroutine.wait(0.05) + if self._flag_getRemindCard then + self.showNextCtr.selectedIndex = 1 + self.showNextList:SetVirtual() + self.showNextList.itemRenderer = function(index, obj) + local card = self.cardSet[index + 1] + self:FillShowCards(obj, card, self.cardMap[card]) + obj.data = { card = card } end - ViewUtil.CloseModalWait2() - if self._flag_getRemindCard then - self.showNextCtr.selectedIndex = 1 - self.showNextList:SetVirtual() - self.showNextList.itemRenderer = function(index, obj) - local card = self.cardSet[index + 1] - self:FillShowCards(obj, card, self.cardMap[card]) - obj.data = { card = card } - end - self.showNextList.numItems = #self.cardSet - time = time + 1 - else - self:reqResidueCard() - end - end) + self.showNextList.numItems = #self.cardSet + else + self:reqResidueCard() + end end) self._view:GetChild('btn_closeShow').onClick:Set(function() self.showNextCtr.selectedIndex = 0 diff --git a/lua_probject/extend_project/extend/poker/runfast/CardCheck.lua b/lua_probject/extend_project/extend/poker/runfast/CardCheck.lua index f59647d2..06f2290e 100644 --- a/lua_probject/extend_project/extend/poker/runfast/CardCheck.lua +++ b/lua_probject/extend_project/extend/poker/runfast/CardCheck.lua @@ -11,6 +11,7 @@ local CardCheck = { threelack = false, fourDaiThree = false, fristCard = true, + haveRuleCard = false, tipCardList = {}, touchCardSet = {}, touchCardMao = {} @@ -40,6 +41,7 @@ function M:InitFlag() self.planelack = config.planelack == 1 self.threelack = config.threelack == 1 self.fourDaiThree = config.fourDaiThree + self.rule = config.rule self._flag_fristCard = true print("==============================lingmengcheckinitFlag") pt(config) @@ -124,14 +126,19 @@ function M:InitLastCard(cardList, mustPutMaxCard) end end -function M:initCards(cardList, flag, flag_allCards) +function M:initCards(cardList, data) print("lingmenginitCards") pt(cardList) local temp_long = 0 + data = data or {} self:Clear() - self._flag_allCards = flag_allCards or false - if flag then + self._flag_allCards = data.flag_allCards or false + self._flag_ruleCard = data.flag_ruleCard or false + if data.flag then for i = 1, #cardList do + if cardList[i].card_code_number == 34 then + self.haveRuleCard = true + end local number = math.floor(cardList[i][1].card_code_number / 10) if self.cardList[number] then self.cardList[number] = self.cardList[number] + 1 @@ -151,6 +158,9 @@ function M:initCards(cardList, flag, flag_allCards) end else for i = 1, #cardList do + if cardList[i].card_code_number == 34 then + self.haveRuleCard = true + end local number = math.floor(cardList[i].card_code_number / 10) if self.cardList[number] then self.cardList[number] = self.cardList[number] + 1 @@ -185,6 +195,9 @@ function M:CheckCards() if self.cardNum == 0 then return end + if self.rule == 1 and self._flag_ruleCard and DataManager.CurrenRoom.curren_round == 1 and not self.haveRuleCard then + return + end print("lingmeng self.lastMinCard", self.lastMinCard) @@ -764,6 +777,7 @@ function M:Clear() self.cardSize = 0 self.long = false self._flag_checkLst = false + self.haveRuleCard = false end return M diff --git a/lua_probject/extend_project/extend/poker/runfast/RunFast_MainView.lua b/lua_probject/extend_project/extend/poker/runfast/RunFast_MainView.lua index 7a348c93..b8aa65f4 100644 --- a/lua_probject/extend_project/extend/poker/runfast/RunFast_MainView.lua +++ b/lua_probject/extend_project/extend/poker/runfast/RunFast_MainView.lua @@ -481,13 +481,16 @@ function M:EventInit() local card = arg[1] self.ctr_state.selectedIndex = 1 -- self.ctr_card_eff.selectedIndex = 1 - -- self:PlayCardEff(card) + -- if self._room.room_config.people_num == 3 then + -- self:PlayCardEff(403) + -- end end) _gamectr:AddEventListener(RunFast_GameEvent.OnInitCard, function(...) local arg = { ... } local round = arg[1] local cardlist = arg[2] + self._popEvent = false if self.destory_win ~= nil then coroutine.stop(self.destory_win) @@ -556,6 +559,15 @@ function M:EventInit() --card_info:UpdateRemainCard(#cardlist,true) end end + + if self._room.room_config.people_num == 3 and round == 1 then + local effect = self._view:GetTransition(string.format('to_%s', self:GetPos(self._room.banker_seat))) + effect:Play(1, 0, function() + self._popEvent = true + end) + else + self._popEvent = true + end end) @@ -1025,7 +1037,7 @@ function M:EventInit() if player.seat ~= win_seat then card_info.ctr_outpoker.selectedIndex = 0 end - if win_seat == self._room.self_player.seat and player.seat ~= self._room.self_player.seat then + if player.seat ~= self._room.self_player.seat then local oneTime = 7 / 60 -- card_info:UpdateHandPoker(player.cards, false, true) diff --git a/lua_probject/extend_project/extend/poker/runfast/RunFast_PlayerBackView.lua b/lua_probject/extend_project/extend/poker/runfast/RunFast_PlayerBackView.lua index b32a6212..79989cb7 100644 --- a/lua_probject/extend_project/extend/poker/runfast/RunFast_PlayerBackView.lua +++ b/lua_probject/extend_project/extend/poker/runfast/RunFast_PlayerBackView.lua @@ -91,7 +91,6 @@ function M:InitView(url) self._cmdmap[RunFast_Record_Event.Evt_Pass] = self.CmdPass self._cmdmap[RunFast_Record_Event.Evt_NewRound] = self.CmdNewRound self._cmdmap[RunFast_Record_Event.Evt_result] = self.Cmdresult - self._cmdmap[RunFast_Record_Event.Evt_Result] = self.CmdResult end function M:NewPlayerPokerInfoView(view, index) @@ -197,6 +196,7 @@ function M:ShowStep(index) end if step.cmd == RunFast_Record_Event.Evt_result then local result = step.result + for i = 1, #result do local card_info = self._player_card_info[self:GetPos(result[i].seat)] diff --git a/lua_probject/extend_project/extend/poker/runfast/RunFast_PlayerSelfPokerInfoView.lua b/lua_probject/extend_project/extend/poker/runfast/RunFast_PlayerSelfPokerInfoView.lua index 098300f0..8334d7ba 100644 --- a/lua_probject/extend_project/extend/poker/runfast/RunFast_PlayerSelfPokerInfoView.lua +++ b/lua_probject/extend_project/extend/poker/runfast/RunFast_PlayerSelfPokerInfoView.lua @@ -216,6 +216,7 @@ function M:InitPoker(pokerList, isPlayAni, open) self.cor_init_poker = nil self.card_list = {} self._ctr_canSendCard.selectedIndex = 0 + self._flag_ruleCard = false self._view_handCard:RemoveChildren(0, -1, true) if isPlayAni == true then self.cor_init_poker = @@ -228,6 +229,9 @@ function M:InitPoker(pokerList, isPlayAni, open) table.sort(pokerList) table.sort(self.card_list, tableSortNumber) for i = #pokerList, 1, -1 do + if pokerList[i] == 403 then + self._flag_ruleCard = true + end local card_number_code = self:ChangeOneCodeByFrom(pokerList[i]) local card_flower_code = pokerList[i] -- local btn_card = self:CreatPoker(card_number_code, cs, open) @@ -283,6 +287,9 @@ function M:InitPoker(pokerList, isPlayAni, open) ) else for i = #pokerList, 1, -1 do + if pokerList[i] == 403 then + self._flag_ruleCard = true + end local card_number_code = self:ChangeOneCodeByFrom(pokerList[i]) local card_flower_code = pokerList[i] local btn_card = self._view_handCard:AddItemFromPool() @@ -483,7 +490,14 @@ function M:TouchMoveEnd(context) if #send_card > 0 then table.sort(send_card, tableSortNumber) send_card = #xuan_card > 0 and xuan_card or send_card - self._cardCheck:initCards(send_card, #xuan_card > 0, #send_card == self._view_handCard.numItems) + self._cardCheck:initCards(send_card, + { + flag = #xuan_card > 0, + flag_allCards = #send_card == self._view_handCard.numItems, + flag_ruleCard = self + ._flag_ruleCard + }) + self._ctr_canSendCard.selectedIndex = self._cardCheck:CheckCards() and 1 or 0 else self._ctr_canSendCard.selectedIndex = 0 @@ -840,7 +854,7 @@ function M:UpdateHandCardsColor() end if #send_card > 0 then table.sort(send_card, tableSortNumber) - self._cardCheck:initCards(send_card, false, #send_card == self._view_handCard.numItems) + self._cardCheck:initCards(send_card, { flag = false, flag_allCards = #send_card == self._view_handCard.numItems }) self._ctr_canSendCard.selectedIndex = self._cardCheck:CheckCards() and 1 or 0 else self._ctr_canSendCard.selectedIndex = 0 @@ -1447,6 +1461,7 @@ function M:Clear() self.card_list = {} self.out_card_list = {} self._view_handCard:RemoveChildren(0, -1, true) + self._flag_ruleCard = false -- self.mask_liangpai:RemoveChildren(0,-1,true) end diff --git a/lua_probject/extend_project/extend/poker/runfast/RunFast_ResultView.lua b/lua_probject/extend_project/extend/poker/runfast/RunFast_ResultView.lua index 6ee7d445..45eb1d95 100644 --- a/lua_probject/extend_project/extend/poker/runfast/RunFast_ResultView.lua +++ b/lua_probject/extend_project/extend/poker/runfast/RunFast_ResultView.lua @@ -139,7 +139,7 @@ end function M:FillPlayerHead(view, playerInfo, bigWin) ImageLoad.Load(playerInfo.self_user.head_url, view:GetChild('btn_head')._iconObject) - view:GetChild('text_name').text = playerInfo.self_user.nick_name + view:GetChild('text_name').text = ViewUtil.stringEllipsis(playerInfo.self_user.nick_name) view:GetChild('text|_ID').text = playerInfo.self_user.account_id view:GetController('bigWin').selectedIndex = bigWin and 1 or 0 end diff --git a/wb_new_ui/assets/Extend_Poker_RunFastNew/Main_New/PlayerHead_3.xml b/wb_new_ui/assets/Extend_Poker_RunFastNew/Main_New/PlayerHead_3.xml index 25fba47f..8420a40c 100644 --- a/wb_new_ui/assets/Extend_Poker_RunFastNew/Main_New/PlayerHead_3.xml +++ b/wb_new_ui/assets/Extend_Poker_RunFastNew/Main_New/PlayerHead_3.xml @@ -1,7 +1,7 @@ - - + + @@ -101,6 +101,7 @@ + diff --git a/wb_new_ui/assets/Extend_Poker_RunFastNew/Main_New/Player_card_info_2.xml b/wb_new_ui/assets/Extend_Poker_RunFastNew/Main_New/Player_card_info_2.xml index 33c8590e..3a526f26 100644 --- a/wb_new_ui/assets/Extend_Poker_RunFastNew/Main_New/Player_card_info_2.xml +++ b/wb_new_ui/assets/Extend_Poker_RunFastNew/Main_New/Player_card_info_2.xml @@ -1,8 +1,8 @@ - + - + @@ -21,9 +21,23 @@ + + + + + + + + + + + + + + - + @@ -61,6 +75,7 @@ + diff --git a/wb_new_ui/assets/Extend_Poker_RunFastNew/Main_New/Player_card_info_3.xml b/wb_new_ui/assets/Extend_Poker_RunFastNew/Main_New/Player_card_info_3.xml index c8d211e8..24d57922 100644 --- a/wb_new_ui/assets/Extend_Poker_RunFastNew/Main_New/Player_card_info_3.xml +++ b/wb_new_ui/assets/Extend_Poker_RunFastNew/Main_New/Player_card_info_3.xml @@ -1,9 +1,9 @@ - - - - + + + + @@ -26,9 +26,18 @@ + + + + + + + + + - + @@ -38,6 +47,14 @@ + + + + + + + + @@ -58,7 +75,6 @@ - diff --git a/wb_new_ui/assets/Extend_Poker_RunFastNew/RunFast_Main_New_3.xml b/wb_new_ui/assets/Extend_Poker_RunFastNew/RunFast_Main_New_3.xml index 44835509..98d4cc2b 100644 --- a/wb_new_ui/assets/Extend_Poker_RunFastNew/RunFast_Main_New_3.xml +++ b/wb_new_ui/assets/Extend_Poker_RunFastNew/RunFast_Main_New_3.xml @@ -1,9 +1,9 @@ - + - + @@ -41,7 +41,7 @@ - + @@ -88,9 +88,9 @@ - + - + @@ -144,15 +144,15 @@ - + - + - + @@ -185,10 +185,11 @@ - + + @@ -274,4 +275,27 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/wb_new_ui/assets/Extend_Poker_RunFastNew/component/effect/poker/poker_eff.xml b/wb_new_ui/assets/Extend_Poker_RunFastNew/component/effect/poker/poker_eff.xml index 07a3510c..fe22d4d4 100644 --- a/wb_new_ui/assets/Extend_Poker_RunFastNew/component/effect/poker/poker_eff.xml +++ b/wb_new_ui/assets/Extend_Poker_RunFastNew/component/effect/poker/poker_eff.xml @@ -1,8 +1,9 @@ - - + +