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/yueyangwaihuzi/ui/Info_Poker_YueYangWHZ')
|
|
|
|
|
return self
|
2025-05-24 14:29:14 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function M:FillData()
|
2025-06-19 23:51:18 +08:00
|
|
|
self._maxPlayer = 3 -- 默认玩家人数
|
|
|
|
|
self._roundChoice = 2 -- 回合选项数
|
|
|
|
|
self._config = UIPackage.CreateObjectFromURL('ui://Info_Poker_YueYangWHZ/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.xipaiValue = 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
|
|
|
end
|
|
|
|
|
end
|
2025-06-19 23:51:18 +08:00
|
|
|
|
2025-05-24 14:29:14 +08:00
|
|
|
local _help_url = 'ui://Info_Poker_YueYangWHZ/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_YueYangWHZ/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_YueYangWHZ/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 kawai = _config:GetController('kawai').selectedIndex
|
|
|
|
|
local piao = _config:GetController('piao').selectedIndex
|
|
|
|
|
local first_rand_zhuang = _config:GetChild('suijizhuang').selected and true or false
|
|
|
|
|
local zhuang_di_hu = _config:GetController('zdihu').selectedIndex
|
|
|
|
|
local hao_config = _config:GetController('hao').selectedIndex
|
|
|
|
|
local hao_jiabei = _config:GetController('jiabei').selectedIndex
|
|
|
|
|
local ming_tang = _config:GetController('mingtang').selectedIndex
|
|
|
|
|
local qupai = 0
|
|
|
|
|
if renshu == 2 then
|
|
|
|
|
qupai = _config:GetController('qupai').selectedIndex
|
2025-05-24 14:29:14 +08:00
|
|
|
end
|
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['kawai'] = kawai
|
|
|
|
|
_data['piao'] = piao
|
|
|
|
|
_data['zhuang_di_hu'] = zhuang_di_hu
|
|
|
|
|
_data['hao_config'] = hao_config
|
|
|
|
|
_data['hao_jiabei'] = hao_jiabei
|
|
|
|
|
_data['ming_tang'] = ming_tang
|
|
|
|
|
_data['first_rand_zhuang'] = first_rand_zhuang
|
|
|
|
|
_data['qupai'] = qupai
|
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
|
|
|
|
|
if oldGameVersion == 2 then
|
|
|
|
|
xi_pai_score = self.xipaiValue
|
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
|
|
|
_data['xi_pai_score'] = xi_pai_score
|
2025-06-19 23:51:18 +08:00
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
_config:GetController('play_list').selectedIndex = data.maxPlayers - 2
|
|
|
|
|
_config:GetController('round').selectedIndex = data.opt == 1 and 0 or 1
|
|
|
|
|
_config:GetController('kawai').selectedIndex = data.kawai
|
|
|
|
|
_config:GetController('piao').selectedIndex = data.piao
|
|
|
|
|
_config:GetChild('suijizhuang').selected = data.first_rand_zhuang
|
|
|
|
|
_config:GetController('zdihu').selectedIndex = data.zhuang_di_hu
|
|
|
|
|
_config:GetController('hao').selectedIndex = data.hao_config
|
|
|
|
|
_config:GetController('jiabei').selectedIndex = data.hao_jiabei
|
|
|
|
|
_config:GetController('mingtang').selectedIndex = data.ming_tang
|
|
|
|
|
_config:GetController('qupai').selectedIndex = data.qupai
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
self.xipaiValue = data.xi_pai_score
|
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
|