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/majiang/zhuanzhuan/ui/Info_MJ_ZhuanZhuan")
|
|
|
|
|
return self
|
2025-05-24 14:29:14 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function M:FillData()
|
2025-06-19 23:51:18 +08:00
|
|
|
self._maxPlayer = 4 -- 默认玩家人数
|
|
|
|
|
self._roundChoice = 4 -- 回合选项数
|
|
|
|
|
|
|
|
|
|
if oldGameVersion == 1 then
|
2025-05-24 14:29:14 +08:00
|
|
|
self._config = UIPackage.CreateObjectFromURL("ui://Info_MJ_ZhuanZhuan/Cgm_create_room")
|
|
|
|
|
else
|
|
|
|
|
self._config = UIPackage.CreateObjectFromURL("ui://Info_MJ_ZhuanZhuan/Cgm_create_room")
|
|
|
|
|
end
|
2025-06-19 23:51:18 +08:00
|
|
|
|
|
|
|
|
if oldGameVersion == 2 then
|
|
|
|
|
self._config:GetController("xipai").selectedIndex = 0
|
|
|
|
|
|
|
|
|
|
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
|
2025-06-19 23:51:18 +08:00
|
|
|
end
|
2025-05-24 14:29:14 +08:00
|
|
|
|
2025-06-19 23:51:18 +08:00
|
|
|
local _help_url = "ui://Info_MJ_ZhuanZhuan/Com_help"
|
2025-05-24 14:29:14 +08:00
|
|
|
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_MJ_ZhuanZhuan/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_MJ_ZhuanZhuan/icon1"
|
|
|
|
|
function M:GetIconUrl1()
|
2025-06-19 23:51:18 +08:00
|
|
|
return _icon_url1
|
2025-05-24 14:29:14 +08:00
|
|
|
end
|
|
|
|
|
|
2025-06-19 23:51:18 +08:00
|
|
|
local _play_list = {} --{"红中麻将","三人红中","二人红中"}
|
2025-05-24 14:29:14 +08:00
|
|
|
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 + 1
|
|
|
|
|
local people = _config:GetController("play_list").selectedIndex + 2
|
|
|
|
|
|
|
|
|
|
local niao_type = _config:GetController("NiaoType").selectedIndex + 1
|
|
|
|
|
local zha_ma = _config:GetController("zha").selectedIndex + 1
|
|
|
|
|
local wo_niao = _config:GetController("wowoniao").selectedIndex + 1
|
|
|
|
|
local aa = _config:GetController("Cost").selectedIndex
|
|
|
|
|
|
2025-05-24 14:29:14 +08:00
|
|
|
local piao_niao = _config:GetChild("btn_piao_niao").selected
|
|
|
|
|
|
|
|
|
|
----------
|
|
|
|
|
-- local piao_niao1=0
|
|
|
|
|
-- if _config:GetController('piao') then
|
|
|
|
|
-- piao_niao1=_config:GetController('piao').selectedIndex
|
2025-06-19 23:51:18 +08:00
|
|
|
-- end
|
2025-05-24 14:29:14 +08:00
|
|
|
-- local piao1=false
|
|
|
|
|
-- local piao2=false
|
|
|
|
|
-- local piao3=false
|
|
|
|
|
-- local piao_niao_opt=0
|
|
|
|
|
-- if piao_niao1==2 then
|
|
|
|
|
-- piao_niao_opt=_config:GetController("piaofen").selectedIndex
|
|
|
|
|
-- end
|
2025-06-19 23:51:18 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
local xi_pai = false
|
|
|
|
|
local xi_paifen = 0
|
2025-05-24 14:29:14 +08:00
|
|
|
if _config:GetChild("xipai") then
|
2025-06-19 23:51:18 +08:00
|
|
|
xi_pai = _config:GetChild("xipai").selected
|
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
|
|
|
-- local fengding_score=0
|
|
|
|
|
-- if _config:GetController("fengding") then
|
|
|
|
|
-- fengding_score=_config:GetController("fengding").selectedIndex
|
2025-06-19 23:51:18 +08:00
|
|
|
-- end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
local dianpao = _config:GetChild("btn_dianpaohu").selected
|
|
|
|
|
local seven_pair = _config:GetChild("btn_qidui").selected
|
|
|
|
|
local laizi = _config:GetChild("btn_hongzhong").selected
|
|
|
|
|
local bi_hu = _config:GetChild("btn_bihu").selected
|
|
|
|
|
local hz_hu = _config:GetChild("btn_wuzhong").selected
|
|
|
|
|
local buzhong = _config:GetChild("btn_buzhongsuanquanzhong").selected
|
|
|
|
|
local zhuangxian = _config:GetChild("btn_zhuangxiansuanfen").selected
|
|
|
|
|
|
|
|
|
|
local qgdp = _config:GetController("qianggang").selectedIndex
|
|
|
|
|
local qianggang_dianpao = false
|
|
|
|
|
if qgdp == 1 then
|
|
|
|
|
qianggang_dianpao = true
|
2025-05-24 14:29:14 +08:00
|
|
|
end
|
|
|
|
|
----------
|
|
|
|
|
|
2025-06-19 23:51:18 +08:00
|
|
|
local _data = {}
|
|
|
|
|
_data["opt"] = round
|
|
|
|
|
_data["maxPlayers"] = people
|
|
|
|
|
|
|
|
|
|
_data["niao"] = niao_type
|
|
|
|
|
if oldGameVersion == 1 then
|
2025-05-24 14:29:14 +08:00
|
|
|
_data["niao_opt"] = niao_type == 2 and 1 or (niao_type == 3 and wo_niao or zha_ma)
|
|
|
|
|
else
|
|
|
|
|
_data["niao_opt"] = niao_type == 2 and 1 or (niao_type == 3 and wo_niao or zha_ma)
|
|
|
|
|
end
|
2025-06-19 23:51:18 +08:00
|
|
|
|
2025-05-24 14:29:14 +08:00
|
|
|
_data["niao_opt_score"] = wo_niao
|
2025-06-19 23:51:18 +08:00
|
|
|
|
2025-05-24 14:29:14 +08:00
|
|
|
|
|
|
|
|
_data["zhuangxian"] = zhuangxian
|
2025-06-19 23:51:18 +08:00
|
|
|
_data["qidui"] = seven_pair
|
2025-05-24 14:29:14 +08:00
|
|
|
_data["hz_hu"] = hz_hu
|
|
|
|
|
_data["dianpao"] = dianpao
|
|
|
|
|
_data["bi_hu"] = bi_hu
|
2025-06-19 23:51:18 +08:00
|
|
|
_data["laizi"] = laizi
|
2025-05-24 14:29:14 +08:00
|
|
|
_data["qianggang_dianpao"] = qianggang_dianpao
|
2025-06-19 23:51:18 +08:00
|
|
|
|
|
|
|
|
_data["AA"] = aa
|
|
|
|
|
|
2025-05-24 14:29:14 +08:00
|
|
|
_data["piao_niao"] = piao_niao
|
|
|
|
|
|
2025-06-19 23:51:18 +08:00
|
|
|
|
2025-05-24 14:29:14 +08:00
|
|
|
-- _data['piao1'] = piao1
|
|
|
|
|
-- _data['piao2'] = piao2
|
|
|
|
|
-- _data['piao3'] = piao3
|
|
|
|
|
|
2025-06-19 23:51:18 +08:00
|
|
|
_data['xi_pai'] = xi_pai
|
|
|
|
|
|
2025-05-24 14:29:14 +08:00
|
|
|
-- auto_piao=false
|
|
|
|
|
-- if piao_niao==2 then
|
|
|
|
|
-- if piao1 or piao2 or piao3 then
|
|
|
|
|
-- auto_piao=true
|
|
|
|
|
-- end
|
|
|
|
|
-- end
|
|
|
|
|
-- _data['auto_piao'] = auto_piao
|
|
|
|
|
-- _data['piao_niao_opt'] = piao_niao_opt
|
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
|
2025-05-24 14:29:14 +08:00
|
|
|
--_data["fengding_score"] = fengding_score
|
|
|
|
|
|
2025-06-19 23:51:18 +08:00
|
|
|
return _data
|
|
|
|
|
end
|
2025-05-24 14:29:14 +08:00
|
|
|
|
|
|
|
|
function M:LoadConfigData(data)
|
2025-06-19 23:51:18 +08:00
|
|
|
local _config = self._config
|
|
|
|
|
_config:GetController("round").selectedIndex = data.opt - 1 -- == 1 and 0 or 1
|
|
|
|
|
_config:GetController("play_list").selectedIndex = data.maxPlayers - 2
|
|
|
|
|
|
|
|
|
|
_config:GetChild("btn_qidui").selected = data.qidui
|
|
|
|
|
_config:GetChild("btn_zhuangxiansuanfen").selected = data.zhuangxian
|
|
|
|
|
_config:GetChild("btn_hongzhong").selected = data.laizi
|
|
|
|
|
_config:GetChild("btn_wuzhong").selected = data.hz_hu
|
|
|
|
|
_config:GetChild("btn_dianpaohu").selected = data.dianpao
|
|
|
|
|
_config:GetChild("btn_bihu").selected = data.bi_hu
|
2025-05-24 14:29:14 +08:00
|
|
|
--_config:GetChild("btn_buzhongsuanquanzhong").selected=data.buzhong
|
2025-06-19 23:51:18 +08:00
|
|
|
|
|
|
|
|
if data.qianggang_dianpao == true then
|
|
|
|
|
_config:GetController("qianggang").selectedIndex = 1
|
2025-05-24 14:29:14 +08:00
|
|
|
else
|
2025-06-19 23:51:18 +08:00
|
|
|
_config:GetController("qianggang").selectedIndex = 0
|
2025-05-24 14:29:14 +08:00
|
|
|
end
|
2025-06-19 23:51:18 +08:00
|
|
|
|
|
|
|
|
_config:GetController("NiaoType").selectedIndex = data.niao - 1
|
|
|
|
|
if data.niao == 1 then
|
|
|
|
|
_config:GetController("zha").selectedIndex = data.niao_opt - 1
|
|
|
|
|
elseif data.niao == 3 then
|
|
|
|
|
_config:GetController("wowoniao").selectedIndex = data.niao_opt - 1
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
_config:GetController("wowoniao").selectedIndex = data.niao_opt_score - 1
|
|
|
|
|
|
|
|
|
|
_config:GetController("Cost").selectedIndex = data.AA or 0
|
|
|
|
|
|
|
|
|
|
_config:GetChild("btn_piao_niao").selected = data.piao_niao
|
|
|
|
|
|
2025-05-24 14:29:14 +08:00
|
|
|
-- if _config:GetController("piao") then
|
|
|
|
|
-- _config:GetController("piao").selectedIndex=data.piao_niao
|
|
|
|
|
-- _config:GetChild('pf1').selected=data.piao1
|
|
|
|
|
-- _config:GetChild('pf2').selected=data.piao2
|
|
|
|
|
-- _config:GetChild('pf3').selected=data.piao3
|
|
|
|
|
-- end
|
2025-06-19 23:51:18 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
2025-05-24 14:29:14 +08:00
|
|
|
-- if _config:GetController("piaofen") then
|
|
|
|
|
-- _config:GetController("piaofen").selectedIndex=data.piao_niao_opt
|
|
|
|
|
-- 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
|
2025-06-19 23:51:18 +08:00
|
|
|
|
2025-05-24 14:29:14 +08:00
|
|
|
-- if _config:GetController("fengding") then
|
|
|
|
|
-- _config:GetController("fengding").selectedIndex=data.fengding_score
|
|
|
|
|
-- end
|
2025-06-19 23:51:18 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
return M
|