2025-05-24 14:29:14 +08:00
|
|
|
local EXGameInfo = {}
|
|
|
|
|
|
|
|
|
|
local M = EXGameInfo
|
|
|
|
|
|
|
|
|
|
function EXGameInfo.new(blur_view)
|
2025-06-19 23:51:18 +08:00
|
|
|
setmetatable(M, { __index = IGameInfo })
|
|
|
|
|
local self = setmetatable({}, { __index = M })
|
|
|
|
|
self.class = 'EXGameInfo'
|
|
|
|
|
UIPackage.AddPackage('extend/zipai/fulushou/ui/Info_Poker_FuLuShou')
|
|
|
|
|
return self
|
2025-05-24 14:29:14 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function M:FillData()
|
|
|
|
|
printlog("jefe fulushou")
|
2025-06-19 23:51:18 +08:00
|
|
|
self._maxPlayer = 3 -- 默认玩家人数
|
|
|
|
|
self._roundChoice = 2 -- 回合选项数
|
|
|
|
|
self._config = UIPackage.CreateObjectFromURL('ui://Info_Poker_FuLuShou/Cgm_create_room')
|
|
|
|
|
if oldGameVersion == 1 then
|
|
|
|
|
self._config:GetController("xipai").selectedIndex = 0
|
2025-05-24 14:29:14 +08:00
|
|
|
end
|
2025-06-19 23:51:18 +08:00
|
|
|
|
|
|
|
|
if oldGameVersion == 2 then
|
|
|
|
|
self._config:GetController("xipai").selectedIndex = 1
|
|
|
|
|
|
|
|
|
|
self.xipaiValueText = self._config:GetChild('xipaifen')
|
|
|
|
|
self.xipaiValueText.text = 1
|
|
|
|
|
self.xipaiValue = 1
|
|
|
|
|
|
|
|
|
|
self.anchouValueText = self._config:GetChild('anchoufen')
|
|
|
|
|
self.anchouValueText.text = 1
|
|
|
|
|
self.anchouValue = 1
|
|
|
|
|
|
2025-05-24 14:29:14 +08:00
|
|
|
local btn_cr = self._config:GetChild('sdsrbtn')
|
2025-06-19 23:51:18 +08:00
|
|
|
btn_cr.onClick:Set(
|
|
|
|
|
function()
|
|
|
|
|
local gniv = GroupNumberInputView_Game.new(nil, function(num)
|
|
|
|
|
local value = limit
|
|
|
|
|
if otype == 1 then
|
|
|
|
|
value = value + ad2d(num)
|
|
|
|
|
elseif otype == -1 then
|
|
|
|
|
value = value - ad2d(num)
|
|
|
|
|
else
|
|
|
|
|
value = ad2d(num)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if value < 0 then
|
|
|
|
|
ViewUtil.ErrorTip(1, "输入数据异常!")
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
self.xipaiValueText.text = value / 100
|
|
|
|
|
self.xipaiValue = value / 100
|
|
|
|
|
end, 3, nil)
|
|
|
|
|
gniv:Show()
|
|
|
|
|
end
|
|
|
|
|
)
|
|
|
|
|
|
2025-05-24 14:29:14 +08:00
|
|
|
|
|
|
|
|
local btn_cr2 = self._config:GetChild('anchoubtn')
|
|
|
|
|
btn_cr2.onClick:Set(
|
|
|
|
|
function()
|
2025-06-19 23:51:18 +08:00
|
|
|
local gniv = GroupNumberInputView_Game.new(nil, function(num)
|
2025-05-24 14:29:14 +08:00
|
|
|
local value = limit
|
|
|
|
|
if otype == 1 then
|
|
|
|
|
value = value + ad2d(num)
|
2025-06-19 23:51:18 +08:00
|
|
|
elseif otype == -1 then
|
2025-05-24 14:29:14 +08:00
|
|
|
value = value - ad2d(num)
|
|
|
|
|
else
|
|
|
|
|
value = ad2d(num)
|
|
|
|
|
end
|
2025-06-19 23:51:18 +08:00
|
|
|
|
2025-05-24 14:29:14 +08:00
|
|
|
if value < 0 then
|
2025-06-19 23:51:18 +08:00
|
|
|
ViewUtil.ErrorTip(1, "输入数据异常!")
|
2025-05-24 14:29:14 +08:00
|
|
|
end
|
2025-06-19 23:51:18 +08:00
|
|
|
|
|
|
|
|
self.anchouValueText.text = value / 100
|
|
|
|
|
self.anchouValue = value / 100
|
2025-05-24 14:29:14 +08:00
|
|
|
end, 3, nil)
|
|
|
|
|
gniv:Show()
|
|
|
|
|
end
|
|
|
|
|
)
|
|
|
|
|
end
|
|
|
|
|
end
|
2025-06-19 23:51:18 +08:00
|
|
|
|
2025-05-24 14:29:14 +08:00
|
|
|
local _help_url = 'ui://Info_Poker_FuLuShou/Com_help'
|
|
|
|
|
function M:GetHelpUrl()
|
2025-06-19 23:51:18 +08:00
|
|
|
return _help_url
|
2025-05-24 14:29:14 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
local _icon_url = "ui://Info_Poker_FuLuShou/icon"
|
|
|
|
|
function M:GetIconUrl()
|
2025-06-19 23:51:18 +08:00
|
|
|
return _icon_url
|
2025-05-24 14:29:14 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
local _icon_url1 = "ui://Info_Poker_FuLuShou/icon1"
|
|
|
|
|
function M:GetIconUrl1()
|
2025-06-19 23:51:18 +08:00
|
|
|
return _icon_url1
|
2025-05-24 14:29:14 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
--local _play_list = {"三人玩法","二人玩法"}
|
|
|
|
|
function M:GetPlayList()
|
2025-06-19 23:51:18 +08:00
|
|
|
--return _play_list
|
2025-05-24 14:29:14 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function M:SelectedConfigData()
|
2025-06-19 23:51:18 +08:00
|
|
|
local _config = self._config
|
|
|
|
|
local round = _config:GetController('round').selectedIndex == 0 and 1 or 2
|
|
|
|
|
local renshu = _config:GetController('play_list').selectedIndex + 2
|
|
|
|
|
|
|
|
|
|
local xuan_zhuang = _config:GetController('zhuangjia').selectedIndex
|
|
|
|
|
local piao = _config:GetController('piao').selectedIndex
|
|
|
|
|
local piao1 = false
|
|
|
|
|
local piao2 = false
|
|
|
|
|
local piao3 = false
|
|
|
|
|
local piao4 = false
|
|
|
|
|
if piao == 3 then
|
|
|
|
|
piao1 = _config:GetChild('pf1').selected and true or false
|
|
|
|
|
piao2 = _config:GetChild('pf2').selected and true or false
|
|
|
|
|
piao3 = _config:GetChild('pf3').selected and true or false
|
|
|
|
|
piao4 = _config:GetChild('pf4').selected and true or false
|
2025-05-24 14:29:14 +08:00
|
|
|
end
|
2025-06-19 23:51:18 +08:00
|
|
|
local fen_diejia = _config:GetController('fen').selectedIndex
|
|
|
|
|
|
|
|
|
|
local qing_zui_hu = _config:GetController('qinzuihu').selectedIndex
|
|
|
|
|
local gang_zhao_liu_xi = _config:GetChild('gangzhao').selected and true or false
|
|
|
|
|
local special_peng_peng_hu = _config:GetChild('pengpenghu').selected and true or false
|
|
|
|
|
|
2025-05-24 14:29:14 +08:00
|
|
|
local piao_fen = _config:GetController('piaofen').selectedIndex
|
2025-06-19 23:51:18 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
local _data = {}
|
|
|
|
|
_data['opt'] = round -- 1 2 8局 16 局
|
|
|
|
|
_data['maxPlayers'] = renshu
|
2025-05-24 14:29:14 +08:00
|
|
|
_data['xuan_zhuang'] = xuan_zhuang
|
|
|
|
|
_data['piao'] = piao
|
|
|
|
|
_data['piao1'] = piao1
|
|
|
|
|
_data['piao2'] = piao2
|
|
|
|
|
_data['piao3'] = piao3
|
|
|
|
|
_data['piao4'] = piao4
|
|
|
|
|
_data['fen_diejia'] = fen_diejia
|
|
|
|
|
_data['qing_zui_hu'] = qing_zui_hu
|
|
|
|
|
_data['gang_zhao_liu_xi'] = gang_zhao_liu_xi
|
|
|
|
|
_data['special_peng_peng_hu'] = special_peng_peng_hu
|
|
|
|
|
if (piao_fen == 0) then
|
|
|
|
|
_data["piao_fen"] = 1
|
|
|
|
|
elseif (piao_fen == 1) then
|
|
|
|
|
_data["piao_fen"] = 2
|
|
|
|
|
elseif (piao_fen == 2) then
|
|
|
|
|
_data["piao_fen"] = 3
|
|
|
|
|
elseif (piao_fen == 3) then
|
|
|
|
|
_data["piao_fen"] = 5
|
|
|
|
|
end
|
2025-06-19 23:51:18 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
local xi_pai = false
|
|
|
|
|
if oldGameVersion == 2 then
|
|
|
|
|
if _config:GetChild("xipai") then
|
2025-05-24 14:29:14 +08:00
|
|
|
xi_pai = _config:GetChild("xipai").selected
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
_data['xi_pai'] = xi_pai
|
|
|
|
|
|
2025-06-19 23:51:18 +08:00
|
|
|
local xi_pai_score = 0
|
|
|
|
|
local an_chou_score = 0
|
|
|
|
|
|
|
|
|
|
if oldGameVersion == 2 then
|
|
|
|
|
xi_pai_score = self.xipaiValue
|
|
|
|
|
an_chou_score = self.anchouValue
|
2025-05-24 14:29:14 +08:00
|
|
|
end
|
2025-06-19 23:51:18 +08:00
|
|
|
|
|
|
|
|
_data['xi_pai_score'] = xi_pai_score * 100
|
|
|
|
|
_data['an_chou_score'] = an_chou_score * 100
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return _data
|
2025-05-24 14:29:14 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function M:LoadConfigData(data)
|
2025-06-19 23:51:18 +08:00
|
|
|
local _config = self._config
|
2025-05-24 14:29:14 +08:00
|
|
|
|
2025-06-19 23:51:18 +08:00
|
|
|
_config:GetController('play_list').selectedIndex = data.maxPlayers - 2
|
|
|
|
|
_config:GetController('round').selectedIndex = data.opt == 1 and 0 or 1
|
|
|
|
|
_config:GetController('zhuangjia').selectedIndex = data.xuan_zhuang
|
|
|
|
|
_config:GetController('piao').selectedIndex = data.piao
|
|
|
|
|
_config:GetChild('pf1').selected = data.piao1
|
|
|
|
|
_config:GetChild('pf2').selected = data.piao2
|
|
|
|
|
_config:GetChild('pf3').selected = data.piao3
|
|
|
|
|
_config:GetChild('pf4').selected = data.piao4
|
2025-05-24 14:29:14 +08:00
|
|
|
|
|
|
|
|
if (data.piao_fen == 1) then
|
|
|
|
|
_config:GetController('piaofen').selectedIndex = 0
|
|
|
|
|
elseif (data.piao_fen == 2) then
|
|
|
|
|
_config:GetController('piaofen').selectedIndex = 1
|
|
|
|
|
elseif (data.piao_fen == 3) then
|
|
|
|
|
_config:GetController('piaofen').selectedIndex = 2
|
|
|
|
|
elseif (data.piao_fen == 5) then
|
|
|
|
|
_config:GetController('piaofen').selectedIndex = 3
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
2025-06-19 23:51:18 +08:00
|
|
|
|
|
|
|
|
_config:GetController('fen').selectedIndex = data.fen_diejia
|
|
|
|
|
|
|
|
|
|
_config:GetController('qinzuihu').selectedIndex = data.qing_zui_hu
|
2025-05-24 14:29:14 +08:00
|
|
|
_config:GetChild('gangzhao').selected = data.gang_zhao_liu_xi
|
2025-06-19 23:51:18 +08:00
|
|
|
_config:GetChild('pengpenghu').selected = data.special_peng_peng_hu
|
|
|
|
|
|
|
|
|
|
if _config:GetChild("xipai") then
|
|
|
|
|
_config:GetChild("xipai").selected = data.xi_pai
|
2025-05-24 14:29:14 +08:00
|
|
|
end
|
|
|
|
|
|
2025-06-19 23:51:18 +08:00
|
|
|
if oldGameVersion == 2 then
|
|
|
|
|
self.xipaiValueText.text = data.xi_pai_score / 100
|
|
|
|
|
self.xipaiValue = data.xi_pai_score / 100
|
|
|
|
|
|
|
|
|
|
self.anchouValueText.text = data.an_chou_score / 100
|
|
|
|
|
self.anchouValue = data.an_chou_score / 100
|
2025-05-24 14:29:14 +08:00
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function M:OnChangeOption(ctype)
|
2025-06-19 23:51:18 +08:00
|
|
|
IGameInfo.OnChangeOption(self, ctype)
|
|
|
|
|
|
|
|
|
|
local play_list = self._config:GetController('play_list')
|
|
|
|
|
play_list.onChanged:Add(
|
|
|
|
|
function()
|
|
|
|
|
self._maxPlayer = play_list.selectedIndex + 2
|
|
|
|
|
self:ShowVariablePrice(ctype)
|
|
|
|
|
end
|
|
|
|
|
)
|
2025-05-24 14:29:14 +08:00
|
|
|
end
|
2025-06-19 23:51:18 +08:00
|
|
|
|
2025-05-24 14:29:14 +08:00
|
|
|
return M
|