diff --git a/lua_probject/base_project/Game/Controller/GroupMgrController.lua b/lua_probject/base_project/Game/Controller/GroupMgrController.lua index db357690..515effa9 100644 --- a/lua_probject/base_project/Game/Controller/GroupMgrController.lua +++ b/lua_probject/base_project/Game/Controller/GroupMgrController.lua @@ -72,6 +72,10 @@ function M:AddEventListener(evt_name, func) self._dispatcher[evt_name] = func end +function M:RemoveEventListener(evt_name) + self._dispatcher[evt_name] = nil +end + ----------------------请求------------------------------------ function M:connect(host, groupId, callback) self.host = host diff --git a/lua_probject/base_project/Game/Controller/NewGroupController.lua b/lua_probject/base_project/Game/Controller/NewGroupController.lua index 2c9623f0..9699a7e3 100644 --- a/lua_probject/base_project/Game/Controller/NewGroupController.lua +++ b/lua_probject/base_project/Game/Controller/NewGroupController.lua @@ -1565,6 +1565,7 @@ function M:FG_UpdatePlay(group_id, game_id, config_data, name, hpData, hpOnOff, _data.pid = pid _data.gtype = gtype _data.deskId = deskId + _data.hp_times = hp_times _client:send(Protocol.WEB_FG_UPDATE_PLAY, _data, function(res) callback(res) end) diff --git a/lua_probject/base_project/Game/View/FGAssistView.lua b/lua_probject/base_project/Game/View/FGAssistView.lua index b612b24e..543c9957 100644 --- a/lua_probject/base_project/Game/View/FGAssistView.lua +++ b/lua_probject/base_project/Game/View/FGAssistView.lua @@ -47,6 +47,9 @@ function M:init(url) self._timer = 0 UpdateBeat:Add(self.OnUpdate, self) + + local mgr_ctr = ControllerManager.GetController(GroupMgrController) + mgr_ctr:AddEventListener(GroupMgrEvent.OnMemberState, handler(self, self.ReFalsh)) end function M:FillData() @@ -58,6 +61,31 @@ function M:FillData() -- end end +function M:ReFalsh(...) + + local arg = { ... } + local group = DataManager.groups:get(self.group_id) + + for _, player in pairs(arg[1].offlineUserId) do + local player = group.memberMap[player] + + if player then + player.online = 0 + end + end + + for _, player in pairs(arg[1].onlineUserId) do + local player = group.memberMap[player] + + if player then + player.online = 1 + end + end + + self._data_number = group.members + self.lst_player.numItems = #group.members +end + function M:PlayerRenderer(index, obj) local i = index + 1 obj:GetChild('tex_name').text = self._data_number[i].nick @@ -65,6 +93,8 @@ function M:PlayerRenderer(index, obj) btn_invite:GetController('online').selectedIndex = self._data_number[i].uid == DataManager.SelfUser.account_id and 0 or self._data_number[i].online obj:GetController('type').selectedIndex = self._data_number[i].online + local loader = obj:GetChild("btn_head"):GetChild("icon") + ImageLoad.Load(self._data_number[i].portrait, loader) btn_invite.onClick:Set(function() local mgr_ctr = ControllerManager.GetController(GroupMgrController) local room = DataManager.CurrenRoom @@ -219,6 +249,9 @@ function M:OnUpdate() end function M:Close() + local mgr_ctr = ControllerManager.GetController(GroupMgrController) + mgr_ctr:RemoveEventListener(GroupMgrEvent.OnMemberState) + BaseWindow.Close(self) if self.callback then self.callback() diff --git a/lua_probject/base_project/Game/View/Family/FamilyEventView.lua b/lua_probject/base_project/Game/View/Family/FamilyEventView.lua index 0e122973..299b3d53 100644 --- a/lua_probject/base_project/Game/View/Family/FamilyEventView.lua +++ b/lua_probject/base_project/Game/View/Family/FamilyEventView.lua @@ -25,6 +25,7 @@ function FamilyEventView.new(root) 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)) + --mgr_ctr:AddEventListener(GroupMgrEvent.OnMemberState, handler(self, self._evtOnMemberState)) return self end @@ -152,8 +153,25 @@ function M:_evtOnNewRecord(...) if view.class ~= "FamilyMainView" then return end - local arg = { ... } + local arg = { ... } view.com_FamilyChatRoom:OnNewChatRefalsh(arg[1]) end +function M:_evtOnMemberState(...) + local view = ViewManager.GetCurrenView() + if view.class ~= "FamilyMainView" then + return + end + local arg = { ... } + local group = DataManager.groups:get(view._group.id) + + for _, player in pairs(arg[1].offlineUserId) do + group.memberMap[player].online = 0 + end + + for _, player in pairs(arg[1].onlineUserId) do + group.memberMap[player].online = 0 + end +end + return M diff --git a/lua_probject/base_project/Game/View/MainView.lua b/lua_probject/base_project/Game/View/MainView.lua index ecba835e..c1cffcb4 100644 --- a/lua_probject/base_project/Game/View/MainView.lua +++ b/lua_probject/base_project/Game/View/MainView.lua @@ -5,6 +5,7 @@ local DismissRoomWindow = import('.DismissRoomWindow') local SettingView = import('.SettingView') local PlayerDistanceView = import('.PlayerDistanceView') local FGAssistView = import('.FGAssistView') +local MissileSender = import(".MissileSender") local function GetSeat(data, uId) for _, player in pairs(data.player_list) do @@ -1151,13 +1152,11 @@ function M:SetLanguage(language) end end -function M:Missile(seat, targetSeat, missile) +function M:Missile(seat, targetSeat, url, animUrl) local send = self._player_info[self:GetPos(seat)] local target = self._player_info[self:GetPos(targetSeat)] - local obj = UIPackage.CreateObjectFromURL("ui://Main_Majiang/Missile") - obj.xy = send.xy - obj:TweenMove(target.xy, 1.5) + MissileSender.Send(url, send._view, target._view, self._view, animUrl, 5, 1) end -- 获取消息使用的语言、序号 diff --git a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupGameSettingView_jaingxi.lua b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupGameSettingView_jaingxi.lua index 27c08a04..7f26998f 100644 --- a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupGameSettingView_jaingxi.lua +++ b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupGameSettingView_jaingxi.lua @@ -669,7 +669,9 @@ function M:FillFagData_jiangxi() gfiv:Show() end) --体力值倍数 - local tex_times = panel_play_set:GetChild("tex_times") + --local tex_times = panel_play_set:GetChild("tex_times") + local tex_times = self._view:GetChild("tex_times") + --[[ if game_id ~= 41 then tex_times.text = hpData and d2ad(hpData.times) or 1 local btn_times_input = panel_play_set:GetChild("btn_times_input") @@ -679,6 +681,7 @@ function M:FillFagData_jiangxi() else tex_times.text = 1 end + ]] local btn_sub = panel_play_set:GetChild("btn_sub") btn_sub.onClick:Set(function() diff --git a/lua_probject/extend_project/extend/majiang/jinxi/EXSettingView.lua b/lua_probject/extend_project/extend/majiang/jinxi/EXSettingView.lua index b9a5896f..662eec54 100644 --- a/lua_probject/extend_project/extend/majiang/jinxi/EXSettingView.lua +++ b/lua_probject/extend_project/extend/majiang/jinxi/EXSettingView.lua @@ -13,8 +13,10 @@ function EXSettingView:Show(room) if roomOwner == DataManager.SelfUser.account_id then self.cBtn.selectedIndex = 1 + self.btn_closeRoom_cStyle = 1 else self.cBtn.selectedIndex = 0 + self.btn_closeRoom_cStyle = 0 end BaseWindow.Show(self) @@ -37,6 +39,8 @@ function M:init(url) local slider_music = view:GetChild('slider_vedio_music') local btn_music = view:GetChild('btn_vedio_music') local btn_sound = view:GetChild('btn_vedio_sound') + local btn_closeRoom = view:GetChild("btn_closeRoom") + self.btn_closeRoom_cStyle = btn_closeRoom:GetController("cStyle") self.cBtn = self._view:GetController('cBtn') @@ -74,7 +78,7 @@ function M:init(url) end end) - self._view:GetChild("btn_closeRoom").onClick:Set(function() + btn_closeRoom.onClick:Set(function() local _gamectr = ControllerManager.GetController(GameController) _gamectr:LevelRoom(function(res) print("退出房间") diff --git a/wb_new_ui/assets/Common/package.xml b/wb_new_ui/assets/Common/package.xml index 7a3f0461..f80716d6 100644 --- a/wb_new_ui/assets/Common/package.xml +++ b/wb_new_ui/assets/Common/package.xml @@ -2093,10 +2093,10 @@ - - - - + + + + diff --git a/wb_new_ui/assets/Main_Majiang/Main_new/Main/Component/btn_invite.xml b/wb_new_ui/assets/Main_Majiang/Main_new/Main/Component/btn_invite.xml index 5fea1c85..f4158b05 100644 --- a/wb_new_ui/assets/Main_Majiang/Main_new/Main/Component/btn_invite.xml +++ b/wb_new_ui/assets/Main_Majiang/Main_new/Main/Component/btn_invite.xml @@ -1,10 +1,10 @@ - + -