同步重新加载房间

master
罗家炜 2025-05-15 17:42:04 +08:00
parent a0892f7c6b
commit f66be072e8
5 changed files with 474 additions and 151 deletions

View File

@ -836,8 +836,7 @@ function M:OnFangziAction(...)
local fs_info = _player_card_info[self:GetPos(fz.from_seat)] local fs_info = _player_card_info[self:GetPos(fz.from_seat)]
fs_info:UpdateOutCardList() fs_info:UpdateOutCardList()
end end
local seat = (self._room.room_config.people_num == 2 and fz.from_seat == 2) and 2 or fz.from_seat - 1 info:UpdateFzList(fz, index, true)
info:UpdateFzList(fz, index, true, seat)
local getcard = fz.type == FZType.Peng or fz.type == FZType.Chi local getcard = fz.type == FZType.Peng or fz.type == FZType.Chi
printlog(getcard) printlog(getcard)
info:UpdateHandCard(getcard) info:UpdateHandCard(getcard)
@ -921,7 +920,7 @@ function M:ReloadRoom(bskip)
end end
end end
self:ShowJing()
for i = 1, #room.player_list do for i = 1, #room.player_list do
local p = room.player_list[i] local p = room.player_list[i]
local info = self._player_card_info[self:GetPos(p.seat)] local info = self._player_card_info[self:GetPos(p.seat)]

View File

