完善创建邀请亲友圈,完善玩法创建删除,完善进入游戏
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
|
||||||
|
|
|
||||||
|
|
@ -6,9 +6,11 @@ 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)
|
||||||
setmetatable(M, {__index = BaseWindow})
|
UIPackage.AddPackage("base/newgroup/ui/NewGroup")
|
||||||
local self = setmetatable({}, {__index = M})
|
|
||||||
|
setmetatable(M, { __index = BaseWindow })
|
||||||
|
local self = setmetatable({}, { __index = M })
|
||||||
self.class = "GroupGameSettingView"
|
self.class = "GroupGameSettingView"
|
||||||
self._animation = false
|
self._animation = false
|
||||||
self._full = true
|
self._full = true
|
||||||
|
|
@ -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
|
||||||
|
|
@ -32,7 +34,7 @@ function GroupGameSettingView.new(blur_view, gid, pid , room_config, callback)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:init(url)
|
function M:init(url)
|
||||||
BaseWindow.init(self,url)
|
BaseWindow.init(self, url)
|
||||||
self.hpData = {}
|
self.hpData = {}
|
||||||
|
|
||||||
self:FillGameData()
|
self:FillGameData()
|
||||||
|
|
@ -65,7 +67,7 @@ end
|
||||||
function M:FillGameData()
|
function M:FillGameData()
|
||||||
local index = 1
|
local index = 1
|
||||||
-- 显示所有游戏
|
-- 显示所有游戏
|
||||||
local games = DataManager.SelfUser.games
|
local games = DataManager.SelfUser.games
|
||||||
local lst_game = self._view:GetChild("lst_game")
|
local lst_game = self._view:GetChild("lst_game")
|
||||||
-- local n65 = lst_game:GetChild("n65")
|
-- local n65 = lst_game:GetChild("n65")
|
||||||
printlog("jefe all games")
|
printlog("jefe all games")
|
||||||
|
|
@ -77,7 +79,7 @@ function M:FillGameData()
|
||||||
index = i
|
index = i
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
self.gl_view = GameListView.new(lst_game,index,self.room_config)
|
self.gl_view = GameListView.new(lst_game, index, self.room_config)
|
||||||
local btn_close = lst_game:GetChild("btn_close")
|
local btn_close = lst_game:GetChild("btn_close")
|
||||||
btn_close.onClick:Set(function()
|
btn_close.onClick:Set(function()
|
||||||
self:Destroy()
|
self:Destroy()
|
||||||
|
|
@ -87,27 +89,26 @@ function M:FillGameData()
|
||||||
local tex_name = self._view:GetChild("tex_name")
|
local tex_name = self._view:GetChild("tex_name")
|
||||||
tex_name.text = self.play.name
|
tex_name.text = self.play.name
|
||||||
end
|
end
|
||||||
end
|
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
|
||||||
|
|
||||||
local panel_play_set = self._view:GetChild("panel_play_set")
|
local panel_play_set = self._view:GetChild("panel_play_set")
|
||||||
local ctr_show_nonnegative = panel_play_set:GetController("show_nonnegative") --玩法不可负分开关
|
local ctr_show_nonnegative = panel_play_set:GetController("show_nonnegative") --玩法不可负分开关
|
||||||
local btn_nonnegative = panel_play_set:GetChild("btn_nonnegative") --不可负分开关
|
local btn_nonnegative = panel_play_set:GetChild("btn_nonnegative") --不可负分开关
|
||||||
local btn_no_upper = panel_play_set:GetChild("btn_no_upper") --没有上限
|
local btn_no_upper = panel_play_set:GetChild("btn_no_upper") --没有上限
|
||||||
local btn_tuoguan = panel_play_set:GetChild("btn_tuoguan") --托管开关
|
local btn_tuoguan = panel_play_set:GetChild("btn_tuoguan") --托管开关
|
||||||
btn_tuoguan.selected = true
|
btn_tuoguan.selected = true
|
||||||
|
|
||||||
local btn_BanDismiss = panel_play_set:GetChild("btn_BanDismiss")
|
local btn_BanDismiss = panel_play_set:GetChild("btn_BanDismiss")
|
||||||
local cb_tuoguan_time = panel_play_set:GetChild("comb_offline") --托管时间
|
local cb_tuoguan_time = panel_play_set:GetChild("comb_offline") --托管时间
|
||||||
local cb_tuoguan_type = panel_play_set:GetChild("comb_result") --托管结算类型
|
local cb_tuoguan_type = panel_play_set:GetChild("comb_result") --托管结算类型
|
||||||
local btn_hidden = panel_play_set:GetChild("btn_hidden") --防作弊开关
|
local btn_hidden = panel_play_set:GetChild("btn_hidden") --防作弊开关
|
||||||
local btn_vip = panel_play_set:GetChild("btn_vip") --vip房间开关
|
local btn_vip = panel_play_set:GetChild("btn_vip") --vip房间开关
|
||||||
--根据hpType显示
|
--根据hpType显示
|
||||||
local game_data = mod.data.game_data
|
local game_data = mod.data.game_data
|
||||||
panel_play_set:GetController("game_type").selectedIndex = game_data and game_data.hpType or 0
|
panel_play_set:GetController("game_type").selectedIndex = game_data and game_data.hpType or 0
|
||||||
|
|
@ -117,7 +118,7 @@ function M:FillFagData()
|
||||||
if group.type == 2 then
|
if group.type == 2 then
|
||||||
ctr_switch.selectedIndex = 1
|
ctr_switch.selectedIndex = 1
|
||||||
panel_play_set:GetController("type").selectedIndex = 1
|
panel_play_set:GetController("type").selectedIndex = 1
|
||||||
end
|
end
|
||||||
local hpData
|
local hpData
|
||||||
|
|
||||||
if self.play then
|
if self.play then
|
||||||
|
|
@ -127,21 +128,21 @@ function M:FillFagData()
|
||||||
end
|
end
|
||||||
local config = json.decode(self.play.config)
|
local config = json.decode(self.play.config)
|
||||||
ctr_switch.selectedIndex = self.play.hpOnOff
|
ctr_switch.selectedIndex = self.play.hpOnOff
|
||||||
|
|
||||||
btn_BanDismiss.selected = (config.isBanDismiss and config.isBanDismiss ~= 0) and true or false
|
btn_BanDismiss.selected = (config.isBanDismiss and config.isBanDismiss ~= 0) and true or false
|
||||||
btn_tuoguan.selected = (config.tuoguan and config.tuoguan ~= 0) and true or false
|
btn_tuoguan.selected = (config.tuoguan and config.tuoguan ~= 0) and true or false
|
||||||
if btn_tuoguan.selected then
|
if btn_tuoguan.selected then
|
||||||
cb_tuoguan_time.value = config.tuoguan_active_timeIndex or 1
|
cb_tuoguan_time.value = config.tuoguan_active_timeIndex or 1
|
||||||
cb_tuoguan_type.value = config.tuoguan_result_type
|
cb_tuoguan_type.value = config.tuoguan_result_type
|
||||||
end
|
end
|
||||||
|
|
||||||
if btn_hidden then
|
if btn_hidden then
|
||||||
btn_hidden.selected = (config.isHidden and config.isHidden ~= 0) and true or false
|
btn_hidden.selected = (config.isHidden and config.isHidden ~= 0) and true or false
|
||||||
end
|
end
|
||||||
if btn_vip then
|
if btn_vip then
|
||||||
btn_vip.selected = (config.isvip and config.isvip ~= 0) and true or false
|
btn_vip.selected = (config.isvip and config.isvip ~= 0) and true or false
|
||||||
end
|
end
|
||||||
|
|
||||||
btn_nonnegative.selected = config.isNonnegative and config.isNonnegative == 1
|
btn_nonnegative.selected = config.isNonnegative and config.isNonnegative == 1
|
||||||
btn_no_upper.selected = config.hp_no_limit and config.hp_no_limit == 1
|
btn_no_upper.selected = config.hp_no_limit and config.hp_no_limit == 1
|
||||||
end
|
end
|
||||||
|
|
@ -151,7 +152,7 @@ function M:FillFagData()
|
||||||
btn_nonnegative.selected = false
|
btn_nonnegative.selected = false
|
||||||
btn_no_upper.selected = false
|
btn_no_upper.selected = false
|
||||||
else
|
else
|
||||||
btn_nonnegative.selected = true
|
btn_nonnegative.selected = true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -161,23 +162,23 @@ function M:FillFagData()
|
||||||
local tex_join_limit = panel_play_set:GetChild("tex_join_limit")
|
local tex_join_limit = panel_play_set:GetChild("tex_join_limit")
|
||||||
tex_join_limit.text = hpData and d2ad(hpData.limitInRoom) or 0
|
tex_join_limit.text = hpData and d2ad(hpData.limitInRoom) or 0
|
||||||
btn_join_limit.onClick:Set(function()
|
btn_join_limit.onClick:Set(function()
|
||||||
self:__input_num(tex_join_limit,"limitInRoom")
|
self:__input_num(tex_join_limit, "limitInRoom")
|
||||||
end)
|
end)
|
||||||
--机器人
|
--机器人
|
||||||
local btn_robot_room = panel_fag:GetChild("robot_room")
|
local btn_robot_room = panel_fag:GetChild("robot_room")
|
||||||
local tex_robot_room = panel_fag:GetChild("tex_robot_room")
|
local tex_robot_room = panel_fag:GetChild("tex_robot_room")
|
||||||
tex_robot_room.text = hpData and (hpData.robot_room and (hpData.robot_room) or 0) or 0
|
tex_robot_room.text = hpData and (hpData.robot_room and (hpData.robot_room) or 0) or 0
|
||||||
btn_robot_room.onClick:Set(function()
|
btn_robot_room.onClick:Set(function()
|
||||||
self:__input_num(tex_robot_room,"robot_room")
|
self:__input_num(tex_robot_room, "robot_room")
|
||||||
end)
|
end)
|
||||||
|
|
||||||
--抢庄限制
|
--抢庄限制
|
||||||
-- local btn_bank_limit = panel_play_set:GetChild("btn_bank_limit")
|
-- local btn_bank_limit = panel_play_set:GetChild("btn_bank_limit")
|
||||||
--local tex_bank_limit = panel_play_set:GetChild("tex_bank_limit")
|
--local tex_bank_limit = panel_play_set:GetChild("tex_bank_limit")
|
||||||
-- tex_bank_limit.text = hpData and hpData.limitloot and d2ad(hpData.limitloot) or 0
|
-- tex_bank_limit.text = hpData and hpData.limitloot and d2ad(hpData.limitloot) or 0
|
||||||
-- btn_bank_limit.onClick:Set(function()
|
-- btn_bank_limit.onClick:Set(function()
|
||||||
-- self:__input_num(tex_bank_limit,"limitloot")
|
-- self:__input_num(tex_bank_limit,"limitloot")
|
||||||
-- end)
|
-- end)
|
||||||
|
|
||||||
-- 退出限制
|
-- 退出限制
|
||||||
local btn_exit_limit = panel_play_set:GetChild("btn_exit_limit")
|
local btn_exit_limit = panel_play_set:GetChild("btn_exit_limit")
|
||||||
|
|
@ -185,10 +186,10 @@ function M:FillFagData()
|
||||||
tex_exit_limit.text = hpData and hpData.limitPlay and d2ad(hpData.limitPlay) or 1
|
tex_exit_limit.text = hpData and hpData.limitPlay and d2ad(hpData.limitPlay) or 1
|
||||||
btn_exit_limit.onClick:Set(function()
|
btn_exit_limit.onClick:Set(function()
|
||||||
-- self:__input_num(tex_exit_limit, "limitPlay")
|
-- self:__input_num(tex_exit_limit, "limitPlay")
|
||||||
local gfiv = GroupNumberInputView.new(self._root_view,function(num)
|
local gfiv = GroupNumberInputView.new(self._root_view, function(num)
|
||||||
if num == 0 then
|
if num == 0 then
|
||||||
ViewUtil.ErrorMsg(nil,-9,"不能输入0")
|
ViewUtil.ErrorMsg(nil, -9, "不能输入0")
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
tex_exit_limit.text = num
|
tex_exit_limit.text = num
|
||||||
end)
|
end)
|
||||||
|
|
@ -208,54 +209,52 @@ function M:FillFagData()
|
||||||
|
|
||||||
local btn_sub = panel_play_set:GetChild("btn_sub")
|
local btn_sub = panel_play_set:GetChild("btn_sub")
|
||||||
btn_sub.onClick:Set(function()
|
btn_sub.onClick:Set(function()
|
||||||
local value = tonumber(tex_times.text)
|
local value = tonumber(tex_times.text)
|
||||||
if value > 1 then
|
if value > 1 then
|
||||||
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")
|
||||||
btn_add.onClick:Set(function()
|
btn_add.onClick:Set(function()
|
||||||
local value = tonumber(tex_times.text)
|
local value = tonumber(tex_times.text)
|
||||||
value = value + 1
|
value = value + 1
|
||||||
tex_times.text = tostring(value)
|
tex_times.text = tostring(value)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|
||||||
--显示创建空房间
|
--显示创建空房间
|
||||||
local tex_times_room = panel_play_set:GetChild("tex_times_room")
|
local tex_times_room = panel_play_set:GetChild("tex_times_room")
|
||||||
|
|
||||||
|
if hpData and hpData.tex_times_room then
|
||||||
|
tex_times_room.text = hpData.tex_times_room / 1000
|
||||||
|
else
|
||||||
|
tex_times_room.text = 1
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
if hpData and hpData.tex_times_room then
|
|
||||||
tex_times_room.text = hpData.tex_times_room/1000
|
|
||||||
else
|
|
||||||
tex_times_room.text = 1
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
local btn_sub_room = panel_play_set:GetChild("btn_sub_room")
|
local btn_sub_room = panel_play_set:GetChild("btn_sub_room")
|
||||||
btn_sub_room.onClick:Set(function()
|
btn_sub_room.onClick:Set(function()
|
||||||
local value = tonumber(tex_times_room.text)
|
local value = tonumber(tex_times_room.text)
|
||||||
if value > 1 then
|
if value > 1 then
|
||||||
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")
|
||||||
btn_add_room.onClick:Set(function()
|
btn_add_room.onClick:Set(function()
|
||||||
local value = tonumber(tex_times_room.text)
|
local value = tonumber(tex_times_room.text)
|
||||||
value = value + 1
|
value = value + 1
|
||||||
tex_times_room.text = tostring(value)
|
tex_times_room.text = tostring(value)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|
||||||
-- 显示抽水列表
|
-- 显示抽水列表
|
||||||
if hpData and hpData.rewards_list then
|
if hpData and hpData.rewards_list then
|
||||||
self.rewards_data = hpData.rewards_list
|
self.rewards_data = hpData.rewards_list
|
||||||
else
|
else
|
||||||
local tem = {}
|
local tem = {}
|
||||||
-- tem.limitPump = hpData and hpData.limitPump or 0
|
-- tem.limitPump = hpData and hpData.limitPump or 0
|
||||||
-- tem.type = hpData and hpData.type or 1
|
-- tem.type = hpData and hpData.type or 1
|
||||||
|
|
@ -302,18 +301,18 @@ function M:FillFagData()
|
||||||
local ctr_rewards_value2 = panel_fag:GetController("rewards_value2")
|
local ctr_rewards_value2 = panel_fag:GetController("rewards_value2")
|
||||||
-- 奖励类型:0百分比 1人头制 2全民推广
|
-- 奖励类型:0百分比 1人头制 2全民推广
|
||||||
if self.play then
|
if self.play then
|
||||||
-- ctr_rewards1.selectedIndex = self.play.xipai_rewardType - 1
|
-- ctr_rewards1.selectedIndex = self.play.xipai_rewardType - 1
|
||||||
ctr_rewards_value2.selectedIndex = (self.play.anchou_rewardValueType or 1) - 1
|
ctr_rewards_value2.selectedIndex = (self.play.anchou_rewardValueType or 1) - 1
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
local base_pump = 0
|
local base_pump = 0
|
||||||
if hpData ~= nil and hpData.basePump ~= nil then
|
if hpData ~= nil and hpData.basePump ~= nil then
|
||||||
base_pump = d2ad(hpData.basePump)
|
base_pump = d2ad(hpData.basePump)
|
||||||
end
|
end
|
||||||
local tex_base_pump = panel_fag:GetChild("tex_base_pump")
|
local tex_base_pump = panel_fag:GetChild("tex_base_pump")
|
||||||
tex_base_pump.text = ""..base_pump
|
tex_base_pump.text = "" .. base_pump
|
||||||
|
|
||||||
local btn_base_pump = panel_fag:GetChild("btn_base_pump")
|
local btn_base_pump = panel_fag:GetChild("btn_base_pump")
|
||||||
btn_base_pump.onClick:Set(function()
|
btn_base_pump.onClick:Set(function()
|
||||||
|
|
@ -332,63 +331,63 @@ function M:FillFagData()
|
||||||
|
|
||||||
-- 点击确定按钮 更新玩法数据
|
-- 点击确定按钮 更新玩法数据
|
||||||
local btn_ok = self._view:GetChild("btn_ok")
|
local btn_ok = self._view:GetChild("btn_ok")
|
||||||
btn_ok.onClick:Set(function()
|
btn_ok.onClick:Set(function()
|
||||||
local _data = mod.data:SelectedConfigData()
|
local _data = mod.data:SelectedConfigData()
|
||||||
_data.game_id = game_id
|
_data.game_id = game_id
|
||||||
_data.isNonnegative = btn_nonnegative.selected and 1 or 0
|
_data.isNonnegative = btn_nonnegative.selected and 1 or 0
|
||||||
_data.hp_no_limit = (btn_nonnegative.selected and btn_no_upper.selected) and 1 or 0
|
_data.hp_no_limit = (btn_nonnegative.selected and btn_no_upper.selected) and 1 or 0
|
||||||
_data.tuoguan = btn_tuoguan.selected
|
_data.tuoguan = btn_tuoguan.selected
|
||||||
|
|
||||||
_data.tuoguan_active_time = _data.tuoguan and tuoguanTimeList[(tonumber(cb_tuoguan_time.value))] or 0
|
_data.tuoguan_active_time = _data.tuoguan and tuoguanTimeList[(tonumber(cb_tuoguan_time.value))] or 0
|
||||||
_data.tuoguan_active_timeIndex=tonumber(cb_tuoguan_time.value)
|
_data.tuoguan_active_timeIndex = tonumber(cb_tuoguan_time.value)
|
||||||
_data.tuoguan_result_type = _data.tuoguan and tonumber(cb_tuoguan_type.value) or 0
|
_data.tuoguan_result_type = _data.tuoguan and tonumber(cb_tuoguan_type.value) or 0
|
||||||
if btn_BanDismiss.selected then
|
if btn_BanDismiss.selected then
|
||||||
_data.isBanDismiss = 1
|
_data.isBanDismiss = 1
|
||||||
end
|
end
|
||||||
|
|
||||||
if btn_hidden then
|
if btn_hidden then
|
||||||
_data.isHidden = btn_hidden.selected and 1 or 0
|
_data.isHidden = btn_hidden.selected and 1 or 0
|
||||||
else
|
else
|
||||||
_data.isHidden=0
|
_data.isHidden = 0
|
||||||
end
|
end
|
||||||
|
|
||||||
if btn_vip then
|
if btn_vip then
|
||||||
_data.isvip = btn_vip.selected and 1 or 0
|
_data.isvip = btn_vip.selected and 1 or 0
|
||||||
else
|
else
|
||||||
_data.isvip=0
|
_data.isvip = 0
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
local hpType = mod.data.game_data.hpType
|
local hpType = mod.data.game_data.hpType
|
||||||
self.hpData.limitInRoom = ad2d(tonumber(panel_play_set:GetChild("tex_join_limit").text))
|
self.hpData.limitInRoom = ad2d(tonumber(panel_play_set:GetChild("tex_join_limit").text))
|
||||||
self.hpData.limitPlay = ad2d(tonumber(panel_play_set:GetChild("tex_exit_limit").text))
|
self.hpData.limitPlay = ad2d(tonumber(panel_play_set:GetChild("tex_exit_limit").text))
|
||||||
self.hpData.limitloot = 0-- ad2d(tonumber(panel_play_set:GetChild("tex_bank_limit").text))
|
self.hpData.limitloot = 0 -- ad2d(tonumber(panel_play_set:GetChild("tex_bank_limit").text))
|
||||||
self.hpData.robot_room = (tonumber(panel_fag:GetChild("tex_robot_room").text))
|
self.hpData.robot_room = (tonumber(panel_fag:GetChild("tex_robot_room").text))
|
||||||
self.hpData.type = self._type
|
self.hpData.type = self._type
|
||||||
self.hpData.limitPump = self._limitPump
|
self.hpData.limitPump = self._limitPump
|
||||||
local hpOnOff = ctr_switch.selectedIndex
|
local hpOnOff = ctr_switch.selectedIndex
|
||||||
if game_id == 41 then
|
if game_id == 41 then
|
||||||
if self.hpData.limitloot < ad2d(_data.up_bank) then
|
if self.hpData.limitloot < ad2d(_data.up_bank) then
|
||||||
ViewUtil.ErrorMsg(self._root_view,-9,"抢庄限制必须大于等于" .. _data.up_bank)
|
ViewUtil.ErrorMsg(self._root_view, -9, "抢庄限制必须大于等于" .. _data.up_bank)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if hpType > 1 and hpOnOff == 1 then
|
if hpType > 1 and hpOnOff == 1 then
|
||||||
if self.hpData.limitInRoom < self.hpData.limitPlay then
|
if self.hpData.limitInRoom < self.hpData.limitPlay then
|
||||||
ViewUtil.ErrorMsg(self._root_view,-9,"进入限制必须大于等于退出限制")
|
ViewUtil.ErrorMsg(self._root_view, -9, "进入限制必须大于等于退出限制")
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if self.hpData.limitPlay == 0 then
|
if self.hpData.limitPlay == 0 then
|
||||||
ViewUtil.ErrorMsg(self._root_view,-9,"退出房间限制不能为0")
|
ViewUtil.ErrorMsg(self._root_view, -9, "退出房间限制不能为0")
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
local times = tonumber(tex_times.text)
|
local times = tonumber(tex_times.text)
|
||||||
self.hpData.times = ad2d(tonumber(times))
|
self.hpData.times = ad2d(tonumber(times))
|
||||||
|
|
||||||
local tex_times_room = tonumber(tex_times_room.text)
|
local tex_times_room = tonumber(tex_times_room.text)
|
||||||
self.hpData.tex_times_room = ad2d(tonumber(tex_times_room))
|
self.hpData.tex_times_room = ad2d(tonumber(tex_times_room))
|
||||||
|
|
||||||
|
|
||||||
local base_pump = tonumber(tex_base_pump.text)
|
local base_pump = tonumber(tex_base_pump.text)
|
||||||
self.hpData.basePump = ad2d(tonumber(base_pump))
|
self.hpData.basePump = ad2d(tonumber(base_pump))
|
||||||
|
|
@ -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))
|
||||||
|
|
@ -453,7 +452,7 @@ function M:FillFagData()
|
||||||
else
|
else
|
||||||
self.hpData.anchou_rewards_val = ad2d(10000)
|
self.hpData.anchou_rewards_val = ad2d(10000)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
local tex_name = self._view:GetChild("tex_name")
|
local tex_name = self._view:GetChild("tex_name")
|
||||||
local name = tex_name.text
|
local name = tex_name.text
|
||||||
|
|
@ -464,83 +463,85 @@ 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,
|
||||||
if self._is_destroy then
|
function(res)
|
||||||
return
|
if self._is_destroy then
|
||||||
end
|
return
|
||||||
ViewUtil.CloseModalWait()
|
end
|
||||||
--print("======新增玩法=============")
|
ViewUtil.CloseModalWait()
|
||||||
--pt(res)
|
--print("======新增玩法=============")
|
||||||
if res.ReturnCode == 0 then
|
--pt(res)
|
||||||
local play = {}
|
if res.ReturnCode == 0 then
|
||||||
play.name = name
|
local play = {}
|
||||||
play.deskId = self.table_color
|
play.name = name
|
||||||
play.game_name = mod.data.game_data.name
|
play.deskId = self.table_color
|
||||||
play.gameId = game_id
|
play.game_name = mod.data.game_data.name
|
||||||
play.hpOnOff = hpOnOff
|
play.gameId = game_id
|
||||||
play.hpData= json.encode(self.hpData)
|
play.hpOnOff = hpOnOff
|
||||||
play.id = res.Data.pid
|
play.hpData = json.encode(self.hpData)
|
||||||
play.xipai_rewards_val = self.hpData.xipairewards_val
|
play.id = res.Data.pid
|
||||||
play.anchou_rewards_val = self.hpData.anchou_rewards_val
|
play.xipai_rewards_val = self.hpData.xipairewards_val
|
||||||
play.reward = self.hpData.rewards_val
|
play.anchou_rewards_val = self.hpData.anchou_rewards_val
|
||||||
play.rewardType = self.hpData.rewards_type
|
play.reward = self.hpData.rewards_val
|
||||||
play.rewardValueType = self.hpData.rewardValueType
|
play.rewardType = self.hpData.rewards_type
|
||||||
play.xipai_rewardType = self.hpData.xipai_rewardType
|
play.rewardValueType = self.hpData.rewardValueType
|
||||||
play.anchou_rewardType = 3
|
play.xipai_rewardType = self.hpData.xipai_rewardType
|
||||||
play.xipai_rewardValueType = self.hpData.xipai_rewardValueType
|
play.anchou_rewardType = 3
|
||||||
play.anchou_rewardValueType = 1
|
play.xipai_rewardValueType = self.hpData.xipai_rewardValueType
|
||||||
_data.maxPlayers = res.Data.maxPlayers
|
play.anchou_rewardValueType = 1
|
||||||
play.config = json.encode(_data)
|
_data.maxPlayers = res.Data.maxPlayers
|
||||||
play.hp_times = self.hpData.times
|
play.config = json.encode(_data)
|
||||||
play.maxPlayers = _data.maxPlayers
|
play.hp_times = self.hpData.times
|
||||||
play.roomNum=self.hpData.tex_times_room/1000
|
play.maxPlayers = _data.maxPlayers
|
||||||
play.maxRound=res.Data.maxRound
|
play.roomNum = self.hpData.tex_times_room / 1000
|
||||||
ViewUtil.ShowBannerOnScreenCenter("添加玩法成功")
|
play.maxRound = res.Data.maxRound
|
||||||
self.callback(play)
|
ViewUtil.ShowBannerOnScreenCenter("添加玩法成功")
|
||||||
self:Destroy()
|
self.callback(play)
|
||||||
else
|
self:Destroy()
|
||||||
ViewUtil.ErrorTip(res.ReturnCode,"添加玩法失败!")
|
else
|
||||||
end
|
ViewUtil.ErrorTip(res.ReturnCode, "添加玩法失败!")
|
||||||
end)
|
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,
|
||||||
if self._is_destroy then
|
self.table_color, function(res)
|
||||||
return
|
if self._is_destroy then
|
||||||
end
|
return
|
||||||
ViewUtil.CloseModalWait()
|
end
|
||||||
--print("======修改玩法=============")
|
ViewUtil.CloseModalWait()
|
||||||
--pt(res)
|
--print("======修改玩法=============")
|
||||||
if res.ReturnCode == 0 then
|
--pt(res)
|
||||||
local play = {}
|
if res.ReturnCode == 0 then
|
||||||
play.name = name
|
local play = {}
|
||||||
play.deskId = self.table_color
|
play.name = name
|
||||||
play.game_name = mod.data.game_data.name
|
play.deskId = self.table_color
|
||||||
play.gameId = game_id
|
play.game_name = mod.data.game_data.name
|
||||||
play.id = self.play.id
|
play.gameId = game_id
|
||||||
play.hpOnOff = hpOnOff
|
play.id = self.play.id
|
||||||
play.hpData= json.encode(self.hpData)
|
play.hpOnOff = hpOnOff
|
||||||
play.xipai_rewards_val = self.hpData.xipairewards_val
|
play.hpData = json.encode(self.hpData)
|
||||||
play.anchou_rewards_val = self.hpData.anchou_rewards_val
|
play.xipai_rewards_val = self.hpData.xipairewards_val
|
||||||
play.reward = self.hpData.rewards_val
|
play.anchou_rewards_val = self.hpData.anchou_rewards_val
|
||||||
play.rewardType = self.hpData.rewards_type
|
play.reward = self.hpData.rewards_val
|
||||||
play.rewardValueType = self.hpData.rewardValueType
|
play.rewardType = self.hpData.rewards_type
|
||||||
play.xipai_rewardType = self.hpData.xipai_rewardType
|
play.rewardValueType = self.hpData.rewardValueType
|
||||||
play.anchou_rewardType = 3
|
play.xipai_rewardType = self.hpData.xipai_rewardType
|
||||||
play.xipai_rewardValueType = self.hpData.xipai_rewardValueType
|
play.anchou_rewardType = 3
|
||||||
play.anchou_rewardValueType = 1
|
play.xipai_rewardValueType = self.hpData.xipai_rewardValueType
|
||||||
_data.maxPlayers = res.Data.maxPlayers
|
play.anchou_rewardValueType = 1
|
||||||
play.config = json.encode(_data)
|
_data.maxPlayers = res.Data.maxPlayers
|
||||||
play.hp_times = self.hpData.times
|
play.config = json.encode(_data)
|
||||||
play.maxPlayers = _data.maxPlayers
|
play.hp_times = self.hpData.times
|
||||||
play.roomNum=self.hpData.tex_times_room/1000
|
play.maxPlayers = _data.maxPlayers
|
||||||
play.maxRound=res.Data.maxRound
|
play.roomNum = self.hpData.tex_times_room / 1000
|
||||||
self.callback(play)
|
play.maxRound = res.Data.maxRound
|
||||||
self:Destroy()
|
self.callback(play)
|
||||||
else
|
self:Destroy()
|
||||||
ViewUtil.ErrorTip(res.ReturnCode,"修改玩法失败!")
|
else
|
||||||
end
|
ViewUtil.ErrorTip(res.ReturnCode, "修改玩法失败!")
|
||||||
end)
|
end
|
||||||
|
end)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
@ -559,7 +560,7 @@ function M:OnRenderItem(index, obj)
|
||||||
local data = self.rewards_data[index]
|
local data = self.rewards_data[index]
|
||||||
-- 抽水方法,固定、浮动
|
-- 抽水方法,固定、浮动
|
||||||
local cb_method = obj:GetChild("cb_method")
|
local cb_method = obj:GetChild("cb_method")
|
||||||
cb_method.value = tostring(self._type)
|
cb_method.value = tostring(self._type)
|
||||||
cb_method.onChanged:Set(function()
|
cb_method.onChanged:Set(function()
|
||||||
local tem = membe_clone(self.rewards_data[1])
|
local tem = membe_clone(self.rewards_data[1])
|
||||||
tem.pumpProportion = 0
|
tem.pumpProportion = 0
|
||||||
|
|
@ -573,11 +574,11 @@ function M:OnRenderItem(index, obj)
|
||||||
for i = 1, 2 do
|
for i = 1, 2 do
|
||||||
local cb_type = obj:GetChild("cb_type" .. i)
|
local cb_type = obj:GetChild("cb_type" .. i)
|
||||||
if self._limitPump <= 4 - tem then
|
if self._limitPump <= 4 - tem then
|
||||||
cb_type.value = tostring(self._limitPump)
|
cb_type.value = tostring(self._limitPump)
|
||||||
else
|
else
|
||||||
self._limitPump = tonumber(cb_type.value)
|
self._limitPump = tonumber(cb_type.value)
|
||||||
end
|
end
|
||||||
cb_type.onChanged:Set(function()
|
cb_type.onChanged:Set(function()
|
||||||
local limitPump = cb_type.value
|
local limitPump = cb_type.value
|
||||||
self._limitPump = tonumber(limitPump)
|
self._limitPump = tonumber(limitPump)
|
||||||
self:UpdateRewards()
|
self:UpdateRewards()
|
||||||
|
|
@ -620,12 +621,11 @@ function M:OnRenderItem(index, obj)
|
||||||
obj:GetController("give_owner").selectedIndex = 1
|
obj:GetController("give_owner").selectedIndex = 1
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
cb_max.value = UpperLimit .. "分"
|
cb_max.value = UpperLimit .. "分"
|
||||||
self:SetIndex(cb_max, d2ad(data.UpperLimit))
|
self:SetIndex(cb_max, d2ad(data.UpperLimit))
|
||||||
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()
|
||||||
|
|
@ -651,11 +651,11 @@ function M:OnRenderItem(index, obj)
|
||||||
if next_data then
|
if next_data then
|
||||||
tem = string.format("小于%s", d2ad(next_data.UpperLimit))
|
tem = string.format("小于%s", d2ad(next_data.UpperLimit))
|
||||||
end
|
end
|
||||||
local tem1 =""
|
local tem1 = ""
|
||||||
if UpperLimitReward ~= 0 then
|
if UpperLimitReward ~= 0 then
|
||||||
tem1 = string.format(",每个玩家赠送盟主%s分",UpperLimitReward)
|
tem1 = string.format(",每个玩家赠送盟主%s分", UpperLimitReward)
|
||||||
end
|
end
|
||||||
str_min_tip = string.format("(低于%s分不抽水%s)", UpperLimit,tem1)
|
str_min_tip = string.format("(低于%s分不抽水%s)", UpperLimit, tem1)
|
||||||
-- str_max_tip = string.format("(低于%s按此设置抽水)", UpperLimit)
|
-- str_max_tip = string.format("(低于%s按此设置抽水)", UpperLimit)
|
||||||
elseif index == #self.rewards_data then
|
elseif index == #self.rewards_data then
|
||||||
str_min_tip = string.format("(大于等于%s按此设置抽水)", UpperLimit)
|
str_min_tip = string.format("(大于等于%s按此设置抽水)", UpperLimit)
|
||||||
|
|
@ -672,9 +672,9 @@ function M:OnRenderItem(index, obj)
|
||||||
local input_limit = 1000
|
local input_limit = 1000
|
||||||
local btn_input = obj:GetChild("btn_input")
|
local btn_input = obj:GetChild("btn_input")
|
||||||
btn_input.onClick:Set(function()
|
btn_input.onClick:Set(function()
|
||||||
local gfiv = GroupNumberInputView.new(self._root_view,function(num)
|
local gfiv = GroupNumberInputView.new(self._root_view, function(num)
|
||||||
if num > input_limit then
|
if num > input_limit then
|
||||||
ViewUtil.ErrorMsg(self._root_view,-9,"输入最大不能超过" .. input_limit)
|
ViewUtil.ErrorMsg(self._root_view, -9, "输入最大不能超过" .. input_limit)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
cb_proportion1.title = "抽" .. num .. "次"
|
cb_proportion1.title = "抽" .. num .. "次"
|
||||||
|
|
@ -695,16 +695,16 @@ function M:OnRenderItem(index, obj)
|
||||||
end
|
end
|
||||||
local btn_input2 = obj:GetChild("btn_input2")
|
local btn_input2 = obj:GetChild("btn_input2")
|
||||||
btn_input2.onClick:Set(function()
|
btn_input2.onClick:Set(function()
|
||||||
local gfiv = GroupNumberInputView.new(self._root_view,function(num)
|
local gfiv = GroupNumberInputView.new(self._root_view, function(num)
|
||||||
if num > input_limit2 then
|
if num > input_limit2 then
|
||||||
ViewUtil.ErrorMsg(nil,-9,"输入值不能超过" .. input_limit2)
|
ViewUtil.ErrorMsg(nil, -9, "输入值不能超过" .. input_limit2)
|
||||||
return
|
return
|
||||||
elseif num >= max_v then
|
elseif num >= max_v then
|
||||||
ViewUtil.ErrorMsg(nil,-9,"输入值必须小于" .. max_v)
|
ViewUtil.ErrorMsg(nil, -9, "输入值必须小于" .. max_v)
|
||||||
return
|
return
|
||||||
elseif num <= min_v then
|
elseif num <= min_v then
|
||||||
ViewUtil.ErrorMsg(nil,-9,"输入值必须大于" .. min_v)
|
ViewUtil.ErrorMsg(nil, -9, "输入值必须大于" .. min_v)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
-- cb_min.title = num .. "分"
|
-- cb_min.title = num .. "分"
|
||||||
data.UpperLimit = ad2d(num)
|
data.UpperLimit = ad2d(num)
|
||||||
|
|
@ -715,8 +715,7 @@ 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)
|
||||||
|
|
@ -726,15 +725,15 @@ function M:OnRenderItem(index, obj)
|
||||||
local tem = string.gsub(cb_min.title, "分", "")
|
local tem = string.gsub(cb_min.title, "分", "")
|
||||||
local tem = tonumber(tem)
|
local tem = tonumber(tem)
|
||||||
if tem > input_limit2 then
|
if tem > input_limit2 then
|
||||||
ViewUtil.ErrorMsg(nil,-9,"输入值不能超过" .. input_limit2)
|
ViewUtil.ErrorMsg(nil, -9, "输入值不能超过" .. input_limit2)
|
||||||
return
|
return
|
||||||
elseif tem >= max_v then
|
elseif tem >= max_v then
|
||||||
cb_min.title = d2ad(data.UpperLimit) .. "分"
|
cb_min.title = d2ad(data.UpperLimit) .. "分"
|
||||||
ViewUtil.ErrorMsg(nil,-9,"输入值必须小于" .. max_v)
|
ViewUtil.ErrorMsg(nil, -9, "输入值必须小于" .. max_v)
|
||||||
return
|
return
|
||||||
elseif tem <= min_v then
|
elseif tem <= min_v then
|
||||||
cb_min.title = d2ad(data.UpperLimit) .. "分"
|
cb_min.title = d2ad(data.UpperLimit) .. "分"
|
||||||
ViewUtil.ErrorMsg(nil,-9,"输入值必须大于" .. min_v)
|
ViewUtil.ErrorMsg(nil, -9, "输入值必须大于" .. min_v)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
data.UpperLimit = ad2d(string.gsub(cb_min.title, "分", ""))
|
data.UpperLimit = ad2d(string.gsub(cb_min.title, "分", ""))
|
||||||
|
|
@ -744,7 +743,7 @@ function M:OnRenderItem(index, obj)
|
||||||
cb_min_send.onChanged:Set(function()
|
cb_min_send.onChanged:Set(function()
|
||||||
local tem = string.gsub(cb_min_send.title, "分", "")
|
local tem = string.gsub(cb_min_send.title, "分", "")
|
||||||
local tem = tonumber(tem)
|
local tem = tonumber(tem)
|
||||||
|
|
||||||
data.UpperLimitReward = ad2d(string.gsub(cb_min_send.title, "分", ""))
|
data.UpperLimitReward = ad2d(string.gsub(cb_min_send.title, "分", ""))
|
||||||
self:UpdateRewards()
|
self:UpdateRewards()
|
||||||
end)
|
end)
|
||||||
|
|
@ -752,14 +751,14 @@ function M:OnRenderItem(index, obj)
|
||||||
cb_max.onChanged:Set(function()
|
cb_max.onChanged:Set(function()
|
||||||
local tem = string.gsub(cb_max.title, "分", "")
|
local tem = string.gsub(cb_max.title, "分", "")
|
||||||
local tem = tonumber(tem)
|
local tem = tonumber(tem)
|
||||||
if tem > max_v then
|
if tem > max_v then
|
||||||
self:SetIndex(cb_max, d2ad(data.UpperLimit))
|
self:SetIndex(cb_max, d2ad(data.UpperLimit))
|
||||||
ViewUtil.ErrorMsg(nil,-9,"输入值必须小于" .. max_v)
|
ViewUtil.ErrorMsg(nil, -9, "输入值必须小于" .. max_v)
|
||||||
return
|
return
|
||||||
-- elseif tem <= min_v then
|
-- elseif tem <= min_v then
|
||||||
-- self:SetIndex(cb_max, d2ad(data.UpperLimit))
|
-- self:SetIndex(cb_max, d2ad(data.UpperLimit))
|
||||||
-- ViewUtil.ErrorMsg(nil,-9,"输入值必须大于" .. min_v)
|
-- ViewUtil.ErrorMsg(nil,-9,"输入值必须大于" .. min_v)
|
||||||
-- return
|
-- return
|
||||||
end
|
end
|
||||||
data.UpperLimit = ad2d(tem)
|
data.UpperLimit = ad2d(tem)
|
||||||
self:UpdateRewards()
|
self:UpdateRewards()
|
||||||
|
|
@ -772,10 +771,10 @@ function M:OnRenderItem(index, obj)
|
||||||
-- 如果UpperLimit达到最大值,无法再增加
|
-- 如果UpperLimit达到最大值,无法再增加
|
||||||
if (cb_method.value == "1" and data.UpperLimit >= ad2d(input_limit2)) or (cb_method.value == "2" and cb_max.selectedIndex == cb_max.values.Length - 1) then
|
if (cb_method.value == "1" and data.UpperLimit >= ad2d(input_limit2)) or (cb_method.value == "2" and cb_max.selectedIndex == cb_max.values.Length - 1) then
|
||||||
ViewUtil.ErrorTip(nil, "已达到上限,无法再增加")
|
ViewUtil.ErrorTip(nil, "已达到上限,无法再增加")
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
local ul = cb_method.value == "1" and data.UpperLimit + 10 or ad2d(cb_max.values[cb_max.selectedIndex + 1])
|
local ul = cb_method.value == "1" and data.UpperLimit + 10 or ad2d(cb_max.values[cb_max.selectedIndex + 1])
|
||||||
local tem = {type = data.type, pumpProportion = data.pumpProportion, UpperLimit = ul}
|
local tem = { type = data.type, pumpProportion = data.pumpProportion, UpperLimit = ul }
|
||||||
table.insert(self.rewards_data, tem)
|
table.insert(self.rewards_data, tem)
|
||||||
self:UpdateRewards()
|
self:UpdateRewards()
|
||||||
end)
|
end)
|
||||||
|
|
@ -784,7 +783,7 @@ function M:OnRenderItem(index, obj)
|
||||||
local msg_tip = MsgWindow.new(self._root_view, "确定删除该项吗?", MsgWindow.MsgMode.OkAndCancel)
|
local msg_tip = MsgWindow.new(self._root_view, "确定删除该项吗?", MsgWindow.MsgMode.OkAndCancel)
|
||||||
msg_tip.onOk:Add(function()
|
msg_tip.onOk:Add(function()
|
||||||
table.remove(self.rewards_data, index)
|
table.remove(self.rewards_data, index)
|
||||||
self:UpdateRewards()
|
self:UpdateRewards()
|
||||||
end)
|
end)
|
||||||
msg_tip:Show()
|
msg_tip:Show()
|
||||||
end)
|
end)
|
||||||
|
|
@ -803,7 +802,7 @@ end
|
||||||
|
|
||||||
function M:__input_num(tex, filed, itype)
|
function M:__input_num(tex, filed, itype)
|
||||||
itype = itype or 0
|
itype = itype or 0
|
||||||
local gfiv = GroupNumberInputView.new(self._root_view,function(num)
|
local gfiv = GroupNumberInputView.new(self._root_view, function(num)
|
||||||
tex.text = num
|
tex.text = num
|
||||||
if filed == "robot_room" then
|
if filed == "robot_room" then
|
||||||
--printlog("cccccccccccccccc ",num)
|
--printlog("cccccccccccccccc ",num)
|
||||||
|
|
@ -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
|
||||||
|
|
@ -821,4 +819,4 @@ function M:Destroy()
|
||||||
self.gl_view:Destroy()
|
self.gl_view:Destroy()
|
||||||
end
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
|
||||||
|
|
@ -180,4 +180,8 @@ function M:LoadConfigData(data)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function M:LoadConfigToDetail(data)
|
||||||
|
return data
|
||||||
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
|
||||||
|
|
@ -18,8 +18,8 @@ local M = ExtendConfig
|
||||||
|
|
||||||
|
|
||||||
function ExtendConfig.new()
|
function ExtendConfig.new()
|
||||||
setmetatable(M, {__index = IExtendConfig})
|
setmetatable(M, { __index = IExtendConfig })
|
||||||
local self = setmetatable({}, {__index = M})
|
local self = setmetatable({}, { __index = M })
|
||||||
self.class = "ExtendConfig"
|
self.class = "ExtendConfig"
|
||||||
self.extend_id = 14
|
self.extend_id = 14
|
||||||
self._viewMap = {}
|
self._viewMap = {}
|
||||||
|
|
@ -38,13 +38,13 @@ function M:UnAssets()
|
||||||
UIPackage.RemovePackage("extend/poker/runfast/ui/Extend_Poker_RunFastNew")
|
UIPackage.RemovePackage("extend/poker/runfast/ui/Extend_Poker_RunFastNew")
|
||||||
ResourcesManager.UnLoadGroup("RunFase_PK")
|
ResourcesManager.UnLoadGroup("RunFase_PK")
|
||||||
end
|
end
|
||||||
|
|
||||||
local _gameInfo = nil
|
local _gameInfo = nil
|
||||||
function M:GetGameInfo()
|
function M:GetGameInfo()
|
||||||
if not _gameInfo then
|
if not _gameInfo then
|
||||||
_gameInfo = EXGameInfo.new()
|
_gameInfo = EXGameInfo.new()
|
||||||
end
|
end
|
||||||
return _gameInfo
|
return _gameInfo
|
||||||
end
|
end
|
||||||
|
|
||||||
local _ctr_game = nil
|
local _ctr_game = nil
|
||||||
|
|
@ -68,7 +68,7 @@ function M:GetIconUrl()
|
||||||
--
|
--
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:FillRoomConfig(room,_config)
|
function M:FillRoomConfig(room, _config)
|
||||||
room.room_config = RunFast_RoomConfig.new(_config)
|
room.room_config = RunFast_RoomConfig.new(_config)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -81,19 +81,19 @@ function M:FillRoomData(s2croom)
|
||||||
local reload = s2croom["reload"]
|
local reload = s2croom["reload"]
|
||||||
|
|
||||||
local _tableInfo = s2croom["tableInfo"]
|
local _tableInfo = s2croom["tableInfo"]
|
||||||
|
|
||||||
room.xipaiScore=_tableInfo["xipai_score"]
|
room.xipaiScore = _tableInfo["xipai_score"]
|
||||||
|
|
||||||
local _config = _tableInfo["config"]
|
local _config = _tableInfo["config"]
|
||||||
room.room_config = RunFast_RoomConfig.new(_config)
|
room.room_config = RunFast_RoomConfig.new(_config)
|
||||||
|
|
||||||
room.curren_round = _tableInfo["round"]
|
room.curren_round = _tableInfo["round"]
|
||||||
if room.curren_round == 0 and reload then
|
if room.curren_round == 0 and reload then
|
||||||
room.curren_round = 1
|
room.curren_round = 1
|
||||||
end
|
end
|
||||||
|
|
||||||
local playerList = _tableInfo["playerData"]
|
local playerList = _tableInfo["playerData"]
|
||||||
for i = 1,#playerList do
|
for i = 1, #playerList do
|
||||||
local _jp = playerList[i]
|
local _jp = playerList[i]
|
||||||
|
|
||||||
local p = RunFast_Player.new()
|
local p = RunFast_Player.new()
|
||||||
|
|
@ -133,28 +133,25 @@ 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"]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
local playing = reloadInfo["playing"]
|
local playing = reloadInfo["playing"]
|
||||||
|
|
||||||
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
|
||||||
|
|
||||||
|
|
||||||
for i = 1, #info_list do
|
for i = 1, #info_list do
|
||||||
local p = room:GetPlayerById(info_list[i]["playerid"])
|
local p = room:GetPlayerById(info_list[i]["playerid"])
|
||||||
|
|
||||||
if p == room.self_player then
|
if p == room.self_player then
|
||||||
p.hand_list = reloadInfo["hand_card"]
|
p.hand_list = reloadInfo["hand_card"]
|
||||||
p.open= reloadInfo["open"]
|
p.open = reloadInfo["open"]
|
||||||
end
|
end
|
||||||
|
|
||||||
p.hand_count = info_list[i]["card_size"]
|
p.hand_count = info_list[i]["card_size"]
|
||||||
|
|
@ -163,17 +160,17 @@ function M:FillRoomData(s2croom)
|
||||||
p.outCards = info_list[i]["outCards"]
|
p.outCards = info_list[i]["outCards"]
|
||||||
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)
|
||||||
else
|
else
|
||||||
p.out_card_list = {0}
|
p.out_card_list = { 0 }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
-- print("aaaaaaaaaaaaaaaa1111111111111111111111111")
|
-- print("aaaaaaaaaaaaaaaa1111111111111111111111111")
|
||||||
--pt(s2croom)
|
--pt(s2croom)
|
||||||
room.game_status=1
|
room.game_status = 1
|
||||||
|
|
||||||
room.CurnrenState = StateType.PalyingWait
|
room.CurnrenState = StateType.PalyingWait
|
||||||
|
|
||||||
|
|
@ -183,37 +180,34 @@ function M:FillRoomData(s2croom)
|
||||||
for i = 1, #info_list do
|
for i = 1, #info_list do
|
||||||
local playerData = info_list[i]
|
local playerData = info_list[i]
|
||||||
local p = room:GetPlayerById(playerData["playerid"])
|
local p = room:GetPlayerById(playerData["playerid"])
|
||||||
|
|
||||||
p.ready = playerData["certainseat"] == 1 and true or false
|
p.ready = playerData["certainseat"] == 1 and true or false
|
||||||
|
|
||||||
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)
|
|
||||||
else
|
else
|
||||||
p.out_card_list = {0}
|
p.out_card_list = { 0 }
|
||||||
end
|
end
|
||||||
|
|
||||||
p.hand_list = info_list[i]["cards"]
|
p.hand_list = info_list[i]["cards"]
|
||||||
p.winscore = info_list[i]["winscore"]
|
p.winscore = info_list[i]["winscore"]
|
||||||
p.piao = info_list[i]["piao"]
|
p.piao = info_list[i]["piao"]
|
||||||
p.hand_count = info_list[i]["card_size"]
|
p.hand_count = info_list[i]["card_size"]
|
||||||
p.thisboomnum=info_list[i]["thisboomnum"]
|
p.thisboomnum = info_list[i]["thisboomnum"]
|
||||||
p.open= info_list[i]["open"]
|
p.open = info_list[i]["open"]
|
||||||
|
|
||||||
p.handCards = info_list[i]["handCards"]
|
p.handCards = info_list[i]["handCards"]
|
||||||
p.outCards = info_list[i]["outCards"]
|
p.outCards = info_list[i]["outCards"]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
room.CurnrenState = StateType.Ready
|
room.CurnrenState = StateType.Ready
|
||||||
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"]
|
||||||
|
|
@ -228,7 +222,7 @@ function M:FillPlayBackData(pd_data)
|
||||||
room.curren_turn_seat = active_seat
|
room.curren_turn_seat = active_seat
|
||||||
room.curren_round = _tableInfo["round"]
|
room.curren_round = _tableInfo["round"]
|
||||||
local _info_list = _tableInfo["playerData"]
|
local _info_list = _tableInfo["playerData"]
|
||||||
for i = 1,#_info_list do
|
for i = 1, #_info_list do
|
||||||
local _jp = _info_list[i]
|
local _jp = _info_list[i]
|
||||||
local p = RunFast_Player.new()
|
local p = RunFast_Player.new()
|
||||||
p.seat = _jp["seat"]
|
p.seat = _jp["seat"]
|
||||||
|
|
@ -250,7 +244,7 @@ function M:FillPlayBackData(pd_data)
|
||||||
p.hand_count = #_hand_card
|
p.hand_count = #_hand_card
|
||||||
p.total_score = _jp["score"]
|
p.total_score = _jp["score"]
|
||||||
p.piao = _jp["piao"]
|
p.piao = _jp["piao"]
|
||||||
p.open= _jp["open"]
|
p.open = _jp["open"]
|
||||||
p.hp_info = _jp["hp_info"]
|
p.hp_info = _jp["hp_info"]
|
||||||
if _jp['hp_info'] then
|
if _jp['hp_info'] then
|
||||||
p.cur_hp = _jp.hp_info.cur_hp
|
p.cur_hp = _jp.hp_info.cur_hp
|
||||||
|
|
@ -261,4 +255,8 @@ function M:FillPlayBackData(pd_data)
|
||||||
room.cmdList = pd_data["cmdList"]
|
room.cmdList = pd_data["cmdList"]
|
||||||
end
|
end
|
||||||
|
|
||||||
return M
|
function M:LoadConfigToDetail(data)
|
||||||
|
return data
|
||||||
|
end
|
||||||
|
|
||||||
|
return M
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue