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/zipai/changdepaohuzi/ui/Extend_Poker_ChangdeWHZ') UIPackage.AddPackage('extend/zipai/changdepaohuzi/ui/Info_Poker_ChangdeWHZ') return self end function M:FillData() self._maxPlayer = 3 -- 默认玩家人数 self._roundChoice = 3 -- 回合选项数 self._config = UIPackage.CreateObjectFromURL('ui://Extend_Poker_ChangdeWHZ/Cgm_create_room') if oldGameVersion == 1 then self._config:GetChild("xipai").visible = false end if oldGameVersion == 2 then self._config:GetController("xipai").selectedIndex = 1 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 local btn_cr = self._config:GetChild('sdsrbtn') 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 ) end local btn_jia = self._config:GetChild('btn_jia') local btn_jian = self._config:GetChild('btn_jian') local btn_jia1 = self._config:GetChild('btn_jia1') local btn_jian1 = self._config:GetChild('btn_jian1') local btn_jia2 = self._config:GetChild('btn_jia2') local btn_jian2 = self._config:GetChild('btn_jian2') -- local fS=self._config:GetChild('btn_round8'):GetChild("title") -- fS.text="1局" -- fS=self._config:GetChild('btn_round16'):GetChild("title") -- fS.text="8局" btn_jia.onClick:Set( function() if self._config:GetController('tun').selectedIndex ~= 5 then self._config:GetController('tun').selectedIndex = self._config:GetController('tun').selectedIndex + 1 end if self._config:GetController('tun').selectedIndex == 5 then btn_jia.touchable = false btn_jia.grayed = true end if self._config:GetController('tun').selectedIndex > 0 then btn_jian.touchable = true btn_jian.grayed = false end end ) btn_jian.onClick:Set( function() if self._config:GetController('tun').selectedIndex ~= 0 then self._config:GetController('tun').selectedIndex = self._config:GetController('tun').selectedIndex - 1 end if self._config:GetController('tun').selectedIndex == 0 then btn_jian.touchable = false btn_jian.grayed = true end if self._config:GetController('tun').selectedIndex < 5 then btn_jia.touchable = true btn_jia.grayed = false end end ) btn_jia1.onClick:Set( function() if self._config:GetController('tun').selectedIndex ~= 5 then self._config:GetController('tun').selectedIndex = self._config:GetController('tun').selectedIndex + 1 end if self._config:GetController('tun').selectedIndex == 5 then btn_jia1.touchable = false btn_jia1.grayed = true end if self._config:GetController('tun').selectedIndex > 0 then btn_jian1.touchable = true btn_jian1.grayed = false end end ) btn_jian1.onClick:Set( function() if self._config:GetController('tun').selectedIndex ~= 0 then self._config:GetController('tun').selectedIndex = self._config:GetController('tun').selectedIndex - 1 end if self._config:GetController('tun').selectedIndex == 0 then btn_jian1.touchable = false btn_jian1.grayed = true end if self._config:GetController('tun').selectedIndex < 5 then btn_jia1.touchable = true btn_jia1.grayed = false end end ) btn_jia2.onClick:Set( function() if self._config:GetController('tun').selectedIndex ~= 5 then self._config:GetController('tun').selectedIndex = self._config:GetController('tun').selectedIndex + 1 end if self._config:GetController('tun').selectedIndex == 5 then btn_jia2.touchable = false btn_jia2.grayed = true end if self._config:GetController('tun').selectedIndex > 0 then btn_jian2.touchable = true btn_jian2.grayed = false end end ) btn_jian2.onClick:Set( function() if self._config:GetController('tun').selectedIndex ~= 0 then self._config:GetController('tun').selectedIndex = self._config:GetController('tun').selectedIndex - 1 end if self._config:GetController('tun').selectedIndex == 0 then btn_jian2.touchable = false btn_jian2.grayed = true end if self._config:GetController('tun').selectedIndex < 5 then btn_jia2.touchable = true btn_jia2.grayed = false end end ) end local _help_url = 'ui://Info_Poker_ChangdeWHZ/Com_help' function M:GetHelpUrl() return _help_url end local _icon_url = "ui://Info_Poker_ChangdeWHZ/icon" function M:GetIconUrl() return _icon_url end local _icon_url1 = "ui://NewGroup/group_paohuzi" function M:GetIconUrl1() return _icon_url1 end local _play_list = { "全名堂", "红黑点", "多红多番" } function M:GetPlayList() return _play_list end function M:SelectedConfigData() local _config = self._config local wanfa_C = _config:GetController('btn_Controller').selectedIndex local round = _config:GetController('round').selectedIndex + 1 --== 0 and 1 or 2 local Cost = _config:GetController('Cost').selectedIndex local tun = _config:GetController('tun').selectedIndex local fengding = _config:GetController('fengding').selectedIndex local tuanyuan = _config:GetController('tuanyuan').selectedIndex local hanghangxi = _config:GetController('hanghangxi').selectedIndex local siqi = _config:GetController('siqi').selectedIndex local shuahou = _config:GetController('shuahou').selectedIndex local huangfan = _config:GetController('huangfan').selectedIndex local jiaxingxing = _config:GetController('jiaxingxing').selectedIndex local tinghu = _config:GetController('tinghu').selectedIndex local duizifu = _config:GetController('duizifu').selectedIndex local back = _config:GetController('Back').selectedIndex local yuan = _config:GetController('yuan').selectedIndex local tianhu = _config:GetController('tianhu').selectedIndex local dihu = _config:GetController('dihu').selectedIndex local haihu = _config:GetController('haihu').selectedIndex local renshu = _config:GetController('renshu').selectedIndex == 0 and 2 or 3 -- local qupai = _config:GetController('qupai').selectedIndex == 1 and true or false local _data = {} _data['opt'] = round -- 1 2 8局 16 局 _data['mode'] = wanfa_C + 1 -- 1 全名堂 2 红黑点 3 多红多番 _data['AA'] = Cost _data['maxPlayers'] = renshu if wanfa_C == 0 then _data['tun'] = tun -- 充囤 0 1 2 3 4 分别是 1 2 3 4 5 _data['fengding'] = fengding -- 封顶 0 1 2 全名堂分别是 不封顶 100封顶 200封顶 _data['tuanyuan'] = tuanyuan -- 大团圆 0 不选 1 选 _data['hanghangxi'] = hanghangxi -- 行行息 0 不选 1 选 _data['shuahou'] = shuahou -- 耍猴 0 不选 1 选 _data['huangfan'] = huangfan -- 黄番 0 不选 1 选 _data['jiaxingxing'] = jiaxingxing -- 假行行 0 不选 1 选 _data['tinghu'] = tinghu -- 听胡 0 不选 1 选 _data['siqi'] = siqi -- 四七红 0 不选 1 选 _data['back'] = back -- 四七红 0 不选 1 选 _data['yuan'] = yuan -- 四七红 0 不选 1 选 elseif wanfa_C == 1 then _data['tun'] = tun -- 充囤 0 1 2 3 4 5 分别是 0 1 2 3 4 5 _data['fengding'] = fengding -- 封顶 0 1 2 红黑点分别是 不封顶 单局20封顶 单局 40封顶 _data['duizifu'] = duizifu -- 对子胡 0 不选 1 选 elseif wanfa_C == 2 then _data['tun'] = tun -- 充囤 0 1 2 3 4 5 分别是 0 1 2 3 4 5 _data['tianhu'] = tianhu _data['dihu'] = dihu _data['haihu'] = haihu _data['tinghu'] = tinghu _data['huangfan'] = huangfan _data['fengding'] = fengding -- 封顶 0 end if renshu == 2 then _data['qupai'] = false end local xi_pai = false if oldGameVersion == 2 then if _config:GetChild("xipai") then xi_pai = _config:GetChild("xipai").selected end end _data['xi_pai'] = xi_pai local xi_pai_score = 0 local an_chou_score = 0 if oldGameVersion == 2 then xi_pai_score = self.xipaiValue an_chou_score = self.anchouValue end _data['xi_pai_score'] = xi_pai_score * 1000 _data['an_chou_score'] = an_chou_score * 1000 _data['xi_pai'] = xi_pai return _data end function M:LoadConfigData(data) local _config = self._config _config:GetController('btn_Controller').selectedIndex = data.mode - 1 _config:GetController('round').selectedIndex = data.opt - 1 --== 1 and 0 or 1 _config:GetController('Cost').selectedIndex = data.AA _config:GetController('renshu').selectedIndex = data.maxPlayers == 2 and 0 or 1 if data.mode == 1 then _config:GetController('tun').selectedIndex = data.tun _config:GetController('fengding').selectedIndex = data.fengding _config:GetController('tuanyuan').selectedIndex = data.tuanyuan _config:GetController('hanghangxi').selectedIndex = data.hanghangxi _config:GetController('siqi').selectedIndex = data.siqi _config:GetController('shuahou').selectedIndex = data.shuahou _config:GetController('huangfan').selectedIndex = data.huangfan _config:GetController('jiaxingxing').selectedIndex = data.jiaxingxing _config:GetController('tinghu').selectedIndex = data.tinghu _config:GetController('Back').selectedIndex = data.back _config:GetController('yuan').selectedIndex = data.yuan elseif data.mode == 2 then _config:GetController('tun').selectedIndex = data.tun _config:GetController('fengding').selectedIndex = data.fengding _config:GetController('duizifu').selectedIndex = data.duizifu elseif data.mode == 3 then _config:GetController('haihu').selectedIndex = 0 _config:GetController('tinghu').selectedIndex = 0 _config:GetController('tianhu').selectedIndex = 0 _config:GetController('dihu').selectedIndex = 0 _config:GetController('huangfan').selectedIndex = 0 _config:GetController('tun').selectedIndex = data.tun _config:GetController('fengding').selectedIndex = data.fengding end if data.maxPlayers == 2 then --_config:GetController('qupai').selectedIndex = data.qupai == true and 1 or 0 end if _config:GetChild("xipai") then _config:GetChild("xipai").selected = data.xi_pai end 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 end end function M:OnChangeOption(ctype) IGameInfo.OnChangeOption(self, ctype) local people = self._config:GetController('renshu') people.onChanged:Set( function() self._maxPlayer = people.selectedIndex == 0 and 2 or 3 self:ShowVariablePrice(ctype) end ) end return M