放大和博精显示测试

master
罗家炜 2025-04-11 11:23:14 +08:00
parent ba2c17f306
commit 944b9ed164
21 changed files with 517 additions and 549 deletions

View File

@ -152,9 +152,9 @@ function ViewUtil.CardPos(obj, area, oder, index, offset, isAdd, padding)
obj.x = (area.width - obj.width) - index * (obj.width + padding) - offset
elseif oder == AreaOderType.down_up then
if isAdd then
obj.y = area.height - obj.height - index * obj.height * 1.5 - offset
obj.y = area.height - obj.height - index * (obj.height + padding) * 1.5 - offset
else
obj.y = area.height - obj.height - index * obj.height - offset
obj.y = area.height - obj.height - index * (obj.height + padding) - offset
end
--obj.y = area.height - obj.height - index * obj.height - offset
end

View File

@ -42,12 +42,6 @@ function M:InitView(url)
self.Laizi2Btn.visible = true
self.bugangnum = self._view:GetChild("bugangnum")
self.jing = self._view:GetChild('jing')
if room.jing then
self.jing.visible = true
end
self:PlayerChangeLineState()
if room.playing or room.curren_round > 0 then

View File

@ -6,8 +6,8 @@ local EXClearingView = {}
local M = EXClearingView
function EXClearingView.new(blur_view)
setmetatable(M, {__index = ResultView})
local self = setmetatable({}, {__index = M})
setmetatable(M, { __index = ResultView })
local self = setmetatable({}, { __index = M })
self._full = true
ResultView.init(self, "ui://Main_Majiang/clearing")
@ -20,69 +20,62 @@ function EXClearingView.new(blur_view)
end
function M:InitMaPai()
self.maPaiCtr=self._view:GetController("mapai")
self.maPaiCtr.selectedIndex=0
self.maPaiCtr = self._view:GetController("mapai")
self.maPaiCtr.selectedIndex = 0
self.maPaiList={}
self.maPaiList = {}
for i=1,8 do
local tempMP=self._view:GetChild("niao"..i)
table.insert(self.maPaiList,tempMP)
end
end
function M:IsMapaiShow(niao,isShow)
if niao then
niao.visible=isShow
for i = 1, 8 do
local tempMP = self._view:GetChild("niao" .. i)
table.insert(self.maPaiList, tempMP)
end
end
function M:SetMaPaiValue(niao,value)
function M:IsMapaiShow(niao, isShow)
if niao then
niao.icon='ui://Main_Majiang/' ..get_majiang_prefix(DataManager.CurrenRoom.game_id).."201_"..value
niao.visible = isShow
end
end
function M:SetMaPaiColor(niao,num)
niao:GetController("color").selectedIndex=num
function M:SetMaPaiValue(niao, value)
if niao then
niao.icon = 'ui://Main_Majiang/' .. get_majiang_prefix(DataManager.CurrenRoom.game_id) .. "201_" .. value
end
end
function M:SetMaPaiColor(niao, num)
niao:GetController("color").selectedIndex = num
end
function M:HideAllMapai()
for i=1,#self.maPaiList do
self:IsMapaiShow(self.maPaiList[i],false)
self:SetMaPaiColor(self.maPaiList[i],0)
for i = 1, #self.maPaiList do
self:IsMapaiShow(self.maPaiList[i], false)
self:SetMaPaiColor(self.maPaiList[i], 0)
end
end
function M:ShowSelectMaPai(niaoList)
if niaoList and #niaoList>0 then
self.maPaiCtr.selectedIndex=1
if niaoList and #niaoList > 0 then
self.maPaiCtr.selectedIndex = 1
self:HideAllMapai()
for i=1,#niaoList do
self:IsMapaiShow(self.maPaiList[i],true)
self:SetMaPaiValue(self.maPaiList[i],niaoList[i].card)
if niaoList[i].score>0 then
self:SetMaPaiColor(self.maPaiList[i],2)
for i = 1, #niaoList do
self:IsMapaiShow(self.maPaiList[i], true)
self:SetMaPaiValue(self.maPaiList[i], niaoList[i].card)
if niaoList[i].score > 0 then
self:SetMaPaiColor(self.maPaiList[i], 2)
end
end
else
self.maPaiCtr.selectedIndex=0
self.maPaiCtr.selectedIndex = 0
end
end
function M:CalculatePaixingInfo(result)
self.WinList={}
if result.info_list and #result.info_list>0 then
for i=1,#result.info_list do
if result.info_list[i].win_list and #result.info_list[i].win_list>0 then
table.insert(self.WinList,result.info_list[i].win_list)
self.WinList = {}
if result.info_list and #result.info_list > 0 then
for i = 1, #result.info_list do
if result.info_list[i].win_list and #result.info_list[i].win_list > 0 then
table.insert(self.WinList, result.info_list[i].win_list)
end
end
end
@ -91,19 +84,15 @@ function M:CalculatePaixingInfo(result)
pt(self.WinList)
end
function M:SetPaixingxiangqing(num)
for i=1,#self.PaiXingXiangQingCtrList do
for i = 1, #self.PaiXingXiangQingCtrList do
if self.PaiXingXiangQingCtrList[i] then
self.PaiXingXiangQingCtrList[i].selectedIndex=num
self.PaiXingXiangQingCtrList[i].selectedIndex = num
end
end
end
function M:InitData(over, room, result, total_result, callback)
self._callback = callback
local _overCtr = self._view:GetController("over")
local btn_confirm = self._view:GetChild("btn_confirm")
@ -113,7 +102,8 @@ function M:InitData(over, room, result, total_result, callback)
local _sdkCtr = self._view:GetController("sdk")
local ctr_type = self._view:GetController("type")
self._view:GetChild("tex_roominfo").text = string.format("房号%s 局%s/%s %s", room.room_id, room.curren_round, room.room_config.round, os.date("%Y-%m-%d %H:%M:%S", os.time()))
self._view:GetChild("tex_roominfo").text = string.format("房号%s 局%s/%s %s", room.room_id, room.curren_round,
room.room_config.round, os.date("%Y-%m-%d %H:%M:%S", os.time()))
self._view:GetChild("tex_gameinfo").text = string.gsub(room.room_config:GetDes2(), "\r", "")
if result then
@ -121,22 +111,22 @@ function M:InitData(over, room, result, total_result, callback)
self:CalculatePaixingInfo(result)
end
self.PaiXingXiangQingCtrList={}
self.PaiXingXiangQingCtrList = {}
local paixingxiangqing=self._view:GetChild("btn_detal")
local fanhuipaixing=self._view:GetChild("btn_fanhuipaixing")
fanhuipaixing.visible=false
paixingxiangqing.visible=true
local paixingxiangqing = self._view:GetChild("btn_detal")
local fanhuipaixing = self._view:GetChild("btn_fanhuipaixing")
fanhuipaixing.visible = false
paixingxiangqing.visible = true
paixingxiangqing.onClick:Add(function()
paixingxiangqing.visible=false
fanhuipaixing.visible=true
self:SetPaixingxiangqing(1)
end)
paixingxiangqing.visible = false
fanhuipaixing.visible = true
self:SetPaixingxiangqing(1)
end)
fanhuipaixing.onClick:Add(function()
paixingxiangqing.visible=true
fanhuipaixing.visible=false
self:SetPaixingxiangqing(0)
end)
paixingxiangqing.visible = true
fanhuipaixing.visible = false
self:SetPaixingxiangqing(0)
end)
if over ~= 2 then
@ -169,7 +159,7 @@ function M:InitData(over, room, result, total_result, callback)
_btnCtr.selectedIndex = 1
_sdkCtr.selectedIndex = 1
btn_result.onClick:Add(function()
self.maPaiCtr.selectedIndex=0
self.maPaiCtr.selectedIndex = 0
_overCtr.selectedIndex = 1
_btnCtr.selectedIndex = 0
_sdkCtr.selectedIndex = 0
@ -185,7 +175,7 @@ function M:InitData(over, room, result, total_result, callback)
end
else
_overCtr.selectedIndex = 1
self.maPaiCtr.selectedIndex=0
self.maPaiCtr.selectedIndex = 0
btn_close.onClick:Add(function()
ViewManager.ChangeView(ViewManager.View_Lobby)
end)
@ -194,20 +184,20 @@ function M:InitData(over, room, result, total_result, callback)
end
end
function M:AddClearItem(room, data, total_data,over, niao, active_player)
function M:AddClearItem(room, data, total_data, over, niao, active_player)
local n = over + 1
local list_view1 = self._view:GetChild("player_list_1")
local list_view2 = self._view:GetChild("player_list_2")
if 0 == over or 1 == over then
table.sort(data, function(a,b) return a.seat < b.seat end)
table.sort(data, function(a, b) return a.seat < b.seat end)
list_view1:RemoveChildrenToPool()
for i=1,#data do
for i = 1, #data do
local item = list_view1:AddItemFromPool()
self:FillItemData(room, data[i], item, active_player, niao)
end
if #data == 3 then
if #data == 3 then
list_view1.lineGap = 54
elseif #data == 2 then
list_view1.lineGap = 108
@ -221,23 +211,22 @@ function M:AddClearItem(room, data, total_data,over, niao, active_player)
end
function M:FillItemData(room, data, item, active_player, niao)
local _gamectr = ControllerManager.GetController(GameController)
local p = room:GetPlayerBySeat(data["seat"])
item:GetChild("playerName").text = p.self_user.nick_name
item:GetChild("lab_hp").text=""--抓马
item:GetChild("lab_hp").text = "" --抓马
local user = room:GetPlayerBySeat(data["seat"]).self_user
local head = item:GetChild('head'):GetChild('n4')
ImageLoad.Load(user.head_url, head)
ImageLoad.Load(user.head_url, head)
-- 手牌
local hand_cards = data["hand_card"]
table.sort( hand_cards, ViewUtil.HandCardSort)
table.sort(hand_cards, ViewUtil.HandCardSort)
local hand_list_view = item:GetChild("hand_card_list")
hand_list_view:RemoveChildrenToPool()
for i=1,#hand_cards do
for i = 1, #hand_cards do
local card = hand_list_view:AddItemFromPool()
card.icon = "ui://Main_Majiang/202_"..hand_cards[i]
card.icon = "ui://Main_Majiang/202_" .. hand_cards[i]
end
hand_list_view.width = 52 * #hand_cards
@ -246,28 +235,27 @@ function M:FillItemData(room, data, item, active_player, niao)
fz_card_list.width = 157 * #fz_card * 0.8
fz_card_list:RemoveChildrenToPool()
for i=1,#fz_card do
for i = 1, #fz_card do
if fz_card[i].type == FZType.Peng then
local item = fz_card_list:AddItemFromPool("ui://Main_Majiang/clearing_fz_3")
for j=1,3 do
for j = 1, 3 do
local card = item:GetChild("card_" .. j)
card.icon = "ui://Main_Majiang/202_"..fz_card[i].card
card.icon = "ui://Main_Majiang/202_" .. fz_card[i].card
end
elseif fz_card[i].type == FZType.Chi then
local item = fz_card_list:AddItemFromPool("ui://Main_Majiang/clearing_fz_3")
for j = 1,3 do
for j = 1, 3 do
local card = item:GetChild("card_" .. j)
card.icon = "ui://Main_Majiang/" .. self:GetPrefix().."202_"..fz_card[i].opcard[j]
card.icon = "ui://Main_Majiang/" .. self:GetPrefix() .. "202_" .. fz_card[i].opcard[j]
end
elseif fz_card[i].type == FZType.Gang or fz_card[i].type == FZType.Gang_An or fz_card[i].type == FZType.Gang_Peng then
local item = fz_card_list:AddItemFromPool("ui://Main_Majiang/clearing_fz_4")
for j=1,4 do
for j = 1, 4 do
local card = item:GetChild("card_" .. j)
if fz_card[i].type == FZType.Gang_An and j == 4 then
card.icon = "ui://Main_Majiang/202_00"
else
card.icon = "ui://Main_Majiang/202_"..fz_card[i].card
card.icon = "ui://Main_Majiang/202_" .. fz_card[i].card
end
end
end
@ -275,11 +263,17 @@ function M:FillItemData(room, data, item, active_player, niao)
local huadd = data["hu_score"]
local gangadd = data["gang_score"]
local jingadd = data["jing_score"]
local total = data["round_score"]
local geng_zhuan=data["geng_zhuan"]
local geng_zhuan = data["geng_zhuan"]
local sp = " "
local str = "胡:"..huadd..""
str = str..sp.."杠:"..gangadd..""
local str = "胡:" .. huadd .. ""
if gangadd then
str = str .. sp .. "杠:" .. gangadd .. ""
end
if jingadd then
str = str .. sp .. "博精:" .. jingadd .. ""
end
@ -288,7 +282,7 @@ function M:FillItemData(room, data, item, active_player, niao)
item:GetChild("score1").text = str
-- local total_score = data["total_score"]
if total >= 0 then
item:GetChild("score2").text = "+"..total
item:GetChild("score2").text = "+" .. total
item:GetChild("score2").grayed = false
else
item:GetChild("score2").text = total
@ -297,166 +291,147 @@ function M:FillItemData(room, data, item, active_player, niao)
--计算牌型
local totalPeson=DataManager.CurrenRoom.room_config.people_num-1
local totalPeson = DataManager.CurrenRoom.room_config.people_num - 1
local win_list = data["win_list"]
local is_win = data["is_win"] or false
local str1=""
sp=""
local str1 = ""
sp = ""
if is_win then
if win_list then
if DataManager.CurrenRoom.isZiMoHu then
str1="自摸"
str1 = "自摸"
else
str1="接炮"
str1 = "接炮"
end
for i=1,#win_list do
local huName=Hu_Type_Name[win_list[i].type]
for i = 1, #win_list do
local huName = Hu_Type_Name[win_list[i].type]
if huName then
str1=str1..sp..huName.."x"..win_list[i].score
str1 = str1 .. sp .. huName .. "x" .. win_list[i].score
end
end
str1=str1.." +"..huadd..""
str1 = str1 .. " +" .. huadd .. ""
end
else
printlog("输家============")
if DataManager.CurrenRoom.isZiMoHu then
printlog("自摸处理============")
--str1=""
if #self.WinList==1 then
for i=1,#self.WinList do
for j=1,#self.WinList[i] do
local huName=Hu_Type_Name[self.WinList[i][j].type]
if #self.WinList == 1 then
for i = 1, #self.WinList do
for j = 1, #self.WinList[i] do
local huName = Hu_Type_Name[self.WinList[i][j].type]
if huName then
if j==1 then
str1=str1..huName.."x"..self.WinList[i][j].score
if j == 1 then
str1 = str1 .. huName .. "x" .. self.WinList[i][j].score
else
str1=str1..sp..huName.."x"..self.WinList[i][j].score
str1 = str1 .. sp .. huName .. "x" .. self.WinList[i][j].score
end
end
end
end
str1=str1.." "..huadd..""
str1 = str1 .. " " .. huadd .. ""
else
printlog("服务端自摸计算异常===>>>")
end
else
printlog("非自摸处理====>>>")
--点炮 一炮多响
local yipaoduoxiang=false
if #self.WinList>1 then
yipaoduoxiang=true
local yipaoduoxiang = false
if #self.WinList > 1 then
yipaoduoxiang = true
end
if yipaoduoxiang then
printlog("一炮多响====>>>")
str="点炮"
local allTypeList={}
local isHas=false
for i=1,#self.WinList do
for j=1,#self.WinList[i] do
isHas=IsHasDictionary(self.WinList[i][j].type,allTypeList)
if isHas==false then
table.insert(allTypeList,self.WinList[i][j].type)
str = "点炮"
local allTypeList = {}
local isHas = false
for i = 1, #self.WinList do
for j = 1, #self.WinList[i] do
isHas = IsHasDictionary(self.WinList[i][j].type, allTypeList)
if isHas == false then
table.insert(allTypeList, self.WinList[i][j].type)
end
end
end
if #allTypeList>0 then
for i=1,#allTypeList do
local huName=Hu_Type_Name[allTypeList[i]]
if #allTypeList > 0 then
for i = 1, #allTypeList do
local huName = Hu_Type_Name[allTypeList[i]]
if huName then
str1=str1..huName..""
str1 = str1 .. huName .. ""
end
end
str1=str1.." "..huadd..""
str1 = str1 .. " " .. huadd .. ""
end
else
if p.self_user.account_id == active_player and is_win == false and not data["liuju"] then
str1="点炮"
if #self.WinList==1 then
for i=1,# self.WinList do
for j=1,#self.WinList[i] do
local huName=Hu_Type_Name[self.WinList[i][j].type]
str1 = "点炮"
if #self.WinList == 1 then
for i = 1, # self.WinList do
for j = 1, #self.WinList[i] do
local huName = Hu_Type_Name[self.WinList[i][j].type]
if huName then
str1=str1..sp..huName.."x"..self.WinList[i][j].score
str1 = str1 .. sp .. huName .. "x" .. self.WinList[i][j].score
end
end
end
str1=str1.." "..huadd..""
str1 = str1 .. " " .. huadd .. ""
else
printlog("服务端自摸计算异常===>>>")
end
end
end
end
end
--
printlog("牌型计算==>>>",str1)
printlog("牌型计算==>>>", str1)
if data["ming_gang_num"]>0 then
str1=str1.." 明杠x"..data["ming_gang_num"]
if data["ming_gang_num"] > 0 then
str1 = str1 .. " 明杠x" .. data["ming_gang_num"]
end
if data["an_gang_num"]>0 then
str1=str1.." 暗杠x"..data["an_gang_num"]
if data["an_gang_num"] > 0 then
str1 = str1 .. " 暗杠x" .. data["an_gang_num"]
end
if data["dian_gang_num"]>0 then
str1=str1.." 点杠x"..data["dian_gang_num"]
if data["dian_gang_num"] > 0 then
str1 = str1 .. " 点杠x" .. data["dian_gang_num"]
end
if gangadd~=0 then
if gangadd>0 then
str1=str1.." +"..gangadd..""
if gangadd ~= 0 then
if gangadd > 0 then
str1 = str1 .. " +" .. gangadd .. ""
else
str1=str1.." "..gangadd..""
str1 = str1 .. " " .. gangadd .. ""
end
end
if data["ma_geng_gong"] and data["ma_geng_gong"]~=0 then
if data["ma_geng_gong"]>0 then
str1 = str1.." 马跟杠:+"..data["ma_geng_gong"]..""
if data["ma_geng_gong"] and data["ma_geng_gong"] ~= 0 then
if data["ma_geng_gong"] > 0 then
str1 = str1 .. " 马跟杠:+" .. data["ma_geng_gong"] .. ""
else
str1 = str1.." 马跟杠:"..data["ma_geng_gong"]..""
str1 = str1 .. " 马跟杠:" .. data["ma_geng_gong"] .. ""
end
end
if geng_zhuan and geng_zhuan~=0 then
if geng_zhuan>0 then
str1 = str1.." 跟庄:+"..geng_zhuan..""
if geng_zhuan and geng_zhuan ~= 0 then
if geng_zhuan > 0 then
str1 = str1 .. " 跟庄:+" .. geng_zhuan .. ""
else
str1 = str1.." 跟庄:"..geng_zhuan..""
str1 = str1 .. " 跟庄:" .. geng_zhuan .. ""
end
end
item:GetChild("score3").text=str1
item:GetChild("score4").text=str1
local paixingCtr=item:GetController("detail")
table.insert(self.PaiXingXiangQingCtrList,paixingCtr)
item:GetChild("score3").text = str1
item:GetChild("score4").text = str1
local paixingCtr = item:GetController("detail")
table.insert(self.PaiXingXiangQingCtrList, paixingCtr)
-------------------------
local hp_nonnegative = room:checkHpNonnegative()
@ -477,16 +452,16 @@ function M:FillItemData(room, data, item, active_player, niao)
end
if is_win then
item:GetController("bg").selectedIndex=1
item:GetController("bg").selectedIndex = 1
else
item:GetController("bg").selectedIndex=0
item:GetController("bg").selectedIndex = 0
end
local win_card = item:GetChild("win_card")
win_card.icon = "ui://Main_Majiang/202_"..data["win_card"]
win_card.icon = "ui://Main_Majiang/202_" .. data["win_card"]
if niao and #niao>0 then
local currentNiaoList=self:CalculateNiao(niao ,data["seat"])
if currentNiaoList and #currentNiaoList>0 then
if niao and #niao > 0 then
local currentNiaoList = self:CalculateNiao(niao, data["seat"])
if currentNiaoList and #currentNiaoList > 0 then
local lst_niao = item:GetChild("list_niao")
lst_niao:RemoveChildrenToPool()
for i = 1, #currentNiaoList do
@ -505,86 +480,86 @@ function M:FillItemData(room, data, item, active_player, niao)
end
end
function M:CalculateNiao(niaoList,seat)
local tempNiao={}
for i=1,#niaoList do
if niaoList[i].seat==seat then
table.insert(tempNiao,niaoList[i])
function M:CalculateNiao(niaoList, seat)
local tempNiao = {}
for i = 1, #niaoList do
if niaoList[i].seat == seat then
table.insert(tempNiao, niaoList[i])
end
end
return tempNiao
end
function M:FillItemData2(room, data, list)
-- 赋值result_info聊天室分享需要
local player_list = {}
for i = 1, #data do
player_list[i] = {}
local user = room:GetPlayerBySeat(data[i].seat).self_user
player_list[i].id = user.account_id
player_list[i].hp_info = data[i].hp_info
player_list[i].score = data[i].total_score
player_list[i].house = room.owner_id == player_list[i].id and 1 or 0
player_list[i].nick = user.nick_name
player_list[i].head_url = user.head_url
-- 赋值result_info聊天室分享需要
local player_list = {}
for i = 1, #data do
player_list[i] = {}
local user = room:GetPlayerBySeat(data[i].seat).self_user
player_list[i].id = user.account_id
player_list[i].hp_info = data[i].hp_info
player_list[i].score = data[i].total_score
player_list[i].house = room.owner_id == player_list[i].id and 1 or 0
player_list[i].nick = user.nick_name
player_list[i].head_url = user.head_url
local settle_log = data[i].settle_log
player_list[i].param = {}
player_list[i].param[1]={}
player_list[i].param[1].key = "自摸次数:"
player_list[i].param[1].value = tostring(data[i].settle_log.zimo)
player_list[i].param[2]={}
player_list[i].param[2].key = "接炮次数:"
player_list[i].param[2].value = tostring(data[i].settle_log.jie_pao)
player_list[i].param[3]={}
player_list[i].param[3].key = "点炮次数:"
player_list[i].param[3].value = tostring(data[i].settle_log.dian_pao)
player_list[i].param[4]={}
player_list[i].param[4].key = "暗杠次数:"
player_list[i].param[4].value = tostring(data[i].settle_log.an_kong)
player_list[i].param[5]={}
player_list[i].param[5].key = "明杠次数:"
player_list[i].param[5].value = tostring(data[i].settle_log.ming_kong)
end
local settle_log = data[i].settle_log
player_list[i].param = {}
player_list[i].param[1] = {}
player_list[i].param[1].key = "自摸次数:"
player_list[i].param[1].value = tostring(data[i].settle_log.zimo)
player_list[i].param[2] = {}
player_list[i].param[2].key = "接炮次数:"
player_list[i].param[2].value = tostring(data[i].settle_log.jie_pao)
player_list[i].param[3] = {}
player_list[i].param[3].key = "点炮次数:"
player_list[i].param[3].value = tostring(data[i].settle_log.dian_pao)
player_list[i].param[4] = {}
player_list[i].param[4].key = "暗杠次数:"
player_list[i].param[4].value = tostring(data[i].settle_log.an_kong)
player_list[i].param[5] = {}
player_list[i].param[5].key = "明杠次数:"
player_list[i].param[5].value = tostring(data[i].settle_log.ming_kong)
end
local round = room.room_config.round
self:GenerateRoomResultInfo(round, room.room_config:GetGameName(), room.room_id, room.create_time, player_list)
local round = room.room_config.round
self:GenerateRoomResultInfo(round, room.room_config:GetGameName(), room.room_id, room.create_time, player_list)
local big_result = self._view:GetChild("big_result")
big_result:GetChild("txt_room_info").text = string.format("%s 房号%s 局%s/%s", os.date("%Y/%m/%d", os.time()), room.room_id, room.curren_round, room.room_config.round)
local lst_p = big_result:GetChild("player_list")
if #player_list == 3 then
big_result:GetChild("txt_room_info").text = string.format("%s 房号%s 局%s/%s", os.date("%Y/%m/%d", os.time()),
room.room_id, room.curren_round, room.room_config.round)
local lst_p = big_result:GetChild("player_list")
if #player_list == 3 then
lst_p.columnGap = 108
elseif #player_list == 2 then
lst_p.columnGap = 208
end
self:InitBigResult(room, 30)
self:InitBigResult(room, 30)
local show_detail = room.hpOnOff == 1
for i = 1, lst_p.numChildren do
local com_p = lst_p:GetChildAt(i - 1)
com_p:GetController("jsicon").selectedIndex=i-1
local list_param = com_p:GetChild("list_param")
for j = 1, list_param.numChildren do
local tem = list_param:GetChildAt(j - 1)
tem:GetChild("txt_value").textFormat.size = 30
end
if show_detail then
local score = 0
if com_p:GetController("pn").selectedIndex == 0 then
score = com_p:GetChild("txt_navigate").text
else
score = com_p:GetChild("txt_positive").text
end
score = score / room.score_times
com_p:GetChild("tex_detail_score").text = string.format("%s × %s倍", score, room.score_times)
end
end
for i = 1, lst_p.numChildren do
local com_p = lst_p:GetChildAt(i - 1)
com_p:GetController("jsicon").selectedIndex = i - 1
local list_param = com_p:GetChild("list_param")
for j = 1, list_param.numChildren do
local tem = list_param:GetChildAt(j - 1)
tem:GetChild("txt_value").textFormat.size = 30
end
if show_detail then
local score = 0
if com_p:GetController("pn").selectedIndex == 0 then
score = com_p:GetChild("txt_navigate").text
else
score = com_p:GetChild("txt_positive").text
end
score = score / room.score_times
com_p:GetChild("tex_detail_score").text = string.format("%s × %s倍", score, room.score_times)
end
end
if room.group_id ~= 0 then
big_result:GetController("group").selectedIndex = 1
end
DataManager.CurrenRoom = nil
if room.group_id ~= 0 then
big_result:GetController("group").selectedIndex = 1
end
DataManager.CurrenRoom = nil
end
function M:LoadHead(p, room)
@ -600,8 +575,8 @@ end
local prefix
function M:GetPrefix()
-- if not prefix then
prefix = get_majiang_prefix(10)
-- end
prefix = get_majiang_prefix(10)
-- end
return prefix
end

View File

@ -101,11 +101,13 @@ function M:UpdateRound()
end
function M:ShowJing()
print("==========================================self._room.jing", self._room.jing, self.jing)
if self._room.jing then
self.jing.icon = 'ui://Main_Majiang/' ..
get_majiang_prefix(DataManager.CurrenRoom.game_id) .. "201_" .. self._room.jing
self.jing.visible = true
if self.jing:GetController('jing') then
self.jing:GetController('jing').selectedIndex = 1
end
else
self.jing.visible = false
end
@ -151,12 +153,13 @@ function M:EventInit()
_gamectr:AddEventListener(TX_GameEvent.EventBuGang, function(...)
local arg = { ... }
self:__BuGang(arg[1],
function(id)
printlog(id)
_gamectr:SendGangCard(id)
self:__CloseGangTip()
end)
_gamectr:SendGangCard(arg[1][1])
-- self:__BuGang(arg[1],
-- function(id)
-- printlog(id)
-- _gamectr:SendGangCard(id)
-- self:__CloseGangTip()
-- end)
end)

View File

@ -110,6 +110,7 @@ function M:UpdateHandCard(getcard, mp)
end
function M:__OnClickHandCard(context)
print("==========================__OnClickHandCard")
local button = context.sender
local _carViewList = self._carViewList
local refresh = true

View File

@ -10,17 +10,15 @@ local RunFast_PlayerPokerInfoView = {
local M = RunFast_PlayerPokerInfoView
function M.new( view,mainView )
function M.new(view, mainView)
local self = {}
setmetatable(self, {__index = M})
setmetatable(self, { __index = M })
self._view = view
self._mainView = mainView
self:init()
return self
end
function M:init()
local view = self._view
self._gameCtr = ControllerManager.GetController(GameController)
@ -41,8 +39,8 @@ function M:init()
self.ani_result_score = view:GetTransition("score_1")
end
function M:SetOutCardInfo(cardlist,isPass,isAnim)
self.outpoker_list:RemoveChildren(0,-1,true)
function M:SetOutCardInfo(cardlist, isPass, isAnim)
self.outpoker_list:RemoveChildren(0, -1, true)
if cardlist == nil then
if isPass == true then
self.ctr_outpoker.selectedIndex = 2
@ -71,37 +69,36 @@ function M:SetOutCardInfo(cardlist,isPass,isAnim)
-- -- body
-- card_code_obj = UIPackage.CreateObjectFromURL("ui://Extend_Poker_RunFast/"..code.."_1")
-- end
if DataManager.CurrenRoom.pai==0 then
if code==310 and DataManager.CurrenRoom.room_config.Heart10 == 1 then
if DataManager.CurrenRoom.pai == 0 then
if code == 310 and DataManager.CurrenRoom.room_config.Heart10 == 1 then
-- body
card_code_obj = UIPackage.CreateObjectFromURL("ui://Extend_Poker_RunFastNew/"..code.."_1")
card_code_obj = UIPackage.CreateObjectFromURL("ui://Extend_Poker_RunFastNew/" .. code .. "_1")
else
card_code_obj = UIPackage.CreateObjectFromURL("ui://Extend_Poker_RunFastNew/"..code)
card_code_obj = UIPackage.CreateObjectFromURL("ui://Extend_Poker_RunFastNew/" .. code)
end
else
if code==310 and DataManager.CurrenRoom.room_config.Heart10 == 1 then
if code == 310 and DataManager.CurrenRoom.room_config.Heart10 == 1 then
-- body
card_code_obj = UIPackage.CreateObjectFromURL("ui://Extend_Poker_RunFastNew/"..code.."_2")
card_code_obj = UIPackage.CreateObjectFromURL("ui://Extend_Poker_RunFastNew/" .. code .. "_2")
else
card_code_obj = UIPackage.CreateObjectFromURL("ui://Main_Poker/" .. code .. "_2")
end
end
if card_code_obj == nil then
card_code_obj = UIPackage.CreateObjectFromURL("ui://Main_Poker/00")
end
--card_code_obj:SetScale(1,1)
poker_item:AddChild(card_code_obj)
--local poker = self:CreatPoker(cardlist[i],0.7)
self.outpoker_list:AddChild(poker_item)
poker_item.xy = Vector2.New(self.out_card_data["start_x"],self.out_card_data["start_y"])
poker_item:TweenMove(self:GetOutCardEndPokerPos(i,#cardlist,self.outpoker_list,poker_item,self.out_card_data["maxcount_x"],1),time)
poker_item.xy = Vector2.New(self.out_card_data["start_x"], self.out_card_data["start_y"])
poker_item:TweenMove(
self:GetOutCardEndPokerPos(i, #cardlist, self.outpoker_list, poker_item, self.out_card_data
["maxcount_x"], 1.5), time)
--card_code_obj
-- self.tween = TweenUtils.TweenFloat(1,0.7,time,function(x)
-- card_code_obj:SetScale(x,x)
-- end)
card_code_obj:SetScale(0.7,0.7)
card_code_obj:SetScale(1.5, 1.5)
end
self.move_cor = coroutine.start(function()
coroutine.wait(0.1)
@ -112,31 +109,30 @@ function M:SetOutCardInfo(cardlist,isPass,isAnim)
local poker_item = UIPackage.CreateObject("Extend_Poker_RunFastNew", "poker7")
local code = self:ChangeCodeByTo(cardlist[i])
local card_code_obj
if DataManager.CurrenRoom.pai==0 then
if code==310 and DataManager.CurrenRoom.room_config.Heart10 == 1 then
if DataManager.CurrenRoom.pai == 0 then
if code == 310 and DataManager.CurrenRoom.room_config.Heart10 == 1 then
-- body
card_code_obj = UIPackage.CreateObjectFromURL("ui://Extend_Poker_RunFastNew/"..code.."_1")
card_code_obj = UIPackage.CreateObjectFromURL("ui://Extend_Poker_RunFastNew/" .. code .. "_1")
else
card_code_obj = UIPackage.CreateObjectFromURL("ui://Extend_Poker_RunFastNew/"..code)
card_code_obj = UIPackage.CreateObjectFromURL("ui://Extend_Poker_RunFastNew/" .. code)
end
else
if code==310 and DataManager.CurrenRoom.room_config.Heart10 == 1 then
if code == 310 and DataManager.CurrenRoom.room_config.Heart10 == 1 then
-- body
card_code_obj = UIPackage.CreateObjectFromURL("ui://Extend_Poker_RunFastNew/"..code.."_2")
card_code_obj = UIPackage.CreateObjectFromURL("ui://Extend_Poker_RunFastNew/" .. code .. "_2")
else
card_code_obj = UIPackage.CreateObjectFromURL("ui://Main_Poker/" .. code .. "_2")
end
end
if card_code_obj == nil then
card_code_obj = UIPackage.CreateObjectFromURL("ui://Main_Poker/00")
end
card_code_obj:SetScale(0.7,0.7)
card_code_obj:SetScale(1.5, 1.5)
poker_item:AddChild(card_code_obj)
--local poker = self:CreatPoker(cardlist[i],0.7)
self.outpoker_list:AddChild(poker_item)
poker_item.xy = self:GetOutCardEndPokerPos(i,#cardlist,self.outpoker_list,poker_item,self.out_card_data["maxcount_x"],1)
poker_item.xy = self:GetOutCardEndPokerPos(i, #cardlist, self.outpoker_list, poker_item,
self.out_card_data["maxcount_x"], 1.5)
end
end
--self.ctr_outpoker.selectedIndex = 1
@ -145,23 +141,24 @@ end
function M:SetOutCardBlack()
for i = 0, self.outpoker_list.numChildren - 1 do
self.outpoker_list:GetChildAt(i):GetChildAt(0):GetChildAt(0):GetChildAt(0).color = Color(0.7,0.7,0.7)
self.outpoker_list:GetChildAt(i):GetChildAt(0):GetChildAt(0):GetChildAt(0).color = Color(0.7, 0.7, 0.7)
end
end
-- 12 -61 --11 58 --10 55 --46
function M:GetOffSet(cardLength) -- 15 -70
function M:GetOffSet(cardLength) -- 15 -70
if cardLength > 8 then
return 52--40
return 52 --40
else
return - cardLength * 5 + 80
return -cardLength * 5 + 80
end
end
function M:GetOutCardEndFirstPokerPos(count,parent_com,poker_obj,max_count,scale)
local parent_width,parent_height = parent_com.width,parent_com.height
local poker_width,poker_height = poker_obj.width * scale,poker_obj.height * scale
function M:GetOutCardEndFirstPokerPos(count, parent_com, poker_obj, max_count, scale)
local parent_width, parent_height = parent_com.width, parent_com.height
local poker_width, poker_height = poker_obj.width * scale, poker_obj.height * scale
local offset = self:GetOffSet(count)
local x,y = 0,0
local x, y = 0, 0
--local length = (count - 1) * (poker_width + offset) + poker_width
--if length <= parent_width then
-- x = (parent_width - length) / 2
@ -171,22 +168,22 @@ function M:GetOutCardEndFirstPokerPos(count,parent_com,poker_obj,max_count,scale
local length = (count - 1) * offset + poker_width
x = (parent_width - length) / 2
y = ((parent_height - poker_height) / 2)
end
return Vector2.New(x,y)
return Vector2.New(x, y)
end
function M:GetOutCardEndPokerPos(index,count,parent_com,poker_obj,max_count,scale)
local offset_x,offset_y = self:GetOffSet(count),-50
local start_pos = self:GetOutCardEndFirstPokerPos(count,parent_com,poker_obj,max_count,scale)
local poker_width,poker_height = poker_obj.width * scale,poker_obj.height * scale
local parent_width,parent_height = parent_com.width,parent_com.height
local pos_x,pos_y = start_pos.x + (index - 1) * offset_x,start_pos.y
function M:GetOutCardEndPokerPos(index, count, parent_com, poker_obj, max_count, scale)
local offset_x, offset_y = self:GetOffSet(count), -100
local start_pos = self:GetOutCardEndFirstPokerPos(count, parent_com, poker_obj, max_count, scale)
local poker_width, poker_height = poker_obj.width * scale, poker_obj.height * scale
local parent_width, parent_height = parent_com.width, parent_com.height
local pos_x, pos_y = start_pos.x + (index - 1) * offset_x, start_pos.y
if index > max_count then
pos_x = (index - max_count - 1) * offset_x
pos_y = pos_y + poker_height + offset_y
end
return Vector2.New(pos_x,pos_y)
return Vector2.New(pos_x, pos_y)
end
-- function M:PlayCardTypeEff(type1)
@ -219,13 +216,13 @@ end
-- end)
-- end
function M:PlayScore(score,isBomb,isWin)
function M:PlayScore(score, isBomb, isWin)
if score == nil then
self.text_bomb_score.alpha = 0
return
end
if isBomb then
self.text_bomb_score.text = score >= 0 and "+"..score or tostring(score)
self.text_bomb_score.text = score >= 0 and "+" .. score or tostring(score)
self.text_bomb_score.grayed = score < 0
self.ani_bomb_score:Play()
else
@ -233,48 +230,45 @@ function M:PlayScore(score,isBomb,isWin)
self.text_bomb_score.text = tostring(score)
self.text_bomb_score.grayed = true
elseif score > 0 then
self.text_bomb_score.text = "+"..score
self.text_bomb_score.text = "+" .. score
self.text_bomb_score.grayed = false
else
local str = isWin and "+" or "-"
self.text_bomb_score.text = str..score
self.text_bomb_score.text = str .. score
self.text_bomb_score.grayed = not isWin
end
self.ani_result_score:Play()
end
end
function M:UpdateHandPoker(cardList,isPlayAni,isMing)
function M:UpdateHandPoker(cardList, isPlayAni, isMing)
if self.cor_init_poker ~= nil then
coroutine.stop(self.cor_init_poker)
end
self.cor_init_poker = nil
self.card_list = {}
self.hand_card_list:RemoveChildren(0,-1,true)
self.hand_card_list:RemoveChildren(0, -1, true)
local card_length
local new_card_list
if isMing == true then
new_card_list = self._gameCtr:ChangeCodeByFrom(cardList,true)
new_card_list = self._gameCtr:ChangeCodeByFrom(cardList, true)
card_length = #cardList
else
card_length = cardList
end
if isPlayAni == true then
self.cor_init_poker = coroutine.start(function()
for i = card_length, 1,-1 do
for i = card_length, 1, -1 do
local code = isMing == true and new_card_list[i] or 0
coroutine.wait(0.01)
local poker = self:CreatPoker1(code,0.4)
local poker = self:CreatPoker1(code, 0.4)
self.hand_card_list:AddChild(poker)
end
end)
else
for i = card_length, 1,-1 do
for i = card_length, 1, -1 do
local code = isMing == true and new_card_list[i] or 0
local poker = self:CreatPoker1(code,0.4)
local poker = self:CreatPoker1(code, 0.4)
self.hand_card_list:AddChild(poker)
end
end
@ -283,7 +277,7 @@ end
function M:SetRemainCardNumber(isPlay)
if isPlay then
self.ctr_one_card.selectedIndex = 1
self.eff_one_card:Play(-1,0,nil)
self.eff_one_card:Play(-1, 0, nil)
else
self.ctr_one_card.selectedIndex = 0
end
@ -293,73 +287,65 @@ function M:SetRemainCardNumber(isPlay)
--end
end
function M:CreatPoker1(poker,scale,bank)
local poker_item = UIPackage.CreateObject("Extend_Poker_RunFastNew", "poker"..scale * 10)
function M:CreatPoker1(poker, scale, bank)
local poker_item = UIPackage.CreateObject("Extend_Poker_RunFastNew", "poker" .. scale * 10)
local code = self:ChangeCodeByTo(poker)
local card_code_obj
if DataManager.CurrenRoom.pai==0 then
if code==310 and DataManager.CurrenRoom.room_config.Heart10 == 1 then
if DataManager.CurrenRoom.pai == 0 then
if code == 310 and DataManager.CurrenRoom.room_config.Heart10 == 1 then
-- body
card_code_obj = UIPackage.CreateObjectFromURL("ui://Extend_Poker_RunFastNew/"..code.."_1")
card_code_obj = UIPackage.CreateObjectFromURL("ui://Extend_Poker_RunFastNew/" .. code .. "_1")
else
card_code_obj = UIPackage.CreateObjectFromURL("ui://Extend_Poker_RunFastNew/"..code)
card_code_obj = UIPackage.CreateObjectFromURL("ui://Extend_Poker_RunFastNew/" .. code)
end
else
if code==310 and DataManager.CurrenRoom.room_config.Heart10 == 1 then
if code == 310 and DataManager.CurrenRoom.room_config.Heart10 == 1 then
-- body
card_code_obj = UIPackage.CreateObjectFromURL("ui://Extend_Poker_RunFastNew/"..code.."_2")
card_code_obj = UIPackage.CreateObjectFromURL("ui://Extend_Poker_RunFastNew/" .. code .. "_2")
else
card_code_obj = UIPackage.CreateObjectFromURL("ui://Main_Poker/" .. code .. "_2")
end
end
if card_code_obj == nil or bank==1 then
if card_code_obj == nil or bank == 1 then
card_code_obj = UIPackage.CreateObjectFromURL("ui://Main_Poker/00")
end
card_code_obj:SetScale(scale,scale)
card_code_obj:SetScale(scale, scale)
poker_item:AddChild(card_code_obj)
return poker_item
end
function M:CreatPoker(poker,scale,bank)
local poker_item = UIPackage.CreateObject("Extend_Poker_RunFastNew", "poker"..12.5)
function M:CreatPoker(poker, scale, bank)
local poker_item = UIPackage.CreateObject("Extend_Poker_RunFastNew", "poker" .. 12.5)
local code = self:ChangeCodeByTo(poker)
local card_code_obj
if DataManager.CurrenRoom.pai==0 then
if code==310 and DataManager.CurrenRoom.room_config.Heart10 == 1 then
if DataManager.CurrenRoom.pai == 0 then
if code == 310 and DataManager.CurrenRoom.room_config.Heart10 == 1 then
-- body
card_code_obj = UIPackage.CreateObjectFromURL("ui://Extend_Poker_RunFastNew/"..code.."_1")
card_code_obj = UIPackage.CreateObjectFromURL("ui://Extend_Poker_RunFastNew/" .. code .. "_1")
else
card_code_obj = UIPackage.CreateObjectFromURL("ui://Extend_Poker_RunFastNew/"..code)
card_code_obj = UIPackage.CreateObjectFromURL("ui://Extend_Poker_RunFastNew/" .. code)
end
else
if code==310 and DataManager.CurrenRoom.room_config.Heart10 == 1 then
if code == 310 and DataManager.CurrenRoom.room_config.Heart10 == 1 then
-- body
card_code_obj = UIPackage.CreateObjectFromURL("ui://Extend_Poker_RunFastNew/"..code.."_2")
card_code_obj = UIPackage.CreateObjectFromURL("ui://Extend_Poker_RunFastNew/" .. code .. "_2")
else
card_code_obj = UIPackage.CreateObjectFromURL("ui://Main_Poker/" .. code .. "_2")
end
end
if card_code_obj == nil or bank==1 then
if card_code_obj == nil or bank == 1 then
card_code_obj = UIPackage.CreateObjectFromURL("ui://Main_Poker/00")
end
card_code_obj:SetScale(scale,scale)
card_code_obj:SetScale(scale, scale)
poker_item:AddChild(card_code_obj)
return poker_item
end
function M:ChangeCodeByTo( card )
function M:ChangeCodeByTo(card)
local flower = card % 10
local number = math.floor(card / 10)
if number == 15 then
@ -368,13 +354,12 @@ function M:ChangeCodeByTo( card )
return flower * 100 + number
end
function M:Clear()
self:PlayScore(nil)
self:SetRemainCardNumber(false)
self:SetOutCardInfo(nil,false)
self.hand_card_list:RemoveChildren(0,-1,true)
self._mask_liangpai:RemoveChildren(0,-1,true)
self:SetOutCardInfo(nil, false)
self.hand_card_list:RemoveChildren(0, -1, true)
self._mask_liangpai:RemoveChildren(0, -1, true)
end
function M:Destroy()

View File

@ -17,7 +17,7 @@ local CardView = {
local function NewCardView(card, cardcodenum, cardcodeflower)
local self = {}
setmetatable(self, {__index = CardView})
setmetatable(self, { __index = CardView })
self.btn_card = card
self.card_code_number = cardcodenum
self.card_code_flower = cardcodeflower
@ -38,8 +38,8 @@ local RunFast_PlayerSelfPokerInfoView = {
local M = RunFast_PlayerSelfPokerInfoView
function M.new(view, mainView)
setmetatable(M, {__index = RunFast_PlayerPokerInfoView})
local self = setmetatable({}, {__index = M})
setmetatable(M, { __index = RunFast_PlayerPokerInfoView })
local self = setmetatable({}, { __index = M })
self._view = view
self._mainView = mainView
self.gameCtr = ControllerManager.GetController(GameController)
@ -88,12 +88,13 @@ function M:InitPoker(pokerList, isPlayAni, open)
-- self.zhizhanplay=0
-- self.zhizhanzdts=0
local cs = 1.25
if DataManager.CurrenRoom.cardsize==0 then
cs = 1.35
print("==========================DataManager.CurrenRoom.cardsize", DataManager.CurrenRoom.cardsize)
if DataManager.CurrenRoom.cardsize == 0 then
cs = 2
elseif DataManager.CurrenRoom.cardsize == 1 then
cs = 1.25
cs = 1.8
elseif DataManager.CurrenRoom.cardsize == 2 then
cs = 1.15
cs = 1.5
end
if self.cor_init_poker ~= nil then
@ -107,73 +108,72 @@ function M:InitPoker(pokerList, isPlayAni, open)
if isPlayAni == true then
self.cor_init_poker =
coroutine.start(
function()
self._mainView._popEvent = false
if self._mainView._rightPanelView._settingView ~= nil then
self._mainView._rightPanelView._settingView:SetBtnDismissRoomEnable(false)
end
table.sort(pokerList)
function()
self._mainView._popEvent = false
if self._mainView._rightPanelView._settingView ~= nil then
self._mainView._rightPanelView._settingView:SetBtnDismissRoomEnable(false)
end
table.sort(pokerList)
for i = 1, #pokerList do
local card_number_code = self:ChangeOneCodeByFrom(pokerList[i])
local card_flower_code = pokerList[i]
local btn_card = self:CreatPoker(card_number_code, cs, open)
local x, y = self._view.width / 2 + 100, -200
btn_card:SetXY(x, y)
btn_card.alpha = 0
btn_card.touchable = false
-- coroutine.wait(0.05)
self.cards_view:AddChild(btn_card)
local card_view = NewCardView(btn_card, card_number_code, card_flower_code)
self.card_list[#self.card_list + 1] = card_view
for i = 1, #pokerList do
local card_number_code = self:ChangeOneCodeByFrom(pokerList[i])
local card_flower_code = pokerList[i]
local btn_card = self:CreatPoker(card_number_code, cs, open)
local x, y = self._view.width / 2 + 100, -200
btn_card:SetXY(x, y)
btn_card.alpha = 0
btn_card.touchable = false
-- coroutine.wait(0.05)
self.cards_view:AddChild(btn_card)
local card_view = NewCardView(btn_card, card_number_code, card_flower_code)
self.card_list[#self.card_list + 1] = card_view
table.sort(self.card_list, tableSortNumber)
table.sort(self.card_list, tableSortNumber)
if i == #pokerList then
for j = 1, #self.card_list do
local card = self.card_list[j]
card.btn_card.touchable = true
if open ~= 1 then
-- body
self:AddCardMoveEvent(card)
if i == #pokerList then
for j = 1, #self.card_list do
local card = self.card_list[j]
card.btn_card.touchable = true
if open ~= 1 then
-- body
self:AddCardMoveEvent(card)
end
end
end
end
end
for j = #self.card_list, 1, -1 do
-- ViewUtil.PlaySound('RunFastNew_PK', 'extend/poker/runfast/sound/mopai.mp3')
local card_view = self.card_list[j]
card_view.index = j
self.cards_view:SetChildIndex(card_view.btn_card, card_view.index - 1)
for j = #self.card_list, 1, -1 do
-- ViewUtil.PlaySound('RunFastNew_PK', 'extend/poker/runfast/sound/mopai.mp3')
local card_view = self.card_list[j]
card_view.index = j
self.cards_view:SetChildIndex(card_view.btn_card, card_view.index - 1)
card_view.btn_card:TweenMove(self:GetHandCardPos(j, #self.card_list), 0.10)
DSTween.To(
0.7,
1,
0.1,
function(value)
card_view.btn_card:SetScale(value, value)
end
)
DSTween.To(
0.7,
1,
0.1,
function(value)
card_view.btn_card.alpha = value
end
)
card_view.btn_card.alpha = 1
end
card_view.btn_card:TweenMove(self:GetHandCardPos(j, #self.card_list), 0.10)
DSTween.To(
0.7,
1,
0.1,
function(value)
card_view.btn_card:SetScale(value, value)
end
)
DSTween.To(
0.7,
1,
0.1,
function(value)
card_view.btn_card.alpha = value
end
)
card_view.btn_card.alpha = 1
end
self._mainView._popEvent = true
if self._mainView._rightPanelView._settingView ~= nil then
self._mainView._rightPanelView._settingView:SetBtnDismissRoomEnable(true)
self._mainView._popEvent = true
if self._mainView._rightPanelView._settingView ~= nil then
self._mainView._rightPanelView._settingView:SetBtnDismissRoomEnable(true)
end
end
end
)
)
else
for i = 1, #pokerList do
local card_number_code = self:ChangeOneCodeByFrom(pokerList[i])
local card_flower_code = pokerList[i]
@ -197,7 +197,6 @@ function M:InitPoker(pokerList, isPlayAni, open)
end
function M:updatePoker()
local templist = {}
for i = 1, #self.card_list do
templist[#templist + 1] = self.card_list[i].card_code_flower
@ -246,21 +245,21 @@ function M:AddCardMoveEvent(card)
if k == #self.card_list then
if
card.btn_card.x + self.card_width > min_x and card.btn_card.x < max_x and
card.card_isTouchable == 0
then
card.card_isTouchable == 0
then
self:UpdateCardMove(card.btn_card, not card.btn_card.selected, false)
--ViewUtil.PlaySound("RunFastNew_PK", "extend/poker/paodekuai/sound/click.mp3")
--ViewUtil.PlaySound("RunFastNew_PK", "extend/poker/paodekuai/sound/click.mp3")
end
else
if
card.btn_card.x +
(self.card_width + self:GetHandCardOffset(#self.card_list)) >
min_x and
card.btn_card.x < max_x and
card.card_isTouchable == 0
then
(self.card_width + self:GetHandCardOffset(#self.card_list)) >
min_x and
card.btn_card.x < max_x and
card.card_isTouchable == 0
then
self:UpdateCardMove(card.btn_card, not card.btn_card.selected, false)
--ViewUtil.PlaySound("RunFastNew_PK", "extend/poker/paodekuai/sound/click.mp3")
--ViewUtil.PlaySound("RunFastNew_PK", "extend/poker/paodekuai/sound/click.mp3")
end
end
end
@ -286,21 +285,21 @@ function M:AddCardMoveEvent(card)
if k == #self.card_list then
if
card.btn_card.x + self.card_width > min_x and card.btn_card.x < max_x and
card.card_isTouchable == 0
then
card.card_isTouchable == 0
then
self:UpdateCardMove(card.btn_card, not card.btn_card.selected, false)
--ViewUtil.PlaySound("RunFastNew_PK", "extend/poker/paodekuai/sound/click.mp3")
--ViewUtil.PlaySound("RunFastNew_PK", "extend/poker/paodekuai/sound/click.mp3")
end
else
if
card.btn_card.x +
(self.card_width + self:GetHandCardOffset(#self.card_list)) >
min_x and
card.btn_card.x < max_x and
card.card_isTouchable == 0
then
(self.card_width + self:GetHandCardOffset(#self.card_list)) >
min_x and
card.btn_card.x < max_x and
card.card_isTouchable == 0
then
self:UpdateCardMove(card.btn_card, not card.btn_card.selected, false)
--ViewUtil.PlaySound("RunFastNew_PK", "extend/poker/paodekuai/sound/click.mp3")
--ViewUtil.PlaySound("RunFastNew_PK", "extend/poker/paodekuai/sound/click.mp3")
end
end
end
@ -340,6 +339,7 @@ function M:AddCardMoveEvent(card)
end
)
end
function M:zhizhanxuanpai() --智障选牌
-- body
local temp_send_card = {}
@ -409,8 +409,8 @@ function M:TouchMoving(context)
else
if
card.btn_card.x + (self.card_width + self:GetHandCardOffset(#self.card_list)) > min_x and
card.btn_card.x < max_x
then
card.btn_card.x < max_x
then
printlog("cccccccccccccc22222222222222")
self:SetBtnCardColor(card, 0.8)
if #send_card1 == 0 then
@ -440,8 +440,8 @@ function M:TouchMoving(context)
else
if
card.btn_card.x + (self.card_width + self:GetHandCardOffset(#self.card_list)) > min_x and
card.btn_card.x < max_x
then
card.btn_card.x < max_x
then
-- self:UpdateCardMove(card.btn_card, not card.btn_card.selected, false)
-- card.card_isTouchable = 1
-- ViewUtil.PlaySound("RunFastNew_PK", "extend/poker/paodekuai/sound/click.mp3")
@ -478,8 +478,8 @@ end
function M:SetBtnCardColor(card, num)
if
card.btn_card:GetChildAt(0) ~= nil and card.btn_card:GetChildAt(0):GetChildAt(0) ~= nil and
card.btn_card:GetChildAt(0):GetChildAt(0):GetChildAt(0) ~= nil
then
card.btn_card:GetChildAt(0):GetChildAt(0):GetChildAt(0) ~= nil
then
-- body
card.btn_card:GetChildAt(0):GetChildAt(0):GetChildAt(0).color = Color(num, num, num)
end
@ -573,15 +573,14 @@ end
function M:SetOutCardBlack()
for i = 1, #self.out_card_list do
local card = self.out_card_list[i]
if card and card:GetChildAt(0) and card:GetChildAt(0):GetChildAt(0) and card:GetChildAt(0):GetChildAt(0):GetChildAt(0) then
card:GetChildAt(0):GetChildAt(0):GetChildAt(0).color = Color(0.7, 0.7, 0.7)
end
if card and card:GetChildAt(0) and card:GetChildAt(0):GetChildAt(0) and card:GetChildAt(0):GetChildAt(0):GetChildAt(0) then
card:GetChildAt(0):GetChildAt(0):GetChildAt(0).color = Color(0.7, 0.7, 0.7)
end
end
end
function M:SetOutCardList(cardlist, isAnim)
local pos_y = -200
local pos_y = -320
if isAnim then
-- self.zhizhanctr_select=0
-- self.zhizhantype=0
@ -606,34 +605,34 @@ function M:SetOutCardList(cardlist, isAnim)
-- todo 出牌动画
local pos =
self:GetOutCardEndPokerPos(
i,
#cardlist,
self.cards_view,
card.btn_card,
self.out_card_data['maxcount_x'],
0.7
)
i,
#cardlist,
self.cards_view,
card.btn_card,
self.out_card_data['maxcount_x'],
1.5
)
card.btn_card:TweenMove(Vector2.New(pos.x, pos_y), time)
-- self.tween = TweenUtils.TweenFloat(1, 0.7, time, function(x)
-- card.btn_card:GetChildAt(0):SetScale(x, x)
-- end)
card.btn_card:GetChildAt(0):SetScale(0.7, 0.7)
card.btn_card:GetChildAt(0):SetScale(1.5, 1.5)
break
end
end
end
self.move_cor =
coroutine.start(
function()
coroutine.wait(0.05)
for i = 1, #self.out_card_list do
local card = self.out_card_list[i]
self.cards_view:SetChildIndex(card, i - 1)
function()
coroutine.wait(0.05)
for i = 1, #self.out_card_list do
local card = self.out_card_list[i]
self.cards_view:SetChildIndex(card, i - 1)
end
coroutine.wait(0.1)
ViewUtil.PlaySound('RunFastNew_PK', 'extend/poker/runfast/sound/chupai.mp3')
end
coroutine.wait(0.1)
ViewUtil.PlaySound('RunFastNew_PK', 'extend/poker/runfast/sound/chupai.mp3')
end
)
)
else
for i = 1, #cardlist do
local poker_item = UIPackage.CreateObject('Extend_Poker_RunFastNew', 'poker7')
@ -667,19 +666,19 @@ function M:SetOutCardList(cardlist, isAnim)
if card_code_obj == nil then
card_code_obj = UIPackage.CreateObjectFromURL('ui://Main_Poker/00')
end
card_code_obj:SetScale(0.7, 0.7)
card_code_obj:SetScale(1.5, 1.5)
poker_item:AddChild(card_code_obj)
--local poker = self:CreatPoker(cardlist[i],0.7)
self.cards_view:AddChild(poker_item)
local pos =
self:GetOutCardEndPokerPos(
i,
#cardlist,
self.cards_view,
poker_item,
self.out_card_data['maxcount_x'],
1
)
i,
#cardlist,
self.cards_view,
poker_item,
self.out_card_data['maxcount_x'],
1.5
)
poker_item.xy = Vector2.New(pos.x, pos_y)
self.out_card_list[#self.out_card_list + 1] = poker_item
end
@ -759,10 +758,10 @@ function M:BtnEvent()
end
local send_card = {}
self.send_card = {}
local currentCard={}
local currentCard = {}
for i = 1, #self.card_list do
local card = self.card_list[i]
table.insert(currentCard,card.card_code_flower)
table.insert(currentCard, card.card_code_flower)
if card.btn_card.selected then
send_card[#send_card + 1] = card.card_code_flower
self.send_card[#self.send_card + 1] = card
@ -772,7 +771,7 @@ function M:BtnEvent()
if #send_card == 0 then
self:ErrorTip('请选择要出的牌 ')
else
self.gameCtr:SendCard(send_card,currentCard)
self.gameCtr:SendCard(send_card, currentCard)
end
end
)
@ -836,15 +835,15 @@ function M:ShowTipsCard(index)
end
function M:GetHandCardOffset(count)
local start = -70---54
local start = -90 ---54
local offset = 0
if count > 10 then
offset = start - count + 18
offset = start - count + 26
else
offset = -50
offset = -30
end
return offset
return -25
end
function M:GetHandCardPos(index, card_count)
@ -855,6 +854,7 @@ function M:GetHandCardPos(index, card_count)
x = start_x + (self.card_width + offset) * (index - 1)
return Vector2.New(x, y)
end
function M:GetHandCardPos1(index, card_count)
local x, y = 0, -18
local offset = self:GetHandCardOffset(card_count)
@ -863,6 +863,7 @@ function M:GetHandCardPos1(index, card_count)
x = start_x + (self.card_width + offset) * (index - 1)
return x, y
end
function M:ChangeOneCodeByFrom(card)
local flower = math.floor(card / 100)
local number = card % 100
@ -879,13 +880,13 @@ function M:ErrorTip(error_text)
self.cor_init_poker = nil
self.cor_init_poker =
coroutine.start(
function()
self.put_error_text.text = error_text
self.ctr_put_error.selectedIndex = 1
coroutine.wait(2)
self.ctr_put_error.selectedIndex = 0
end
)
function()
self.put_error_text.text = error_text
self.ctr_put_error.selectedIndex = 1
coroutine.wait(2)
self.ctr_put_error.selectedIndex = 0
end
)
end
--RunFast_CardType
@ -904,7 +905,7 @@ end
function M:GetCardTips(type, number, length, mustPutMaxCard, tip_templist)
local tip_list = {}
local sidaisan = false
local touch_key_list = {3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}
local touch_key_list = { 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }
--printlog("aaaaaaaaaaaaacccccccccccccccccccc11111111111111111111111111111")
--pt(self.card_list)
local card_map, max_key = self:GetCardMapAndMaxKey(self.card_list)
@ -996,7 +997,7 @@ end
-- 合并多个list
function M:GetMergeAllList(...)
local lists = {...}
local lists = { ... }
local merge_list = {}
for i = 1, #lists do
local list_item = lists[i]
@ -1024,13 +1025,13 @@ function M:CheckOneCard(pokerMap, num, length)
end
for k, v in pairs(pokerMap) do
if k > num and #v == 1 then
one_card_list[#one_card_list + 1] = {v[1]}
one_card_list[#one_card_list + 1] = { v[1] }
touch_key_list[#touch_key_list + 1] = k
end
end
for k, v in pairs(pokerMap) do
if k > num and #v ~= 1 then
one_card_list[#one_card_list + 1] = {v[1]}
one_card_list[#one_card_list + 1] = { v[1] }
touch_key_list[#touch_key_list + 1] = k
end
end
@ -1045,7 +1046,7 @@ function M:CheckOnePair(pokerMap, num, length)
end
for k, v in pairs(pokerMap) do -- 从三条和对子里面提取
if #v > 1 and k > num then
one_pair_list[#one_pair_list + 1] = {v[1], v[2]}
one_pair_list[#one_pair_list + 1] = { v[1], v[2] }
touch_key_list[#touch_key_list + 1] = k
end
end
@ -1060,7 +1061,7 @@ function M:CheckThree(pokerMap, num, length)
end
for k, v in pairs(pokerMap) do
if #v > 2 and k > num then
three_list[#three_list + 1] = {v[1], v[2], v[3]}
three_list[#three_list + 1] = { v[1], v[2], v[3] }
touch_key_list[#touch_key_list + 1] = k
end
end
@ -1107,8 +1108,8 @@ function M:CheckThreeAndOne(pokerMap, num, length)
end
for k, v in pairs(pokerMap) do
if #v >= 3 and k > num then
three_and_one_list[#three_and_one_list + 1] = {v[1], v[2], v[3]}
touch_key_list = {3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}
three_and_one_list[#three_and_one_list + 1] = { v[1], v[2], v[3] }
touch_key_list = { 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }
end
end
return three_and_one_list, touch_key_list
@ -1122,8 +1123,8 @@ function M:CheckThreeAndTwo(pokerMap, num, length)
end
for k, v in pairs(pokerMap) do
if #v >= 3 and k > num then
three_and_two_list[#three_and_two_list + 1] = {v[1], v[2], v[3]}
touch_key_list = {3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}
three_and_two_list[#three_and_two_list + 1] = { v[1], v[2], v[3] }
touch_key_list = { 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }
end
end
return three_and_two_list, touch_key_list
@ -1208,7 +1209,7 @@ function M:CheckPlane(pokerMap, num, length, and_num)
end
if j == i + pair_length - 1 then
plane_list[#plane_list + 1] = item_all_list
touch_key_list = {3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}
touch_key_list = { 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }
end
end
end
@ -1216,7 +1217,7 @@ function M:CheckPlane(pokerMap, num, length, and_num)
end
function M:SetNotTouchCard(touch_key_list, card_map)
local all_key_list = {3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}
local all_key_list = { 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }
for i = 1, #all_key_list do
local key = all_key_list[i]
local isExsit = self:IsExistByList(touch_key_list, key)
@ -1259,13 +1260,14 @@ function M:GetCardMapAndMaxKey(pokerList)
max_key = number
end
if map[number] == nil then
map[number] = {pokerList[i]}
map[number] = { pokerList[i] }
else
map[number][#map[number] + 1] = pokerList[i]
end
end
return map, max_key
end
function M:CheckOnes(pokerMap, num, length)
local one_card_list = {}
local touch_key_list = {}
@ -1283,7 +1285,7 @@ function M:CheckOnes(pokerMap, num, length)
for i = 0, length - 1 do
if l == k + i and l ~= 15 and l ~= 16 then
-- body
text[#text + 1] = {p[1]}
text[#text + 1] = { p[1] }
text2[#text2 + 1] = l
if #text >= length then
-- body
@ -1311,6 +1313,7 @@ function M:CheckOnes(pokerMap, num, length)
end
return one_card_list, touch_key_list, length
end
function M:Clear()
self:PlayScore(nil)
self:SetOutCardInfo(nil, false)
@ -1321,9 +1324,9 @@ function M:Clear()
end
function M:ClearCheck()
self.card_list = {}
self.card_list = {}
self.out_card_list = {}
self.cards_view:RemoveChildren(0, -1, true)
self.cards_view:RemoveChildren(0, -1, true)
end
function M:Destroy()

View File

@ -308,6 +308,9 @@ function M:UpdateOutCardList(outcard, card_item, cursor)
if DataManager.CurrenRoom.room_config.people_num == 2 then
ViewUtil.CardPos(obj, self._area_outcard_list, oder, col, nil, nil, -6)
ViewUtil.CardPos(obj, self._area_outcard_list, multi_oder, row, nil, nil, -12)
elseif DataManager.CurrenRoom.room_config.people_num == 4 then
ViewUtil.CardPos(obj, self._area_outcard_list, oder, col, nil, nil, -6)
ViewUtil.CardPos(obj, self._area_outcard_list, multi_oder, row, nil, nil, -12)
else
ViewUtil.CardPos(obj, self._area_outcard_list, oder, col)
ViewUtil.CardPos(obj, self._area_outcard_list, multi_oder, row)

View File

@ -57,6 +57,8 @@ end
function M:setHandCardPos(btn_card, i, getcard)
if DataManager.CurrenRoom.room_config.people_num == 2 then
btn_card.x = i * (btn_card.width - 12) + (getcard and 20 or 0)
elseif DataManager.CurrenRoom.room_config.people_num == 4 then
btn_card.x = i * (btn_card.width - 12) + (getcard and 20 or 0)
else
btn_card.x = i * btn_card.width * 1.05 + (getcard and 20 or 0)
end
@ -101,6 +103,8 @@ function M:UpdateHandCard(getcard, mp)
local btn_card = nil
if _room.room_config.people_num == 2 then
btn_card = UIPackage.CreateObject(self:GetCardObjPack(), "Btn_Card_jiangxi" .. b3d)
elseif _room.room_config.people_num == 4 then
btn_card = UIPackage.CreateObject(self:GetCardObjPack(), "Btn_Card_new_4" .. b3d)
else
btn_card = UIPackage.CreateObject(self:GetCardObjPack(), "Btn_Card" .. b3d)
btn_card:SetScale(1.05, 1.05)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 537 KiB

After

Width:  |  Height:  |  Size: 906 KiB

View File

@ -88,5 +88,5 @@ TextureImporter:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleName: base/main_majiang/d2fa434d27dc07bf09395dc32491060b
assetBundleVariant:

View File

@ -88,5 +88,5 @@ TextureImporter:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleName: base/main_majiang/bceee620094f2c87befefb9d76b9b13b
assetBundleVariant:

View File

@ -3,5 +3,5 @@ guid: fbda7506a5976cb44840289e8ebcb105
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleName: base/main_majiang/bceee620094f2c87befefb9d76b9b13b
assetBundleVariant:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 MiB

After

Width:  |  Height:  |  Size: 3.8 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 633 KiB

After

Width:  |  Height:  |  Size: 808 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 MiB

After

Width:  |  Height:  |  Size: 2.0 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 910 KiB

After

Width:  |  Height:  |  Size: 540 KiB

View File

@ -88,5 +88,5 @@ TextureImporter:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleName: extend/majiang/lichuan/8dba1742414c996765e2bd85d1b4bea7
assetBundleVariant: