diff --git a/lua_probject/extend_project/extend/poker/runfast/EXGameInfo.lua b/lua_probject/extend_project/extend/poker/runfast/EXGameInfo.lua index 6db62aec..1d351ea8 100644 --- a/lua_probject/extend_project/extend/poker/runfast/EXGameInfo.lua +++ b/lua_probject/extend_project/extend/poker/runfast/EXGameInfo.lua @@ -6,7 +6,6 @@ local EXGameInfo = {} local M = EXGameInfo -local roundTable = { 10, 15, 20 } function EXGameInfo.new(blur_view) setmetatable(M, { __index = IGameInfo }) local self = setmetatable({}, { __index = M }) @@ -19,49 +18,94 @@ function M:FillData(view, index) self._maxPlayer = 2 -- 默认玩家人数 self._roundChoice = 5 -- 回合选项数 - -- if oldGameVersion == 1 then - self._config = UIPackage.CreateObjectFromURL("ui://Info_Poker_RunFastNew/Label_Detail_Play") - - local com_editSetting = self._config:GetChild("com_editSetting") - - com_editSetting:GetController("cGps").selectedIndex = 2 - - local ctr_round = self._config:GetController("round") - if ctr_round.selectedIndex == 0 then - com_editSetting:GetController("oneRound").selectedIndex = 1 + if oldGameVersion == 1 then + self._config = UIPackage.CreateObjectFromURL("ui://Info_Poker_RunFastNew/Creat_RunFast") else - com_editSetting:GetController("oneRound").selectedIndex = 0 + self._config = UIPackage.CreateObjectFromURL("ui://Info_Poker_RunFastNew/Creat_RunFast_yueyang") end - self._config:GetController("round").onChanged:Set(function() - if ctr_round.selectedIndex == 0 then - com_editSetting:GetController("oneRound").selectedIndex = 1 - else - com_editSetting:GetController("oneRound").selectedIndex = 0 + + + if oldGameVersion == 2 then + self._config:GetController("xipai").selectedIndex = 0 + + 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 / 100 + self.xipaiValue = value / 100 + 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 / 100 + self.anchouValue = value / 100 + end, 3, nil) + gniv:Show() + end + ) + end + + + + self._config:GetChild("people_2").onClick:Set(function() + self._config:GetController("rule").selectedIndex = 0 + end) + + local piao = self._config:GetController("piao") + local daniao = self._config:GetController("daniao") + + piao.onChanged:Add(function() + if piao.selectedIndex ~= 0 then + daniao.selectedIndex = 0 end end) - -- else - -- self._config = UIPackage.CreateObjectFromURL("ui://Info_Poker_RunFastNew/Creat_RunFast_yueyang") - -- end - - -- self._config:GetChild("people_2").onClick:Set(function() - -- self._config:GetController("rule").selectedIndex = 0 - -- end) - - -- local piao = self._config:GetController("piao") - -- local daniao = self._config:GetController("daniao") - - -- piao.onChanged:Add(function() - -- if piao.selectedIndex ~= 0 then - -- daniao.selectedIndex = 0 - -- end - -- end) - - -- daniao.onChanged:Add(function() - -- if daniao.selectedIndex ~= 0 then - -- piao.selectedIndex = 0 - -- end - -- end) + daniao.onChanged:Add(function() + if daniao.selectedIndex ~= 0 then + piao.selectedIndex = 0 + end + end) end local _help_url = "ui://Info_Poker_RunFastNew/Com_help" @@ -71,7 +115,7 @@ end local _icon_url = "ui://Info_Poker_RunFastNew/icon" function M:GetIconUrl() - return "ui://Lobby/paodekuai2", "ui://Lobby/paodekuai1" + return _icon_url end local _icon_url1 = "ui://Info_Poker_RunFastNew/icon1" @@ -86,109 +130,100 @@ end function M:LoadConfigData(data) local _config = self._config - pt(data) _config:GetController("round").selectedIndex = data.opt - 1 - _config:GetController("handcard").selectedIndex = 2 - data.leaf - _config:GetController("peopleNum").selectedIndex = 3 - data.maxPlayers - _config:GetController("showCardNum").selectedIndex = 1 - data.showlength - _config:GetController("wanfa1_1").selectedIndex = data.planeNoBelt - _config:GetController("wanfa1_2").selectedIndex = data.planelack - _config:GetController("wanfa1_3").selectedIndex = data.fourDaiThree and 1 or 0 - _config:GetController("wanfa1_4").selectedIndex = data.heartten - 1 - _config:GetController("wanfa1_5").selectedIndex = 2 - data.rule - _config:GetController("wanfa2_1").selectedIndex = data.specilAdd + _config:GetController("rule").selectedIndex = data.rule == 2 and 0 or 1 + _config:GetController("play_list").selectedIndex = data.leaf - 1 + _config:GetController("willBeOut").selectedIndex = data.willBeOut - 1 + _config:GetController("heart10").selectedIndex = data.heartten - 1 + _config:GetController("bombSpring").selectedIndex = data.minboom - 1 + _config:GetController("player_num").selectedIndex = data.maxPlayers == 2 and 0 or 1 + _config:GetController("Cost").selectedIndex = data.AA == 0 and 0 or 1 + _config:GetController("showlength").selectedIndex = data.showlength + _config:GetController("fourBeltThree").selectedIndex = data.fourBeltThree + _config:GetController("demolition").selectedIndex = data.demolition + _config:GetController("fangzuobi").selectedIndex = data.fangzuobi - -- local sandaidan = data.sandaidan - -- if sandaidan ~= nil and sandaidan == 1 then - -- _config:GetChild("sandaidan").selected = true + local sandaidan = data.sandaidan + if sandaidan ~= nil and sandaidan == 1 then + _config:GetChild("sandaidan").selected = true - -- _config:GetChild("planelack").selected = false - -- _config:GetChild("Threelack").selected = false - -- else - -- _config:GetChild("sandaidan").selected = false + _config:GetChild("planelack").selected = false + _config:GetChild("Threelack").selected = false + else + _config:GetChild("sandaidan").selected = false - -- _config:GetChild("planelack").selected = data.planelack == 1 and true or false - -- _config:GetChild("Threelack").selected = data.threelack == 1 and true or false - -- end + _config:GetChild("planelack").selected = data.planelack == 1 and true or false + _config:GetChild("Threelack").selected = data.threelack == 1 and true or false + end - -- local fs = data.fs - -- if fs ~= nil and fs == 1 then - -- _config:GetChild("fan_sprint").selected = true - -- else - -- _config:GetChild("fan_sprint").selected = false - -- end + local fs = data.fs + if fs ~= nil and fs == 1 then + _config:GetChild("fan_sprint").selected = true + else + _config:GetChild("fan_sprint").selected = false + end - -- local ba = data.ba - -- if ba ~= nil and ba == 1 then - -- _config:GetChild("boom_add").selected = true - -- else - -- _config:GetChild("boom_add").selected = false - -- end + local ba = data.ba + if ba ~= nil and ba == 1 then + _config:GetChild("boom_add").selected = true + else + _config:GetChild("boom_add").selected = false + end - -- _config:GetChild("ThreeA").selected = data.threeA == 1 and true or false + _config:GetChild("ThreeA").selected = data.threeA == 1 and true or false - -- if data.piao ~= nil then - -- _config:GetController("piao").selectedIndex = data.piao - -- end + if data.piao ~= nil then + _config:GetController("piao").selectedIndex = data.piao + end - -- if data.daniao ~= nil then - -- _config:GetController("daniao").selectedIndex = data.daniao - -- end + if data.daniao ~= nil then + _config:GetController("daniao").selectedIndex = data.daniao + end - -- if _config:GetChild("fourBeltThree") then - -- _config:GetChild("fourBeltThree").selected = data.fourDaiTwo - -- end + if _config:GetChild("fourBeltThree") then + _config:GetChild("fourBeltThree").selected = data.fourDaiTwo + end - -- if _config:GetChild("fourBeltTwo") then - -- _config:GetChild("fourBeltTwo").selected = data.fourDaiThree - -- end + if _config:GetChild("fourBeltTwo") then + _config:GetChild("fourBeltTwo").selected = data.fourDaiThree + end - -- if _config:GetChild("xipai") then - -- _config:GetChild("xipai").selected = data.xi_pai - -- 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 + if oldGameVersion == 2 then + self.xipaiValueText.text = data.xi_pai_score / 100 + self.xipaiValue = data.xi_pai_score / 100 - -- self.anchouValueText.text = data.an_chou_score / 1000 - -- self.anchouValue = data.an_chou_score / 1000 - -- end + self.anchouValueText.text = data.an_chou_score / 100 + self.anchouValue = data.an_chou_score / 100 + end end function M:SelectedConfigData() local _config = self._config local round = _config:GetController("round").selectedIndex - local handcard = _config:GetController("handcard").selectedIndex - local peopleNum = _config:GetController("peopleNum").selectedIndex - local showCardNum = _config:GetController("showCardNum").selectedIndex - local wanfa1_1 = _config:GetController("wanfa1_1").selectedIndex - local wanfa1_2 = _config:GetController("wanfa1_2").selectedIndex - local wanfa1_3 = _config:GetController("wanfa1_3").selectedIndex - local wanfa1_4 = _config:GetController("wanfa1_4").selectedIndex - local wanfa1_5 = _config:GetController("wanfa1_5").selectedIndex - local wanfa2_1 = _config:GetController("wanfa2_1").selectedIndex - - -- local rule = _config:GetController("rule").selectedIndex - -- local leaf = _config:GetController("play_list").selectedIndex - -- local willBeOut = _config:GetController("willBeOut").selectedIndex - -- local bombSpring = _config:GetController("bombSpring").selectedIndex - -- local heart10 = _config:GetController("heart10").selectedIndex - -- local player_num = _config:GetController("player_num").selectedIndex - -- local AA = _config:GetController("Cost").selectedIndex - -- local showlength = _config:GetController("showlength").selectedIndex - -- local fourBeltThree = _config:GetController("fourBeltThree").selectedIndex - -- local demolition = _config:GetController("demolition").selectedIndex - -- local fangzuobi = _config:GetController("fangzuobi").selectedIndex - -- local planelack = _config:GetChild("planelack").selected and 1 or 0 - -- local threelack = _config:GetChild("Threelack").selected and 1 or 0 - -- local ThreeA = _config:GetChild("ThreeA").selected and 1 or 0 - -- local piao = _config:GetController("piao").selectedIndex - -- local daniao = _config:GetController("daniao").selectedIndex - -- local sandaidan = _config:GetController("sandaidan").selectedIndex - -- local ba = _config:GetChild("boom_add").selected and 1 or 0 - -- local fs = _config:GetChild("fan_sprint").selected and 1 or 0 + local rule = _config:GetController("rule").selectedIndex + local leaf = _config:GetController("play_list").selectedIndex + local willBeOut = _config:GetController("willBeOut").selectedIndex + local bombSpring = _config:GetController("bombSpring").selectedIndex + local heart10 = _config:GetController("heart10").selectedIndex + local player_num = _config:GetController("player_num").selectedIndex + local AA = _config:GetController("Cost").selectedIndex + local showlength = _config:GetController("showlength").selectedIndex + local fourBeltThree = _config:GetController("fourBeltThree").selectedIndex + local demolition = _config:GetController("demolition").selectedIndex + local fangzuobi = _config:GetController("fangzuobi").selectedIndex + local planelack = _config:GetChild("planelack").selected and 1 or 0 + local threelack = _config:GetChild("Threelack").selected and 1 or 0 + local ThreeA = _config:GetChild("ThreeA").selected and 1 or 0 + local piao = _config:GetController("piao").selectedIndex + local daniao = _config:GetController("daniao").selectedIndex + local sandaidan = _config:GetController("sandaidan").selectedIndex + local ba = _config:GetChild("boom_add").selected and 1 or 0 + local fs = _config:GetChild("fan_sprint").selected and 1 or 0 ----- local fourDaiTwo = false @@ -209,183 +244,66 @@ function M:SelectedConfigData() ---- local _data = {} _data["account_id"] = DataManager.SelfUser.Id - -- _data["AA"] = AA - -- _data["willBeOut"] = willBeOut + 1 - -- _data["minboom"] = (willBeOut == 0 and leaf == 1 and player_num == 1) and bombSpring + 1 or 2 - -- _data["fourBeltThree"] = fourBeltThree - -- _data["demolition"] = demolition - -- _data["fangzuobi"] = fangzuobi - -- _data["threeA"] = ThreeA - -- _data["piao"] = piao - -- _data["daniao"] = daniao - -- _data["sandaidan"] = sandaidan - -- _data["ba"] = ba - -- _data["fs"] = fs + _data["opt"] = round + 1 + _data["rule"] = rule == 0 and 2 or 1 + _data["leaf"] = leaf + 1 + _data["AA"] = AA + _data["willBeOut"] = willBeOut + 1 + _data["showlength"] = showlength + _data["heartten"] = willBeOut == 0 and heart10 + 1 or 2 + _data["minboom"] = (willBeOut == 0 and leaf == 1 and player_num == 1) and bombSpring + 1 or 2 + _data["maxPlayers"] = player_num + 2 + _data["fourBeltThree"] = fourBeltThree + _data["demolition"] = demolition + _data["fangzuobi"] = fangzuobi + _data["threeA"] = ThreeA + _data["piao"] = piao + _data["daniao"] = daniao + _data["sandaidan"] = sandaidan + _data["ba"] = ba + _data["fs"] = fs _data["fourDaiTwo"] = fourDaiTwo - - -----------------------lingmeng---------------------------- - - _data["AA"] = 0 - _data["willBeOut"] = 1 - _data["minboom"] = 2 - _data["fourBeltThree"] = 0 - _data["demolition"] = 0 - _data["fangzuobi"] = 0 - _data["threeA"] = 0 - _data["piao"] = 0 - _data["daniao"] = 0 - _data["sandaidan"] = 0 - _data["ba"] = 0 - _data["fs"] = 0 + _data["fourDaiThree"] = fourDaiThree - _data["leaf"] = handcard == 0 and 2 or handcard --手牌 1是15张,2是16张 - _data["opt"] = round + 1 --局数 1是10局 2是15局 3是20局 ("未知") - _data["maxPlayers"] = peopleNum == 1 and 2 or 3 --人数 2是2人 3是三人 - _data["rule"] = wanfa1_5 == 0 and 2 or 1 --黑桃3必出 2是选择了该玩法 1是没有该玩法 - _data["showlength"] = (showCardNum + 1) % 2 --显示手牌数量 0是不显示 1是显示 - _data["planeNoBelt"] = wanfa1_1 --飞机不带 - _data["threeNoBelt"] = wanfa1_1 --三张不带 - _data["planelack"] = wanfa1_2 --飞机可少带接完 - _data["threelack"] = wanfa1_2 --三张可少带接完 - _data["fourDaiThree"] = false --四带三 false没有该玩法 true有该玩法 - if wanfa1_3 == 1 then - _data["fourDaiThree"] = true + if willBeOut == 1 then + -- body + _data["planelack"] = 0 + _data["threelack"] = 0 + else + if sandaidan == 1 then + _data["planelack"] = 0 + _data["threelack"] = 0 + else + _data["planelack"] = planelack + _data["threelack"] = threelack + end end - _data["heartten"] = wanfa1_4 + 1 --红桃扎鸟 1没有该玩法 2有该玩法 似乎说的是红桃10分数翻倍,具体要问江西那边 - _data["specilAdd"] = wanfa2_1 --特殊加分规则:只出一张加扣10分,出2-3张加扣5分 0没有该玩法 1有该玩法 - - - - - ----------------------------------------------------------- - - - -- if willBeOut == 1 then - -- -- body - -- _data["planelack"] = 0 - -- _data["threelack"] = 0 - -- else - -- if sandaidan == 1 then - -- _data["planelack"] = 0 - -- _data["threelack"] = 0 - -- else - -- _data["planelack"] = planelack - -- _data["threelack"] = threelack - -- end - -- end _data['xi_pai'] = xi_pai - local xi_pai_score = 1 - local an_chou_score = 1 + 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 + 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_score'] = xi_pai_score * 100 + _data['an_chou_score'] = an_chou_score * 100 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 + local people = self._config:GetController("player_num") + people.onChanged:Set(function() + self._maxPlayer = people.selectedIndex + 2 self:ShowVariablePrice(ctype, pay_obj) end) end -function M:LoadConfigToDetail(data, hpdata) - local configData = data - if type(data) == 'string' then - configData = json.decode(data) - end - - local hpData = configData.hpData or hpdata - if type(hpData) == 'string' then - if hpData == "null" then - hpData = nil - else - hpData = json.decode(hpData) - end - end - local returnString = "" - - if hpData then - returnString = string.format("%s倍,", hpData.times / 1000) - end - - returnString = string.format("%s人数%s人", returnString, configData.maxPlayers) - - if hpData then - returnString = string.format("%s %s局", returnString, hpData.maxRound) - end - if configData.leaf then - returnString = string.format("%s,%s", returnString, configData.leaf == 1 and "15张手牌" or "16张手牌") - end - if configData.showlength then - returnString = string.format("%s,%s", returnString, configData.showlength == 0 and "不显示牌数" or "显示牌数") - end - if configData.planeNoBelt and configData.threeNoBelt then - if configData.planeNoBelt == 0 and configData.threeNoBelt == 0 then - returnString = string.format("%s,%s", returnString, "三张、飞机必带") - elseif configData.planeNoBelt == 0 then - returnString = string.format("%s,%s", returnString, "三张必带、飞机可不带") - elseif configData.threeNoBelt == 0 then - returnString = string.format("%s,%s", returnString, "三张可不带、飞机必带") - else - returnString = string.format("%s,%s", returnString, "三张、飞机可不带") - end - else - if configData.planeNoBelt then - returnString = string.format("%s%s", returnString, configData.planeNoBelt == 0 and "" or ",飞机可不带") - end - if configData.threeNoBelt then - returnString = string.format("%s%s", returnString, configData.threeNoBelt == 0 and "" or ",三张可不带") - end - end - - if configData.planelack and configData.threelack then - if configData.planelack == 0 and configData.threelack == 0 then - returnString = string.format("%s,%s", returnString, "三张、飞机不可少带接完") - elseif configData.planelack == 0 then - returnString = string.format("%s,%s", returnString, "三张不可少带接完、飞机可少带接完") - elseif configData.threelack == 0 then - returnString = string.format("%s,%s", returnString, "三张可少带接完、飞机不可少带接完") - else - returnString = string.format("%s,%s", returnString, "三张、飞机可少带接完") - end - else - if configData.planelack then - returnString = string.format("%s%s", returnString, configData.planelack == 0 and "" or ",飞机可少带") - end - if configData.threelack then - returnString = string.format("%s%s", returnString, configData.threelack == 0 and "" or ",三张可少带") - end - end - if configData.fourDaiThree then - returnString = string.format("%s%s", returnString, configData.fourDaiThree and ",四带三" or "") - end - if configData.heartten then - returnString = string.format("%s%s", returnString, configData.heartten == 1 and "" or ",红桃10扎鸟") - end - if configData.rule then - returnString = string.format("%s%s", returnString, - configData.rule == 1 and ",首局黑桃三必出" or "") - end - if configData.specilAdd then - returnString = string.format("%s%s", returnString, configData.specilAdd == 0 and "" or ",只出一张加扣10分,出2-3张加扣5分") - end - - returnString = returnString .. IGameInfo.LoadConfigToDetail(self, configData, hpData) - - return returnString -end - return M diff --git a/wb_new_ui/assets/Extend_Poker_RunFastNew_old/package.xml b/wb_new_ui/assets/Extend_Poker_RunFastNew_old/package.xml index 27222cbb..78d68a39 100644 --- a/wb_new_ui/assets/Extend_Poker_RunFastNew_old/package.xml +++ b/wb_new_ui/assets/Extend_Poker_RunFastNew_old/package.xml @@ -489,5 +489,5 @@ - + \ No newline at end of file diff --git a/wb_new_ui/assets/Info_Poker_RunFastNew/Button3.xml b/wb_new_ui/assets/Info_Poker_RunFastNew/Button3.xml index 5ac22ff4..e33515b3 100644 --- a/wb_new_ui/assets/Info_Poker_RunFastNew/Button3.xml +++ b/wb_new_ui/assets/Info_Poker_RunFastNew/Button3.xml @@ -2,7 +2,7 @@ - + diff --git a/wb_new_ui/assets/Info_Poker_RunFastNew/Com_help.xml b/wb_new_ui/assets/Info_Poker_RunFastNew/Com_help.xml index 976d8c42..8d95b867 100644 --- a/wb_new_ui/assets/Info_Poker_RunFastNew/Com_help.xml +++ b/wb_new_ui/assets/Info_Poker_RunFastNew/Com_help.xml @@ -1,6 +1,6 @@ - + - + \ No newline at end of file diff --git a/wb_new_ui/assets/Info_Poker_RunFastNew/ComboBox1_item.xml b/wb_new_ui/assets/Info_Poker_RunFastNew/ComboBox1_item.xml index 0a58668a..294d841f 100644 --- a/wb_new_ui/assets/Info_Poker_RunFastNew/ComboBox1_item.xml +++ b/wb_new_ui/assets/Info_Poker_RunFastNew/ComboBox1_item.xml @@ -1,15 +1,15 @@ - + - + - - - - + + + + - - - + + + -