@ -88,11 +88,15 @@ function M:FillRoomData(s2croom)
local playing = _reloadInfo["playing"] local playing = _reloadInfo["playing"]
local _info_list = _reloadInfo["info_list"] local _info_list = _reloadInfo["info_list"]
local last_outcard_seat = _reloadInfo["last_outcard_seat"] local last_outcard_seat = _reloadInfo["last_outcard_seat"]
local jing = _reloadInfo["jing"]
room.left_count = _reloadInfo["left_card"] room.left_count = _reloadInfo["left_card"]
room.banker_seat = bank_seat room.banker_seat = bank_seat
room.curren_outcard_seat = _reloadInfo["curren_outcard_seat"] room.curren_outcard_seat = _reloadInfo["curren_outcard_seat"]
room.last_outcard_seat = last_outcard_seat room.last_outcard_seat = last_outcard_seat
room.playing = playing room.playing = playing
if jing then
room.jing = jing
end
for i = 1, #_info_list do for i = 1, #_info_list do
local tem = _info_list[i] local tem = _info_list[i]
local playerid = tem["playerid"] local playerid = tem["playerid"]
@ -108,6 +112,7 @@ function M:FillRoomData(s2croom)
local fz = {} local fz = {}
fz.type = op["type"] fz.type = op["type"]
fz.card = op["card"] fz.card = op["card"]
fz.from_seat = op["from_seat"]
p.fz_list[#p.fz_list + 1] = fz p.fz_list[#p.fz_list + 1] = fz
end end
print("=======================在此进入", playing) print("=======================在此进入", playing)

View File

@ -6,7 +6,6 @@ local EXGameInfo = {}
local M = EXGameInfo local M = EXGameInfo
local roundTable = { 10, 15, 20 }
function EXGameInfo.new(blur_view) function EXGameInfo.new(blur_view)
setmetatable(M, { __index = IGameInfo }) setmetatable(M, { __index = IGameInfo })
local self = setmetatable({}, { __index = M }) local self = setmetatable({}, { __index = M })
@ -26,24 +25,87 @@ function M:FillData(view, index)
-- end -- end
-- self._config:GetChild("people_2").onClick:Set(function() if oldGameVersion == 2 then
-- self._config:GetController("rule").selectedIndex = 0 self._config:GetController("xipai").selectedIndex = 0
-- end)
-- local piao = self._config:GetController("piao") self.xipaiValueText = self._config:GetChild('xipaifen')
-- local daniao = self._config:GetController("daniao") self.xipaiValueText.text = 1
self.xipaiValue = 1
-- piao.onChanged:Add(function() self.anchouValueText = self._config:GetChild('anchoufen')
-- if piao.selectedIndex ~= 0 then self.anchouValueText.text = 1
-- daniao.selectedIndex = 0 self.anchouValue = 1
-- end
-- end)
-- daniao.onChanged:Add(function() local btn_cr = self._config:GetChild('sdsrbtn')
-- if daniao.selectedIndex ~= 0 then btn_cr.onClick:Set(
-- piao.selectedIndex = 0 function()
-- end local gniv = GroupNumberInputView_Game.new(nil, function(num)
-- end) 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, 0, 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
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)
end end
local _help_url = "ui://Info_Poker_RunFastNew/Com_help" local _help_url = "ui://Info_Poker_RunFastNew/Com_help"
@ -143,35 +205,25 @@ end
function M:SelectedConfigData() function M:SelectedConfigData()
local _config = self._config local _config = self._config
local round = _config:GetController("round").selectedIndex local round = _config:GetController("round").selectedIndex
local handcard = _config:GetController("handcard").selectedIndex local rule = _config:GetController("rule").selectedIndex
local peopleNum = _config:GetController("peopleNum").selectedIndex local leaf = _config:GetController("play_list").selectedIndex
local showCardNum = _config:GetController("showCardNum").selectedIndex local willBeOut = _config:GetController("willBeOut").selectedIndex
local wanfa1_1 = _config:GetController("wanfa1_1").selectedIndex local bombSpring = _config:GetController("bombSpring").selectedIndex
local wanfa1_2 = _config:GetController("wanfa1_2").selectedIndex local heart10 = _config:GetController("heart10").selectedIndex
local wanfa1_3 = _config:GetController("wanfa1_3").selectedIndex local player_num = _config:GetController("player_num").selectedIndex
local wanfa1_4 = _config:GetController("wanfa1_4").selectedIndex local AA = _config:GetController("Cost").selectedIndex
local wanfa1_5 = _config:GetController("wanfa1_5").selectedIndex local showlength = _config:GetController("showlength").selectedIndex
local wanfa2_1 = _config:GetController("wanfa2_1").selectedIndex local fourBeltThree = _config:GetController("fourBeltThree").selectedIndex
local demolition = _config:GetController("demolition").selectedIndex
-- local rule = _config:GetController("rule").selectedIndex local fangzuobi = _config:GetController("fangzuobi").selectedIndex
-- local leaf = _config:GetController("play_list").selectedIndex local planelack = _config:GetChild("planelack").selected and 1 or 0
-- local willBeOut = _config:GetController("willBeOut").selectedIndex local threelack = _config:GetChild("Threelack").selected and 1 or 0
-- local bombSpring = _config:GetController("bombSpring").selectedIndex local ThreeA = _config:GetChild("ThreeA").selected and 1 or 0
-- local heart10 = _config:GetController("heart10").selectedIndex local piao = _config:GetController("piao").selectedIndex
-- local player_num = _config:GetController("player_num").selectedIndex local daniao = _config:GetController("daniao").selectedIndex
-- local AA = _config:GetController("Cost").selectedIndex local sandaidan = _config:GetController("sandaidan").selectedIndex
-- local showlength = _config:GetController("showlength").selectedIndex local ba = _config:GetChild("boom_add").selected and 1 or 0
-- local fourBeltThree = _config:GetController("fourBeltThree").selectedIndex local fs = _config:GetChild("fan_sprint").selected and 1 or 0
-- 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 local fourDaiTwo = false
@ -192,82 +244,52 @@ function M:SelectedConfigData()
---- ----
local _data = {} local _data = {}
_data["account_id"] = DataManager.SelfUser.Id _data["account_id"] = DataManager.SelfUser.Id
-- _data["AA"] = AA _data["opt"] = round + 1
-- _data["willBeOut"] = willBeOut + 1 _data["rule"] = rule == 0 and 2 or 1
-- _data["minboom"] = (willBeOut == 0 and leaf == 1 and player_num == 1) and bombSpring + 1 or 2 _data["leaf"] = leaf + 1
-- _data["fourBeltThree"] = fourBeltThree _data["AA"] = AA
-- _data["demolition"] = demolition _data["willBeOut"] = willBeOut + 1
-- _data["fangzuobi"] = fangzuobi _data["showlength"] = showlength
-- _data["threeA"] = ThreeA _data["heartten"] = willBeOut == 0 and heart10 + 1 or 2
-- _data["piao"] = piao _data["minboom"] = (willBeOut == 0 and leaf == 1 and player_num == 1) and bombSpring + 1 or 2
-- _data["daniao"] = daniao _data["maxPlayers"] = player_num + 2
-- _data["sandaidan"] = sandaidan _data["fourBeltThree"] = fourBeltThree
-- _data["ba"] = ba _data["demolition"] = demolition
-- _data["fs"] = fs _data["fangzuobi"] = fangzuobi
_data["threeA"] = ThreeA
_data["piao"] = piao
_data["daniao"] = daniao
_data["sandaidan"] = sandaidan
_data["ba"] = ba
_data["fs"] = fs
_data["fourDaiTwo"] = fourDaiTwo _data["fourDaiTwo"] = fourDaiTwo
_data["fourDaiThree"] = fourDaiThree
-----------------------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["leaf"] = handcard == 0 and 2 or handcard --手牌 1是15张2是16张 if willBeOut == 1 then
_data["opt"] = round + 1 --局数 1是10局 2是15局 3是20局 ("未知") -- body
_data["maxPlayers"] = peopleNum == 1 and 2 or 3 --人数 2是2人 3是三人 _data["planelack"] = 0
_data["rule"] = wanfa1_5 == 0 and 2 or 1 --黑桃3必出 2是选择了该玩法 1是没有该玩法 _data["threelack"] = 0
_data["showlength"] = (showCardNum + 1) % 2 --显示手牌数量 0是不显示 1是显示 else
_data["planeNoBelt"] = wanfa1_1 --飞机不带 if sandaidan == 1 then
_data["threeNoBelt"] = wanfa1_1 --三张不带 _data["planelack"] = 0
_data["planelack"] = wanfa1_2 --飞机可少带接完 _data["threelack"] = 0
_data["threelack"] = wanfa1_2 --三张可少带接完 else
_data["fourDaiThree"] = false --四带三 false没有该玩法 true有该玩法 _data["planelack"] = planelack
if wanfa1_3 == 1 then _data["threelack"] = threelack
_data["fourDaiThree"] = true end
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 _data['xi_pai'] = xi_pai
local xi_pai_score = 1 local xi_pai_score = 0
local an_chou_score = 1 local an_chou_score = 0
-- if oldGameVersion == 2 then if oldGameVersion == 2 then
-- xi_pai_score = self.xipaiValue xi_pai_score = self.xipaiValue
-- an_chou_score = self.anchouValue an_chou_score = self.anchouValue
-- end end
_data['xi_pai_score'] = xi_pai_score * 1000 _data['xi_pai_score'] = xi_pai_score * 1000
_data['an_chou_score'] = an_chou_score * 1000 _data['an_chou_score'] = an_chou_score * 1000
@ -277,9 +299,9 @@ end
function M:OnChangeOption(ctype, pay_obj) function M:OnChangeOption(ctype, pay_obj)
IGameInfo.OnChangeOption(self, ctype, pay_obj) IGameInfo.OnChangeOption(self, ctype, pay_obj)
local peopleNum = self._config:GetController("peopleNum") local people = self._config:GetController("player_num")
peopleNum.onChanged:Set(function() people.onChanged:Set(function()
self._maxPlayer = peopleNum.selectedIndex == 1 and 2 or 3 self._maxPlayer = people.selectedIndex + 2
self:ShowVariablePrice(ctype, pay_obj) self:ShowVariablePrice(ctype, pay_obj)
end) end)
end end
@ -287,37 +309,6 @@ end
function M:LoadConfigToDetail(data) function M:LoadConfigToDetail(data)
local configData = json.decode(data) local configData = json.decode(data)
local returnString = string.format("人数%s人", configData.maxPlayers) local returnString = string.format("人数%s人", configData.maxPlayers)
if configData.leaf then
returnString = string.format("%s,%s", returnString, configData.leaf == 1 and "十五张手牌" or "十六张手牌")
end
if configData.rule then
returnString = string.format("%s%s", returnString,
configData.rule == 1 and ",黑桃三必出" or "")
end
if configData.showlength then
-- returnString = string.format("%s,%s", returnString, configData.zimo == 0 and "可点炮,可自摸" or "必须自摸")
end
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
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
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 ",红桃扎鸟")
end
if configData.specilAdd then
returnString = string.format("%s%s", returnString, configData.specilAdd == 0 and "" or ",特殊加分")
end
return returnString return returnString
end end

View File

@ -0,0 +1,324 @@
---
--- 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/runfast/ui/Info_Poker_RunFastNew")
return self
end
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")
-- 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)
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
local _play_list = { "15张玩法", "16张玩法" }
function M:GetPlayList()
return _play_list
end
function M:LoadConfigData(data)
local _config = self._config
_config:GetController("round").selectedIndex = data.opt - 1
_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
_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
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
_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.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("fourBeltTwo") then
_config:GetChild("fourBeltTwo").selected = data.fourDaiThree
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: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 fourDaiTwo = false
if _config:GetChild("fourBeltThree") then
fourDaiTwo = _config:GetChild("fourBeltThree").selected
end
local fourDaiThree = false
if _config:GetChild("fourBeltTwo") then
fourDaiThree = _config:GetChild("fourBeltTwo").selected
end
local xi_pai = false
if _config:GetChild("xipai") then
xi_pai = _config:GetChild("xipai").selected
end
----
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["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["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
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
-- 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
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)
if configData.leaf then
returnString = string.format("%s,%s", returnString, configData.leaf == 1 and "十五张手牌" or "十六张手牌")
end
if configData.rule then
returnString = string.format("%s%s", returnString,
configData.rule == 1 and ",黑桃三必出" or "")
end
if configData.showlength then
-- returnString = string.format("%s,%s", returnString, configData.zimo == 0 and "可点炮,可自摸" or "必须自摸")
end
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
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
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 ",红桃扎鸟")
end
if configData.specilAdd then
returnString = string.format("%s%s", returnString, configData.specilAdd == 0 and "" or ",特殊加分")
end
return returnString
end
return M

View File

@ -219,7 +219,11 @@ local function getPos(my_seat, other_seat, total)
return pos return pos
end end
function M:UpdateFzList(fz, index, show_card, seat) function M:UpdateFzList(fz, index, show_card)
local room = DataManager.CurrenRoom
-- local seat = (room.room_config.people_num == 2 and fz.from_seat == 2) and 2 or fz.from_seat - 1
local seat = ViewUtil.GetPos(room.self_player.seat, fz.from_seat, room.room_config.people_num)
seat = (room.room_config.people_num == 2 and seat == 2) and 2 or seat - 1
print("lingmengUpdateFzList", fz, index, show_card, seat) print("lingmengUpdateFzList", fz, index, show_card, seat)
local FZame = self._viewText_cardInfo['FZ_Card'] local FZame = self._viewText_cardInfo['FZ_Card']
index = index or 0 index = index or 0