25.4.1.5
parent
5d1e0caefe
commit
00e03acf94
|
|
@ -328,18 +328,19 @@ function M:UpdateFamilyRoom(fgCtr, id)
|
||||||
pt(roomList)
|
pt(roomList)
|
||||||
list_room.itemRenderer = function(index, obj)
|
list_room.itemRenderer = function(index, obj)
|
||||||
if index < #roomList then
|
if index < #roomList then
|
||||||
|
local newIndex = index + 1
|
||||||
-- local config = ExtendManager.GetExtendConfig(roomList[index + 1].pid)
|
-- local config = ExtendManager.GetExtendConfig(roomList[index + 1].pid)
|
||||||
-- local mode = config:GetGameInfo()
|
-- local mode = config:GetGameInfo()
|
||||||
-- local gamePlay = mode:LoadConfigToDetail("这是房间")
|
-- local gamePlay = mode:LoadConfigToDetail("这是房间")
|
||||||
-- obj:GetChild('Label_gameRule').title = gamePlay
|
-- obj:GetChild('Label_gameRule').title = gamePlay
|
||||||
obj:GetChild('game_type').text = string.format("房间-%s", roomList[index + 1].id)
|
obj:GetChild('game_type').text = string.format("房间-%s", roomList[newIndex].id)
|
||||||
obj:GetChild('btn_joinGame'):GetController('type').selectedIndex = 1
|
obj:GetChild('btn_joinGame'):GetController('type').selectedIndex = 1
|
||||||
obj:GetChild('btn_joinGame').onClick:Set(function()
|
obj:GetChild('btn_joinGame').onClick:Set(function()
|
||||||
ViewUtil.ShowModalWait(self._root_view, "匹配房间中", 'join_room')
|
ViewUtil.ShowModalWait(self._root_view, "匹配房间中", 'join_room')
|
||||||
local roomCtr = ControllerManager.GetController(RoomController)
|
local roomCtr = ControllerManager.GetController(RoomController)
|
||||||
roomCtr:PublicJoinRoom(
|
roomCtr:PublicJoinRoom(
|
||||||
Protocol.WEB_FG_JOIN_ROOM,
|
Protocol.WEB_FG_JOIN_ROOM,
|
||||||
roomList[index + 1].id,
|
roomList[newIndex].id,
|
||||||
false,
|
false,
|
||||||
function(response)
|
function(response)
|
||||||
ViewUtil.CloseModalWait('join_room')
|
ViewUtil.CloseModalWait('join_room')
|
||||||
|
|
@ -357,15 +358,16 @@ function M:UpdateFamilyRoom(fgCtr, id)
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
id,
|
id,
|
||||||
roomList[index + 1].pid
|
roomList[newIndex].pid
|
||||||
)
|
)
|
||||||
end)
|
end)
|
||||||
else
|
else
|
||||||
|
local newIndex = index - #roomList + 1
|
||||||
-- local config = ExtendManager.GetExtendConfig(playList[index - #roomList + 1].gameId)
|
-- local config = ExtendManager.GetExtendConfig(playList[index - #roomList + 1].gameId)
|
||||||
-- local mode = config:GetGameInfo()
|
-- local mode = config:GetGameInfo()
|
||||||
-- local gamePlay = mode:LoadConfigToDetail("随便甜点")
|
-- local gamePlay = mode:LoadConfigToDetail("随便甜点")
|
||||||
-- obj:GetChild('Label_gameRule').title = gamePlay
|
-- obj:GetChild('Label_gameRule').title = gamePlay
|
||||||
obj:GetChild('game_type').text = playList[index - #roomList + 1].name
|
obj:GetChild('game_type').text = playList[newIndex].name
|
||||||
obj:GetChild('btn_joinGame'):GetController('type').selectedIndex = 0
|
obj:GetChild('btn_joinGame'):GetController('type').selectedIndex = 0
|
||||||
obj:GetChild('btn_joinGame').onClick:Set(function()
|
obj:GetChild('btn_joinGame').onClick:Set(function()
|
||||||
ViewUtil.ShowModalWait(self._root_view, "匹配房间中", 'join_room')
|
ViewUtil.ShowModalWait(self._root_view, "匹配房间中", 'join_room')
|
||||||
|
|
@ -387,11 +389,11 @@ function M:UpdateFamilyRoom(fgCtr, id)
|
||||||
-- ViewManager.ChangeView(ViewManager.View_Lobby)
|
-- ViewManager.ChangeView(ViewManager.View_Lobby)
|
||||||
return
|
return
|
||||||
else
|
else
|
||||||
ViewManager.ChangeView(ViewManager.View_Main, playList[index + 1].gameId)
|
ViewManager.ChangeView(ViewManager.View_Main, playList[newIndex].gameId)
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
id,
|
id,
|
||||||
playList[index + 1].id
|
playList[newIndex].id
|
||||||
)
|
)
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
|
@ -512,17 +514,17 @@ function M:OnUpdate()
|
||||||
for i = 1, self._group.room_num do
|
for i = 1, self._group.room_num do
|
||||||
if self._group.rooms[i] and #self._group.rooms[i].plist == 0 then
|
if self._group.rooms[i] and #self._group.rooms[i].plist == 0 then
|
||||||
self._group.update_room = false
|
self._group.update_room = false
|
||||||
-- fgCtr:FG_RemoveRoom(
|
fgCtr:FG_RemoveRoom(
|
||||||
-- self._group.id,
|
self._group.id,
|
||||||
-- self._group.rooms[i].id,
|
self._group.rooms[i].id,
|
||||||
-- function(res)
|
function(res)
|
||||||
-- if res.ReturnCode ~= 0 then
|
if res.ReturnCode ~= 0 then
|
||||||
-- ViewUtil.ErrorTip(res.ReturnCode, string.format('删除房间-%s失败!', self._group.rooms[i].id))
|
ViewUtil.ErrorTip(res.ReturnCode, string.format('删除房间-%s失败!', self._group.rooms[i].id))
|
||||||
-- else
|
else
|
||||||
-- self._roomNum = #self._group.rooms
|
self._roomNum = #self._group.rooms
|
||||||
-- end
|
end
|
||||||
-- end
|
end
|
||||||
-- )
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue