恢复修改
|
|
@ -12,6 +12,7 @@ GroupMgrEvent = {
|
||||||
BeInvited = "be_invited",
|
BeInvited = "be_invited",
|
||||||
UpdateGroup = "UpdateGroup",
|
UpdateGroup = "UpdateGroup",
|
||||||
NewMailTip = "NewMailTip",
|
NewMailTip = "NewMailTip",
|
||||||
|
InviteResponse = "InviteResponse",
|
||||||
}
|
}
|
||||||
|
|
||||||
GroupMgrController = {
|
GroupMgrController = {
|
||||||
|
|
@ -35,8 +36,6 @@ function GroupMgrController.new()
|
||||||
self._eventmap = {}
|
self._eventmap = {}
|
||||||
self._dispatcher = {}
|
self._dispatcher = {}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
self._eventmap[Protocol.FGMGR_EVT_ADD_PLAY] = self.OnEvtAddPlay
|
self._eventmap[Protocol.FGMGR_EVT_ADD_PLAY] = self.OnEvtAddPlay
|
||||||
self._eventmap[Protocol.FGMGR_EVT_DEL_PLAY] = self.OnEvtDelPlay
|
self._eventmap[Protocol.FGMGR_EVT_DEL_PLAY] = self.OnEvtDelPlay
|
||||||
self._eventmap[Protocol.FGMGR_EVT_UPDATE_PLAY] = self.OnEvtUpdatePlay
|
self._eventmap[Protocol.FGMGR_EVT_UPDATE_PLAY] = self.OnEvtUpdatePlay
|
||||||
|
|
@ -48,6 +47,7 @@ function GroupMgrController.new()
|
||||||
self._eventmap[Protocol.FGMGR_EVT_INVITED] = self.OnEvtInvited
|
self._eventmap[Protocol.FGMGR_EVT_INVITED] = self.OnEvtInvited
|
||||||
self._eventmap[Protocol.FGMGR_EVT_UPDATE_GROUP] = self.OnEvtUpdateGroup
|
self._eventmap[Protocol.FGMGR_EVT_UPDATE_GROUP] = self.OnEvtUpdateGroup
|
||||||
self._eventmap[Protocol.FGMGR_EVT_NEW_MAIL] = self.OnEvtNewMailTip
|
self._eventmap[Protocol.FGMGR_EVT_NEW_MAIL] = self.OnEvtNewMailTip
|
||||||
|
self._eventmap[Protocol.FGMGR_RESPONSE_INVITE] = self.FG_ResponseInvited
|
||||||
-- self:connect(callback)
|
-- self:connect(callback)
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
@ -290,10 +290,11 @@ function M:FG_GetOnlinePlayers(callback)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- 邀请在线玩家
|
-- 邀请在线玩家
|
||||||
function M:FG_InvitePlayer(group_id, tag, roomid, pid, game_name, callback)
|
function M:FG_InvitePlayer(group_id, tag, player_id, roomid, pid, game_name, callback)
|
||||||
local _data = {}
|
local _data = {}
|
||||||
_data.id = group_id
|
_data.id = group_id
|
||||||
_data.tagId = tag
|
_data.tagId = tag
|
||||||
|
_data.player_id = player_id
|
||||||
_data.roomid = roomid
|
_data.roomid = roomid
|
||||||
_data.pid = pid
|
_data.pid = pid
|
||||||
_data.g_name = game_name
|
_data.g_name = game_name
|
||||||
|
|
@ -303,11 +304,21 @@ function M:FG_InvitePlayer(group_id, tag, roomid, pid, game_name, callback)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- 回复邀请
|
-- 回复邀请
|
||||||
function M:FG_ResponseInvited(id, refuse)
|
-- function M:FG_ResponseInvited(id, refuse)
|
||||||
local _data = {}
|
-- local _data = {}
|
||||||
_data.invi_id = id
|
-- _data.invi_id = id
|
||||||
_data.refuse = refuse
|
-- _data.refuse = refuse
|
||||||
self._mgr_client:send(Protocol.FGMGR_RESPONSE_INVITE, _data)
|
-- self._mgr_client:send(Protocol.FGMGR_RESPONSE_INVITE, _data)
|
||||||
|
-- end
|
||||||
|
|
||||||
|
--被邀请玩家收到邀请
|
||||||
|
function M:FG_ResponseInvited(evt_data)
|
||||||
|
local invite_id = evt_data.invite_id
|
||||||
|
local g_name = evt_data.g_name
|
||||||
|
local roomid = evt_data.roomid
|
||||||
|
local pid = evt_data.pid
|
||||||
|
local groupid = evt_data.groupid
|
||||||
|
DispatchEvent(self._dispatcher, GroupMgrEvent.InviteResponse, invite_id, g_name, roomid, pid, groupid)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:PopEvent()
|
function M:PopEvent()
|
||||||
|
|
|
||||||
|
|
@ -2,10 +2,10 @@
|
||||||
local FGAssistInviteView = {}
|
local FGAssistInviteView = {}
|
||||||
|
|
||||||
local M = FGAssistInviteView
|
local M = FGAssistInviteView
|
||||||
setmetatable(M, {__index = BaseWindow})
|
setmetatable(M, { __index = BaseWindow })
|
||||||
|
|
||||||
function FGAssistInviteView.new(blur_view, callback)
|
function FGAssistInviteView.new(blur_view, callback)
|
||||||
local self = setmetatable({}, {__index = M})
|
local self = setmetatable({}, { __index = M })
|
||||||
self.class = "FGAssistInviteView"
|
self.class = "FGAssistInviteView"
|
||||||
self._blur_view = blur_view
|
self._blur_view = blur_view
|
||||||
self._animation = true
|
self._animation = true
|
||||||
|
|
@ -28,7 +28,7 @@ function M:initView(url)
|
||||||
|
|
||||||
self._timer = 0
|
self._timer = 0
|
||||||
self:FillData()
|
self:FillData()
|
||||||
UpdateBeat:Add(self.OnUpdate,self)
|
UpdateBeat:Add(self.OnUpdate, self)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:FillData()
|
function M:FillData()
|
||||||
|
|
|
||||||
|
|
@ -68,9 +68,14 @@ function M:PlayerRenderer(index, obj)
|
||||||
btn_invite.onClick:Set(function()
|
btn_invite.onClick:Set(function()
|
||||||
local mgr_ctr = ControllerManager.GetController(GroupMgrController)
|
local mgr_ctr = ControllerManager.GetController(GroupMgrController)
|
||||||
local room = DataManager.CurrenRoom
|
local room = DataManager.CurrenRoom
|
||||||
mgr_ctr:FG_InvitePlayer(self.group_id, self._data_number[i].uid, room.room_id, room.play_id,
|
mgr_ctr:FG_InvitePlayer(self.group_id, self._data_number[i].uid, DataManager.SelfUser.account_id, room.room_id,
|
||||||
|
room.play_id,
|
||||||
room.room_config:GetGameName(),
|
room.room_config:GetGameName(),
|
||||||
function()
|
function(res)
|
||||||
|
if res.ReturnCode ~= 0 then
|
||||||
|
ViewUtil.ErrorTip(res.ReturnCode, "邀请失败")
|
||||||
|
else
|
||||||
|
end
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,122 @@
|
||||||
|
local FGInvitedMsgView = import('.FamilyInvitedMsgView')
|
||||||
|
|
||||||
|
|
||||||
|
local FamilyEventView = {}
|
||||||
|
|
||||||
|
local M = FamilyEventView
|
||||||
|
|
||||||
|
function FamilyEventView.new(root)
|
||||||
|
setmetatable(M, { __index = root })
|
||||||
|
local self = setmetatable({}, { __index = M })
|
||||||
|
|
||||||
|
local mgr_ctr = self._mgr_ctr
|
||||||
|
mgr_ctr:AddEventListener(GroupMgrEvent.AddPlay, handler(self, self._evtAddPlay))
|
||||||
|
mgr_ctr:AddEventListener(GroupMgrEvent.DelPlay, handler(self, self._evtDelPlay))
|
||||||
|
mgr_ctr:AddEventListener(GroupMgrEvent.UpdatePlay, handler(self, self._evtUpdatePlay))
|
||||||
|
mgr_ctr:AddEventListener(GroupMgrEvent.AddRoom, handler(self, self._evtAddRoom))
|
||||||
|
mgr_ctr:AddEventListener(GroupMgrEvent.DelRoom, handler(self, self._evtDelRoom))
|
||||||
|
mgr_ctr:AddEventListener(GroupMgrEvent.UpdateRoom, handler(self, self._evtUpdateRoom))
|
||||||
|
mgr_ctr:AddEventListener(GroupMgrEvent.UpdatePlayerInfo, handler(self, self._evtUpdatePlayerInfo))
|
||||||
|
mgr_ctr:AddEventListener(GroupMgrEvent.BeInvited, handler(self, self._evtInvited))
|
||||||
|
mgr_ctr:AddEventListener(GroupMgrEvent.UpdateGroup, handler(self, self._evtUpdateGroup))
|
||||||
|
mgr_ctr:AddEventListener(GroupMgrEvent.NewMailTip, handler(self, self._evtNewMailTip))
|
||||||
|
mgr_ctr:AddEventListener(GroupMgrEvent.InviteResponse, handler(self, self._evtInviteResponse))
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
|
function M:_evtAddPlay(...)
|
||||||
|
local arg = { ... }
|
||||||
|
print("family event _evtAddPlay")
|
||||||
|
end
|
||||||
|
|
||||||
|
function M:_evtDelPlay(...)
|
||||||
|
local arg = { ... }
|
||||||
|
print("family event _evtDelPlay")
|
||||||
|
end
|
||||||
|
|
||||||
|
function M:_evtUpdatePlay(...)
|
||||||
|
local arg = { ... }
|
||||||
|
print("family event _evtUpdatePlay")
|
||||||
|
end
|
||||||
|
|
||||||
|
function M:_evtAddRoom(...)
|
||||||
|
local arg = { ... }
|
||||||
|
print("family event _evtAddRoom")
|
||||||
|
end
|
||||||
|
|
||||||
|
function M:_evtDelRoom(...)
|
||||||
|
local arg = { ... }
|
||||||
|
print("family event _evtDelRoom")
|
||||||
|
end
|
||||||
|
|
||||||
|
function M:_evtUpdateRoom(...)
|
||||||
|
local arg = { ... }
|
||||||
|
print("family event _evtUpdateRoom")
|
||||||
|
end
|
||||||
|
|
||||||
|
function M:_evtUpdatePlayerInfo(...)
|
||||||
|
local arg = { ... }
|
||||||
|
print("family event _evtUpdatePlayerInfo")
|
||||||
|
end
|
||||||
|
|
||||||
|
function M:_evtInvited(...)
|
||||||
|
local arg = { ... }
|
||||||
|
print("family event _evtInvited")
|
||||||
|
end
|
||||||
|
|
||||||
|
function M:_evtUpdateGroup(...)
|
||||||
|
local arg = { ... }
|
||||||
|
print("family event _evtUpdateGroup")
|
||||||
|
end
|
||||||
|
|
||||||
|
function M:_evtNewMailTip(...)
|
||||||
|
local arg = { ... }
|
||||||
|
print("family event _evtNewMailTip")
|
||||||
|
end
|
||||||
|
|
||||||
|
function M:_evtInviteResponse(...)
|
||||||
|
local arg = { ... }
|
||||||
|
local invite_id = arg[1]
|
||||||
|
local g_name = arg[2]
|
||||||
|
local roomid = arg[3]
|
||||||
|
local pid = arg[4]
|
||||||
|
local groupid = arg[5]
|
||||||
|
local roomCtr = ControllerManager.GetController(RoomController)
|
||||||
|
local gameId = DataManager.groups:get(groupid):getPlay(pid).gameId
|
||||||
|
local imv =
|
||||||
|
FGInvitedMsgView.new(
|
||||||
|
self._root_view,
|
||||||
|
groupid,
|
||||||
|
pid,
|
||||||
|
invite_id,
|
||||||
|
function()
|
||||||
|
roomCtr:PublicJoinRoom(
|
||||||
|
Protocol.WEB_FG_JOIN_ROOM,
|
||||||
|
roomid,
|
||||||
|
groupid,
|
||||||
|
function(response)
|
||||||
|
if (response.ReturnCode == -1) then
|
||||||
|
ViewUtil.ErrorMsg(self._root_view, response.ReturnCode, 'response.ReturnCode == -1')
|
||||||
|
-- RestartGame()
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
if response.ReturnCode ~= 0 then
|
||||||
|
ViewUtil.ErrorMsg(self._root_view, response.ReturnCode, '进入房间失败')
|
||||||
|
-- ViewManager.ChangeView(ViewManager.View_Lobby)
|
||||||
|
return
|
||||||
|
else
|
||||||
|
UpdateBeat:Remove(self.OnUpdate, self)
|
||||||
|
ViewManager.ChangeView(ViewManager.View_Main, gameId)
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
groupid,
|
||||||
|
pid
|
||||||
|
)
|
||||||
|
end
|
||||||
|
)
|
||||||
|
-- imv:FillData(data)
|
||||||
|
imv:Show()
|
||||||
|
end
|
||||||
|
|
||||||
|
return M
|
||||||
|
|
@ -0,0 +1,66 @@
|
||||||
|
-- 被邀请界面
|
||||||
|
local FGInvitedMsgView = {}
|
||||||
|
|
||||||
|
local M = FGInvitedMsgView
|
||||||
|
setmetatable(M, { __index = BaseWindow })
|
||||||
|
|
||||||
|
function FGInvitedMsgView.new(groupid, pid, invite_id, blur_view, callback)
|
||||||
|
print("lingmeng FGAssistInviteView")
|
||||||
|
local self = setmetatable({}, { __index = M })
|
||||||
|
self.class = "FGAssistInviteView"
|
||||||
|
self._blur_view = blur_view
|
||||||
|
self._animation = true
|
||||||
|
self._new_hide = false
|
||||||
|
self._put_map = false
|
||||||
|
self._close_destroy = true
|
||||||
|
self.groupid = groupid
|
||||||
|
self.pid = pid
|
||||||
|
self.invite_id = invite_id
|
||||||
|
self.callback = callback
|
||||||
|
print("lingmeng FGAssistInviteView1")
|
||||||
|
|
||||||
|
self:initView("ui://FGAssist/panel_invite")
|
||||||
|
print("lingmeng FGAssistInviteView2")
|
||||||
|
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
|
function M:initView(url)
|
||||||
|
BaseWindow.init(self, url)
|
||||||
|
print("lingmeng FGAssistInviteView3")
|
||||||
|
self._viewText_groupName = self._view:GetChild('tex_group_name')
|
||||||
|
self._viewText_gameName = self._view:GetChild('tex_game_name')
|
||||||
|
self._viewText_inviteName = self._view:GetChild('tex_name')
|
||||||
|
self._viewText_playName = self._view:GetChild('tex_play_name')
|
||||||
|
self._viewText_playConfig = self._view:GetChild('text_play_config')
|
||||||
|
|
||||||
|
print("lingmeng FGAssistInviteView4")
|
||||||
|
|
||||||
|
self._view:GetChild('btn_no').onClick:Set(function()
|
||||||
|
print("lingmeng btn_no")
|
||||||
|
self:Destroy()
|
||||||
|
end)
|
||||||
|
|
||||||
|
print("lingmeng FGAssistInviteView5")
|
||||||
|
|
||||||
|
self._view:GetChild('btn_yes').onClick:Set(function()
|
||||||
|
print("lingmeng btn_yes", self.callback)
|
||||||
|
|
||||||
|
if self.callback then
|
||||||
|
self.callback()
|
||||||
|
end
|
||||||
|
self:Destroy()
|
||||||
|
end)
|
||||||
|
print("lingmeng FGAssistInviteViewend")
|
||||||
|
self:FillData()
|
||||||
|
end
|
||||||
|
|
||||||
|
function M:FillData()
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
function M:Destroy()
|
||||||
|
BaseWindow.Destroy(self)
|
||||||
|
end
|
||||||
|
|
||||||
|
return M
|
||||||
|
|
@ -9,6 +9,7 @@ local FamilyNumberRecord = import(".Family.FamilyNumberRecord")
|
||||||
local FamilyAuditNumber = import(".Family.FamilyAuditNumber")
|
local FamilyAuditNumber = import(".Family.FamilyAuditNumber")
|
||||||
local FamilyJoinAndCreate = import(".Family.FamilyJoinAndCreate")
|
local FamilyJoinAndCreate = import(".Family.FamilyJoinAndCreate")
|
||||||
local FamilyBanDeskmate = import(".Family.FamilyBanDeskmate")
|
local FamilyBanDeskmate = import(".Family.FamilyBanDeskmate")
|
||||||
|
local FamilyEventView = import(".Family.FamilyEventView")
|
||||||
---
|
---
|
||||||
FamilyView = {}
|
FamilyView = {}
|
||||||
|
|
||||||
|
|
@ -35,6 +36,7 @@ function M:init(url)
|
||||||
|
|
||||||
self.familyType = view:GetController('familyType')
|
self.familyType = view:GetController('familyType')
|
||||||
self.btn_close = view:GetChild('btn_close')
|
self.btn_close = view:GetChild('btn_close')
|
||||||
|
self._mgr_ctr = ControllerManager.GetController(GroupMgrController)
|
||||||
|
|
||||||
self:InitCloseClick()
|
self:InitCloseClick()
|
||||||
|
|
||||||
|
|
@ -52,6 +54,11 @@ function M:init(url)
|
||||||
self._child_familyNumberRecord = FamilyNumberRecord.New(self)
|
self._child_familyNumberRecord = FamilyNumberRecord.New(self)
|
||||||
self.lastType = 1
|
self.lastType = 1
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
if FamilyEventView then
|
||||||
|
self._familyEventView = FamilyEventView.new(self)
|
||||||
|
self._familyEventView:_evtAddPlay()
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:InitCloseClick()
|
function M:InitCloseClick()
|
||||||
|
|
@ -391,6 +398,21 @@ function M:OnUpdate()
|
||||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||||
local heatTime = os.time()
|
local heatTime = os.time()
|
||||||
-- --12001事件
|
-- --12001事件
|
||||||
|
local func = self._mgr_ctr:PopEvent()
|
||||||
|
if (func ~= nil) then
|
||||||
|
local success, result = pcall(func)
|
||||||
|
if success then
|
||||||
|
|
||||||
|
else
|
||||||
|
print("witness error")
|
||||||
|
print(result)
|
||||||
|
-- self._gamectr = ControllerManager.GetController(GameController)
|
||||||
|
-- if self._gamectr then
|
||||||
|
-- self._gamectr:ResetConnect()
|
||||||
|
-- end
|
||||||
|
end
|
||||||
|
--func()
|
||||||
|
end
|
||||||
if self._group.update_room then
|
if self._group.update_room then
|
||||||
-- if self._roomNum == self._group.room_num then
|
-- if self._roomNum == self._group.room_num then
|
||||||
-- for i = 1, self._group.room_num do
|
-- for i = 1, self._group.room_num do
|
||||||
|
|
|
||||||
|
|
@ -404,7 +404,7 @@ function M:EventInit()
|
||||||
---
|
---
|
||||||
local isZiMo = win_seat == lose_seat
|
local isZiMo = win_seat == lose_seat
|
||||||
DataManager.CurrenRoom.isZiMoHu = isZiMo
|
DataManager.CurrenRoom.isZiMoHu = isZiMo
|
||||||
local hu_sound = isZiMo and ("zimo" .. math.random(1, 3)) or ("hu" .. math.random(1, 2))
|
local hu_sound = isZiMo and ("zimo") or ("hu")
|
||||||
printlog("声音====>>>", hu_sound)
|
printlog("声音====>>>", hu_sound)
|
||||||
self:PlaySound("FuZhou_MJ", player.self_user.sex, hu_sound)
|
self:PlaySound("FuZhou_MJ", player.self_user.sex, hu_sound)
|
||||||
|
|
||||||
|
|
@ -420,6 +420,10 @@ function M:EventInit()
|
||||||
local tem = win_list[i]
|
local tem = win_list[i]
|
||||||
if tem.type > 0 and tem.type < 32 then
|
if tem.type > 0 and tem.type < 32 then
|
||||||
local com_name = "he" .. tem.type
|
local com_name = "he" .. tem.type
|
||||||
|
printlog("声音====>>>", com_name)
|
||||||
|
ViewUtil.PlaySound("FuZhou_MJ",
|
||||||
|
string.format("extend/majiang/fuhzou/sound/%s/%s.mp3", ViewUtil.Sex_Chat[player.self_user.sex],
|
||||||
|
com_name))
|
||||||
local item = he_list:GetChild("list"):AddItemFromPool("ui://Extend_MJ_FuZhou/" .. com_name)
|
local item = he_list:GetChild("list"):AddItemFromPool("ui://Extend_MJ_FuZhou/" .. com_name)
|
||||||
coroutine.wait(0.3)
|
coroutine.wait(0.3)
|
||||||
end
|
end
|
||||||
|
|
@ -802,16 +806,16 @@ function M:OnFangziAction(...)
|
||||||
-- local pNode = info._mask_liangpai
|
-- local pNode = info._mask_liangpai
|
||||||
local effect = UIPackage.CreateObject("Extend_MJ_FuZhou", "FzEffect")
|
local effect = UIPackage.CreateObject("Extend_MJ_FuZhou", "FzEffect")
|
||||||
if fz.type == FZType.Peng then
|
if fz.type == FZType.Peng then
|
||||||
self:PlaySound("FuZhou_MJ", player.self_user.sex, "peng" .. math.random(1, 3))
|
self:PlaySound("FuZhou_MJ", player.self_user.sex, "peng")
|
||||||
effect:GetChild("word1").icon = UIPackage.GetItemURL("Main_Majiang", "碰")
|
effect:GetChild("word1").icon = UIPackage.GetItemURL("Main_Majiang", "碰")
|
||||||
effect:GetChild("word2").icon = UIPackage.GetItemURL("Main_Majiang", "碰")
|
effect:GetChild("word2").icon = UIPackage.GetItemURL("Main_Majiang", "碰")
|
||||||
-- effect:GetChild("kuang").icon = UIPackage.GetItemURL("Main_Majiang", "碰框")
|
-- effect:GetChild("kuang").icon = UIPackage.GetItemURL("Main_Majiang", "碰框")
|
||||||
elseif fz.type == FZType.Chi then
|
elseif fz.type == FZType.Chi then
|
||||||
self:PlaySound("FuZhou_MJ", player.self_user.sex, "chi" .. math.random(1, 3))
|
self:PlaySound("FuZhou_MJ", player.self_user.sex, "chi")
|
||||||
effect:GetChild("word1").icon = UIPackage.GetItemURL("Main_Majiang", "吃")
|
effect:GetChild("word1").icon = UIPackage.GetItemURL("Main_Majiang", "吃")
|
||||||
effect:GetChild("word2").icon = UIPackage.GetItemURL("Main_Majiang", "吃")
|
effect:GetChild("word2").icon = UIPackage.GetItemURL("Main_Majiang", "吃")
|
||||||
else
|
else
|
||||||
self:PlaySound("FuZhou_MJ", player.self_user.sex, "gang" .. math.random(1, 2))
|
self:PlaySound("FuZhou_MJ", player.self_user.sex, "gang")
|
||||||
effect:GetChild("word1").icon = UIPackage.GetItemURL("Main_Majiang", "杠")
|
effect:GetChild("word1").icon = UIPackage.GetItemURL("Main_Majiang", "杠")
|
||||||
effect:GetChild("word2").icon = UIPackage.GetItemURL("Main_Majiang", "杠")
|
effect:GetChild("word2").icon = UIPackage.GetItemURL("Main_Majiang", "杠")
|
||||||
-- effect:GetChild("kuang").icon = UIPackage.GetItemURL("Main_Majiang", "杠框")
|
-- effect:GetChild("kuang").icon = UIPackage.GetItemURL("Main_Majiang", "杠框")
|
||||||
|
|
|
||||||
|
|
@ -10,8 +10,8 @@ local M = {}
|
||||||
|
|
||||||
--- Create a new ZZ_MainView
|
--- Create a new ZZ_MainView
|
||||||
function M.new()
|
function M.new()
|
||||||
setmetatable(M,{__index = MJMainView})
|
setmetatable(M, { __index = MJMainView })
|
||||||
local self = setmetatable({}, {__index = M})
|
local self = setmetatable({}, { __index = M })
|
||||||
self.class = "MainView"
|
self.class = "MainView"
|
||||||
self.asset_group = "GeJiu_MJ"
|
self.asset_group = "GeJiu_MJ"
|
||||||
self:init()
|
self:init()
|
||||||
|
|
@ -25,17 +25,17 @@ function M:InitView(url)
|
||||||
self._gps_style = 1
|
self._gps_style = 1
|
||||||
self._full = true
|
self._full = true
|
||||||
UIPackage.AddPackage("extend/majiang/gejiu/ui/Extend_MJ_GeJiu")
|
UIPackage.AddPackage("extend/majiang/gejiu/ui/Extend_MJ_GeJiu")
|
||||||
MJMainView.InitView(self,"ui://Main_Majiang/Main_"..room.room_config.people_num .. "_s2")
|
MJMainView.InitView(self, "ui://Main_Majiang/Main_" .. room.room_config.people_num .. "_s2")
|
||||||
self._hu_tip = HuTipView.new(self)
|
self._hu_tip = HuTipView.new(self)
|
||||||
|
|
||||||
self._view:GetChild('wanfa_text').text =room.room_config.people_num .. '人个旧麻将 ' .. room.score_times .. '倍'
|
self._view:GetChild('wanfa_text').text = room.room_config.people_num .. '人个旧麻将 ' .. room.score_times .. '倍'
|
||||||
|
|
||||||
self.selectLaiziBtn=self._view:GetChild('selectlaizi')
|
self.selectLaiziBtn = self._view:GetChild('selectlaizi')
|
||||||
self.Laizi1Btn=self._view:GetChild('selectgang1')
|
self.Laizi1Btn = self._view:GetChild('selectgang1')
|
||||||
self.Laizi2Btn=self._view:GetChild('selectgang2')
|
self.Laizi2Btn = self._view:GetChild('selectgang2')
|
||||||
self._view:GetChild("n108").visible = true
|
self._view:GetChild("n108").visible = true
|
||||||
self.Laizi1Btn.visible=true
|
self.Laizi1Btn.visible = true
|
||||||
self.Laizi2Btn.visible=true
|
self.Laizi2Btn.visible = true
|
||||||
self.bugangnum = self._view:GetChild("bugangnum")
|
self.bugangnum = self._view:GetChild("bugangnum")
|
||||||
|
|
||||||
self:PlayerChangeLineState()
|
self:PlayerChangeLineState()
|
||||||
|
|
@ -45,8 +45,7 @@ function M:InitView(url)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:__BuGang(card1,card2, callback)
|
function M:__BuGang(card1, card2, callback)
|
||||||
|
|
||||||
local _gang_tip_choice = UIPackage.CreateObject("Extend_MJ_GeJiu", "Gang_tip_choice")
|
local _gang_tip_choice = UIPackage.CreateObject("Extend_MJ_GeJiu", "Gang_tip_choice")
|
||||||
_gang_tip_choice.visible = true
|
_gang_tip_choice.visible = true
|
||||||
|
|
||||||
|
|
@ -54,8 +53,8 @@ function M:__BuGang(card1,card2, callback)
|
||||||
local gangcard2 = _gang_tip_choice:GetChild("card2")
|
local gangcard2 = _gang_tip_choice:GetChild("card2")
|
||||||
|
|
||||||
|
|
||||||
gangcard1.icon = UIPackage.GetItemURL("Main_Majiang", self:GetPrefix() .. "202_"..card1)
|
gangcard1.icon = UIPackage.GetItemURL("Main_Majiang", self:GetPrefix() .. "202_" .. card1)
|
||||||
gangcard2.icon = UIPackage.GetItemURL("Main_Majiang", self:GetPrefix() .. "202_"..card2)
|
gangcard2.icon = UIPackage.GetItemURL("Main_Majiang", self:GetPrefix() .. "202_" .. card2)
|
||||||
|
|
||||||
gangcard1.onClick:Add(function()
|
gangcard1.onClick:Add(function()
|
||||||
callback(card1)
|
callback(card1)
|
||||||
|
|
@ -65,38 +64,36 @@ function M:__BuGang(card1,card2, callback)
|
||||||
callback(card2)
|
callback(card2)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
_gang_tip_choice.xy = Vector2((self._view.width - _gang_tip_choice.width)/2, (self._view.height - _gang_tip_choice.height)/2)
|
_gang_tip_choice.xy = Vector2((self._view.width - _gang_tip_choice.width) / 2,
|
||||||
|
(self._view.height - _gang_tip_choice.height) / 2)
|
||||||
self._view:AddChild(_gang_tip_choice)
|
self._view:AddChild(_gang_tip_choice)
|
||||||
self._gang_tip_choice = _gang_tip_choice
|
self._gang_tip_choice = _gang_tip_choice
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function M:SetShowGangZiProcess(currentLaizi1ID, currentLaizi2ID, bugangnum, isShowAnim)
|
||||||
function M:SetShowGangZiProcess(currentLaizi1ID,currentLaizi2ID,bugangnum,isShowAnim)
|
|
||||||
--zhongid=currentLaizi1ID
|
--zhongid=currentLaizi1ID
|
||||||
if isShowAnim==nil then isShowAnim=false end
|
if isShowAnim == nil then isShowAnim = false end
|
||||||
|
|
||||||
self:SetGangZiCard(self.Laizi1Btn,currentLaizi1ID)
|
|
||||||
self:SetGangZiCard(self.Laizi2Btn,currentLaizi2ID)
|
|
||||||
self:IsShowGangZi(self.Laizi1Btn,true)
|
|
||||||
self:IsShowGangZi(self.Laizi2Btn,true)
|
|
||||||
self.bugangnum.text = "当前 "..bugangnum.." 杠"
|
|
||||||
|
|
||||||
|
self:SetGangZiCard(self.Laizi1Btn, currentLaizi1ID)
|
||||||
|
self:SetGangZiCard(self.Laizi2Btn, currentLaizi2ID)
|
||||||
|
self:IsShowGangZi(self.Laizi1Btn, true)
|
||||||
|
self:IsShowGangZi(self.Laizi2Btn, true)
|
||||||
|
self.bugangnum.text = "当前 " .. bugangnum .. " 杠"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function M:HideAllGangZiCard()
|
function M:HideAllGangZiCard()
|
||||||
self.Laizi1Btn.visible=false
|
self.Laizi1Btn.visible = false
|
||||||
self.Laizi2Btn.visible=false
|
self.Laizi2Btn.visible = false
|
||||||
self.selectLaiziBtn.visible=false
|
self.selectLaiziBtn.visible = false
|
||||||
--self.LaiziBG.visible=false
|
--self.LaiziBG.visible=false
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:SetGangZiCard(btn,cardId)
|
function M:SetGangZiCard(btn, cardId)
|
||||||
btn.icon='ui://Main_Majiang/' ..get_majiang_prefix(DataManager.CurrenRoom.game_id).."201_"..cardId
|
btn.icon = 'ui://Main_Majiang/' .. get_majiang_prefix(DataManager.CurrenRoom.game_id) .. "201_" .. cardId
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:IsShowGangZi(btn,isShow)
|
function M:IsShowGangZi(btn, isShow)
|
||||||
btn.visible=isShow
|
btn.visible = isShow
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:UpdateRound()
|
function M:UpdateRound()
|
||||||
|
|
@ -109,16 +106,16 @@ function M:InitPlayerInfoView()
|
||||||
local _player_info = self._player_info
|
local _player_info = self._player_info
|
||||||
for i = 1, self._room.room_config.people_num do
|
for i = 1, self._room.room_config.people_num do
|
||||||
local tem = self._view:GetChild("player_info" .. i)
|
local tem = self._view:GetChild("player_info" .. i)
|
||||||
_player_info[i] = PlayerInfoView.new(tem,self)
|
_player_info[i] = PlayerInfoView.new(tem, self)
|
||||||
tem.visible = false
|
tem.visible = false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:NewMJPlayerCardInfoView(view,index)
|
function M:NewMJPlayerCardInfoView(view, index)
|
||||||
if index == 1 then
|
if index == 1 then
|
||||||
return MJPlayerSelfCardInfoView.new(view,self)
|
return MJPlayerSelfCardInfoView.new(view, self)
|
||||||
end
|
end
|
||||||
return MJPlayerCardInfoView.new(view,self)
|
return MJPlayerCardInfoView.new(view, self)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:EventInit()
|
function M:EventInit()
|
||||||
|
|
@ -133,18 +130,18 @@ function M:EventInit()
|
||||||
|
|
||||||
|
|
||||||
_gamectr:AddEventListener(TX_GameEvent.SendLaiZi, function(...)
|
_gamectr:AddEventListener(TX_GameEvent.SendLaiZi, function(...)
|
||||||
local arg = {...}
|
local arg = { ... }
|
||||||
self:SetShowLaiZiProcess(arg[1],arg[2],arg[3],arg[4])
|
self:SetShowLaiZiProcess(arg[1], arg[2], arg[3], arg[4])
|
||||||
end)
|
end)
|
||||||
|
|
||||||
_gamectr:AddEventListener(TX_GameEvent.SendGangZi, function(...)
|
_gamectr:AddEventListener(TX_GameEvent.SendGangZi, function(...)
|
||||||
local arg = {...}
|
local arg = { ... }
|
||||||
self:SetShowGangZiProcess(arg[1],arg[2],arg[3],arg[4])
|
self:SetShowGangZiProcess(arg[1], arg[2], arg[3], arg[4])
|
||||||
end)
|
end)
|
||||||
|
|
||||||
_gamectr:AddEventListener(TX_GameEvent.EventBuGang, function(...)
|
_gamectr:AddEventListener(TX_GameEvent.EventBuGang, function(...)
|
||||||
local arg = {...}
|
local arg = { ... }
|
||||||
self:__BuGang(arg[1],arg[2],
|
self:__BuGang(arg[1], arg[2],
|
||||||
function(id)
|
function(id)
|
||||||
printlog(id)
|
printlog(id)
|
||||||
_gamectr:SendGangCard(id)
|
_gamectr:SendGangCard(id)
|
||||||
|
|
@ -154,12 +151,12 @@ function M:EventInit()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
_gamectr:AddEventListener(TX_GameEvent.SendCards,function( ... )
|
_gamectr:AddEventListener(TX_GameEvent.SendCards, function(...)
|
||||||
-- self:ShowHuTip()
|
-- self:ShowHuTip()
|
||||||
self:UpdateRound()
|
self:UpdateRound()
|
||||||
self._state.selectedIndex = 1
|
self._state.selectedIndex = 1
|
||||||
local list = _room.player_list
|
local list = _room.player_list
|
||||||
for i=1,#list do
|
for i = 1, #list do
|
||||||
local p = list[i]
|
local p = list[i]
|
||||||
local info = self._player_info[self:GetPos(p.seat)]
|
local info = self._player_info[self:GetPos(p.seat)]
|
||||||
info:FillData(p)
|
info:FillData(p)
|
||||||
|
|
@ -170,7 +167,7 @@ function M:EventInit()
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
_gamectr:AddEventListener(TX_GameEvent.EventTurn, function(...)
|
_gamectr:AddEventListener(TX_GameEvent.EventTurn, function(...)
|
||||||
local arg = {...}
|
local arg = { ... }
|
||||||
self._left_time = 15
|
self._left_time = 15
|
||||||
local seat = arg[1]
|
local seat = arg[1]
|
||||||
self:UpdateCardBox(self:GetPos(seat))
|
self:UpdateCardBox(self:GetPos(seat))
|
||||||
|
|
@ -184,11 +181,11 @@ function M:EventInit()
|
||||||
info:UpdateHandCard(true)
|
info:UpdateHandCard(true)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
local _gcm_outcard_url ="ui://Main_Majiang/Gcm_OutCard"
|
local _gcm_outcard_url = "ui://Main_Majiang/Gcm_OutCard"
|
||||||
_gamectr:AddEventListener(TX_GameEvent.OutCard, function(...)
|
_gamectr:AddEventListener(TX_GameEvent.OutCard, function(...)
|
||||||
self:__CloseTip()
|
self:__CloseTip()
|
||||||
self._left_time = 0
|
self._left_time = 0
|
||||||
local arg = {...}
|
local arg = { ... }
|
||||||
local p = arg[1]
|
local p = arg[1]
|
||||||
local card = arg[2]
|
local card = arg[2]
|
||||||
local seat = p.seat
|
local seat = p.seat
|
||||||
|
|
@ -205,7 +202,7 @@ function M:EventInit()
|
||||||
end)
|
end)
|
||||||
_gamectr:AddEventListener(TX_GameEvent.GetCard, function(...)
|
_gamectr:AddEventListener(TX_GameEvent.GetCard, function(...)
|
||||||
self:__CloseTip()
|
self:__CloseTip()
|
||||||
local arg = {...}
|
local arg = { ... }
|
||||||
local seat = arg[1]
|
local seat = arg[1]
|
||||||
local card = arg[2]
|
local card = arg[2]
|
||||||
-- self._tex_leftTime.text = arg[3]
|
-- self._tex_leftTime.text = arg[3]
|
||||||
|
|
@ -216,20 +213,20 @@ function M:EventInit()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
_gamectr:AddEventListener(TX_GameEvent.FZTips, function(...)
|
_gamectr:AddEventListener(TX_GameEvent.FZTips, function(...)
|
||||||
local arg = {...}
|
local arg = { ... }
|
||||||
local _tip = arg[1]
|
local _tip = arg[1]
|
||||||
local weight = arg[2]
|
local weight = arg[2]
|
||||||
self:__FangziTip(_tip, weight)
|
self:__FangziTip(_tip, weight)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
_gamectr:AddEventListener(TX_GameEvent.FangziAction, handler(self,self.OnFangziAction))
|
_gamectr:AddEventListener(TX_GameEvent.FangziAction, handler(self, self.OnFangziAction))
|
||||||
|
|
||||||
_gamectr:AddEventListener(TX_GameEvent.ZPHuCard, function(...)
|
_gamectr:AddEventListener(TX_GameEvent.ZPHuCard, function(...)
|
||||||
self._left_time = 0
|
self._left_time = 0
|
||||||
self:UpdateCardBox(0)
|
self:UpdateCardBox(0)
|
||||||
self:__CloseTip()
|
self:__CloseTip()
|
||||||
self._popEvent = false
|
self._popEvent = false
|
||||||
local arg = {...}
|
local arg = { ... }
|
||||||
local win_seat = arg[1]
|
local win_seat = arg[1]
|
||||||
local lose_seat = arg[2]
|
local lose_seat = arg[2]
|
||||||
local win_card = arg[3]
|
local win_card = arg[3]
|
||||||
|
|
@ -263,7 +260,7 @@ function M:EventInit()
|
||||||
pNode:AddChild(he)
|
pNode:AddChild(he)
|
||||||
he:GetTransition("t2"):Play()
|
he:GetTransition("t2"):Play()
|
||||||
he:Center()
|
he:Center()
|
||||||
if _room.room_config.people_num==2 then
|
if _room.room_config.people_num == 2 then
|
||||||
if win_seat ~= _room.self_player.seat then
|
if win_seat ~= _room.self_player.seat then
|
||||||
he.scaleY = 0.4
|
he.scaleY = 0.4
|
||||||
he.scaleX = 0.4
|
he.scaleX = 0.4
|
||||||
|
|
@ -286,11 +283,11 @@ function M:EventInit()
|
||||||
|
|
||||||
|
|
||||||
---
|
---
|
||||||
local isZiMo=win_seat==lose_seat
|
local isZiMo = win_seat == lose_seat
|
||||||
DataManager.CurrenRoom.isZiMoHu=isZiMo
|
DataManager.CurrenRoom.isZiMoHu = isZiMo
|
||||||
local hu_sound = isZiMo and ("zimo"..math.random(1, 3)) or ("hu"..math.random(1, 2))
|
local hu_sound = isZiMo and ("zimo" .. math.random(1, 3)) or ("hu" .. math.random(1, 2))
|
||||||
printlog("声音====>>>",hu_sound)
|
printlog("声音====>>>", hu_sound)
|
||||||
self:PlaySound("GeJiu_MJ",player.self_user.sex, hu_sound)
|
self:PlaySound("GeJiu_MJ", player.self_user.sex, hu_sound)
|
||||||
|
|
||||||
local pNode = info._view
|
local pNode = info._view
|
||||||
local url = "eff_list1"
|
local url = "eff_list1"
|
||||||
|
|
@ -300,14 +297,13 @@ function M:EventInit()
|
||||||
he_list:Center()
|
he_list:Center()
|
||||||
|
|
||||||
coroutine.start(function()
|
coroutine.start(function()
|
||||||
for i = 1 ,#win_list do
|
for i = 1, #win_list do
|
||||||
local tem = win_list[i]
|
local tem = win_list[i]
|
||||||
if tem.type>0 and tem.type<32 then
|
if tem.type > 0 and tem.type < 32 then
|
||||||
local com_name = "he" .. tem.type
|
local com_name = "he" .. tem.type
|
||||||
local item = he_list:GetChild("list"):AddItemFromPool("ui://Extend_MJ_GeJiu/" .. com_name)
|
local item = he_list:GetChild("list"):AddItemFromPool("ui://Extend_MJ_GeJiu/" .. com_name)
|
||||||
coroutine.wait(0.3)
|
coroutine.wait(0.3)
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
coroutine.wait(2)
|
coroutine.wait(2)
|
||||||
|
|
@ -319,12 +315,12 @@ function M:EventInit()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
_gamectr:AddEventListener(TX_GameEvent.EventNiao, function(...)
|
_gamectr:AddEventListener(TX_GameEvent.EventNiao, function(...)
|
||||||
local arg = {...}
|
local arg = { ... }
|
||||||
self._popEvent = false
|
self._popEvent = false
|
||||||
local list = arg[1]
|
local list = arg[1]
|
||||||
local start_seat = arg[2]
|
local start_seat = arg[2]
|
||||||
-- ViewUtil.PlaySound("GeJiu_MJ", "extend/majiang/chaozhou/sound/zhuaniao.mp3")
|
-- ViewUtil.PlaySound("GeJiu_MJ", "extend/majiang/chaozhou/sound/zhuaniao.mp3")
|
||||||
coroutine.start(self.RunNiao,self,list, start_seat)
|
coroutine.start(self.RunNiao, self, list, start_seat)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
_gamectr:AddEventListener(TX_GameEvent.ZPResult1, function(...)
|
_gamectr:AddEventListener(TX_GameEvent.ZPResult1, function(...)
|
||||||
|
|
@ -333,7 +329,7 @@ function M:EventInit()
|
||||||
self._left_time = 0
|
self._left_time = 0
|
||||||
self:UpdateCardBox(0)
|
self:UpdateCardBox(0)
|
||||||
self._ctr_cardbox.selectedIndex = 0
|
self._ctr_cardbox.selectedIndex = 0
|
||||||
local arg = {...}
|
local arg = { ... }
|
||||||
local result = arg[1]
|
local result = arg[1]
|
||||||
local liuju = result.liuju
|
local liuju = result.liuju
|
||||||
local data = result.info_list
|
local data = result.info_list
|
||||||
|
|
@ -399,7 +395,7 @@ function M:EventInit()
|
||||||
self._left_time = 0
|
self._left_time = 0
|
||||||
self:UpdateCardBox(0)
|
self:UpdateCardBox(0)
|
||||||
self._ctr_cardbox.selectedIndex = 0
|
self._ctr_cardbox.selectedIndex = 0
|
||||||
local arg = {...}
|
local arg = { ... }
|
||||||
local total_result = arg[2]
|
local total_result = arg[2]
|
||||||
local result = arg[1]
|
local result = arg[1]
|
||||||
local over = arg[3]
|
local over = arg[3]
|
||||||
|
|
@ -420,7 +416,7 @@ function M:EventInit()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
_gamectr:AddEventListener(TX_GameEvent.EvnetPiao, function(...)
|
_gamectr:AddEventListener(TX_GameEvent.EvnetPiao, function(...)
|
||||||
local arg = {...}
|
local arg = { ... }
|
||||||
local seat = arg[1]
|
local seat = arg[1]
|
||||||
local num = arg[2]
|
local num = arg[2]
|
||||||
if num > 0 then
|
if num > 0 then
|
||||||
|
|
@ -440,7 +436,7 @@ end
|
||||||
|
|
||||||
function M:OutCard(card)
|
function M:OutCard(card)
|
||||||
if card ~= 0 then
|
if card ~= 0 then
|
||||||
printlog("当前出牌为===>>>"..card)
|
printlog("当前出牌为===>>>" .. card)
|
||||||
local _gamectr = ControllerManager.GetController(GameController)
|
local _gamectr = ControllerManager.GetController(GameController)
|
||||||
self._room.curren_outcard_seat = -1
|
self._room.curren_outcard_seat = -1
|
||||||
_gamectr:SendOutCard(card, function()
|
_gamectr:SendOutCard(card, function()
|
||||||
|
|
@ -449,12 +445,12 @@ function M:OutCard(card)
|
||||||
info:UpdateHandCard()
|
info:UpdateHandCard()
|
||||||
|
|
||||||
info:UpdateOutCardList(nil, card, self._cursor)
|
info:UpdateOutCardList(nil, card, self._cursor)
|
||||||
self:PlaySound("GeJiu_MJ", self._room.self_player.self_user.sex,tostring(card))
|
self:PlaySound("GeJiu_MJ", self._room.self_player.self_user.sex, tostring(card))
|
||||||
self:PlayMJSound("chupai.mp3")
|
self:PlayMJSound("chupai.mp3")
|
||||||
-- self:ShowHuTip()
|
-- self:ShowHuTip()
|
||||||
end)
|
end)
|
||||||
else
|
else
|
||||||
printlog("鬼牌不能出===>>>"..card)
|
printlog("鬼牌不能出===>>>" .. card)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -476,16 +472,16 @@ function M:__FangziTip(tip, weight)
|
||||||
local count = #_tlist
|
local count = #_tlist
|
||||||
table.sort(_tlist)
|
table.sort(_tlist)
|
||||||
local isHu = false
|
local isHu = false
|
||||||
for k=1,#_tlist do
|
for k = 1, #_tlist do
|
||||||
local td = tip.tip_map_type[_tlist[k]][1]
|
local td = tip.tip_map_type[_tlist[k]][1]
|
||||||
local url = "ui://Main_Majiang/Btn_fztip"
|
local url = "ui://Main_Majiang/Btn_fztip"
|
||||||
local td_weight = td.weight
|
local td_weight = td.weight
|
||||||
if td_weight == 16 then td_weight = 8 end
|
if td_weight == 16 then td_weight = 8 end
|
||||||
if td_weight == 8 then url = "ui://Main_Majiang/Btn_hu" end
|
if td_weight == 8 then url = "ui://Main_Majiang/Btn_hu" end
|
||||||
local btn_t = _lit_fanzi:AddItemFromPool(url)
|
local btn_t = _lit_fanzi:AddItemFromPool(url)
|
||||||
btn_t.icon = "ui://Main_Majiang/fztip_"..td_weight
|
btn_t.icon = "ui://Main_Majiang/fztip_" .. td_weight
|
||||||
btn_t.data = { tip, td }
|
btn_t.data = { tip, td }
|
||||||
btn_t.onClick:Add(self.__TipAction,self)
|
btn_t.onClick:Add(self.__TipAction, self)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- if not (tonumber(weight) >= 16) then
|
-- if not (tonumber(weight) >= 16) then
|
||||||
|
|
@ -544,7 +540,8 @@ function M:_ChiView(tiplist, callback)
|
||||||
local list_choose1 = _pop_tip_choice:GetChild("Lst_choose")
|
local list_choose1 = _pop_tip_choice:GetChild("Lst_choose")
|
||||||
local list_choose2 = _pop_tip_choice:GetChild("Lst_choose2")
|
local list_choose2 = _pop_tip_choice:GetChild("Lst_choose2")
|
||||||
local crossCtr = _pop_tip_choice:GetController("state")
|
local crossCtr = _pop_tip_choice:GetController("state")
|
||||||
crossCtr.selectedIndex = #tiplist == 3 and 0 or (#tiplist == 2 and 1 or (#tiplist == 4 and 2 or (#tiplist == 5 and 3 or 4)))
|
crossCtr.selectedIndex = #tiplist == 3 and 0 or
|
||||||
|
(#tiplist == 2 and 1 or (#tiplist == 4 and 2 or (#tiplist == 5 and 3 or 4)))
|
||||||
_pop_tip_choice:GetChild("Btn_cross").onClick:Add(function()
|
_pop_tip_choice:GetChild("Btn_cross").onClick:Add(function()
|
||||||
_pop_tip_choice:Dispose()
|
_pop_tip_choice:Dispose()
|
||||||
self._chipeng_tip.visible = true
|
self._chipeng_tip.visible = true
|
||||||
|
|
@ -557,7 +554,8 @@ function M:_ChiView(tiplist, callback)
|
||||||
item_choose:GetController("type").selectedIndex = (1 == tiplist[i].weight or 2 == tiplist[i].weight) and 1 or 0
|
item_choose:GetController("type").selectedIndex = (1 == tiplist[i].weight or 2 == tiplist[i].weight) and 1 or 0
|
||||||
if tiplist[i].weight ~= 1 then
|
if tiplist[i].weight ~= 1 then
|
||||||
for j = 1, 4 do
|
for j = 1, 4 do
|
||||||
item_choose:GetChild("card"..j).icon = UIPackage.GetItemURL("Main_Majiang", self:GetPrefix() .. "202_"..tiplist[i].card)
|
item_choose:GetChild("card" .. j).icon = UIPackage.GetItemURL("Main_Majiang",
|
||||||
|
self:GetPrefix() .. "202_" .. tiplist[i].card)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
local tem = {}
|
local tem = {}
|
||||||
|
|
@ -568,9 +566,12 @@ function M:_ChiView(tiplist, callback)
|
||||||
table.sort(tem, function(a, b)
|
table.sort(tem, function(a, b)
|
||||||
return a < b
|
return a < b
|
||||||
end)
|
end)
|
||||||
item_choose:GetChild("card1").icon = UIPackage.GetItemURL("Main_Majiang", self:GetPrefix() .. "202_"..tem[1])
|
item_choose:GetChild("card1").icon = UIPackage.GetItemURL("Main_Majiang", self:GetPrefix() .. "202_" ..
|
||||||
item_choose:GetChild("card2").icon = UIPackage.GetItemURL("Main_Majiang", self:GetPrefix() .. "202_"..tem[2])
|
tem[1])
|
||||||
item_choose:GetChild("card4").icon = UIPackage.GetItemURL("Main_Majiang", self:GetPrefix() .. "202_"..tem[3])
|
item_choose:GetChild("card2").icon = UIPackage.GetItemURL("Main_Majiang", self:GetPrefix() .. "202_" ..
|
||||||
|
tem[2])
|
||||||
|
item_choose:GetChild("card4").icon = UIPackage.GetItemURL("Main_Majiang", self:GetPrefix() .. "202_" ..
|
||||||
|
tem[3])
|
||||||
local cardpos = tem[2] > tcard and 1 or (tem[2] < tcard and 4 or 2)
|
local cardpos = tem[2] > tcard and 1 or (tem[2] < tcard and 4 or 2)
|
||||||
item_choose:GetChild("card" .. cardpos):GetController("color").selectedIndex = 1
|
item_choose:GetChild("card" .. cardpos):GetController("color").selectedIndex = 1
|
||||||
end
|
end
|
||||||
|
|
@ -578,14 +579,15 @@ function M:_ChiView(tiplist, callback)
|
||||||
callback(tiplist[i].id)
|
callback(tiplist[i].id)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
_pop_tip_choice.xy = Vector2((self._view.width - _pop_tip_choice.width)/2, (self._view.height - _pop_tip_choice.height)/2)
|
_pop_tip_choice.xy = Vector2((self._view.width - _pop_tip_choice.width) / 2,
|
||||||
|
(self._view.height - _pop_tip_choice.height) / 2)
|
||||||
self._view:AddChild(_pop_tip_choice)
|
self._view:AddChild(_pop_tip_choice)
|
||||||
self._pop_tip_choice = _pop_tip_choice
|
self._pop_tip_choice = _pop_tip_choice
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:OnFangziAction(...)
|
function M:OnFangziAction(...)
|
||||||
self:__CloseTip()
|
self:__CloseTip()
|
||||||
local arg = {...}
|
local arg = { ... }
|
||||||
local _player_card_info = self._player_card_info
|
local _player_card_info = self._player_card_info
|
||||||
local fz = arg[1]
|
local fz = arg[1]
|
||||||
local player = arg[2]
|
local player = arg[2]
|
||||||
|
|
@ -595,16 +597,16 @@ function M:OnFangziAction(...)
|
||||||
local pNode = info._mask_liangpai
|
local pNode = info._mask_liangpai
|
||||||
local effect = UIPackage.CreateObject("Extend_MJ_GeJiu", "FzEffect")
|
local effect = UIPackage.CreateObject("Extend_MJ_GeJiu", "FzEffect")
|
||||||
if fz.type == FZType.Peng then
|
if fz.type == FZType.Peng then
|
||||||
self:PlaySound("GeJiu_MJ", player.self_user.sex,"peng"..math.random(1, 3))
|
self:PlaySound("GeJiu_MJ", player.self_user.sex, "peng" .. math.random(1, 3))
|
||||||
effect:GetChild("word1").icon = UIPackage.GetItemURL("Main_Majiang", "碰")
|
effect:GetChild("word1").icon = UIPackage.GetItemURL("Main_Majiang", "碰")
|
||||||
effect:GetChild("word2").icon = UIPackage.GetItemURL("Main_Majiang", "碰")
|
effect:GetChild("word2").icon = UIPackage.GetItemURL("Main_Majiang", "碰")
|
||||||
-- effect:GetChild("kuang").icon = UIPackage.GetItemURL("Main_Majiang", "碰框")
|
-- effect:GetChild("kuang").icon = UIPackage.GetItemURL("Main_Majiang", "碰框")
|
||||||
elseif fz.type == FZType.Chi then
|
elseif fz.type == FZType.Chi then
|
||||||
self:PlaySound("GeJiu_MJ", player.self_user.sex,"chi"..math.random(1, 3))
|
self:PlaySound("GeJiu_MJ", player.self_user.sex, "chi" .. math.random(1, 3))
|
||||||
effect:GetChild("word1").icon = UIPackage.GetItemURL("Main_Majiang", "吃")
|
effect:GetChild("word1").icon = UIPackage.GetItemURL("Main_Majiang", "吃")
|
||||||
effect:GetChild("word2").icon = UIPackage.GetItemURL("Main_Majiang", "吃")
|
effect:GetChild("word2").icon = UIPackage.GetItemURL("Main_Majiang", "吃")
|
||||||
else
|
else
|
||||||
self:PlaySound("GeJiu_MJ", player.self_user.sex,"gang"..math.random(1, 2))
|
self:PlaySound("GeJiu_MJ", player.self_user.sex, "gang")
|
||||||
effect:GetChild("word1").icon = UIPackage.GetItemURL("Main_Majiang", "杠")
|
effect:GetChild("word1").icon = UIPackage.GetItemURL("Main_Majiang", "杠")
|
||||||
effect:GetChild("word2").icon = UIPackage.GetItemURL("Main_Majiang", "杠")
|
effect:GetChild("word2").icon = UIPackage.GetItemURL("Main_Majiang", "杠")
|
||||||
-- effect:GetChild("kuang").icon = UIPackage.GetItemURL("Main_Majiang", "杠框")
|
-- effect:GetChild("kuang").icon = UIPackage.GetItemURL("Main_Majiang", "杠框")
|
||||||
|
|
@ -636,7 +638,7 @@ end
|
||||||
function M:RunNiao(list, start_seat)
|
function M:RunNiao(list, start_seat)
|
||||||
local _room = self._room
|
local _room = self._room
|
||||||
--local _niao_View = self._niao_View
|
--local _niao_View = self._niao_View
|
||||||
self._niao_View = UIPackage.CreateObject("Extend_MJ_GeJiu","Panel_Birds")
|
self._niao_View = UIPackage.CreateObject("Extend_MJ_GeJiu", "Panel_Birds")
|
||||||
self._view:AddChild(self._niao_View)
|
self._view:AddChild(self._niao_View)
|
||||||
self._niao_View:Center()
|
self._niao_View:Center()
|
||||||
local _niao_View = self._niao_View
|
local _niao_View = self._niao_View
|
||||||
|
|
@ -654,7 +656,7 @@ function M:RunNiao(list, start_seat)
|
||||||
local card = list[i].card
|
local card = list[i].card
|
||||||
coroutine.wait(0.3)
|
coroutine.wait(0.3)
|
||||||
item:GetTransition("appear"):Play()
|
item:GetTransition("appear"):Play()
|
||||||
item.icon = UIPackage.GetItemURL("Main_Majiang", "201_"..card)
|
item.icon = UIPackage.GetItemURL("Main_Majiang", "201_" .. card)
|
||||||
if list[i].score > 0 then item:GetController("bg").selectedIndex = 1 end
|
if list[i].score > 0 then item:GetController("bg").selectedIndex = 1 end
|
||||||
end
|
end
|
||||||
coroutine.start(function()
|
coroutine.start(function()
|
||||||
|
|
@ -732,7 +734,7 @@ function M:ReloadRoom(bskip)
|
||||||
|
|
||||||
if p.seat == room.last_outcard_seat then
|
if p.seat == room.last_outcard_seat then
|
||||||
local card = p.outcard_list[#p.outcard_list]
|
local card = p.outcard_list[#p.outcard_list]
|
||||||
info:UpdateOutCardList(nil,card, self._cursor)
|
info:UpdateOutCardList(nil, card, self._cursor)
|
||||||
elseif p.seat == room.curren_outcard_seat then
|
elseif p.seat == room.curren_outcard_seat then
|
||||||
info:UpdateHandCard(true)
|
info:UpdateHandCard(true)
|
||||||
info:UpdateOutCardList()
|
info:UpdateOutCardList()
|
||||||
|
|
@ -750,7 +752,7 @@ function M:ReloadRoom(bskip)
|
||||||
self._player_info[self:GetPos(p.seat)]:Ready(true)
|
self._player_info[self:GetPos(p.seat)]:Ready(true)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if p.piao_niao~=nil and p.piao_niao > 0 then
|
if p.piao_niao ~= nil and p.piao_niao > 0 then
|
||||||
local head_info = self._player_info[self:GetPos(p.seat)]
|
local head_info = self._player_info[self:GetPos(p.seat)]
|
||||||
head_info._view:GetChild("mask_piao").title = "飘分 " .. p.piao_niao
|
head_info._view:GetChild("mask_piao").title = "飘分 " .. p.piao_niao
|
||||||
head_info._view:GetController("piao_niao").selectedIndex = 1
|
head_info._view:GetController("piao_niao").selectedIndex = 1
|
||||||
|
|
@ -796,7 +798,6 @@ function M:__CloseTip()
|
||||||
self._pop_tip_choice:Dispose()
|
self._pop_tip_choice:Dispose()
|
||||||
self._pop_tip_choice = nil
|
self._pop_tip_choice = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:__CloseGangTip()
|
function M:__CloseGangTip()
|
||||||
|
|
@ -806,8 +807,6 @@ function M:__CloseGangTip()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function M:closeTipOnTuoguan()
|
function M:closeTipOnTuoguan()
|
||||||
self:__CloseTip()
|
self:__CloseTip()
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -404,7 +404,7 @@ function M:EventInit()
|
||||||
---
|
---
|
||||||
local isZiMo = win_seat == lose_seat
|
local isZiMo = win_seat == lose_seat
|
||||||
DataManager.CurrenRoom.isZiMoHu = isZiMo
|
DataManager.CurrenRoom.isZiMoHu = isZiMo
|
||||||
local hu_sound = isZiMo and ("zimo" .. math.random(1, 3)) or ("hu" .. math.random(1, 2))
|
local hu_sound = isZiMo and ("zimo") or ("hu")
|
||||||
printlog("声音====>>>", hu_sound)
|
printlog("声音====>>>", hu_sound)
|
||||||
self:PlaySound("JinXi_MJ", player.self_user.sex, hu_sound)
|
self:PlaySound("JinXi_MJ", player.self_user.sex, hu_sound)
|
||||||
|
|
||||||
|
|
@ -420,6 +420,10 @@ function M:EventInit()
|
||||||
local tem = win_list[i]
|
local tem = win_list[i]
|
||||||
if tem.type > 0 and tem.type < 32 then
|
if tem.type > 0 and tem.type < 32 then
|
||||||
local com_name = "he" .. tem.type
|
local com_name = "he" .. tem.type
|
||||||
|
printlog("声音====>>>", com_name)
|
||||||
|
ViewUtil.PlaySound("JinXi_MJ",
|
||||||
|
string.format("extend/majiang/jinxi/sound/%s/%s.mp3", ViewUtil.Sex_Chat[player.self_user.sex],
|
||||||
|
com_name))
|
||||||
local item = he_list:GetChild("list"):AddItemFromPool("ui://Extend_MJ_JinXi/" .. com_name)
|
local item = he_list:GetChild("list"):AddItemFromPool("ui://Extend_MJ_JinXi/" .. com_name)
|
||||||
coroutine.wait(0.3)
|
coroutine.wait(0.3)
|
||||||
end
|
end
|
||||||
|
|
@ -803,16 +807,16 @@ function M:OnFangziAction(...)
|
||||||
-- local pNode = info._mask_liangpai
|
-- local pNode = info._mask_liangpai
|
||||||
local effect = UIPackage.CreateObject("Extend_MJ_JinXi", "FzEffect")
|
local effect = UIPackage.CreateObject("Extend_MJ_JinXi", "FzEffect")
|
||||||
if fz.type == FZType.Peng then
|
if fz.type == FZType.Peng then
|
||||||
self:PlaySound("JinXi_MJ", player.self_user.sex, "peng" .. math.random(1, 3))
|
self:PlaySound("FuZhou_MJ", player.self_user.sex, "peng")
|
||||||
effect:GetChild("word1").icon = UIPackage.GetItemURL("Main_Majiang", "碰")
|
effect:GetChild("word1").icon = UIPackage.GetItemURL("Main_Majiang", "碰")
|
||||||
effect:GetChild("word2").icon = UIPackage.GetItemURL("Main_Majiang", "碰")
|
effect:GetChild("word2").icon = UIPackage.GetItemURL("Main_Majiang", "碰")
|
||||||
-- effect:GetChild("kuang").icon = UIPackage.GetItemURL("Main_Majiang", "碰框")
|
-- effect:GetChild("kuang").icon = UIPackage.GetItemURL("Main_Majiang", "碰框")
|
||||||
elseif fz.type == FZType.Chi then
|
elseif fz.type == FZType.Chi then
|
||||||
self:PlaySound("JinXi_MJ", player.self_user.sex, "chi" .. math.random(1, 3))
|
self:PlaySound("JinXi_MJ", player.self_user.sex, "chi")
|
||||||
effect:GetChild("word1").icon = UIPackage.GetItemURL("Main_Majiang", "吃")
|
effect:GetChild("word1").icon = UIPackage.GetItemURL("Main_Majiang", "吃")
|
||||||
effect:GetChild("word2").icon = UIPackage.GetItemURL("Main_Majiang", "吃")
|
effect:GetChild("word2").icon = UIPackage.GetItemURL("Main_Majiang", "吃")
|
||||||
else
|
else
|
||||||
self:PlaySound("JinXi_MJ", player.self_user.sex, "gang" .. math.random(1, 2))
|
self:PlaySound("JinXi_MJ", player.self_user.sex, "gang")
|
||||||
effect:GetChild("word1").icon = UIPackage.GetItemURL("Main_Majiang", "杠")
|
effect:GetChild("word1").icon = UIPackage.GetItemURL("Main_Majiang", "杠")
|
||||||
effect:GetChild("word2").icon = UIPackage.GetItemURL("Main_Majiang", "杠")
|
effect:GetChild("word2").icon = UIPackage.GetItemURL("Main_Majiang", "杠")
|
||||||
-- effect:GetChild("kuang").icon = UIPackage.GetItemURL("Main_Majiang", "杠框")
|
-- effect:GetChild("kuang").icon = UIPackage.GetItemURL("Main_Majiang", "杠框")
|
||||||
|
|
|
||||||
|
|
@ -402,7 +402,7 @@ function M:EventInit()
|
||||||
---
|
---
|
||||||
local isZiMo = win_seat == lose_seat
|
local isZiMo = win_seat == lose_seat
|
||||||
DataManager.CurrenRoom.isZiMoHu = isZiMo
|
DataManager.CurrenRoom.isZiMoHu = isZiMo
|
||||||
local hu_sound = isZiMo and ("zimo" .. math.random(1, 3)) or ("hu" .. math.random(1, 2))
|
local hu_sound = isZiMo and ("zimo") or ("hu")
|
||||||
printlog("声音====>>>", hu_sound)
|
printlog("声音====>>>", hu_sound)
|
||||||
self:PlaySound("LiChuan_MJ", player.self_user.sex, hu_sound)
|
self:PlaySound("LiChuan_MJ", player.self_user.sex, hu_sound)
|
||||||
|
|
||||||
|
|
@ -418,6 +418,10 @@ function M:EventInit()
|
||||||
local tem = win_list[i]
|
local tem = win_list[i]
|
||||||
if tem.type > 0 and tem.type < 32 then
|
if tem.type > 0 and tem.type < 32 then
|
||||||
local com_name = "he" .. tem.type
|
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)
|
local item = he_list:GetChild("list"):AddItemFromPool("ui://Extend_MJ_LiChuan/" .. com_name)
|
||||||
coroutine.wait(0.3)
|
coroutine.wait(0.3)
|
||||||
end
|
end
|
||||||
|
|
@ -805,16 +809,16 @@ function M:OnFangziAction(...)
|
||||||
-- local pNode = info._mask_liangpai
|
-- local pNode = info._mask_liangpai
|
||||||
local effect = UIPackage.CreateObject("Extend_MJ_LiChuan", "FzEffect")
|
local effect = UIPackage.CreateObject("Extend_MJ_LiChuan", "FzEffect")
|
||||||
if fz.type == FZType.Peng then
|
if fz.type == FZType.Peng then
|
||||||
self:PlaySound("LiChuan_MJ", player.self_user.sex, "peng" .. math.random(1, 3))
|
self:PlaySound("FuZhou_MJ", player.self_user.sex, "peng")
|
||||||
effect:GetChild("word1").icon = UIPackage.GetItemURL("Main_Majiang", "碰")
|
effect:GetChild("word1").icon = UIPackage.GetItemURL("Main_Majiang", "碰")
|
||||||
effect:GetChild("word2").icon = UIPackage.GetItemURL("Main_Majiang", "碰")
|
effect:GetChild("word2").icon = UIPackage.GetItemURL("Main_Majiang", "碰")
|
||||||
-- effect:GetChild("kuang").icon = UIPackage.GetItemURL("Main_Majiang", "碰框")
|
-- effect:GetChild("kuang").icon = UIPackage.GetItemURL("Main_Majiang", "碰框")
|
||||||
elseif fz.type == FZType.Chi then
|
elseif fz.type == FZType.Chi then
|
||||||
self:PlaySound("LiChuan_MJ", player.self_user.sex, "chi" .. math.random(1, 3))
|
self:PlaySound("LiChuan_MJ", player.self_user.sex, "chi")
|
||||||
effect:GetChild("word1").icon = UIPackage.GetItemURL("Main_Majiang", "吃")
|
effect:GetChild("word1").icon = UIPackage.GetItemURL("Main_Majiang", "吃")
|
||||||
effect:GetChild("word2").icon = UIPackage.GetItemURL("Main_Majiang", "吃")
|
effect:GetChild("word2").icon = UIPackage.GetItemURL("Main_Majiang", "吃")
|
||||||
else
|
else
|
||||||
self:PlaySound("LiChuan_MJ", player.self_user.sex, "gang" .. math.random(1, 2))
|
self:PlaySound("LiChuan_MJ", player.self_user.sex, "gang")
|
||||||
effect:GetChild("word1").icon = UIPackage.GetItemURL("Main_Majiang", "杠")
|
effect:GetChild("word1").icon = UIPackage.GetItemURL("Main_Majiang", "杠")
|
||||||
effect:GetChild("word2").icon = UIPackage.GetItemURL("Main_Majiang", "杠")
|
effect:GetChild("word2").icon = UIPackage.GetItemURL("Main_Majiang", "杠")
|
||||||
-- effect:GetChild("kuang").icon = UIPackage.GetItemURL("Main_Majiang", "杠框")
|
-- effect:GetChild("kuang").icon = UIPackage.GetItemURL("Main_Majiang", "杠框")
|
||||||
|
|
|
||||||
|
|
@ -403,7 +403,7 @@ function M:EventInit()
|
||||||
---
|
---
|
||||||
local isZiMo = win_seat == lose_seat
|
local isZiMo = win_seat == lose_seat
|
||||||
DataManager.CurrenRoom.isZiMoHu = isZiMo
|
DataManager.CurrenRoom.isZiMoHu = isZiMo
|
||||||
local hu_sound = isZiMo and ("zimo" .. math.random(1, 3)) or ("hu" .. math.random(1, 2))
|
local hu_sound = isZiMo and ("zimo") or ("hu")
|
||||||
printlog("声音====>>>", hu_sound)
|
printlog("声音====>>>", hu_sound)
|
||||||
self:PlaySound("NanCheng_MJ", player.self_user.sex, hu_sound)
|
self:PlaySound("NanCheng_MJ", player.self_user.sex, hu_sound)
|
||||||
|
|
||||||
|
|
@ -419,6 +419,10 @@ function M:EventInit()
|
||||||
local tem = win_list[i]
|
local tem = win_list[i]
|
||||||
if tem.type > 0 and tem.type < 32 then
|
if tem.type > 0 and tem.type < 32 then
|
||||||
local com_name = "he" .. tem.type
|
local com_name = "he" .. tem.type
|
||||||
|
printlog("声音====>>>", com_name)
|
||||||
|
ViewUtil.PlaySound("NanCheng_MJ",
|
||||||
|
string.format("extend/majiang/nancheng/sound/%s/%s.mp3", ViewUtil.Sex_Chat[player.self_user.sex],
|
||||||
|
com_name))
|
||||||
local item = he_list:GetChild("list"):AddItemFromPool("ui://Extend_MJ_NanCheng/" .. com_name)
|
local item = he_list:GetChild("list"):AddItemFromPool("ui://Extend_MJ_NanCheng/" .. com_name)
|
||||||
print("lingmenghe", "ui://Extend_MJ_NanCheng/" .. com_name)
|
print("lingmenghe", "ui://Extend_MJ_NanCheng/" .. com_name)
|
||||||
coroutine.wait(0.3)
|
coroutine.wait(0.3)
|
||||||
|
|
@ -805,16 +809,16 @@ function M:OnFangziAction(...)
|
||||||
-- local pNode = info._mask_liangpai
|
-- local pNode = info._mask_liangpai
|
||||||
local effect = UIPackage.CreateObject("Extend_MJ_NanCheng", "FzEffect")
|
local effect = UIPackage.CreateObject("Extend_MJ_NanCheng", "FzEffect")
|
||||||
if fz.type == FZType.Peng then
|
if fz.type == FZType.Peng then
|
||||||
self:PlaySound("NanCheng_MJ", player.self_user.sex, "peng" .. math.random(1, 3))
|
self:PlaySound("FuZhou_MJ", player.self_user.sex, "peng")
|
||||||
effect:GetChild("word1").icon = UIPackage.GetItemURL("Main_Majiang", "碰")
|
effect:GetChild("word1").icon = UIPackage.GetItemURL("Main_Majiang", "碰")
|
||||||
effect:GetChild("word2").icon = UIPackage.GetItemURL("Main_Majiang", "碰")
|
effect:GetChild("word2").icon = UIPackage.GetItemURL("Main_Majiang", "碰")
|
||||||
-- effect:GetChild("kuang").icon = UIPackage.GetItemURL("Main_Majiang", "碰框")
|
-- effect:GetChild("kuang").icon = UIPackage.GetItemURL("Main_Majiang", "碰框")
|
||||||
elseif fz.type == FZType.Chi then
|
elseif fz.type == FZType.Chi then
|
||||||
self:PlaySound("NanCheng_MJ", player.self_user.sex, "chi" .. math.random(1, 3))
|
self:PlaySound("NanCheng_MJ", player.self_user.sex, "chi")
|
||||||
effect:GetChild("word1").icon = UIPackage.GetItemURL("Main_Majiang", "吃")
|
effect:GetChild("word1").icon = UIPackage.GetItemURL("Main_Majiang", "吃")
|
||||||
effect:GetChild("word2").icon = UIPackage.GetItemURL("Main_Majiang", "吃")
|
effect:GetChild("word2").icon = UIPackage.GetItemURL("Main_Majiang", "吃")
|
||||||
else
|
else
|
||||||
self:PlaySound("NanCheng_MJ", player.self_user.sex, "gang" .. math.random(1, 2))
|
self:PlaySound("NanCheng_MJ", player.self_user.sex, "gang")
|
||||||
effect:GetChild("word1").icon = UIPackage.GetItemURL("Main_Majiang", "杠")
|
effect:GetChild("word1").icon = UIPackage.GetItemURL("Main_Majiang", "杠")
|
||||||
effect:GetChild("word2").icon = UIPackage.GetItemURL("Main_Majiang", "杠")
|
effect:GetChild("word2").icon = UIPackage.GetItemURL("Main_Majiang", "杠")
|
||||||
-- effect:GetChild("kuang").icon = UIPackage.GetItemURL("Main_Majiang", "杠框")
|
-- effect:GetChild("kuang").icon = UIPackage.GetItemURL("Main_Majiang", "杠框")
|
||||||
|
|
|
||||||
|
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 86 KiB |
|
Before Width: | Height: | Size: 113 KiB After Width: | Height: | Size: 206 KiB |
|
Before Width: | Height: | Size: 117 KiB After Width: | Height: | Size: 210 KiB |
|
Before Width: | Height: | Size: 120 KiB After Width: | Height: | Size: 226 KiB |
|
Before Width: | Height: | Size: 111 KiB After Width: | Height: | Size: 198 KiB |
|
Before Width: | Height: | Size: 115 KiB After Width: | Height: | Size: 215 KiB |
|
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 87 KiB |
|
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 104 KiB |
|
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 90 KiB |
|
Before Width: | Height: | Size: 79 KiB After Width: | Height: | Size: 150 KiB |
|
Before Width: | Height: | Size: 70 KiB After Width: | Height: | Size: 125 KiB |
|
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 99 KiB |
|
Before Width: | Height: | Size: 57 KiB After Width: | Height: | Size: 100 KiB |
|
Before Width: | Height: | Size: 53 KiB After Width: | Height: | Size: 101 KiB |
|
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 84 KiB |
|
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 120 KiB |
|
Before Width: | Height: | Size: 174 KiB After Width: | Height: | Size: 329 KiB |
|
Before Width: | Height: | Size: 170 KiB After Width: | Height: | Size: 312 KiB |
|
Before Width: | Height: | Size: 165 KiB After Width: | Height: | Size: 311 KiB |
|
Before Width: | Height: | Size: 161 KiB After Width: | Height: | Size: 295 KiB |
|
Before Width: | Height: | Size: 183 KiB After Width: | Height: | Size: 346 KiB |
|
Before Width: | Height: | Size: 179 KiB After Width: | Height: | Size: 330 KiB |
|
Before Width: | Height: | Size: 61 KiB After Width: | Height: | Size: 110 KiB |
|
Before Width: | Height: | Size: 169 KiB After Width: | Height: | Size: 317 KiB |
|
Before Width: | Height: | Size: 164 KiB After Width: | Height: | Size: 300 KiB |
|
Before Width: | Height: | Size: 160 KiB After Width: | Height: | Size: 299 KiB |
|
Before Width: | Height: | Size: 156 KiB After Width: | Height: | Size: 282 KiB |
|
Before Width: | Height: | Size: 178 KiB After Width: | Height: | Size: 333 KiB |
|
Before Width: | Height: | Size: 173 KiB After Width: | Height: | Size: 318 KiB |
|
Before Width: | Height: | Size: 151 KiB After Width: | Height: | Size: 283 KiB |
|
Before Width: | Height: | Size: 143 KiB After Width: | Height: | Size: 266 KiB |
|
Before Width: | Height: | Size: 160 KiB After Width: | Height: | Size: 303 KiB |
|
Before Width: | Height: | Size: 146 KiB After Width: | Height: | Size: 271 KiB |
|
Before Width: | Height: | Size: 99 KiB After Width: | Height: | Size: 182 KiB |
|
Before Width: | Height: | Size: 138 KiB After Width: | Height: | Size: 254 KiB |
|
Before Width: | Height: | Size: 155 KiB After Width: | Height: | Size: 290 KiB |
|
Before Width: | Height: | Size: 94 KiB After Width: | Height: | Size: 176 KiB |
|
Before Width: | Height: | Size: 86 KiB After Width: | Height: | Size: 160 KiB |
|
Before Width: | Height: | Size: 103 KiB After Width: | Height: | Size: 196 KiB |
|
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 170 KiB |
|
Before Width: | Height: | Size: 129 KiB After Width: | Height: | Size: 278 KiB |
|
Before Width: | Height: | Size: 124 KiB After Width: | Height: | Size: 267 KiB |
|
Before Width: | Height: | Size: 60 KiB After Width: | Height: | Size: 107 KiB |
|
Before Width: | Height: | Size: 120 KiB After Width: | Height: | Size: 216 KiB |
|
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 86 KiB |
|
Before Width: | Height: | Size: 112 KiB After Width: | Height: | Size: 206 KiB |
|
Before Width: | Height: | Size: 117 KiB After Width: | Height: | Size: 210 KiB |
|
Before Width: | Height: | Size: 120 KiB After Width: | Height: | Size: 226 KiB |
|
Before Width: | Height: | Size: 111 KiB After Width: | Height: | Size: 198 KiB |
|
Before Width: | Height: | Size: 115 KiB After Width: | Height: | Size: 215 KiB |
|
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 87 KiB |
|
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 104 KiB |
|
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 90 KiB |
|
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 99 KiB |
|
Before Width: | Height: | Size: 61 KiB After Width: | Height: | Size: 110 KiB |
|
Before Width: | Height: | Size: 99 KiB After Width: | Height: | Size: 182 KiB |
|
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 170 KiB |
|
Before Width: | Height: | Size: 129 KiB After Width: | Height: | Size: 278 KiB |
|
Before Width: | Height: | Size: 124 KiB After Width: | Height: | Size: 267 KiB |
|
Before Width: | Height: | Size: 60 KiB After Width: | Height: | Size: 107 KiB |
|
Before Width: | Height: | Size: 120 KiB After Width: | Height: | Size: 216 KiB |
|
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 86 KiB |
|
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 110 KiB |
|
Before Width: | Height: | Size: 79 KiB After Width: | Height: | Size: 150 KiB |
|
Before Width: | Height: | Size: 70 KiB After Width: | Height: | Size: 125 KiB |
|
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 114 KiB |
|
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 99 KiB |
|
Before Width: | Height: | Size: 61 KiB After Width: | Height: | Size: 110 KiB |
|
Before Width: | Height: | Size: 99 KiB After Width: | Height: | Size: 182 KiB |
|
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 170 KiB |
|
Before Width: | Height: | Size: 60 KiB After Width: | Height: | Size: 107 KiB |
|
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 87 KiB |
|
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 104 KiB |
|
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 90 KiB |
|
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 86 KiB |
|
Before Width: | Height: | Size: 112 KiB After Width: | Height: | Size: 206 KiB |
|
Before Width: | Height: | Size: 117 KiB After Width: | Height: | Size: 210 KiB |
|
Before Width: | Height: | Size: 120 KiB After Width: | Height: | Size: 226 KiB |
|
Before Width: | Height: | Size: 111 KiB After Width: | Height: | Size: 198 KiB |
|
Before Width: | Height: | Size: 115 KiB After Width: | Height: | Size: 215 KiB |
|
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 87 KiB |
|
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 104 KiB |
|
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 90 KiB |
|
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 99 KiB |
|
Before Width: | Height: | Size: 61 KiB After Width: | Height: | Size: 110 KiB |
|
Before Width: | Height: | Size: 99 KiB After Width: | Height: | Size: 182 KiB |
|
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 170 KiB |
|
Before Width: | Height: | Size: 129 KiB After Width: | Height: | Size: 278 KiB |
|
Before Width: | Height: | Size: 124 KiB After Width: | Height: | Size: 267 KiB |