家族界面生命周期管理

master
1076390229 2025-08-06 18:34:58 +08:00
parent 62477b97b5
commit a1715131be
9 changed files with 28 additions and 12 deletions

View File

@ -74,7 +74,7 @@ function M:init(name)
self._eventmap[Protocol.GAME_EVT_EXIT_ROOM_DISMISS] = self.OnEventExitRoomDismiss
self._eventmap[Protocol.GAME_EVT_DISMISS_ROOM] = self.OnEventDismissRoom
self._eventmap[Protocol.GAME_EVT_DISMISS_ROOM_VOTE] = self.OnEventDismissRoomVote
--self._eventmap[Protocol.GAME_EVT_DISMISS_ROOM_VOTE] = self.OnEventDismissRoomVote
self._eventmap[Protocol.GAME_EVT_DISMISS_ROOM_FAIL] = self.OnEventDismissRoomFail
self._eventmap[Protocol.GAME_EVT_INTERACTION] = self.OnEventInteraction

View File

@ -591,7 +591,6 @@ function M:OnMemberOut(evt_data)
end
function M:OnMemberOnline(evt_data)
--[[
print("收到在线成员推送")
pt(evt_data)
@ -611,7 +610,6 @@ function M:OnMemberOnline(evt_data)
DispatchEvent(self._dispatcher, GroupMgrEvent.OnMemberState, evt_data)
Broadcast.Send(BroadcastEvent.OnMemberChange)
]]
end
function M:OnMemberGameState(evt_data)

View File

@ -169,8 +169,10 @@ function M:PublicJoinRoom(cmd, roomid, tem, callback, group_id, pid)
-- 圈子信息圈子id和玩法id
room.group_id = json["groupId"]
-- 圈子禁止文字聊天,禁止语音聊天
room.ban_chat1 = json["ban_chat1"]
room.ban_chat2 = json["ban_chat2"]
--room.ban_chat1 = json["ban_chat1"]
--room.ban_chat2 = json["ban_chat2"]
--
-- 玩法id
room.play_id = json["pid"]
-- 体力值开关

View File

@ -8,6 +8,7 @@ function FamilyInviteFamilyView.new()
setmetatable(M, { __index = BaseView })
local self = setmetatable({}, { __index = M })
self.class = "com_numberList"
self._scale = true
BaseView.InitView(self, "ui://Family/com_numberList")
self:initBtn()
return self

View File

@ -1135,6 +1135,8 @@ function M:Show()
Broadcast.AddListener(BroadcastEvent.OnOutFamily, self.Reflash, self)
BaseView.Show(self)
self:Reflash()
end
function M:Close()

View File

@ -157,6 +157,7 @@ function M:InitView(url, isHideIpAdds)
self:FillRoomConfig(roominfo_panel1, _room)
-- 显示玩家距离
--[[
-- self.btn_distance = self._view:GetChild('btn_distance')
--self.btn_distance.displayObject.gameObject:SetActive(false)
if self.btn_distance then
@ -173,6 +174,7 @@ function M:InitView(url, isHideIpAdds)
-- self.distance_view:Show()
end)
end
]]
local btn_rule = self._view:GetChild('btn_rule')
if btn_rule ~= nil then
@ -282,11 +284,22 @@ function M:InitView(url, isHideIpAdds)
if self.chat_view == nil then
self.chat_view = ChatView.new(self)
end
--[[
if self._room.ban_chat1 then
if self.chat_view.HideInputField then
self.chat_view:HideInputField()
end
end
]]
local group = DataManager.groups:get(self._room.group_id)
local play = group:getPlay(self._room.play_id)
local hpData = json.decode(play.hpData)
if hpData.BanChat and hpData.BanChat == 1 then
ViewUtil.ShowTips("本房间禁止快捷聊天")
return
end
self.chat_view:Show()
end)
end
@ -1018,9 +1031,9 @@ function M:OnPlayerEnter(...)
-- self.distance_view._view:GetController("state").selectedIndex = self._state.selectedIndex > 0 and
-- self._state.selectedIndex < 3 and 1 or 0
-- self.distance_view:Show()
if self.btn_distance then
self.btn_distance:GetController("state").selectedIndex = 1
end
--if self.btn_distance then
-- self.btn_distance:GetController("state").selectedIndex = 1
--end
end
local info = self._player_info[self:GetPos(p.seat)]
info:FillData(p)
@ -1201,7 +1214,7 @@ function M:OnPlayerLeave(...)
local info = self._player_info[self:GetPos(p.seat)]
info._view.visible = false
if not self._gamectr:CheckGPS() then
self.btn_distance:GetController("state").selectedIndex = 0
--self.btn_distance:GetController("state").selectedIndex = 0
end
end

View File

@ -896,9 +896,9 @@ function M:FillFagData_jiangxi()
-- 功能
self.hpData.GongNeng = cGongneng.selectedIndex + 1
-- 开启聊天
self.hpData.canChat = cChat.selectedIndex
self.hpData.BanChat = cChat.selectedIndex
-- 开启表情互动
self.hpData.canMissile = cMisslie.selectedIndex
self.hpData.BanMissile = cMisslie.selectedIndex
local hpType = mod.data.game_data.hpType

View File

@ -117,7 +117,7 @@
<item/>
<item/>
</list>
<list id="n28_in3i" name="list_room" xy="854,377" size="1636,738" group="n34_86ct" overflow="scroll" lineGap="12" defaultItem="ui://htcn7v3rin3i7cuh" autoItemSize="false" autoClearItems="true">
<list id="n28_in3i" name="list_room" xy="854,377" size="1636,738" group="n34_86ct" overflow="scroll" lineGap="12" defaultItem="ui://htcn7v3rin3i7cuh" autoClearItems="true">
<relation target="" sidePair="left-left,rightext-right,bottomext-bottom"/>
<item/>
<item/>