放大和博精显示测试

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 obj.x = (area.width - obj.width) - index * (obj.width + padding) - offset
elseif oder == AreaOderType.down_up then elseif oder == AreaOderType.down_up then
if isAdd 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 else
obj.y = area.height - obj.height - index * obj.height - offset obj.y = area.height - obj.height - index * (obj.height + padding) - offset
end end
--obj.y = area.height - obj.height - index * obj.height - offset --obj.y = area.height - obj.height - index * obj.height - offset
end end

View File

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

View File

@ -29,17 +29,14 @@ function M:InitMaPai()
local tempMP = self._view:GetChild("niao" .. i) local tempMP = self._view:GetChild("niao" .. i)
table.insert(self.maPaiList, tempMP) table.insert(self.maPaiList, tempMP)
end end
end end
function M:IsMapaiShow(niao, isShow) function M:IsMapaiShow(niao, isShow)
if niao then if niao then
niao.visible = isShow niao.visible = isShow
end end
end end
function M:SetMaPaiValue(niao, value) function M:SetMaPaiValue(niao, value)
if niao then if niao then
niao.icon = 'ui://Main_Majiang/' .. get_majiang_prefix(DataManager.CurrenRoom.game_id) .. "201_" .. value niao.icon = 'ui://Main_Majiang/' .. get_majiang_prefix(DataManager.CurrenRoom.game_id) .. "201_" .. value
@ -57,8 +54,6 @@ function M:HideAllMapai()
end end
end end
function M:ShowSelectMaPai(niaoList) function M:ShowSelectMaPai(niaoList)
if niaoList and #niaoList > 0 then if niaoList and #niaoList > 0 then
self.maPaiCtr.selectedIndex = 1 self.maPaiCtr.selectedIndex = 1
@ -75,8 +70,6 @@ function M:ShowSelectMaPai(niaoList)
end end
end end
function M:CalculatePaixingInfo(result) function M:CalculatePaixingInfo(result)
self.WinList = {} self.WinList = {}
if result.info_list and #result.info_list > 0 then if result.info_list and #result.info_list > 0 then
@ -91,7 +84,6 @@ function M:CalculatePaixingInfo(result)
pt(self.WinList) pt(self.WinList)
end end
function M:SetPaixingxiangqing(num) function M:SetPaixingxiangqing(num)
for i = 1, #self.PaiXingXiangQingCtrList do for i = 1, #self.PaiXingXiangQingCtrList do
if self.PaiXingXiangQingCtrList[i] then if self.PaiXingXiangQingCtrList[i] then
@ -100,10 +92,7 @@ function M:SetPaixingxiangqing(num)
end end
end end
function M:InitData(over, room, result, total_result, callback) function M:InitData(over, room, result, total_result, callback)
self._callback = callback self._callback = callback
local _overCtr = self._view:GetController("over") local _overCtr = self._view:GetController("over")
local btn_confirm = self._view:GetChild("btn_confirm") 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 _sdkCtr = self._view:GetController("sdk")
local ctr_type = self._view:GetController("type") 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", "") self._view:GetChild("tex_gameinfo").text = string.gsub(room.room_config:GetDes2(), "\r", "")
if result then if result then
@ -221,7 +211,6 @@ function M:AddClearItem(room, data, total_data,over, niao, active_player)
end end
function M:FillItemData(room, data, item, active_player, niao) function M:FillItemData(room, data, item, active_player, niao)
local _gamectr = ControllerManager.GetController(GameController) local _gamectr = ControllerManager.GetController(GameController)
local p = room:GetPlayerBySeat(data["seat"]) local p = room:GetPlayerBySeat(data["seat"])
item:GetChild("playerName").text = p.self_user.nick_name item:GetChild("playerName").text = p.self_user.nick_name
@ -248,7 +237,6 @@ function M:FillItemData(room, data, item, active_player, niao)
for i = 1, #fz_card do for i = 1, #fz_card do
if fz_card[i].type == FZType.Peng then if fz_card[i].type == FZType.Peng then
local item = fz_card_list:AddItemFromPool("ui://Main_Majiang/clearing_fz_3") 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) local card = item:GetChild("card_" .. j)
@ -275,11 +263,17 @@ function M:FillItemData(room, data, item, active_player, niao)
local huadd = data["hu_score"] local huadd = data["hu_score"]
local gangadd = data["gang_score"] local gangadd = data["gang_score"]
local jingadd = data["jing_score"]
local total = data["round_score"] local total = data["round_score"]
local geng_zhuan = data["geng_zhuan"] local geng_zhuan = data["geng_zhuan"]
local sp = " " local sp = " "
local str = "胡:" .. huadd .. "" local str = "胡:" .. huadd .. ""
if gangadd then
str = str .. sp .. "杠:" .. gangadd .. "" str = str .. sp .. "杠:" .. gangadd .. ""
end
if jingadd then
str = str .. sp .. "博精:" .. jingadd .. ""
end
@ -314,11 +308,9 @@ function M:FillItemData(room, data, item, active_player, niao)
if huName then if huName then
str1 = str1 .. sp .. huName .. "x" .. win_list[i].score str1 = str1 .. sp .. huName .. "x" .. win_list[i].score
end end
end end
str1 = str1 .. " +" .. huadd .. "" str1 = str1 .. " +" .. huadd .. ""
end end
else else
printlog("输家============") printlog("输家============")
if DataManager.CurrenRoom.isZiMoHu then if DataManager.CurrenRoom.isZiMoHu then
@ -326,7 +318,6 @@ function M:FillItemData(room, data, item, active_player, niao)
--str1="" --str1=""
if #self.WinList == 1 then if #self.WinList == 1 then
for i = 1, #self.WinList do for i = 1, #self.WinList do
for j = 1, #self.WinList[i] do for j = 1, #self.WinList[i] do
local huName = Hu_Type_Name[self.WinList[i][j].type] local huName = Hu_Type_Name[self.WinList[i][j].type]
if huName then if huName then
@ -335,17 +326,13 @@ function M:FillItemData(room, data, item, active_player, niao)
else 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
end end
end end
str1 = str1 .. " " .. huadd .. "" str1 = str1 .. " " .. huadd .. ""
else else
printlog("服务端自摸计算异常===>>>") printlog("服务端自摸计算异常===>>>")
end end
else else
printlog("非自摸处理====>>>") printlog("非自摸处理====>>>")
--点炮 一炮多响 --点炮 一炮多响
@ -366,7 +353,6 @@ function M:FillItemData(room, data, item, active_player, niao)
table.insert(allTypeList, self.WinList[i][j].type) table.insert(allTypeList, self.WinList[i][j].type)
end end
end end
end end
if #allTypeList > 0 then if #allTypeList > 0 then
@ -378,32 +364,24 @@ function M:FillItemData(room, data, item, active_player, niao)
end end
str1 = str1 .. " " .. huadd .. "" str1 = str1 .. " " .. huadd .. ""
end end
else else
if p.self_user.account_id == active_player and is_win == false and not data["liuju"] then if p.self_user.account_id == active_player and is_win == false and not data["liuju"] then
str1 = "点炮" str1 = "点炮"
if #self.WinList == 1 then if #self.WinList == 1 then
for i = 1, # self.WinList do for i = 1, # self.WinList do
for j = 1, #self.WinList[i] do for j = 1, #self.WinList[i] do
local huName = Hu_Type_Name[self.WinList[i][j].type] local huName = Hu_Type_Name[self.WinList[i][j].type]
if huName then 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 end
end end
str1 = str1 .. " " .. huadd .. "" str1 = str1 .. " " .. huadd .. ""
else else
printlog("服务端自摸计算异常===>>>") printlog("服务端自摸计算异常===>>>")
end end
end end
end end
end end
end end
@ -428,7 +406,6 @@ function M:FillItemData(room, data, item, active_player, niao)
else else
str1 = str1 .. " " .. gangadd .. "" str1 = str1 .. " " .. gangadd .. ""
end end
end end
if data["ma_geng_gong"] and data["ma_geng_gong"] ~= 0 then if data["ma_geng_gong"] and data["ma_geng_gong"] ~= 0 then
@ -437,7 +414,6 @@ function M:FillItemData(room, data, item, active_player, niao)
else else
str1 = str1 .. " 马跟杠:" .. data["ma_geng_gong"] .. "" str1 = str1 .. " 马跟杠:" .. data["ma_geng_gong"] .. ""
end end
end end
if geng_zhuan and geng_zhuan ~= 0 then if geng_zhuan and geng_zhuan ~= 0 then
@ -446,7 +422,6 @@ function M:FillItemData(room, data, item, active_player, niao)
else else
str1 = str1 .. " 跟庄:" .. geng_zhuan .. "" str1 = str1 .. " 跟庄:" .. geng_zhuan .. ""
end end
end end
@ -515,7 +490,6 @@ function M:CalculateNiao(niaoList,seat)
return tempNiao return tempNiao
end end
function M:FillItemData2(room, data, list) function M:FillItemData2(room, data, list)
-- 赋值result_info聊天室分享需要 -- 赋值result_info聊天室分享需要
local player_list = {} local player_list = {}
@ -551,7 +525,8 @@ function M:FillItemData2(room, data, list)
local round = room.room_config.round local round = room.room_config.round
self:GenerateRoomResultInfo(round, room.room_config:GetGameName(), room.room_id, room.create_time, player_list) self:GenerateRoomResultInfo(round, room.room_config:GetGameName(), room.room_id, room.create_time, player_list)
local big_result = self._view:GetChild("big_result") 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) 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") local lst_p = big_result:GetChild("player_list")
if #player_list == 3 then if #player_list == 3 then
lst_p.columnGap = 108 lst_p.columnGap = 108

