其他四个麻将同步

master
罗家炜 2025-04-21 18:55:46 +08:00
parent bb04ca25cf
commit 5959b54cb6
38 changed files with 1748 additions and 1866 deletions

View File

@ -1,40 +1,47 @@
local CS_Win_Type = {
"点炮",
"平胡",
"小七对",
"一般高",
"七星",
"龙夹背",
"清大对",
"七星一般高",
"双龙夹背",
"三龙夹背",
"十老头",
"塘子十三ㄠ",
"塘子小七对",
"大对子",
"烂牌",
"一条龙",
"落地龙",
"混一色",
"庄家",
"清一色",
"字一色",
"抢杠胡",
"杠上开花",
"杠上炮",
"双杠花",
"双杠上炮",
"三杠花",
"三杠上炮",
"四杠花",
"四杠上炮",
"塘子七星",
"塘子一般高",
"塘子七星一般高",
"塘子烂牌",
"闲家",
"塘子胡",
"点炮",
"自摸",
"十三烂",
"七星十三烂",
"碰碰胡",
"碰碰胡清一色",
"碰碰胡字一色",
"七小对",
"七小对清一色",
"七小对字一色",
"清一色真胡",
"清一色假胡",
"字一色真胡",
"字一色假胡",
"天胡",
"地胡",
"平胡",
"抢杠胡",
"杠上花",
"烧庄",
"四归一",
"八归一",
"十二归一",
"清一色假胡四归一",
"清一色真胡四归一",
"清一色假胡八归一",
"清一色真胡八归一",
"清一色假胡十二归一",
"清一色真胡十二归一",
"字一色假胡四归一",
"字一色真胡四归一",
"字一色假胡八归一",
"字一色真胡八归一",
"字一色假胡十二归一",
"字一色真胡十二归一",
"清一色七对四归一",
"清一色七对八归一",
"清一色七对十二归一",
"字一色七对四归一",
"字一色七对八归一",
"字一色七对十二归一",
"七对四归一",
"七对八归一",
"七对十二归一"
}
return CS_Win_Type

View File

@ -6,610 +6,283 @@ local EXClearingView = {}
local M = EXClearingView
function EXClearingView.new(blur_view)
setmetatable(M, {__index = ResultView})
local self = setmetatable({}, {__index = M})
self._full = true
ResultView.init(self, "ui://Main_Majiang/clearing")
setmetatable(M, { __index = ResultView })
local self = setmetatable({}, { __index = M })
self._full = true
ResultView.init(self, "ui://Main_Majiang/clearing")
self._currenIndex = 0
self._blur_view = blur_view
self._close_zone = false
self:InitMaPai()
return self
self._currenIndex = 0
self._blur_view = blur_view
self._close_zone = false
-- self:InitMaPai()
return self
end
function M:InitMaPai()
self.maPaiCtr=self._view:GetController("mapai")
self.maPaiCtr.selectedIndex=0
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
end
end
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)
end
end
function M:ShowSelectMaPai(niaoList)
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)
end
end
else
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)
end
end
end
printlog("牌型列表====>>>")
pt(self.WinList)
end
function M:SetPaixingxiangqing(num)
for i=1,#self.PaiXingXiangQingCtrList do
if self.PaiXingXiangQingCtrList[i] then
self.PaiXingXiangQingCtrList[i].selectedIndex=num
end
end
end
-- function M:InitMaPai()
-- self.maPaiCtr = self._view:GetController("mapai")
-- self.maPaiCtr.selectedIndex = 0
-- self.maPaiList = {}
-- for i = 1, 8 do
-- local tempMP = self._view:GetChild("niao" .. i)
-- table.insert(self.maPaiList, tempMP)
-- end
-- end
function M:InitData(over, room, result, total_result, callback)
-- print("===============================InitData===========================", over, room, result, total_result)
-- pt(room)
-- pt(result)
-- Pt(total_result)
self._callback = callback
local showClearMainBtn = self._view:GetChild("btn_showClearMain")
local nextRoundBtn = self._view:GetChild("btn_nextRound")
local nextRoundBtn2 = self._view:GetChild("Btn_NextRound2")
local endRound = self._view:GetChild("Btn_EndRound")
local _overCtr = self._view:GetController("over")
local mainCtr = self._view:GetController("main")
local playerNum = self._view:GetController("playerNum")
local showBtnTypeCtr = self._view:GetController("showType")
self._callback = callback
local _overCtr = self._view:GetController("over")
local btn_confirm = self._view:GetChild("btn_confirm")
local btn_result = self._view:GetChild("btn_showResult")
local btn_close = self._view:GetChild("big_result"):GetChild("btn_close")
local _btnCtr = self._view:GetController("button")
local _sdkCtr = self._view:GetController("sdk")
local ctr_type = self._view:GetController("type")
local peopleNum = room.room_config.people_num
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
self:ShowSelectMaPai(result.niao)
self:CalculatePaixingInfo(result)
end
self.PaiXingXiangQingCtrList={}
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)
fanhuipaixing.onClick:Add(function()
paixingxiangqing.visible=true
fanhuipaixing.visible=false
self:SetPaixingxiangqing(0)
end)
playerNum.selectedIndex = peopleNum - 2
if over ~= 2 then
if result.liuju then
ctr_type.selectedIndex = 3
else
local info_list = result.info_list
for i = 1, #info_list do
local is_win = info_list[i].is_win
if is_win then
if info_list[i].seat == room.self_player.seat then
ctr_type.selectedIndex = 1
else
ctr_type.selectedIndex = 2
end
end
end
end
showClearMainBtn.onClick:Set(function()
mainCtr.selectedIndex = 1
end)
if over == 0 then
_btnCtr.selectedIndex = 0
_sdkCtr.selectedIndex = 1
btn_confirm.onClick:Add(function()
local _gamectr = ControllerManager.GetController(GameController)
_gamectr:PlayerReady()
self:DestroyWithCallback()
end)
self:AddClearItem(room, result.info_list, nil, over, result.niao, result.active_player)
elseif over == 1 then
_btnCtr.selectedIndex = 1
_sdkCtr.selectedIndex = 1
btn_result.onClick:Add(function()
self.maPaiCtr.selectedIndex=0
_overCtr.selectedIndex = 1
_btnCtr.selectedIndex = 0
_sdkCtr.selectedIndex = 0
if self._qsinfo_view then
self._qsinfo_view:Dispose()
end
end)
btn_close.onClick:Add(function()
ViewManager.ChangeView(ViewManager.View_Lobby)
end)
self:AddClearItem(room, result.info_list, total_result.info_list, over, result.niao, result.active_player)
end
else
_overCtr.selectedIndex = 1
self.maPaiCtr.selectedIndex=0
btn_close.onClick:Add(function()
ViewManager.ChangeView(ViewManager.View_Lobby)
end)
self:AddClearItem(room, nil, total_result.info_list, over)
end
end
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)
list_view1:RemoveChildrenToPool()
for i=1,#data do
local item = list_view1:AddItemFromPool()
self:FillItemData(room, data[i], item, active_player, niao)
end
if #data == 3 then
list_view1.lineGap = 54
elseif #data == 2 then
list_view1.lineGap = 108
end
if 1 == over then
self:FillItemData2(room, total_data, list_view2)
end
elseif 2 == over then
self:FillItemData2(room, total_data, list_view2)
end
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=""--抓马
local user = room:GetPlayerBySeat(data["seat"]).self_user
local head = item:GetChild('head'):GetChild('n4')
ImageLoad.Load(user.head_url, head)
-- 手牌
local hand_cards = data["hand_card"]
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
local card = hand_list_view:AddItemFromPool()
card.icon = "ui://Main_Majiang/202_"..hand_cards[i]
end
hand_list_view.width = 52 * #hand_cards
local fz_card = p.fz_list
local fz_card_list = item:GetChild("fz_card_list")
fz_card_list.width = 157 * #fz_card * 0.8
fz_card_list:RemoveChildrenToPool()
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
local card = item:GetChild("card_" .. j)
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
local card = item:GetChild("card_" .. 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
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
end
end
end
end
local huadd = data["hu_score"]
local gangadd = data["gang_score"]
local total = data["round_score"]
local geng_zhuan=data["geng_zhuan"]
local sp = " "
local str = "胡:"..huadd..""
str = str..sp.."杠:"..gangadd..""
item:GetChild("score1").text = str
-- local total_score = data["total_score"]
if total >= 0 then
item:GetChild("score2").text = "+"..total
item:GetChild("score2").grayed = false
else
item:GetChild("score2").text = total
item:GetChild("score2").grayed = true
end
--计算牌型
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=""
if is_win then
if win_list then
if DataManager.CurrenRoom.isZiMoHu then
str1="自摸"
else
str1="接炮"
end
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
end
end
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 huName then
if j==1 then
str1=str1..huName.."x"..self.WinList[i][j].score
else
str1=str1..sp..huName.."x"..self.WinList[i][j].score
end
end
end
end
str1=str1.." "..huadd..""
else
printlog("服务端自摸计算异常===>>>")
end
else
printlog("非自摸处理====>>>")
--点炮 一炮多响
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)
end
end
end
if #allTypeList>0 then
for i=1,#allTypeList do
local huName=Hu_Type_Name[allTypeList[i]]
if huName then
str1=str1..huName..""
end
end
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]
if huName then
str1=str1..sp..huName.."x"..self.WinList[i][j].score
end
end
end
str1=str1.." "..huadd..""
else
printlog("服务端自摸计算异常===>>>")
end
end
end
end
end
--
printlog("牌型计算==>>>",str1)
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"]
end
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..""
else
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"]..""
else
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..""
else
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)
-------------------------
local hp_nonnegative = room:checkHpNonnegative()
item:GetController("nonnegative").selectedIndex = hp_nonnegative and 1 or 0
if hp_nonnegative then
local hp_info = data.hp_info
local ctr_hp_limit = item:GetController("hp_limit")
local hp = d2ad(hp_info.round_actual_hp)
if hp >= 0 then hp = "+" .. tostring(hp) end
item:GetChild("tex_hp").text = hp
ctr_hp_limit.selectedIndex = hp_info.upper_limit and 1 or 0
end
item:GetController("win").selectedIndex = is_win and 0 or 1
if p.self_user.account_id == active_player and is_win == false and total < 0 then
item:GetController("win").selectedIndex = 2
end
if is_win then
item:GetController("bg").selectedIndex=1
else
item:GetController("bg").selectedIndex=0
end
local win_card = item:GetChild("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
local lst_niao = item:GetChild("list_niao")
lst_niao:RemoveChildrenToPool()
for i = 1, #currentNiaoList do
if currentNiaoList[i].score > 0 then
local card_niao = lst_niao:AddItemFromPool()
card_niao.icon = "ui://Main_Majiang/202_" .. currentNiaoList[i].card
end
end
end
end
if p.seat == room.banker_seat then
item:GetController("bank").selectedIndex = 1
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])
end
end
return tempNiao
end
nextRoundBtn.onClick:Set(function()
local _gamectr = ControllerManager.GetController(GameController)
_gamectr:PlayerReady()
self:DestroyWithCallback()
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
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)
endRound.onClick:Set(function()
ViewManager.ChangeView(ViewManager.View_Family)
end)
if over == 0 then
showBtnTypeCtr.selectedIndex = 0
_overCtr.selectedIndex = 0
self:fillResult0(room, peopleNum, result)
nextRoundBtn2.onClick:Set(function()
local _gamectr = ControllerManager.GetController(GameController)
_gamectr:PlayerReady()
self:DestroyWithCallback()
end)
elseif over == 1 then
showBtnTypeCtr.selectedIndex = 1
self:fillResult1(room, peopleNum, total_result)
if result then
self:fillResult0(room, peopleNum, result)
nextRoundBtn2.onClick:Set(function()
_overCtr.selectedIndex = 1
end)
else
_overCtr.selectedIndex = 1
end
else --解散房间如果没有开局直接退出不显示结算界面over=2
if room.curren_round > 0 then
_overCtr.selectedIndex = 1
showBtnTypeCtr.selectedIndex = 1
self:fillResult1(room, peopleNum, total_result)
else
ViewManager.ChangeView(ViewManager.View_Family)
end
end
end
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
lst_p.columnGap = 108
elseif #player_list == 2 then
lst_p.columnGap = 208
end
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
function M:fillResult0(room, peopleNum, result)
local config = ExtendManager.GetExtendConfig(room.game_id)
local mode = config:GetGameInfo()
local gamePlay = mode:LoadConfigToDetail(json.encode(room.room_config.config))
self._view:GetChild("Label_GamePlay").title = string.format("第%s/%s局,%s", room.curren_round,
room.room_config.round, gamePlay)
for i = 1, peopleNum do
local playerInfoComp = self._view:GetChild(string.format("Comp_Player%d", i))
local allCardsList = playerInfoComp:GetChild("list_allCards")
local huCardBtn = playerInfoComp:GetChild("Btn_Card_Hu")
local jiangMaList = playerInfoComp:GetChild("list_JiangMa")
local ziMoCtr = playerInfoComp:GetController("isZiMo")
local dianPaoCtr = playerInfoComp:GetController("isPao")
local isMeCtr = playerInfoComp:GetController("IsMe")
local isZhuang = playerInfoComp:GetController("zhuang")
local infoList = result.info_list[i]
local playInfo = room:GetPlayerBySeat(infoList.seat)
local fzCardInfo = playInfo.fz_list
local fzInfoNum = #fzCardInfo
local handInfoNum = #infoList.hand_card
self:fillHead(playInfo.self_user.head_url, playerInfoComp)
playerInfoComp:GetChild("text_name").text = playInfo.self_user.nick_name
playerInfoComp:GetChild("Text_BoJing").text = infoList.jing_score >= 0 and
string.format("+%d", infoList.jing_score) or infoList.jing_score
playerInfoComp:GetChild("Text_Gang").text = infoList.gang_score >= 0 and
string.format("+%d", infoList.gang_score) or infoList.gang_score
playerInfoComp:GetChild("Text_Hu").text = infoList.hu_score >= 0 and string.format("+%d", infoList.hu_score) or
infoList.hu_score
playerInfoComp:GetChild("Text_Tatal").text = infoList.round_score >= 0 and
string.format("+%d", infoList.round_score) or infoList.round_score
for j = 1, fzInfoNum do
if fzCardInfo[j].type == FZType.Peng then
local item = allCardsList:AddItemFromPool("ui://Main_Majiang/Comp_Clearing_FZ_3")
for l = 1, 3 do
local card = item:GetChild(string.format("Btn_Card%d", l))
card.icon = string.format("ui://Main_Majiang/%s202_%d", self:GetPrefix(), fzCardInfo[j].card)
print("===============================FZType.Peng", room.jing, fzCardInfo[j].card)
if room.jing == fzCardInfo[j].card then
card:GetController('jing').selectedIndex = 1
end
end
elseif fzCardInfo[j].type == FZType.Chi then
local item = allCardsList:AddItemFromPool("ui://Main_Majiang/Comp_Clearing_FZ_3")
for l = 1, 3 do
local card = item:GetChild(string.format("Btn_Card%d", l))
card.icon = string.format("ui://Main_Majiang/%s202_%d", self:GetPrefix(), fzCardInfo[j].opcard
[l])
print("===============================FZType.Chi", room.jing, fzCardInfo[j].opcard[l])
if room.jing == fzCardInfo[j].opcard[l] then
card:GetController('jing').selectedIndex = 1
end
end
elseif fzCardInfo[j].type == FZType.Gang or fzCardInfo[j].type == FZType.Gang_An or fzCardInfo[j].type == FZType.Gang_Peng then
local item = allCardsList:AddItemFromPool("ui://Main_Majiang/Comp_Clearing_FZ_4")
for l = 1, 4 do
local card = item:GetChild(string.format("Btn_Card%d", l))
if fzCardInfo[j].type == FZType.Gang_An and j == 4 then
card.icon = "ui://Main_Majiang/202_00"
else
card.icon = string.format("ui://Main_Majiang/%s202_%d", self:GetPrefix(), fzCardInfo[j].card)
print("===============================FZType.Gang", room.jing, fzCardInfo[j].card)
if room.jing == fzCardInfo[j].card then
card:GetController('jing').selectedIndex = 1
end
end
end
end
end
local handCardItem = allCardsList:AddItemFromPool("ui://Main_Majiang/Comp_HandCard")
local handCardList = handCardItem:GetChild("list")
handCardList:SetVirtual()
handCardList.itemRenderer = function(index, obj)
obj.icon = string.format("ui://Main_Majiang/%s202_%d", self:GetPrefix(), infoList.hand_card[index + 1])
if room.jing == infoList.hand_card[index + 1] then
ViewUtil:ErrorTip("显示精")
obj:GetController('jing').selectedIndex = 1
end
end
handCardList.numItems = handInfoNum
allCardsList.width = 172 * fzInfoNum + 60 + (handInfoNum - 1) * 56 + 36 * (fzInfoNum)
if infoList.seat == room.self_player.seat then
isMeCtr.selectedIndex = 1
end
if infoList.seat == room.banker_seat then
ViewUtil:ErrorTip("显示庄家")
isZhuang.selectedIndex = 1
end
if infoList.is_win then
local winInfo = ""
for j = 1, #infoList.win_list do
winInfo = string.format("%s,%s", winInfo, Hu_Type_Name[infoList.win_list[j].type])
end
winInfo = string.sub(winInfo, 2, -1)
playerInfoComp:GetChild("text_huShow").text = winInfo
if room.isZiMoHu then
ziMoCtr.selectedIndex = 1
end
huCardBtn.icon = string.format("ui://Main_Majiang/202_%d", infoList.win_card)
huCardBtn.visible = true
jiangMaList.visible = false
else
playerInfoComp:GetChild("text_huShow").text = ""
if not room.isZiMoHu and playInfo.self_user.account_id == result.active_player then
dianPaoCtr.selectedIndex = 1
end
huCardBtn.visible = false
jiangMaList.visible = false
end
end
end
function M:fillResult1(room, peopleNum, total_result)
local gameNameAndRoomIDText = self._view:GetChild("Text_GameNameAndRoomID")
local familyIDText = self._view:GetChild("Text_FamilyID")
for i, v in pairs(room.self_player.self_user.games) do
if v.game_id == room.game_id then
gameNameAndRoomIDText.text = string.format("%s 房号:%s", v.name, room.room_id)
end
end
if #gameNameAndRoomIDText.text <= 0 then
gameNameAndRoomIDText.text = string.format("房号:%s", room.room_id)
end
if room.group_id ~= 0 then
big_result:GetController("group").selectedIndex = 1
familyIDText.text = string.format("俱乐部:%s", room.group_id)
else
familyIDText.visible = false
end
self._view:GetChild("Text_RoundNum").text = string.format("局数:%s/%s", room.curren_round, room.room_config.round)
self._view:GetChild("Text_Time").text = os.date("%Y-%m-%d %H:%M:%S", os.time())
for i = 1, peopleNum do
local resultInfoComp = self._view:GetChild(string.format("Comp_ResultInfo%d", i))
local totalInfoList = total_result.info_list[i]
local playInfo = room:GetPlayerBySeat(totalInfoList.seat)
self:fillHead(playInfo.self_user.head_url, resultInfoComp)
resultInfoComp:GetChild('Text_Name').text = playInfo.self_user.nick_name
resultInfoComp:GetChild('Text_ID').text = string.format("ID:%s", playInfo.self_user.account_id)
resultInfoComp:GetChild('Text_TotalScore').text = totalInfoList.total_score >= 0 and
string.format("+%s", totalInfoList.total_score) or totalInfoList.total_score
resultInfoComp:GetChild('Text_ZiMo').text = string.format("自摸 %d次", totalInfoList.settle_log.zimo or 0)
resultInfoComp:GetChild('Text_JiePao').text = string.format("接炮 %d次", totalInfoList.settle_log.jiepao or 0)
resultInfoComp:GetChild('Text_FangPao').text = string.format("放炮 %d次", totalInfoList.settle_log.fangpao or 0)
resultInfoComp:GetChild('Text_AnGang').text = string.format("暗杠 %d次", totalInfoList.settle_log.an_kong or 0)
resultInfoComp:GetChild('Text_MingGang').text = string.format("明杠 %d次",
totalInfoList.settle_log.ming_kong or 0)
resultInfoComp:GetChild('Text_FangGang').text = string.format("放杠 %d次",
totalInfoList.settle_log.fanggang or 0)
resultInfoComp:GetController("win").selectedIndex = totalInfoList.total_score >= 0 and 1 or 0
end
DataManager.CurrenRoom = nil
end
function M:LoadHead(p, room)
local btn_head = self._view:GetChild("btn_head")
for i = 1, #room.player_list do
local player = room.player_list[i]
if p.seat == player.seat and player.self_user.head_url ~= "" then
ImageLoad.Load(player.self_user.head_url, btn_head.icon)
end
end
function M:fillHead(url, view)
ImageLoad.Load(url, view:GetChild("Btn_Head")._iconObject)
end
local prefix
function M:GetPrefix()
-- if not prefix then
prefix = get_majiang_prefix(10)
-- if not prefix then
prefix = get_majiang_prefix(10)
-- end
return prefix
return prefix
end
function M:DestroyWithCallback()
if self._callback then
self._callback()
end
self:Destroy()
function M:DestroyWithCallback()
if self._callback then
self._callback()
end
self:Destroy()
end
return M
return M

View File

@ -40,6 +40,18 @@ end
local __pre_delete_card = false
-- 发送出牌指令到服务器
-------------------------lingmeng---------------------------
function M:SendNextCard(card)
local _data = {}
_data["card"] = tonumber(card)
local _client = ControllerManager.GameNetClinet
_client:send(TX_Protocol.GAME_NEXT_CARD, _data)
end
------------------------------------------------------------
function M:SendOutCard(card, callback)
local _data = {}
_data["card"] = card
@ -117,6 +129,8 @@ function M:OnEventSendCards(evt_data)
local handcards = evt_data["card_list"]
local p = _room.self_player
local seat = evt_data["bank_seat"]
local jing = evt_data["jing"]
_room.jing = jing
self._cacheEvent:Enqueue(function()
_room.banker_seat = seat
for i = 1, #_room.player_list do

View File

@ -4,7 +4,7 @@ local MJMainView = require("main.majiang.MJMainView")
local EXClearingView = import(".EXClearingView")
local TX_GameEvent = import(".GameEvent")
local HuTipView = import("main.majiang.HuTipView")
local SettingView = import("main.majiang.MJSettingViewNew")
local SettingView = import(".EXSettingView")
local PlayerInfoView = import(".EXPlayerInfoView")
local M = {}
@ -42,6 +42,93 @@ function M:InitView(url)
self.Laizi2Btn.visible = true
self.bugangnum = self._view:GetChild("bugangnum")
--lingmeng
--[[
MJMainView.InitView(self, "ui://Main_Majiang/Main_new_" .. room.room_config.people_num)
--]]
self.jing = self._view:GetChild('jing')
local showNextCtr = self._view:GetController('showNext')
local ShowNextConfrimCtr = self._view:GetController('showNextConfrim')
local showNextList = self._view:GetChild('list_showNext')
local pop_showNextConfrim = self._view:GetChild('pop_showNextConfrim')
self._view:GetChild('btn_showNext').onClick:Set(function()
showNextCtr.selectedIndex = 1
end)
self._view:GetChild('btn_sendShow').onClick:Set(function()
self:SendShowNext(ShowNextConfrimCtr)
end)
self._view:GetChild('btn_closeShow').onClick:Set(function()
ShowNextConfrimCtr.selectedIndex = 0
showNextCtr.selectedIndex = 0
showNextList.selectedIndex = -1
self._showNextName = nil
end)
showNextList.onClickItem:Set(function(context)
local _gamectr = ControllerManager.GetController(GameController)
_gamectr:SendNextCard(string.sub(context.data.name, -3))
showNextCtr.selectedIndex = 0
showNextList.selectedIndex = -1
self._showNextName = nil
-- self:ClickShowNext(context, ShowNextConfrimCtr)
end)
ShowNextConfrimCtr.onChanged:Set(function()
pop_showNextConfrim:GetChild("btn_ShowCard").icon = self._showNextName
end)
pop_showNextConfrim:GetChild("btn_center").onClick:Set(function()
local _gamectr = ControllerManager.GetController(GameController)
_gamectr:SendNextCard(string.sub(self._showNextName, -3))
ShowNextConfrimCtr.selectedIndex = 0
showNextCtr.selectedIndex = 0
showNextList.selectedIndex = -1
self._showNextName = nil
end)
if self._room.room_config.people_num == 2 then
local btn_closeRoom = self._view:GetChild("btn_setting")
self._view:GetChild('btn_closeRoom').onClick:Set(function()
---[[
--旧
local tip_owner = '您是否退出房间?\n(退出房间后房间将解散)'
local tip = '您是否退出房间?' -- \n (请注意,申请洗牌后退出,不会返还洗牌分)
local tipStr = ''
if self._room.agent then
tipStr = '您是否退出房间?'
else
tipStr = self._room.owner_id == self._room.self_player.self_user.account_id and tip_owner or tip
end
local _curren_msg = MsgWindow.new(self._root_view, tipStr, MsgWindow.MsgMode.OkAndCancel)
_curren_msg.onOk:Add(
function()
if self._state.selectedIndex > 0 and self._state.selectedIndex < 3 then
ViewUtil.ErrorTip(nil, '房间已开始,无法退出游戏。')
else
ViewUtil.ShowModalWait(self._root_view)
self._gamectr:LevelRoom(
function(res)
ViewUtil.CloseModalWait()
if res.ReturnCode == 0 then
ViewManager.ChangeView(ViewManager.View_Family)
else
ViewUtil.ErrorTip(res.ReturnCode)
end
end
)
end
end
)
_curren_msg:Show()
--]]
end)
btn_closeRoom.onClick:Add(handler(self, function()
local settingView = SettingView.new(self)
settingView:Show()
end))
end
--------
self:PlayerChangeLineState()
if room.playing or room.curren_round > 0 then
@ -108,6 +195,19 @@ function M:UpdateRound()
end
end
function M:ShowJing()
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
end
function M:InitPlayerInfoView()
self._player_info = {}
local _player_info = self._player_info
@ -148,12 +248,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)
@ -162,6 +263,7 @@ function M:EventInit()
-- self:ShowHuTip()
self:UpdateRound()
self._state.selectedIndex = 1
self:ShowJing()
local list = _room.player_list
for i = 1, #list do
local p = list[i]
@ -244,7 +346,7 @@ function M:EventInit()
self:RemoveCursor()
info:UpdateHandCard(true, true)
local obj_win_card = UIPackage.CreateObjectFromURL("ui://Main_Majiang/Btn_Card")
local obj_win_card = UIPackage.CreateObjectFromURL("ui://Main_Majiang/Btn_Card_jiangxi")
obj_win_card.icon = "ui://Main_Majiang/202_" .. win_card
obj_win_card:GetController("bg").selectedIndex = 1
info._view:AddChild(obj_win_card)
@ -377,7 +479,7 @@ function M:EventInit()
-- info:UpdateScore()
info._view:GetChild("zhanji").visible = true
local num = data[i].hp_info.total_hp
if num > 0 then
if num >= 0 then
info._view:GetController("text_color").selectedIndex = 0
info._view:GetChild("text_jifen").text = "+" .. d2ad(num)
else
@ -796,6 +898,26 @@ function M:UpdateCardBox(seat)
self._ctr_cardbox.selectedIndex = index
end
-----------------------lingmeng----------------------------
function M:SendShowNext(ShowNextConfrimCtr)
if not self._showNextName then
ViewUtil.ErrorTip(nil, "请先选择一个麻将牌")
return
end
ShowNextConfrimCtr.selectedIndex = 1
end
function M:ClickShowNext(context, ShowNextConfrimCtr)
if self._showNextName == context.data.name then
self:SendShowNext(ShowNextConfrimCtr)
return
end
self._showNextName = context.data.name
end
-----------------------------------------------------------
function M:__CloseTip()
if self._chipeng_tip then
self._chipeng_tip:Dispose()

View File

@ -0,0 +1,60 @@
--设置窗口对象
local EXSettingView = {}
local M = EXSettingView
setmetatable(M, { __index = BaseWindow })
function EXSettingView.new(main_view)
local self = setmetatable({}, { __index = M })
self.class = 'EXSettingView'
self._close_destroy = true
self._mainView = main_view
self:init('ui://Main_Majiang/Setting')
return self
end
function M:init(url)
BaseWindow.init(self, url)
local view = self._view
local slider_sound = view:GetChild('slider_vedio_sound')
local slider_music = view:GetChild('slider_vedio_music')
local btn_music = view:GetChild('btn_vedio_music')
local btn_sound = view:GetChild('btn_vedio_sound')
-- slider_sound.value = GameApplication.Instance.SoundValue
-- slider_music.value = GameApplication.Instance.MusicValue
slider_music.onChanged:Add(function()
-- GameApplication.Instance.MusicValue = slider_music.value
-- btn_music.selected = false
-- GameApplication.Instance.MusicMute = false;
end)
slider_sound.onChanged:Add(function()
-- GameApplication.Instance.SoundValue = slider_sound.value
-- btn_sound.selected = false
-- GameApplication.Instance.SoundMute = false;
end)
btn_sound.onClick:Add(function()
-- GameApplication.Instance.SoundMute = btn_sound.selected;
end)
btn_music.onClick:Add(function()
-- GameApplication.Instance.MusicMute = btn_music.selected;
end)
local _btn_logout = self._view:GetChild('btn_closeRoom')
_btn_logout.onClick:Set(function()
if self._mainView.dismiss_room_cd_time > 0 then
ViewUtil.ErrorTip(nil, "您还处于解散冷却时间当中,请稍后重试!")
else
local _gamectr = ControllerManager.GetController(GameController)
_gamectr:AskDismissRoom()
end
end)
end
return M

View File

@ -58,7 +58,7 @@ function M:UpdateHandCard(getcard, mp)
local card_list = DataManager.CurrenRoom.self_player.card_list
self:ShowHuTip(card_list)
-- self:ShowHuTip(card_list)
if getcard then
self._out_card = true
local card_list = membe_clone(DataManager.CurrenRoom.self_player.card_list)
@ -130,7 +130,7 @@ function M:__OnClickHandCard(context)
end
if self._out_card then
self:ShowHuTip(card_list)
-- self:ShowHuTip(card_list)
end
-- 标记出牌
@ -152,7 +152,7 @@ end
function M:__OnDragStart(card)
local card_list = membe_clone(DataManager.CurrenRoom.self_player.card_list)
list_remove(card_list, card)
self:ShowHuTip(card_list)
-- self:ShowHuTip(card_list)
end
function M:__OnDragEnd(context)

View File

@ -47,6 +47,9 @@ local Protocol = {
GAME_EVT_GANGZI = "837",
GAME_EVT_BUGANG = "838",
GAME_EVT_DOGANG = "839",
--送牌
GAME_NEXT_CARD = "888"
}
return Protocol

View File

@ -1,40 +1,20 @@
local CS_Win_Type = {
"点炮",
"自摸",
"十三烂",
"七星十三烂",
"碰碰胡",
"碰碰胡清一色",
"碰碰胡字一色",
"七小对",
"七小对清一色",
"七小对字一色",
"清一色真胡",
"清一色假胡",
"字一色真胡",
"字一色假胡",
"天胡",
"地胡",
"平胡",
"小七对",
"一般高",
"七星",
"龙夹背",
"清大对",
"七星一般高",
"双龙夹背",
"三龙夹背",
"十老头",
"塘子十三ㄠ",
"塘子小七对",
"大对子",
"烂牌",
"一条龙",
"落地龙",
"混一色",
"庄家",
"清一色",
"字一色",
"抢杠胡",
"杠上开花",
"杠上炮",
"双杠花",
"双杠上炮",
"三杠花",
"三杠上炮",
"四杠花",
"四杠上炮",
"塘子七星",
"塘子一般高",
"塘子七星一般高",
"塘子烂牌",
"闲家",
"塘子胡",
}
return CS_Win_Type

View File

@ -6,610 +6,283 @@ local EXClearingView = {}
local M = EXClearingView
function EXClearingView.new(blur_view)
setmetatable(M, {__index = ResultView})
local self = setmetatable({}, {__index = M})
self._full = true
ResultView.init(self, "ui://Main_Majiang/clearing")
setmetatable(M, { __index = ResultView })
local self = setmetatable({}, { __index = M })
self._full = true
ResultView.init(self, "ui://Main_Majiang/clearing")
self._currenIndex = 0
self._blur_view = blur_view
self._close_zone = false
self:InitMaPai()
return self
self._currenIndex = 0
self._blur_view = blur_view
self._close_zone = false
-- self:InitMaPai()
return self
end
function M:InitMaPai()
self.maPaiCtr=self._view:GetController("mapai")
self.maPaiCtr.selectedIndex=0
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
end
end
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)
end
end
function M:ShowSelectMaPai(niaoList)
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)
end
end
else
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)
end
end
end
printlog("牌型列表====>>>")
pt(self.WinList)
end
function M:SetPaixingxiangqing(num)
for i=1,#self.PaiXingXiangQingCtrList do
if self.PaiXingXiangQingCtrList[i] then
self.PaiXingXiangQingCtrList[i].selectedIndex=num
end
end
end
-- function M:InitMaPai()
-- self.maPaiCtr = self._view:GetController("mapai")
-- self.maPaiCtr.selectedIndex = 0
-- self.maPaiList = {}
-- for i = 1, 8 do
-- local tempMP = self._view:GetChild("niao" .. i)
-- table.insert(self.maPaiList, tempMP)
-- end
-- end
function M:InitData(over, room, result, total_result, callback)
-- print("===============================InitData===========================", over, room, result, total_result)
-- pt(room)
-- pt(result)
-- Pt(total_result)
self._callback = callback
local showClearMainBtn = self._view:GetChild("btn_showClearMain")
local nextRoundBtn = self._view:GetChild("btn_nextRound")
local nextRoundBtn2 = self._view:GetChild("Btn_NextRound2")
local endRound = self._view:GetChild("Btn_EndRound")
local _overCtr = self._view:GetController("over")
local mainCtr = self._view:GetController("main")
local playerNum = self._view:GetController("playerNum")
local showBtnTypeCtr = self._view:GetController("showType")
self._callback = callback
local _overCtr = self._view:GetController("over")
local btn_confirm = self._view:GetChild("btn_confirm")
local btn_result = self._view:GetChild("btn_showResult")
local btn_close = self._view:GetChild("big_result"):GetChild("btn_close")
local _btnCtr = self._view:GetController("button")
local _sdkCtr = self._view:GetController("sdk")
local ctr_type = self._view:GetController("type")
local peopleNum = room.room_config.people_num
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
self:ShowSelectMaPai(result.niao)
self:CalculatePaixingInfo(result)
end
self.PaiXingXiangQingCtrList={}
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)
fanhuipaixing.onClick:Add(function()
paixingxiangqing.visible=true
fanhuipaixing.visible=false
self:SetPaixingxiangqing(0)
end)
playerNum.selectedIndex = peopleNum - 2
if over ~= 2 then
if result.liuju then
ctr_type.selectedIndex = 3
else
local info_list = result.info_list
for i = 1, #info_list do
local is_win = info_list[i].is_win
if is_win then
if info_list[i].seat == room.self_player.seat then
ctr_type.selectedIndex = 1
else
ctr_type.selectedIndex = 2
end
end
end
end
showClearMainBtn.onClick:Set(function()
mainCtr.selectedIndex = 1
end)
if over == 0 then
_btnCtr.selectedIndex = 0
_sdkCtr.selectedIndex = 1
btn_confirm.onClick:Add(function()
local _gamectr = ControllerManager.GetController(GameController)
_gamectr:PlayerReady()
self:DestroyWithCallback()
end)
self:AddClearItem(room, result.info_list, nil, over, result.niao, result.active_player)
elseif over == 1 then
_btnCtr.selectedIndex = 1
_sdkCtr.selectedIndex = 1
btn_result.onClick:Add(function()
self.maPaiCtr.selectedIndex=0
_overCtr.selectedIndex = 1
_btnCtr.selectedIndex = 0
_sdkCtr.selectedIndex = 0
if self._qsinfo_view then
self._qsinfo_view:Dispose()
end
end)
btn_close.onClick:Add(function()
ViewManager.ChangeView(ViewManager.View_Lobby)
end)
self:AddClearItem(room, result.info_list, total_result.info_list, over, result.niao, result.active_player)
end
else
_overCtr.selectedIndex = 1
self.maPaiCtr.selectedIndex=0
btn_close.onClick:Add(function()
ViewManager.ChangeView(ViewManager.View_Lobby)
end)
self:AddClearItem(room, nil, total_result.info_list, over)
end
end
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)
list_view1:RemoveChildrenToPool()
for i=1,#data do
local item = list_view1:AddItemFromPool()
self:FillItemData(room, data[i], item, active_player, niao)
end
if #data == 3 then
list_view1.lineGap = 54
elseif #data == 2 then
list_view1.lineGap = 108
end
if 1 == over then
self:FillItemData2(room, total_data, list_view2)
end
elseif 2 == over then
self:FillItemData2(room, total_data, list_view2)
end
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=""--抓马
local user = room:GetPlayerBySeat(data["seat"]).self_user
local head = item:GetChild('head'):GetChild('n4')
ImageLoad.Load(user.head_url, head)
-- 手牌
local hand_cards = data["hand_card"]
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
local card = hand_list_view:AddItemFromPool()
card.icon = "ui://Main_Majiang/202_"..hand_cards[i]
end
hand_list_view.width = 52 * #hand_cards
local fz_card = p.fz_list
local fz_card_list = item:GetChild("fz_card_list")
fz_card_list.width = 157 * #fz_card * 0.8
fz_card_list:RemoveChildrenToPool()
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
local card = item:GetChild("card_" .. j)
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
local card = item:GetChild("card_" .. 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
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
end
end
end
end
local huadd = data["hu_score"]
local gangadd = data["gang_score"]
local total = data["round_score"]
local geng_zhuan=data["geng_zhuan"]
local sp = " "
local str = "胡:"..huadd..""
str = str..sp.."杠:"..gangadd..""
item:GetChild("score1").text = str
-- local total_score = data["total_score"]
if total >= 0 then
item:GetChild("score2").text = "+"..total
item:GetChild("score2").grayed = false
else
item:GetChild("score2").text = total
item:GetChild("score2").grayed = true
end
--计算牌型
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=""
if is_win then
if win_list then
if DataManager.CurrenRoom.isZiMoHu then
str1="自摸"
else
str1="接炮"
end
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
end
end
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 huName then
if j==1 then
str1=str1..huName.."x"..self.WinList[i][j].score
else
str1=str1..sp..huName.."x"..self.WinList[i][j].score
end
end
end
end
str1=str1.." "..huadd..""
else
printlog("服务端自摸计算异常===>>>")
end
else
printlog("非自摸处理====>>>")
--点炮 一炮多响
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)
end
end
end
if #allTypeList>0 then
for i=1,#allTypeList do
local huName=Hu_Type_Name[allTypeList[i]]
if huName then
str1=str1..huName..""
end
end
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]
if huName then
str1=str1..sp..huName.."x"..self.WinList[i][j].score
end
end
end
str1=str1.." "..huadd..""
else
printlog("服务端自摸计算异常===>>>")
end
end
end
end
end
--
printlog("牌型计算==>>>",str1)
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"]
end
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..""
else
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"]..""
else
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..""
else
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)
-------------------------
local hp_nonnegative = room:checkHpNonnegative()
item:GetController("nonnegative").selectedIndex = hp_nonnegative and 1 or 0
if hp_nonnegative then
local hp_info = data.hp_info
local ctr_hp_limit = item:GetController("hp_limit")
local hp = d2ad(hp_info.round_actual_hp)
if hp >= 0 then hp = "+" .. tostring(hp) end
item:GetChild("tex_hp").text = hp
ctr_hp_limit.selectedIndex = hp_info.upper_limit and 1 or 0
end
item:GetController("win").selectedIndex = is_win and 0 or 1
if p.self_user.account_id == active_player and is_win == false and total < 0 then
item:GetController("win").selectedIndex = 2
end
if is_win then
item:GetController("bg").selectedIndex=1
else
item:GetController("bg").selectedIndex=0
end
local win_card = item:GetChild("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
local lst_niao = item:GetChild("list_niao")
lst_niao:RemoveChildrenToPool()
for i = 1, #currentNiaoList do
if currentNiaoList[i].score > 0 then
local card_niao = lst_niao:AddItemFromPool()
card_niao.icon = "ui://Main_Majiang/202_" .. currentNiaoList[i].card
end
end
end
end
if p.seat == room.banker_seat then
item:GetController("bank").selectedIndex = 1
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])
end
end
return tempNiao
end
nextRoundBtn.onClick:Set(function()
local _gamectr = ControllerManager.GetController(GameController)
_gamectr:PlayerReady()
self:DestroyWithCallback()
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
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)
endRound.onClick:Set(function()
ViewManager.ChangeView(ViewManager.View_Family)
end)
if over == 0 then
showBtnTypeCtr.selectedIndex = 0
_overCtr.selectedIndex = 0
self:fillResult0(room, peopleNum, result)
nextRoundBtn2.onClick:Set(function()
local _gamectr = ControllerManager.GetController(GameController)
_gamectr:PlayerReady()
self:DestroyWithCallback()
end)
elseif over == 1 then
showBtnTypeCtr.selectedIndex = 1
self:fillResult1(room, peopleNum, total_result)
if result then
self:fillResult0(room, peopleNum, result)
nextRoundBtn2.onClick:Set(function()
_overCtr.selectedIndex = 1
end)
else
_overCtr.selectedIndex = 1
end
else --解散房间如果没有开局直接退出不显示结算界面over=2
if room.curren_round > 0 then
_overCtr.selectedIndex = 1
showBtnTypeCtr.selectedIndex = 1
self:fillResult1(room, peopleNum, total_result)
else
ViewManager.ChangeView(ViewManager.View_Family)
end
end
end
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
lst_p.columnGap = 108
elseif #player_list == 2 then
lst_p.columnGap = 208
end
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
function M:fillResult0(room, peopleNum, result)
local config = ExtendManager.GetExtendConfig(room.game_id)
local mode = config:GetGameInfo()
local gamePlay = mode:LoadConfigToDetail(json.encode(room.room_config.config))
self._view:GetChild("Label_GamePlay").title = string.format("第%s/%s局,%s", room.curren_round,
room.room_config.round, gamePlay)
for i = 1, peopleNum do
local playerInfoComp = self._view:GetChild(string.format("Comp_Player%d", i))
local allCardsList = playerInfoComp:GetChild("list_allCards")
local huCardBtn = playerInfoComp:GetChild("Btn_Card_Hu")
local jiangMaList = playerInfoComp:GetChild("list_JiangMa")
local ziMoCtr = playerInfoComp:GetController("isZiMo")
local dianPaoCtr = playerInfoComp:GetController("isPao")
local isMeCtr = playerInfoComp:GetController("IsMe")
local isZhuang = playerInfoComp:GetController("zhuang")
local infoList = result.info_list[i]
local playInfo = room:GetPlayerBySeat(infoList.seat)
local fzCardInfo = playInfo.fz_list
local fzInfoNum = #fzCardInfo
local handInfoNum = #infoList.hand_card
self:fillHead(playInfo.self_user.head_url, playerInfoComp)
playerInfoComp:GetChild("text_name").text = playInfo.self_user.nick_name
playerInfoComp:GetChild("Text_BoJing").text = infoList.jing_score >= 0 and
string.format("+%d", infoList.jing_score) or infoList.jing_score
playerInfoComp:GetChild("Text_Gang").text = infoList.gang_score >= 0 and
string.format("+%d", infoList.gang_score) or infoList.gang_score
playerInfoComp:GetChild("Text_Hu").text = infoList.hu_score >= 0 and string.format("+%d", infoList.hu_score) or
infoList.hu_score
playerInfoComp:GetChild("Text_Tatal").text = infoList.round_score >= 0 and
string.format("+%d", infoList.round_score) or infoList.round_score
for j = 1, fzInfoNum do
if fzCardInfo[j].type == FZType.Peng then
local item = allCardsList:AddItemFromPool("ui://Main_Majiang/Comp_Clearing_FZ_3")
for l = 1, 3 do
local card = item:GetChild(string.format("Btn_Card%d", l))
card.icon = string.format("ui://Main_Majiang/%s202_%d", self:GetPrefix(), fzCardInfo[j].card)
print("===============================FZType.Peng", room.jing, fzCardInfo[j].card)
if room.jing == fzCardInfo[j].card then
card:GetController('jing').selectedIndex = 1
end
end
elseif fzCardInfo[j].type == FZType.Chi then
local item = allCardsList:AddItemFromPool("ui://Main_Majiang/Comp_Clearing_FZ_3")
for l = 1, 3 do
local card = item:GetChild(string.format("Btn_Card%d", l))
card.icon = string.format("ui://Main_Majiang/%s202_%d", self:GetPrefix(), fzCardInfo[j].opcard
[l])
print("===============================FZType.Chi", room.jing, fzCardInfo[j].opcard[l])
if room.jing == fzCardInfo[j].opcard[l] then
card:GetController('jing').selectedIndex = 1
end
end
elseif fzCardInfo[j].type == FZType.Gang or fzCardInfo[j].type == FZType.Gang_An or fzCardInfo[j].type == FZType.Gang_Peng then
local item = allCardsList:AddItemFromPool("ui://Main_Majiang/Comp_Clearing_FZ_4")
for l = 1, 4 do
local card = item:GetChild(string.format("Btn_Card%d", l))
if fzCardInfo[j].type == FZType.Gang_An and j == 4 then
card.icon = "ui://Main_Majiang/202_00"
else
card.icon = string.format("ui://Main_Majiang/%s202_%d", self:GetPrefix(), fzCardInfo[j].card)
print("===============================FZType.Gang", room.jing, fzCardInfo[j].card)
if room.jing == fzCardInfo[j].card then
card:GetController('jing').selectedIndex = 1
end
end
end
end
end
local handCardItem = allCardsList:AddItemFromPool("ui://Main_Majiang/Comp_HandCard")
local handCardList = handCardItem:GetChild("list")
handCardList:SetVirtual()
handCardList.itemRenderer = function(index, obj)
obj.icon = string.format("ui://Main_Majiang/%s202_%d", self:GetPrefix(), infoList.hand_card[index + 1])
if room.jing == infoList.hand_card[index + 1] then
ViewUtil:ErrorTip("显示精")
obj:GetController('jing').selectedIndex = 1
end
end
handCardList.numItems = handInfoNum
allCardsList.width = 172 * fzInfoNum + 60 + (handInfoNum - 1) * 56 + 36 * (fzInfoNum)
if infoList.seat == room.self_player.seat then
isMeCtr.selectedIndex = 1
end
if infoList.seat == room.banker_seat then
ViewUtil:ErrorTip("显示庄家")
isZhuang.selectedIndex = 1
end
if infoList.is_win then
local winInfo = ""
for j = 1, #infoList.win_list do
winInfo = string.format("%s,%s", winInfo, Hu_Type_Name[infoList.win_list[j].type])
end
winInfo = string.sub(winInfo, 2, -1)
playerInfoComp:GetChild("text_huShow").text = winInfo
if room.isZiMoHu then
ziMoCtr.selectedIndex = 1
end
huCardBtn.icon = string.format("ui://Main_Majiang/202_%d", infoList.win_card)
huCardBtn.visible = true
jiangMaList.visible = false
else
playerInfoComp:GetChild("text_huShow").text = ""
if not room.isZiMoHu and playInfo.self_user.account_id == result.active_player then
dianPaoCtr.selectedIndex = 1
end
huCardBtn.visible = false
jiangMaList.visible = false
end
end
end
function M:fillResult1(room, peopleNum, total_result)
local gameNameAndRoomIDText = self._view:GetChild("Text_GameNameAndRoomID")
local familyIDText = self._view:GetChild("Text_FamilyID")
for i, v in pairs(room.self_player.self_user.games) do
if v.game_id == room.game_id then
gameNameAndRoomIDText.text = string.format("%s 房号:%s", v.name, room.room_id)
end
end
if #gameNameAndRoomIDText.text <= 0 then
gameNameAndRoomIDText.text = string.format("房号:%s", room.room_id)
end
if room.group_id ~= 0 then
big_result:GetController("group").selectedIndex = 1
familyIDText.text = string.format("俱乐部:%s", room.group_id)
else
familyIDText.visible = false
end
self._view:GetChild("Text_RoundNum").text = string.format("局数:%s/%s", room.curren_round, room.room_config.round)
self._view:GetChild("Text_Time").text = os.date("%Y-%m-%d %H:%M:%S", os.time())
for i = 1, peopleNum do
local resultInfoComp = self._view:GetChild(string.format("Comp_ResultInfo%d", i))
local totalInfoList = total_result.info_list[i]
local playInfo = room:GetPlayerBySeat(totalInfoList.seat)
self:fillHead(playInfo.self_user.head_url, resultInfoComp)
resultInfoComp:GetChild('Text_Name').text = playInfo.self_user.nick_name
resultInfoComp:GetChild('Text_ID').text = string.format("ID:%s", playInfo.self_user.account_id)
resultInfoComp:GetChild('Text_TotalScore').text = totalInfoList.total_score >= 0 and
string.format("+%s", totalInfoList.total_score) or totalInfoList.total_score
resultInfoComp:GetChild('Text_ZiMo').text = string.format("自摸 %d次", totalInfoList.settle_log.zimo or 0)
resultInfoComp:GetChild('Text_JiePao').text = string.format("接炮 %d次", totalInfoList.settle_log.jiepao or 0)
resultInfoComp:GetChild('Text_FangPao').text = string.format("放炮 %d次", totalInfoList.settle_log.fangpao or 0)
resultInfoComp:GetChild('Text_AnGang').text = string.format("暗杠 %d次", totalInfoList.settle_log.an_kong or 0)
resultInfoComp:GetChild('Text_MingGang').text = string.format("明杠 %d次",
totalInfoList.settle_log.ming_kong or 0)
resultInfoComp:GetChild('Text_FangGang').text = string.format("放杠 %d次",
totalInfoList.settle_log.fanggang or 0)
resultInfoComp:GetController("win").selectedIndex = totalInfoList.total_score >= 0 and 1 or 0
end
DataManager.CurrenRoom = nil
end
function M:LoadHead(p, room)
local btn_head = self._view:GetChild("btn_head")
for i = 1, #room.player_list do
local player = room.player_list[i]
if p.seat == player.seat and player.self_user.head_url ~= "" then
ImageLoad.Load(player.self_user.head_url, btn_head.icon)
end
end
function M:fillHead(url, view)
ImageLoad.Load(url, view:GetChild("Btn_Head")._iconObject)
end
local prefix
function M:GetPrefix()
-- if not prefix then
prefix = get_majiang_prefix(10)
-- if not prefix then
prefix = get_majiang_prefix(10)
-- end
return prefix
return prefix
end
function M:DestroyWithCallback()
if self._callback then
self._callback()
end
self:Destroy()
function M:DestroyWithCallback()
if self._callback then
self._callback()
end
self:Destroy()
end
return M
return M

View File

@ -40,6 +40,18 @@ end
local __pre_delete_card = false
-- 发送出牌指令到服务器
-------------------------lingmeng---------------------------
function M:SendNextCard(card)
local _data = {}
_data["card"] = tonumber(card)
local _client = ControllerManager.GameNetClinet
_client:send(TX_Protocol.GAME_NEXT_CARD, _data)
end
------------------------------------------------------------
function M:SendOutCard(card, callback)
local _data = {}
_data["card"] = card

View File

@ -4,7 +4,7 @@ local MJMainView = require("main.majiang.MJMainView")
local EXClearingView = import(".EXClearingView")
local TX_GameEvent = import(".GameEvent")
local HuTipView = import("main.majiang.HuTipView")
local SettingView = import("main.majiang.MJSettingViewNew")
local SettingView = import(".EXSettingView")
local PlayerInfoView = import(".EXPlayerInfoView")
local M = {}
@ -42,6 +42,93 @@ function M:InitView(url)
self.Laizi2Btn.visible = true
self.bugangnum = self._view:GetChild("bugangnum")
--lingmeng
--[[
MJMainView.InitView(self, "ui://Main_Majiang/Main_new_" .. room.room_config.people_num)
--]]
self.jing = self._view:GetChild('jing')
local showNextCtr = self._view:GetController('showNext')
local ShowNextConfrimCtr = self._view:GetController('showNextConfrim')
local showNextList = self._view:GetChild('list_showNext')
local pop_showNextConfrim = self._view:GetChild('pop_showNextConfrim')
self._view:GetChild('btn_showNext').onClick:Set(function()
showNextCtr.selectedIndex = 1
end)
self._view:GetChild('btn_sendShow').onClick:Set(function()
self:SendShowNext(ShowNextConfrimCtr)
end)
self._view:GetChild('btn_closeShow').onClick:Set(function()
ShowNextConfrimCtr.selectedIndex = 0
showNextCtr.selectedIndex = 0
showNextList.selectedIndex = -1
self._showNextName = nil
end)
showNextList.onClickItem:Set(function(context)
local _gamectr = ControllerManager.GetController(GameController)
_gamectr:SendNextCard(string.sub(context.data.name, -3))
showNextCtr.selectedIndex = 0
showNextList.selectedIndex = -1
self._showNextName = nil
-- self:ClickShowNext(context, ShowNextConfrimCtr)
end)
ShowNextConfrimCtr.onChanged:Set(function()
pop_showNextConfrim:GetChild("btn_ShowCard").icon = self._showNextName
end)
pop_showNextConfrim:GetChild("btn_center").onClick:Set(function()
local _gamectr = ControllerManager.GetController(GameController)
_gamectr:SendNextCard(string.sub(self._showNextName, -3))
ShowNextConfrimCtr.selectedIndex = 0
showNextCtr.selectedIndex = 0
showNextList.selectedIndex = -1
self._showNextName = nil
end)
if self._room.room_config.people_num == 2 then
local btn_closeRoom = self._view:GetChild("btn_setting")
self._view:GetChild('btn_closeRoom').onClick:Set(function()
---[[
--旧
local tip_owner = '您是否退出房间?\n(退出房间后房间将解散)'
local tip = '您是否退出房间?' -- \n (请注意,申请洗牌后退出,不会返还洗牌分)
local tipStr = ''
if self._room.agent then
tipStr = '您是否退出房间?'
else
tipStr = self._room.owner_id == self._room.self_player.self_user.account_id and tip_owner or tip
end
local _curren_msg = MsgWindow.new(self._root_view, tipStr, MsgWindow.MsgMode.OkAndCancel)
_curren_msg.onOk:Add(
function()
if self._state.selectedIndex > 0 and self._state.selectedIndex < 3 then
ViewUtil.ErrorTip(nil, '房间已开始,无法退出游戏。')
else
ViewUtil.ShowModalWait(self._root_view)
self._gamectr:LevelRoom(
function(res)
ViewUtil.CloseModalWait()
if res.ReturnCode == 0 then
ViewManager.ChangeView(ViewManager.View_Family)
else
ViewUtil.ErrorTip(res.ReturnCode)
end
end
)
end
end
)
_curren_msg:Show()
--]]
end)
btn_closeRoom.onClick:Add(handler(self, function()
local settingView = SettingView.new(self)
settingView:Show()
end))
end
--------
self:PlayerChangeLineState()
if room.playing or room.curren_round > 0 then
@ -99,13 +186,26 @@ function M:IsShowGangZi(btn, isShow)
end
function M:UpdateRound()
-- if self._room.room_config.people_num == 2 then
-- self._view:GetChild("text_round").text = string.format("当前局数:%d/%d", self._room.curren_round,
-- self._room.room_config.round)
-- else
self._view:GetChild("tex_round1").text = self._room.curren_round
self._view:GetChild("tex_round2").text = self._room.room_config.round
-- end
if self._room.room_config.people_num == 2 then
self._view:GetChild("text_round").text = string.format("当前局数:%d/%d", self._room.curren_round,
self._room.room_config.round)
else
self._view:GetChild("tex_round1").text = self._room.curren_round
self._view:GetChild("tex_round2").text = self._room.room_config.round
end
end
function M:ShowJing()
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
end
function M:InitPlayerInfoView()
@ -148,12 +248,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)
@ -162,6 +263,7 @@ function M:EventInit()
-- self:ShowHuTip()
self:UpdateRound()
self._state.selectedIndex = 1
self:ShowJing()
local list = _room.player_list
for i = 1, #list do
local p = list[i]
@ -212,7 +314,8 @@ function M:EventInit()
local arg = { ... }
local seat = arg[1]
local card = arg[2]
self._tex_leftTime.text = arg[3]
-- self._tex_leftTime.text = arg[3]
self._tex_LeftCard.text = string.format("剩余%d张牌", arg[3])
-- self:UpdateRoomInfo()
local info = self._player_card_info[self:GetPos(seat)]
info:UpdateHandCard(true)
@ -243,7 +346,7 @@ function M:EventInit()
self:RemoveCursor()
info:UpdateHandCard(true, true)
local obj_win_card = UIPackage.CreateObjectFromURL("ui://Main_Majiang/Btn_Card")
local obj_win_card = UIPackage.CreateObjectFromURL("ui://Main_Majiang/Btn_Card_jiangxi")
obj_win_card.icon = "ui://Main_Majiang/202_" .. win_card
obj_win_card:GetController("bg").selectedIndex = 1
info._view:AddChild(obj_win_card)
@ -376,7 +479,7 @@ function M:EventInit()
-- info:UpdateScore()
info._view:GetChild("zhanji").visible = true
local num = data[i].hp_info.total_hp
if num > 0 then
if num >= 0 then
info._view:GetController("text_color").selectedIndex = 0
info._view:GetChild("text_jifen").text = "+" .. d2ad(num)
else
@ -416,7 +519,7 @@ function M:EventInit()
_gamectr:AddEventListener(TX_GameEvent.EvnetPiaoTip, function()
self:UpdateRound()
self._tex_LeftCard.text = "0"
self._tex_LeftCard.text = "剩余0张牌"
self._state.selectedIndex = 1
self:__PiaoNiaoTip()
end)
@ -768,7 +871,7 @@ function M:ReloadRoom(bskip)
if bskip == nil or bskip == false then
self:UpdateCardBox(self:GetPos(room.curren_outcard_seat))
self._tex_LeftCard.text = room.left_count
self._tex_LeftCard.text = string.format("剩余%d张牌", room.left_count)
self:UpdateRound()
end
end
@ -795,6 +898,26 @@ function M:UpdateCardBox(seat)
self._ctr_cardbox.selectedIndex = index
end
-----------------------lingmeng----------------------------
function M:SendShowNext(ShowNextConfrimCtr)
if not self._showNextName then
ViewUtil.ErrorTip(nil, "请先选择一个麻将牌")
return
end
ShowNextConfrimCtr.selectedIndex = 1
end
function M:ClickShowNext(context, ShowNextConfrimCtr)
if self._showNextName == context.data.name then
self:SendShowNext(ShowNextConfrimCtr)
return
end
self._showNextName = context.data.name
end
-----------------------------------------------------------
function M:__CloseTip()
if self._chipeng_tip then
self._chipeng_tip:Dispose()

View File

@ -4,11 +4,11 @@ local PlayerInfoView_copy = require("Game.View.PlayerInfoView_copy")
local M = {}
function M.new(view, mainView)
-- if mainView._room.room_config.people_num == 2 then
-- setmetatable(M, { __index = PlayerInfoView_copy })
-- else
setmetatable(M, { __index = PlayerInfoView })
-- end
if mainView._room.room_config.people_num == 2 then
setmetatable(M, { __index = PlayerInfoView_copy })
else
setmetatable(M, { __index = PlayerInfoView })
end
local self = setmetatable({}, { __index = M })
self._view = view
self._main_view = mainView
@ -17,14 +17,14 @@ function M.new(view, mainView)
end
function M:init()
-- if self._main_view._room.room_config.people_num ~= 2 then
PlayerInfoView.init(self)
self._tex_score = self._view:GetChild("info"):GetChild("tex_score1")
self._tex_score2 = self._view:GetChild("info"):GetChild("tex_score2")
self._ct_score = self._view:GetChild("info"):GetController("score")
-- else
-- PlayerInfoView_copy.init(self)
-- end
if self._main_view._room.room_config.people_num ~= 2 then
PlayerInfoView.init(self)
self._tex_score = self._view:GetChild("info"):GetChild("tex_score1")
self._tex_score2 = self._view:GetChild("info"):GetChild("tex_score2")
self._ct_score = self._view:GetChild("info"):GetController("score")
else
PlayerInfoView_copy.init(self)
end
end
function M:ShowInteraction(type, str)
@ -57,12 +57,12 @@ function M:UpdateRemainCard(card_num, hide)
end
function M:FillData(player)
-- if self._main_view._room.room_config.people_num == 2 then
-- PlayerInfoView_copy.FillData(self, player)
-- else
PlayerInfoView.FillData(self, player)
self:UpdateScore(player.total_score)
-- end
if self._main_view._room.room_config.people_num == 2 then
PlayerInfoView_copy.FillData(self, player)
else
PlayerInfoView.FillData(self, player)
self:UpdateScore(player.total_score)
end
end
function M:UpdateScore()

View File

@ -0,0 +1,60 @@
--设置窗口对象
local EXSettingView = {}
local M = EXSettingView
setmetatable(M, { __index = BaseWindow })
function EXSettingView.new(main_view)
local self = setmetatable({}, { __index = M })
self.class = 'EXSettingView'
self._close_destroy = true
self._mainView = main_view
self:init('ui://Main_Majiang/Setting')
return self
end
function M:init(url)
BaseWindow.init(self, url)
local view = self._view
local slider_sound = view:GetChild('slider_vedio_sound')
local slider_music = view:GetChild('slider_vedio_music')
local btn_music = view:GetChild('btn_vedio_music')
local btn_sound = view:GetChild('btn_vedio_sound')
-- slider_sound.value = GameApplication.Instance.SoundValue
-- slider_music.value = GameApplication.Instance.MusicValue
slider_music.onChanged:Add(function()
-- GameApplication.Instance.MusicValue = slider_music.value
-- btn_music.selected = false
-- GameApplication.Instance.MusicMute = false;
end)
slider_sound.onChanged:Add(function()
-- GameApplication.Instance.SoundValue = slider_sound.value
-- btn_sound.selected = false
-- GameApplication.Instance.SoundMute = false;
end)
btn_sound.onClick:Add(function()
-- GameApplication.Instance.SoundMute = btn_sound.selected;
end)
btn_music.onClick:Add(function()
-- GameApplication.Instance.MusicMute = btn_music.selected;
end)
local _btn_logout = self._view:GetChild('btn_closeRoom')
_btn_logout.onClick:Set(function()
if self._mainView.dismiss_room_cd_time > 0 then
ViewUtil.ErrorTip(nil, "您还处于解散冷却时间当中,请稍后重试!")
else
local _gamectr = ControllerManager.GetController(GameController)
_gamectr:AskDismissRoom()
end
end)
end
return M

View File

@ -58,7 +58,7 @@ function M:UpdateHandCard(getcard, mp)
local card_list = DataManager.CurrenRoom.self_player.card_list
self:ShowHuTip(card_list)
-- self:ShowHuTip(card_list)
if getcard then
self._out_card = true
local card_list = membe_clone(DataManager.CurrenRoom.self_player.card_list)
@ -130,7 +130,7 @@ function M:__OnClickHandCard(context)
end
if self._out_card then
self:ShowHuTip(card_list)
-- self:ShowHuTip(card_list)
end
-- 标记出牌
@ -152,7 +152,7 @@ end
function M:__OnDragStart(card)
local card_list = membe_clone(DataManager.CurrenRoom.self_player.card_list)
list_remove(card_list, card)
self:ShowHuTip(card_list)
-- self:ShowHuTip(card_list)
end
function M:__OnDragEnd(context)

View File

@ -47,6 +47,9 @@ local Protocol = {
GAME_EVT_GANGZI = "837",
GAME_EVT_BUGANG = "838",
GAME_EVT_DOGANG = "839",
--送牌
GAME_NEXT_CARD = "888"
}
return Protocol

View File

@ -1,7 +1,7 @@
local EXTEND_MODEL_NAME = ...
local EXGameInfo = import(".EXGameInfo")
local EXMainView = import(".EXMainView_jaingxi")
local EXMainView = import(".EXMainView")
local EXGameController = import(".EXGameController")
local EXRoomConfig = import(".EXRoomConfig")
local EXPlayBackView = import(".EXPlayBackView")

View File

@ -6,610 +6,283 @@ local EXClearingView = {}
local M = EXClearingView
function EXClearingView.new(blur_view)
setmetatable(M, {__index = ResultView})
local self = setmetatable({}, {__index = M})
self._full = true
ResultView.init(self, "ui://Main_Majiang/clearing")
setmetatable(M, { __index = ResultView })
local self = setmetatable({}, { __index = M })
self._full = true
ResultView.init(self, "ui://Main_Majiang/clearing")
self._currenIndex = 0
self._blur_view = blur_view
self._close_zone = false
self:InitMaPai()
return self
self._currenIndex = 0
self._blur_view = blur_view
self._close_zone = false
-- self:InitMaPai()
return self
end
function M:InitMaPai()
self.maPaiCtr=self._view:GetController("mapai")
self.maPaiCtr.selectedIndex=0
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
end
end
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)
end
end
function M:ShowSelectMaPai(niaoList)
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)
end
end
else
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)
end
end
end
printlog("牌型列表====>>>")
pt(self.WinList)
end
function M:SetPaixingxiangqing(num)
for i=1,#self.PaiXingXiangQingCtrList do
if self.PaiXingXiangQingCtrList[i] then
self.PaiXingXiangQingCtrList[i].selectedIndex=num
end
end
end
-- function M:InitMaPai()
-- self.maPaiCtr = self._view:GetController("mapai")
-- self.maPaiCtr.selectedIndex = 0
-- self.maPaiList = {}
-- for i = 1, 8 do
-- local tempMP = self._view:GetChild("niao" .. i)
-- table.insert(self.maPaiList, tempMP)
-- end
-- end
function M:InitData(over, room, result, total_result, callback)
-- print("===============================InitData===========================", over, room, result, total_result)
-- pt(room)
-- pt(result)
-- Pt(total_result)
self._callback = callback
local showClearMainBtn = self._view:GetChild("btn_showClearMain")
local nextRoundBtn = self._view:GetChild("btn_nextRound")
local nextRoundBtn2 = self._view:GetChild("Btn_NextRound2")
local endRound = self._view:GetChild("Btn_EndRound")
local _overCtr = self._view:GetController("over")
local mainCtr = self._view:GetController("main")
local playerNum = self._view:GetController("playerNum")
local showBtnTypeCtr = self._view:GetController("showType")
self._callback = callback
local _overCtr = self._view:GetController("over")
local btn_confirm = self._view:GetChild("btn_confirm")
local btn_result = self._view:GetChild("btn_showResult")
local btn_close = self._view:GetChild("big_result"):GetChild("btn_close")
local _btnCtr = self._view:GetController("button")
local _sdkCtr = self._view:GetController("sdk")
local ctr_type = self._view:GetController("type")
local peopleNum = room.room_config.people_num
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
self:ShowSelectMaPai(result.niao)
self:CalculatePaixingInfo(result)
end
self.PaiXingXiangQingCtrList={}
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)
fanhuipaixing.onClick:Add(function()
paixingxiangqing.visible=true
fanhuipaixing.visible=false
self:SetPaixingxiangqing(0)
end)
playerNum.selectedIndex = peopleNum - 2
if over ~= 2 then
if result.liuju then
ctr_type.selectedIndex = 3
else
local info_list = result.info_list
for i = 1, #info_list do
local is_win = info_list[i].is_win
if is_win then
if info_list[i].seat == room.self_player.seat then
ctr_type.selectedIndex = 1
else
ctr_type.selectedIndex = 2
end
end
end
end
showClearMainBtn.onClick:Set(function()
mainCtr.selectedIndex = 1
end)
if over == 0 then
_btnCtr.selectedIndex = 0
_sdkCtr.selectedIndex = 1
btn_confirm.onClick:Add(function()
local _gamectr = ControllerManager.GetController(GameController)
_gamectr:PlayerReady()
self:DestroyWithCallback()
end)
self:AddClearItem(room, result.info_list, nil, over, result.niao, result.active_player)
elseif over == 1 then
_btnCtr.selectedIndex = 1
_sdkCtr.selectedIndex = 1
btn_result.onClick:Add(function()
self.maPaiCtr.selectedIndex=0
_overCtr.selectedIndex = 1
_btnCtr.selectedIndex = 0
_sdkCtr.selectedIndex = 0
if self._qsinfo_view then
self._qsinfo_view:Dispose()
end
end)
btn_close.onClick:Add(function()
ViewManager.ChangeView(ViewManager.View_Lobby)
end)
self:AddClearItem(room, result.info_list, total_result.info_list, over, result.niao, result.active_player)
end
else
_overCtr.selectedIndex = 1
self.maPaiCtr.selectedIndex=0
btn_close.onClick:Add(function()
ViewManager.ChangeView(ViewManager.View_Lobby)
end)
self:AddClearItem(room, nil, total_result.info_list, over)
end
end
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)
list_view1:RemoveChildrenToPool()
for i=1,#data do
local item = list_view1:AddItemFromPool()
self:FillItemData(room, data[i], item, active_player, niao)
end
if #data == 3 then
list_view1.lineGap = 54
elseif #data == 2 then
list_view1.lineGap = 108
end
if 1 == over then
self:FillItemData2(room, total_data, list_view2)
end
elseif 2 == over then
self:FillItemData2(room, total_data, list_view2)
end
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=""--抓马
local user = room:GetPlayerBySeat(data["seat"]).self_user
local head = item:GetChild('head'):GetChild('n4')
ImageLoad.Load(user.head_url, head)
-- 手牌
local hand_cards = data["hand_card"]
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
local card = hand_list_view:AddItemFromPool()
card.icon = "ui://Main_Majiang/202_"..hand_cards[i]
end
hand_list_view.width = 52 * #hand_cards
local fz_card = p.fz_list
local fz_card_list = item:GetChild("fz_card_list")
fz_card_list.width = 157 * #fz_card * 0.8
fz_card_list:RemoveChildrenToPool()
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
local card = item:GetChild("card_" .. j)
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
local card = item:GetChild("card_" .. 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
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
end
end
end
end
local huadd = data["hu_score"]
local gangadd = data["gang_score"]
local total = data["round_score"]
local geng_zhuan=data["geng_zhuan"]
local sp = " "
local str = "胡:"..huadd..""
str = str..sp.."杠:"..gangadd..""
item:GetChild("score1").text = str
-- local total_score = data["total_score"]
if total >= 0 then
item:GetChild("score2").text = "+"..total
item:GetChild("score2").grayed = false
else
item:GetChild("score2").text = total
item:GetChild("score2").grayed = true
end
--计算牌型
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=""
if is_win then
if win_list then
if DataManager.CurrenRoom.isZiMoHu then
str1="自摸"
else
str1="接炮"
end
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
end
end
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 huName then
if j==1 then
str1=str1..huName.."x"..self.WinList[i][j].score
else
str1=str1..sp..huName.."x"..self.WinList[i][j].score
end
end
end
end
str1=str1.." "..huadd..""
else
printlog("服务端自摸计算异常===>>>")
end
else
printlog("非自摸处理====>>>")
--点炮 一炮多响
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)
end
end
end
if #allTypeList>0 then
for i=1,#allTypeList do
local huName=Hu_Type_Name[allTypeList[i]]
if huName then
str1=str1..huName..""
end
end
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]
if huName then
str1=str1..sp..huName.."x"..self.WinList[i][j].score
end
end
end
str1=str1.." "..huadd..""
else
printlog("服务端自摸计算异常===>>>")
end
end
end
end
end
--
printlog("牌型计算==>>>",str1)
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"]
end
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..""
else
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"]..""
else
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..""
else
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)
-------------------------
local hp_nonnegative = room:checkHpNonnegative()
item:GetController("nonnegative").selectedIndex = hp_nonnegative and 1 or 0
if hp_nonnegative then
local hp_info = data.hp_info
local ctr_hp_limit = item:GetController("hp_limit")
local hp = d2ad(hp_info.round_actual_hp)
if hp >= 0 then hp = "+" .. tostring(hp) end
item:GetChild("tex_hp").text = hp
ctr_hp_limit.selectedIndex = hp_info.upper_limit and 1 or 0
end
item:GetController("win").selectedIndex = is_win and 0 or 1
if p.self_user.account_id == active_player and is_win == false and total < 0 then
item:GetController("win").selectedIndex = 2
end
if is_win then
item:GetController("bg").selectedIndex=1
else
item:GetController("bg").selectedIndex=0
end
local win_card = item:GetChild("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
local lst_niao = item:GetChild("list_niao")
lst_niao:RemoveChildrenToPool()
for i = 1, #currentNiaoList do
if currentNiaoList[i].score > 0 then
local card_niao = lst_niao:AddItemFromPool()
card_niao.icon = "ui://Main_Majiang/202_" .. currentNiaoList[i].card
end
end
end
end
if p.seat == room.banker_seat then
item:GetController("bank").selectedIndex = 1
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])
end
end
return tempNiao
end
nextRoundBtn.onClick:Set(function()
local _gamectr = ControllerManager.GetController(GameController)
_gamectr:PlayerReady()
self:DestroyWithCallback()
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
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)
endRound.onClick:Set(function()
ViewManager.ChangeView(ViewManager.View_Family)
end)
if over == 0 then
showBtnTypeCtr.selectedIndex = 0
_overCtr.selectedIndex = 0
self:fillResult0(room, peopleNum, result)
nextRoundBtn2.onClick:Set(function()
local _gamectr = ControllerManager.GetController(GameController)
_gamectr:PlayerReady()
self:DestroyWithCallback()
end)
elseif over == 1 then
showBtnTypeCtr.selectedIndex = 1
self:fillResult1(room, peopleNum, total_result)
if result then
self:fillResult0(room, peopleNum, result)
nextRoundBtn2.onClick:Set(function()
_overCtr.selectedIndex = 1
end)
else
_overCtr.selectedIndex = 1
end
else --解散房间如果没有开局直接退出不显示结算界面over=2
if room.curren_round > 0 then
_overCtr.selectedIndex = 1
showBtnTypeCtr.selectedIndex = 1
self:fillResult1(room, peopleNum, total_result)
else
ViewManager.ChangeView(ViewManager.View_Family)
end
end
end
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
lst_p.columnGap = 108
elseif #player_list == 2 then
lst_p.columnGap = 208
end
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
function M:fillResult0(room, peopleNum, result)
local config = ExtendManager.GetExtendConfig(room.game_id)
local mode = config:GetGameInfo()
local gamePlay = mode:LoadConfigToDetail(json.encode(room.room_config.config))
self._view:GetChild("Label_GamePlay").title = string.format("第%s/%s局,%s", room.curren_round,
room.room_config.round, gamePlay)
for i = 1, peopleNum do
local playerInfoComp = self._view:GetChild(string.format("Comp_Player%d", i))
local allCardsList = playerInfoComp:GetChild("list_allCards")
local huCardBtn = playerInfoComp:GetChild("Btn_Card_Hu")
local jiangMaList = playerInfoComp:GetChild("list_JiangMa")
local ziMoCtr = playerInfoComp:GetController("isZiMo")
local dianPaoCtr = playerInfoComp:GetController("isPao")
local isMeCtr = playerInfoComp:GetController("IsMe")
local isZhuang = playerInfoComp:GetController("zhuang")
local infoList = result.info_list[i]
local playInfo = room:GetPlayerBySeat(infoList.seat)
local fzCardInfo = playInfo.fz_list
local fzInfoNum = #fzCardInfo
local handInfoNum = #infoList.hand_card
self:fillHead(playInfo.self_user.head_url, playerInfoComp)
playerInfoComp:GetChild("text_name").text = playInfo.self_user.nick_name
playerInfoComp:GetChild("Text_BoJing").text = infoList.jing_score >= 0 and
string.format("+%d", infoList.jing_score) or infoList.jing_score
playerInfoComp:GetChild("Text_Gang").text = infoList.gang_score >= 0 and
string.format("+%d", infoList.gang_score) or infoList.gang_score
playerInfoComp:GetChild("Text_Hu").text = infoList.hu_score >= 0 and string.format("+%d", infoList.hu_score) or
infoList.hu_score
playerInfoComp:GetChild("Text_Tatal").text = infoList.round_score >= 0 and
string.format("+%d", infoList.round_score) or infoList.round_score
for j = 1, fzInfoNum do
if fzCardInfo[j].type == FZType.Peng then
local item = allCardsList:AddItemFromPool("ui://Main_Majiang/Comp_Clearing_FZ_3")
for l = 1, 3 do
local card = item:GetChild(string.format("Btn_Card%d", l))
card.icon = string.format("ui://Main_Majiang/%s202_%d", self:GetPrefix(), fzCardInfo[j].card)
print("===============================FZType.Peng", room.jing, fzCardInfo[j].card)
if room.jing == fzCardInfo[j].card then
card:GetController('jing').selectedIndex = 1
end
end
elseif fzCardInfo[j].type == FZType.Chi then
local item = allCardsList:AddItemFromPool("ui://Main_Majiang/Comp_Clearing_FZ_3")
for l = 1, 3 do
local card = item:GetChild(string.format("Btn_Card%d", l))
card.icon = string.format("ui://Main_Majiang/%s202_%d", self:GetPrefix(), fzCardInfo[j].opcard
[l])
print("===============================FZType.Chi", room.jing, fzCardInfo[j].opcard[l])
if room.jing == fzCardInfo[j].opcard[l] then
card:GetController('jing').selectedIndex = 1
end
end
elseif fzCardInfo[j].type == FZType.Gang or fzCardInfo[j].type == FZType.Gang_An or fzCardInfo[j].type == FZType.Gang_Peng then
local item = allCardsList:AddItemFromPool("ui://Main_Majiang/Comp_Clearing_FZ_4")
for l = 1, 4 do
local card = item:GetChild(string.format("Btn_Card%d", l))
if fzCardInfo[j].type == FZType.Gang_An and j == 4 then
card.icon = "ui://Main_Majiang/202_00"
else
card.icon = string.format("ui://Main_Majiang/%s202_%d", self:GetPrefix(), fzCardInfo[j].card)
print("===============================FZType.Gang", room.jing, fzCardInfo[j].card)
if room.jing == fzCardInfo[j].card then
card:GetController('jing').selectedIndex = 1
end
end
end
end
end
local handCardItem = allCardsList:AddItemFromPool("ui://Main_Majiang/Comp_HandCard")
local handCardList = handCardItem:GetChild("list")
handCardList:SetVirtual()
handCardList.itemRenderer = function(index, obj)
obj.icon = string.format("ui://Main_Majiang/%s202_%d", self:GetPrefix(), infoList.hand_card[index + 1])
if room.jing == infoList.hand_card[index + 1] then
ViewUtil:ErrorTip("显示精")
obj:GetController('jing').selectedIndex = 1
end
end
handCardList.numItems = handInfoNum
allCardsList.width = 172 * fzInfoNum + 60 + (handInfoNum - 1) * 56 + 36 * (fzInfoNum)
if infoList.seat == room.self_player.seat then
isMeCtr.selectedIndex = 1
end
if infoList.seat == room.banker_seat then
ViewUtil:ErrorTip("显示庄家")
isZhuang.selectedIndex = 1
end
if infoList.is_win then
local winInfo = ""
for j = 1, #infoList.win_list do
winInfo = string.format("%s,%s", winInfo, Hu_Type_Name[infoList.win_list[j].type])
end
winInfo = string.sub(winInfo, 2, -1)
playerInfoComp:GetChild("text_huShow").text = winInfo
if room.isZiMoHu then
ziMoCtr.selectedIndex = 1
end
huCardBtn.icon = string.format("ui://Main_Majiang/202_%d", infoList.win_card)
huCardBtn.visible = true
jiangMaList.visible = false
else
playerInfoComp:GetChild("text_huShow").text = ""
if not room.isZiMoHu and playInfo.self_user.account_id == result.active_player then
dianPaoCtr.selectedIndex = 1
end
huCardBtn.visible = false
jiangMaList.visible = false
end
end
end
function M:fillResult1(room, peopleNum, total_result)
local gameNameAndRoomIDText = self._view:GetChild("Text_GameNameAndRoomID")
local familyIDText = self._view:GetChild("Text_FamilyID")
for i, v in pairs(room.self_player.self_user.games) do
if v.game_id == room.game_id then
gameNameAndRoomIDText.text = string.format("%s 房号:%s", v.name, room.room_id)
end
end
if #gameNameAndRoomIDText.text <= 0 then
gameNameAndRoomIDText.text = string.format("房号:%s", room.room_id)
end
if room.group_id ~= 0 then
big_result:GetController("group").selectedIndex = 1
familyIDText.text = string.format("俱乐部:%s", room.group_id)
else
familyIDText.visible = false
end
self._view:GetChild("Text_RoundNum").text = string.format("局数:%s/%s", room.curren_round, room.room_config.round)
self._view:GetChild("Text_Time").text = os.date("%Y-%m-%d %H:%M:%S", os.time())
for i = 1, peopleNum do
local resultInfoComp = self._view:GetChild(string.format("Comp_ResultInfo%d", i))
local totalInfoList = total_result.info_list[i]
local playInfo = room:GetPlayerBySeat(totalInfoList.seat)
self:fillHead(playInfo.self_user.head_url, resultInfoComp)
resultInfoComp:GetChild('Text_Name').text = playInfo.self_user.nick_name
resultInfoComp:GetChild('Text_ID').text = string.format("ID:%s", playInfo.self_user.account_id)
resultInfoComp:GetChild('Text_TotalScore').text = totalInfoList.total_score >= 0 and
string.format("+%s", totalInfoList.total_score) or totalInfoList.total_score
resultInfoComp:GetChild('Text_ZiMo').text = string.format("自摸 %d次", totalInfoList.settle_log.zimo or 0)
resultInfoComp:GetChild('Text_JiePao').text = string.format("接炮 %d次", totalInfoList.settle_log.jiepao or 0)
resultInfoComp:GetChild('Text_FangPao').text = string.format("放炮 %d次", totalInfoList.settle_log.fangpao or 0)
resultInfoComp:GetChild('Text_AnGang').text = string.format("暗杠 %d次", totalInfoList.settle_log.an_kong or 0)
resultInfoComp:GetChild('Text_MingGang').text = string.format("明杠 %d次",
totalInfoList.settle_log.ming_kong or 0)
resultInfoComp:GetChild('Text_FangGang').text = string.format("放杠 %d次",
totalInfoList.settle_log.fanggang or 0)
resultInfoComp:GetController("win").selectedIndex = totalInfoList.total_score >= 0 and 1 or 0
end
DataManager.CurrenRoom = nil
end
function M:LoadHead(p, room)
local btn_head = self._view:GetChild("btn_head")
for i = 1, #room.player_list do
local player = room.player_list[i]
if p.seat == player.seat and player.self_user.head_url ~= "" then
ImageLoad.Load(player.self_user.head_url, btn_head.icon)
end
end
function M:fillHead(url, view)
ImageLoad.Load(url, view:GetChild("Btn_Head")._iconObject)
end
local prefix
function M:GetPrefix()
-- if not prefix then
prefix = get_majiang_prefix(10)
-- if not prefix then
prefix = get_majiang_prefix(10)
-- end
return prefix
return prefix
end
function M:DestroyWithCallback()
if self._callback then
self._callback()
end
self:Destroy()
function M:DestroyWithCallback()
if self._callback then
self._callback()
end
self:Destroy()
end
return M
return M

View File

@ -40,6 +40,18 @@ end
local __pre_delete_card = false
-- 发送出牌指令到服务器
-------------------------lingmeng---------------------------
function M:SendNextCard(card)
local _data = {}
_data["card"] = tonumber(card)
local _client = ControllerManager.GameNetClinet
_client:send(TX_Protocol.GAME_NEXT_CARD, _data)
end
------------------------------------------------------------
function M:SendOutCard(card, callback)
local _data = {}
_data["card"] = card
@ -117,6 +129,8 @@ function M:OnEventSendCards(evt_data)
local handcards = evt_data["card_list"]
local p = _room.self_player
local seat = evt_data["bank_seat"]
local jing = evt_data["jing"]
_room.jing = jing
self._cacheEvent:Enqueue(function()
_room.banker_seat = seat
for i = 1, #_room.player_list do

View File

@ -4,7 +4,7 @@ local MJMainView = require("main.majiang.MJMainView")
local EXClearingView = import(".EXClearingView")
local TX_GameEvent = import(".GameEvent")
local HuTipView = import("main.majiang.HuTipView")
local SettingView = import("main.majiang.MJSettingViewNew")
local SettingView = import(".EXSettingView")
local PlayerInfoView = import(".EXPlayerInfoView")
local M = {}
@ -42,6 +42,93 @@ function M:InitView(url)
self.Laizi2Btn.visible = true
self.bugangnum = self._view:GetChild("bugangnum")
--lingmeng
--[[
MJMainView.InitView(self, "ui://Main_Majiang/Main_new_" .. room.room_config.people_num)
--]]
self.jing = self._view:GetChild('jing')
local showNextCtr = self._view:GetController('showNext')
local ShowNextConfrimCtr = self._view:GetController('showNextConfrim')
local showNextList = self._view:GetChild('list_showNext')
local pop_showNextConfrim = self._view:GetChild('pop_showNextConfrim')
self._view:GetChild('btn_showNext').onClick:Set(function()
showNextCtr.selectedIndex = 1
end)
self._view:GetChild('btn_sendShow').onClick:Set(function()
self:SendShowNext(ShowNextConfrimCtr)
end)
self._view:GetChild('btn_closeShow').onClick:Set(function()
ShowNextConfrimCtr.selectedIndex = 0
showNextCtr.selectedIndex = 0
showNextList.selectedIndex = -1
self._showNextName = nil
end)
showNextList.onClickItem:Set(function(context)
local _gamectr = ControllerManager.GetController(GameController)
_gamectr:SendNextCard(string.sub(context.data.name, -3))
showNextCtr.selectedIndex = 0
showNextList.selectedIndex = -1
self._showNextName = nil
-- self:ClickShowNext(context, ShowNextConfrimCtr)
end)
ShowNextConfrimCtr.onChanged:Set(function()
pop_showNextConfrim:GetChild("btn_ShowCard").icon = self._showNextName
end)
pop_showNextConfrim:GetChild("btn_center").onClick:Set(function()
local _gamectr = ControllerManager.GetController(GameController)
_gamectr:SendNextCard(string.sub(self._showNextName, -3))
ShowNextConfrimCtr.selectedIndex = 0
showNextCtr.selectedIndex = 0
showNextList.selectedIndex = -1
self._showNextName = nil
end)
if self._room.room_config.people_num == 2 then
local btn_closeRoom = self._view:GetChild("btn_setting")
self._view:GetChild('btn_closeRoom').onClick:Set(function()
---[[
--旧
local tip_owner = '您是否退出房间?\n(退出房间后房间将解散)'
local tip = '您是否退出房间?' -- \n (请注意,申请洗牌后退出,不会返还洗牌分)
local tipStr = ''
if self._room.agent then
tipStr = '您是否退出房间?'
else
tipStr = self._room.owner_id == self._room.self_player.self_user.account_id and tip_owner or tip
end
local _curren_msg = MsgWindow.new(self._root_view, tipStr, MsgWindow.MsgMode.OkAndCancel)
_curren_msg.onOk:Add(
function()
if self._state.selectedIndex > 0 and self._state.selectedIndex < 3 then
ViewUtil.ErrorTip(nil, '房间已开始,无法退出游戏。')
else
ViewUtil.ShowModalWait(self._root_view)
self._gamectr:LevelRoom(
function(res)
ViewUtil.CloseModalWait()
if res.ReturnCode == 0 then
ViewManager.ChangeView(ViewManager.View_Family)
else
ViewUtil.ErrorTip(res.ReturnCode)
end
end
)
end
end
)
_curren_msg:Show()
--]]
end)
btn_closeRoom.onClick:Add(handler(self, function()
local settingView = SettingView.new(self)
settingView:Show()
end))
end
--------
self:PlayerChangeLineState()
if room.playing or room.curren_round > 0 then
@ -108,6 +195,19 @@ function M:UpdateRound()
end
end
function M:ShowJing()
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
end
function M:InitPlayerInfoView()
self._player_info = {}
local _player_info = self._player_info
@ -148,12 +248,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)
@ -162,6 +263,7 @@ function M:EventInit()
-- self:ShowHuTip()
self:UpdateRound()
self._state.selectedIndex = 1
self:ShowJing()
local list = _room.player_list
for i = 1, #list do
local p = list[i]
@ -244,7 +346,7 @@ function M:EventInit()
self:RemoveCursor()
info:UpdateHandCard(true, true)
local obj_win_card = UIPackage.CreateObjectFromURL("ui://Main_Majiang/Btn_Card")
local obj_win_card = UIPackage.CreateObjectFromURL("ui://Main_Majiang/Btn_Card_jiangxi")
obj_win_card.icon = "ui://Main_Majiang/202_" .. win_card
obj_win_card:GetController("bg").selectedIndex = 1
info._view:AddChild(obj_win_card)
@ -377,7 +479,7 @@ function M:EventInit()
-- info:UpdateScore()
info._view:GetChild("zhanji").visible = true
local num = data[i].hp_info.total_hp
if num > 0 then
if num >= 0 then
info._view:GetController("text_color").selectedIndex = 0
info._view:GetChild("text_jifen").text = "+" .. d2ad(num)
else
@ -796,6 +898,26 @@ function M:UpdateCardBox(seat)
self._ctr_cardbox.selectedIndex = index
end
-----------------------lingmeng----------------------------
function M:SendShowNext(ShowNextConfrimCtr)
if not self._showNextName then
ViewUtil.ErrorTip(nil, "请先选择一个麻将牌")
return
end
ShowNextConfrimCtr.selectedIndex = 1
end
function M:ClickShowNext(context, ShowNextConfrimCtr)
if self._showNextName == context.data.name then
self:SendShowNext(ShowNextConfrimCtr)
return
end
self._showNextName = context.data.name
end
-----------------------------------------------------------
function M:__CloseTip()
if self._chipeng_tip then
self._chipeng_tip:Dispose()

View File

@ -0,0 +1,60 @@
--设置窗口对象
local EXSettingView = {}
local M = EXSettingView
setmetatable(M, { __index = BaseWindow })
function EXSettingView.new(main_view)
local self = setmetatable({}, { __index = M })
self.class = 'EXSettingView'
self._close_destroy = true
self._mainView = main_view
self:init('ui://Main_Majiang/Setting')
return self
end
function M:init(url)
BaseWindow.init(self, url)
local view = self._view
local slider_sound = view:GetChild('slider_vedio_sound')
local slider_music = view:GetChild('slider_vedio_music')
local btn_music = view:GetChild('btn_vedio_music')
local btn_sound = view:GetChild('btn_vedio_sound')
-- slider_sound.value = GameApplication.Instance.SoundValue
-- slider_music.value = GameApplication.Instance.MusicValue
slider_music.onChanged:Add(function()
-- GameApplication.Instance.MusicValue = slider_music.value
-- btn_music.selected = false
-- GameApplication.Instance.MusicMute = false;
end)
slider_sound.onChanged:Add(function()
-- GameApplication.Instance.SoundValue = slider_sound.value
-- btn_sound.selected = false
-- GameApplication.Instance.SoundMute = false;
end)
btn_sound.onClick:Add(function()
-- GameApplication.Instance.SoundMute = btn_sound.selected;
end)
btn_music.onClick:Add(function()
-- GameApplication.Instance.MusicMute = btn_music.selected;
end)
local _btn_logout = self._view:GetChild('btn_closeRoom')
_btn_logout.onClick:Set(function()
if self._mainView.dismiss_room_cd_time > 0 then
ViewUtil.ErrorTip(nil, "您还处于解散冷却时间当中,请稍后重试!")
else
local _gamectr = ControllerManager.GetController(GameController)
_gamectr:AskDismissRoom()
end
end)
end
return M

View File

@ -58,7 +58,7 @@ function M:UpdateHandCard(getcard, mp)
local card_list = DataManager.CurrenRoom.self_player.card_list
self:ShowHuTip(card_list)
-- self:ShowHuTip(card_list)
if getcard then
self._out_card = true
local card_list = membe_clone(DataManager.CurrenRoom.self_player.card_list)
@ -130,7 +130,7 @@ function M:__OnClickHandCard(context)
end
if self._out_card then
self:ShowHuTip(card_list)
-- self:ShowHuTip(card_list)
end
-- 标记出牌
@ -152,7 +152,7 @@ end
function M:__OnDragStart(card)
local card_list = membe_clone(DataManager.CurrenRoom.self_player.card_list)
list_remove(card_list, card)
self:ShowHuTip(card_list)
-- self:ShowHuTip(card_list)
end
function M:__OnDragEnd(context)

View File

@ -47,6 +47,9 @@ local Protocol = {
GAME_EVT_GANGZI = "837",
GAME_EVT_BUGANG = "838",
GAME_EVT_DOGANG = "839",
--送牌
GAME_NEXT_CARD = "888"
}
return Protocol

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 MiB

After

Width:  |  Height:  |  Size: 944 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 0e38ff08c92b6fe4f9fb606078139c8f

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

View File

@ -0,0 +1,92 @@
fileFormatVersion: 2
guid: 4bc6de557fd8b01469ea797a88fab6e7
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: dbed66f7225e8e947bf642537b101869

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 MiB

After

Width:  |  Height:  |  Size: 944 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 954 KiB

View File

@ -0,0 +1,92 @@
fileFormatVersion: 2
guid: 1bac4deafc7d3de4eb47ce486a4975ea
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 981 KiB

After

Width:  |  Height:  |  Size: 945 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 954 KiB

View File

@ -0,0 +1,92 @@
fileFormatVersion: 2
guid: 67a875cabb31a38438757231517e845b
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant: