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