0908测试后同步

master
罗家炜 2025-09-09 14:58:47 +08:00
parent eb7e5aa9a7
commit b1b799045d
86 changed files with 840 additions and 364 deletions

View File

@ -166,7 +166,7 @@ function M:ExitWitnessGame(pid, gid, rid)
_data["room_id"] = rid
-- _data["session"] = _client:getSession()
_client:send(Protocol.GAME_Exit_WITNESS_ROOM, _data)
_client:destroy()
-- _client:destroy()
end
--聊天

View File

@ -10,7 +10,7 @@ function M.New(data, callback)
local self = setmetatable({}, { __index = M })
self._full = true
self.class = "com_FamilyMsgRecord"
BaseWindow.init(self, 'ui://Family/com_FamilyMsgRecord')
BaseWindow.init(self, 'ui://Family/com_FamilyMsgDiamond')
self.data = data
self:Init()
self.closeCallback = callback

View File

@ -675,7 +675,7 @@ function M:UpdateFamilyRoom(fgCtr, id)
self:EnterWitnesss(id, startRoom[newIndex].id, playInfo.gameId, startRoom[newIndex].pid)
end)
obj:GetChild('btn_jiesan').onClick:Set(function()
self:JieSanRomm(id, readyRoom[newIndex].id)
self:JieSanRomm(id, startRoom[newIndex].id)
end)
else
local newIndex = index - #readyRoom + 1
@ -1062,6 +1062,7 @@ local MORE_LIST = {
name = "关闭旁观",
Fct = M.SetCanWatch
},
}
function M:ChangeOther()
@ -1112,7 +1113,7 @@ function M:RefalshMoreBtn()
elseif self._group.isOpenChatRoom == 0 then
tex = "打开聊天室"
end
MORE_LIST[4].name = tex
MORE_LIST[5].name = tex
local tex = ""
if self._group.isWatch == 1 then
@ -1120,7 +1121,7 @@ function M:RefalshMoreBtn()
elseif self._group.isWatch == 0 then
tex = "打开观战"
end
MORE_LIST[5].name = tex
MORE_LIST[6].name = tex
local tex = ""
if self._group.ban then

View File

@ -110,7 +110,7 @@ end
function M:RecordDetailRenderer(index, obj, data)
local score = data.totalScore[index + 1].score
obj:GetController('colour').selectedIndex = score >= 0 and 1 or 0
obj:GetChild('text_score').text = string.format("%s%d", score > 0 and "+" or "", score)
obj:GetChild('text_score').text = string.format("%s%d", score >= 0 and "+" or "", score)
obj:GetChild('text_name').text = data.totalScore[index + 1].nick
end
@ -128,7 +128,7 @@ function M:PlayerScoreRenderer(index, obj)
obj:GetChild('text_time').text = os.date("%m-%d\n%H:%M:%S", tonumber(data.create_time))
local list_playerScore = obj:GetChild('list_playerScore')
list_playerScore.itemRenderer = function(index1, obj1)
obj1.text = string.format("%s%d", data[string.format("round_%d", index + 1)][index1 + 1].score > 0 and "+" or "",
obj1.text = string.format("%s%d", data[string.format("round_%d", index + 1)][index1 + 1].score >= 0 and "+" or "",
data[string.format("round_%d", index + 1)][index1 + 1].score)
end
list_playerScore.numItems = data.Info.peopleNum

View File

@ -42,6 +42,7 @@ function M:InitView(url)
contentPane.height = self._view.height
contentPane:Center()
self.com_notice = self._view:GetChild("com_notice")
local panel_record = self._view:GetChild('panel_record')
self._record = panel_record
local btn_LastRound = panel_record:GetChild('btn_LastRound')
@ -152,6 +153,15 @@ function M:InitView(url)
)
end
--没有update先不显示跑马灯
self.com_notice.visible = false
-- local text_notice = self.com_notice:GetChild("text_notice")
-- text_notice.text = DataManager.GameNotice[self.noticeIndex]
-- local speed = 44
-- local time = text_notice.width / speed
-- text_notice.x = self.com_notice.width
self._eventmap = {}
end

View File

@ -46,6 +46,7 @@ function M:init()
self._ctr_read = view:GetController('read')
self._ctr_offline = view:GetController('offline')
self._tex_score = view:GetChild('text_jifen')
self._mask_voice = view:GetChild('mask_voice')
self._btn_head = view:GetChild('btn_head')
self._ctr_bank = view:GetController('bank')
@ -112,6 +113,16 @@ function M:OnUpdate()
self:muShiPlayerUpdate()
end
end
if self.voiceTimePlay then
if self.voiceTime > 0 then
self.voiceTime = self.voiceTime - Time.deltaTime
self._mask_voice.text = math.floor(self.voiceTime)
else
self.voiceTimePlay = false
self._ctr_mask_voice.selectedIndex = 0
GameApplication.Instance.StopMusic = GameApplication.Instance.StopMusic - 1
end
end
end
function M:FillData(player)
@ -236,7 +247,7 @@ end
-- 表情 语音
function M:ShowInteraction(type, str)
if type == 3 then
print("lingmeng ShowInteractionq",str)
print("lingmeng ShowInteractionq", str)
Voice.DownLoad(
str,
function(clip)
@ -244,7 +255,7 @@ function M:ShowInteraction(type, str)
if (clip) then
print("lingmeng ShowInteraction1")
self:ShowMaskVoice(clip.length)
GameApplication.Instance:PlayVoice(clip)
GameApplication.Instance:PlayVoice(clip, 3)
print("lingmeng ShowInteraction2")
end
end
@ -308,17 +319,22 @@ end
function M:ShowMaskVoice(time, mask)
mask = mask or true
GameApplication.Instance.StopMusic = GameApplication.Instance.StopMusic + 1
if (mask) then
self._ctr_mask_voice.selectedIndex = 1
end
if (self.__runwait_voice ~= nil) then
coroutine.stop(self.__runwait_voice)
if (self.voiceTimePlay) then
-- coroutine.stop(self.__runwait_voice)
GameApplication.Instance.StopMusic = GameApplication.Instance.StopMusic - 1
end
self.__runwait_voice = nil
self.__runwait_voice = coroutine.start(self.__WaitMaskVoice, self, time)
-- self._mask_voice:GetTransition('t0'):Play()
self._mask_voice.text = math.floor(time)
self.voiceTime = time
self.voiceTimePlay = true
TimerManager.AddTimer(self.OnUpdate, self)
-- self.__runwait_voice = nil
-- self.__runwait_voice = coroutine.start(self.__WaitMaskVoice, self, time)
end
function M:__WaitMaskVoice(time)

View File

@ -289,6 +289,18 @@ function M:fillResult1(room, peopleNum, total_result)
local familyIDText = self._view:GetChild("Text_FamilyID")
print("lingmeng fillResult1")
pt(room)
--初始化大赢家和最佳炮手
local bigWin = { seat = -1, score = 0 }
local bestPao = { seat = -1, times = 0 }
--循环数据得出分数最大的大赢家,以及点炮次数最多的最佳炮手
for i = 1, #total_result.info_list do
if total_result.info_list[i].total_score > bigWin.score then
bigWin = { seat = total_result.info_list[i].seat, score = total_result.info_list[i].total_score }
end
if total_result.info_list[i].settle_log.fangpao and total_result.info_list[i].settle_log.fangpao > bestPao.times then
bestPao = { seat = total_result.info_list[i].seat, times = total_result.info_list[i].settle_log.fangpao }
end
end
for i, v in pairs(DataManager.SelfUser.games) do
if v.game_id == room.game_id then
gameNameAndRoomIDText.text = string.format("%s 房号:%s", v.name, room.room_id)
@ -326,6 +338,16 @@ function M:fillResult1(room, peopleNum, total_result)
totalInfoList.settle_log.fanggang or 0)
resultInfoComp:GetController("win").selectedIndex = totalInfoList.total_score >= 0 and 1 or 0
if totalInfoList.seat == bigWin.seat then
resultInfoComp:GetController("bigWin").selectedIndex = 1
-- else
-- resultInfoComp:GetController("bigWin").selectedIndex = 0
end
if totalInfoList.seat == bestPao.seat then
resultInfoComp:GetController("fangPao").selectedIndex = 1
-- else
-- resultInfoComp:GetController("fangPao").selectedIndex = 0
end
end
end

View File

@ -93,10 +93,6 @@ function M:InitView(url)
if room.playing or room.curren_round > 0 then
self:ReloadRoom()
end
---------为了下次复现出牌情况
--self._viewText_testName = self._view:GetChild('text_testName')
--self._viewText_testName.text = 0
end
function M:__BuGang(cardInfo, callback)
@ -149,7 +145,7 @@ function M:IsShowGangZi(btn, isShow)
end
function M:UpdateRound()
self._view:GetChild("text_round").text = string.format("局数:%d /%d", self._room.curren_round,
self._view:GetChild("text_round").text = string.format("局数:%d/%d", self._room.curren_round,
self._room.room_config.round)
end
@ -223,9 +219,9 @@ function M:EventInit()
_gamectr:AddEventListener(TX_GameEvent.SendCards, function(...)
-- self:ShowHuTip()
--测试用记录出牌权次数
--self._viewText_testName.text = 0
self:UpdateRound()
self:RemoveCursor()
self._state.selectedIndex = 1
self:ShowJing()
local list = _room.player_list
@ -297,6 +293,102 @@ function M:EventInit()
_gamectr:AddEventListener(TX_GameEvent.ZPHuCard, function(...)
MJMainView.OnHuCard(self, ...)
--[[
self._left_time = 0
self:UpdateCardBox(0)
self:__CloseTip()
self._popEvent = false
local arg = { ... }
local win_seat = arg[1]
local lose_seat = arg[2]
local win_card = arg[3]
local cards = arg[4]
local win_list = arg[5]
local index = self:GetPos(win_seat)
local info = self._player_card_info[index]
self:RemoveCursor()
--info:UpdateHandCard(false, false)
info:ShowHuCard(win_card)
local obj_win_card = UIPackage.CreateObjectFromURL("ui://Main_Majiang/Btn_Card_jiangxi")
obj_win_card.icon = "ui://Main_Majiang/b202_" .. win_card
obj_win_card:GetController("bg").selectedIndex = 1
info._view:AddChild(obj_win_card)
obj_win_card:Center()
local url, pNode
local player = _room:GetPlayerBySeat(win_seat)
if win_seat ~= _room.self_player.seat then
url = "ui://Main_Majiang/别人胡"
pNode = info._view
elseif win_seat == _room.self_player.seat then
url = "ui://Main_Majiang/自己胡牌"
pNode = self._view
end
if win_seat == lose_seat then
url = "ui://Main_Majiang/eff_zimo"
end
local he = UIPackage.CreateObjectFromURL(url)
pNode:AddChild(he)
he:GetTransition("t2"):Play()
he:Center()
if _room.room_config.people_num == 2 then
if win_seat ~= _room.self_player.seat then
he.scaleY = 0.4
he.scaleX = 0.4
he.x = he.width * 0.4 * 0.5 * -1
he.y = he.height * 0.4 * 0.5 * -1
end
end
if win_seat == _room.self_player.seat then
printlog("自己位置=====")
he:Center()
elseif url == "ui://Main_Majiang/eff_zimo" then
printlog("自摸地址==========")
he.scaleY = 0.4
he.scaleX = 0.4
he.x = he.width * 0.4 * 0.5 * -1
he.y = he.height * 0.4 * 0.5 * -1
end
---
local isZiMo = win_seat == lose_seat
DataManager.CurrenRoom.isZiMoHu = isZiMo
local hu_sound = isZiMo and ("zimo") or ("hu")
printlog("声音====>>>", hu_sound)
self:PlaySound("LiChuan_MJ", player.self_user.sex, hu_sound)
local pNode = info._view
local url = "eff_list1"
local he_list = UIPackage.CreateObjectFromURL("ui://Extend_MJ_LiChuan/" .. url)
he_list.touchable = false
pNode:AddChild(he_list)
he_list:Center()
coroutine.start(function()
for i = 1, #win_list do
local tem = win_list[i]
if tem.type > 0 and tem.type < 32 then
local com_name = "he" .. tem.type
printlog("声音====>>>", com_name)
ViewUtil.PlaySound("LiChuan_MJ",
string.format("extend/majiang/lichuan/sound/%s/%s.mp3", ViewUtil.Sex_Chat[player.self_user.sex],
com_name))
local item = he_list:GetChild("list"):AddItemFromPool("ui://Extend_MJ_LiChuan/" .. com_name)
coroutine.wait(0.3)
end
end
coroutine.wait(2)
obj_win_card:Dispose()
he:Dispose()
he_list:Dispose()
self._popEvent = true
end)]]
end)
_gamectr:AddEventListener(TX_GameEvent.EventNiao, function(...)
@ -389,9 +481,9 @@ function M:EventInit()
local total_result = arg[2]
local result = arg[1]
local over = arg[3]
if over < 2 or _room.curren_round > 0 then
self:PlayMJSound("end_music.mp3")
end
-- if over < 2 or _room.curren_round > 0 then
-- self:PlayMJSound("end_music.mp3")
-- end
self._clearingView = EXClearingView.new()
coroutine.start(function()
coroutine.wait(0.5)
@ -750,7 +842,7 @@ function M:RunNiao(list, start_seat)
local card = list[i].card
coroutine.wait(0.3)
item:GetTransition("appear"):Play()
item.icon = UIPackage.GetItemURL("Main_Majiang", "201_" .. card)
item.icon = UIPackage.GetItemURL("Main_Majiang", "b201_" .. card)
if list[i].score > 0 then item:GetController("bg").selectedIndex = 1 end
end
coroutine.start(function()
@ -919,7 +1011,7 @@ function M:FillShowCards(obj, card, num)
if obj.icon then
obj.icon = 'ui://Main_Majiang/b201_' .. card
else
obj:GetChild("icon").url = 'ui://Main_Majiang/201_' .. card
obj:GetChild("icon").url = 'ui://Main_Majiang/b201_' .. card
end
if obj.title then
obj.title = string.format("%d张", num)

View File

@ -124,7 +124,7 @@ function M:ShowStep(index)
list:RemoveChildrenToPool()
for i = 1, #niao_list do
local item = list:AddItemFromPool()
item.icon = UIPackage.GetItemURL("Main_Majiang", "201_" .. niao_list[i].card)
item.icon = UIPackage.GetItemURL("Main_Majiang", "b201_" .. niao_list[i].card)
if niao_list[i].score > 0 then
item:GetController("bg").selectedIndex = 2
end

View File

@ -4,11 +4,7 @@ local PlayerInfoView2 = require("Game.View.PlayerInfoView2")
local M = {}
function M.new(view, mainView)
if mainView._room.room_config.people_num == 2 then
setmetatable(M, { __index = PlayerInfoView2 })
else
setmetatable(M, { __index = PlayerInfoView })
end
setmetatable(M, { __index = PlayerInfoView2 })
local self = setmetatable({}, { __index = M })
self._view = view
self._main_view = mainView

View File

@ -56,27 +56,27 @@ function M:init(url)
self.cBtn = self._view:GetController('cBtn')
-- slider_sound.value = GameApplication.Instance.SoundValue
-- slider_music.value = GameApplication.Instance.MusicValue
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;
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;
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;
GameApplication.Instance.SoundMute = btn_sound.selected;
end)
btn_music.onClick:Add(function()
-- GameApplication.Instance.MusicMute = btn_music.selected;
GameApplication.Instance.MusicMute = btn_music.selected;
end)
local _btn_logout = self._view:GetChild('btn_cancelRoom')

View File

@ -6,13 +6,13 @@ local MJPlayerSelfCardInfoView = import(".MJPlayerSelfCardInfoView")
local MJPlayerCardInfoView = require("main.majiang.MJPlayerCardInfoView")
local SettingView = import(".EXSettingView")
local TableBG = require("Game.Data.TableBG")
local WitnessView = require("Game.View.WitnessView")
local WitnessView = require("main.majiang.MJWitnessView")
local MJMainView = require("main.majiang.MJMainView")
local HuCardImg = import(".HuCardImg")
local Record_Event = import(".RecordEvent")
local M = {}
--- Create a new
@ -26,29 +26,17 @@ function M.new()
end
function M:init()
self._gamectr = ControllerManager.GetController(GameController)
self._room = DataManager.CurrenRoom
self._room.Witness = true
UIPackage.AddPackage('base/chat/ui/Chat')
UIPackage.AddPackage("base/main_majiang/ui/Main_Majiang")
self._eventmap = {}
-- self._full = true
self._put_map = false
self._new_hide = false
self._queue = false
self._style = 1
self._popEvent = true
self:InitView()
WitnessView.init(self)
getmetatable(M).__index.init(self)
end
function M:InitView(url)
function M:InitView()
local room = self._room
getmetatable(M).__index.InitView(self)
UIPackage.AddPackage("extend/majiang/fuzhou/ui/Extend_MJ_FuZhou")
BaseView.InitView(self, string.format("ui://Main_Majiang/Main_new_%d_jiangxi", room.room_config.people_num))
self:EventInit()
UpdateBeat:Add(self.OnUpdate, self)
WitnessView.InitView(self)
self.HuCardImg = setmetatable(HuCardImg, { __index = self.HuCardImg })
local centerBox = self._view:GetChild("Comp_ConterBox")
self._ctr_cardbox = centerBox:GetController("seat")
@ -70,9 +58,9 @@ function M:InitView(url)
self._text_remined = self._view:GetChild('remaining_card')
self._text_round = self._view:GetChild('text_round')
self._cursor = UIPackage.CreateObjectFromURL("ui://Main_Majiang/Ani_play_bj")
self._state.onChanged:Add(function()
self:UpdatePlayerInfoView()
end)
-- self._state.onChanged:Add(function()
-- self:UpdatePlayerInfoView()
-- end)
self:UpdateRound()
self:InitPlayerInfoView()
@ -92,8 +80,8 @@ function M:InitView(url)
for i = 1, #p.fz_list do
cardInfo:UpdateFzList(p.fz_list[i], -1)
end
-- info:FillData(p)
-- info._view.visible = true
info:FillData(p)
info._view.visible = true
end
local btn_rule = self._view:GetChild('btn_rule')
@ -154,8 +142,14 @@ function M:EventInit()
local _gamectr = self._gamectr
_gamectr:AddEventListener(GameEvent.PlayerEnter, function(...)
self:PlayMJSound("user_enter.mp3")
local arg = { ... }
print("lingmeng witness PlayerEnter")
local p = arg[1]
local info = self._player_info[self:GetPos(p.seat)]
info:FillData(p)
info._view.visible = true
info:SetPlayer(p)
info:FillData()
end)
_gamectr:AddEventListener(GameEvent.WitnessPlayerEnter, function(...)
@ -197,6 +191,7 @@ function M:EventInit()
self._clearingView = nil
end
self:UpdateRound()
self:RemoveCursor()
self._state.selectedIndex = 4
local list = _room.player_list
for i = 1, #list do
@ -247,7 +242,7 @@ function M:EventInit()
info:UpdateOutCardList(nil, nil, self._cursor)
print("ling 2zhihouq")
-- self:PlaySound("FuZhou_MJ", p.self_user.sex, tostring(card))
-- self:PlayMJSound("chupai.mp3")
self:PlayMJSound("chupai.mp3")
print("ling 2zhihou")
if seat == _room.self_player.seat then
_room.curren_outcard_seat = -1
@ -265,7 +260,105 @@ function M:EventInit()
_gamectr:AddEventListener(TX_GameEvent.FangziAction, handler(self, self.OnFangziAction))
_gamectr:AddEventListener(TX_GameEvent.ZPHuCard, function(...)
print("lingmeng witness ZPHuCard")
self._left_time = 0
self:UpdateCardBox(0)
local arg = { ... }
local win_seat = arg[1]
local lose_seat = arg[2]
local win_card = arg[3]
local cards = arg[4]
local win_list = arg[5]
local scoreData = arg[6]
local index = self:GetPos(win_seat)
local info = self._player_card_info[index]
local player = self._room:GetPlayerBySeat(win_seat)
info:ShowHuCard(win_card, index == 1)
-- self.cHuCardEffect.selectedIndex = 1
local loader_HuEffect = info._viewLoader_selfHuCardEffect
local list_HuCardEffect = info._viewList_HuEffect
---
local isZiMo = win_seat == lose_seat
DataManager.CurrenRoom.isZiMoHu = isZiMo
local hu_sound = isZiMo and ("zimo") or ("hu")
printlog("声音====>>>", hu_sound)
self:PlaySound(self.asset_group, player.self_user.sex, hu_sound)
local effects = isZiMo and ("tile_zimo") or ("tile_hu")
loader_HuEffect.visible = true
loader_HuEffect.url = "ui://Main_Majiang/" .. effects
loader_HuEffect:SetScale(2, 2)
loader_HuEffect:TweenScale(Vector2(1, 1), 0.3):SetEase(EaseType.QuartOut)
--观战暂时把这个特效去了,现在这个特效位置也不对
-- self.effect_ZiMo.xy = loader_HuEffect.xy
-- self.effect_ZiMo:SetPlaySettings(0, -1, 1, -1);
-- self.effect_ZiMo.visible = true
-- self.effect_ZiMo.playing = true
-- self.effect_ZiMo.onPlayEnd:Set(function()
-- self.effect_ZiMo.visible = false
-- end)
coroutine.start(function()
coroutine.wait(0.5)
loader_HuEffect.visible = false
local Effects = {}
for i = 1, #win_list do
local HuMsg = win_list[i]
-- ↓↓↓先排列好特效图片
if HuMsg.type > 2 and HuMsg.type < 32 then
-- local sound_name = string.format(self.Sound_path .. "%s/%s.mp3",
-- ViewUtil.Sex_Chat[player.self_user.sex],
-- "he" .. HuMsg.type)
-- ViewUtil.PlaySound(self.asset_group, sound_name)
self:PlaySound(self.asset_group, player.self_user.sex, "he" .. HuMsg.type)
local imgList = self.HuCardImg[HuMsg.type]
for _, img in pairs(imgList) do
local imgPath = "ui://Main_Majiang/" .. img
local imgObj = list_HuCardEffect:AddItemFromPool()
local imgLoader = imgObj:GetChild("loader_img")
imgLoader.url = imgPath
imgObj.visible = false
Effects[#Effects + 1] = imgObj
end
end
end
-- ↓↓↓播放动画
for _, imgObj in pairs(Effects) do
imgObj.visible = true
local effect_xingxing = imgObj:GetChild("effect_xingxing")
effect_xingxing:SetPlaySettings(0, -1, 1, -1);
effect_xingxing.visible = true
effect_xingxing.playing = true
effect_xingxing.onPlayEnd:Set(function()
effect_xingxing.visible = false
end)
local imgLoader = imgObj:GetChild("loader_img")
imgLoader:SetScale(2, 2)
imgLoader:Center()
imgLoader:TweenScale(Vector2(1, 1), 0.3)
coroutine.wait(0.5)
end
-- 扣分动画
for _, pScore in pairs(scoreData) do
local infoView = self._player_info[self:GetPos(pScore.seat)]
infoView:UpdateScore(pScore.total_score, true)
end
coroutine.wait(0.5)
self._popEvent = true
list_HuCardEffect:RemoveChildrenToPool()
-- self.cHuCardEffect.selectedIndex = 0
end)
end)
_gamectr:AddEventListener(TX_GameEvent.EventNiao, function(...)
@ -293,7 +386,7 @@ function M:EventInit()
-- le:Dispose()
-- end)
-- end
self:RemoveCursor()
-- self:RemoveCursor()
if self._clearingView == nil then
self._clearingView = EXClearingView.new(self._root_view)
coroutine.start(function()
@ -307,7 +400,6 @@ function M:EventInit()
-- if #niao == 0 then self._view:GetChild("n13").visible = false end
self._clearingView:InitData(0, _room, result, nil, function(...)
DataManager.CurrenRoom.self_player.card_list = {}
self._state.selectedIndex = 2
self._clearingView = nil
end)
end
@ -412,6 +504,12 @@ function M:PlayMJSound(path)
ViewUtil.PlaySound(self.asset_group, majiang_asset_path .. path)
end
function M:PlaySound(group, sex, path)
local sex_path = ViewUtil.Sex_Chat[sex]
local path1 = majiang_asset_path .. string.format("%s/%s.mp3", sex_path, path)
ViewUtil.PlaySound(group, path1)
end
function M:UpdateRound()
self._view:GetChild("text_round").text = string.format("局数:%d /%d", self._room.curren_round,
self._room.room_config.round)
@ -420,26 +518,26 @@ end
function M:ShowJing()
if self._room.jing then
self.jing.visible = true
MJPlayerCardInfoView.fillCard2(self, self.jing, "202_", self._room.jing)
MJPlayerCardInfoView.fillCard2(self, self.jing, "b202_", self._room.jing)
else
self.jing.visible = false
end
end
function M:UpdatePlayerInfoView()
self._player_info = {}
local _player_info = self._player_info
local list = self._room.player_list
-- function M:UpdatePlayerInfoView()
-- self._player_info = {}
-- local _player_info = self._player_info
-- local list = self._room.player_list
for i = 1, self._room.room_config.people_num do
local seat = self:GetPos(list[i].seat)
local tem = self._view:GetChild(string.format("player_info%d_%d", seat,
(self._state.selectedIndex == 4 and 1 or 0) + 1))
_player_info[seat] = PlayerInfoView.new(tem, self)
_player_info[seat]:FillData(list[i])
printlog("lingmeng _player_info", tem, seat, list[i].self_user.nick_name)
end
end
-- for i = 1, self._room.room_config.people_num do
-- local seat = self:GetPos(list[i].seat)
-- local tem = self._view:GetChild(string.format("player_info%d_%d", seat,
-- (self._state.selectedIndex == 4 and 1 or 0) + 1))
-- _player_info[seat] = PlayerInfoView.new(tem, self)
-- _player_info[seat]:FillData(list[i])
-- printlog("lingmeng _player_info", tem, seat, list[i].self_user.nick_name)
-- end
-- end
function M:OnUpdate()
if (self._popEvent) then

View File

@ -80,9 +80,7 @@ function M:FillRoomData(s2croom)
if (reload) then
local _reloadInfo = s2croom["reloadInfo"]
local _hand_card = _reloadInfo["hand_card"]
room.self_player.card_list = _hand_card
table.sort(_hand_card, ViewUtil.HandCardSort)
local active_seat = _reloadInfo["active_seat"]
local bank_seat = _reloadInfo["banker_seat"]
@ -94,6 +92,9 @@ function M:FillRoomData(s2croom)
room.curren_outcard_seat = _reloadInfo["curren_outcard_seat"]
room.last_outcard_seat = last_outcard_seat
room.playing = playing
local _hand_card = _reloadInfo["hand_card"]
room.self_player.card_list = _hand_card
table.sort(_hand_card, self.HandCardSortAndJing)
for i = 1, #_info_list do
local tem = _info_list[i]
local playerid = tem["playerid"]

View File

@ -288,6 +288,18 @@ function M:fillResult1(room, peopleNum, total_result)
local familyIDText = self._view:GetChild("Text_FamilyID")
print("lingmeng fillResult1")
pt(room)
--初始化大赢家和最佳炮手
local bigWin = { seat = -1, score = 0 }
local bestPao = { seat = -1, times = 0 }
--循环数据得出分数最大的大赢家,以及点炮次数最多的最佳炮手
for i = 1, #total_result.info_list do
if total_result.info_list[i].total_score > bigWin.score then
bigWin = { seat = total_result.info_list[i].seat, score = total_result.info_list[i].total_score }
end
if total_result.info_list[i].settle_log.fangpao and total_result.info_list[i].settle_log.fangpao > bestPao.times then
bestPao = { seat = total_result.info_list[i].seat, times = total_result.info_list[i].settle_log.fangpao }
end
end
for i, v in pairs(DataManager.SelfUser.games) do
if v.game_id == room.game_id then
gameNameAndRoomIDText.text = string.format("%s 房号:%s", v.name, room.room_id)
@ -325,6 +337,16 @@ function M:fillResult1(room, peopleNum, total_result)
totalInfoList.settle_log.fanggang or 0)
resultInfoComp:GetController("win").selectedIndex = totalInfoList.total_score >= 0 and 1 or 0
if totalInfoList.seat == bigWin.seat then
resultInfoComp:GetController("bigWin").selectedIndex = 1
-- else
-- resultInfoComp:GetController("bigWin").selectedIndex = 0
end
if totalInfoList.seat == bestPao.seat then
resultInfoComp:GetController("fangPao").selectedIndex = 1
-- else
-- resultInfoComp:GetController("fangPao").selectedIndex = 0
end
end
end

View File

@ -144,7 +144,7 @@ function M:IsShowGangZi(btn, isShow)
end
function M:UpdateRound()
self._view:GetChild("text_round").text = string.format("局数:%d /%d", self._room.curren_round,
self._view:GetChild("text_round").text = string.format("局数:%d/%d", self._room.curren_round,
self._room.room_config.round)
end
@ -220,6 +220,7 @@ function M:EventInit()
-- self:ShowHuTip()
--self._viewText_testName.text = 0
self:UpdateRound()
self:RemoveCursor()
self._state.selectedIndex = 1
self:ShowJing()
local list = _room.player_list
@ -305,7 +306,7 @@ function M:EventInit()
local index = self:GetPos(win_seat)
local info = self._player_card_info[index]
self:RemoveCursor()
--info:UpdateHandCard(true, false)
--info:UpdateHandCard(false, false)
info:ShowHuCard(win_card)
local obj_win_card = UIPackage.CreateObjectFromURL("ui://Main_Majiang/Btn_Card_jiangxi")
@ -481,9 +482,9 @@ function M:EventInit()
local total_result = arg[2]
local result = arg[1]
local over = arg[3]
if over < 2 or _room.curren_round > 0 then
self:PlayMJSound("end_music.mp3")
end
-- if over < 2 or _room.curren_round > 0 then
-- self:PlayMJSound("end_music.mp3")
-- end
self._clearingView = EXClearingView.new()
coroutine.start(function()
coroutine.wait(0.5)
@ -842,7 +843,7 @@ function M:RunNiao(list, start_seat)
local card = list[i].card
coroutine.wait(0.3)
item:GetTransition("appear"):Play()
item.icon = UIPackage.GetItemURL("Main_Majiang", "201_" .. card)
item.icon = UIPackage.GetItemURL("Main_Majiang", "b201_" .. card)
if list[i].score > 0 then item:GetController("bg").selectedIndex = 1 end
end
coroutine.start(function()
@ -1011,7 +1012,7 @@ function M:FillShowCards(obj, card, num)
if obj.icon then
obj.icon = 'ui://Main_Majiang/b201_' .. card
else
obj:GetChild("icon").url = 'ui://Main_Majiang/201_' .. card
obj:GetChild("icon").url = 'ui://Main_Majiang/b201_' .. card
end
if obj.title then
obj.title = string.format("%d张", num)

View File

@ -124,7 +124,7 @@ function M:ShowStep(index)
list:RemoveChildrenToPool()
for i = 1, #niao_list do
local item = list:AddItemFromPool()
item.icon = UIPackage.GetItemURL("Main_Majiang", "201_" .. niao_list[i].card)
item.icon = UIPackage.GetItemURL("Main_Majiang", "b201_" .. niao_list[i].card)
if niao_list[i].score > 0 then
item:GetController("bg").selectedIndex = 2
end

View File

@ -4,11 +4,7 @@ local PlayerInfoView2 = require("Game.View.PlayerInfoView2")
local M = {}
function M.new(view, mainView)
if mainView._room.room_config.people_num == 2 then
setmetatable(M, { __index = PlayerInfoView2 })
else
setmetatable(M, { __index = PlayerInfoView })
end
setmetatable(M, { __index = PlayerInfoView2 })
local self = setmetatable({}, { __index = M })
self._view = view
self._main_view = mainView

View File

@ -41,27 +41,27 @@ function M:init(url)
self.cBtn = self._view:GetController('cBtn')
-- slider_sound.value = GameApplication.Instance.SoundValue
-- slider_music.value = GameApplication.Instance.MusicValue
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;
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;
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;
GameApplication.Instance.SoundMute = btn_sound.selected;
end)
btn_music.onClick:Add(function()
-- GameApplication.Instance.MusicMute = btn_music.selected;
GameApplication.Instance.MusicMute = btn_music.selected;
end)
local _btn_logout = self._view:GetChild('btn_cancelRoom')

View File

@ -6,8 +6,9 @@ local MJPlayerSelfCardInfoView = import(".MJPlayerSelfCardInfoView")
local MJPlayerCardInfoView = require("main.majiang.MJPlayerCardInfoView")
local SettingView = import(".EXSettingView")
local TableBG = require("Game.Data.TableBG")
local WitnessView = require("Game.View.WitnessView")
local WitnessView = require("main.majiang.MJWitnessView")
local MJMainView = require("main.majiang.MJMainView")
local HuCardImg = import(".HuCardImg")
local Record_Event = import(".RecordEvent")
@ -25,29 +26,17 @@ function M.new()
end
function M:init()
self._gamectr = ControllerManager.GetController(GameController)
self._room = DataManager.CurrenRoom
self._room.Witness = true
UIPackage.AddPackage('base/chat/ui/Chat')
UIPackage.AddPackage("base/main_majiang/ui/Main_Majiang")
self._eventmap = {}
-- self._full = true
self._put_map = false
self._new_hide = false
self._queue = false
self._style = 1
self._popEvent = true
self:InitView()
WitnessView.init(self)
getmetatable(M).__index.init(self)
end
function M:InitView(url)
local room = self._room
getmetatable(M).__index.InitView(self)
UIPackage.AddPackage("extend/majiang/jinxi/ui/Extend_MJ_JinXi")
BaseView.InitView(self, string.format("ui://Main_Majiang/Main_new_%d_jiangxi", room.room_config.people_num))
self:EventInit()
UpdateBeat:Add(self.OnUpdate, self)
WitnessView.InitView(self)
self.HuCardImg = setmetatable(HuCardImg, { __index = self.HuCardImg })
local centerBox = self._view:GetChild("Comp_ConterBox")
self._ctr_cardbox = centerBox:GetController("seat")
@ -69,19 +58,19 @@ function M:InitView(url)
self._text_remined = self._view:GetChild('remaining_card')
self._text_round = self._view:GetChild('text_round')
self._cursor = UIPackage.CreateObjectFromURL("ui://Main_Majiang/Ani_play_bj")
self._state.onChanged:Add(function()
self:UpdatePlayerInfoView()
end)
-- self._state.onChanged:Add(function()
-- self:UpdatePlayerInfoView()
-- end)
self:UpdateRound()
-- self:InitPlayerInfoView()
self:InitPlayerInfoView()
self._player_card_info = {}
local _player_card_info = self._player_card_info
for i = 1, #room.player_list do
local p = room.player_list[i]
local index = self:GetPos(p.seat)
print("lingmeng index", index)
-- local info = self._player_info[index]
local info = self._player_info[index]
local tem = self._view:GetChild("player_card_info" .. index)
_player_card_info[index] = self:NewMJPlayerCardInfoView(tem, index)
local cardInfo = _player_card_info[index]
@ -91,8 +80,8 @@ function M:InitView(url)
for i = 1, #p.fz_list do
cardInfo:UpdateFzList(p.fz_list[i], -1)
end
-- info:FillData(p)
-- info._view.visible = true
info:FillData(p)
info._view.visible = true
end
local btn_rule = self._view:GetChild('btn_rule')
@ -153,8 +142,14 @@ function M:EventInit()
local _gamectr = self._gamectr
_gamectr:AddEventListener(GameEvent.PlayerEnter, function(...)
self:PlayMJSound("user_enter.mp3")
local arg = { ... }
print("lingmeng witness PlayerEnter")
local p = arg[1]
local info = self._player_info[self:GetPos(p.seat)]
info:FillData(p)
info._view.visible = true
info:SetPlayer(p)
info:FillData()
end)
_gamectr:AddEventListener(GameEvent.WitnessPlayerEnter, function(...)
@ -196,6 +191,7 @@ function M:EventInit()
self._clearingView = nil
end
self:UpdateRound()
self:RemoveCursor()
self._state.selectedIndex = 4
local list = _room.player_list
for i = 1, #list do
@ -246,7 +242,7 @@ function M:EventInit()
info:UpdateOutCardList(nil, nil, self._cursor)
print("ling 2zhihouq")
--self:PlaySound("JinXi_MJ", p.self_user.sex, tostring(card))
-- self:PlayMJSound("chupai.mp3")
self:PlayMJSound("chupai.mp3")
print("ling 2zhihou")
if seat == _room.self_player.seat then
_room.curren_outcard_seat = -1
@ -264,7 +260,105 @@ function M:EventInit()
_gamectr:AddEventListener(TX_GameEvent.FangziAction, handler(self, self.OnFangziAction))
_gamectr:AddEventListener(TX_GameEvent.ZPHuCard, function(...)
print("lingmeng witness ZPHuCard")
self._left_time = 0
self:UpdateCardBox(0)
local arg = { ... }
local win_seat = arg[1]
local lose_seat = arg[2]
local win_card = arg[3]
local cards = arg[4]
local win_list = arg[5]
local scoreData = arg[6]
local index = self:GetPos(win_seat)
local info = self._player_card_info[index]
local player = self._room:GetPlayerBySeat(win_seat)
info:ShowHuCard(win_card, index == 1)
-- self.cHuCardEffect.selectedIndex = 1
local loader_HuEffect = info._viewLoader_selfHuCardEffect
local list_HuCardEffect = info._viewList_HuEffect
---
local isZiMo = win_seat == lose_seat
DataManager.CurrenRoom.isZiMoHu = isZiMo
local hu_sound = isZiMo and ("zimo") or ("hu")
printlog("声音====>>>", hu_sound)
self:PlaySound(self.asset_group, player.self_user.sex, hu_sound)
local effects = isZiMo and ("tile_zimo") or ("tile_hu")
loader_HuEffect.visible = true
loader_HuEffect.url = "ui://Main_Majiang/" .. effects
loader_HuEffect:SetScale(2, 2)
loader_HuEffect:TweenScale(Vector2(1, 1), 0.3):SetEase(EaseType.QuartOut)
--观战暂时把这个特效去了,现在这个特效位置也不对
-- self.effect_ZiMo.xy = loader_HuEffect.xy
-- self.effect_ZiMo:SetPlaySettings(0, -1, 1, -1);
-- self.effect_ZiMo.visible = true
-- self.effect_ZiMo.playing = true
-- self.effect_ZiMo.onPlayEnd:Set(function()
-- self.effect_ZiMo.visible = false
-- end)
coroutine.start(function()
coroutine.wait(0.5)
loader_HuEffect.visible = false
local Effects = {}
for i = 1, #win_list do
local HuMsg = win_list[i]
-- ↓↓↓先排列好特效图片
if HuMsg.type > 2 and HuMsg.type < 32 then
-- local sound_name = string.format(self.Sound_path .. "%s/%s.mp3",
-- ViewUtil.Sex_Chat[player.self_user.sex],
-- "he" .. HuMsg.type)
-- ViewUtil.PlaySound(self.asset_group, sound_name)
self:PlaySound(self.asset_group, player.self_user.sex, "he" .. HuMsg.type)
local imgList = self.HuCardImg[HuMsg.type]
for _, img in pairs(imgList) do
local imgPath = "ui://Main_Majiang/" .. img
local imgObj = list_HuCardEffect:AddItemFromPool()
local imgLoader = imgObj:GetChild("loader_img")
imgLoader.url = imgPath
imgObj.visible = false
Effects[#Effects + 1] = imgObj
end
end
end
-- ↓↓↓播放动画
for _, imgObj in pairs(Effects) do
imgObj.visible = true
local effect_xingxing = imgObj:GetChild("effect_xingxing")
effect_xingxing:SetPlaySettings(0, -1, 1, -1);
effect_xingxing.visible = true
effect_xingxing.playing = true
effect_xingxing.onPlayEnd:Set(function()
effect_xingxing.visible = false
end)
local imgLoader = imgObj:GetChild("loader_img")
imgLoader:SetScale(2, 2)
imgLoader:Center()
imgLoader:TweenScale(Vector2(1, 1), 0.3)
coroutine.wait(0.5)
end
-- 扣分动画
for _, pScore in pairs(scoreData) do
local infoView = self._player_info[self:GetPos(pScore.seat)]
infoView:UpdateScore(pScore.total_score, true)
end
coroutine.wait(0.5)
self._popEvent = true
list_HuCardEffect:RemoveChildrenToPool()
-- self.cHuCardEffect.selectedIndex = 0
end)
end)
_gamectr:AddEventListener(TX_GameEvent.EventNiao, function(...)
@ -292,7 +386,7 @@ function M:EventInit()
-- le:Dispose()
-- end)
-- end
self:RemoveCursor()
-- self:RemoveCursor()
if self._clearingView == nil then
self._clearingView = EXClearingView.new(self._root_view)
coroutine.start(function()
@ -306,7 +400,6 @@ function M:EventInit()
-- if #niao == 0 then self._view:GetChild("n13").visible = false end
self._clearingView:InitData(0, _room, result, nil, function(...)
DataManager.CurrenRoom.self_player.card_list = {}
self._state.selectedIndex = 2
self._clearingView = nil
end)
end
@ -411,6 +504,12 @@ function M:PlayMJSound(path)
ViewUtil.PlaySound(self.asset_group, majiang_asset_path .. path)
end
function M:PlaySound(group, sex, path)
local sex_path = ViewUtil.Sex_Chat[sex]
local path1 = majiang_asset_path .. string.format("%s/%s.mp3", sex_path, path)
ViewUtil.PlaySound(group, path1)
end
function M:UpdateRound()
self._view:GetChild("text_round").text = string.format("局数:%d /%d", self._room.curren_round,
self._room.room_config.round)
@ -419,26 +518,26 @@ end
function M:ShowJing()
if self._room.jing then
self.jing.visible = true
MJPlayerCardInfoView.fillCard2(self, self.jing, "202_", self._room.jing)
MJPlayerCardInfoView.fillCard2(self, self.jing, "b202_", self._room.jing)
else
self.jing.visible = false
end
end
function M:UpdatePlayerInfoView()
self._player_info = {}
local _player_info = self._player_info
local list = self._room.player_list
-- function M:UpdatePlayerInfoView()
-- self._player_info = {}
-- local _player_info = self._player_info
-- local list = self._room.player_list
for i = 1, self._room.room_config.people_num do
local seat = self:GetPos(list[i].seat)
local tem = self._view:GetChild(string.format("player_info%d_%d", seat,
(self._state.selectedIndex == 4 and 1 or 0) + 1))
_player_info[seat] = PlayerInfoView.new(tem, self)
_player_info[seat]:FillData(list[i])
printlog("lingmeng _player_info", tem, seat, list[i].self_user.nick_name)
end
end
-- for i = 1, self._room.room_config.people_num do
-- local seat = self:GetPos(list[i].seat)
-- local tem = self._view:GetChild(string.format("player_info%d_%d", seat,
-- (self._state.selectedIndex == 4 and 1 or 0) + 1))
-- _player_info[seat] = PlayerInfoView.new(tem, self)
-- _player_info[seat]:FillData(list[i])
-- printlog("lingmeng _player_info", tem, seat, list[i].self_user.nick_name)
-- end
-- end
function M:OnUpdate()
if (self._popEvent) then

View File

@ -143,7 +143,7 @@ function M:IsShowGangZi(btn, isShow)
end
function M:UpdateRound()
self._view:GetChild("text_round").text = string.format("局数:%d /%d", self._room.curren_round,
self._view:GetChild("text_round").text = string.format("局数:%d/%d", self._room.curren_round,
self._room.room_config.round)
end

View File

@ -56,10 +56,6 @@ function M:InitView(url)
--[[
MJMainView.InitView(self, "ui://Main_Majiang/Main_new_" .. room.room_config.people_num)
--]]
local config = ExtendManager.GetExtendConfig(room.game_id)
local mode = config:GetGameInfo()
local gamePlay = mode:LoadConfigToDetail(json.encode(room.room_config.config), json.encode(room.room_config.hpData))
self._view:GetChild('wanfa_text').text = gamePlay
self.jing = self._view:GetChild('jing')
self._state.onChanged:Add(function()
@ -90,10 +86,6 @@ function M:InitView(url)
if room.playing or room.curren_round > 0 then
self:ReloadRoom()
end
---------为了下次复现出牌情况
--self._viewText_testName = self._view:GetChild('text_testName')
--self._viewText_testName.text = 0
end
function M:__BuGang(cardInfo, callback)
@ -220,9 +212,9 @@ function M:EventInit()
_gamectr:AddEventListener(TX_GameEvent.SendCards, function(...)
-- self:ShowHuTip()
--测试用记录出牌权次数
--self._viewText_testName.text = 0
self:UpdateRound()
self:RemoveCursor()
self._state.selectedIndex = 1
self:ShowJing()
local list = _room.player_list
@ -485,9 +477,9 @@ function M:EventInit()
local total_result = arg[2]
local result = arg[1]
local over = arg[3]
if over < 2 or _room.curren_round > 0 then
self:PlayMJSound("end_music.mp3")
end
-- if over < 2 or _room.curren_round > 0 then
-- self:PlayMJSound("end_music.mp3")
-- end
self._clearingView = EXClearingView.new()
coroutine.start(function()
coroutine.wait(0.5)
@ -847,7 +839,7 @@ function M:RunNiao(list, start_seat)
local card = list[i].card
coroutine.wait(0.3)
item:GetTransition("appear"):Play()
item.icon = UIPackage.GetItemURL("Main_Majiang", "201_" .. card)
item.icon = UIPackage.GetItemURL("Main_Majiang", "b201_" .. card)
if list[i].score > 0 then item:GetController("bg").selectedIndex = 1 end
end
coroutine.start(function()
@ -1016,7 +1008,7 @@ function M:FillShowCards(obj, card, num)
if obj.icon then
obj.icon = 'ui://Main_Majiang/b201_' .. card
else
obj:GetChild("icon").url = 'ui://Main_Majiang/201_' .. card
obj:GetChild("icon").url = 'ui://Main_Majiang/b201_' .. card
end
if obj.title then
obj.title = string.format("%d张", num)

View File

@ -20,13 +20,18 @@ end
function M:InitView(url)
local room = self._room
UIPackage.AddPackage("extend/majiang/nancheng/ui/Extend_MJ_NanCheng")
MJPlayBackView.InitView(self, string.format("ui://Main_Majiang/Main_new_%d_jiangxi", room.room_config.people_num))
MJPlayBackView.InitView(self, string.format("ui://Main_Majiang/Main_new_%d_jiangxi", room.room_config.people_num))
local _cardbox = self._view:GetChild("cardbox")
--self._view:GetChild("panel_record"):GetChild("btn_LastStep").enabled = false
self._ctr_cardbox = _cardbox:GetController("c1")
self._tex_round = self._view:GetChild("tex_round")
self._tex_LeftCard = self._view:GetChild("remaining_card")
self._anchor = self._view:GetChild("mask_tips")
local config = ExtendManager.GetExtendConfig(room.game_id)
local mode = config:GetGameInfo()
local gamePlay = mode:LoadConfigToDetail(json.encode(room.room_config.config), json.encode(room.room_config.hpData))
self._view:GetChild('wanfa_text').text = gamePlay
self._eventmap = {}
self._cmdmap = {}
@ -55,14 +60,14 @@ function M:FillRoomData(data)
roominfo_panel:GetChild("tex_roomid").text = room.room_id
roominfo_panel:GetChild("tex_gametype").text = room.room_config:GetGameName()
for i = 1, #room.player_list do
local p = room.player_list[i]
local card_info = _player_card_info[self:GetPos(p.seat)]
-- card_info:Clear()
table.sort(p.card_list, self.HandCardSortAndJing)
card_info:UpdateHandCard(false, true)
self._player_info[i]._view:GetController("piao_niao").selectedIndex = 0
end
for i = 1, #room.player_list do
local p = room.player_list[i]
local card_info = _player_card_info[self:GetPos(p.seat)]
-- card_info:Clear()
table.sort(p.card_list, self.HandCardSortAndJing)
card_info:UpdateHandCard(false, true)
self._player_info[i]._view:GetController("piao_niao").selectedIndex = 0
end
self:GenerateAllStepData(data)
self:UpdateStep(1)
@ -109,8 +114,8 @@ function M:ShowStep(index)
end
if step.cmd == Record_Event.Evt_Win then
self._win_pic = UIPackage.CreateObjectFromURL("ui://Main_Majiang/胡")
local info = self._player_card_info[self:GetPos(step.win)]
info._view:AddChild(self._win_pic)
local info = self._player_card_info[self:GetPos(step.win)]
info._view:AddChild(self._win_pic)
self._win_pic:Center()
else
if self._win_pic then
@ -124,7 +129,7 @@ function M:ShowStep(index)
list:RemoveChildrenToPool()
for i = 1, #niao_list do
local item = list:AddItemFromPool()
item.icon = UIPackage.GetItemURL("Main_Majiang", "201_" .. niao_list[i].card)
item.icon = UIPackage.GetItemURL("Main_Majiang", "b201_" .. niao_list[i].card)
if niao_list[i].score > 0 then
item:GetController("bg").selectedIndex = 2
end
@ -136,27 +141,27 @@ function M:ShowStep(index)
if self._niao then
self._niao:Dispose()
end
end
if step.cmd == Record_Event.Evt_Result then
if not self.result then
self.result = EXClearingView.new(self._root_view, { flag_back = true })
self.result:InitData(0, self._room, step.result_data)
self.result._view.x = (GRoot.inst.width - self.result._view.width) * -0.5
self.result._view.width = GRoot.inst.width
self.result._view.height = GRoot.inst.height
-- self.result._view:GetChild("btn_confirm").visible = false
self._anchor:AddChild(self.result._view)
self.result._view.x = self._anchor.x * -1
self.result._view.y = self._anchor.y * -1
else
self.result._view.visible = true
end
-- self.result._view:Center()
-- else
-- if self.result then
-- self.result._view.visible = false
-- end
end
end
if step.cmd == Record_Event.Evt_Result then
if not self.result then
self.result = EXClearingView.new(self._root_view, { flag_back = true })
self.result:InitData(0, self._room, step.result_data)
self.result._view.x = (GRoot.inst.width - self.result._view.width) * -0.5
self.result._view.width = GRoot.inst.width
self.result._view.height = GRoot.inst.height
-- self.result._view:GetChild("btn_confirm").visible = false
self._anchor:AddChild(self.result._view)
self.result._view.x = self._anchor.x * -1
self.result._view.y = self._anchor.y * -1
else
self.result._view.visible = true
end
-- self.result._view:Center()
-- else
-- if self.result then
-- self.result._view.visible = false
-- end
end
end
function M:GenerateAllStepData(data)
@ -287,8 +292,8 @@ function M:UpdateCardBox(seat)
end
function M:UpdateRound()
self._view:GetChild("text_round").text = string.format("局数:%d /%d", self._room.curren_round,
self._room.room_config.round)
self._view:GetChild("text_round").text = string.format("局数:%d/%d", self._room.curren_round,
self._room.room_config.round)
end
function M:UpdateStep(step)

View File

@ -4,11 +4,7 @@ local PlayerInfoView2 = require("Game.View.PlayerInfoView2")
local M = {}
function M.new(view, mainView)
if mainView._room.room_config.people_num == 2 then
setmetatable(M, { __index = PlayerInfoView2 })
else
setmetatable(M, { __index = PlayerInfoView })
end
setmetatable(M, { __index = PlayerInfoView2 })
local self = setmetatable({}, { __index = M })
self._view = view
self._main_view = mainView

View File

@ -41,27 +41,27 @@ function M:init(url)
self.cBtn = self._view:GetController('cBtn')
-- slider_sound.value = GameApplication.Instance.SoundValue
-- slider_music.value = GameApplication.Instance.MusicValue
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;
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;
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;
GameApplication.Instance.SoundMute = btn_sound.selected;
end)
btn_music.onClick:Add(function()
-- GameApplication.Instance.MusicMute = btn_music.selected;
GameApplication.Instance.MusicMute = btn_music.selected;
end)
local _btn_logout = self._view:GetChild('btn_cancelRoom')

View File

@ -6,8 +6,9 @@ local MJPlayerSelfCardInfoView = import(".MJPlayerSelfCardInfoView")
local MJPlayerCardInfoView = require("main.majiang.MJPlayerCardInfoView")
local SettingView = import(".EXSettingView")
local TableBG = require("Game.Data.TableBG")
local WitnessView = require("Game.View.WitnessView")
local WitnessView = require("main.majiang.MJWitnessView")
local MJMainView = require("main.majiang.MJMainView")
local HuCardImg = import(".HuCardImg")
local Record_Event = import(".RecordEvent")
@ -25,29 +26,17 @@ function M.new()
end
function M:init()
self._gamectr = ControllerManager.GetController(GameController)
self._room = DataManager.CurrenRoom
self._room.Witness = true
UIPackage.AddPackage('base/chat/ui/Chat')
UIPackage.AddPackage("base/main_majiang/ui/Main_Majiang")
self._eventmap = {}
-- self._full = true
self._put_map = false
self._new_hide = false
self._queue = false
self._style = 1
self._popEvent = true
self:InitView()
WitnessView.init(self)
getmetatable(M).__index.init(self)
end
function M:InitView(url)
function M:InitView()
local room = self._room
getmetatable(M).__index.InitView(self)
UIPackage.AddPackage("extend/majiang/nancheng/ui/Extend_MJ_NanCheng")
BaseView.InitView(self, string.format("ui://Main_Majiang/Main_new_%d_jiangxi", room.room_config.people_num))
self:EventInit()
UpdateBeat:Add(self.OnUpdate, self)
WitnessView.InitView(self)
self.HuCardImg = setmetatable(HuCardImg, { __index = self.HuCardImg })
local centerBox = self._view:GetChild("Comp_ConterBox")
self._ctr_cardbox = centerBox:GetController("seat")
@ -69,12 +58,12 @@ function M:InitView(url)
self._text_remined = self._view:GetChild('remaining_card')
self._text_round = self._view:GetChild('text_round')
self._cursor = UIPackage.CreateObjectFromURL("ui://Main_Majiang/Ani_play_bj")
self._state.onChanged:Add(function()
self:UpdatePlayerInfoView()
end)
-- self._state.onChanged:Add(function()
-- self:UpdatePlayerInfoView()
-- end)
self:UpdateRound()
-- self:InitPlayerInfoView()
self:InitPlayerInfoView()
self._player_card_info = {}
local _player_card_info = self._player_card_info
for i = 1, #room.player_list do
@ -91,8 +80,8 @@ function M:InitView(url)
for i = 1, #p.fz_list do
cardInfo:UpdateFzList(p.fz_list[i], -1)
end
-- info:FillData(p)
-- info._view.visible = true
info:FillData(p)
info._view.visible = true
end
local btn_rule = self._view:GetChild('btn_rule')
@ -153,8 +142,14 @@ function M:EventInit()
local _gamectr = self._gamectr
_gamectr:AddEventListener(GameEvent.PlayerEnter, function(...)
self:PlayMJSound("user_enter.mp3")
local arg = { ... }
print("lingmeng witness PlayerEnter")
local p = arg[1]
local info = self._player_info[self:GetPos(p.seat)]
info:FillData(p)
info._view.visible = true
info:SetPlayer(p)
info:FillData()
end)
_gamectr:AddEventListener(GameEvent.WitnessPlayerEnter, function(...)
@ -196,6 +191,7 @@ function M:EventInit()
self._clearingView = nil
end
self:UpdateRound()
self:RemoveCursor()
self._state.selectedIndex = 4
local list = _room.player_list
for i = 1, #list do
@ -264,7 +260,105 @@ function M:EventInit()
_gamectr:AddEventListener(TX_GameEvent.FangziAction, handler(self, self.OnFangziAction))
_gamectr:AddEventListener(TX_GameEvent.ZPHuCard, function(...)
print("lingmeng witness ZPHuCard")
self._left_time = 0
self:UpdateCardBox(0)
local arg = { ... }
local win_seat = arg[1]
local lose_seat = arg[2]
local win_card = arg[3]
local cards = arg[4]
local win_list = arg[5]
local scoreData = arg[6]
local index = self:GetPos(win_seat)
local info = self._player_card_info[index]
local player = self._room:GetPlayerBySeat(win_seat)
info:ShowHuCard(win_card, index == 1)
-- self.cHuCardEffect.selectedIndex = 1
local loader_HuEffect = info._viewLoader_selfHuCardEffect
local list_HuCardEffect = info._viewList_HuEffect
---
local isZiMo = win_seat == lose_seat
DataManager.CurrenRoom.isZiMoHu = isZiMo
local hu_sound = isZiMo and ("zimo") or ("hu")
printlog("声音====>>>", hu_sound)
self:PlaySound(self.asset_group, player.self_user.sex, hu_sound)
local effects = isZiMo and ("tile_zimo") or ("tile_hu")
loader_HuEffect.visible = true
loader_HuEffect.url = "ui://Main_Majiang/" .. effects
loader_HuEffect:SetScale(2, 2)
loader_HuEffect:TweenScale(Vector2(1, 1), 0.3):SetEase(EaseType.QuartOut)
--观战暂时把这个特效去了,现在这个特效位置也不对
-- self.effect_ZiMo.xy = loader_HuEffect.xy
-- self.effect_ZiMo:SetPlaySettings(0, -1, 1, -1);
-- self.effect_ZiMo.visible = true
-- self.effect_ZiMo.playing = true
-- self.effect_ZiMo.onPlayEnd:Set(function()
-- self.effect_ZiMo.visible = false
-- end)
coroutine.start(function()
coroutine.wait(0.5)
loader_HuEffect.visible = false
local Effects = {}
for i = 1, #win_list do
local HuMsg = win_list[i]
-- ↓↓↓先排列好特效图片
if HuMsg.type > 2 and HuMsg.type < 32 then
-- local sound_name = string.format(self.Sound_path .. "%s/%s.mp3",
-- ViewUtil.Sex_Chat[player.self_user.sex],
-- "he" .. HuMsg.type)
-- ViewUtil.PlaySound(self.asset_group, sound_name)
self:PlaySound(self.asset_group, player.self_user.sex, "he" .. HuMsg.type)
local imgList = self.HuCardImg[HuMsg.type]
for _, img in pairs(imgList) do
local imgPath = "ui://Main_Majiang/" .. img
local imgObj = list_HuCardEffect:AddItemFromPool()
local imgLoader = imgObj:GetChild("loader_img")
imgLoader.url = imgPath
imgObj.visible = false
Effects[#Effects + 1] = imgObj
end
end
end
-- ↓↓↓播放动画
for _, imgObj in pairs(Effects) do
imgObj.visible = true
local effect_xingxing = imgObj:GetChild("effect_xingxing")
effect_xingxing:SetPlaySettings(0, -1, 1, -1);
effect_xingxing.visible = true
effect_xingxing.playing = true
effect_xingxing.onPlayEnd:Set(function()
effect_xingxing.visible = false
end)
local imgLoader = imgObj:GetChild("loader_img")
imgLoader:SetScale(2, 2)
imgLoader:Center()
imgLoader:TweenScale(Vector2(1, 1), 0.3)
coroutine.wait(0.5)
end
-- 扣分动画
for _, pScore in pairs(scoreData) do
local infoView = self._player_info[self:GetPos(pScore.seat)]
infoView:UpdateScore(pScore.total_score, true)
end
coroutine.wait(0.5)
self._popEvent = true
list_HuCardEffect:RemoveChildrenToPool()
-- self.cHuCardEffect.selectedIndex = 0
end)
end)
_gamectr:AddEventListener(TX_GameEvent.EventNiao, function(...)
@ -292,7 +386,7 @@ function M:EventInit()
-- le:Dispose()
-- end)
-- end
self:RemoveCursor()
-- self:RemoveCursor()
if self._clearingView == nil then
self._clearingView = EXClearingView.new(self._root_view)
coroutine.start(function()
@ -306,7 +400,6 @@ function M:EventInit()
-- if #niao == 0 then self._view:GetChild("n13").visible = false end
self._clearingView:InitData(0, _room, result, nil, function(...)
DataManager.CurrenRoom.self_player.card_list = {}
self._state.selectedIndex = 2
self._clearingView = nil
end)
end
@ -411,6 +504,12 @@ function M:PlayMJSound(path)
ViewUtil.PlaySound(self.asset_group, majiang_asset_path .. path)
end
function M:PlaySound(group, sex, path)
local sex_path = ViewUtil.Sex_Chat[sex]
local path1 = majiang_asset_path .. string.format("%s/%s.mp3", sex_path, path)
ViewUtil.PlaySound(group, path1)
end
function M:UpdateRound()
self._view:GetChild("text_round").text = string.format("局数:%d /%d", self._room.curren_round,
self._room.room_config.round)
@ -419,26 +518,26 @@ end
function M:ShowJing()
if self._room.jing then
self.jing.visible = true
MJPlayerCardInfoView.fillCard2(self, self.jing, "202_", self._room.jing)
MJPlayerCardInfoView.fillCard2(self, self.jing, "b202_", self._room.jing)
else
self.jing.visible = false
end
end
function M:UpdatePlayerInfoView()
self._player_info = {}
local _player_info = self._player_info
local list = self._room.player_list
-- function M:UpdatePlayerInfoView()
-- self._player_info = {}
-- local _player_info = self._player_info
-- local list = self._room.player_list
for i = 1, self._room.room_config.people_num do
local seat = self:GetPos(list[i].seat)
local tem = self._view:GetChild(string.format("player_info%d_%d", seat,
(self._state.selectedIndex == 4 and 1 or 0) + 1))
_player_info[seat] = PlayerInfoView.new(tem, self)
_player_info[seat]:FillData(list[i])
printlog("lingmeng _player_info", tem, seat, list[i].self_user.nick_name)
end
end
-- for i = 1, self._room.room_config.people_num do
-- local seat = self:GetPos(list[i].seat)
-- local tem = self._view:GetChild(string.format("player_info%d_%d", seat,
-- (self._state.selectedIndex == 4 and 1 or 0) + 1))
-- _player_info[seat] = PlayerInfoView.new(tem, self)
-- _player_info[seat]:FillData(list[i])
-- printlog("lingmeng _player_info", tem, seat, list[i].self_user.nick_name)
-- end
-- end
function M:OnUpdate()
if (self._popEvent) then

View File

@ -81,9 +81,7 @@ function M:FillRoomData(s2croom)
if (reload) then
local _reloadInfo = s2croom["reloadInfo"]
local _hand_card = _reloadInfo["hand_card"]
room.self_player.card_list = _hand_card
table.sort(_hand_card, ViewUtil.HandCardSort)
local active_seat = _reloadInfo["active_seat"]
local bank_seat = _reloadInfo["banker_seat"]
@ -96,6 +94,9 @@ function M:FillRoomData(s2croom)
room.last_outcard_seat = last_outcard_seat
room.playing = playing
room.reload = reload
local _hand_card = _reloadInfo["hand_card"]
room.self_player.card_list = _hand_card
table.sort(_hand_card, self.HandCardSortAndJing)
for i = 1, #_info_list do
local tem = _info_list[i]
local playerid = tem["playerid"]

View File

@ -48,6 +48,11 @@ function M:FillRoomData()
info._view.visible = true
info:FillData(p)
end
local config = ExtendManager.GetExtendConfig(_room.game_id)
local mode = config:GetGameInfo()
local gamePlay = mode:LoadConfigToDetail(json.encode(_room.room_config.config), json.encode(_room.room_config.hpData))
self._view:GetChild('wanfa_text').text = gamePlay
end
function M:SetCardBoxPosition()

View File

@ -7,8 +7,9 @@
<text id="n1_k356" name="tex_msg" xy="21,0" size="1563,102" font="Arial" fontSize="42" color="#444444" vAlign="middle" autoSize="none" bold="true" text="{微信用户1}被{用户121}加入亲友圈">
<relation target="" sidePair="left-left"/>
</text>
<text id="n4_k356" name="tex_time" xy="1568,0" size="413,102" font="Arial" fontSize="42" align="right" vAlign="middle" autoSize="none" bold="true" text="2025-03-08 11:40:28">
<text id="n4_k356" name="tex_time" xy="1587,23" size="394,56" font="Arial" fontSize="42" align="right" vAlign="middle" bold="true" text="2025-03-08 11:40:28">
<relation target="" sidePair="right-right"/>
<relation target="n0_k356" sidePair="middle-middle"/>
</text>
</displayList>
</component>

View File

@ -7,7 +7,7 @@
<image id="n10_hyws" name="n10" src="jrro7cyd" fileName="Main/Image/bt_top.png" xy="0,0" group="n17_hyws">
<relation target="" sidePair="right-left,top-top,rightext-right"/>
</image>
<component id="n11_hyws" name="btn_quit" src="in3i7cu9" fileName="Main/Component/btn_close.xml" xy="54,6" group="n17_hyws"/>
<component id="n11_hyws" name="btn_close" src="in3i7cu9" fileName="Main/Component/btn_close.xml" xy="54,6" group="n17_hyws"/>
<image id="n13_hyws" name="n13" src="yk1o7d3p" fileName="Main/Image/hall_club_common_tittle_icon1.png" xy="1003,24" group="n16_hyws">
<relation target="n14_hyws" sidePair="left-left"/>
</image>
@ -19,9 +19,15 @@
</image>
<group id="n16_hyws" name="n16" xy="1003,24" size="526,99" group="n17_hyws" advanced="true"/>
<group id="n17_hyws" name="bg" xy="0,0" size="2532,1170"/>
<image id="n18_66fw" name="n18" src="jrro7cyl" fileName="Main/Image/bg_main1.png" xy="226,140" size="2080,1005"/>
<image id="n19_66fw" name="n19" src="jrro7cyk" fileName="Main/Image/bg_main2.png" xy="241,153" size="2050,978"/>
<list id="n4_k356" name="list_msg" xy="264,171" size="1997,956" layout="flow_hz" overflow="scroll" lineGap="16" defaultItem="ui://htcn7v3r66fw7d6u" align="center" autoClearItems="true">
<image id="n18_66fw" name="n18" src="jrro7cyl" fileName="Main/Image/bg_main1.png" xy="226,140" size="2080,1005">
<relation target="" sidePair="width-width%,height-height%"/>
</image>
<image id="n19_66fw" name="n19" src="jrro7cyk" fileName="Main/Image/bg_main2.png" xy="241,153" size="2050,978">
<relation target="n18_66fw" sidePair="rightext-right,topext-top,bottomext-bottom,leftext-left"/>
</image>
<list id="n4_k356" name="list_msg" xy="249,171" size="2034,956" layout="flow_hz" overflow="scroll" lineGap="16" defaultItem="ui://htcn7v3r66fw7d6z" align="center" autoClearItems="true">
<relation target="n19_66fw" sidePair="bottomext-bottom"/>
<relation target="" sidePair="width-width%,top-top"/>
<item/>
<item/>
<item/>

View File

@ -7,7 +7,7 @@
<image id="n10_hyws" name="n10" src="jrro7cyd" fileName="Main/Image/bt_top.png" xy="0,0" group="n17_hyws">
<relation target="" sidePair="right-left,top-top,rightext-right"/>
</image>
<component id="n11_hyws" name="btn_close" src="in3i7cu9" fileName="Main/Component/btn_close.xml" xy="54,6" group="n17_hyws"/>
<component id="n11_hyws" name="btn_quit" src="in3i7cu9" fileName="Main/Component/btn_close.xml" xy="54,6" group="n17_hyws"/>
<image id="n13_hyws" name="n13" src="yk1o7d3p" fileName="Main/Image/hall_club_common_tittle_icon1.png" xy="1003,24" group="n16_hyws">
<relation target="n14_hyws" sidePair="left-left"/>
</image>
@ -19,15 +19,9 @@
</image>
<group id="n16_hyws" name="n16" xy="1003,24" size="526,99" group="n17_hyws" advanced="true"/>
<group id="n17_hyws" name="bg" xy="0,0" size="2532,1170"/>
<image id="n18_66fw" name="n18" src="jrro7cyl" fileName="Main/Image/bg_main1.png" xy="226,140" size="2080,1005">
<relation target="" sidePair="width-width%,height-height%"/>
</image>
<image id="n19_66fw" name="n19" src="jrro7cyk" fileName="Main/Image/bg_main2.png" xy="241,153" size="2050,978">
<relation target="n18_66fw" sidePair="rightext-right,topext-top,bottomext-bottom,leftext-left"/>
</image>
<list id="n4_k356" name="list_msg" xy="249,171" size="2034,956" layout="flow_hz" overflow="scroll" lineGap="16" defaultItem="ui://htcn7v3r66fw7d6z" align="center" autoClearItems="true">
<relation target="n19_66fw" sidePair="bottomext-bottom"/>
<relation target="" sidePair="width-width%,top-top"/>
<image id="n18_66fw" name="n18" src="jrro7cyl" fileName="Main/Image/bg_main1.png" xy="226,140" size="2080,1005"/>
<image id="n19_66fw" name="n19" src="jrro7cyk" fileName="Main/Image/bg_main2.png" xy="241,153" size="2050,978"/>
<list id="n4_k356" name="list_msg" xy="264,171" size="1997,956" layout="flow_hz" overflow="scroll" lineGap="16" defaultItem="ui://htcn7v3r66fw7d6u" align="center" autoClearItems="true">
<item/>
<item/>
<item/>

View File

@ -366,7 +366,7 @@
<image id="ftxw7d59" name="Group 558.png" path="/FamilyRoomCardRecord/FamilyRoomCardRecord/Image/"/>
<image id="ftxw7d5a" name="Rectangle 165(2).png" path="/FamilyRoomCardRecord/FamilyRoomCardRecord/Image/"/>
<image id="ftxw7d5b" name="Rectangle 186.png" path="/FamilyRoomCardRecord/FamilyRoomCardRecord/Image/"/>
<component id="edxg7d5c" name="com_FamilyMsgRecord.xml" path="/FamilyMsgRecord/" exported="true"/>
<component id="edxg7d5c" name="com_FamilyMsgDiamond.xml" path="/FamilyMsgRecord/" exported="true"/>
<component id="edxg7d5d" name="item_msg.xml" path="/FamilyMsgRecord/Component/" exported="true"/>
<image id="edxg7d5e" name="Group 650.png" path="/FamilyMsgRecord/Iamge/" scale="9grid" scale9grid="25,22,54,59"/>
<image id="edxg7d5f" name="Rectangle 290.png" path="/FamilyMsgRecord/Iamge/" scale="9grid" scale9grid="20,21,40,42"/>
@ -417,7 +417,7 @@
<image id="66fw7d6v" name="Group 650(1).png" path="/FamilyMsgRecord/Iamge/" scale="9grid" scale9grid="25,22,54,59"/>
<image id="66fw7d6w" name="Rectangle 290(1).png" path="/FamilyMsgRecord/Iamge/" scale="9grid" scale9grid="20,21,40,42"/>
<image id="66fw7d6x" name="Rectangle 291(1).png" path="/FamilyMsgRecord/Iamge/" scale="9grid" scale9grid="21,22,42,44"/>
<component id="66fw7d6y" name="com_FamilyMsgDiamond.xml" path="/FamilyMsgRecord/" exported="true"/>
<component id="66fw7d6y" name="com_FamilyMsgRecord.xml" path="/FamilyMsgRecord/" exported="true"/>
<component id="66fw7d6z" name="item_msg_diamond.xml" path="/FamilyMsgRecord/Component/" exported="true"/>
</resources>
<publish name="Family" path="..\wb_unity_pro\Assets\ART\base\Family\ui" packageCount="2"/>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 263 KiB

View File

@ -2,7 +2,7 @@
<component size="148,148" extention="Button" mask="n2_pkx5">
<controller name="button" pages="0,up,1,down,2,over,3,selectedOver" selected="0"/>
<displayList>
<graph id="n2_pkx5" name="mask" xy="0,0" size="148,148" touchable="false" type="rect" lineSize="0" fillColor="#ffcccccc" corner="12">
<graph id="n2_pkx5" name="mask" xy="0,0" size="148,148" touchable="false" type="rect" lineSize="0" fillColor="#00cccccc" corner="12">
<relation target="" sidePair="width-width,height-height"/>
</graph>
<loader id="n3_pkx5" name="icon" xy="0,0" size="148,148" fill="scaleMatchHeight">
@ -12,5 +12,5 @@
<relation target="" sidePair="width-width,height-height"/>
</graph>
</displayList>
<Button downEffect="dark" downEffectValue=".8"/>
<Button downEffect="dark" downEffectValue="0.8"/>
</component>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="2340,186">
<controller name="IsMe" alias="是否是我" pages="0,不是,1,是" selected="1"/>
<controller name="IsMe" alias="是否是我" pages="0,不是,1,是" selected="0"/>
<controller name="isZiMo" alias="是否自摸" pages="0,不是,1,是" selected="0"/>
<controller name="isPao" alias="是否点炮" pages="0,不是,1,是" selected="0"/>
<controller name="zhuang" pages="0,,1," selected="0"/>
@ -12,7 +12,7 @@
<gearDisplay controller="IsMe" pages="1"/>
</graph>
<graph id="n2_yry6" name="bg_head" xy="12,12" size="162,162" type="rect" lineSize="2" lineColor="#ff804b2e" fillColor="#ffe0a94f" corner="12"/>
<component id="n3_yry6" name="Btn_Head" src="yry6z2" fileName="Main_new/Clearing/Component/Btn_Head.xml" xy="19,19"/>
<component id="n17_66fw" name="Btn_Head" src="pkx5sz" fileName="Main_new/Main/Component/btn_head.xml" xy="19,19" size="148,148"/>
<text id="n4_yry6" name="text_name" xy="189,23" size="327,58" font="ui://27vd145bh35o7ili" fontSize="36" color="#fbbb46" vAlign="middle" leading="0" autoSize="shrink" text="微信用户1111"/>
<text id="n5_yry6" name="text_huShow" xy="503,4" size="491,76" font="ui://27vd145bg2mo7ij0" fontSize="58" color="#fcd696" leading="0" text="平胡dsad 实打实收">
<relation target="n2_yry6" sidePair="left-right"/>

View File

@ -2,7 +2,7 @@
<component size="590,800">
<controller name="win" pages="0,输,1,赢" selected="0"/>
<controller name="fangPao" pages="0,,1," selected="1"/>
<controller name="bigWin" pages="0,,1," selected="1"/>
<controller name="bigWin" pages="0,,1," selected="0"/>
<displayList>
<image id="n0_yry6" name="n0" src="yry6z7" fileName="Main_new/Clearing/Image/final_result_bgCell1 1.png" xy="0,0" size="590,800">
<gearDisplay controller="win" pages="0"/>
@ -14,16 +14,12 @@
<image id="n2_yry6" name="n2" src="yry6z9" fileName="Main_new/Clearing/Image/final_result_bigWin 1.png" xy="103,-36">
<gearDisplay controller="bigWin" pages="1"/>
</image>
<component id="n4_yry6" name="Btn_Head" src="yry6zg" fileName="Main_new/Clearing/Component/Btn_Head_End.xml" xy="75,39" size="163,137">
<relation target="" sidePair="width-width%,height-height%,left-left%,top-top%"/>
</component>
<component id="n15_66fw" name="Btn_Head" src="pkx5sz" fileName="Main_new/Main/Component/btn_head.xml" xy="75,47" size="163,131"/>
<text id="n5_yry6" name="Text_Name" xy="253,63" size="281,49" font="FZCuYuan-M03" fontSize="36" color="#b76734" autoSize="none" text="微信用户1111">
<relation target="" sidePair="width-width%,height-height,top-top%"/>
<relation target="n4_yry6" sidePair="left-right"/>
</text>
<text id="n6_yry6" name="Text_ID" xy="253,125" size="249,49" font="FZCuYuan-M03" fontSize="36" color="#ff0f00" autoSize="shrink" text="微信用户1111">
<relation target="" sidePair="width-width%,height-height,top-top%"/>
<relation target="n4_yry6" sidePair="left-right"/>
</text>
<text id="n7_yry6" name="Text_ZiMo" xy="189,191" size="212,64" font="FZCuYuan-M03" fontSize="48" color="#ffffff" letterSpacing="6" text="自摸 2次">
<relation target="" sidePair="topext-top"/>

Binary file not shown.

After

Width:  |  Height:  |  Size: 923 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 640 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="132,132" initName="gcm_info">
<controller name="room_owner" pages="0,,1," selected="0"/>
<controller name="bank" pages="0,,1," selected="0"/>
<controller name="bank" pages="0,,1," selected="1"/>
<controller name="read" pages="0,,1," selected="0"/>
<controller name="offline" pages="0,,1," selected="0"/>
<controller name="mask_voice" pages="0,,1," selected="0"/>
<controller name="mask_voice" pages="0,,1," selected="1"/>
<controller name="piao_niao" pages="0,,1," selected="0"/>
<controller name="three_win" pages="0,,1," selected="0"/>
<controller name="ting" pages="0,,1," selected="0"/>
@ -38,7 +38,7 @@
<gearXY controller="site" pages="2,0,1" values="-47,-43|-37,-57|150,0"/>
<relation target="" sidePair="center-center,top-top"/>
</text>
<component id="n31_e54q" name="chat" src="gq7m6b" fileName="component/MsgBubble2.xml" xy="78,6" size="198,80" alpha="0" touchable="false">
<component id="n31_e54q" name="chat" src="gq7m6b" fileName="component/MsgBubble2.xml" xy="78,6" size="232,80" alpha="0" touchable="false">
<Label title="你太牛了"/>
</component>
<component id="n27_e54q" name="face" src="gq7m5x" fileName="component/Face3.xml" xy="0,0" alpha="0" touchable="false">
@ -47,7 +47,7 @@
<image id="n38_tla5" name="n38" src="sx7x14g" fileName="Main_new/Main/Image/gamechatback1.png" xy="85,4" size="157,64" scale="1.3,1.3">
<gearDisplay controller="mask_voice" pages="1"/>
</image>
<component id="n18" name="mask_voice" src="gq7m61" fileName="component/VoiceMask(1).xml" xy="112,19" touchable="false">
<component id="n18" name="mask_voice" src="gq7m61" fileName="component/VoiceMask(1).xml" xy="112,9" size="140,74" touchable="false">
<gearDisplay controller="mask_voice" pages="1"/>
</component>
<component id="n39_nip5" name="mask_piao" src="gq7m65" fileName="component/piao_niao/mask_piao.xml" xy="-5,97" touchable="false">

View File

@ -4,7 +4,7 @@
<controller name="bank" pages="0,,1," selected="0"/>
<controller name="read" pages="0,,1," selected="0"/>
<controller name="offline" pages="0,,1," selected="0"/>
<controller name="mask_voice" pages="0,,1," selected="0"/>
<controller name="mask_voice" pages="0,,1," selected="1"/>
<controller name="piao_niao" pages="0,,1," selected="0"/>
<controller name="three_win" pages="0,,1," selected="0"/>
<controller name="ting" pages="0,,1," selected="0"/>
@ -44,10 +44,10 @@
<component id="n51_l9ll" name="chat" src="gq7m6b" fileName="component/MsgBubble2.xml" xy="78,6" size="198,80" alpha="0" touchable="false">
<Label title="你太牛了"/>
</component>
<image id="n38_tla5" name="n38" src="gq7m5w" fileName="images/game_icon_07.png" xy="-20,-89">
<image id="n38_tla5" name="n38" src="gq7m5w" fileName="images/game_icon_07.png" xy="103,5" size="204,86" flip="hz">
<gearDisplay controller="mask_voice" pages="1"/>
</image>
<component id="n18" name="mask_voice" src="gq7m61" fileName="component/VoiceMask(1).xml" xy="31,-64" touchable="false">
<component id="n18" name="mask_voice" src="gq7m61" fileName="component/VoiceMask(1).xml" xy="127,11" touchable="false">
<gearDisplay controller="mask_voice" pages="1"/>
</component>
<component id="n39_nip5" name="mask_piao" src="gq7m65" fileName="component/piao_niao/mask_piao.xml" xy="-5,97" touchable="false">

View File

@ -4,7 +4,7 @@
<controller name="bank" pages="0,,1," selected="0"/>
<controller name="read" pages="0,,1," selected="0"/>
<controller name="offline" pages="0,,1," selected="0"/>
<controller name="mask_voice" pages="0,,1," selected="0"/>
<controller name="mask_voice" pages="0,,1," selected="1"/>
<controller name="piao_niao" pages="0,,1," selected="0"/>
<controller name="three_win" pages="0,,1," selected="0"/>
<controller name="ting" pages="0,,1," selected="0"/>
@ -37,10 +37,10 @@
</text>
<component id="n31_e54q" name="chat" src="gq7m76" fileName="component/MsgBubble1.xml" xy="-153,32" size="216,67" alpha="0" touchable="false"/>
<component id="n27_e54q" name="face" src="gq7m5x" fileName="component/Face3.xml" xy="0,0" alpha="0" touchable="false"/>
<image id="n51_l9ll" name="n51" src="sx7x14g" fileName="Main_new/Main/Image/gamechatback1.png" xy="85,4" size="157,64" scale="1.3,1.3">
<image id="n51_l9ll" name="n51" src="sx7x14g" fileName="Main_new/Main/Image/gamechatback1.png" xy="85,4" size="157,65" scale="1.3,1.3">
<gearDisplay controller="mask_voice" pages="1"/>
</image>
<component id="n52_l9ll" name="mask_voice" src="gq7m61" fileName="component/VoiceMask(1).xml" xy="119,25" touchable="false">
<component id="n52_l9ll" name="mask_voice" src="gq7m61" fileName="component/VoiceMask(1).xml" xy="111,10" touchable="false">
<gearDisplay controller="mask_voice" pages="1"/>
</component>
<component id="n39_nip5" name="mask_piao" src="gq7m65" fileName="component/piao_niao/mask_piao.xml" xy="-5,97" touchable="false">

View File

@ -1,17 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="77,44">
<component size="127,74" extention="Button">
<displayList>
<image id="n4_h1uu" name="n4" src="gq7m62" xy="0,0"/>
<image id="n1" name="n1" src="gq7m63" xy="0,4"/>
<image id="n2" name="n2" src="gq7m64" xy="0,1"/>
<image id="n5_66fw" name="n5" src="66fw1jo" fileName="Main_new/Main/Image/hudong/voice/图层 1.png" xy="4,1"/>
<image id="n6_66fw" name="n6" src="66fw1jp" fileName="Main_new/Main/Image/hudong/voice/图层 2.png" xy="55,22"/>
<image id="n7_66fw" name="n7" src="66fw1jq" fileName="Main_new/Main/Image/hudong/voice/图层 3.png" xy="62,8"/>
<image id="n8_66fw" name="n8" src="66fw1jq" fileName="Main_new/Main/Image/hudong/voice/图层 3.png" xy="82,9"/>
<text id="n9_66fw" name="title" xy="116,10" size="48,54" font="Arial" fontSize="40" color="#2f891e" bold="true" text="60"/>
</displayList>
<Button/>
<transition name="t0" autoPlay="true" autoPlayRepeat="-1">
<item time="0" type="Visible" target="n2" value="false"/>
<item time="0" type="Visible" target="n1" value="false"/>
<item time="0" type="Visible" target="n4_h1uu" value="false"/>
<item time="10" type="Visible" target="n1" value="true"/>
<item time="20" type="Visible" target="n2" value="true"/>
<item time="32" type="Visible" target="n4_h1uu" value="true"/>
<item time="44" type="Visible" target="n4_h1uu" value="true"/>
<item time="0" type="Visible" target="n6_66fw" value="true"/>
<item time="0" type="Visible" target="n7_66fw" value="true"/>
<item time="0" type="Visible" target="n8_66fw" value="true"/>
<item time="3" type="Visible" target="n8_66fw" value="false"/>
<item time="6" type="Visible" target="n7_66fw" value="false"/>
<item time="9" type="Visible" target="n6_66fw" value="false"/>
<item time="12" type="Visible" target="n6_66fw" value="true"/>
<item time="15" type="Visible" target="n7_66fw" value="true"/>
<item time="18" type="Visible" target="n8_66fw" value="true"/>
</transition>
</component>

View File

@ -1171,7 +1171,6 @@
<image id="ofwa1gq" name="jing.png" path="/Main_new/Clearing/Component/"/>
<image id="ofwa1gr" name="ting_corner_icon.png" path="/Main_new/Clearing/Component/"/>
<image id="ofwa1gs" name="jing(1).png" path="/Main_new/Clearing/Component/"/>
<image id="l9ll1gt" name="3cd3392e-1471-4b6a-b7f8-f27a56ca117f.png" path="/Main_new/Clearing/"/>
<image id="l9ll1gu" name="mahj_common_bg.png" path="/Main_new/Clearing/Image/" scale="9grid" scale9grid="16,17,32,34"/>
<image id="l9ll1gv" name="mahj_common_frame2.png" path="/Main_new/Clearing/Image/"/>
<image id="l9ll1gw" name="mahj_common_frame3.png" path="/Main_new/Clearing/Image/"/>
@ -1267,6 +1266,9 @@
<movieclip id="l9ll1jl" name="flower.jta" path="/Main_new/Main/Image/hudong/flower/" exported="true" atlas="3"/>
<movieclip id="l9ll1jm" name="diamo.jta" path="/Main_new/Main/Image/hudong/jiezhi/" exported="true" atlas="4"/>
<image id="66fw1jn" name="vip_bomb_00.png" path="/Main_new/Main/Image/hudong/bomb/"/>
<image id="66fw1jo" name="图层 1.png" path="/Main_new/Main/Image/hudong/voice/"/>
<image id="66fw1jp" name="图层 2.png" path="/Main_new/Main/Image/hudong/voice/"/>
<image id="66fw1jq" name="图层 3.png" path="/Main_new/Main/Image/hudong/voice/"/>
</resources>
<publish name="Main_Majiang" path="..\wb_unity_pro\Assets\ART\base\main_majiang\ui" packageCount="2"/>
</packageDescription>

View File

@ -18,5 +18,5 @@ AudioImporter:
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleName: base/main_majiang/7a1388fbbc06004b6889a35d185cb02e
assetBundleVariant:

View File

@ -18,5 +18,5 @@ AudioImporter:
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleName: base/main_majiang/70e495da7c7d17e8e9d61bfb31938377
assetBundleVariant:

View File

@ -18,5 +18,5 @@ AudioImporter:
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleName: base/main_majiang/bca805d48422810a17b624027920e50c
assetBundleVariant:

View File

@ -18,5 +18,5 @@ AudioImporter:
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleName: base/main_majiang/4f3d8f4fab24e0476144b04967b7e2f5
assetBundleVariant:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 MiB

After

Width:  |  Height:  |  Size: 4.2 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 MiB

After

Width:  |  Height:  |  Size: 3.8 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 MiB

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 752 KiB

After

Width:  |  Height:  |  Size: 674 KiB

View File

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

View File

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

View File

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

View File

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

View File

@ -303,6 +303,11 @@ public class GameApplication : MonoBehaviour
voiceSource.PlayOneShot(clip, 1f);
}
public void PlayVoice(AudioClip clip,float volume)
{
voiceSource.PlayOneShot(clip, volume);
}
public void PlaySound(string path)
{
if (_soundValue < 5) return;

View File

@ -252,11 +252,27 @@ public class GameApplicationWrap
{
try
{
ToLua.CheckArgsCount(L, 2);
GameApplication obj = (GameApplication)ToLua.CheckObject<GameApplication>(L, 1);
UnityEngine.AudioClip arg0 = (UnityEngine.AudioClip)ToLua.CheckObject(L, 2, typeof(UnityEngine.AudioClip));
obj.PlayVoice(arg0);
return 0;
int count = LuaDLL.lua_gettop(L);
if (count == 2)
{
GameApplication obj = (GameApplication)ToLua.CheckObject<GameApplication>(L, 1);
UnityEngine.AudioClip arg0 = (UnityEngine.AudioClip)ToLua.CheckObject(L, 2, typeof(UnityEngine.AudioClip));
obj.PlayVoice(arg0);
return 0;
}
else if (count == 3)
{
GameApplication obj = (GameApplication)ToLua.CheckObject<GameApplication>(L, 1);
UnityEngine.AudioClip arg0 = (UnityEngine.AudioClip)ToLua.CheckObject(L, 2, typeof(UnityEngine.AudioClip));
float arg1 = (float)LuaDLL.luaL_checknumber(L, 3);
obj.PlayVoice(arg0, arg1);
return 0;
}
else
{
return LuaDLL.luaL_throw(L, "invalid arguments to method: GameApplication.PlayVoice");
}
}
catch (Exception e)
{

View File

@ -8,34 +8,34 @@
"bundle": "extend/poker/runfast"
},
{
"ver": "1.0.37",
"ver": "1.0.38",
"name": "南城麻将",
"check": true,
"version": "1.0.37",
"version": "1.0.38",
"game_id": "86",
"bundle": "extend/majiang/nancheng"
},
{
"ver": "1.0.40",
"ver": "1.0.41",
"name": "黎川麻将",
"check": true,
"version": "1.0.40",
"version": "1.0.41",
"game_id": "87",
"bundle": "extend/majiang/lichuan"
},
{
"ver": "1.0.24",
"ver": "1.0.25",
"name": "金溪麻将",
"check": true,
"version": "1.0.24",
"version": "1.0.25",
"game_id": "88",
"bundle": "extend/majiang/jinxi"
},
{
"ver": "1.0.23",
"ver": "1.0.24",
"name": "抚州麻将",
"check": true,
"version": "1.0.23",
"version": "1.0.24",
"game_id": "89",
"bundle": "extend/majiang/fuzhou"
}

View File

@ -1,109 +1,109 @@
[
{
"lua_path": "/tolua_project,/base_project,/main_project",
"ver": "1.0.8",
"ver": "1.0.6",
"name": "base_script",
"check": true,
"bundle": "base/base_script",
"version": "1.0.8"
"version": "1.0.6"
},
{
"ver": "1.0.8",
"ver": "1.0.6",
"name": "common",
"check": true,
"bundle": "base/common",
"version": "1.0.8"
"version": "1.0.6"
},
{
"ver": "1.0.8",
"ver": "1.0.6",
"name": "login",
"check": true,
"bundle": "base/login",
"version": "1.0.8"
"version": "1.0.6"
},
{
"ver": "1.0.8",
"ver": "1.0.6",
"name": "lobby",
"check": true,
"bundle": "base/lobby",
"version": "1.0.8"
"version": "1.0.6"
},
{
"ver": "1.0.8",
"ver": "1.0.6",
"name": "Family",
"check": true,
"bundle": "base/Family",
"version": "1.0.8"
"version": "1.0.6"
},
{
"ver": "1.0.8",
"ver": "1.0.6",
"name": "chat",
"check": true,
"bundle": "base/chat",
"version": "1.0.8"
"version": "1.0.6"
},
{
"ver": "1.0.8",
"ver": "1.0.6",
"name": "newgroup",
"check": true,
"bundle": "base/newgroup",
"version": "1.0.8"
"version": "1.0.6"
},
{
"ver": "1.0.8",
"ver": "1.0.6",
"name": "rank",
"check": true,
"version": "1.0.8",
"version": "1.0.6",
"bundle": "base/rank"
},
{
"ver": "1.0.8",
"ver": "1.0.6",
"name": "main_majiang",
"check": true,
"version": "1.0.8",
"version": "1.0.6",
"bundle": "base/main_majiang"
},
{
"ver": "1.0.8",
"ver": "1.0.6",
"name": "main_poker",
"check": true,
"version": "1.0.8",
"version": "1.0.6",
"bundle": "base/main_poker"
},
{
"ver": "1.0.8",
"ver": "1.0.6",
"name": "main_zipai",
"check": true,
"version": "1.0.8",
"version": "1.0.6",
"bundle": "base/main_zipai"
},
{
"ver": "1.0.8",
"ver": "1.0.6",
"name": "static",
"check": true,
"bundle": "base/static",
"version": "1.0.8"
"version": "1.0.6"
},
{
"ver": "1.0.8",
"ver": "1.0.6",
"is_res": true,
"name": "embed",
"check": true,
"bundle": "base/embed",
"version": "1.0.8"
"version": "1.0.6"
},
{
"ver": "1.0.8",
"ver": "1.0.6",
"name": "main_pokemajiang",
"check": true,
"version": "1.0.8",
"version": "1.0.6",
"bundle": "base/main_pokemajiang"
},
{
"ver": "1.0.8",
"ver": "1.0.6",
"name": "main_zipaimajiang",
"check": true,
"version": "1.0.8",
"version": "1.0.6",
"bundle": "base/main_zipaimajiang"
}
]

View File

@ -39,7 +39,6 @@ GraphicsSettings:
- {fileID: 16000, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 16001, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 17000, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 16003, guid: 0000000000000000f000000000000000, type: 0}
m_PreloadedShaders: []
m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000,
type: 0}