84 lines
2.2 KiB
Lua
84 lines
2.2 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/poker2/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_SuoHa/Label_Detail_Play")
|
|
|
|
self.peopleSlider = self._config:GetChild("slider_people")
|
|
self.peopleSlider.onChanged:Set(function()
|
|
self._config:GetChild("text_people").text = string.format("共%s牛马", Mathf.Round(self.peopleSlider.value) + 1)
|
|
end)
|
|
end
|
|
|
|
local _help_url = "ui://Info_Poker_RunFastNew/Com_help"
|
|
function M:GetHelpUrl()
|
|
return _help_url
|
|
end
|
|
|
|
local _icon_url = "ui://Info_Poker_RunFastNew/icon"
|
|
function M:GetIconUrl()
|
|
return _icon_url
|
|
end
|
|
|
|
local _icon_url1 = "ui://Info_Poker_RunFastNew/icon1"
|
|
function M:GetIconUrl1()
|
|
return _icon_url1
|
|
end
|
|
|
|
function M:LoadConfigData(data)
|
|
local _config = self._config
|
|
end
|
|
|
|
function M:SelectedConfigData()
|
|
local _config = self._config
|
|
local round = _config:GetController("round").selectedIndex
|
|
|
|
|
|
local _data = {}
|
|
_data["opt"] = round + 1
|
|
_data["maxPlayers"] = Mathf.Round(self.peopleSlider.value) + 1
|
|
_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:OnChangeOption(ctype, pay_obj)
|
|
-- IGameInfo.OnChangeOption(self, ctype, pay_obj)
|
|
-- local peopleNum = self._config:GetController("peopleNum")
|
|
-- peopleNum.onChanged:Set(function()
|
|
-- self._maxPlayer = peopleNum.selectedIndex == 1 and 2 or 3
|
|
-- self:ShowVariablePrice(ctype, pay_obj)
|
|
-- end)
|
|
-- end
|
|
|
|
function M:LoadConfigToDetail(data)
|
|
local configData = json.decode(data)
|
|
local returnString = string.format("人数%s人", configData.maxPlayers)
|
|
|
|
return returnString
|
|
end
|
|
|
|
return M
|