2025-11-17 18:55:00 +08:00
|
|
|
local EXGameInfo = {}
|
|
|
|
|
|
|
|
|
|
local M = EXGameInfo
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function EXGameInfo.new(blur_view)
|
2025-11-18 18:49:01 +08:00
|
|
|
setmetatable(M, { __index = IGameInfo })
|
|
|
|
|
local self = setmetatable({}, { __index = M })
|
|
|
|
|
self.class = "EXGameInfo"
|
|
|
|
|
|
|
|
|
|
UIPackage.AddPackage("extend/majiang/changsha/ui/Info_MJ_ChangSha")
|
|
|
|
|
return self
|
2025-11-17 18:55:00 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function M:FillData()
|
2025-11-18 18:49:01 +08:00
|
|
|
self._maxPlayer = 4 -- 默认玩家人数
|
|
|
|
|
self._roundChoice = 4 -- 回合选项数
|
|
|
|
|
if oldGameVersion == 1 then
|
2025-11-17 18:55:00 +08:00
|
|
|
self._config = UIPackage.CreateObjectFromURL("ui://Info_MJ_ChangSha/Cgm_create_room")
|
|
|
|
|
else
|
|
|
|
|
self._config = UIPackage.CreateObjectFromURL("ui://Info_MJ_ChangSha/Cgm_create_room_yueyang")
|
|
|
|
|
end
|
2025-11-18 18:49:01 +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-11-17 18:55:00 +08:00
|
|
|
|
|
|
|
|
local btn_cr = self._config:GetChild('sdsrbtn')
|
2025-11-18 18:49:01 +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 / 1000
|
|
|
|
|
self.xipaiValue = value / 1000
|
|
|
|
|
end, 3, nil)
|
|
|
|
|
gniv:Show()
|
|
|
|
|
end
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
local btn_cr2 = self._config:GetChild('anchoubtn')
|
|
|
|
|
btn_cr2.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.anchouValueText.text = value / 1000
|
|
|
|
|
self.anchouValue = value / 1000
|
|
|
|
|
end, 3, nil)
|
|
|
|
|
gniv:Show()
|
|
|
|
|
end
|
|
|
|
|
)
|
2025-11-17 18:55:00 +08:00
|
|
|
end
|
2025-11-18 18:49:01 +08:00
|
|
|
end
|
2025-11-17 18:55:00 +08:00
|
|
|
|
2025-11-18 18:49:01 +08:00
|
|
|
local _help_url = "ui://Info_MJ_ChangSha/Com_help"
|
2025-11-17 18:55:00 +08:00
|
|
|
function M:GetHelpUrl()
|
2025-11-18 18:49:01 +08:00
|
|
|
return _help_url
|
2025-11-17 18:55:00 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
local _icon_url = "ui://Info_MJ_ChangSha/icon"
|
|
|
|
|
function M:GetIconUrl()
|
2025-11-18 18:49:01 +08:00
|
|
|
return _icon_url
|
2025-11-17 18:55:00 +08:00
|
|
|
end
|
|
|
|
|
|
2025-11-18 18:49:01 +08:00
|
|
|
local _icon_url1 = "ui://NewGroup/group_changsha"
|
2025-11-17 18:55:00 +08:00
|
|
|
function M:GetIconUrl1()
|
2025-11-18 18:49:01 +08:00
|
|
|
return _icon_url1
|
2025-11-17 18:55:00 +08:00
|
|
|
end
|
|
|
|
|
|
2025-11-18 18:49:01 +08:00
|
|
|
local _play_list = {} --{"长沙麻将","三人长沙","二人长沙"}
|
2025-11-17 18:55:00 +08:00
|
|
|
function M:GetPlayList()
|
2025-11-18 18:49:01 +08:00
|
|
|
return _play_list
|
2025-11-17 18:55:00 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function M:SelectedConfigData()
|
2025-11-18 18:49:01 +08:00
|
|
|
local _config = self._config
|
|
|
|
|
local round = _config:GetController("round").selectedIndex + 1 --== 0 and 1 or 2
|
|
|
|
|
self._maxPlayer = _config:GetController("play_list").selectedIndex + 2
|
|
|
|
|
|
|
|
|
|
local zhuangxian = _config:GetChild("btn_zhuangxian").selected and true or false
|
|
|
|
|
-- local piaofen = _config:GetChild("btn_piaofen").selected and true or false
|
|
|
|
|
local zimo = _config:GetChild("btn_zimo").selected and true or false
|
|
|
|
|
local AA = _config:GetController("Cost").selectedIndex
|
|
|
|
|
-- local liuliushun = _config:GetChild("btn_liuliushun").selected and true or false
|
|
|
|
|
-- local queyise = _config:GetChild("btn_queyise").selected and true or false
|
|
|
|
|
-- local banbanhu = _config:GetChild("btn_banbanhu").selected and true or false
|
|
|
|
|
-- local dasixi = _config:GetChild("btn_dasixi").selected and true or false
|
|
|
|
|
local jiejiegao = _config:GetChild("btn_jiejiegao").selected and true or false
|
|
|
|
|
local santong = _config:GetChild("btn_santong").selected and true or false
|
|
|
|
|
local yizhihua = _config:GetChild("btn_yizhihua").selected and true or false
|
|
|
|
|
local zhongtusixi = _config:GetChild("btn_zhongtusixi").selected and true or false
|
|
|
|
|
local zhongtuliuliushun = _config:GetChild("btn_zhongtuliuliushun").selected and true or false
|
|
|
|
|
|
|
|
|
|
local niao_type = _config:GetController("niao").selectedIndex
|
|
|
|
|
local niao_num = _config:GetController("niao_num").selectedIndex
|
|
|
|
|
local niao_db_num = _config:GetController("niao_db_num").selectedIndex
|
|
|
|
|
local niao = niao_type == 1 and (niao_db_num == 0 and 1 or 2) or
|
|
|
|
|
(niao_type == 0 and (niao_num == 0 and 2 or (niao_num == 1 and 4 or 6)) or 2)
|
|
|
|
|
local piao_niao = _config:GetChild("btn_piao_niao").selected
|
|
|
|
|
local two_pair = _config:GetChild("btn_two_pair").selected
|
|
|
|
|
local no_jiang = _config:GetChild("btn_no_jiang").selected
|
|
|
|
|
local four_win = _config:GetChild("btn_four_win").selected
|
|
|
|
|
local native_hu = _config:GetChild("btn_native_hu").selected
|
|
|
|
|
local queyimen = _config:GetChild("btn_queyimen").selected
|
|
|
|
|
local fengding = _config:GetChild("btn_fengding").selected
|
|
|
|
|
local banyiquan = _config:GetChild("btn_banyiquan").selected
|
|
|
|
|
local menqing = _config:GetChild("btn_menqing").selected
|
|
|
|
|
|
|
|
|
|
local fengding_score = 0
|
|
|
|
|
if _config:GetController("fengding") then
|
|
|
|
|
fengding_score = _config:GetController("fengding").selectedIndex
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
local piao_niao1 = 0
|
2025-11-17 18:55:00 +08:00
|
|
|
if _config:GetController('piao') then
|
2025-11-18 18:49:01 +08:00
|
|
|
piao_niao1 = _config:GetController('piao').selectedIndex
|
2025-11-17 18:55:00 +08:00
|
|
|
end
|
2025-11-18 18:49:01 +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
|
|
|
|
|
|
|
|
|
|
local xi_pai = false
|
|
|
|
|
local xi_paifen = 0
|
2025-11-17 18:55:00 +08:00
|
|
|
if _config:GetChild("xipai") then
|
2025-11-18 18:49:01 +08:00
|
|
|
xi_pai = _config:GetChild("xipai").selected
|
2025-11-17 18:55:00 +08:00
|
|
|
end
|
2025-11-18 18:49:01 +08:00
|
|
|
|
|
|
|
|
local niaofen_opt = 0
|
|
|
|
|
local niaofen_score = 1
|
|
|
|
|
local difen_score = 1
|
|
|
|
|
local kai_gong = 0
|
|
|
|
|
if oldGameVersion == 2 then
|
|
|
|
|
niaofen_opt = _config:GetController("niaoadd").selectedIndex
|
|
|
|
|
niaofen_score = tonumber(_config:GetController("niaodf").selectedPage)
|
|
|
|
|
difen_score = tonumber(_config:GetController("jcdifen").selectedPage)
|
|
|
|
|
kai_gong = _config:GetController("kaigang").selectedIndex
|
2025-11-17 18:55:00 +08:00
|
|
|
end
|
2025-11-18 18:49:01 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
---------
|
|
|
|
|
local _data = {}
|
|
|
|
|
_data["opt"] = round
|
|
|
|
|
_data["maxPlayers"] = self._maxPlayer
|
|
|
|
|
|
|
|
|
|
_data["zhuangxian"] = zhuangxian
|
|
|
|
|
_data["zimo"] = zimo
|
|
|
|
|
_data["AA"] = AA
|
|
|
|
|
-- _data["piaofen"] = piaofen
|
|
|
|
|
-- _data["liuliushun"] = liuliushun
|
|
|
|
|
-- _data["queyise"] = queyise
|
|
|
|
|
-- _data["banbanhu"] = banbanhu
|
|
|
|
|
-- _data["dasixi"] = dasixi
|
|
|
|
|
_data["jiejiegao"] = jiejiegao
|
|
|
|
|
_data["santong"] = santong
|
|
|
|
|
_data["yizhihua"] = yizhihua
|
|
|
|
|
_data["zhongtusixi"] = zhongtusixi
|
|
|
|
|
_data["zhongtuliuliushun"] = zhongtuliuliushun
|
|
|
|
|
|
|
|
|
|
_data["niao_type"] = niao_type
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if oldGameVersion == 1 then
|
2025-11-17 18:55:00 +08:00
|
|
|
_data["niao"] = niao
|
|
|
|
|
else
|
|
|
|
|
_data["niao"] = tonumber(_config:GetController("niao_num").selectedPage)
|
|
|
|
|
end
|
2025-11-18 18:49:01 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
if oldGameVersion == 1 then
|
2025-11-17 18:55:00 +08:00
|
|
|
_data["piao_niao"] = piao_niao
|
|
|
|
|
else
|
|
|
|
|
_data["piao_niao"] = piao_niao1
|
|
|
|
|
end
|
2025-11-18 18:49:01 +08:00
|
|
|
_data["two_pair"] = two_pair
|
|
|
|
|
_data["no_jiang"] = no_jiang
|
|
|
|
|
_data["four_win"] = four_win
|
|
|
|
|
_data["native_hu"] = native_hu
|
|
|
|
|
_data["queyimen"] = queyimen
|
|
|
|
|
_data["fengding"] = fengding
|
|
|
|
|
_data["banyiquan"] = banyiquan
|
|
|
|
|
_data["menqing"] = menqing
|
2025-11-17 18:55:00 +08:00
|
|
|
_data["fengding_score"] = fengding_score
|
|
|
|
|
--_data['piao'] = piao
|
|
|
|
|
_data['piao1'] = piao1
|
|
|
|
|
_data['piao2'] = piao2
|
|
|
|
|
_data['piao3'] = piao3
|
2025-11-18 18:49:01 +08:00
|
|
|
|
|
|
|
|
auto_piao = false
|
|
|
|
|
if piao_niao1 == 2 then
|
2025-11-17 18:55:00 +08:00
|
|
|
if piao1 or piao2 or piao3 then
|
2025-11-18 18:49:01 +08:00
|
|
|
auto_piao = true
|
2025-11-17 18:55:00 +08:00
|
|
|
end
|
|
|
|
|
end
|
2025-11-18 18:49:01 +08:00
|
|
|
|
|
|
|
|
if oldGameVersion == 2 then
|
2025-11-17 18:55:00 +08:00
|
|
|
_data['auto_piao'] = auto_piao
|
|
|
|
|
end
|
2025-11-18 18:49:01 +08:00
|
|
|
|
2025-11-17 18:55:00 +08:00
|
|
|
_data['xi_pai'] = xi_pai
|
|
|
|
|
_data['piao_niao_opt'] = piao_niao_opt
|
2025-11-18 18:49:01 +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-11-17 18:55:00 +08:00
|
|
|
end
|
2025-11-18 18:49:01 +08:00
|
|
|
|
|
|
|
|
_data['xi_pai_score'] = xi_pai_score * 1000
|
|
|
|
|
_data['an_chou_score'] = an_chou_score * 1000
|
|
|
|
|
|
|
|
|
|
if oldGameVersion == 2 then
|
2025-11-17 18:55:00 +08:00
|
|
|
_data['niaofen_opt'] = niaofen_opt
|
|
|
|
|
_data['niaofen_score'] = niaofen_score
|
|
|
|
|
_data['difen_score'] = difen_score
|
|
|
|
|
_data['kai_gong'] = kai_gong
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
2025-11-18 18:49:01 +08:00
|
|
|
pt(_data)
|
|
|
|
|
return _data
|
|
|
|
|
end
|
2025-11-17 18:55:00 +08:00
|
|
|
|
|
|
|
|
function M:LoadConfigData(data)
|
|
|
|
|
pt(data)
|
2025-11-18 18:49:01 +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_zhuangxian").selected = data.zhuangxian
|
|
|
|
|
_config:GetChild("btn_zimo").selected = data.zimo
|
|
|
|
|
_config:GetController("Cost").selectedIndex = data.AA
|
|
|
|
|
-- _config:GetChild("btn_piaofen").selected = data.piaofen
|
|
|
|
|
-- _config:GetChild("btn_liuliushun").selected = data.liuliushun
|
|
|
|
|
-- _config:GetChild("btn_queyise").selected = data.queyise
|
|
|
|
|
-- _config:GetChild("btn_banbanhu").selected = data.banbanhu
|
|
|
|
|
-- _config:GetChild("btn_dasixi").selected = data.dasixi
|
|
|
|
|
_config:GetChild("btn_jiejiegao").selected = data.jiejiegao
|
|
|
|
|
_config:GetChild("btn_santong").selected = data.santong
|
|
|
|
|
_config:GetChild("btn_yizhihua").selected = data.yizhihua
|
|
|
|
|
_config:GetChild("btn_zhongtusixi").selected = data.zhongtusixi
|
|
|
|
|
_config:GetChild("btn_zhongtuliuliushun").selected = data.zhongtuliuliushun
|
|
|
|
|
|
|
|
|
|
_config:GetController("niao").selectedIndex = data.niao_type
|
|
|
|
|
|
|
|
|
|
if oldGameVersion == 1 then
|
|
|
|
|
_config:GetController("niao_num").selectedIndex = data.niao_type ~= 0 and 0 or
|
|
|
|
|
(data.niao == 4 and 1 or (data.niao == 6 and 2 or 0))
|
2025-11-17 18:55:00 +08:00
|
|
|
else
|
2025-11-18 18:49:01 +08:00
|
|
|
_config:GetController("niao_num").selectedIndex = data.niao / 2 - 1
|
2025-11-17 18:55:00 +08:00
|
|
|
end
|
2025-11-18 18:49:01 +08:00
|
|
|
_config:GetController("niao_db_num").selectedIndex = data.niao_type ~= 1 and 0 or (data.niao == 1 and 0 or 1)
|
|
|
|
|
if oldGameVersion == 1 then
|
2025-11-17 18:55:00 +08:00
|
|
|
_config:GetChild("btn_piao_niao").selected = data.piao_niao
|
|
|
|
|
end
|
2025-11-18 18:49:01 +08:00
|
|
|
_config:GetChild("btn_two_pair").selected = data.two_pair
|
|
|
|
|
_config:GetChild("btn_no_jiang").selected = data.no_jiang
|
|
|
|
|
_config:GetChild("btn_four_win").selected = data.four_win
|
|
|
|
|
_config:GetChild("btn_native_hu").selected = data.native_hu
|
|
|
|
|
_config:GetChild("btn_queyimen").selected = data.queyimen
|
|
|
|
|
_config:GetChild("btn_fengding").selected = data.fengding or false
|
|
|
|
|
_config:GetChild("btn_banyiquan").selected = data.banyiquan or false
|
|
|
|
|
_config:GetChild("btn_menqing").selected = data.menqing or false
|
|
|
|
|
|
|
|
|
|
if _config:GetController("fengding") then
|
|
|
|
|
_config:GetController("fengding").selectedIndex = data.fengding_score
|
2025-11-17 18:55:00 +08:00
|
|
|
end
|
2025-11-18 18:49:01 +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
|
2025-11-17 18:55:00 +08:00
|
|
|
end
|
2025-11-18 18:49:01 +08:00
|
|
|
|
|
|
|
|
if _config:GetChild("xipai") then
|
|
|
|
|
_config:GetChild("xipai").selected = data.xi_pai
|
2025-11-17 18:55:00 +08:00
|
|
|
end
|
2025-11-18 18:49:01 +08:00
|
|
|
|
|
|
|
|
if _config:GetController("piaofen") then
|
|
|
|
|
_config:GetController("piaofen").selectedIndex = data.piao_niao_opt
|
2025-11-17 18:55:00 +08:00
|
|
|
end
|
|
|
|
|
|
2025-11-18 18:49:01 +08:00
|
|
|
if oldGameVersion == 2 then
|
|
|
|
|
self.xipaiValueText.text = data.xi_pai_score / 1000
|
|
|
|
|
self.xipaiValue = data.xi_pai_score / 1000
|
|
|
|
|
|
|
|
|
|
self.anchouValueText.text = data.an_chou_score / 1000
|
|
|
|
|
self.anchouValue = data.an_chou_score / 1000
|
2025-11-17 18:55:00 +08:00
|
|
|
end
|
2025-11-18 18:49:01 +08:00
|
|
|
|
|
|
|
|
if oldGameVersion == 2 then
|
|
|
|
|
_config:GetController("niaoadd").selectedIndex = data.niaofen_opt or 0
|
|
|
|
|
_config:GetController("niaodf").selectedIndex = data.niaofen_score - 1
|
|
|
|
|
_config:GetController("jcdifen").selectedIndex = data.difen_score - 1
|
|
|
|
|
_config:GetController("kaigang").selectedIndex = data.kai_gong
|
2025-11-17 18:55:00 +08:00
|
|
|
end
|
2025-11-18 18:49:01 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
return M
|