家族界面生命周期管理
parent
62477b97b5
commit
a1715131be
|
|
@ -74,7 +74,7 @@ function M:init(name)
|
||||||
|
|
||||||
self._eventmap[Protocol.GAME_EVT_EXIT_ROOM_DISMISS] = self.OnEventExitRoomDismiss
|
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] = 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_DISMISS_ROOM_FAIL] = self.OnEventDismissRoomFail
|
||||||
|
|
||||||
self._eventmap[Protocol.GAME_EVT_INTERACTION] = self.OnEventInteraction
|
self._eventmap[Protocol.GAME_EVT_INTERACTION] = self.OnEventInteraction
|
||||||
|
|
|
||||||
|
|
@ -591,7 +591,6 @@ function M:OnMemberOut(evt_data)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:OnMemberOnline(evt_data)
|
function M:OnMemberOnline(evt_data)
|
||||||
--[[
|
|
||||||
print("收到在线成员推送")
|
print("收到在线成员推送")
|
||||||
pt(evt_data)
|
pt(evt_data)
|
||||||
|
|
||||||
|
|
@ -611,7 +610,6 @@ function M:OnMemberOnline(evt_data)
|
||||||
|
|
||||||
DispatchEvent(self._dispatcher, GroupMgrEvent.OnMemberState, evt_data)
|
DispatchEvent(self._dispatcher, GroupMgrEvent.OnMemberState, evt_data)
|
||||||
Broadcast.Send(BroadcastEvent.OnMemberChange)
|
Broadcast.Send(BroadcastEvent.OnMemberChange)
|
||||||
]]
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:OnMemberGameState(evt_data)
|
function M:OnMemberGameState(evt_data)
|
||||||
|
|
|
||||||
|
|
@ -169,8 +169,10 @@ function M:PublicJoinRoom(cmd, roomid, tem, callback, group_id, pid)
|
||||||
-- 圈子信息,圈子id和玩法id
|
-- 圈子信息,圈子id和玩法id
|
||||||
room.group_id = json["groupId"]
|
room.group_id = json["groupId"]
|
||||||
-- 圈子禁止文字聊天,禁止语音聊天
|
-- 圈子禁止文字聊天,禁止语音聊天
|
||||||
room.ban_chat1 = json["ban_chat1"]
|
--room.ban_chat1 = json["ban_chat1"]
|
||||||
room.ban_chat2 = json["ban_chat2"]
|
--room.ban_chat2 = json["ban_chat2"]
|
||||||
|
--
|
||||||
|
|
||||||
-- 玩法id
|
-- 玩法id
|
||||||
room.play_id = json["pid"]
|
room.play_id = json["pid"]
|
||||||
-- 体力值开关
|
-- 体力值开关
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ function FamilyInviteFamilyView.new()
|
||||||
setmetatable(M, { __index = BaseView })
|
setmetatable(M, { __index = BaseView })
|
||||||
local self = setmetatable({}, { __index = M })
|
local self = setmetatable({}, { __index = M })
|
||||||
self.class = "com_numberList"
|
self.class = "com_numberList"
|
||||||
|
self._scale = true
|
||||||
BaseView.InitView(self, "ui://Family/com_numberList")
|
BaseView.InitView(self, "ui://Family/com_numberList")
|
||||||
self:initBtn()
|
self:initBtn()
|
||||||
return self
|
return self
|
||||||
|
|
|
||||||
|
|
@ -1135,6 +1135,8 @@ function M:Show()
|
||||||
Broadcast.AddListener(BroadcastEvent.OnOutFamily, self.Reflash, self)
|
Broadcast.AddListener(BroadcastEvent.OnOutFamily, self.Reflash, self)
|
||||||
|
|
||||||
BaseView.Show(self)
|
BaseView.Show(self)
|
||||||
|
|
||||||
|
self:Reflash()
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:Close()
|
function M:Close()
|
||||||
|
|
|
||||||
|
|
@ -157,6 +157,7 @@ function M:InitView(url, isHideIpAdds)
|
||||||
self:FillRoomConfig(roominfo_panel1, _room)
|
self:FillRoomConfig(roominfo_panel1, _room)
|
||||||
|
|
||||||
-- 显示玩家距离
|
-- 显示玩家距离
|
||||||
|
--[[
|
||||||
-- self.btn_distance = self._view:GetChild('btn_distance')
|
-- self.btn_distance = self._view:GetChild('btn_distance')
|
||||||
--self.btn_distance.displayObject.gameObject:SetActive(false)
|
--self.btn_distance.displayObject.gameObject:SetActive(false)
|
||||||
if self.btn_distance then
|
if self.btn_distance then
|
||||||
|
|
@ -173,6 +174,7 @@ function M:InitView(url, isHideIpAdds)
|
||||||
-- self.distance_view:Show()
|
-- self.distance_view:Show()
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
]]
|
||||||
|
|
||||||
local btn_rule = self._view:GetChild('btn_rule')
|
local btn_rule = self._view:GetChild('btn_rule')
|
||||||
if btn_rule ~= nil then
|
if btn_rule ~= nil then
|
||||||
|
|
@ -282,11 +284,22 @@ function M:InitView(url, isHideIpAdds)
|
||||||
if self.chat_view == nil then
|
if self.chat_view == nil then
|
||||||
self.chat_view = ChatView.new(self)
|
self.chat_view = ChatView.new(self)
|
||||||
end
|
end
|
||||||
|
--[[
|
||||||
if self._room.ban_chat1 then
|
if self._room.ban_chat1 then
|
||||||
if self.chat_view.HideInputField then
|
if self.chat_view.HideInputField then
|
||||||
self.chat_view:HideInputField()
|
self.chat_view:HideInputField()
|
||||||
end
|
end
|
||||||
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()
|
self.chat_view:Show()
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
@ -1018,9 +1031,9 @@ function M:OnPlayerEnter(...)
|
||||||
-- self.distance_view._view:GetController("state").selectedIndex = self._state.selectedIndex > 0 and
|
-- self.distance_view._view:GetController("state").selectedIndex = self._state.selectedIndex > 0 and
|
||||||
-- self._state.selectedIndex < 3 and 1 or 0
|
-- self._state.selectedIndex < 3 and 1 or 0
|
||||||
-- self.distance_view:Show()
|
-- self.distance_view:Show()
|
||||||
if self.btn_distance then
|
--if self.btn_distance then
|
||||||
self.btn_distance:GetController("state").selectedIndex = 1
|
-- self.btn_distance:GetController("state").selectedIndex = 1
|
||||||
end
|
--end
|
||||||
end
|
end
|
||||||
local info = self._player_info[self:GetPos(p.seat)]
|
local info = self._player_info[self:GetPos(p.seat)]
|
||||||
info:FillData(p)
|
info:FillData(p)
|
||||||
|
|
@ -1201,7 +1214,7 @@ function M:OnPlayerLeave(...)
|
||||||
local info = self._player_info[self:GetPos(p.seat)]
|
local info = self._player_info[self:GetPos(p.seat)]
|
||||||
info._view.visible = false
|
info._view.visible = false
|
||||||
if not self._gamectr:CheckGPS() then
|
if not self._gamectr:CheckGPS() then
|
||||||
self.btn_distance:GetController("state").selectedIndex = 0
|
--self.btn_distance:GetController("state").selectedIndex = 0
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -896,9 +896,9 @@ function M:FillFagData_jiangxi()
|
||||||
-- 功能
|
-- 功能
|
||||||
self.hpData.GongNeng = cGongneng.selectedIndex + 1
|
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
|
local hpType = mod.data.game_data.hpType
|
||||||
|
|
|
||||||
|
|
@ -117,7 +117,7 @@
|
||||||
<item/>
|
<item/>
|
||||||
<item/>
|
<item/>
|
||||||
</list>
|
</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"/>
|
<relation target="" sidePair="left-left,rightext-right,bottomext-bottom"/>
|
||||||
<item/>
|
<item/>
|
||||||
<item/>
|
<item/>
|
||||||
|
|
|
||||||
Binary file not shown.
Loading…
Reference in New Issue