10.14
|
|
@ -4,23 +4,24 @@ local M = DismissRoomWindow
|
||||||
|
|
||||||
|
|
||||||
function DismissRoomWindow.new(blur_view)
|
function DismissRoomWindow.new(blur_view)
|
||||||
setmetatable(M, {__index = BaseWindow})
|
setmetatable(M, { __index = BaseWindow })
|
||||||
local self = setmetatable({}, {__index = M})
|
local self = setmetatable({}, { __index = M })
|
||||||
self.class = "DismissRoomWindow"
|
self.class = "DismissRoomWindow"
|
||||||
self._currenIndex = 0
|
self._currenIndex = 0
|
||||||
self._blur_view = blur_view
|
self._blur_view = blur_view
|
||||||
self._animation = false
|
self._animation = false
|
||||||
self.onCallback = event("onCallback",true)
|
self.onCallback = event("onCallback", true)
|
||||||
self._close_zone = false
|
self._close_zone = false
|
||||||
|
-- self._queue = false
|
||||||
self.time = 180
|
self.time = 180
|
||||||
self:init("ui://Common/dismiss_room")
|
self:init("ui://Common/dismiss_room")
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function M:init(url)
|
function M:init(url)
|
||||||
BaseWindow.init(self,url)
|
BaseWindow.init(self, url)
|
||||||
local view = self._view
|
local view = self._view
|
||||||
|
-- self._root_view.sortingOrder = 100
|
||||||
self.tex_time = view:GetChild("tex_time")
|
self.tex_time = view:GetChild("tex_time")
|
||||||
self.tex_time2 = view:GetChild("tex_time2")
|
self.tex_time2 = view:GetChild("tex_time2")
|
||||||
local _btn_aggree = view:GetChild("btn_aggree")
|
local _btn_aggree = view:GetChild("btn_aggree")
|
||||||
|
|
@ -55,26 +56,27 @@ function M:FillData(data)
|
||||||
self._view:GetChild("tex_tip").text = string.format("玩家\\[[color=#70401C]%s[/color]]申请解散房间", data.req_p.seat)
|
self._view:GetChild("tex_tip").text = string.format("玩家\\[[color=#70401C]%s[/color]]申请解散房间", data.req_p.seat)
|
||||||
else
|
else
|
||||||
--self._view:GetChild("tex_tip").text = string.format("[color=#ff9d02]【%s】[/color]发起了解散房间申请,是否同意?",data.req_p.self_user.nick_name)
|
--self._view:GetChild("tex_tip").text = string.format("[color=#ff9d02]【%s】[/color]发起了解散房间申请,是否同意?",data.req_p.self_user.nick_name)
|
||||||
self._view:GetChild("tex_tip").text = string.format("玩家\\[[color=#70401C]%s[/color]]申请解散房间", data.req_p.self_user.nick_name)
|
self._view:GetChild("tex_tip").text = string.format("玩家\\[[color=#70401C]%s[/color]]申请解散房间",
|
||||||
|
data.req_p.self_user.nick_name)
|
||||||
end
|
end
|
||||||
local ctr_falg = self._view:GetController("falg")
|
local ctr_falg = self._view:GetController("falg")
|
||||||
local lst_player = self._view:GetChild("lst_player")
|
local lst_player = self._view:GetChild("lst_player")
|
||||||
lst_player:RemoveChildrenToPool()
|
lst_player:RemoveChildrenToPool()
|
||||||
local list = data.list
|
local list = data.list
|
||||||
for i=1,#list do
|
for i = 1, #list do
|
||||||
local tem = list[i]
|
local tem = list[i]
|
||||||
if tem.player == DataManager.CurrenRoom.self_player then
|
if tem.player == DataManager.CurrenRoom.self_player then
|
||||||
ctr_falg.selectedIndex = tem.result
|
ctr_falg.selectedIndex = tem.result
|
||||||
end
|
end
|
||||||
-- elseif tem.player ~= data.req_p then
|
-- elseif tem.player ~= data.req_p then
|
||||||
local item = lst_player:AddItemFromPool()
|
local item = lst_player:AddItemFromPool()
|
||||||
if isHidden then
|
if isHidden then
|
||||||
item:GetChild("tex_name").text = "玩家\\[[color=#70401C]" .. tem.player.seat .. "[/color]]"
|
item:GetChild("tex_name").text = "玩家\\[[color=#70401C]" .. tem.player.seat .. "[/color]]"
|
||||||
else
|
else
|
||||||
item:GetChild("tex_name").text = "玩家\\[[color=#70401C]" .. tem.player.self_user.nick_name .. "[/color]]"
|
item:GetChild("tex_name").text = "玩家\\[[color=#70401C]" .. tem.player.self_user.nick_name .. "[/color]]"
|
||||||
end
|
end
|
||||||
local ctr_item_falg = item:GetController("falg")
|
local ctr_item_falg = item:GetController("falg")
|
||||||
ctr_item_falg.selectedIndex = tem.result
|
ctr_item_falg.selectedIndex = tem.result
|
||||||
-- end
|
-- end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
@ -82,11 +84,10 @@ end
|
||||||
function M:OnUpdate(deltaTime)
|
function M:OnUpdate(deltaTime)
|
||||||
if self.time > 0 then
|
if self.time > 0 then
|
||||||
self.time = self.time - deltaTime
|
self.time = self.time - deltaTime
|
||||||
self.time = math.max(0, self.time)
|
self.time = math.max(0, self.time)
|
||||||
end
|
end
|
||||||
self.tex_time.text = tostring(math.floor(self.time)) .. "s"
|
self.tex_time.text = tostring(math.floor(self.time)) .. "s"
|
||||||
self.tex_time2.text = tostring(math.floor(self.time))
|
self.tex_time2.text = tostring(math.floor(self.time))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
|
||||||
|
|
@ -599,6 +599,9 @@ end
|
||||||
function M:UpdateFamilyRoom(fgCtr, id)
|
function M:UpdateFamilyRoom(fgCtr, id)
|
||||||
local list_room = self._view:GetChild('list_room')
|
local list_room = self._view:GetChild('list_room')
|
||||||
list_room:SetVirtual()
|
list_room:SetVirtual()
|
||||||
|
local pane = list_room.scrollPane
|
||||||
|
pane.decelerationRate = 0.95 -- 惯性大
|
||||||
|
pane.bouncebackEffect = true
|
||||||
local playList = self._group.playList
|
local playList = self._group.playList
|
||||||
local roomList = self._group.rooms
|
local roomList = self._group.rooms
|
||||||
self._view:GetChild('n364').text = string.format("已开启%s桌游戏", #roomList)
|
self._view:GetChild('n364').text = string.format("已开启%s桌游戏", #roomList)
|
||||||
|
|
|
||||||
|
|
@ -52,8 +52,16 @@ function M:init(url)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
btn_sound.onClick:Add(function()
|
btn_sound.onClick:Add(function()
|
||||||
slider_sound.value = 0
|
if btn_sound.selected then
|
||||||
GameApplication.Instance.SoundValue = 0
|
local v = GameApplication.Instance.SoundValue
|
||||||
|
slider_sound.value = 0
|
||||||
|
GameApplication.Instance.SoundValue = 0
|
||||||
|
PlayerPrefs.SetInt('sound', v)
|
||||||
|
else
|
||||||
|
local v = PlayerPrefs.GetInt('sound')
|
||||||
|
slider_sound.value = v
|
||||||
|
GameApplication.Instance.SoundValue = v
|
||||||
|
end
|
||||||
GameApplication.Instance.SoundMute = btn_sound.selected;
|
GameApplication.Instance.SoundMute = btn_sound.selected;
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -65,8 +65,9 @@ function M:InitView(url)
|
||||||
|
|
||||||
local btn_authenticate = self._view:GetChild("btn_authenticate")
|
local btn_authenticate = self._view:GetChild("btn_authenticate")
|
||||||
btn_authenticate.onClick:Add(handler(self, function()
|
btn_authenticate.onClick:Add(handler(self, function()
|
||||||
local authenticateView = LobbyAuthenticateView.new()
|
-- local authenticateView = LobbyAuthenticateView.new()
|
||||||
authenticateView:Show()
|
-- authenticateView:Show()
|
||||||
|
ViewUtil.ErrorTip(-1, "该功能还会开放,敬请期待")
|
||||||
end))
|
end))
|
||||||
|
|
||||||
local btn_notice = self._view:GetChild("btn_notice")
|
local btn_notice = self._view:GetChild("btn_notice")
|
||||||
|
|
@ -564,7 +565,7 @@ function M:ReconnectRoom(groupId)
|
||||||
if response.ReturnCode ~= 0 then
|
if response.ReturnCode ~= 0 then
|
||||||
ViewUtil.ErrorMsg(self._root_view, response.ReturnCode, '进入房间失败')
|
ViewUtil.ErrorMsg(self._root_view, response.ReturnCode, '进入房间失败')
|
||||||
FamilyView.lastId = groupId
|
FamilyView.lastId = groupId
|
||||||
ViewManager.ChangeView(ViewManager.View_Family)
|
ViewManager.ChangeView(ViewManager.View_Lobby)
|
||||||
return
|
return
|
||||||
else
|
else
|
||||||
FamilyView.lastId = groupId
|
FamilyView.lastId = groupId
|
||||||
|
|
|
||||||
|
|
@ -1300,16 +1300,16 @@ function M:Missile(seat, targetSeat, Missile)
|
||||||
local url = ""
|
local url = ""
|
||||||
if Missile == "boom" then
|
if Missile == "boom" then
|
||||||
animUrl = "ui://Main_Majiang/bomb"
|
animUrl = "ui://Main_Majiang/bomb"
|
||||||
url = "ui://Common/boom"
|
url = "ui://Common/boom_move"
|
||||||
elseif Missile == "egg" then
|
elseif Missile == "egg" then
|
||||||
animUrl = "ui://Main_Majiang/egg"
|
animUrl = "ui://Main_Majiang/egg"
|
||||||
url = "ui://Common/egg"
|
url = "ui://Common/egg_move"
|
||||||
elseif Missile == "diamo" then
|
elseif Missile == "diamo" then
|
||||||
animUrl = "ui://Main_Majiang/jiezhi"
|
animUrl = "ui://Main_Majiang/jiezhi"
|
||||||
url = "ui://Common/diamo"
|
url = "ui://Common/diamo_move"
|
||||||
elseif Missile == "flower" then
|
elseif Missile == "flower" then
|
||||||
animUrl = "ui://Main_Majiang/flower"
|
animUrl = "ui://Main_Majiang/flower"
|
||||||
url = "ui://Common/flower"
|
url = "ui://Common/flower_move"
|
||||||
end
|
end
|
||||||
|
|
||||||
local send = self._player_info[self:GetPos(seat)]
|
local send = self._player_info[self:GetPos(seat)]
|
||||||
|
|
@ -1534,6 +1534,7 @@ function M:Destroy()
|
||||||
DSTweenManager.ClearTween()
|
DSTweenManager.ClearTween()
|
||||||
MissileSender.Clear()
|
MissileSender.Clear()
|
||||||
|
|
||||||
|
DataManager.SelfUser.room_id = ""
|
||||||
NetResetConnectWindow.CloseNetReset()
|
NetResetConnectWindow.CloseNetReset()
|
||||||
Voice.CrealRecord()
|
Voice.CrealRecord()
|
||||||
ControllerManager.resetJionRoom = false
|
ControllerManager.resetJionRoom = false
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ local function GetObj()
|
||||||
return re
|
return re
|
||||||
end
|
end
|
||||||
|
|
||||||
return UIPackage.CreateObjectFromURL("ui://Main_Majiang/Missile")
|
return UIPackage.CreateObjectFromURL("ui://Common/Missile")
|
||||||
end
|
end
|
||||||
|
|
||||||
local function BackObj(obj)
|
local function BackObj(obj)
|
||||||
|
|
@ -60,8 +60,9 @@ function MissileSender.Send(url, send, target, root, animUrl, Missile, num, time
|
||||||
obj:TweenMove(targetPos, time):OnComplete(function()
|
obj:TweenMove(targetPos, time):OnComplete(function()
|
||||||
BackObj(obj)
|
BackObj(obj)
|
||||||
--动画击中头像后播放击中的音效和动画
|
--动画击中头像后播放击中的音效和动画
|
||||||
root:PlayMJSound(string.format("%s.mp3", Missile))
|
ViewUtil.PlaySound("MissileSender", string.format("base/main_majiang/sound/%s.mp3", Missile))
|
||||||
local clip = UIPackage.CreateObjectFromURL(string.format("ui://Main_Majiang/%s", Missile))
|
|
||||||
|
local clip = UIPackage.CreateObjectFromURL(string.format("ui://Common/%s", Missile))
|
||||||
clip:SetSize(clipFather.width, clipFather.height)
|
clip:SetSize(clipFather.width, clipFather.height)
|
||||||
clipFather:AddChild(clip)
|
clipFather:AddChild(clip)
|
||||||
clip:SetPlaySettings(0, -1, 1, -1)
|
clip:SetPlaySettings(0, -1, 1, -1)
|
||||||
|
|
|
||||||
|
|
@ -165,6 +165,7 @@ end
|
||||||
|
|
||||||
function ViewManager.OnApplicationPause()
|
function ViewManager.OnApplicationPause()
|
||||||
print("game pause")
|
print("game pause")
|
||||||
|
|
||||||
if (_currenView ~= nil) then
|
if (_currenView ~= nil) then
|
||||||
_currenView:OnApplicationPause()
|
_currenView:OnApplicationPause()
|
||||||
end
|
end
|
||||||
|
|
@ -172,6 +173,7 @@ end
|
||||||
|
|
||||||
function ViewManager.OnApplicationActive()
|
function ViewManager.OnApplicationActive()
|
||||||
print("game active")
|
print("game active")
|
||||||
|
|
||||||
if (_currenView ~= nil) then
|
if (_currenView ~= nil) then
|
||||||
_currenView:OnApplicationActive()
|
_currenView:OnApplicationActive()
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -353,6 +353,7 @@ function M:fillResult1(room, peopleNum, total_result)
|
||||||
familyIDText.text = string.format("俱乐部:%s", room.group_id)
|
familyIDText.text = string.format("俱乐部:%s", room.group_id)
|
||||||
else
|
else
|
||||||
familyIDText.visible = false
|
familyIDText.visible = false
|
||||||
|
self._view:GetChild('n148').visible = false
|
||||||
end
|
end
|
||||||
self._view:GetChild("Text_RoundNum").text = string.format("局数:%s/%s", room.curren_round, room.room_config.round)
|
self._view:GetChild("Text_RoundNum").text = string.format("局数:%s/%s", room.curren_round, room.room_config.round)
|
||||||
self._view:GetChild("Text_Time").text = os.date("%Y-%m-%d %H:%M:%S", os.time())
|
self._view:GetChild("Text_Time").text = os.date("%Y-%m-%d %H:%M:%S", os.time())
|
||||||
|
|
|
||||||
|
|
@ -349,6 +349,7 @@ function M:fillResult1(room, peopleNum, total_result)
|
||||||
familyIDText.text = string.format("俱乐部:%s", room.group_id)
|
familyIDText.text = string.format("俱乐部:%s", room.group_id)
|
||||||
else
|
else
|
||||||
familyIDText.visible = false
|
familyIDText.visible = false
|
||||||
|
self._view:GetChild('n148').visible = false
|
||||||
end
|
end
|
||||||
self._view:GetChild("Text_RoundNum").text = string.format("局数:%s/%s", room.curren_round, room.room_config.round)
|
self._view:GetChild("Text_RoundNum").text = string.format("局数:%s/%s", room.curren_round, room.room_config.round)
|
||||||
self._view:GetChild("Text_Time").text = os.date("%Y-%m-%d %H:%M:%S", os.time())
|
self._view:GetChild("Text_Time").text = os.date("%Y-%m-%d %H:%M:%S", os.time())
|
||||||
|
|
|
||||||
|
|
@ -536,6 +536,15 @@ function M:EventInit()
|
||||||
self:PlayMJSound("end_music.mp3")
|
self:PlayMJSound("end_music.mp3")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
-- 扣分动画
|
||||||
|
if result then
|
||||||
|
for _, pScore in pairs(result.info_list) do
|
||||||
|
local infoView = self._player_info[self:GetPos(pScore.seat)]
|
||||||
|
infoView:UpdateScore(pScore.total_score, true)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
coroutine.wait(0.3)
|
||||||
|
|
||||||
coroutine.wait(0.5)
|
coroutine.wait(0.5)
|
||||||
self._clearingView:Show()
|
self._clearingView:Show()
|
||||||
self._popEvent = true
|
self._popEvent = true
|
||||||
|
|
|
||||||
|
|
@ -342,6 +342,7 @@ function M:fillResult1(room, peopleNum, total_result)
|
||||||
familyIDText.text = string.format("俱乐部:%s", room.group_id)
|
familyIDText.text = string.format("俱乐部:%s", room.group_id)
|
||||||
else
|
else
|
||||||
familyIDText.visible = false
|
familyIDText.visible = false
|
||||||
|
self._view:GetChild('n148').visible = false
|
||||||
end
|
end
|
||||||
self._view:GetChild("Text_RoundNum").text = string.format("局数:%s/%s", room.curren_round, room.room_config.round)
|
self._view:GetChild("Text_RoundNum").text = string.format("局数:%s/%s", room.curren_round, room.room_config.round)
|
||||||
self._view:GetChild("Text_Time").text = os.date("%Y-%m-%d %H:%M:%S", os.time())
|
self._view:GetChild("Text_Time").text = os.date("%Y-%m-%d %H:%M:%S", os.time())
|
||||||
|
|
|
||||||
|
|
@ -535,6 +535,15 @@ function M:EventInit()
|
||||||
self:PlayMJSound("end_music.mp3")
|
self:PlayMJSound("end_music.mp3")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
-- 扣分动画
|
||||||
|
if result then
|
||||||
|
for _, pScore in pairs(result.info_list) do
|
||||||
|
local infoView = self._player_info[self:GetPos(pScore.seat)]
|
||||||
|
infoView:UpdateScore(pScore.total_score, true)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
coroutine.wait(0.3)
|
||||||
|
|
||||||
coroutine.wait(0.5)
|
coroutine.wait(0.5)
|
||||||
self._clearingView:Show()
|
self._clearingView:Show()
|
||||||
self._popEvent = true
|
self._popEvent = true
|
||||||
|
|
|
||||||
|
|
@ -352,6 +352,7 @@ function M:fillResult1(room, peopleNum, total_result)
|
||||||
familyIDText.text = string.format("俱乐部:%s", room.group_id)
|
familyIDText.text = string.format("俱乐部:%s", room.group_id)
|
||||||
else
|
else
|
||||||
familyIDText.visible = false
|
familyIDText.visible = false
|
||||||
|
self._view:GetChild('n148').visible = false
|
||||||
end
|
end
|
||||||
self._view:GetChild("Text_RoundNum").text = string.format("局数:%s/%s", room.curren_round, room.room_config.round)
|
self._view:GetChild("Text_RoundNum").text = string.format("局数:%s/%s", room.curren_round, room.room_config.round)
|
||||||
self._view:GetChild("Text_Time").text = os.date("%Y-%m-%d %H:%M:%S", os.time())
|
self._view:GetChild("Text_Time").text = os.date("%Y-%m-%d %H:%M:%S", os.time())
|
||||||
|
|
|
||||||
|
|
@ -537,9 +537,11 @@ function M:EventInit()
|
||||||
end
|
end
|
||||||
|
|
||||||
-- 扣分动画
|
-- 扣分动画
|
||||||
for _, pScore in pairs(result.info_list) do
|
if result then
|
||||||
local infoView = self._player_info[self:GetPos(pScore.seat)]
|
for _, pScore in pairs(result.info_list) do
|
||||||
infoView:UpdateScore(pScore.total_score, true)
|
local infoView = self._player_info[self:GetPos(pScore.seat)]
|
||||||
|
infoView:UpdateScore(pScore.total_score, true)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
coroutine.wait(0.3)
|
coroutine.wait(0.3)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -405,7 +405,7 @@ function M:CheckOutCardGetTouchSet(cardSet, cardMap, cardType, longLength)
|
||||||
if lastCard - card == -1 then
|
if lastCard - card == -1 then
|
||||||
tempLong = tempLong + 1
|
tempLong = tempLong + 1
|
||||||
else
|
else
|
||||||
if tempLong >= longLength and not self._flag_mustMax then
|
if tempLong >= longLength and (cardType ~= 1 or longLength >= 5 or not self._flag_mustMax) then
|
||||||
for j = 1, tempLong do
|
for j = 1, tempLong do
|
||||||
table.insert(self.touchCardSet, tempCardSet[j])
|
table.insert(self.touchCardSet, tempCardSet[j])
|
||||||
self.touchCardMao[tempCardSet[j]] = 1
|
self.touchCardMao[tempCardSet[j]] = 1
|
||||||
|
|
@ -427,7 +427,7 @@ function M:CheckOutCardGetTouchSet(cardSet, cardMap, cardType, longLength)
|
||||||
end
|
end
|
||||||
if tempLong >= longLength then
|
if tempLong >= longLength then
|
||||||
for j = 1, tempLong do
|
for j = 1, tempLong do
|
||||||
if j == tempLong or not self._flag_mustMax then
|
if cardType ~= 1 or longLength >= 5 or not self._flag_mustMax or j == tempLong then
|
||||||
table.insert(self.touchCardSet, tempCardSet[j])
|
table.insert(self.touchCardSet, tempCardSet[j])
|
||||||
self.touchCardMao[tempCardSet[j]] = 1
|
self.touchCardMao[tempCardSet[j]] = 1
|
||||||
end
|
end
|
||||||
|
|
@ -456,7 +456,7 @@ function M:CheckOutCardSetTipList(tipCardSet, longLength, cardMap, cardType)
|
||||||
tempSanDaiCard[card] = true
|
tempSanDaiCard[card] = true
|
||||||
local minNum = Mathf.Min(cardMap[card].value, cardType)
|
local minNum = Mathf.Min(cardMap[card].value, cardType)
|
||||||
for k = 1, minNum do
|
for k = 1, minNum do
|
||||||
if not self._flag_mustMax or card == self.maxCard then
|
if cardType ~= 1 or longLength >= 5 or not self._flag_mustMax or card == self.maxCard then
|
||||||
table.insert(tempList, cardMap[card].cardList[k])
|
table.insert(tempList, cardMap[card].cardList[k])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
@ -490,7 +490,7 @@ function M:CheckOutCardSetTipList(tipCardSet, longLength, cardMap, cardType)
|
||||||
tempSanDaiCard[card] = true
|
tempSanDaiCard[card] = true
|
||||||
local minNum = Mathf.Min(cardMap[card].value, cardType)
|
local minNum = Mathf.Min(cardMap[card].value, cardType)
|
||||||
for l = 1, minNum do
|
for l = 1, minNum do
|
||||||
if not self._flag_mustMax or card == self.maxCard then
|
if cardType ~= 1 or longLength >= 5 or not self._flag_mustMax or card == self.maxCard then
|
||||||
table.insert(tempList, cardMap[card].cardList[l])
|
table.insert(tempList, cardMap[card].cardList[l])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -283,9 +283,27 @@ function M:OnChangeOption(ctype, pay_obj)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:LoadConfigToDetail(data)
|
function M:LoadConfigToDetail(data, hpdata)
|
||||||
local configData = json.decode(data)
|
local configData = data
|
||||||
local returnString = string.format("人数%s人", configData.maxPlayers)
|
if type(data) == 'string' then
|
||||||
|
configData = json.decode(data)
|
||||||
|
end
|
||||||
|
|
||||||
|
local hpData = configData.hpData or hpdata
|
||||||
|
if type(hpData) == 'string' then
|
||||||
|
if hpData == "null" then
|
||||||
|
hpData = nil
|
||||||
|
else
|
||||||
|
hpData = json.decode(hpData)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
local returnString = ""
|
||||||
|
|
||||||
|
if hpData then
|
||||||
|
returnString = string.format("%s倍,", hpData.times / 1000)
|
||||||
|
end
|
||||||
|
|
||||||
|
returnString = string.format("%s人数%s人", returnString, configData.maxPlayers)
|
||||||
if configData.leaf then
|
if configData.leaf then
|
||||||
returnString = string.format("%s,%s", returnString, configData.leaf == 1 and "十五张手牌" or "十六张手牌")
|
returnString = string.format("%s,%s", returnString, configData.leaf == 1 and "十五张手牌" or "十六张手牌")
|
||||||
end
|
end
|
||||||
|
|
@ -293,9 +311,6 @@ function M:LoadConfigToDetail(data)
|
||||||
returnString = string.format("%s%s", returnString,
|
returnString = string.format("%s%s", returnString,
|
||||||
configData.rule == 1 and ",黑桃三必出" or "")
|
configData.rule == 1 and ",黑桃三必出" or "")
|
||||||
end
|
end
|
||||||
if configData.showlength then
|
|
||||||
-- returnString = string.format("%s,%s", returnString, configData.zimo == 0 and "可点炮,可自摸" or "必须自摸")
|
|
||||||
end
|
|
||||||
if configData.planeNoBelt then
|
if configData.planeNoBelt then
|
||||||
returnString = string.format("%s%s", returnString, configData.planeNoBelt == 0 and "" or ",飞机可不带")
|
returnString = string.format("%s%s", returnString, configData.planeNoBelt == 0 and "" or ",飞机可不带")
|
||||||
end
|
end
|
||||||
|
|
@ -317,6 +332,9 @@ function M:LoadConfigToDetail(data)
|
||||||
if configData.specilAdd then
|
if configData.specilAdd then
|
||||||
returnString = string.format("%s%s", returnString, configData.specilAdd == 0 and "" or ",特殊加分")
|
returnString = string.format("%s%s", returnString, configData.specilAdd == 0 and "" or ",特殊加分")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
returnString = returnString .. IGameInfo.LoadConfigToDetail(self, configData, hpData)
|
||||||
|
|
||||||
return returnString
|
return returnString
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -133,9 +133,9 @@ function M:InitView(url)
|
||||||
self:UpdateRound(0)
|
self:UpdateRound(0)
|
||||||
|
|
||||||
--按钮功能全部未开放
|
--按钮功能全部未开放
|
||||||
self._view:GetChild('Btn_Spectator').onClick:Set(function()
|
-- self._view:GetChild('Btn_Spectator').onClick:Set(function()
|
||||||
ViewUtil.ErrorMsg(self._view, "", "该功能还未开放")
|
-- ViewUtil.ErrorMsg(self._view, "", "该功能还未开放")
|
||||||
end)
|
-- end)
|
||||||
self._view:GetChild('Btn_Invite').onClick:Set(function()
|
self._view:GetChild('Btn_Invite').onClick:Set(function()
|
||||||
ViewUtil.ErrorMsg(self._view, "", "该功能还未开放")
|
ViewUtil.ErrorMsg(self._view, "", "该功能还未开放")
|
||||||
end)
|
end)
|
||||||
|
|
|
||||||
|
|
@ -184,6 +184,7 @@ function M:OnInitCard(evt_data)
|
||||||
for _, player in ipairs(self._room.player_list) do
|
for _, player in ipairs(self._room.player_list) do
|
||||||
player:Clear()
|
player:Clear()
|
||||||
player.hand_count = #cardlist
|
player.hand_count = #cardlist
|
||||||
|
player.hand_list = cardlist
|
||||||
end
|
end
|
||||||
|
|
||||||
self._room.curren_round = round
|
self._room.curren_round = round
|
||||||
|
|
|
||||||
|
|
@ -210,12 +210,12 @@ function M:InitView(url)
|
||||||
|
|
||||||
self._cardCheck = RunFast_CardCheck:InitFlag()
|
self._cardCheck = RunFast_CardCheck:InitFlag()
|
||||||
self._gamectr._cardCheck = self._cardCheck
|
self._gamectr._cardCheck = self._cardCheck
|
||||||
self:UpdateRound(0)
|
self:UpdateRound(self._room.curren_round or 0)
|
||||||
|
|
||||||
--按钮功能全部未开放
|
--按钮功能全部未开放
|
||||||
self._view:GetChild('Btn_Spectator').onClick:Set(function()
|
-- self._view:GetChild('Btn_Spectator').onClick:Set(function()
|
||||||
ViewUtil.ErrorMsg(self._view, "", "该功能还未开放")
|
-- ViewUtil.ErrorMsg(self._view, "", "该功能还未开放")
|
||||||
end)
|
-- end)
|
||||||
-- self._view:GetChild('Btn_GamePlay').onClick:Set(function()
|
-- self._view:GetChild('Btn_GamePlay').onClick:Set(function()
|
||||||
-- ViewUtil.ErrorMsg(self._view, "", "该功能还未开放")
|
-- ViewUtil.ErrorMsg(self._view, "", "该功能还未开放")
|
||||||
-- end)
|
-- end)
|
||||||
|
|
@ -240,6 +240,24 @@ function M:InitView(url)
|
||||||
--闹钟倒计时报时
|
--闹钟倒计时报时
|
||||||
self._leftTime_xiangling = 5
|
self._leftTime_xiangling = 5
|
||||||
self._leftTime_bianhong = true
|
self._leftTime_bianhong = true
|
||||||
|
|
||||||
|
local btn_witness = self._view:GetChild('btn_pangGuang')
|
||||||
|
if btn_witness then
|
||||||
|
btn_witness.onClick:Set(function()
|
||||||
|
self._view:GetController('witness').selectedIndex = 1
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
----------屏幕大小发生变化
|
||||||
|
GRoot.inst.onSizeChanged:Set(function()
|
||||||
|
for _, player in ipairs(self._room.player_list) do
|
||||||
|
local player_card_info = self._player_card_info[self:GetPos(player.seat)]
|
||||||
|
|
||||||
|
if player.seat == self._room.self_player.seat then
|
||||||
|
player_card_info:InitPoker(player.hand_list, false)
|
||||||
|
else
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:UpdateCard(index)
|
function M:UpdateCard(index)
|
||||||
|
|
@ -509,13 +527,14 @@ function M:EventInit()
|
||||||
-- body
|
-- body
|
||||||
head_info._view:GetChild("shengyu").text = p.hand_count
|
head_info._view:GetChild("shengyu").text = p.hand_count
|
||||||
end
|
end
|
||||||
p:Clear()
|
-- p:Clear()
|
||||||
head_info:MarkBank(p.seat == _room.banker_seat)
|
head_info:MarkBank(p.seat == _room.banker_seat)
|
||||||
head_info:FillData(p)
|
head_info:FillData(p)
|
||||||
local card_info = self._player_card_info[self:GetPos(p.seat)]
|
local card_info = self._player_card_info[self:GetPos(p.seat)]
|
||||||
card_info:Clear()
|
card_info:Clear()
|
||||||
head_info:Ready(false)
|
head_info:Ready(false)
|
||||||
|
|
||||||
|
|
||||||
if p.seat == self._room.self_player.seat then
|
if p.seat == self._room.self_player.seat then
|
||||||
if self._room.room_config.people_num == 3 and self._room.room_config.fangzuobi == 1 then
|
if self._room.room_config.people_num == 3 and self._room.room_config.fangzuobi == 1 then
|
||||||
-- body
|
-- body
|
||||||
|
|
@ -567,6 +586,7 @@ function M:EventInit()
|
||||||
-- end
|
-- end
|
||||||
self._leftClock_continue = coroutine.start(function()
|
self._leftClock_continue = coroutine.start(function()
|
||||||
coroutine.wait(0.2)
|
coroutine.wait(0.2)
|
||||||
|
card_info:SetOutCardInfo(nil, false)
|
||||||
for i = 1, #self._player_card_info do
|
for i = 1, #self._player_card_info do
|
||||||
local card_info = self._player_card_info[i]
|
local card_info = self._player_card_info[i]
|
||||||
if i == index then
|
if i == index then
|
||||||
|
|
@ -609,7 +629,7 @@ function M:EventInit()
|
||||||
|
|
||||||
_gamectr:AddEventListener(RunFast_GameEvent.OnPlaySucc, function(...)
|
_gamectr:AddEventListener(RunFast_GameEvent.OnPlaySucc, function(...)
|
||||||
ViewUtil.PlaySound("RunFastNew_PK", "extend/poker/runfast/sound/playcard_chup.mp3")
|
ViewUtil.PlaySound("RunFastNew_PK", "extend/poker/runfast/sound/playcard_chup.mp3")
|
||||||
self._popEvent = false
|
-- self._popEvent = false
|
||||||
local arg = { ... }
|
local arg = { ... }
|
||||||
local p = arg[1]
|
local p = arg[1]
|
||||||
local card_number = arg[2]
|
local card_number = arg[2]
|
||||||
|
|
@ -803,7 +823,7 @@ function M:EventInit()
|
||||||
local m = false
|
local m = false
|
||||||
local next_seat = self._room.self_player.seat + 1
|
local next_seat = self._room.self_player.seat + 1
|
||||||
local card_info = self._player_card_info[1]
|
local card_info = self._player_card_info[1]
|
||||||
--card_info:SetOutCardInfo(nil, false)
|
card_info:SetOutCardInfo(nil, false)
|
||||||
if self.MypokerList ~= nil then
|
if self.MypokerList ~= nil then
|
||||||
-- body
|
-- body
|
||||||
card_info:Clear()
|
card_info:Clear()
|
||||||
|
|
@ -818,7 +838,6 @@ function M:EventInit()
|
||||||
end
|
end
|
||||||
local zdts = self._view:GetController("zidongtishi").selectedIndex
|
local zdts = self._view:GetController("zidongtishi").selectedIndex
|
||||||
-- self._player_card_info[1]._cardCheck:InitLastCard(lastCardList)
|
-- self._player_card_info[1]._cardCheck:InitLastCard(lastCardList)
|
||||||
card_info:SetOutCardInfo(nil, false)
|
|
||||||
-- self._player_card_info[1]:ShowOutCardOption(ctr_number, card_type, card_number, card_length, m, play, zdts)
|
-- self._player_card_info[1]:ShowOutCardOption(ctr_number, card_type, card_number, card_length, m, play, zdts)
|
||||||
card_info:ShowOutCardOption2(lastCardList, ctr_number, m)
|
card_info:ShowOutCardOption2(lastCardList, ctr_number, m)
|
||||||
end)
|
end)
|
||||||
|
|
@ -1105,26 +1124,7 @@ function M:ReConnectForStart()
|
||||||
local head_info = self._player_info[self:GetPos(player.seat)]
|
local head_info = self._player_info[self:GetPos(player.seat)]
|
||||||
head_info:Ready(false)
|
head_info:Ready(false)
|
||||||
|
|
||||||
--如果是体力值不可负分模式 则显示当前的hp值
|
head_info:UpdateScore(player.total_score)
|
||||||
if player.hp_info ~= nil and player.hp_info.cur_hp ~= nil then
|
|
||||||
head_info:UpdateScore(d2ad(player.hp_info.cur_hp))
|
|
||||||
head_info._view:GetChild('zhanji').visible = true
|
|
||||||
local num = player.hp_info.total_hp
|
|
||||||
if num > 0 then
|
|
||||||
head_info._view:GetController('text_color').selectedIndex = 0
|
|
||||||
head_info._view:GetChild('text_jifen').text = '+' .. d2ad(player.hp_info.total_hp)
|
|
||||||
else
|
|
||||||
head_info._view:GetController('text_color').selectedIndex = 1
|
|
||||||
head_info._view:GetChild('text_jifen').text = d2ad(player.hp_info.total_hp)
|
|
||||||
end
|
|
||||||
else
|
|
||||||
local rt = 1
|
|
||||||
if self._room.hpOnOff == 1 then
|
|
||||||
rt = self._room.score_times
|
|
||||||
end
|
|
||||||
head_info:UpdateScore(player.total_score * rt)
|
|
||||||
end
|
|
||||||
|
|
||||||
head_info:UpdateLineState(player.line_state)
|
head_info:UpdateLineState(player.line_state)
|
||||||
head_info:UpdatePiao(player.piao)
|
head_info:UpdatePiao(player.piao)
|
||||||
head_info:SetBaoDan(player.hand_count == 1)
|
head_info:SetBaoDan(player.hand_count == 1)
|
||||||
|
|
@ -1158,16 +1158,16 @@ function M:ReConnectForStart()
|
||||||
-- self.bgm_index = 2
|
-- self.bgm_index = 2
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if self._room.curren_turn_seat ~= player.seat then
|
if self._room.curren_turn_seat == player.seat then
|
||||||
-- head_info:MarkBank(false)
|
-- head_info:MarkBank(false)
|
||||||
player_card_info._ctr_time_clock.selectedIndex = 1
|
player_card_info._ctr_time_clock.selectedIndex = 1
|
||||||
self._tex_leftTime = player_card_info._view_comp_clock
|
self._tex_leftTime = player_card_info._view_comp_clock
|
||||||
self._left_time = 15
|
self._left_time = 15
|
||||||
if player.out_card_list[1] == 0 then
|
-- if player.out_card_list[1] == 0 then
|
||||||
player_card_info:SetOutCardInfo(nil, false)
|
player_card_info:SetOutCardInfo(nil, false)
|
||||||
else
|
-- else
|
||||||
player_card_info:SetOutCardInfo(player.out_card_list, false)
|
-- player_card_info:SetOutCardInfo(player.out_card_list, false)
|
||||||
end
|
-- end
|
||||||
else
|
else
|
||||||
-- head_info:MarkBank(true)
|
-- head_info:MarkBank(true)
|
||||||
end
|
end
|
||||||
|
|
@ -1611,6 +1611,9 @@ function M:Destroy()
|
||||||
coroutine.stop(card_info_i.cor_init_poker)
|
coroutine.stop(card_info_i.cor_init_poker)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
GRoot.inst.onSizeChanged:Set(function()
|
||||||
|
|
||||||
|
end)
|
||||||
PKMainView.Destroy(self)
|
PKMainView.Destroy(self)
|
||||||
UIPackage.RemovePackage("extend/poker/runfast/ui/Extend_Poker_RunFastNew")
|
UIPackage.RemovePackage("extend/poker/runfast/ui/Extend_Poker_RunFastNew")
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -233,15 +233,11 @@ function M:InitPoker(pokerList, isPlayAni, open)
|
||||||
-- local btn_card = self:CreatPoker(card_number_code, cs, open)
|
-- local btn_card = self:CreatPoker(card_number_code, cs, open)
|
||||||
local btn_card = self._view_handCard:AddItemFromPool()
|
local btn_card = self._view_handCard:AddItemFromPool()
|
||||||
self:FillPoker(btn_card, "", card_number_code)
|
self:FillPoker(btn_card, "", card_number_code)
|
||||||
-- local x, y = self._view.width / 2 + 100, -200
|
|
||||||
-- btn_card:SetXY(x, y)
|
|
||||||
btn_card.alpha = 0
|
btn_card.alpha = 0
|
||||||
btn_card.touchable = false
|
btn_card.touchable = false
|
||||||
-- coroutine.wait(0.05)
|
|
||||||
-- self.cards_view:AddChild(btn_card)
|
|
||||||
local card_view = NewCardView(btn_card, card_number_code, card_flower_code)
|
local card_view = NewCardView(btn_card, card_number_code, card_flower_code)
|
||||||
self.card_list[#self.card_list + 1] = card_view
|
self.card_list[#self.card_list + 1] = card_view
|
||||||
|
btn_card.data = card_view
|
||||||
self:AddTouchMoveEvent(self._view_handCard)
|
self:AddTouchMoveEvent(self._view_handCard)
|
||||||
|
|
||||||
if i == #pokerList then
|
if i == #pokerList then
|
||||||
|
|
@ -256,10 +252,8 @@ function M:InitPoker(pokerList, isPlayAni, open)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
for j = #self.card_list, 1, -1 do
|
for j = #self.card_list, 1, -1 do
|
||||||
-- ViewUtil.PlaySound('RunFastNew_PK', 'extend/poker/runfast/sound/mopai.mp3')
|
|
||||||
local card_view = self.card_list[j]
|
local card_view = self.card_list[j]
|
||||||
card_view.index = j
|
card_view.index = j
|
||||||
-- self.cards_view:SetChildIndex(card_view.btn_card, card_view.index - 1)
|
|
||||||
|
|
||||||
card_view.btn_card:TweenMove(self:GetHandCardPos(j, #self.card_list), 0.10)
|
card_view.btn_card:TweenMove(self:GetHandCardPos(j, #self.card_list), 0.10)
|
||||||
DSTween.To(
|
DSTween.To(
|
||||||
|
|
@ -296,15 +290,13 @@ function M:InitPoker(pokerList, isPlayAni, open)
|
||||||
-- self.cards_view:AddChild(btn_card)
|
-- self.cards_view:AddChild(btn_card)
|
||||||
local card_view = NewCardView(btn_card, card_number_code, card_flower_code)
|
local card_view = NewCardView(btn_card, card_number_code, card_flower_code)
|
||||||
self.card_list[#self.card_list + 1] = card_view
|
self.card_list[#self.card_list + 1] = card_view
|
||||||
|
btn_card.data = card_view
|
||||||
btn_card.width = (GRoot.inst.width * 0.95 - self._view_handCard.columnGap * 15) / 16
|
btn_card.width = (GRoot.inst.width * 0.95 - self._view_handCard.columnGap * 15) / 16
|
||||||
end
|
end
|
||||||
table.sort(self.card_list, tableSortNumber)
|
table.sort(self.card_list, tableSortNumber)
|
||||||
self:AddTouchMoveEvent(self._view_handCard)
|
self:AddTouchMoveEvent(self._view_handCard)
|
||||||
for i = 1, #self.card_list do
|
for i = 1, #self.card_list do
|
||||||
local card = self.card_list[i]
|
local card = self.card_list[i]
|
||||||
-- card.index = i
|
|
||||||
-- self.cards_view:SetChildIndex(card.btn_card, card.index - 1)
|
|
||||||
-- card.btn_card.xy = self:GetHandCardPos(i, #self.card_list)
|
|
||||||
if open ~= 1 then
|
if open ~= 1 then
|
||||||
-- body
|
-- body
|
||||||
self:AddCardTouchEvent(card)
|
self:AddCardTouchEvent(card)
|
||||||
|
|
@ -321,114 +313,6 @@ function M:updatePoker()
|
||||||
self:InitPoker(templist, false, 0)
|
self:InitPoker(templist, false, 0)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- function M:AddCardMoveEvent(card)
|
|
||||||
-- local send_card = {}
|
|
||||||
|
|
||||||
-- card.btn_card.onTouchBegin:Set(
|
|
||||||
-- function(context)
|
|
||||||
-- self.send_card = {}
|
|
||||||
-- if card.btn_card.touchable == false then
|
|
||||||
-- return
|
|
||||||
-- end
|
|
||||||
-- local fristCard = self._view_handCard:GetChildAt(0)
|
|
||||||
-- local CardWidth = fristCard.width
|
|
||||||
-- local columnGap = self._view_handCard.columnGap
|
|
||||||
-- local oneCardWidth = CardWidth - columnGap
|
|
||||||
-- local xy = fristCard:GlobalToLocal(Vector2.New(context.inputEvent.x, context.inputEvent.y))
|
|
||||||
-- -- if xy.y > -21 and xy.y < 316 then
|
|
||||||
-- self.touchBegin = xy
|
|
||||||
-- Stage.inst.onTouchMove:Add(self.touchMoveFun)
|
|
||||||
-- --Stage.inst.onClick:Add(self.touchMoveFun)
|
|
||||||
-- card.btn_card.onTouchEnd:Set(
|
|
||||||
-- function(context)
|
|
||||||
-- local downCards = #self.card_list
|
|
||||||
-- local xy = fristCard:GlobalToLocal(Vector2.New(context.inputEvent.x, context.inputEvent.y))
|
|
||||||
-- Stage.inst.onTouchMove:Remove(self.touchMoveFun)
|
|
||||||
-- --Stage.inst.onClick:onTouchMove(self.touchMoveFun)
|
|
||||||
-- -- if xy.y > -21 and xy.y < 316 then
|
|
||||||
-- local max_x
|
|
||||||
-- local min_x
|
|
||||||
-- if xy.x - self.touchBegin.x > 0 then
|
|
||||||
-- max_x = xy.x
|
|
||||||
-- min_x = self.touchBegin.x
|
|
||||||
-- else
|
|
||||||
-- max_x = self.touchBegin.x
|
|
||||||
-- min_x = xy.x
|
|
||||||
-- end
|
|
||||||
|
|
||||||
-- for k = 1, #self.card_list do
|
|
||||||
-- local card = self.card_list[k]
|
|
||||||
-- if not card.btn_card.selected then
|
|
||||||
-- downCards = downCards - 1
|
|
||||||
-- end
|
|
||||||
-- -- for i = 1, #self.card_list do
|
|
||||||
-- -- local card = self.card_list[i]
|
|
||||||
-- -- if card.btn_card.selected then
|
|
||||||
-- -- send_card[#send_card + 1] = card.card_code_flower
|
|
||||||
-- -- self.send_card[#self.send_card + 1] = card
|
|
||||||
-- -- end
|
|
||||||
-- -- end
|
|
||||||
-- if card.btn_card.touchable == true then
|
|
||||||
-- send_card[#send_card + 1] = card
|
|
||||||
|
|
||||||
-- self:SetBtnCardColor(card, 0)
|
|
||||||
-- -- if k == #self.card_list then
|
|
||||||
-- -- if
|
|
||||||
-- -- card.btn_card.x + self.card_width > min_x and card.btn_card.x < max_x and
|
|
||||||
-- -- card.card_isTouchable == 0
|
|
||||||
-- -- then
|
|
||||||
-- -- self:UpdateCardMove(card.btn_card, not card.btn_card.selected, false)
|
|
||||||
-- -- --ViewUtil.PlaySound("RunFastNew_PK", "extend/poker/paodekuai/sound/click.mp3")
|
|
||||||
-- -- end
|
|
||||||
-- -- else
|
|
||||||
-- -- if
|
|
||||||
-- -- card.btn_card.x +
|
|
||||||
-- -- (self.card_width + self:GetHandCardOffset(#self.card_list)) >
|
|
||||||
-- -- min_x and
|
|
||||||
-- -- card.btn_card.x < max_x and
|
|
||||||
-- -- card.card_isTouchable == 0
|
|
||||||
-- -- then
|
|
||||||
-- -- self:UpdateCardMove(card.btn_card, not card.btn_card.selected, false)
|
|
||||||
-- -- --ViewUtil.PlaySound("RunFastNew_PK", "extend/poker/paodekuai/sound/click.mp3")
|
|
||||||
-- -- end
|
|
||||||
-- -- end
|
|
||||||
-- if
|
|
||||||
-- (card.btn_card.x + oneCardWidth > min_x or (k == #self.card_list and card.btn_card.x + CardWidth > min_x))
|
|
||||||
-- and card.btn_card.x < max_x and card.card_isTouchable == 0
|
|
||||||
-- then
|
|
||||||
-- self:UpdateCardMove(card.btn_card, not card.btn_card.selected, false)
|
|
||||||
-- --ViewUtil.PlaySound("RunFastNew_PK", "extend/poker/paodekuai/sound/click.mp3")
|
|
||||||
-- end
|
|
||||||
-- end
|
|
||||||
-- end
|
|
||||||
|
|
||||||
-- ViewUtil.PlaySound('RunFastNew_PK', 'extend/poker/runfast/sound/click.mp3')
|
|
||||||
|
|
||||||
-- Stage.inst:ResetInputState()
|
|
||||||
-- card.btn_card.onTouchEnd:Set(nil)
|
|
||||||
|
|
||||||
-- if downCards == 0 then
|
|
||||||
-- self:zhizhanxuanpai()
|
|
||||||
-- end
|
|
||||||
-- end
|
|
||||||
-- )
|
|
||||||
-- -- else
|
|
||||||
-- -- local button = card.btn_card
|
|
||||||
-- -- button.onChanged:Add(
|
|
||||||
-- -- function()
|
|
||||||
-- -- -- body
|
|
||||||
-- -- if card.btn_card.selected == true then
|
|
||||||
-- -- self:UpdateCardMove(card.btn_card, not card.btn_card.selected, false)
|
|
||||||
-- -- else
|
|
||||||
-- -- self:UpdateCardMove(card.btn_card, card.btn_card.selected, false)
|
|
||||||
-- -- end
|
|
||||||
-- -- end
|
|
||||||
-- -- )
|
|
||||||
-- -- end
|
|
||||||
-- end
|
|
||||||
-- )
|
|
||||||
-- end
|
|
||||||
|
|
||||||
function M:AddTouchMoveEvent(list)
|
function M:AddTouchMoveEvent(list)
|
||||||
local send_card = {}
|
local send_card = {}
|
||||||
|
|
||||||
|
|
@ -447,20 +331,6 @@ function M:AddTouchMoveEvent(list)
|
||||||
self.touchBegin = xy
|
self.touchBegin = xy
|
||||||
Stage.inst.onTouchMove:Add(self.touchMoveFun)
|
Stage.inst.onTouchMove:Add(self.touchMoveFun)
|
||||||
Stage.inst.onTouchEnd:Add(self.touchMoveEndFun)
|
Stage.inst.onTouchEnd:Add(self.touchMoveEndFun)
|
||||||
--Stage.inst.onClick:Add(self.touchMoveFun)
|
|
||||||
-- else
|
|
||||||
-- local button = card.btn_card
|
|
||||||
-- button.onChanged:Add(
|
|
||||||
-- function()
|
|
||||||
-- -- body
|
|
||||||
-- if card.btn_card.selected == true then
|
|
||||||
-- self:UpdateCardMove(card.btn_card, not card.btn_card.selected, false)
|
|
||||||
-- else
|
|
||||||
-- self:UpdateCardMove(card.btn_card, card.btn_card.selected, false)
|
|
||||||
-- end
|
|
||||||
-- end
|
|
||||||
-- )
|
|
||||||
-- end
|
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
@ -476,60 +346,6 @@ function M:AddCardTouchEvent(card)
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- function M:zhizhanxuanpai() --智障选牌
|
|
||||||
-- print("lingmengxuan", #self.send_card)
|
|
||||||
-- -- body
|
|
||||||
-- local temp_send_card = {}
|
|
||||||
-- for i = 1, #self.send_card do
|
|
||||||
-- if self.send_card[i] ~= self.send_card[i - 1] then
|
|
||||||
-- -- body
|
|
||||||
-- temp_send_card[#temp_send_card + 1] = self.send_card[i]
|
|
||||||
-- end
|
|
||||||
-- end
|
|
||||||
|
|
||||||
-- local card_map, max_key = self:GetCardMapAndMaxKey(temp_send_card)
|
|
||||||
|
|
||||||
-- list_type1, touch_type1 = self:CheckPairs(card_map, 0, 8)
|
|
||||||
|
|
||||||
-- list_type2, touch_type2 = self:CheckPlane(card_map, 0, 6, 0)
|
|
||||||
-- list_bomb, touch_bomb = self:CheckBomb(card_map, 0, 4)
|
|
||||||
|
|
||||||
-- local list_type, touch_type = self:CheckOnes(card_map, 0, 11)
|
|
||||||
-- for i = 5, 11 do
|
|
||||||
-- local list_temp, touch_temp = self:CheckOnes(card_map, 0, i)
|
|
||||||
-- if list_temp[1] ~= nil then
|
|
||||||
-- -- body
|
|
||||||
-- list_type = list_temp
|
|
||||||
-- end
|
|
||||||
-- end
|
|
||||||
-- local temp_list = list_type[1]
|
|
||||||
-- local temp_list1 = list_type1[1]
|
|
||||||
-- local temp_list2 = list_type2[1]
|
|
||||||
-- local temp_bomb = list_bomb[1]
|
|
||||||
-- if self.xunpai == nil then
|
|
||||||
-- -- body
|
|
||||||
-- self.xunpai = {}
|
|
||||||
-- end
|
|
||||||
|
|
||||||
-- -- if temp_list ~= nil and temp_list1 == nil and temp_list2 == nil and temp_bomb == nil and #temp_list > #self.xunpai then
|
|
||||||
-- if temp_list ~= nil and temp_list1 == nil and temp_list2 == nil and temp_bomb == nil then
|
|
||||||
-- -- for i = 1, #self.send_card do
|
|
||||||
-- for i = 1, #self.card_list do
|
|
||||||
-- self:UpdateCardMove(self.card_list[i].btn_card, false, false)
|
|
||||||
-- end
|
|
||||||
-- for i = 1, #self.send_card do
|
|
||||||
-- for j = 1, #temp_list do
|
|
||||||
-- if self.send_card[i] == temp_list[j] then
|
|
||||||
-- -- body
|
|
||||||
-- self:UpdateCardMove(self.send_card[i].btn_card, true, false)
|
|
||||||
-- end
|
|
||||||
-- end
|
|
||||||
-- end
|
|
||||||
-- self.xunpai = temp_list
|
|
||||||
-- else
|
|
||||||
-- self.xunpai = {}
|
|
||||||
-- end
|
|
||||||
-- end
|
|
||||||
function M:zhizhanxuanpai() --智障选牌
|
function M:zhizhanxuanpai() --智障选牌
|
||||||
-- body
|
-- body
|
||||||
local temp_send_card = {}
|
local temp_send_card = {}
|
||||||
|
|
@ -561,88 +377,6 @@ function M:zhizhanxuanpai() --智障选牌
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- function M:TouchMoving(context)
|
|
||||||
-- if self.cards_view == nil then
|
|
||||||
-- return
|
|
||||||
-- end
|
|
||||||
-- local send_card1 = {}
|
|
||||||
-- local xy = self.cards_view:GlobalToLocal(Vector2.New(context.inputEvent.x, context.inputEvent.y))
|
|
||||||
-- self.isTouching = true
|
|
||||||
-- if xy.x - self.touchBegin.x > 0 then -- 往右边滑
|
|
||||||
-- local max_x = xy.x
|
|
||||||
-- local min_x = self.touchBegin.x
|
|
||||||
-- for i = 1, #self.card_list do
|
|
||||||
-- local card = self.card_list[i]
|
|
||||||
-- if card.btn_card.touchable == false or card.card_isTouchable == 1 then
|
|
||||||
-- else
|
|
||||||
-- if
|
|
||||||
-- card.btn_card.x + (self.card_width + self:GetHandCardOffset(#self.card_list)) > min_x and
|
|
||||||
-- card.btn_card.x < max_x
|
|
||||||
-- then
|
|
||||||
-- printlog("cccccccccccccc22222222222222")
|
|
||||||
-- self:SetBtnCardColor(card, 0.8)
|
|
||||||
-- if #send_card1 == 0 then
|
|
||||||
-- -- body
|
|
||||||
-- send_card1[1] = card
|
|
||||||
-- end
|
|
||||||
-- for i = 1, #send_card1 do
|
|
||||||
-- if send_card1[i] ~= card then
|
|
||||||
-- -- body
|
|
||||||
-- send_card1[#send_card1 + 1] = card
|
|
||||||
-- end
|
|
||||||
-- end
|
|
||||||
-- else
|
|
||||||
-- -- self:UpdateCardMove(card.btn_card, not card.btn_card.selected, false)
|
|
||||||
-- -- card.card_isTouchable = 1
|
|
||||||
-- -- ViewUtil.PlaySound("RunFastNew_PK", "extend/poker/paodekuai/sound/click.mp3")
|
|
||||||
-- self:SetBtnCardColor(card, 1)
|
|
||||||
-- end
|
|
||||||
-- end
|
|
||||||
-- end
|
|
||||||
-- elseif xy.x - self.touchBegin.x < 0 then -- 左边滑
|
|
||||||
-- local max_x = self.touchBegin.x
|
|
||||||
-- local min_x = xy.x
|
|
||||||
-- for i = 1, #self.card_list do
|
|
||||||
-- local card = self.card_list[i]
|
|
||||||
-- if card.btn_card.touchable == false or card.card_isTouchable == 1 then
|
|
||||||
-- else
|
|
||||||
-- if
|
|
||||||
-- card.btn_card.x + (self.card_width + self:GetHandCardOffset(#self.card_list)) > min_x and
|
|
||||||
-- card.btn_card.x < max_x
|
|
||||||
-- then
|
|
||||||
-- -- self:UpdateCardMove(card.btn_card, not card.btn_card.selected, false)
|
|
||||||
-- -- card.card_isTouchable = 1
|
|
||||||
-- -- ViewUtil.PlaySound("RunFastNew_PK", "extend/poker/paodekuai/sound/click.mp3")
|
|
||||||
-- self:SetBtnCardColor(card, 0.8)
|
|
||||||
-- if #send_card1 == 0 then
|
|
||||||
-- -- body
|
|
||||||
-- send_card1[1] = card
|
|
||||||
-- end
|
|
||||||
-- for i = 1, #send_card1 do
|
|
||||||
-- if send_card1[i] ~= card then
|
|
||||||
-- -- body
|
|
||||||
-- send_card1[#send_card1 + 1] = card
|
|
||||||
-- end
|
|
||||||
-- end
|
|
||||||
-- else
|
|
||||||
-- self:SetBtnCardColor(card, 1)
|
|
||||||
-- end
|
|
||||||
-- end
|
|
||||||
-- end
|
|
||||||
-- end
|
|
||||||
-- ---- print(vardump(send_card1))
|
|
||||||
-- -- local send_card = {}
|
|
||||||
-- -- self.send_card = {}
|
|
||||||
-- -- for i = 1, #self.card_list do
|
|
||||||
-- -- local card = self.card_list[i]
|
|
||||||
-- -- if card.btn_card.selected then
|
|
||||||
-- -- send_card[#send_card + 1] = card.card_code_flower
|
|
||||||
-- -- self.send_card[#self.send_card + 1] = card
|
|
||||||
-- -- end
|
|
||||||
-- -- end
|
|
||||||
-- self.send_card = send_card1
|
|
||||||
-- end
|
|
||||||
|
|
||||||
function M:TouchMoving(context)
|
function M:TouchMoving(context)
|
||||||
if self._view_handCard == nil then
|
if self._view_handCard == nil then
|
||||||
return
|
return
|
||||||
|
|
@ -664,8 +398,9 @@ function M:TouchMoving(context)
|
||||||
max_x = self.touchBegin.x
|
max_x = self.touchBegin.x
|
||||||
min_x = xy.x
|
min_x = xy.x
|
||||||
end
|
end
|
||||||
for i = 1, #self.card_list do
|
|
||||||
local card = self.card_list[i]
|
for i = 1, self._view_handCard.numItems do
|
||||||
|
local card = self._view_handCard:GetChildAt(i - 1).data
|
||||||
if card.btn_card.touchable == false or card.card_isTouchable == 1 then
|
if card.btn_card.touchable == false or card.card_isTouchable == 1 then
|
||||||
else
|
else
|
||||||
if
|
if
|
||||||
|
|
@ -711,8 +446,8 @@ function M:TouchMoveEnd(context)
|
||||||
min_x = xy.x
|
min_x = xy.x
|
||||||
end
|
end
|
||||||
|
|
||||||
for k = 1, #self.card_list do
|
for k = 1, self._view_handCard.numItems do
|
||||||
local card = self.card_list[k]
|
local card = self._view_handCard:GetChildAt(k - 1).data
|
||||||
table.insert(currentCard, card.card_code_flower)
|
table.insert(currentCard, card.card_code_flower)
|
||||||
if not card.btn_card.selected then
|
if not card.btn_card.selected then
|
||||||
downCards = downCards - 1
|
downCards = downCards - 1
|
||||||
|
|
|
||||||
|
|
@ -196,9 +196,9 @@ function M:InitView(url)
|
||||||
self:UpdateRound(0)
|
self:UpdateRound(0)
|
||||||
|
|
||||||
--按钮功能全部未开放
|
--按钮功能全部未开放
|
||||||
self._view:GetChild('Btn_Spectator').onClick:Set(function()
|
-- self._view:GetChild('Btn_Spectator').onClick:Set(function()
|
||||||
ViewUtil.ErrorMsg(self._view, "", "该功能还未开放")
|
-- ViewUtil.ErrorMsg(self._view, "", "该功能还未开放")
|
||||||
end)
|
-- end)
|
||||||
self._view:GetChild('Btn_GamePlay').onClick:Set(function()
|
self._view:GetChild('Btn_GamePlay').onClick:Set(function()
|
||||||
ViewUtil.ErrorMsg(self._view, "", "该功能还未开放")
|
ViewUtil.ErrorMsg(self._view, "", "该功能还未开放")
|
||||||
end)
|
end)
|
||||||
|
|
|
||||||
|
|
@ -21,8 +21,8 @@ local Fix_Msg_Chat = {
|
||||||
|
|
||||||
--- Create a new ZZ_MainView
|
--- Create a new ZZ_MainView
|
||||||
function M.new()
|
function M.new()
|
||||||
setmetatable(M, {__index = ZPMainView})
|
setmetatable(M, { __index = ZPMainView })
|
||||||
local self = setmetatable({}, {__index = M})
|
local self = setmetatable({}, { __index = M })
|
||||||
self.class = 'RunBeard_MainView'
|
self.class = 'RunBeard_MainView'
|
||||||
self._full = true
|
self._full = true
|
||||||
self:init()
|
self:init()
|
||||||
|
|
@ -36,6 +36,7 @@ function M:getCardItem(card_1, card_2)
|
||||||
return card_1 .. '2_' .. card_2
|
return card_1 .. '2_' .. card_2
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:InitView(url)
|
function M:InitView(url)
|
||||||
local _room = self._room
|
local _room = self._room
|
||||||
self.Fix_Msg_Chat = Fix_Msg_Chat
|
self.Fix_Msg_Chat = Fix_Msg_Chat
|
||||||
|
|
@ -127,12 +128,14 @@ function M:NewPlayerCardInfoView(view, index)
|
||||||
end
|
end
|
||||||
return PlayerCardInfoView.new(view, self)
|
return PlayerCardInfoView.new(view, self)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:closeTipOnTuoguan()
|
function M:closeTipOnTuoguan()
|
||||||
if self._clearingView ~= nil then
|
if self._clearingView ~= nil then
|
||||||
self._clearingView:Close()
|
self._clearingView:Close()
|
||||||
end
|
end
|
||||||
self:__CloseTip()
|
self:__CloseTip()
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:EventInit()
|
function M:EventInit()
|
||||||
MainView.EventInit(self)
|
MainView.EventInit(self)
|
||||||
local _room = self._room
|
local _room = self._room
|
||||||
|
|
@ -140,32 +143,28 @@ function M:EventInit()
|
||||||
local _player_info = self._player_info
|
local _player_info = self._player_info
|
||||||
local _gamectr = self._gamectr
|
local _gamectr = self._gamectr
|
||||||
|
|
||||||
_gamectr:AddEventListener(GameEvent.EventXiPai,function( ... )
|
_gamectr:AddEventListener(GameEvent.EventXiPai, function(...)
|
||||||
local arg = {...}
|
local arg = { ... }
|
||||||
local currentPlayer1=arg[1]
|
local currentPlayer1 = arg[1]
|
||||||
local currentPlayer2=arg[2]
|
local currentPlayer2 = arg[2]
|
||||||
printlog("jefe AddEventListener===》》》》",arg)
|
printlog("jefe AddEventListener===》》》》", arg)
|
||||||
self._popEvent = false
|
self._popEvent = false
|
||||||
if ( currentPlayer1 ) then
|
if (currentPlayer1) then
|
||||||
|
local xipaiCB = function()
|
||||||
local xipaiCB=function ()
|
self._popEvent = true
|
||||||
self._popEvent = true
|
end
|
||||||
end
|
self:PlayXiPai(xipaiCB)
|
||||||
self:PlayXiPai(xipaiCB)
|
end
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
if ( currentPlayer2 ) then
|
if (currentPlayer2) then
|
||||||
--self._popEvent = false
|
--self._popEvent = false
|
||||||
local xipaiCB2=function ()
|
local xipaiCB2 = function()
|
||||||
self._popEvent = true
|
self._popEvent = true
|
||||||
end
|
end
|
||||||
self:PlayXiPai1(xipaiCB2)
|
self:PlayXiPai1(xipaiCB2)
|
||||||
end
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
end)
|
|
||||||
|
|
||||||
_gamectr:AddEventListener(
|
_gamectr:AddEventListener(
|
||||||
GameEvent.SendCards,
|
GameEvent.SendCards,
|
||||||
|
|
@ -213,7 +212,7 @@ function M:EventInit()
|
||||||
_gamectr:AddEventListener(
|
_gamectr:AddEventListener(
|
||||||
GameEvent.GetCard,
|
GameEvent.GetCard,
|
||||||
function(...)
|
function(...)
|
||||||
local arg = {...}
|
local arg = { ... }
|
||||||
local seat = arg[1]
|
local seat = arg[1]
|
||||||
local card = arg[2]
|
local card = arg[2]
|
||||||
local _leftcard = arg[3]
|
local _leftcard = arg[3]
|
||||||
|
|
@ -239,7 +238,7 @@ function M:EventInit()
|
||||||
_gamectr:AddEventListener(
|
_gamectr:AddEventListener(
|
||||||
GameEvent.AddCard,
|
GameEvent.AddCard,
|
||||||
function(...)
|
function(...)
|
||||||
local arg = {...}
|
local arg = { ... }
|
||||||
local seat = arg[1]
|
local seat = arg[1]
|
||||||
local card = arg[2]
|
local card = arg[2]
|
||||||
self._popEvent = false
|
self._popEvent = false
|
||||||
|
|
@ -260,7 +259,7 @@ function M:EventInit()
|
||||||
_gamectr:AddEventListener(
|
_gamectr:AddEventListener(
|
||||||
GameEvent.EventTurn,
|
GameEvent.EventTurn,
|
||||||
function(...)
|
function(...)
|
||||||
local arg = {...}
|
local arg = { ... }
|
||||||
local seat = arg[1]
|
local seat = arg[1]
|
||||||
local list = _room.player_list
|
local list = _room.player_list
|
||||||
local readyNum = 0
|
local readyNum = 0
|
||||||
|
|
@ -292,7 +291,7 @@ function M:EventInit()
|
||||||
function(...)
|
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
|
||||||
|
|
@ -329,7 +328,7 @@ function M:EventInit()
|
||||||
self:__CloseTip()
|
self:__CloseTip()
|
||||||
self._popEvent = false
|
self._popEvent = false
|
||||||
self._left_time = 0
|
self._left_time = 0
|
||||||
local arg = {...}
|
local arg = { ... }
|
||||||
local seat = arg[1]
|
local seat = arg[1]
|
||||||
local card = arg[2]
|
local card = arg[2]
|
||||||
local p = _room:GetPlayerBySeat(seat)
|
local p = _room:GetPlayerBySeat(seat)
|
||||||
|
|
@ -343,7 +342,7 @@ function M:EventInit()
|
||||||
_gamectr:AddEventListener(
|
_gamectr:AddEventListener(
|
||||||
GameEvent.FZTips,
|
GameEvent.FZTips,
|
||||||
function(...)
|
function(...)
|
||||||
local arg = {...}
|
local arg = { ... }
|
||||||
local _tip = arg[1]
|
local _tip = arg[1]
|
||||||
local _uid = arg[2]
|
local _uid = arg[2]
|
||||||
self:__FangziTip(_tip, _uid)
|
self:__FangziTip(_tip, _uid)
|
||||||
|
|
@ -358,7 +357,7 @@ function M:EventInit()
|
||||||
self._left_time = 0
|
self._left_time = 0
|
||||||
self:__CloseTip()
|
self:__CloseTip()
|
||||||
self._popEvent = false
|
self._popEvent = false
|
||||||
local arg = {...}
|
local arg = { ... }
|
||||||
local w = arg[1]
|
local w = arg[1]
|
||||||
local l = arg[2]
|
local l = arg[2]
|
||||||
local cards = arg[3]
|
local cards = arg[3]
|
||||||
|
|
@ -394,7 +393,7 @@ function M:EventInit()
|
||||||
function(...)
|
function(...)
|
||||||
self._popEvent = false
|
self._popEvent = false
|
||||||
self._left_time = 0
|
self._left_time = 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
|
||||||
|
|
@ -473,7 +472,7 @@ function M:EventInit()
|
||||||
GameEvent.ZPResult2,
|
GameEvent.ZPResult2,
|
||||||
function(...)
|
function(...)
|
||||||
self._left_time = 0
|
self._left_time = 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]
|
||||||
|
|
@ -504,8 +503,8 @@ end
|
||||||
function M:ChangeCards(list)
|
function M:ChangeCards(list)
|
||||||
local _gamectr = ControllerManager.GetController(GameController)
|
local _gamectr = ControllerManager.GetController(GameController)
|
||||||
if _gamectr then
|
if _gamectr then
|
||||||
_gamectr:SendChangeCards(list)
|
_gamectr:SendChangeCards(list)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:__FangziTip(tip, _uid)
|
function M:__FangziTip(tip, _uid)
|
||||||
|
|
@ -530,7 +529,7 @@ function M:__FangziTip(tip, _uid)
|
||||||
local url = 'ui://Main_RunBeard/Btn_fztip'
|
local url = 'ui://Main_RunBeard/Btn_fztip'
|
||||||
local btn_t = _lit_fanzi:AddItemFromPool(url)
|
local btn_t = _lit_fanzi:AddItemFromPool(url)
|
||||||
btn_t.icon = 'ui://Main_RunBeard/newop_' .. td.type
|
btn_t.icon = 'ui://Main_RunBeard/newop_' .. td.type
|
||||||
btn_t.data = {tip, td, tip_hu}
|
btn_t.data = { tip, td, tip_hu }
|
||||||
btn_t.onClick:Set(self.__TipAction, self)
|
btn_t.onClick:Set(self.__TipAction, self)
|
||||||
end
|
end
|
||||||
if p.hand_left_count ~= 0 then
|
if p.hand_left_count ~= 0 then
|
||||||
|
|
@ -563,6 +562,7 @@ function M:__FangziTip(tip, _uid)
|
||||||
_chipeng_tip.x = _chipeng_tip.x + 200
|
_chipeng_tip.x = _chipeng_tip.x + 200
|
||||||
_chipeng_tip.y = _chipeng_tip.y - 50
|
_chipeng_tip.y = _chipeng_tip.y - 50
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:__TipAction(context)
|
function M:__TipAction(context)
|
||||||
local data = context.sender.data
|
local data = context.sender.data
|
||||||
local _gamectr = self._gamectr
|
local _gamectr = self._gamectr
|
||||||
|
|
@ -751,7 +751,7 @@ function M:deepcopy(object)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:OnFangziAction(...)
|
function M:OnFangziAction(...)
|
||||||
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]
|
||||||
|
|
@ -845,7 +845,7 @@ function M:OnFangziAction(...)
|
||||||
elseif fz.type == RB_FZType.Ti then
|
elseif fz.type == RB_FZType.Ti then
|
||||||
self:PlaySound(player.self_user.sex, 'F_SaoChuan')
|
self:PlaySound(player.self_user.sex, 'F_SaoChuan')
|
||||||
effect:GetChild('icon1').icon = UIPackage.GetItemURL('Main_RunBeard', 'ti')
|
effect:GetChild('icon1').icon = UIPackage.GetItemURL('Main_RunBeard', 'ti')
|
||||||
-- effect:GetChild("icon2").icon = UIPackage.GetItemURL("Main_RunBeard", "ti")
|
-- effect:GetChild("icon2").icon = UIPackage.GetItemURL("Main_RunBeard", "ti")
|
||||||
end
|
end
|
||||||
effect.touchable = false
|
effect.touchable = false
|
||||||
effect.x, effect.y = 0, 0
|
effect.x, effect.y = 0, 0
|
||||||
|
|
@ -941,8 +941,8 @@ function M:ReloadRoom()
|
||||||
card_info:ChuPaiTiShi()
|
card_info:ChuPaiTiShi()
|
||||||
if
|
if
|
||||||
self._room.self_player.card_list ~= nil and
|
self._room.self_player.card_list ~= nil and
|
||||||
#self._room.self_player.handcard_list == #self._room.self_player.card_list
|
#self._room.self_player.handcard_list == #self._room.self_player.card_list
|
||||||
then
|
then
|
||||||
local _list = self:deepcopy(self._room.self_player.card_list)
|
local _list = self:deepcopy(self._room.self_player.card_list)
|
||||||
local cards = {}
|
local cards = {}
|
||||||
for i = 1, #_list do
|
for i = 1, #_list do
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ function MJCheckG.new()
|
||||||
self.class = 'MJCheckG'
|
self.class = 'MJCheckG'
|
||||||
self._currenIndex = 0
|
self._currenIndex = 0
|
||||||
self._close_destroy = true
|
self._close_destroy = true
|
||||||
|
self._close_zone = false
|
||||||
self:init('ui://Common/comp_checkG')
|
self:init('ui://Common/comp_checkG')
|
||||||
|
|
||||||
return self
|
return self
|
||||||
|
|
@ -28,18 +29,20 @@ function M:init(url)
|
||||||
|
|
||||||
self.coroutine = coroutine.start(function(...)
|
self.coroutine = coroutine.start(function(...)
|
||||||
self.valueTemp = 0
|
self.valueTemp = 0
|
||||||
|
local kaTime = math.random(200)
|
||||||
while self.valueTemp < 100 do
|
while self.valueTemp < 100 do
|
||||||
-- 让他在72的时候卡顿一下
|
if self.valueTemp >= kaTime then
|
||||||
if self.valueTemp > 72 and self.valueTemp < 80 then
|
coroutine.wait(0.4)
|
||||||
|
kaTime = 200
|
||||||
end
|
end
|
||||||
|
local addVulse = math.random(4)
|
||||||
self.valueTemp = self.valueTemp + math.random(4)
|
self.valueTemp = self.valueTemp + addVulse
|
||||||
self.silder.value = self.valueTemp
|
self.silder.value = self.valueTemp
|
||||||
coroutine.wait(0.1)
|
coroutine.wait(addVulse * 0.04)
|
||||||
end
|
end
|
||||||
showText.text = "检测完毕,环境安全"
|
showText.text = "检测完毕,环境安全"
|
||||||
coroutine.wait(2)
|
coroutine.wait(0.66)
|
||||||
|
self._view:GetController('ok_touch').selectedIndex = 1
|
||||||
-- self:Destroy()
|
-- self:Destroy()
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -137,9 +137,17 @@ function M:init(url)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
self.btn_sound.onClick:Add(function()
|
self.btn_sound.onClick:Add(function()
|
||||||
|
if self.btn_sound.selected then
|
||||||
|
local v = GameApplication.Instance.SoundValue
|
||||||
|
self.slider_sound.value = 0
|
||||||
|
GameApplication.Instance.SoundValue = 0
|
||||||
|
PlayerPrefs.SetInt('sound', v)
|
||||||
|
else
|
||||||
|
local v = PlayerPrefs.GetInt('sound')
|
||||||
|
self.slider_sound.value = v
|
||||||
|
GameApplication.Instance.SoundValue = v
|
||||||
|
end
|
||||||
GameApplication.Instance.SoundMute = self.btn_sound.selected;
|
GameApplication.Instance.SoundMute = self.btn_sound.selected;
|
||||||
self.slider_sound.value = 0
|
|
||||||
GameApplication.Instance.SoundValue = 0
|
|
||||||
end)
|
end)
|
||||||
|
|
||||||
self.btn_music.onClick:Add(function()
|
self.btn_music.onClick:Add(function()
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ function PKCheckG.new()
|
||||||
self.class = 'PKCheckG'
|
self.class = 'PKCheckG'
|
||||||
self._currenIndex = 0
|
self._currenIndex = 0
|
||||||
self._close_destroy = true
|
self._close_destroy = true
|
||||||
|
self._close_zone = false
|
||||||
self:init('ui://Common/comp_checkG')
|
self:init('ui://Common/comp_checkG')
|
||||||
|
|
||||||
return self
|
return self
|
||||||
|
|
@ -28,18 +29,20 @@ function M:init(url)
|
||||||
|
|
||||||
self.coroutine = coroutine.start(function(...)
|
self.coroutine = coroutine.start(function(...)
|
||||||
self.valueTemp = 0
|
self.valueTemp = 0
|
||||||
|
local kaTime = math.random(200)
|
||||||
while self.valueTemp < 100 do
|
while self.valueTemp < 100 do
|
||||||
-- 让他在72的时候卡顿一下
|
if self.valueTemp >= kaTime then
|
||||||
if self.valueTemp > 72 and self.valueTemp < 80 then
|
coroutine.wait(0.4)
|
||||||
|
kaTime = 200
|
||||||
end
|
end
|
||||||
|
local addVulse = math.random(4)
|
||||||
self.valueTemp = self.valueTemp + math.random(4)
|
self.valueTemp = self.valueTemp + addVulse
|
||||||
self.silder.value = self.valueTemp
|
self.silder.value = self.valueTemp
|
||||||
coroutine.wait(0.1)
|
coroutine.wait(addVulse * 0.04)
|
||||||
end
|
end
|
||||||
showText.text = "检测完毕,环境安全"
|
showText.text = "检测完毕,环境安全"
|
||||||
coroutine.wait(2)
|
coroutine.wait(0.66)
|
||||||
|
self._view:GetController('ok_touch').selectedIndex = 1
|
||||||
-- self:Destroy()
|
-- self:Destroy()
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -110,9 +110,17 @@ function M:init(url)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
self.btn_sound.onClick:Add(function()
|
self.btn_sound.onClick:Add(function()
|
||||||
|
if self.btn_sound.selected then
|
||||||
|
local v = GameApplication.Instance.SoundValue
|
||||||
|
self.slider_sound.value = 0
|
||||||
|
GameApplication.Instance.SoundValue = 0
|
||||||
|
PlayerPrefs.SetInt('sound', v)
|
||||||
|
else
|
||||||
|
local v = PlayerPrefs.GetInt('sound')
|
||||||
|
self.slider_sound.value = v
|
||||||
|
GameApplication.Instance.SoundValue = v
|
||||||
|
end
|
||||||
GameApplication.Instance.SoundMute = self.btn_sound.selected;
|
GameApplication.Instance.SoundMute = self.btn_sound.selected;
|
||||||
self.slider_sound.value = 0
|
|
||||||
GameApplication.Instance.SoundValue = 0
|
|
||||||
end)
|
end)
|
||||||
|
|
||||||
self.btn_music.onClick:Add(function()
|
self.btn_music.onClick:Add(function()
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<component size="1350,702">
|
<component size="1350,702">
|
||||||
|
<controller name="ok_touch" pages="0,,1," selected="0"/>
|
||||||
<displayList>
|
<displayList>
|
||||||
<image id="n0_o8k8" name="n0" src="o8k87imv" fileName="images/checkG/Group 536.png" xy="0,0" size="1350,702"/>
|
<image id="n0_o8k8" name="n0" src="o8k87imv" fileName="images/checkG/Group 536.png" xy="0,0" size="1350,702"/>
|
||||||
<component id="n2_o8k8" name="slider_check" src="o8k87imz" fileName="images/checkG/slider_checkG.xml" xy="175,234">
|
<component id="n2_o8k8" name="slider_check" src="o8k87imz" fileName="images/checkG/slider_checkG.xml" xy="175,234">
|
||||||
|
|
@ -8,7 +9,9 @@
|
||||||
<text id="n3_o8k8" name="n3" xy="339,369" size="672,102" font="ui://27vd145bg2mo7ij0" fontSize="78" color="#5a2d0e" autoSize="none" text="请稍后,检测中...">
|
<text id="n3_o8k8" name="n3" xy="339,369" size="672,102" font="ui://27vd145bg2mo7ij0" fontSize="78" color="#5a2d0e" autoSize="none" text="请稍后,检测中...">
|
||||||
<relation target="" sidePair="center-center,middle-middle"/>
|
<relation target="" sidePair="center-center,middle-middle"/>
|
||||||
</text>
|
</text>
|
||||||
<component id="n4_o8k8" name="btn_ok" src="n2h87imc" fileName="component/pop_oneChoose/btn_oneChoose.xml" xy="462,492" size="426,139"/>
|
<component id="n4_o8k8" name="btn_ok" src="n2h87imc" fileName="component/pop_oneChoose/btn_oneChoose.xml" xy="462,492" size="426,139" touchable="false" grayed="true">
|
||||||
|
<gearLook controller="ok_touch" pages="0" values="1,0,1,0" default="1,0,0,1"/>
|
||||||
|
</component>
|
||||||
<component id="n5_o8k8" name="btn_close" src="n2h87imc" fileName="component/pop_oneChoose/btn_oneChoose.xml" xy="558,286" visible="false"/>
|
<component id="n5_o8k8" name="btn_close" src="n2h87imc" fileName="component/pop_oneChoose/btn_oneChoose.xml" xy="558,286" visible="false"/>
|
||||||
</displayList>
|
</displayList>
|
||||||
</component>
|
</component>
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<component size="112,112" pivot="0.5,0.5">
|
||||||
|
<displayList>
|
||||||
|
<loader id="n0_uans" name="loader" xy="56,56" pivot="0.5,0.5" anchor="true" size="112,112" aspect="true" url="ui://27vd145bqmc17jbx" align="center" vAlign="middle" fill="scaleFree">
|
||||||
|
<relation target="" sidePair="width-width,height-height"/>
|
||||||
|
</loader>
|
||||||
|
</displayList>
|
||||||
|
</component>
|
||||||
|
After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 5.8 KiB |
|
After Width: | Height: | Size: 5.3 KiB |
|
After Width: | Height: | Size: 5.7 KiB |
|
After Width: | Height: | Size: 5.3 KiB |
|
After Width: | Height: | Size: 5.7 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 9.1 KiB |
|
After Width: | Height: | Size: 7.3 KiB |
|
After Width: | Height: | Size: 3.1 KiB |
|
After Width: | Height: | Size: 3.4 KiB |
|
After Width: | Height: | Size: 3.0 KiB |
|
After Width: | Height: | Size: 3.2 KiB |
|
After Width: | Height: | Size: 3.4 KiB |
|
After Width: | Height: | Size: 3.0 KiB |
|
After Width: | Height: | Size: 3.2 KiB |
|
After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 3.8 KiB |
|
After Width: | Height: | Size: 4.1 KiB |
|
After Width: | Height: | Size: 6.3 KiB |
|
After Width: | Height: | Size: 6.3 KiB |
|
After Width: | Height: | Size: 6.2 KiB |
|
After Width: | Height: | Size: 5.7 KiB |
|
After Width: | Height: | Size: 4.3 KiB |
|
After Width: | Height: | Size: 6.0 KiB |
|
After Width: | Height: | Size: 8.7 KiB |
|
After Width: | Height: | Size: 7.8 KiB |
|
After Width: | Height: | Size: 7.8 KiB |
|
After Width: | Height: | Size: 6.6 KiB |
|
After Width: | Height: | Size: 5.6 KiB |
|
After Width: | Height: | Size: 4.8 KiB |
|
After Width: | Height: | Size: 3.9 KiB |
|
After Width: | Height: | Size: 3.8 KiB |
|
After Width: | Height: | Size: 4.0 KiB |
|
After Width: | Height: | Size: 4.0 KiB |
|
After Width: | Height: | Size: 3.8 KiB |
|
After Width: | Height: | Size: 4.7 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 8.7 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 863 B |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 2.2 KiB |
|
After Width: | Height: | Size: 2.2 KiB |
|
After Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 5.6 KiB |
|
After Width: | Height: | Size: 5.8 KiB |
|
After Width: | Height: | Size: 5.9 KiB |
|
After Width: | Height: | Size: 6.7 KiB |
|
After Width: | Height: | Size: 9.2 KiB |
|
After Width: | Height: | Size: 8.8 KiB |
|
After Width: | Height: | Size: 9.4 KiB |