62 lines
1.6 KiB
Lua
62 lines
1.6 KiB
Lua
---
|
|
--- Created by 谌建军.
|
|
--- DateTime: 2017/12/18 15:19
|
|
---
|
|
local EXGameInfo = {}
|
|
|
|
local M = EXGameInfo
|
|
|
|
local roundTable = { 10, 15, 20 }
|
|
function EXGameInfo.new(blur_view)
|
|
setmetatable(M, { __index = IGameInfo })
|
|
local self = setmetatable({}, { __index = M })
|
|
self.class = "EXGameInfo"
|
|
UIPackage.AddPackage("extend/poker/suoha/ui/Info_Poker_SuoHa")
|
|
return self
|
|
end
|
|
|
|
function M:FillData(view, index)
|
|
self._maxPlayer = 2 -- 默认玩家人数
|
|
self._roundChoice = 5 -- 回合选项数
|
|
|
|
self._config = UIPackage.CreateObjectFromURL("ui://Info_Poker_RunFastNew/Label_Detail_Play")
|
|
|
|
local jiangmaSlider = self._config:GetChild("slider_people")
|
|
jiangmaSlider.onChanged:Set(function()
|
|
self._config:GetChild("text_people").text = string.format("共%s人", Mathf.Round(jiangmaSlider.value))
|
|
end)
|
|
end
|
|
|
|
function M:LoadConfigData(data)
|
|
local _config = self._config
|
|
end
|
|
|
|
function M:SelectedConfigData()
|
|
local _config = self._config
|
|
local round = _config:GetController("round").selectedIndex
|
|
|
|
local peopleNum = Mathf.Round(_config:GetChild("slider_people").value)
|
|
|
|
local _data = {}
|
|
_data["account_id"] = DataManager.SelfUser.Id
|
|
|
|
_data["opt"] = round + 1 --局数
|
|
_data["maxPlayers"] = peopleNum --人数为peopleNum
|
|
_data["min_score"] = 0
|
|
_data["max_score"] = 0
|
|
_data["max_bet"] = 0
|
|
_data["join_score"] = 0
|
|
_data["min_player"] = 0
|
|
_data["base_score"] = 0
|
|
|
|
return _data
|
|
end
|
|
|
|
function M:LoadConfigToDetail(data)
|
|
local configData = json.decode(data)
|
|
local returnString = string.format("人数%s人", configData.maxPlayers)
|
|
return returnString
|
|
end
|
|
|
|
return M
|