117 lines
2.6 KiB
Lua
117 lines
2.6 KiB
Lua
local EXGameInfo = {}
|
|
|
|
local M = EXGameInfo
|
|
|
|
|
|
function EXGameInfo.new(blur_view)
|
|
setmetatable(M, {__index = IGameInfo})
|
|
local self = setmetatable({}, {__index = M})
|
|
self.class = "EXGameInfo"
|
|
UIPackage.AddPackage("extend/majiang/qizhiba/ui/Info_MJ_QiZhiBa")
|
|
return self
|
|
end
|
|
|
|
function M:FillData()
|
|
self._maxPlayer = 4 -- 默认玩家人数
|
|
self._roundChoice = 3 -- 回合选项数
|
|
self._config = UIPackage.CreateObjectFromURL("ui://Info_MJ_QiZhiBa/Cgm_create_room")
|
|
end
|
|
|
|
local _help_url= "ui://Info_MJ_QiZhiBa/Com_help"
|
|
function M:GetHelpUrl()
|
|
return _help_url
|
|
end
|
|
|
|
local _icon_url = "ui://Info_MJ_QiZhiBa/icon"
|
|
function M:GetIconUrl()
|
|
return _icon_url
|
|
end
|
|
|
|
local _icon_url1 = "ui://Info_MJ_QiZhiBa/icon1"
|
|
function M:GetIconUrl1()
|
|
return _icon_url1
|
|
end
|
|
|
|
local _play_list ={} --{"七支八-4","七支八-3","七支八-2"}
|
|
function M:GetPlayList()
|
|
return _play_list
|
|
end
|
|
|
|
function M:SelectedConfigData()
|
|
local _config = self._config
|
|
local round = _config:GetController("round").selectedIndex + 1
|
|
local people = _config:GetController("play_list").selectedIndex+2
|
|
|
|
local laizi=_config:GetController("GuiType").selectedIndex
|
|
local zhama=_config:GetController("zhama").selectedIndex
|
|
local niao=0
|
|
local niao_opt=0
|
|
if zhama>0 and zhama<5 then
|
|
niao=1
|
|
niao_opt=zhama
|
|
end
|
|
|
|
|
|
|
|
|
|
local lian_zhuang=_config:GetChild("btn_lianzhuang").selected and true or false
|
|
local must_hu=_config:GetChild("btn_zidonghu").selected and true or false
|
|
local chipai=_config:GetChild("btn_chipai").selected and true or false
|
|
|
|
|
|
|
|
------
|
|
local _data = {}
|
|
_data["opt"] = round
|
|
_data["maxPlayers"] = people
|
|
|
|
_data["laizi"] = laizi
|
|
_data["niao"] = niao
|
|
_data["niao_opt"] = niao_opt
|
|
|
|
|
|
|
|
_data["lian_zhuang"] = lian_zhuang
|
|
_data["zi_dong_hu"] = must_hu
|
|
_data["chipai"] = chipai
|
|
|
|
--printlog("上传房间配置==========>>>")
|
|
--pt(_data)
|
|
|
|
return _data
|
|
end
|
|
|
|
function M:LoadConfigData(data)
|
|
--printlog("加载房间配置=========>>>")
|
|
--pt(data)
|
|
local _config = self._config
|
|
_config:GetController("round").selectedIndex = data.opt -1
|
|
_config:GetController("play_list").selectedIndex = data.maxPlayers-2
|
|
|
|
_config:GetController("GuiType").selectedIndex = data.laizi
|
|
|
|
|
|
local GuiTypeValue=0
|
|
if data.niao ==0 then
|
|
GuiTypeValue=0
|
|
elseif data.niao ==1 then
|
|
GuiTypeValue=data.niao_opt
|
|
end
|
|
|
|
_config:GetController("zhama").selectedIndex = GuiTypeValue
|
|
|
|
|
|
_config:GetChild("btn_lianzhuang").selected = data.lian_zhuang or false
|
|
_config:GetChild("btn_zidonghu").selected = data.zi_dong_hu or false
|
|
_config:GetChild("btn_chipai").selected = data.chipai or false
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
return M
|
|
|