完善创建邀请亲友圈,完善玩法创建删除,完善进入游戏
parent
86619f2e5e
commit
948bd04300
|
|
@ -1,6 +1,6 @@
|
|||
local FamilyInviteFamilyView = import('.Family.FamilyInviteFamilyView')
|
||||
local CreatePlayView = import('.Family.CreatePlayView')
|
||||
local GroupMngGameListView = import(".NewGroup.MngView/GroupMngGameListView")
|
||||
local GroupGameSettingView = import(".NewGroup.MngView/GroupGameSettingView")
|
||||
|
||||
--设置窗口对象
|
||||
|
||||
|
|
@ -402,12 +402,16 @@ function M:UpdateFamilyRoom(fgCtr, id)
|
|||
list_gamePlay.itemRenderer = function(index, obj)
|
||||
if index == 0 then
|
||||
obj:GetChild('num').text = string.format("%d/7", #playList)
|
||||
obj:GetChild('btn_addPlay').onClick:Add(function()
|
||||
local gl_view = GroupMngGameListView.new(id)
|
||||
gl_view:Show()
|
||||
gl_view:CreateCallBack(function()
|
||||
obj:GetChild('btn_addPlay').onClick:Set(function()
|
||||
local tem = GroupGameSettingView.new(self.blur_view, id, 0, nil, function(play)
|
||||
local group = DataManager.groups:get(id)
|
||||
group:addPlay(play)
|
||||
-- self:FillView()
|
||||
self:UpdateFamilyRoom(fgCtr, id)
|
||||
printlog("刷新玩法===>>>>")
|
||||
group.update_play = true
|
||||
end)
|
||||
tem:Show()
|
||||
end)
|
||||
return
|
||||
end
|
||||
|
|
@ -432,6 +436,8 @@ function M:ConnetFamily(index, groups, isCreate)
|
|||
|
||||
local list_family = self._view:GetChild('list_family')
|
||||
self._group = DataManager.groups:get(groups[index].id)
|
||||
print("===================================self._group")
|
||||
pt(self._group)
|
||||
self._roomNum = self._group.room_num
|
||||
|
||||
if isCreate then
|
||||
|
|
@ -440,7 +446,7 @@ function M:ConnetFamily(index, groups, isCreate)
|
|||
local child = UIPackage.CreateObjectFromURL('ui://Family/btn_familyName')
|
||||
child:GetChild('name').text = groups[i].name
|
||||
child.onClick:Add(function()
|
||||
self:ConnetFamily(j, groups, false)
|
||||
self:ConnetFamily(j, DataManager.groups.groupList, false)
|
||||
end)
|
||||
if i == index then
|
||||
child:GetController('button').selectedIndex = 1
|
||||
|
|
@ -452,17 +458,17 @@ function M:ConnetFamily(index, groups, isCreate)
|
|||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
|
||||
ViewUtil.ShowModalWait(self._root_view, "正在加载亲友圈权限中......")
|
||||
self:ChangeOther(tonumber(groups[index].lev) + 1)
|
||||
self:ChangeOther(tonumber(self._group.lev) + 1)
|
||||
allLoad = 1
|
||||
|
||||
ViewUtil.ShowModalWait(self._root_view, "正在加载成员列表中......")
|
||||
allLoad = allLoad +
|
||||
self:ChangeNumber(fgCtr, groups[index].id, 0, groups[index].total_member_num or groups[index].member_num, false,
|
||||
self:ChangeNumber(fgCtr, self._group.id, 0, self._group.total_member_num, false,
|
||||
1)
|
||||
|
||||
ViewUtil.ShowModalWait(self._root_view, "正在加载房间列表中......")
|
||||
|
||||
allLoad = allLoad + self:ConnetFamilyRoom(fgCtr, groups[index].id)
|
||||
allLoad = allLoad + self:ConnetFamilyRoom(fgCtr, self._group.id)
|
||||
UpdateBeat:Add(self.OnUpdate, self)
|
||||
end
|
||||
|
||||
|
|
@ -501,7 +507,7 @@ function M:JoinRoom(roomId)
|
|||
-- end)
|
||||
--先换成邀请玩家
|
||||
fgCtr:FG_AddMember(self._group.id, tonumber(roomId), function()
|
||||
self:ChangeNumber(fgCtr, self._group.id, 0, (self._group.total_member_num or self._group.member_num) + 1, false,
|
||||
self:ChangeNumber(fgCtr, self._group.id, 0, self._group.total_member_num1, false,
|
||||
1)
|
||||
end)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@ local GroupGameSettingView = {}
|
|||
local M = GroupGameSettingView
|
||||
|
||||
function GroupGameSettingView.new(blur_view, gid, pid, room_config, callback)
|
||||
UIPackage.AddPackage("base/newgroup/ui/NewGroup")
|
||||
|
||||
setmetatable(M, { __index = BaseWindow })
|
||||
local self = setmetatable({}, { __index = M })
|
||||
self.class = "GroupGameSettingView"
|
||||
|
|
@ -19,11 +21,11 @@ function GroupGameSettingView.new(blur_view, gid, pid , room_config, callback)
|
|||
self._new_hide = false
|
||||
self._queue = false
|
||||
self.group_id = gid
|
||||
self.play = DataManager.groups:get(gid):getPlay(pid)
|
||||
self.table_color = self.play and self.play.deskId or 0
|
||||
if room_config then
|
||||
self.room_config = json.decode(room_config)
|
||||
end
|
||||
-- self.play = DataManager.groups:get(gid):getPlay(pid)
|
||||
-- self.table_color = self.play and self.play.deskId or 0
|
||||
-- if room_config then
|
||||
-- self.room_config = json.decode(room_config)
|
||||
-- end
|
||||
self.rewards_data = {}
|
||||
self.callback = callback
|
||||
self._full = true
|
||||
|
|
@ -92,7 +94,6 @@ end
|
|||
local tuoguanTimeList = { 10, 30, 60, 120, 180, 240, 300 }
|
||||
-- 显示玩法体力值配置
|
||||
function M:FillFagData()
|
||||
|
||||
local mod = self.gl_view:GetModeData()
|
||||
local game_id = mod.data.game_data.game_id
|
||||
|
||||
|
|
@ -213,7 +214,6 @@ function M:FillFagData()
|
|||
value = value - 1
|
||||
tex_times.text = tostring(value)
|
||||
end
|
||||
|
||||
end)
|
||||
|
||||
local btn_add = panel_play_set:GetChild("btn_add")
|
||||
|
|
@ -241,7 +241,6 @@ function M:FillFagData()
|
|||
value = value - 1
|
||||
tex_times_room.text = tostring(value)
|
||||
end
|
||||
|
||||
end)
|
||||
|
||||
local btn_add_room = panel_play_set:GetChild("btn_add_room")
|
||||
|
|
@ -403,7 +402,8 @@ function M:FillFagData()
|
|||
-- tem.limitPump = tonumber(r_item:GetChild("cb_type").value)
|
||||
-- 抽水次数 固定抽水要发小数
|
||||
local cb_method = r_item:GetChild("cb_method")
|
||||
local proportion = string.gsub(string.gsub(r_item:GetChild("cb_proportion" .. cb_method.value).title, "抽", ""), "次", "")
|
||||
local proportion = string.gsub(
|
||||
string.gsub(r_item:GetChild("cb_proportion" .. cb_method.value).title, "抽", ""), "次", "")
|
||||
if cb_method.value == "1" then proportion = ad2d(proportion) end
|
||||
-- 抽水分数
|
||||
-- self.hpData.pumpProportion = tonumber(proportion)
|
||||
|
|
@ -415,7 +415,6 @@ function M:FillFagData()
|
|||
|
||||
local vsend = string.gsub(r_item:GetChild("cb_min_send").title, "分", "")
|
||||
tem.UpperLimitReward = ad2d(tonumber(vsend))
|
||||
|
||||
else
|
||||
local v = string.gsub(r_item:GetChild("cb_max").title, "分", "")
|
||||
-- self.hpData.UpperLimit = ad2d(tonumber(v))
|
||||
|
|
@ -464,7 +463,8 @@ function M:FillFagData()
|
|||
ViewUtil.ShowModalWait(self._root_view)
|
||||
if not self.play then
|
||||
-- 新增玩法
|
||||
fgCtr:FG_AddPlay(self.group_id, game_id, _data, name, self.hpData, hpOnOff, group.type, self.table_color, function(res)
|
||||
fgCtr:FG_AddPlay(self.group_id, game_id, _data, name, self.hpData, hpOnOff, group.type, self.table_color,
|
||||
function(res)
|
||||
if self._is_destroy then
|
||||
return
|
||||
end
|
||||
|
|
@ -504,7 +504,8 @@ function M:FillFagData()
|
|||
end)
|
||||
else
|
||||
-- 修改玩法
|
||||
fgCtr:FG_UpdatePlay(self.group_id,game_id,_data,name,self.hpData,hpOnOff,self.play.id, group.type, self.table_color, function(res)
|
||||
fgCtr:FG_UpdatePlay(self.group_id, game_id, _data, name, self.hpData, hpOnOff, self.play.id, group.type,
|
||||
self.table_color, function(res)
|
||||
if self._is_destroy then
|
||||
return
|
||||
end
|
||||
|
|
@ -625,7 +626,6 @@ function M:OnRenderItem(index, obj)
|
|||
end
|
||||
|
||||
obj:GetController("give_owner").onChanged:Add(function()
|
||||
|
||||
if obj:GetController("give_owner").selectedIndex == 0 then
|
||||
data.UpperLimitReward = 0
|
||||
self:UpdateRewards()
|
||||
|
|
@ -716,7 +716,6 @@ function M:OnRenderItem(index, obj)
|
|||
local btn_input2_send = obj:GetChild("btn_input2_send")
|
||||
btn_input2_send.onClick:Set(function()
|
||||
local gfiv = GroupNumberInputView.new(self._root_view, function(num)
|
||||
|
||||
data.UpperLimitReward = ad2d(num)
|
||||
self:UpdateRewards()
|
||||
end, 3)
|
||||
|
|
@ -811,7 +810,6 @@ function M:__input_num(tex, filed, itype)
|
|||
else
|
||||
self.hpData[filed] = ad2d(num)
|
||||
end
|
||||
|
||||
end, itype)
|
||||
gfiv:Show()
|
||||
end
|
||||
|
|
|
|||
|
|
@ -180,4 +180,8 @@ function M:LoadConfigData(data)
|
|||
end
|
||||
end
|
||||
|
||||
function M:LoadConfigToDetail(data)
|
||||
return data
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
|
|||
|
|
@ -133,7 +133,6 @@ function M:FillRoomData(s2croom)
|
|||
room.owner_id = owner
|
||||
room.game_status = 0
|
||||
if reload then
|
||||
|
||||
local reloadInfo = s2croom["reloadInfo"]
|
||||
|
||||
|
||||
|
|
@ -143,8 +142,6 @@ function M:FillRoomData(s2croom)
|
|||
room.curren_turn_seat = reloadInfo["active_seat"]
|
||||
local info_list = reloadInfo["info_list"]
|
||||
if playing == true then
|
||||
|
||||
|
||||
room.CurnrenState = StateType.Palying
|
||||
room.game_status = 1
|
||||
|
||||
|
|
@ -188,7 +185,6 @@ function M:FillRoomData(s2croom)
|
|||
|
||||
local last_outcard = info_list[i]["last_outcard"]
|
||||
if last_outcard ~= nil and last_outcard[1] ~= 0 then
|
||||
|
||||
local out_card_list = _ctr_game:ChangeCodeByFrom(last_outcard.card_list, true)
|
||||
local card_type, number, length, plan_three_count = _ctr_game:GetCardListInfo(out_card_list)
|
||||
p.out_card_list = _ctr_game:GetSortOutCardList(out_card_list, card_type, number, plan_three_count)
|
||||
|
|
@ -212,8 +208,6 @@ function M:FillRoomData(s2croom)
|
|||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
function M:FillPlayBackData(pd_data)
|
||||
local room = DataManager.CurrenRoom
|
||||
local _tableInfo = pd_data["info"]
|
||||
|
|
@ -261,4 +255,8 @@ function M:FillPlayBackData(pd_data)
|
|||
room.cmdList = pd_data["cmdList"]
|
||||
end
|
||||
|
||||
function M:LoadConfigToDetail(data)
|
||||
return data
|
||||
end
|
||||
|
||||
return M
|
||||
Loading…
Reference in New Issue