dezhou_client/lua_probject/extend_project/extend/poker/tuolaji/EXGameInfo.lua

81 lines
2.2 KiB
Lua
Raw Normal View History

2025-12-17 21:08:27 +08:00
---
--- Created by 谌建军.
--- DateTime: 2017/12/18 15:19
---
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/poker/tuolaji/ui/Info_Poker_Tuolaji")
return self
end
function M:FillData(view, index)
self._maxPlayer = 4 -- 默认玩家人数
self._roundChoice = 3 -- 回合选项数
self._config = UIPackage.CreateObjectFromURL("ui://Info_Poker_Tuolaji/Creat_Tuolaji")
end
local _help_url = "ui://Info_Poker_Tuolaji/Com_help"
function M:GetHelpUrl()
return _help_url
end
local _icon_url = "ui://Info_Poker_Tuolaji/icontest"
function M:GetIconUrl()
return _icon_url
end
local _icon_url1 = "ui://Info_Poker_Tuolaji/icon1test"
function M:GetIconUrl1()
return _icon_url1
end
local _play_list = {"拖拉机"}
function M:GetPlayList()
return _play_list
end
function M:LoadConfigData(data)
local _config = self._config
_config:GetController("round").selectedIndex = data.opt - 1
_config:GetController("limit").selectedIndex = data.limit - 1
_config:GetController("reviewcard").selectedIndex = data.reviewCard
_config:GetController("fangzuobi").selectedIndex = data.isHidden
end
function M:SelectedConfigData()
local _config = self._config
local round = _config:GetController("round").selectedIndex
local limit = _config:GetController("limit").selectedIndex
local reviewcard = _config:GetController("reviewcard").selectedIndex
local isHidden = _config:GetController("fangzuobi").selectedIndex
local _data = {}
_data["account_id"] = DataManager.SelfUser.Id
_data["opt"] = round + 1
_data["limit"] = limit + 1
_data["reviewCard"] = reviewcard
_data["zhu"] = 0
_data["pai"] = 2
_data["zhuang"] = 1
_data["isHidden"] = isHidden
_data["friend"] = 1
return _data
end
function M:OnChangeOption(ctype, pay_obj)
IGameInfo.OnChangeOption(self, ctype, pay_obj)
local people = self._config:GetController("player_num")
people.onChanged:Set(function()
self._maxPlayer = people.selectedIndex + 2
self:ShowVariablePrice(ctype, pay_obj)
end)
end
return M