修改对面碰吃牌型异常
parent
b5fb6912da
commit
1679c5edc6
|
|
@ -92,28 +92,14 @@ function M:init(url)
|
|||
end)
|
||||
view:GetChild('btn_create').onClick:Add(function()
|
||||
fgCtr:FG_GroupList(function(res)
|
||||
local groups = res.Data.groups
|
||||
if #groups > 0 then
|
||||
for i = 1, #groups do
|
||||
if groups[i].name == input_name.text then
|
||||
fgCtr:FG_RemoveGroup(groups[i].id, function(res)
|
||||
fgCtr:FG_CreateGroup(input_name.text, 1, 2, function(res)
|
||||
if res.ReturnCode == 0 then
|
||||
self.familyType.selectedIndex = 1
|
||||
self:ConnetFamily(1, DataManager.groups.groupList, true)
|
||||
end
|
||||
end)
|
||||
end)
|
||||
end
|
||||
end
|
||||
else
|
||||
fgCtr:FG_CreateGroup(input_name.text, 1, 2, function(res)
|
||||
if res.ReturnCode == 0 then
|
||||
self.familyType.selectedIndex = 1
|
||||
self:ConnetFamily(1, DataManager.groups.groupList, true)
|
||||
ViewUtil.ErrorTip(res.ReturnCode, '创建大联盟失败!')
|
||||
end
|
||||
end)
|
||||
end
|
||||
end)
|
||||
end)
|
||||
end
|
||||
|
|
@ -422,24 +408,21 @@ function M:ConnetFamily(index, groups, isCreate)
|
|||
ViewUtil:CloseModalWait()
|
||||
|
||||
local list_family = self._view:GetChild('list_family')
|
||||
list_family:SetVirtual()
|
||||
self._group = DataManager.groups:get(groups[index].id)
|
||||
print("===================================self._group")
|
||||
pt(self._group)
|
||||
self._roomNum = self._group.room_num
|
||||
|
||||
if isCreate then
|
||||
for i = 1, #groups do
|
||||
local j = i
|
||||
local child = UIPackage.CreateObjectFromURL('ui://Family/btn_familyName')
|
||||
child:GetChild('name').text = groups[i].name
|
||||
child.onClick:Add(function()
|
||||
list_family.itemRenderer = function(i, obj)
|
||||
local j = i + 1
|
||||
obj:GetChild('name').text = groups[j].name
|
||||
obj.onClick:Add(function()
|
||||
self:ConnetFamily(j, DataManager.groups.groupList, false)
|
||||
end)
|
||||
if i == index then
|
||||
child:GetController('button').selectedIndex = 1
|
||||
end
|
||||
list_family:AddChild(child)
|
||||
end
|
||||
list_family.numItems = #groups
|
||||
end
|
||||
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
|
|
|
|||
|
|
@ -147,7 +147,7 @@ function ViewUtil.CardPos(obj, area, oder, index, offset, isAdd, padding)
|
|||
if oder == AreaOderType.left_right then
|
||||
obj.x = index * (obj.width + padding) + offset
|
||||
elseif oder == AreaOderType.up_down then
|
||||
obj.y = index * (obj.height + padding) + offset
|
||||
obj.y = index * (obj.height - padding) + offset
|
||||
elseif oder == AreaOderType.right_left then
|
||||
obj.x = (area.width - obj.width) - index * (obj.width + padding) - offset
|
||||
elseif oder == AreaOderType.down_up then
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue