跑得快展示提示,修复少带不能出

master
罗家炜 2025-05-07 11:58:53 +08:00
parent 2370ea7783
commit b502289a2a
4 changed files with 60 additions and 31 deletions

View File

@ -27,11 +27,12 @@ function M:initFlag()
return self return self
end end
function M:initCards(cardList, flag) function M:initCards(cardList, flag, flag_allCards)
print("lingmenginitCards") print("lingmenginitCards")
pt(cardList) pt(cardList)
local temp_long = 0 local temp_long = 0
self:Clear() self:Clear()
self._flag_allCards = flag_allCards or false
if flag then if flag then
for i = 1, #cardList do for i = 1, #cardList do
local number = math.floor(cardList[i][1].card_code_number / 10) local number = math.floor(cardList[i][1].card_code_number / 10)
@ -78,26 +79,21 @@ function M:initCards(cardList, flag)
end end
function M:CheckCards() function M:CheckCards()
print("lingmengcheck1")
if self:CheckAloneOrLong() then if self:CheckAloneOrLong() then
return true return true
end end
print("lingmengcheck2")
if self:CheckDuiZi() then if self:CheckDuiZi() then
return true return true
end end
print("lingmengcheck3")
if self:CheckSanDai() then if self:CheckSanDai() then
return true return true
end end
print("lingmengcheck4")
if self:CheckZha() then if self:CheckZha() then
return true return true
end end
print("lingmengcheck5")
return false return false
end end
@ -142,9 +138,9 @@ function M:CheckSanDai()
if self.threeNoBelt and self.cardNum == 3 and self.cardSize == 1 then if self.threeNoBelt and self.cardNum == 3 and self.cardSize == 1 then
return true return true
end end
-- if self.threelack and self.cardNum == 4 and self.cardSize == 2 then if self.threelack and self.cardNum == 4 and self.cardSize == 2 and self._flag_allCards then
-- return true return true
-- end end
--飞机 --飞机
local temp_normol_feiji local temp_normol_feiji
@ -201,27 +197,27 @@ function M:CheckSanDai()
return true return true
end end
-- if self.threelack then if self.threelack and self._flag_allCards then
-- local last_k local last_k
-- local num_san = 0 local num_san = 0
-- for k, v in pairs(self.cardList) do for k, v in pairs(self.cardList) do
-- if v >= 3 then if v >= 3 then
-- num_san = num_san + 1 num_san = num_san + 1
-- if not last_k then if not last_k then
-- last_k = k last_k = k
-- else else
-- if math.abs(last_k - k) ~= 1 then if math.abs(last_k - k) ~= 1 then
-- return return
-- end end
-- end end
-- end end
-- end end
-- if self.cardNum - num_san * 3 < num_san * 2 then if self.cardNum - num_san * 3 < num_san * 2 then
-- return true return true
-- else else
-- return return
-- end end
-- end end
end end
function M:CheckZha() function M:CheckZha()

View File

@ -287,6 +287,34 @@ 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.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

@ -744,7 +744,8 @@ function M:TouchMoveEnd(context)
if #send_card > 0 then if #send_card > 0 then
table.sort(send_card, tableSortNumber) table.sort(send_card, tableSortNumber)
self._cardCheck:initCards(#xuan_card > 0 and xuan_card or send_card, #xuan_card > 0) send_card = #xuan_card > 0 and xuan_card or send_card
self._cardCheck:initCards(send_card, #xuan_card > 0, #send_card == self._view_handCard.numItems)
self._ctr_canSendCard.selectedIndex = self._cardCheck:CheckCards() and 1 or 0 self._ctr_canSendCard.selectedIndex = self._cardCheck:CheckCards() and 1 or 0
else else
self._ctr_canSendCard.selectedIndex = 0 self._ctr_canSendCard.selectedIndex = 0

View File

@ -171,9 +171,13 @@ function M:onTouchMove(context)
end end
end end
else else
print("lingmengonTouchMove", chooseIndex, self._view_handCardList.numItems)
self.ischoose = true self.ischoose = true
if self._view_handCardList.selectedIndex ~= chooseIndex then if self._view_handCardList.selectedIndex ~= chooseIndex then
self:ChooseHand(chooseIndex) self:ChooseHand(chooseIndex)
else
end end
end end
end end