View File

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

View File

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

View File

@ -19,8 +19,6 @@ function M.new( view,mainView )
return self return self
end end
function M:init() function M:init()
local view = self._view local view = self._view
self._gameCtr = ControllerManager.GetController(GameController) self._gameCtr = ControllerManager.GetController(GameController)
@ -78,7 +76,6 @@ function M:SetOutCardInfo(cardlist,isPass,isAnim)
else else
card_code_obj = UIPackage.CreateObjectFromURL("ui://Extend_Poker_RunFastNew/" .. code) card_code_obj = UIPackage.CreateObjectFromURL("ui://Extend_Poker_RunFastNew/" .. code)
end end
else else
if code == 310 and DataManager.CurrenRoom.room_config.Heart10 == 1 then if code == 310 and DataManager.CurrenRoom.room_config.Heart10 == 1 then
-- body -- body
@ -86,22 +83,22 @@ function M:SetOutCardInfo(cardlist,isPass,isAnim)
else else
card_code_obj = UIPackage.CreateObjectFromURL("ui://Main_Poker/" .. code .. "_2") card_code_obj = UIPackage.CreateObjectFromURL("ui://Main_Poker/" .. code .. "_2")
end end
end end
if card_code_obj == nil then if card_code_obj == nil then
card_code_obj = UIPackage.CreateObjectFromURL("ui://Main_Poker/00") card_code_obj = UIPackage.CreateObjectFromURL("ui://Main_Poker/00")
end end
--card_code_obj:SetScale(1,1)
poker_item:AddChild(card_code_obj) poker_item:AddChild(card_code_obj)
--local poker = self:CreatPoker(cardlist[i],0.7) --local poker = self:CreatPoker(cardlist[i],0.7)
self.outpoker_list:AddChild(poker_item) 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.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:TweenMove(
self:GetOutCardEndPokerPos(i, #cardlist, self.outpoker_list, poker_item, self.out_card_data
["maxcount_x"], 1.5), time)
--card_code_obj --card_code_obj
-- self.tween = TweenUtils.TweenFloat(1,0.7,time,function(x) -- self.tween = TweenUtils.TweenFloat(1,0.7,time,function(x)
-- card_code_obj:SetScale(x,x) -- card_code_obj:SetScale(x,x)
-- end) -- end)
card_code_obj:SetScale(0.7,0.7) card_code_obj:SetScale(1.5, 1.5)
end end
self.move_cor = coroutine.start(function() self.move_cor = coroutine.start(function()
coroutine.wait(0.1) coroutine.wait(0.1)
@ -119,7 +116,6 @@ function M:SetOutCardInfo(cardlist,isPass,isAnim)
else else
card_code_obj = UIPackage.CreateObjectFromURL("ui://Extend_Poker_RunFastNew/" .. code) card_code_obj = UIPackage.CreateObjectFromURL("ui://Extend_Poker_RunFastNew/" .. code)
end end
else else
if code == 310 and DataManager.CurrenRoom.room_config.Heart10 == 1 then if code == 310 and DataManager.CurrenRoom.room_config.Heart10 == 1 then
-- body -- body
@ -127,16 +123,16 @@ function M:SetOutCardInfo(cardlist,isPass,isAnim)
else else
card_code_obj = UIPackage.CreateObjectFromURL("ui://Main_Poker/" .. code .. "_2") card_code_obj = UIPackage.CreateObjectFromURL("ui://Main_Poker/" .. code .. "_2")
end end
end end
if card_code_obj == nil then if card_code_obj == nil then
card_code_obj = UIPackage.CreateObjectFromURL("ui://Main_Poker/00") card_code_obj = UIPackage.CreateObjectFromURL("ui://Main_Poker/00")
end end
card_code_obj:SetScale(0.7,0.7) card_code_obj:SetScale(1.5, 1.5)
poker_item:AddChild(card_code_obj) poker_item:AddChild(card_code_obj)
--local poker = self:CreatPoker(cardlist[i],0.7) --local poker = self:CreatPoker(cardlist[i],0.7)
self.outpoker_list:AddChild(poker_item) 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
end end
--self.ctr_outpoker.selectedIndex = 1 --self.ctr_outpoker.selectedIndex = 1
@ -157,6 +153,7 @@ function M:GetOffSet(cardLength) -- 15 -70
return -cardLength * 5 + 80 return -cardLength * 5 + 80
end end
end end
function M:GetOutCardEndFirstPokerPos(count, parent_com, poker_obj, max_count, scale) function M:GetOutCardEndFirstPokerPos(count, parent_com, poker_obj, max_count, scale)
local parent_width, parent_height = parent_com.width, parent_com.height 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 poker_width, poker_height = poker_obj.width * scale, poker_obj.height * scale
@ -171,13 +168,12 @@ function M:GetOutCardEndFirstPokerPos(count,parent_com,poker_obj,max_count,scale
local length = (count - 1) * offset + poker_width local length = (count - 1) * offset + poker_width
x = (parent_width - length) / 2 x = (parent_width - length) / 2
y = ((parent_height - poker_height) / 2) y = ((parent_height - poker_height) / 2)
end end
return Vector2.New(x, y) return Vector2.New(x, y)
end end
function M:GetOutCardEndPokerPos(index, count, parent_com, poker_obj, max_count, scale) function M:GetOutCardEndPokerPos(index, count, parent_com, poker_obj, max_count, scale)
local offset_x,offset_y = self:GetOffSet(count),-50 local offset_x, offset_y = self:GetOffSet(count), -100
local start_pos = self:GetOutCardEndFirstPokerPos(count, parent_com, poker_obj, max_count, scale) 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 poker_width, poker_height = poker_obj.width * scale, poker_obj.height * scale
local parent_width, parent_height = parent_com.width, parent_com.height local parent_width, parent_height = parent_com.width, parent_com.height
@ -186,6 +182,7 @@ function M:GetOutCardEndPokerPos(index,count,parent_com,poker_obj,max_count,scal
pos_x = (index - max_count - 1) * offset_x pos_x = (index - max_count - 1) * offset_x
pos_y = pos_y + poker_height + offset_y pos_y = pos_y + poker_height + offset_y
end end
return Vector2.New(pos_x, pos_y) return Vector2.New(pos_x, pos_y)
end end
@ -244,9 +241,6 @@ function M:PlayScore(score,isBomb,isWin)
end end
end end
function M:UpdateHandPoker(cardList, isPlayAni, isMing) function M:UpdateHandPoker(cardList, isPlayAni, isMing)
if self.cor_init_poker ~= nil then if self.cor_init_poker ~= nil then
coroutine.stop(self.cor_init_poker) coroutine.stop(self.cor_init_poker)
@ -294,7 +288,6 @@ function M:SetRemainCardNumber(isPlay)
end end
function M:CreatPoker1(poker, scale, bank) function M:CreatPoker1(poker, scale, bank)
local poker_item = UIPackage.CreateObject("Extend_Poker_RunFastNew", "poker" .. scale * 10) local poker_item = UIPackage.CreateObject("Extend_Poker_RunFastNew", "poker" .. scale * 10)
local code = self:ChangeCodeByTo(poker) local code = self:ChangeCodeByTo(poker)
local card_code_obj local card_code_obj
@ -306,7 +299,6 @@ function M:CreatPoker1(poker,scale,bank)
else else
card_code_obj = UIPackage.CreateObjectFromURL("ui://Extend_Poker_RunFastNew/" .. code) card_code_obj = UIPackage.CreateObjectFromURL("ui://Extend_Poker_RunFastNew/" .. code)
end end
else else
if code == 310 and DataManager.CurrenRoom.room_config.Heart10 == 1 then if code == 310 and DataManager.CurrenRoom.room_config.Heart10 == 1 then
-- body -- body
@ -314,7 +306,6 @@ function M:CreatPoker1(poker,scale,bank)
else else
card_code_obj = UIPackage.CreateObjectFromURL("ui://Main_Poker/" .. code .. "_2") card_code_obj = UIPackage.CreateObjectFromURL("ui://Main_Poker/" .. code .. "_2")
end end
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") card_code_obj = UIPackage.CreateObjectFromURL("ui://Main_Poker/00")
@ -327,11 +318,9 @@ function M:CreatPoker1(poker,scale,bank)
end end
function M:CreatPoker(poker, scale, bank) function M:CreatPoker(poker, scale, bank)
local poker_item = UIPackage.CreateObject("Extend_Poker_RunFastNew", "poker" .. 12.5) local poker_item = UIPackage.CreateObject("Extend_Poker_RunFastNew", "poker" .. 12.5)
local code = self:ChangeCodeByTo(poker) local code = self:ChangeCodeByTo(poker)
local card_code_obj local card_code_obj
if DataManager.CurrenRoom.pai == 0 then if DataManager.CurrenRoom.pai == 0 then
if code == 310 and DataManager.CurrenRoom.room_config.Heart10 == 1 then if code == 310 and DataManager.CurrenRoom.room_config.Heart10 == 1 then
-- body -- body
@ -339,7 +328,6 @@ function M:CreatPoker(poker,scale,bank)
else else
card_code_obj = UIPackage.CreateObjectFromURL("ui://Extend_Poker_RunFastNew/" .. code) card_code_obj = UIPackage.CreateObjectFromURL("ui://Extend_Poker_RunFastNew/" .. code)
end end
else else
if code == 310 and DataManager.CurrenRoom.room_config.Heart10 == 1 then if code == 310 and DataManager.CurrenRoom.room_config.Heart10 == 1 then
-- body -- body
@ -347,12 +335,10 @@ function M:CreatPoker(poker,scale,bank)
else else
card_code_obj = UIPackage.CreateObjectFromURL("ui://Main_Poker/" .. code .. "_2") card_code_obj = UIPackage.CreateObjectFromURL("ui://Main_Poker/" .. code .. "_2")
end end
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") card_code_obj = UIPackage.CreateObjectFromURL("ui://Main_Poker/00")
end end
card_code_obj:SetScale(scale, scale) card_code_obj:SetScale(scale, scale)
poker_item:AddChild(card_code_obj) poker_item:AddChild(card_code_obj)
@ -368,7 +354,6 @@ function M:ChangeCodeByTo( card )
return flower * 100 + number return flower * 100 + number
end end
function M:Clear() function M:Clear()
self:PlayScore(nil) self:PlayScore(nil)
self:SetRemainCardNumber(false) self:SetRemainCardNumber(false)

View File

@ -88,12 +88,13 @@ function M:InitPoker(pokerList, isPlayAni, open)
-- self.zhizhanplay=0 -- self.zhizhanplay=0
-- self.zhizhanzdts=0 -- self.zhizhanzdts=0
local cs = 1.25 local cs = 1.25
print("==========================DataManager.CurrenRoom.cardsize", DataManager.CurrenRoom.cardsize)
if DataManager.CurrenRoom.cardsize == 0 then if DataManager.CurrenRoom.cardsize == 0 then
cs = 1.35 cs = 2
elseif DataManager.CurrenRoom.cardsize == 1 then elseif DataManager.CurrenRoom.cardsize == 1 then
cs = 1.25 cs = 1.8
elseif DataManager.CurrenRoom.cardsize == 2 then elseif DataManager.CurrenRoom.cardsize == 2 then
cs = 1.15 cs = 1.5
end end
if self.cor_init_poker ~= nil then if self.cor_init_poker ~= nil then
@ -173,7 +174,6 @@ function M:InitPoker(pokerList, isPlayAni, open)
end end
) )
else else
for i = 1, #pokerList do for i = 1, #pokerList do
local card_number_code = self:ChangeOneCodeByFrom(pokerList[i]) local card_number_code = self:ChangeOneCodeByFrom(pokerList[i])
local card_flower_code = pokerList[i] local card_flower_code = pokerList[i]
@ -197,7 +197,6 @@ function M:InitPoker(pokerList, isPlayAni, open)
end end
function M:updatePoker() function M:updatePoker()
local templist = {} local templist = {}
for i = 1, #self.card_list do for i = 1, #self.card_list do
templist[#templist + 1] = self.card_list[i].card_code_flower templist[#templist + 1] = self.card_list[i].card_code_flower
@ -340,6 +339,7 @@ function M:AddCardMoveEvent(card)
end end
) )
end end
function M:zhizhanxuanpai() --智障选牌 function M:zhizhanxuanpai() --智障选牌
-- body -- body
local temp_send_card = {} local temp_send_card = {}
@ -576,12 +576,11 @@ function M:SetOutCardBlack()
if card and card:GetChildAt(0) and card:GetChildAt(0):GetChildAt(0) and card:GetChildAt(0):GetChildAt(0):GetChildAt(0) then 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) card:GetChildAt(0):GetChildAt(0):GetChildAt(0).color = Color(0.7, 0.7, 0.7)
end end
end end
end end
function M:SetOutCardList(cardlist, isAnim) function M:SetOutCardList(cardlist, isAnim)
local pos_y = -200 local pos_y = -320
if isAnim then if isAnim then
-- self.zhizhanctr_select=0 -- self.zhizhanctr_select=0
-- self.zhizhantype=0 -- self.zhizhantype=0
@ -611,13 +610,13 @@ function M:SetOutCardList(cardlist, isAnim)
self.cards_view, self.cards_view,
card.btn_card, card.btn_card,
self.out_card_data['maxcount_x'], self.out_card_data['maxcount_x'],
0.7 1.5
) )
card.btn_card:TweenMove(Vector2.New(pos.x, pos_y), time) card.btn_card:TweenMove(Vector2.New(pos.x, pos_y), time)
-- self.tween = TweenUtils.TweenFloat(1, 0.7, time, function(x) -- self.tween = TweenUtils.TweenFloat(1, 0.7, time, function(x)
-- card.btn_card:GetChildAt(0):SetScale(x, x) -- card.btn_card:GetChildAt(0):SetScale(x, x)
-- end) -- end)
card.btn_card:GetChildAt(0):SetScale(0.7, 0.7) card.btn_card:GetChildAt(0):SetScale(1.5, 1.5)
break break
end end
end end
@ -667,7 +666,7 @@ function M:SetOutCardList(cardlist, isAnim)
if card_code_obj == nil then if card_code_obj == nil then
card_code_obj = UIPackage.CreateObjectFromURL('ui://Main_Poker/00') card_code_obj = UIPackage.CreateObjectFromURL('ui://Main_Poker/00')
end end
card_code_obj:SetScale(0.7, 0.7) card_code_obj:SetScale(1.5, 1.5)
poker_item:AddChild(card_code_obj) poker_item:AddChild(card_code_obj)
--local poker = self:CreatPoker(cardlist[i],0.7) --local poker = self:CreatPoker(cardlist[i],0.7)
self.cards_view:AddChild(poker_item) self.cards_view:AddChild(poker_item)
@ -678,7 +677,7 @@ function M:SetOutCardList(cardlist, isAnim)
self.cards_view, self.cards_view,
poker_item, poker_item,
self.out_card_data['maxcount_x'], self.out_card_data['maxcount_x'],
1 1.5
) )
poker_item.xy = Vector2.New(pos.x, pos_y) poker_item.xy = Vector2.New(pos.x, pos_y)
self.out_card_list[#self.out_card_list + 1] = poker_item self.out_card_list[#self.out_card_list + 1] = poker_item
@ -836,15 +835,15 @@ function M:ShowTipsCard(index)
end end
function M:GetHandCardOffset(count) function M:GetHandCardOffset(count)
local start = -70---54 local start = -90 ---54
local offset = 0 local offset = 0
if count > 10 then if count > 10 then
offset = start - count + 18 offset = start - count + 26
else else
offset = -50 offset = -30
end end
return offset return -25
end end
function M:GetHandCardPos(index, card_count) 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) x = start_x + (self.card_width + offset) * (index - 1)
return Vector2.New(x, y) return Vector2.New(x, y)
end end
function M:GetHandCardPos1(index, card_count) function M:GetHandCardPos1(index, card_count)
local x, y = 0, -18 local x, y = 0, -18
local offset = self:GetHandCardOffset(card_count) 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) x = start_x + (self.card_width + offset) * (index - 1)
return x, y return x, y
end end
function M:ChangeOneCodeByFrom(card) function M:ChangeOneCodeByFrom(card)
local flower = math.floor(card / 100) local flower = math.floor(card / 100)
local number = card % 100 local number = card % 100
@ -1266,6 +1267,7 @@ function M:GetCardMapAndMaxKey(pokerList)
end end
return map, max_key return map, max_key
end end
function M:CheckOnes(pokerMap, num, length) function M:CheckOnes(pokerMap, num, length)
local one_card_list = {} local one_card_list = {}
local touch_key_list = {} local touch_key_list = {}
@ -1311,6 +1313,7 @@ function M:CheckOnes(pokerMap, num, length)
end end
return one_card_list, touch_key_list, length return one_card_list, touch_key_list, length
end end
function M:Clear() function M:Clear()
self:PlayScore(nil) self:PlayScore(nil)
self:SetOutCardInfo(nil, false) self:SetOutCardInfo(nil, false)

View File

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

View File

@ -57,6 +57,8 @@ end
function M:setHandCardPos(btn_card, i, getcard) function M:setHandCardPos(btn_card, i, getcard)
if DataManager.CurrenRoom.room_config.people_num == 2 then if DataManager.CurrenRoom.room_config.people_num == 2 then
btn_card.x = i * (btn_card.width - 12) + (getcard and 20 or 0) 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 else
btn_card.x = i * btn_card.width * 1.05 + (getcard and 20 or 0) btn_card.x = i * btn_card.width * 1.05 + (getcard and 20 or 0)
end end
@ -101,6 +103,8 @@ function M:UpdateHandCard(getcard, mp)
local btn_card = nil local btn_card = nil
if _room.room_config.people_num == 2 then if _room.room_config.people_num == 2 then
btn_card = UIPackage.CreateObject(self:GetCardObjPack(), "Btn_Card_jiangxi" .. b3d) 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 else
btn_card = UIPackage.CreateObject(self:GetCardObjPack(), "Btn_Card" .. b3d) btn_card = UIPackage.CreateObject(self:GetCardObjPack(), "Btn_Card" .. b3d)
btn_card:SetScale(1.05, 1.05) 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 pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0 pSDShowRemoveMatteOption: 0
userData: userData:
assetBundleName: assetBundleName: base/main_majiang/d2fa434d27dc07bf09395dc32491060b
assetBundleVariant: assetBundleVariant:

View File

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

View File

@ -3,5 +3,5 @@ guid: fbda7506a5976cb44840289e8ebcb105
TextScriptImporter: TextScriptImporter:
externalObjects: {} externalObjects: {}
userData: userData:
assetBundleName: assetBundleName: base/main_majiang/bceee620094f2c87befefb9d76b9b13b
assetBundleVariant: 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 pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0 pSDShowRemoveMatteOption: 0
userData: userData:
assetBundleName: assetBundleName: extend/majiang/lichuan/8dba1742414c996765e2bd85d1b4bea7
assetBundleVariant: assetBundleVariant: