diff --git a/lua_probject/base_project/Game/Controller/GroupMgrController.lua b/lua_probject/base_project/Game/Controller/GroupMgrController.lua index 927aa89c..8f8d57cc 100644 --- a/lua_probject/base_project/Game/Controller/GroupMgrController.lua +++ b/lua_probject/base_project/Game/Controller/GroupMgrController.lua @@ -16,6 +16,7 @@ GroupMgrEvent = { IsOpenChatRoom = "IsOpenChatRoom", ChatRoomData = "ChatRoomData", OnNewApply = "OnNewApply", + OnNewRecord = "OnNewRecord", } GroupMgrController = { @@ -53,6 +54,7 @@ function GroupMgrController.new() self._eventmap[Protocol.FGMGR_RESPONSE_INVITE] = self.FG_ResponseInvited self._eventmap[Protocol.FGMGR_EVT_ISOPEN_CHATROOM] = self.FG_Isopen_ChatRoom self._eventmap[Protocol.FGMGR_EVT_DATA_CHATROOM] = self.FG_Data_ChatRoom + self._eventmap[Protocol.FGMGR_EVT_NEWCHAT] = self.FG_Data_NewChat -- self:connect(callback) return self end @@ -341,6 +343,28 @@ function M:FG_InvitePlayer(group_id, tag, player_id, roomid, pid, game_name, cal end) end +-- 进入亲友圈 +function M:FG_Get_Online_Member(groupId, callback) + local _data = {} + _data.id = groupId + _data.uid = DataManager.SelfUser.account_id + local _client = ControllerManager.GroupClient + _client:send(Protocol.WEB_FG_GET_ONLINE_MEMBER, _data, function(res) + callback(res) + end) +end + +-- 退出亲友圈 +function M:FG_Get_Offline_Member(groupId, callback) + local _data = {} + _data.id = groupId + _data.uid = DataManager.SelfUser.account_id + local _client = ControllerManager.GroupClient + _client:send(Protocol.WEB_FG_GET_OFFLINE_MEMBER, _data, function(res) + callback(res) + end) +end + -- 回复邀请 -- function M:FG_ResponseInvited(id, refuse) -- local _data = {} @@ -368,10 +392,15 @@ end function M:FG_Data_ChatRoom(evt_data) print("收到是否开启聊天室推送") pt(evt_data) - --json.decode(_totalScore) DispatchEvent(self._dispatcher, GroupMgrEvent.ChatRoomData, evt_data) end +function M:FG_Data_NewChat(evt_data) + print("收到新聊天室推送") + pt(evt_data) + DispatchEvent(self._dispatcher, GroupMgrEvent.OnNewRecord, evt_data) +end + function M:PopEvent() local _cacheEvent = self._cacheEvent if (_cacheEvent:Count() > 0) then diff --git a/lua_probject/base_project/Game/Controller/NewGroupController.lua b/lua_probject/base_project/Game/Controller/NewGroupController.lua index 5f67fa32..2c9623f0 100644 --- a/lua_probject/base_project/Game/Controller/NewGroupController.lua +++ b/lua_probject/base_project/Game/Controller/NewGroupController.lua @@ -1675,6 +1675,7 @@ function M:FG_Recharge_Diamo(groupId, diamo, callback) end) end +--[[ -- 进入亲友圈 function M:FG_Get_Online_Member(groupId, callback) local _data = {} @@ -1694,3 +1695,4 @@ function M:FG_Get_Offline_Member(groupId, callback) callback(res) end) end +]] diff --git a/lua_probject/base_project/Game/Protocol.lua b/lua_probject/base_project/Game/Protocol.lua index 92303811..543aafa5 100644 --- a/lua_probject/base_project/Game/Protocol.lua +++ b/lua_probject/base_project/Game/Protocol.lua @@ -278,9 +278,9 @@ Protocol = { -- 亲友圈房卡充值 WEB_FG_RECHARGE_DIAMO = "group/recharge_diamo", -- 进入亲友圈 - WEB_FG_GET_ONLINE_MEMBER = "group/get_online_member", + WEB_FG_GET_ONLINE_MEMBER = "13005",--"get_online_member", -- 退出亲友圈 - WEB_FG_GET_OFFLINE_MEMBER = "group/get_offline_member", + WEB_FG_GET_OFFLINE_MEMBER = "13006",--"get_offline_member", -------------- group-log--------------------- -- 获取奖励日志 WEB_FG_GET_REWARDS_LOG = "group/log/get_reward_log", @@ -397,6 +397,8 @@ Protocol = { FGMGR_EVT_ENTER_CHATROOM = "13004", -- 聊天室协议 FGMGR_EVT_DATA_CHATROOM = "13003", + -- 其他成员结算游戏时推送战绩 + FGMGR_EVT_NEWCHAT = "12011", -- 设置是否允许观战 WEB_FG_SET_CANWATCH = "group/set_group_guest", diff --git a/lua_probject/base_project/Game/View/Family/FamilyChatRoom.lua b/lua_probject/base_project/Game/View/Family/FamilyChatRoom.lua index 18874aa4..437303be 100644 --- a/lua_probject/base_project/Game/View/Family/FamilyChatRoom.lua +++ b/lua_probject/base_project/Game/View/Family/FamilyChatRoom.lua @@ -5,8 +5,8 @@ require 'FairyGUI' local function SetBigWiller(totalScore) local s = -999 local winer = 0 - for _,player in pairs(totalScore) do - if player.score > s then + for _, player in pairs(totalScore) do + if player.score > s then s = player.score winer = _ end @@ -22,21 +22,20 @@ local function list_players_Renderer(index, obj, totalScore, self) local tex_score = obj:GetChild("tex_score") local player = totalScore[index + 1] - + tex_name.text = player.nick tex_id.text = player.accId tex_score.text = player.score ImageLoad.Load(player.portrait, loader_icon) - if player.winer then + if player.winer then obj:GetController("cWiner").selectedIndex = 1 - else + else obj:GetController("cWiner").selectedIndex = 0 end end local function ChatItemRenderer(index, obj, self) - --local data = self.ChatRoomData.records[index + 1] local data = self.ChatRoomData[1].records[index + 1] local totalScore = json.decode(data.totalScore) @@ -116,35 +115,53 @@ function FamilyChatRoom:Close() end function FamilyChatRoom:Refalsh() - --local data = string.sub(self.ChatRoomData[1].records, 1, -2) - --data = data .. ']' pt(self.ChatRoomData[1]) - --pt(data) - --self.records = json.decode(self.ChatRoomData[1].records) - --self.records = json.decode(self.ChatRoomData[1].records) self.list_chat.numItems = #self.ChatRoomData[1].records or 0 end +-- 新战绩推到时刷新一条 +function FamilyChatRoom:OnNewChatRefalsh(arg) + local groupId = arg.gid + local maxRound = arg.datas.maxRound + local round = arg.datas.round + local playerlist = arg.datas.datas + local time = arg.datas.time + local roomId = arg.datas.roomid + local pid = arg.datas.pid + local group = DataManager.groups.groupMap[groupId] + local play = group:getPlay(pid) + local gameName = play.game_name + + local obj = self.list_chat:AddItemFromPool() + local list_players = obj:GetChild("list_players") + local tex_time = obj:GetChild("tex_time") + local tex_name = obj:GetChild("tex_name") + local tex_roomIdRound = obj:GetChild("tex_roomIdRound") + + tex_time.text = os.date("游戏结算:%m月%d号 %X", time) --data.create_time + tex_name.text = gameName + local roundTex = round .. "/" .. maxRound + tex_roomIdRound.text = roomId .. "\n" .. roundTex + + for _, player in pairs(playerlist) do + + local pObj = list_players:AddItemFromPool() + + local tex_name = pObj:GetChild("tex_name") + local loader_icon = pObj:GetChild("loader_icon") + local tex_id = pObj:GetChild("tex_id") + local tex_score = pObj:GetChild("tex_score") + + tex_name.text = player.nick + tex_id.text = player.accId + tex_score.text = player.score + ImageLoad.Load(player.portrait, loader_icon) + end +end + function FamilyChatRoom:Show() local cChatRoom = self.root._view:GetController("cIsChatRoom") cChatRoom.selectedIndex = 1 - - --[[ - GetIsOpenChatRoom(self.root._group.id, self) - - local fgCtr = ControllerManager.GetController(NewGroupController) - fgCtr:GetChatRoom(self.root._group.id, function(res) - self:GetChatCallBack(res) - end) - ]] end ---[[ -function FamilyChatRoom:GetChatCallBack(res) - print("收到聊天室协议") - pt(res) - pt(res.Data.records.totalScore) -end -]] - -return FamilyChatRoom \ No newline at end of file +return FamilyChatRoom diff --git a/lua_probject/base_project/Game/View/Family/FamilyEventView.lua b/lua_probject/base_project/Game/View/Family/FamilyEventView.lua index 562836dd..0e122973 100644 --- a/lua_probject/base_project/Game/View/Family/FamilyEventView.lua +++ b/lua_probject/base_project/Game/View/Family/FamilyEventView.lua @@ -24,6 +24,7 @@ function FamilyEventView.new(root) mgr_ctr:AddEventListener(GroupMgrEvent.IsOpenChatRoom, handler(self, self._evtIsOpenChatRoom)) mgr_ctr:AddEventListener(GroupMgrEvent.ChatRoomData, handler(self, self._evtChatRoomData)) mgr_ctr:AddEventListener(GroupMgrEvent.OnNewApply, handler(self, self._evtOnNewApply)) + mgr_ctr:AddEventListener(GroupMgrEvent.OnNewRecord, handler(self, self._evtOnNewRecord)) return self end @@ -146,4 +147,13 @@ function M:_evtChatRoomData(...) view.com_FamilyChatRoom:Refalsh() end +function M:_evtOnNewRecord(...) + local view = ViewManager.GetCurrenView() + if view.class ~= "FamilyMainView" then + return + end + local arg = { ... } + view.com_FamilyChatRoom:OnNewChatRefalsh(arg[1]) +end + return M diff --git a/lua_probject/base_project/Game/View/FamilyView.lua b/lua_probject/base_project/Game/View/FamilyView.lua index 8668cabe..51af1cb7 100644 --- a/lua_probject/base_project/Game/View/FamilyView.lua +++ b/lua_probject/base_project/Game/View/FamilyView.lua @@ -24,14 +24,14 @@ FamilyView = {} local M = FamilyView local function FamilyOnline(groupId) - local fgCtr = ControllerManager.GetController(NewGroupController) + local fgCtr = ControllerManager.GetController(GroupMgrController) fgCtr:FG_Get_Online_Member(groupId, function(res) end) end local function FamilyOffline(groupId) - local fgCtr = ControllerManager.GetController(NewGroupController) + local fgCtr = ControllerManager.GetController(GroupMgrController) fgCtr:FG_Get_Offline_Member(groupId, function(res) end) diff --git a/lua_probject/base_project/Game/View/ResultView.lua b/lua_probject/base_project/Game/View/ResultView.lua index ca22f6ed..1e218e78 100644 --- a/lua_probject/base_project/Game/View/ResultView.lua +++ b/lua_probject/base_project/Game/View/ResultView.lua @@ -2,102 +2,103 @@ ResultView = {} local M = ResultView -setmetatable(M, {__index = BaseWindow}) -local self = setmetatable({}, {__index = M}) +setmetatable(M, { __index = BaseWindow }) +local self = setmetatable({}, { __index = M }) - -function M:InitView() - self:InitMaPai() - self:InitMaPaiShowPanel() - +function M:Show() + local obj = self._view:GetChild("Frist") + if obj then + local pos = obj.xy + self._view:GetChild("Frist"):TweenMove(Vector2.New(pos.x, pos.y + 200), 1.5) + end + BaseWindow.Show(self) end +function M:InitView() + self:InitMaPai() + self:InitMaPaiShowPanel() +end function M:InitMaPaiShowPanel() - self.mapaiTypeCtr=self._view:GetController("matype") - if self.mapaiTypeCtr then - self.mapaiTypeCtr.selectedIndex=0 - end - - - self.mapaiTypeBgShowCtr=self._view:GetController("matypebgshow") - if self.mapaiTypeBgShowCtr then - self.mapaiTypeBgShowCtr.selectedIndex=0 - end - - self.mapaiTypeShowCtr=self._view:GetController("matypeshow") - if self.mapaiTypeShowCtr then - self.mapaiTypeShowCtr.selectedIndex=0 - end + self.mapaiTypeCtr = self._view:GetController("matype") + if self.mapaiTypeCtr then + self.mapaiTypeCtr.selectedIndex = 0 + end + + + self.mapaiTypeBgShowCtr = self._view:GetController("matypebgshow") + if self.mapaiTypeBgShowCtr then + self.mapaiTypeBgShowCtr.selectedIndex = 0 + end + + self.mapaiTypeShowCtr = self._view:GetController("matypeshow") + if self.mapaiTypeShowCtr then + self.mapaiTypeShowCtr.selectedIndex = 0 + end end function M:InitMaPai() - self.maPaiCtr=self._view:GetController("mapai") - if self.maPaiCtr then - self.maPaiCtr.selectedIndex=0 - end - - - self.maPaiList={} - - for i=1,8 do - local tempMP=self._view:GetChild("niao"..i) - if tempMP then - table.insert(self.maPaiList,tempMP) - end - - end - + self.maPaiCtr = self._view:GetController("mapai") + if self.maPaiCtr then + self.maPaiCtr.selectedIndex = 0 + end + + + self.maPaiList = {} + + for i = 1, 8 do + local tempMP = self._view:GetChild("niao" .. i) + if tempMP then + table.insert(self.maPaiList, tempMP) + end + end end -function M:IsMapaiShow(niao,isShow) - if niao then - niao.visible=isShow - end +function M:IsMapaiShow(niao, isShow) + if niao then + niao.visible = isShow + end end - -function M:SetMaPaiValue(niao,value) - if niao then - niao.icon='ui://Main_Majiang/' ..get_majiang_prefix(DataManager.CurrenRoom.game_id).."201_"..value - end +function M:SetMaPaiValue(niao, value) + if niao then + niao.icon = 'ui://Main_Majiang/' .. get_majiang_prefix(DataManager.CurrenRoom.game_id) .. "201_" .. value + end end -function M:SetMaPaiColor(niao,num) - niao:GetController("color").selectedIndex=num +function M:SetMaPaiColor(niao, num) + niao:GetController("color").selectedIndex = num end function M:HideAllMapai() - for i=1,#self.maPaiList do - self:IsMapaiShow(self.maPaiList[i],false) - self:SetMaPaiColor(self.maPaiList[i],0) - end + for i = 1, #self.maPaiList do + self:IsMapaiShow(self.maPaiList[i], false) + self:SetMaPaiColor(self.maPaiList[i], 0) + end end - - function M:ShowSelectMaPai(niaoList) - if niaoList and #niaoList>0 then - self.maPaiCtr.selectedIndex=1 - self:HideAllMapai() - for i=1,#niaoList do - self:IsMapaiShow(self.maPaiList[i],true) - self:SetMaPaiValue(self.maPaiList[i],niaoList[i].card) - if niaoList[i].score>0 then - self:SetMaPaiColor(self.maPaiList[i],2) - end - end - else - self.maPaiCtr.selectedIndex=0 - end + if niaoList and #niaoList > 0 then + self.maPaiCtr.selectedIndex = 1 + self:HideAllMapai() + for i = 1, #niaoList do + self:IsMapaiShow(self.maPaiList[i], true) + self:SetMaPaiValue(self.maPaiList[i], niaoList[i].card) + if niaoList[i].score > 0 then + self:SetMaPaiColor(self.maPaiList[i], 2) + end + end + else + self.maPaiCtr.selectedIndex = 0 + end end - -function M:init(url,isBigFull) +function M:init(url, isBigFull) + self._animation = false BaseWindow.init(self, url) - - self:InitView() - + + self:InitView() + local btn_share = self._view:GetChild('btn_share') if btn_share ~= nil then btn_share.onClick:Set( @@ -127,15 +128,15 @@ function M:init(url,isBigFull) local big_result = self._view:GetChild('big_result') if big_result ~= nil then - if isBigFull then - - else - self._full = true - big_result:AddRelation(self._view, RelationType.Size) - big_result.width = self._view.width - big_result.height = self._view.height - end - + if isBigFull then + + else + self._full = true + big_result:AddRelation(self._view, RelationType.Size) + big_result.width = self._view.width + big_result.height = self._view.height + end + local btn_share_copy = big_result:GetChild('btn_share_copy') btn_share_copy.onClick:Set( @@ -193,7 +194,6 @@ function M:init(url,isBigFull) end end - -- 分享数据至聊天室,需在扩展填充数据,GenerateRoomResultInfo() function M:__ShareResultInfo() local info = self._resultInfo diff --git a/lua_probject/base_project/Game/View/ViewUtil.lua b/lua_probject/base_project/Game/View/ViewUtil.lua index a72b7c10..b1d50826 100644 --- a/lua_probject/base_project/Game/View/ViewUtil.lua +++ b/lua_probject/base_project/Game/View/ViewUtil.lua @@ -361,10 +361,3 @@ function ViewUtil.ShowOneInput(showText, callback) GRoot.inst:RemoveChild(pop_oneInput) end) end - -function ViewUtil.TextOmit(str) - if utf8.len(str) > 6 then - return string.sub(str, 1, utf8.offset(s, 6)) .. "..." - end - return str -end diff --git a/lua_probject/extend_project/extend/majiang/fuzhou/EXMainView.lua b/lua_probject/extend_project/extend/majiang/fuzhou/EXMainView.lua index 713b396c..7b2e1769 100644 --- a/lua_probject/extend_project/extend/majiang/fuzhou/EXMainView.lua +++ b/lua_probject/extend_project/extend/majiang/fuzhou/EXMainView.lua @@ -126,7 +126,7 @@ function M:InitView(url) btn_closeRoom.onClick:Add(handler(self, function() local settingView = SettingView.new(self) - settingView:Show() + settingView:Show(self._room) end)) -------- diff --git a/lua_probject/extend_project/extend/majiang/jinxi/EXMainView.lua b/lua_probject/extend_project/extend/majiang/jinxi/EXMainView.lua index 0f2848d8..e5164d52 100644 --- a/lua_probject/extend_project/extend/majiang/jinxi/EXMainView.lua +++ b/lua_probject/extend_project/extend/majiang/jinxi/EXMainView.lua @@ -122,7 +122,7 @@ function M:InitView(url) btn_closeRoom.onClick:Add(handler(self, function() local settingView = SettingView.new(self) - settingView:Show() + settingView:Show(self._room) end)) diff --git a/lua_probject/extend_project/extend/majiang/nancheng/EXMainView.lua b/lua_probject/extend_project/extend/majiang/nancheng/EXMainView.lua index 215c6ee7..ed5b51f1 100644 --- a/lua_probject/extend_project/extend/majiang/nancheng/EXMainView.lua +++ b/lua_probject/extend_project/extend/majiang/nancheng/EXMainView.lua @@ -125,7 +125,7 @@ function M:InitView(url) btn_closeRoom.onClick:Add(handler(self, function() local settingView = SettingView.new(self) - settingView:Show() + settingView:Show(self._room) end)) -------- diff --git a/wb_new_ui/assets/Common/package.xml b/wb_new_ui/assets/Common/package.xml index d8357613..39a5e960 100644 --- a/wb_new_ui/assets/Common/package.xml +++ b/wb_new_ui/assets/Common/package.xml @@ -2086,6 +2086,17 @@ + + + + + + + + + + + diff --git a/wb_new_ui/assets/Main_Majiang/Main_new/Clearing/clearing.xml b/wb_new_ui/assets/Main_Majiang/Main_new/Clearing/clearing.xml index 3c4fed5f..6c90ea9b 100644 --- a/wb_new_ui/assets/Main_Majiang/Main_new/Clearing/clearing.xml +++ b/wb_new_ui/assets/Main_Majiang/Main_new/Clearing/clearing.xml @@ -1,18 +1,18 @@ - + - - - + + + - + - + diff --git a/wb_new_ui/assets/Main_Majiang/Main_new/Main/Component/Comp_jing.xml b/wb_new_ui/assets/Main_Majiang/Main_new/Main/Component/Comp_jing.xml index 219dfa27..a80ba449 100644 --- a/wb_new_ui/assets/Main_Majiang/Main_new/Main/Component/Comp_jing.xml +++ b/wb_new_ui/assets/Main_Majiang/Main_new/Main/Component/Comp_jing.xml @@ -2,10 +2,10 @@ - + - + diff --git a/wb_new_ui/assets/Main_Majiang/Main_new/Main/PlayerHead_1.xml b/wb_new_ui/assets/Main_Majiang/Main_new/Main/PlayerHead_1.xml index 381c75ef..228ec16a 100644 --- a/wb_new_ui/assets/Main_Majiang/Main_new/Main/PlayerHead_1.xml +++ b/wb_new_ui/assets/Main_Majiang/Main_new/Main/PlayerHead_1.xml @@ -2,7 +2,7 @@ - + @@ -37,7 +37,7 @@ - + diff --git a/wb_new_ui/assets/Main_Majiang/package.xml b/wb_new_ui/assets/Main_Majiang/package.xml index 7633d859..52989531 100644 --- a/wb_new_ui/assets/Main_Majiang/package.xml +++ b/wb_new_ui/assets/Main_Majiang/package.xml @@ -1404,7 +1404,7 @@ - + @@ -1422,6 +1422,7 @@ + \ No newline at end of file diff --git a/wb_unity_pro/Assets/ART/base/main_majiang/ui/Main_Majiang_atlas0_2.png b/wb_unity_pro/Assets/ART/base/main_majiang/ui/Main_Majiang_atlas0_2.png index 1f853a28..921ade40 100644 Binary files a/wb_unity_pro/Assets/ART/base/main_majiang/ui/Main_Majiang_atlas0_2.png and b/wb_unity_pro/Assets/ART/base/main_majiang/ui/Main_Majiang_atlas0_2.png differ diff --git a/wb_unity_pro/Assets/ART/base/main_majiang/ui/Main_Majiang_fui.bytes b/wb_unity_pro/Assets/ART/base/main_majiang/ui/Main_Majiang_fui.bytes index 63c2a51f..acc6d30e 100644 Binary files a/wb_unity_pro/Assets/ART/base/main_majiang/ui/Main_Majiang_fui.bytes and b/wb_unity_pro/Assets/ART/base/main_majiang/ui/Main_Majiang_fui.bytes differ