diff --git a/lua_probject/base_project/Game/View/LobbyView.lua b/lua_probject/base_project/Game/View/LobbyView.lua index 23eb25e7..ad0dbad3 100644 --- a/lua_probject/base_project/Game/View/LobbyView.lua +++ b/lua_probject/base_project/Game/View/LobbyView.lua @@ -467,7 +467,6 @@ function M:InitClip() local hechengName = "ui://Lobby/hecheng 1_00" local hecheng = self._view:GetChild('btn_joinroom') local hechengIndex = 0 - print("lingmengInitClip", taohua, renwu) coroutine.start( function() while true do diff --git a/lua_probject/base_project/Game/View/MainView.lua b/lua_probject/base_project/Game/View/MainView.lua index 22ef88a1..17fb6209 100644 --- a/lua_probject/base_project/Game/View/MainView.lua +++ b/lua_probject/base_project/Game/View/MainView.lua @@ -808,18 +808,18 @@ function M:OnPlayerReady(...) if p.isSendCardState~=nil and p.isSendCardState==true then p.isSendCardState=false ControllerManager.IsSendCard=false - --print("进入设置计时器控制==========") + print("进入设置计时器控制==========") coroutine.start(function() - --print("计时器倒计时5s=============") + print("计时器倒计时5s=============") coroutine.wait(5) - --print("当前状态==============") - --print(ControllerManager.IsSendCard) + print("当前状态==============") + print(ControllerManager.IsSendCard) if ControllerManager.IsSendCard==true then - --print("以发送开牌======================") + print("以发送开牌======================") return else - --print("开始断线重连") - --ControllerManager.OnConnect(SocketCode.TimeoutDisconnect) + print("开始断线重连") + ControllerManager.OnConnect(SocketCode.TimeoutDisconnect) ViewManager.refreshGameView() end ControllerManager.IsSendCard=false diff --git a/lua_probject/base_project/Game/ViewManager.lua b/lua_probject/base_project/Game/ViewManager.lua index 7ec489c1..4e68e1dd 100644 --- a/lua_probject/base_project/Game/ViewManager.lua +++ b/lua_probject/base_project/Game/ViewManager.lua @@ -159,7 +159,6 @@ function ViewManager.refreshGameView() if DataManager.CurrenRoom then ControllerManager.reset_join_room = 0 - ControllerManager.ResetJionRoom() else NetResetConnectWindow.CloseNetReset() diff --git a/lua_probject/extend_project/extend/zipai/fanpaofa/EXGameController.lua b/lua_probject/extend_project/extend/zipai/fanpaofa/EXGameController.lua index b96a1acd..a59d3c02 100644 --- a/lua_probject/extend_project/extend/zipai/fanpaofa/EXGameController.lua +++ b/lua_probject/extend_project/extend/zipai/fanpaofa/EXGameController.lua @@ -31,6 +31,8 @@ function M:init(name) self._eventmap[RB_Protocol.GAME_EVT_DANIAO_TIP] = self.OnEventDaNiaoTip + self._eventmap[RB_Protocol.GAME_EVT_DANIAO] = self.OnEventDaNiao + self._eventmap[RB_Protocol.GAME_EVENT_XIPAI] = self.OnEventXiPai self._eventmap[RB_Protocol.GAME_EVENT_NOTIFY_XIPAI] = self.OnEventXiPaiAnim @@ -51,17 +53,43 @@ function M:SendXiPaiAction(callBack) end function M:OnEventDaNiaoTip(evt_data) - - printlog("OnEventDaNiaoTip") if ViewManager.GetCurrenView().dview_class == LobbyView then self:ReturnToRoom() return end - local piao = 1 -- evt_data["piao"] + local niao = evt_data["niao"] + local reload = evt_data["reload"] + self._cacheEvent:Enqueue( function() - DispatchEvent(self._dispatcher, FanPaoFa_GameEvent.OnDaNiaoTips, piao) + DispatchEvent(self._dispatcher, FanPaoFa_GameEvent.OnDaNiaoTips, niao,reload) + ControllerManager.IsSendCard=true + end + ) +end + +function M:SendNiao(niao,callBack) + local _data = {} + _data["niaoflag"] = niao + printlog("niao flag" , niao) + local _client = ControllerManager.GameNetClinet + _client:send(RB_Protocol.GAME_EVT_SEND_NIAO, _data) + self.NiaoTipsCallBack=callBack +end + +function M:OnEventDaNiao(evt_data) + local seat = evt_data["seat"] + local niao = evt_data["niao"] + if seat==DataManager.CurrenRoom.self_player.seat then + if self.NiaoTipsCallBack then + self.NiaoTipsCallBack() + self.NiaoTipsCallBack=nil + end + end + self._cacheEvent:Enqueue( + function() + DispatchEvent(self._dispatcher, FanPaoFa_GameEvent.OnEventDaNiao, seat,niao) end ) end diff --git a/lua_probject/extend_project/extend/zipai/fanpaofa/EXMainView.lua b/lua_probject/extend_project/extend/zipai/fanpaofa/EXMainView.lua index 0b87e338..0defd41b 100644 --- a/lua_probject/extend_project/extend/zipai/fanpaofa/EXMainView.lua +++ b/lua_probject/extend_project/extend/zipai/fanpaofa/EXMainView.lua @@ -30,6 +30,7 @@ function M.new() end function M:getCardItem(card_1, card_2) + printlog("jefe getCardItem") if self._room.change_card_display ~= nil then return card_1 .. self._room.change_card_display .. card_2 else @@ -177,40 +178,57 @@ function M:EventInit() _gamectr:AddEventListener(GameEvent.OnDaNiaoTips, function(...) local arg = {...} local niao = arg[1] - printlog("main daniao tips") - --[[ - local otherpoker_list = self._view:GetChild("otherpoker_list") + local reload = arg[2] + if reload==0 then + self._leftcard = 1 + self._leftcard = 1 + local rightpanel = self._view:GetChild('right_panel') + local tex_round = rightpanel:GetChild('tex_round') + if tex_round ~= nil then + tex_round.text = '第 ' .. _room.curren_round .. ' 局' + end + self._view:GetChild('tex_round').text = '第 ' .. _room.curren_round .. '/' .. _room.room_config.round .. ' 局' - if otherpoker_list ~= nil then - -- body - otherpoker_list.visible=false - otherpoker_list:RemoveChildrenToPool() - end - self.ctr_state.selectedIndex = 1 - self.ctr_card_eff.selectedIndex = 0 - if self.rank_view ~= nil then - self.rank_view:Dispose() - self.rank_view = nil - end - self:UpdateRound(self._room.curren_round) - - local list = _room.player_list - for i = 1, #list do - local p = list[i] - local head_info = self._player_info[self:GetPos(p.seat)] - - p:Clear() - head_info:FillData(p) - local card_info = self._player_card_info[self:GetPos(p.seat)] - card_info:Clear() - head_info:Ready(false) - head_info:UpdatePiao(-1) - end + self._state.selectedIndex = 1 + self:closeTipOnTuoguan() + local list = _room.player_list + for i = 1, #list do + local p = list[i] + p.hu_xi = 0 + local _info = self._player_card_info[self:GetPos(p.seat)] + _info:SetPlayer(p) + local info = self._player_info[self:GetPos(p.seat)] + info:FillData(p) + info:MarkBank(p.seat == _room.banker_seat) + info:Ready(false) + --info:UpdatePiao(-1) + info._view:GetController('huxi').selectedIndex = 1 + info._view:GetChild('huxi').text = p.hu_xi + info._view:GetController('zhanji').selectedIndex = 0 + if _room.hpOnOff == 1 or _room:checkHpNonnegative() then + if p.total_hp == nil then + p.total_hp = 0 + end + info._view:GetController('zhanji').selectedIndex = 1 + info._view:GetChild('tex_jifen').text = d2ad(p.total_hp) + end + end + + end self._player_card_info[1]:ShwoDaNiao(niao) - ]] end) + + _gamectr:AddEventListener(GameEvent.OnEventDaNiao, function(...) + local arg = {...} + local seat = arg[1] + local niao = arg[2] + --local head_info = self._player_info[self:GetPos(seat)] + --head_info:UpdatePiao(piao) + end) + + _gamectr:AddEventListener( GameEvent.SendCards, function(...) diff --git a/lua_probject/extend_project/extend/zipai/fanpaofa/EXPlayerInfoView.lua b/lua_probject/extend_project/extend/zipai/fanpaofa/EXPlayerInfoView.lua index 0d6e8b57..205d75cc 100644 --- a/lua_probject/extend_project/extend/zipai/fanpaofa/EXPlayerInfoView.lua +++ b/lua_probject/extend_project/extend/zipai/fanpaofa/EXPlayerInfoView.lua @@ -21,4 +21,5 @@ function M:Init() end + return M diff --git a/lua_probject/extend_project/extend/zipai/fanpaofa/FanPaoFa_GameEvent.lua b/lua_probject/extend_project/extend/zipai/fanpaofa/FanPaoFa_GameEvent.lua index 657aa759..a4a46155 100644 --- a/lua_probject/extend_project/extend/zipai/fanpaofa/FanPaoFa_GameEvent.lua +++ b/lua_probject/extend_project/extend/zipai/fanpaofa/FanPaoFa_GameEvent.lua @@ -38,6 +38,7 @@ local FanPaoFa_GameEvent = { FangWei = "FangWei", OnDaNiaoTips = "OnDaNiaoTips", + OnEventDaNiao = "OnEventDaNiao", } return FanPaoFa_GameEvent diff --git a/lua_probject/extend_project/extend/zipai/fanpaofa/Protocol.lua b/lua_probject/extend_project/extend/zipai/fanpaofa/Protocol.lua index 846f541c..658082a2 100644 --- a/lua_probject/extend_project/extend/zipai/fanpaofa/Protocol.lua +++ b/lua_probject/extend_project/extend/zipai/fanpaofa/Protocol.lua @@ -46,7 +46,8 @@ local Protocol = { GAME_EVT_FANGPAO = "823", --鸟 - GAME_EVT_NIAO = "831", + GAME_EVT_SEND_NIAO = "831", + --打鸟提示 GAME_EVT_DANIAO_TIP = "832", diff --git a/lua_probject/extend_project/extend/zipai/fanpaofa/main/ZPCardView.lua b/lua_probject/extend_project/extend/zipai/fanpaofa/main/ZPCardView.lua index 2c24f342..d14119e9 100644 --- a/lua_probject/extend_project/extend/zipai/fanpaofa/main/ZPCardView.lua +++ b/lua_probject/extend_project/extend/zipai/fanpaofa/main/ZPCardView.lua @@ -51,6 +51,7 @@ function M:InitUI(card_code, type) end function M:GetCardItem(card_1, card_2) + printlog("jefe get card_item") local room = DataManager.CurrenRoom if room.change_card_display ~= nil then return card_1 .. room.change_card_display .. card_2 diff --git a/lua_probject/extend_project/extend/zipai/fanpaofa/main/ZPMainView.lua b/lua_probject/extend_project/extend/zipai/fanpaofa/main/ZPMainView.lua index ca1b510b..3e90ba0d 100644 --- a/lua_probject/extend_project/extend/zipai/fanpaofa/main/ZPMainView.lua +++ b/lua_probject/extend_project/extend/zipai/fanpaofa/main/ZPMainView.lua @@ -63,11 +63,13 @@ function M:InitView(url, isdisplay, open_social, change_card_size, qihu) local _gamectr = self._gamectr _gamectr:SendChangeTypeFace(typeface) + + printlog("jefe InitView "..typeface) if typeface == 1 then if isdisplay then - self._room.change_card_display = '7_' + self._room.change_card_display = '6_' else - self._room.change_card_display = '2_' + self._room.change_card_display = '6_' end elseif typeface == 2 then self._room.change_card_display = '1_' @@ -272,7 +274,7 @@ function M:UpdateCardDisplay(index) local _gamectr = self._gamectr _gamectr:SendChangeTypeFace(index) if index == 1 then - self._room.change_card_display = '2_' + self._room.change_card_display = '6_' elseif index == 2 then self._room.change_card_display = '1_' elseif index == 3 then diff --git a/lua_probject/extend_project/extend/zipai/fanpaofa/main/ZPPlayerCardInfoView.lua b/lua_probject/extend_project/extend/zipai/fanpaofa/main/ZPPlayerCardInfoView.lua index dfab2634..fbdfb10d 100644 --- a/lua_probject/extend_project/extend/zipai/fanpaofa/main/ZPPlayerCardInfoView.lua +++ b/lua_probject/extend_project/extend/zipai/fanpaofa/main/ZPPlayerCardInfoView.lua @@ -203,6 +203,7 @@ end function M:UpdateHandCards( list ) + self.card_lists = {} self._area_handcard_list:RemoveChildren(0,-1,true) local CountCards = {} diff --git a/lua_probject/extend_project/extend/zipai/fanpaofa/main/ZPPlayerSelfCardInfoView.lua b/lua_probject/extend_project/extend/zipai/fanpaofa/main/ZPPlayerSelfCardInfoView.lua index ebe5e960..59bbccf1 100644 --- a/lua_probject/extend_project/extend/zipai/fanpaofa/main/ZPPlayerSelfCardInfoView.lua +++ b/lua_probject/extend_project/extend/zipai/fanpaofa/main/ZPPlayerSelfCardInfoView.lua @@ -68,14 +68,14 @@ function M:init() self.ctr_piao = self._view:GetController('piao') self.ctr_niao = self._view:GetController('niao') self.ctr_piao_value = self._view:GetController('piaovalue') - printlog("zp init32") self:BtnEvent() end function M:ShwoDaNiao(niao) - printlog("main daniao ShwoDaNiao") - self.ctr_niao.selectedIndex = niao + printlog("main daniao ShwoDaNiao",self.ctr_niao) + self.ctr_niao.selectedIndex = 1 + printlog("main daniao ShwoDaNiao1") end function M:HideDaNiao() @@ -93,39 +93,30 @@ function M:HidePiao() end + function M:BtnEvent() self.btn_tips = self._view:GetChild('btn_tips') - - local function click_piao() - local closePiaoTipsFunc=function () - self.ctr_piao.selectedIndex = 0 + + local function click_niao1(vaule) + local closeNiaoTipsFunc=function () + self.ctr_niao.selectedIndex = 0 end - ControllerManager.GetController(GameController):SendPiao(tonumber(self.ctr_piao_value.selectedPage),closePiaoTipsFunc) + ControllerManager.GetController(GameController):SendNiao(1,closeNiaoTipsFunc) end - self.PiaoList={} - local btn_piao0 = self._view:GetChild('piao0') - btn_piao0.onClick:Set(click_piao) - table.insert(self.PiaoList,btn_piao0) - - local btn_piao1 = self._view:GetChild('piao1') - btn_piao1.onClick:Set(click_piao) - table.insert(self.PiaoList,btn_piao1) - - local btn_piao2 = self._view:GetChild('piao2') - btn_piao2.onClick:Set(click_piao) - table.insert(self.PiaoList,btn_piao2) - local btn_piao3 = self._view:GetChild('piao3') - btn_piao3.onClick:Set(click_piao) - table.insert(self.PiaoList,btn_piao3) + local function click_niao0(vaule) + local closeNiaoTipsFunc=function () + self.ctr_niao.selectedIndex = 0 + end + ControllerManager.GetController(GameController):SendNiao(0,closeNiaoTipsFunc) + end + + local btn_budaniao = self._view:GetChild("budaniao") + btn_budaniao.onClick:Set(click_niao0) - local btn_piao5 = self._view:GetChild('piao5') - btn_piao5.onClick:Set(click_piao) - table.insert(self.PiaoList,btn_piao5) + local btn_daniao = self._view:GetChild("daniao") + btn_daniao.onClick:Set(click_niao1) - local btn_piao8 = self._view:GetChild('piao8') - btn_piao8.onClick:Set(click_piao) - table.insert(self.PiaoList,btn_piao8) end @@ -357,6 +348,7 @@ function M:onTouchBegin(context) if DataManager.CurrenRoom.curren_outcard_seat == DataManager.CurrenRoom.self_player.seat then self:ShowHuTip(card.card_item) end + printlog("jefe onTouchBegin") card.btn_card:GetChild('icon').icon = self:getCardItem('ui://Main_RunBeard/203_', card.card_item) -- card.btn_card.sortingOrder = 100 local xy = self._area_handcard_list:GlobalToLocal(Vector2.New(context.inputEvent.x, context.inputEvent.y)) @@ -873,10 +865,10 @@ end --得到设置的牌字体 function M:getCardItem(card_1, card_2) if self._room.change_card_display ~= nil then - --printlog("===========",self._room.change_card_display) + printlog("===========",self._room.change_card_display) return card_1 .. self._room.change_card_display .. card_2 else - return card_1 .. '2_' .. card_2 + return card_1 .. '6_' .. card_2 end end --得到设置的牌大小 diff --git a/lua_probject/extend_project/extend/zipai/fanpaofa/main/ZPSettingView.lua b/lua_probject/extend_project/extend/zipai/fanpaofa/main/ZPSettingView.lua index d336d511..7e5e5407 100644 --- a/lua_probject/extend_project/extend/zipai/fanpaofa/main/ZPSettingView.lua +++ b/lua_probject/extend_project/extend/zipai/fanpaofa/main/ZPSettingView.lua @@ -245,7 +245,7 @@ function M:UpdateIndex() local _str = string.sub(room.change_card_display, 1, 1) local n = tonumber(_str) if n == 7 then - n = 2 + n = 6 end if n == 1 then c1.selectedIndex = 1 @@ -254,7 +254,7 @@ function M:UpdateIndex() elseif n == 8 then c1.selectedIndex = 3 else - c1.selectedIndex = 2 + c1.selectedIndex = 6 end end end diff --git a/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/EXGameController.lua b/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/EXGameController.lua new file mode 100644 index 00000000..2acac374 --- /dev/null +++ b/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/EXGameController.lua @@ -0,0 +1,565 @@ +local RB_Protocol = import(".Protocol") +local FZTipList = import(".main.FZData") +local RB_GameEvent = import(".RunBeard_GameEvent") +local M = {} + +--- Create a new HZ_GameController +function M.new() + setmetatable(M,{__index = GameController}) + local self = setmetatable({}, {__index = M}) + self:init("娄底放炮罚") + self.class = "RB_GameController" + return self +end + +function M:init(name) + GameController.init(self,name) + + self._eventmap[RB_Protocol.GAME_EVT_PLAYER_DEAL] = self.OnEventSendCards + self._eventmap[RB_Protocol.GAME_EVT_CHANGE_ACTIVE_PLAYER] = self.OnEventTurn + + self._eventmap[RB_Protocol.GAME_EVT_DRAW] = self.OnEventTakeCard + self._eventmap[RB_Protocol.GAME_EVT_DISCARD_TIP] = self.OnEventOutHint + self._eventmap[RB_Protocol.GAME_EVT_DISCARD] = self.OnEventOutCard + + self._eventmap[RB_Protocol.GAME_EVT_FZTIPS] = self.OnEventFzTips + + self._eventmap[RB_Protocol.GAME_EVT_ACTION] = self.OnEventFzAction + + self._eventmap[RB_Protocol.GAME_EVT_HU] = self.OnEventHu + + self._eventmap[RB_Protocol.GAME_EVT_RESULT1] = self.OneventResult1 + self._eventmap[RB_Protocol.GAME_EVT_QIPAI] = self.OnEventQIPAI + self._eventmap[RB_Protocol.GAME_EVT_ADD_CARD] = self.OnAddCard + + self._eventmap[RB_Protocol.GAME_EVT_Piao_Tip] = self.OnPiaoTip + self._eventmap[RB_Protocol.GAME_EVT_Piao_Action] = self.OnPiaoAction + self._eventmap[RB_Protocol.GAME_EVENT_XIPAI] = self.OnEventXiPai + self._eventmap[RB_Protocol.GAME_EVENT_NOTIFY_XIPAI] = self.OnEventXiPaiAnim + +end + + +function M:SendXiPaiAction(callBack) + local _data = {} + local _client = ControllerManager.GameNetClinet + _client:send(RB_Protocol.GAME_XIPAI, _data) + self.XiPaiCallBack=callBack +end + +function M:OnEventXiPai(evt_data) + if evt_data["result"]==0 then + if self.XiPaiCallBack then + self.XiPaiCallBack() + end + else + ViewUtil.ErrorTip(1000000,"申请洗牌失败") + end + +end + + +function M:OnEventXiPaiAnim(evt_data) + printlog("洗牌动画===》》》》") + pt(evt_data) + local playeridList = evt_data["list"] + local my_isXiPai=false + local other_isXiPai=false + if playeridList and #playeridList>0 then + for i=1,#playeridList do + local p = self._room:GetPlayerById(playeridList[i]) + if p== self._room.self_player then + my_isXiPai=true + else + other_isXiPai=true + end + end + end + + self._cacheEvent:Enqueue(function() + DispatchEvent(self._dispatcher,RB_GameEvent.EventXiPai,my_isXiPai,other_isXiPai) + end) +end + + +-- 发送出牌指令到服务器 +function M:SendOutCard(card) + local _data = {} + _data["card"] = card + local _room = self._room + local _client = ControllerManager.GameNetClinet + if _client ~= nil then + _client:send(RB_Protocol.GAME_DIS_CARD, _data) + end + +end +--GAME_CHANGE_CARD GAME_DIS_CARD +function M:SendChangeCards( card_list ) + local _data = {} + if card_list then + _data["card_list"] = card_list + else + _data["card_list"]={} + end + local _client = ControllerManager.GameNetClinet + if _client ~= nil then + _client:send(RB_Protocol.GAME_CHANGE_CARD, _data) + end +end + +function M:SendChangeTypeFace(TypeFace) + -- body + local _data = {} + _data["typeface"] = TypeFace + local _client = ControllerManager.GameNetClinet + if _client ~= nil then + _client:send(RB_Protocol.GAME_CHANGE_TYPEfACE, _data) + end +end + + +function M:ConformToNextGame( ) + local _client = ControllerManager.GameNetClinet + if _client ~= nil then + _client:send(RB_Protocol.GAME_EVT_CHUI) + end +end + +-- 发送放子选择到服务器 +function M:SendAction(id,num) + local _data = {} + _data["id"] = id + if num ~=nil then + _data["biid"] = num + end + local _client = ControllerManager.GameNetClinet + if _client ~= nil then + _client:send(RB_Protocol.GAME_ACTION, _data) + end +end + + +function M:SendPiao(piao,callBack) + local _data = {} + _data["id"] = piao + local _client = ControllerManager.GameNetClinet + _client:send(RB_Protocol.GAME_EVT_Send_Piao, _data) + self.PiaoTipsCallBack=callBack +end + + +function M:OnPiaoTip(evt_data) + if ViewManager.GetCurrenView().dview_class == LobbyView then + self:ReturnToRoom() + return + end + + local piao = evt_data["piao"] + local reload = evt_data["reload"] + self._cacheEvent:Enqueue( + function() + DispatchEvent(self._dispatcher, RB_GameEvent.OnPiaoTips, piao,reload) + ControllerManager.IsSendCard=true + end + ) +end + +function M:OnPiaoAction(evt_data) + local seat = evt_data["seat"] + local piao = evt_data["piao"] + if seat==DataManager.CurrenRoom.self_player.seat then + if self.PiaoTipsCallBack then + self.PiaoTipsCallBack() + self.PiaoTipsCallBack=nil + end + end + self._cacheEvent:Enqueue( + function() + DispatchEvent(self._dispatcher, RB_GameEvent.OnPiaoAction, seat,piao) + end + ) +end + + +function M:OnEventSendCards(evt_data) + printlog("发牌事件===》》》") + pt(evt_data) + if ViewManager.GetCurrenView().dview_class == LobbyView then + self:ReturnToRoom() + return + end + + local _room = self._room + _room.self_player.currentNotPutCardList={} + _room.curren_round = _room.curren_round + 1 + if _room.curren_round > 0 then _room.playing = true end + + local handcards = {} + if evt_data.card_list and #evt_data.card_list>0 then + handcards = evt_data["card_list"] + else + ViewUtil.ErrorTip(100000,"发牌数据异常") + end + + local p = _room.self_player + local seat =nil + if evt_data.bank_seat then + seat = evt_data["bank_seat"] + else + ViewUtil.ErrorTip(100001,"发牌座位异常") + end + + _room.banker_seat = seat + for i=1,#_room.player_list do + _room.self_player.handcard_list ={} + _room.self_player.card_list = {} + _room.player_list[i].hand_left_count = 20 + _room.player_list[i].fz_list = {} + _room.player_list[i].card_list = {} + _room.player_list[i].outcard_list = {} + _room.player_list[i].hu_xi = 0 + end + self._cacheEvent:Enqueue(function() + _room.self_player.handcard_list=handcards + self._room.self_player.hand_left_count = #handcards + DispatchEvent(self._dispatcher,RB_GameEvent.SendCards, p) + --print("发牌结束=====打开标志") + ControllerManager.IsSendCard=true + end) +end + +function M:OnEventOutCard(evt_data) + local seat = evt_data["seat"] + local card = evt_data["card"] + local p = self._room:GetPlayerBySeat(seat) + self._cacheEvent:Enqueue(function() + local _room = self._room + if(seat == _room.self_player.seat) then + list_remove(_room.self_player.handcard_list,card) + end + p.DiceCard = card + p.hand_left_count = p.hand_left_count -1 + DispatchEvent(self._dispatcher,RB_GameEvent.OutCard, p,card) + end) +end + +function M:OnEventQIPAI(evt_data) + local seat = evt_data["seat"] + local card = evt_data["card"] + local p = self._room:GetPlayerBySeat(seat) + self._cacheEvent:Enqueue(function() + local _room = self._room + if(not p.outcard_list) then p.outcard_list = {} end + p.outcard_list[#p.outcard_list+1] = card + DispatchEvent(self._dispatcher,RB_GameEvent.QiCard, seat,card) + end) +end + +function M:OnEventTakeCard(evt_data) + local _room = self._room + local seat = evt_data["seat"] + local card = evt_data["card"] + local left_count = evt_data["left_count"] + local p = _room:GetPlayerBySeat(seat) + self._cacheEvent:Enqueue(function() + if card ~=0 then + p.DiceCard = card + end + DispatchEvent(self._dispatcher,RB_GameEvent.GetCard, seat, card, left_count) + end) +end + +function M:OnAddCard(evt_data) + local _room = self._room + local seat = evt_data["seat"] + local card = evt_data["card"] + local p = _room:GetPlayerBySeat(seat) + + self._cacheEvent:Enqueue(function() + p.DiceCard = 0 + p.hand_left_count = p.hand_left_count +1 + if (seat == _room.self_player.seat) then + _room.self_player.handcard_list[#_room.self_player.handcard_list+1] = card + end + DispatchEvent(self._dispatcher,RB_GameEvent.AddCard, seat, card) + end) +end + +function M:OnEventOutHint(evt_data) + printlog("出牌提示事件===》》》") + pt(evt_data) + self._cacheEvent:Enqueue(function() + + DispatchEvent(self._dispatcher,RB_GameEvent.OutHint) + end) + +end + +function M:OnEventTurn(evt_data) + local seat = evt_data["seat"] + self._cacheEvent:Enqueue(function() + DispatchEvent(self._dispatcher,RB_GameEvent.EventTurn, seat) + end) +end + +function M:OnEventFzTips(evt_data) + printlog("放子提示事件===》》》") + pt(evt_data) + self._cacheEvent:Enqueue(function() + local tiplist = FZTipList.new() + local list = evt_data["tip_list"] + local uid = evt_data["uid"] + for i=1,#list do + local dtip = list[i] + local tip = {} + tip.id = dtip["id"] + tip.weight = dtip["weight"] + tip.card = dtip["card"] + tip.type = dtip["type"] + tip.bi_list = dtip["bi_list"] + if (dtip["opcard"]) then + local opcard = dtip["opcard"] + tip.OpCard = opcard + table.sort(tip.OpCard) + tip.OpCard[3] = tip.Card + end + tiplist:AddTip(tip) + + end + DispatchEvent(self._dispatcher,RB_GameEvent.FZTips, tiplist,uid) + end) +end + +function M:OnEventFzAction(evt_data) + printlog("放子行为提示事件===》》》") + pt(evt_data) + local _room = self._room + _room.self_player.currentNotPutCardList=evt_data["notput"] + local playerid = evt_data["playerid"] + local card = evt_data["card"] + local actice_card = evt_data["active_card"] + local ftype = evt_data["type"] + local from_seat = evt_data["from_seat"] + local opcard = evt_data["opcard"] + local huxi = evt_data["hu_xi"] + local p = _room:GetPlayerById(playerid) + self._cacheEvent:Enqueue(function() + local isNeedDelHandCard =0 + p.hu_xi = huxi + local fz = {} + fz.card = card + fz.type = ftype + fz.active_card = actice_card + fz.from_seat = from_seat + fz.opcard =opcard + local remove_num = #opcard + if ftype == RB_FZType.Chi then + p.fz_list[#p.fz_list+1] = fz + if (p == _room.self_player) then + for i=1,remove_num do + list_remove(_room.self_player.handcard_list,opcard[i]) + end + end + elseif ftype == RB_FZType.Bi then + p.fz_list[#p.fz_list+1] = fz + if (p == _room.self_player) then + for i=1,remove_num do + list_remove(_room.self_player.handcard_list,opcard[i]) + end + list_remove(_room.self_player.handcard_list,fz.card) + end + elseif ftype == RB_FZType.Peng then + p.fz_list[#p.fz_list+1] = fz + if (p == _room.self_player) then + for i=1,remove_num do + list_remove(_room.self_player.handcard_list,opcard[i]) + end + end + elseif ftype == RB_FZType.Kan then + if (p == _room.self_player) then + if #opcard==2 then + _room.self_player.handcard_list[#_room.self_player.handcard_list+1] = card + end + p.fz_list[#p.fz_list+1] = fz + end + elseif ftype == RB_FZType.ChouWei then + p.fz_list[#p.fz_list+1] = fz + if (p == _room.self_player) then + for i=1,2 do + list_remove(_room.self_player.handcard_list,opcard[i]) + end + end + elseif ftype == RB_FZType.Wei then + p.fz_list[#p.fz_list+1] = fz + if (p == _room.self_player) then + for i=1,remove_num do + list_remove(_room.self_player.handcard_list,opcard[i]) + end + end + elseif ftype == RB_FZType.Pao then + + if (p == _room.self_player) then + for i=1,#p.fz_list do + if p.fz_list[i].card == card then + if p.fz_list[i].type == RB_FZType.Kan then + isNeedDelHandCard =3 + for i=1,remove_num do + list_remove(_room.self_player.handcard_list,opcard[i]) + end + end + remove_num= 0 + p.fz_list[i].type= RB_FZType.Pao + end + end + local num =0 + for i=1,#_room.self_player.handcard_list do + if card == _room.self_player.handcard_list[i] then + num=num+1 + end + end + if num>0 then + isNeedDelHandCard =num + + for i=1,num do + list_remove(_room.self_player.handcard_list,card) + end + local isAddTi =false + for i=1,#p.fz_list do + if p.fz_list[i].card == card then + p.fz_list[i].type= RB_FZType.Pao + isAddTi=true + remove_num= 0 + end + end + if isAddTi==false then + p.fz_list[#p.fz_list+1] = fz + end + end + + else + local num =0 + for i=1,#p.fz_list do + if p.fz_list[i].card == card then + p.fz_list[i].type= RB_FZType.Pao + num=1 + remove_num= 0 + end + end + if num==0 then + p.fz_list[#p.fz_list+1] = fz + end + end + + elseif ftype == RB_FZType.Ti then + + if (p == _room.self_player) then + for i=1,#p.fz_list do + if p.fz_list[i].card == card then + if p.fz_list[i].type == RB_FZType.Kan then + isNeedDelHandCard =3 + for i=1,remove_num do + list_remove(_room.self_player.handcard_list,opcard[i]) + end + end + remove_num= 0 + p.fz_list[i].type= RB_FZType.Ti + end + end + local num =0 + for i=1,#_room.self_player.handcard_list do + if card == _room.self_player.handcard_list[i] then + num=num+1 + end + end + if num>0 then + isNeedDelHandCard =num + + for i=1,num do + list_remove(_room.self_player.handcard_list,card) + end + local isAddTi =false + for i=1,#p.fz_list do + if p.fz_list[i].card == card then + p.fz_list[i].type= RB_FZType.Ti + remove_num= 0 + isAddTi=true + end + end + if isAddTi==false then + p.fz_list[#p.fz_list+1] = fz + end + end + + else + local num =0 + for i=1,#p.fz_list do + if p.fz_list[i].card == card then + p.fz_list[i].type= RB_FZType.Ti + remove_num= 0 + num=1 + end + end + if num==0 then + p.fz_list[#p.fz_list+1] = fz + end + + end + + end + + + p.hand_left_count = p.hand_left_count - remove_num + --[[if fz.type == RB_FZType.Pao or fz.type == RB_FZType.Ti then + coroutine.start(function() + coroutine.wait(0.5) + DispatchEvent(self._dispatcher,RB_GameEvent.FangziAction, fz, p,isNeedDelHandCard) + end) + else + DispatchEvent(self._dispatcher,RB_GameEvent.FangziAction, fz, p,isNeedDelHandCard) + end--]] + DispatchEvent(self._dispatcher,RB_GameEvent.FangziAction, fz, p,isNeedDelHandCard) + + end) +end + +function M:OnEventHu(evt_data) + local cards = evt_data["card"] + local win_p = self._room:GetPlayerBySeat(evt_data["seat"]) + local lose_p = self._room:GetPlayerBySeat(evt_data["from_seat"]) + -- print(win_p.hand_left_count) + + self._cacheEvent:Enqueue(function() + win_p.card_list = cards + table.sort( win_p.card_list, ViewUtil.HandCardSort) + DispatchEvent(self._dispatcher,RB_GameEvent.ZPHuCard, evt_data["seat"],evt_data["from_seat"],cards) + end) +end + +function M:OneventResult1(evt_data) + printlog("结算=============>>>") + pt(evt_data) + local over = evt_data.type + --0:小结算 1:小大结算 2:大结算 + self._room.playing = false + if 0 == over then + local result = evt_data.result + for i = 1, #self._room.player_list do + local p = self._room.player_list[i] + p.hand_left_count = 0 + p.outcard_list = {} + end + self._cacheEvent:Enqueue(function() + DispatchEvent(self._dispatcher,RB_GameEvent.ZPResult1, result); + end) + elseif 1 == over or 2 == over then + DataManager.CurrenRoom.Over = true + ControllerManager.SetGameNetClient(nil,true) + local total_result = evt_data.total_result + local result = evt_data.result + self._cacheEvent:Enqueue(function() + DispatchEvent(self._dispatcher,RB_GameEvent.ZPResult2, result, total_result, over); + end) + end +end + +return M \ No newline at end of file diff --git a/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/EXGameInfo.lua b/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/EXGameInfo.lua new file mode 100644 index 00000000..1969f2d8 --- /dev/null +++ b/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/EXGameInfo.lua @@ -0,0 +1,191 @@ +local EXGameInfo = {} + +local M = EXGameInfo + +function EXGameInfo.new(blur_view) + setmetatable(M, {__index = IGameInfo}) + local self = setmetatable({}, {__index = M}) + self.class = 'EXGameInfo' + UIPackage.AddPackage('extend/zipai/fanpaofa/ui/Extend_Poker_FanPaoFa') + UIPackage.AddPackage('extend/zipai/fanpaofa/ui/Info_Poker_FanPaoFa') + return self +end + +function M:FillData() + self._maxPlayer = 3 -- 默认玩家人数 + self._roundChoice = 3 -- 回合选项数 + self._config = UIPackage.CreateObjectFromURL('ui://Info_Poker_FanPaoFa/Cgm_create_room') + + if oldGameVersion ==1 then + --self._config:GetChild("xipai").visible=false + end + + + if oldGameVersion==2 then + self._config:GetController("xipai").selectedIndex=1 + self.xipaiValueText=self._config:GetChild('xipaifen') + self.xipaiValueText.text=1 + self.xipaiValue=1 + + + + local btn_cr = self._config:GetChild('sdsrbtn') + btn_cr.onClick:Set( + function() + + local gniv = GroupNumberInputView_Game.new(nil, function(num) + + local value = limit + if otype == 1 then + value = value + ad2d(num) + elseif otype == - 1 then + value = value - ad2d(num) + else + value = ad2d(num) + end + + if value < 0 then + ViewUtil.ErrorTip(1,"输入数据异常!") + end + + self.xipaiValueText.text=value/1000 + self.xipaiValue=value/1000 + + end, 3, nil) + gniv:Show() + + + end + ) + + end + + +end +local _help_url = 'ui://Info_Poker_FanPaoFa/Com_help' +function M:GetHelpUrl() + return _help_url +end + +local _icon_url = "ui://Info_Poker_FanPaoFa/icon" +function M:GetIconUrl() + return _icon_url +end + +local _icon_url1 = "ui://Info_Poker_FanPaoFa/icon1" +function M:GetIconUrl1() + return _icon_url1 +end + + +function M:SelectedConfigData() + local _config = self._config + local round = _config:GetController('round').selectedIndex+1 --局数 + local Cost = _config:GetController('Cost').selectedIndex + local renshu = _config:GetController('renshu').selectedIndex+2 --人数 + local shoupai = _config:GetController('shoupai').selectedIndex --手牌 + local choupai = _config:GetController('choupai').selectedIndex --抽牌 + local hunum = _config:GetController('hunum').selectedIndex --多少起胡 0:6,1:10,2:15 + + local daniao = _config:GetController('daniao').selectedIndex --多少起胡 0:6,1:10,2:15 + + --名堂-- + local tiandihu = _config:GetChild('btn_tiandihu').selected + local honghu = _config:GetChild('btn_honghu').selected + local shisanhong = _config:GetChild('btn_shisanhong').selected + local wuhu = _config:GetChild('btn_wuhu').selected + local yidianhong = _config:GetChild('btn_yidianhong').selected + local yikuaibian = _config:GetChild('btn_yikuaibian').selected + local haidihu = _config:GetChild('btn_haidihu').selected + local kahu = _config:GetChild('btn_kahu').selected + local mingwei = _config:GetChild('btn_mingwei').selected + + + + if shoupai==1 then + hunum=0 + end + if shoupai==0 and hunum==0 then + _config:GetController('hunum').selectedIndex = 1 + end + + local _data = {} + + _data['opt'] = round -- 1 2 8局 16 局 + _data['AA'] = Cost + _data['maxPlayers'] = renshu + _data['shoupai'] = shoupai --手牌 + _data["choupai"] = choupai --抽牌 + _data['hunum'] = hunum --胡息计算 + _data['daniao'] = daniao --打鸟 + _data['tiandihu'] = tiandihu --天地胡 + _data['honghu'] = honghu --红胡 + _data['shisanhong'] = shisanhong --十三红 + _data['wuhu'] = wuhu --乌胡 + _data['yidianhong'] = yidianhong --一点红 + _data['yikuaibian'] = yikuaibian --一块扁 + _data['haidiliao'] = haidihu --海底胡 + _data['kahu'] = kahu --卡胡 + _data['mingwei'] = mingwei --明偎 + + + + + local xi_pai=false + if oldGameVersion ==2 then + if _config:GetChild("xipai") then + --xi_pai = _config:GetChild("xipai").selected + xi_pai = true + end + end + + _data['xi_pai'] = xi_pai + local xi_pai_score=0 + + if oldGameVersion==2 then + xi_pai_score=self.xipaiValue + end + _data['xi_pai_score'] = xi_pai_score*1000 + + return _data +end + +function M:LoadConfigData(data) + local _config = self._config + -- data.mode=3 + _config:GetController('round').selectedIndex = data.opt - 1 --== 1 and 0 or 1 + _config:GetController('Cost').selectedIndex = data.AA + _config:GetController('renshu').selectedIndex = data.maxPlayers == 2 and 0 or 1 + + _config:GetController('shoupai').selectedIndex = data.shoupai --手牌 + _config:GetController('choupai').selectedIndex = data.choupai --抽牌 + _config:GetController('hunum').selectedIndex = data.hunum --起胡息 + _config:GetController('daniao').selectedIndex = data.daniao --打鸟 0不打,1:10,2:20,3:50 + + _config:GetChild('btn_tiandihu').selected = data.tiandihu --天地胡 + _config:GetChild('btn_honghu').selected = data.honghu --红胡 + _config:GetChild('btn_shisanhong').selected = data.shisanhong --十三红 + _config:GetChild('btn_wuhu').selected = data.wuhu --乌胡 + _config:GetChild('btn_yidianhong').selected = data.yidianhong --一点红 + _config:GetChild('btn_yikuaibian').selected = data.yikuaibian --一块扁 + _config:GetChild('btn_haidihu').selected = data.haidihu --海底胡 + _config:GetChild('btn_kahu').selected = data.kahu --卡胡 + _config:GetChild('btn_mingwei').selected = data.mingwei --明偎 + + if oldGameVersion==2 then + self.xipaiValueText.text=data.xi_pai_score/1000 + self.xipaiValue=data.xi_pai_score/1000 + end + +end +function M:OnChangeOption(ctype) + IGameInfo.OnChangeOption(self, ctype) + local people = self._config:GetController('renshu') + people.onChanged:Set( + function() + self._maxPlayer = people.selectedIndex == 0 and 2 or 3 + self:ShowVariablePrice(ctype) + end + ) +end +return M diff --git a/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/EXMainView.lua b/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/EXMainView.lua new file mode 100644 index 00000000..0093738b --- /dev/null +++ b/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/EXMainView.lua @@ -0,0 +1,1102 @@ +local SettingView = import('.main.ZPSettingView') +local PlayerSelfCardInfoView = import('.PlayerSelfCardInfoView') +local PlayerCardInfoView = import('.PlayerCardInfoView') +local ZPMainView = import('.main.ZPMainView') +local GameEvent = import('.RunBeard_GameEvent') +local RunBeard_ResultView = import('.RunBeard_ResultView') +local PlayerInfoView = import(".EXPlayerInfoView") + +local M = {} +local Fix_Msg_Chat = { + '在搞么的,出牌撒', + '又掉线哒!', + '和你打牌太有味了', + '人呢?还搞不搞滴', + '哈哈,对不住了', + '稍等哈哈,马上就来', + '不要走,决战到天亮', + '牌打得不错嘛!', + '今朝这个方位硬是不好', + '不好意思临时有事,申请解散!' +} + +--- Create a new ZZ_MainView +function M.new() + setmetatable(M, {__index = ZPMainView}) + local self = setmetatable({}, {__index = M}) + self.class = 'RunBeard_MainView' + self._full = true + self:init() + return self +end + +function M:getCardItem(card_1, card_2) + if self._room.change_card_display ~= nil then + return card_1 .. self._room.change_card_display .. card_2 + else + return card_1 .. '2_' .. card_2 + end +end +function M:InitView(url) + local _room = self._room + self.Fix_Msg_Chat = Fix_Msg_Chat + ViewUtil.PlayMuisc('FanPaoFa_ZP', 'extend/zipai/fanpaofa/sound/bg.mp3') + UIPackage.AddPackage('extend/zipai/fanpaofa/ui/Extend_Poker_FanPaoFa') + ZPMainView.InitView(self, 'ui://Main_RunBeard/Main_' .. _room.room_config.people_num, false, false, 1.2, 8) + + self:PlayerChangeLineState() + SettingView.onEXMainCallback = handler(self, self.UpdateCardDisplay) + SettingView.onUpdataCardSizeCallback = handler(self, self.UpdateCardSize) + + if DataManager.CurrenRoom.change_card_display==nil then + self:UpdateCardDisplay(2) + end + for i = 1, #_room.player_list do + local p = _room.player_list[i] + local head = self._player_info[self:GetPos(p.seat)] + head:UpdateScore() + end + + if _room.playing or _room.curren_round > 0 then + self:ReloadRoom() + end + self._view:GetController('jushu').selectedIndex = 1 + self:setBtn() +end + +function M:setBtn() + local rightpanel = self._view:GetChild('right_panel') + local btn_rule = rightpanel:GetChild('btn_log') + local gcm_chat = self._view:GetChild('gcm_chat') + local _btn_chat = gcm_chat:GetChild('n1') + _btn_chat:GetChild('icon').icon = 'ui://Main_RunBeard/chat_img' + local btn_record = gcm_chat:GetChild('btn_record') + btn_record:GetChild('icon').icon = 'ui://Main_RunBeard/yuyin_img' + + if btn_rule ~= nil then + btn_rule.onClick:Set( + function() + if self.RuleView == nil or self.RuleView._is_destroy then + self.RuleView = RoomInfoView.new(self._room) + end + self.RuleView:Show() + end + ) + end + local btn_setting = self._view:GetChild('btn_setting') + btn_setting.onClick:Set( + function() + local _settingView = self:NewSettingView(1) + _settingView.stateIndex = (self._room.curren_round >= 1 and self._allow_dissmiss) and 2 or 1 + _settingView.cd_time = self.dismiss_room_cd_time + _settingView:Show() + + local room = DataManager.CurrenRoom + _settingView.onCallback:Add( + function(context) + local _gamectr = ControllerManager.GetController(GameController) + if (room.CurnrenState == StateType.Ready) then + _gamectr:LevelRoom( + function(response) + if (response.ReturnCode == 0) then + ViewManager.ChangeView(ViewManager.View_Lobby) + GameApplication.Instance:ShowTips('房间已解散!') + end + end + ) + else + _gamectr:AskDismissRoom( + function(res) + ViewUtil.ErrorTip(res.ReturnCode, '') + end + ) + end + end + ) + end + ) + local tex_roomid = rightpanel:GetChild('tex_roomid') + tex_roomid.text = self._room.room_id + if self._room.room_config.isHidden and self._room.room_config.isHidden == 1 then + tex_roomid.text = "000000" + end +end + +function M:InitPlayerInfoView() + self._player_info = {} + local _player_info = self._player_info + for i = 1, self._room.room_config.people_num do + local tem = self._view:GetChild("player_info" .. i) + _player_info[i] = PlayerInfoView.new(tem,self) + tem.visible = false + end +end + + +function M:NewPlayerCardInfoView(view, index) + if index == 1 then + return PlayerSelfCardInfoView.new(view, self) + end + return PlayerCardInfoView.new(view, self) +end +function M:closeTipOnTuoguan() + if self._clearingView ~= nil then + self._clearingView:Close() + end + self:__CloseTip() +end +function M:EventInit() + MainView.EventInit(self) + local _room = self._room + local _view = self._view + local _player_info = self._player_info + local _gamectr = self._gamectr + + _gamectr:AddEventListener(GameEvent.EventXiPai,function( ... ) + local arg = {...} + local currentPlayer1=arg[1] + local currentPlayer2=arg[2] + self._popEvent = false + if ( currentPlayer1 ) then + + local xipaiCB=function () + self._popEvent = true + end + self:PlayXiPai(xipaiCB) + + end + + + if ( currentPlayer2 ) then + --self._popEvent = false + local xipaiCB2=function () + self._popEvent = true + end + self:PlayXiPai1(xipaiCB2) + end + + + end) + + _gamectr:AddEventListener(GameEvent.OnPiaoTips, function(...) + local arg = {...} + local piao = arg[1] + local reload = arg[2] + if reload==0 then + --self._popEvent = false + self._leftcard = 1 + self._leftcard = 1 + local rightpanel = self._view:GetChild('right_panel') + local tex_round = rightpanel:GetChild('tex_round') + if tex_round ~= nil then + tex_round.text = '第 ' .. _room.curren_round .. ' 局' + end + self._view:GetChild('tex_round').text = '第 ' .. _room.curren_round .. '/' .. _room.room_config.round .. ' 局' + + self._state.selectedIndex = 1 + self:closeTipOnTuoguan() + local list = _room.player_list + for i = 1, #list do + local p = list[i] + p.hu_xi = 0 + local _info = self._player_card_info[self:GetPos(p.seat)] + _info:SetPlayer(p) + local info = self._player_info[self:GetPos(p.seat)] + info:FillData(p) + info:MarkBank(p.seat == _room.banker_seat) + info:Ready(false) + info:UpdatePiao(-1) + info._view:GetController('huxi').selectedIndex = 1 + info._view:GetChild('huxi').text = p.hu_xi + info._view:GetController('zhanji').selectedIndex = 0 + + if _room.hpOnOff == 1 or _room:checkHpNonnegative() then + if p.total_hp == nil then + p.total_hp = 0 + end + info._view:GetController('zhanji').selectedIndex = 1 + info._view:GetChild('tex_jifen').text = d2ad(p.total_hp) + end + end + + end + --local card_info = self._player_card_info[1] + --card_info:UpdateIsOnClick(false) + --card_info:InitHandCard(true) + printlog("飘分提示==>>>") + + self._player_card_info[1]:ShowPiao(piao) + end) + + + _gamectr:AddEventListener(GameEvent.OnPiaoAction, function(...) + local arg = {...} + local seat = arg[1] + local piao = arg[2] + local head_info = self._player_info[self:GetPos(seat)] + head_info:UpdatePiao(piao) + end) + + _gamectr:AddEventListener( + GameEvent.SendCards, + function(...) + self._popEvent = false + self._leftcard = 1 + self._leftcard = 1 + local rightpanel = self._view:GetChild('right_panel') + local tex_round = rightpanel:GetChild('tex_round') + if tex_round ~= nil then + tex_round.text = '第 ' .. _room.curren_round .. ' 局' + end + self._view:GetChild('tex_round').text = '第 ' .. _room.curren_round .. '/' .. _room.room_config.round .. ' 局' + + self._state.selectedIndex = 1 + self:closeTipOnTuoguan() + local list = _room.player_list + for i = 1, #list do + local p = list[i] + p.hu_xi = 0 + local _info = self._player_card_info[self:GetPos(p.seat)] + _info:SetPlayer(p) + local info = self._player_info[self:GetPos(p.seat)] + info:FillData(p) + info:MarkBank(p.seat == _room.banker_seat) + info:Ready(false) + info._view:GetController('huxi').selectedIndex = 1 + info._view:GetChild('huxi').text = p.hu_xi + info._view:GetController('zhanji').selectedIndex = 0 + + if _room.hpOnOff == 1 or _room:checkHpNonnegative() then + if p.total_hp == nil then + p.total_hp = 0 + end + info._view:GetController('zhanji').selectedIndex = 1 + info._view:GetChild('tex_jifen').text = d2ad(p.total_hp) + end + end + local card_info = self._player_card_info[1] + card_info:UpdateIsOnClick(false) + card_info:InitHandCard(true) + end + ) + + _gamectr:AddEventListener( + GameEvent.GetCard, + function(...) + local arg = {...} + local seat = arg[1] + local card = arg[2] + local _leftcard = arg[3] + self._left_time = 15 + self._tex_LeftCard.text = '剩余 ' .. _leftcard .. ' 张牌' + local info = self._player_card_info[self:GetPos(seat)] + info:UpdateOutCardList(card, true, true, self:GetPos(seat)) + if card ~= 0 then + local p = _room:GetPlayerBySeat(seat) + self:PlaySound(p.self_user.sex, 'F_' .. card) + else + self._popEvent = false + coroutine.start( + function() + coroutine.wait(0.5) + self._popEvent = true + info:ClearOutCard() + end + ) + end + end + ) + _gamectr:AddEventListener( + GameEvent.AddCard, + function(...) + local arg = {...} + local seat = arg[1] + local card = arg[2] + self._popEvent = false + local info = self._player_card_info[self:GetPos(seat)] + coroutine.start( + function() + coroutine.wait(0.5) + if seat == self._room.self_player.seat then + info:InitHandCard(false) + end + info:ClearOutCard() + self._popEvent = true + end + ) + end + ) + + _gamectr:AddEventListener( + GameEvent.EventTurn, + function(...) + local arg = {...} + local seat = arg[1] + local list = _room.player_list + local readyNum = 0 + for i = 1, #list do + local p = list[i] + local info = self._player_info[self:GetPos(p.seat)] + info._view:GetController('time').selectedIndex = 0 + end + local info = self._player_info[self:GetPos(seat)] + info._view:GetController('time').selectedIndex = 1 + end + ) + _gamectr:AddEventListener( + GameEvent.OutHint, + function(...) + _room.curren_outcard_seat = _room.self_player.seat + coroutine.start( + function() + coroutine.wait(0.5) + local info = self._player_card_info[self:GetPos(_room.self_player.seat)] + info:ChuPaiTiShi() + end + ) + end + ) + + _gamectr:AddEventListener( + GameEvent.OutCard, + function(...) + self:__CloseTip() + self._left_time = 0 + local arg = {...} + local p = arg[1] + local card = arg[2] + local seat = p.seat + local info = self._player_card_info[self:GetPos(seat)] + self:PlaySound(p.self_user.sex, 'F_' .. card) + if seat == self._room.self_player.seat then + _room.curren_outcard_seat = -1 + info:DeleteHandCard(card) + info:UpdateIsOnClick(true) + info:SendChangeCard() + info:ChuPaiTiShi() + end + local list = _room.player_list + for i = 1, #list do + local p = list[i] + local info = self._player_info[self:GetPos(p.seat)] + info._view:GetController('time').selectedIndex = 0 + end + info:UpdateOutCardList(card, true, false, self:GetPos(seat)) + if self._leftcard == 1 then + self._leftcard = 0 + for i = 1, #_room.player_list do + local p = _room.player_list[i] + local card_info = self._player_card_info[self:GetPos(p.seat)] + card_info:UpdateFzList(p.fz_list, false, p.seat) + end + end + end + ) + + _gamectr:AddEventListener( + GameEvent.QiCard, + function(...) + self:__CloseTip() + self._popEvent = false + self._left_time = 0 + local arg = {...} + local seat = arg[1] + local card = arg[2] + local p = _room:GetPlayerBySeat(seat) + local info = self._player_card_info[self:GetPos(seat)] + info:PlayingOutCardAnima(p.DiceCard) + p.DiceCard = 0 + info:UpdateQiPai(p.outcard_list, true, seat) + self._popEvent = true + end + ) + _gamectr:AddEventListener( + GameEvent.FZTips, + function(...) + local arg = {...} + local _tip = arg[1] + local _uid = arg[2] + self:__FangziTip(_tip, _uid) + end + ) + + _gamectr:AddEventListener(GameEvent.FangziAction, handler(self, self.OnFangziAction)) + + _gamectr:AddEventListener( + GameEvent.ZPHuCard, + function(...) + self._left_time = 0 + self:__CloseTip() + self._popEvent = false + local arg = {...} + local w = arg[1] + local l = arg[2] + local cards = arg[3] + local info = self._player_card_info[self:GetPos(w)] + -- info:UpdateHandCard() + + local url = 'ui://Extend_Poker_FanPaoFa/别人胡' + local pNode = info._mask_liangpai + local player = _room:GetPlayerBySeat(w) + if w == _room.self_player.seat then + url = 'ui://Extend_Poker_FanPaoFa/自己胡牌' + pNode = self._view + end + self:PlaySound(player.self_user.sex, 'F_Hu') + local he = UIPackage.CreateObjectFromURL(url) + he:GetTransition('t2'):Play() + if w == _room.self_player.seat then + he:Center() + end + pNode:AddChild(he) + coroutine.start( + function() + coroutine.wait(0.7) + he:Dispose() + self._popEvent = true + end + ) + end + ) + + _gamectr:AddEventListener( + GameEvent.ZPResult1, + function(...) + self._popEvent = false + self._left_time = 0 + local arg = {...} + local result = arg[1] + local liuju = result.liuju + local data = result.info_list + local x = {} + self._hu_tip:FillData(x) + self:__CloseTip() + if self._clearingView == nil then + if liuju == true then + self._clearingView = RunBeard_ResultView.new(self._view, 1) + else + self._clearingView = RunBeard_ResultView.new(self._view) + end + end + coroutine.start( + function() + coroutine.wait(0.5) + -- if self._clearingView._is_destroy then return end + self._clearingView:Show() + if _room.curren_round ~= _room.room_config.round then + for i = 1, #data do + local p = _room:GetPlayerBySeat(data[i].seat) + local card_info = self._player_card_info[self:GetPos(p.seat)] + local info = self._player_info[self:GetPos(p.seat)] + p.total_score = data[i].total_score + p.cur_hp = data[i]['cur_hp'] or 0 + p.total_hp = data[i]['total_hp'] or 0 + if data[i]['hp_info'] then + p.cur_hp = data[i].hp_info.cur_hp + p.total_hp = data[i].hp_info.total_hp == nil and 0 or data[i].hp_info.total_hp + info._view:GetController('zhanji').selectedIndex = 0 + if _room.hpOnOff == 1 or _room:checkHpNonnegative() then + info._view:GetController('zhanji').selectedIndex = 1 + info._view:GetChild('tex_jifen').text = d2ad(p.total_hp) + end + end + + card_info:Clear() + info:UpdateScore() + end + local list = _room.player_list + for i = 1, #list do + local p = list[i] + local info = self._player_info[self:GetPos(p.seat)] + info._view:GetController('time').selectedIndex = 0 + end + + for i = 1, #_room.player_list do + _room.self_player.handcard_list = {} + _room.player_list[i].DiceCard = nil + _room.player_list[i].hand_left_count = 20 + _room.player_list[i].fz_list = {} + _room.player_list[i].card_list = {} + _room.player_list[i].outcard_list = {} + _room.player_list[i].hu_xi = 0 + end + end + self._popEvent = true + end + ) + if _room.curren_round ~= _room.room_config.round then + self._clearingView:InitData( + 0, + _room, + result, + nil, + function(...) + self._state.selectedIndex = 2 + self._clearingView = nil + end + ) + end + end + ) + + _gamectr:AddEventListener( + GameEvent.ZPResult2, + function(...) + self._left_time = 0 + local arg = {...} + local total_result = arg[2] + local result = arg[1] + local over = arg[3] + local x = {} + self._hu_tip:FillData(x) + self:__CloseTip() + self:UnmarkSelfTuoguan() + self._clearingView = RunBeard_ResultView.new() + coroutine.start( + function() + coroutine.wait(0.5) + self._clearingView:Show() + end + ) + self._clearingView:InitData(over, _room, result, total_result) + ControllerManager.ChangeController(LoddyController) + end + ) +end + +function M:OutCard(card_item) + local _gamectr = ControllerManager.GetController(GameController) + self._room.curren_outcard_seat = -1 + _gamectr:SendOutCard(card_item) +end + +--改变牌队形 +function M:ChangeCards(list) + local _gamectr = ControllerManager.GetController(GameController) + if _gamectr then + _gamectr:SendChangeCards(list) + end +end + +function M:__FangziTip(tip, _uid) + local _gamectr = self._gamectr + local _chipeng_tip = UIPackage.CreateObject('Main_RunBeard', 'Gcm_action_tips') + self._chipeng_tip = _chipeng_tip + local p = self._room.self_player + + local _lit_fanzi = _chipeng_tip:GetChild('lit_fanzi') + _lit_fanzi:RemoveChildrenToPool() + local _tlist = table.keys(tip.tip_map_type) + local tip_hu = false + local count = #_tlist + for k = 1, #_tlist do + local td = tip.tip_map_type[_tlist[k]][1] + if td.type == 8 then + tip_hu = true + end + end + for k = 1, #_tlist do + local td = tip.tip_map_type[_tlist[k]][1] + local url = 'ui://Main_RunBeard/Btn_fztip' + local btn_t = _lit_fanzi:AddItemFromPool(url) + if td.type==8 then + btn_t:GetChild("hupai").icon="ui://Main_RunBeard/201_1_" .. td.card + btn_t:GetController("hupai").selectedIndex=1 + end + btn_t.icon = 'ui://Main_RunBeard/newop_' .. td.type + btn_t.data = {tip, td, tip_hu} + btn_t.onClick:Set(self.__TipAction, self) + end + if p.hand_left_count ~= 0 then + local _btn_pass = _lit_fanzi:AddItemFromPool('ui://Main_RunBeard/Btn_pass_new') + _btn_pass.onClick:Set( + function() + if tip_hu then + local guo_msg = MsgWindow.new(self._root_view, '确定取消胡吗?', MsgWindow.MsgMode.OkAndCancel) + guo_msg.onOk:Add( + function() + _gamectr:SendAction(_uid) + _chipeng_tip:Dispose() + self._chipeng_tip = nil + guo_msg:Close() + end + ) + + guo_msg:Show() + else + _gamectr:SendAction(_uid) + _chipeng_tip:Dispose() + self._chipeng_tip = nil + end + end + ) + end + + self._view:AddChild(_chipeng_tip) + _chipeng_tip:Center() + _chipeng_tip.x = _chipeng_tip.x + 200 + _chipeng_tip.y = _chipeng_tip.y - 50 +end +function M:__TipAction(context) + local data = context.sender.data + local _gamectr = self._gamectr + local tip = data[1] + local td = data[2] + local tip_hu = data[3] + local list = tip.tip_map_type[td.weight] + if (#list > 1) or td.type == 1 then + self:_ChiView( + list, + tip_hu, + function(id) + if tip_hu and td.type ~= 8 then + local guo_msg = MsgWindow.new(self._root_view, '确定取消胡吗?', MsgWindow.MsgMode.OkAndCancel) + guo_msg.onOk:Add( + function() + _gamectr:SendAction(id) + guo_msg:Close() + self:__CloseTip() + local info = self._player_card_info[1] + info:UpdateIsOnClick(false) + end + ) + guo_msg:Show() + else + _gamectr:SendAction(id) + self:__CloseTip() + local info = self._player_card_info[1] + info:UpdateIsOnClick(false) + end + end + ) + --self._chipeng_tip.visible = false + return + end + if tip_hu and td.type ~= 8 then + local guo_msg = MsgWindow.new(self._root_view, '确定取消胡吗?', MsgWindow.MsgMode.OkAndCancel) + guo_msg.onOk:Add( + function() + _gamectr:SendAction(td.id) + guo_msg:Close() + local info = self._player_card_info[1] + info:UpdateIsOnClick(false) + if (self._chipeng_tip == nil) then + return + end + self._chipeng_tip:Dispose() + self._chipeng_tip = nil + end + ) + guo_msg:Show() + else + _gamectr:SendAction(td.id) + local info = self._player_card_info[1] + info:UpdateIsOnClick(false) + if (self._chipeng_tip == nil) then + return + end + self._chipeng_tip:Dispose() + self._chipeng_tip = nil + end +end + +function M:_ChiView(tip_list, tip_hu, callback) + local _pop_tip_choice = UIPackage.CreateObject('Main_RunBeard', 'Pop_tip_choice') + local list_choose = _pop_tip_choice:GetChild('Lst_choose') + _pop_tip_choice:GetChild('dibtn').onClick:Add( + function() + _pop_tip_choice:Dispose() + end + ) + + list_choose:RemoveChildrenToPool() + for i = 1, #tip_list do + if tip_list[i].weight ~= 4 then + local item_choose = list_choose:AddItemFromPool() + item_choose:GetChild('card' .. 2).icon = + UIPackage.GetItemURL('Main_RunBeard', self:getCardItem('201_', tip_list[i].OpCard[1])) + item_choose:GetChild('card' .. 3).icon = + UIPackage.GetItemURL('Main_RunBeard', self:getCardItem('201_', tip_list[i].OpCard[2])) + item_choose:GetChild('card' .. 1).icon = + UIPackage.GetItemURL('Main_RunBeard', self:getCardItem('201_', tip_list[i].card)) + + item_choose.onClick:Add( + function() + for k = 1, list_choose.numChildren do + list_choose:GetChildAt(k - 1):GetController('zhong').selectedIndex = 0 + end + item_choose:GetController('zhong').selectedIndex = 1 + if tip_list[i].bi_list == nil then + callback(tip_list[i].id) + else + self.bilist = {} + self._chiid = tip_list[i].id + self:CheckRatioCard(tip_list[i].bi_list, 1, tip_list[i].card) + end + end + ) + end + end + list_choose:ResizeToFit(#tip_list) + _pop_tip_choice:GetChild('di1').width = list_choose.width + 110 + _pop_tip_choice.xy = Vector2((self._view.width - _pop_tip_choice.width) / 2, -100) + self._view:AddChild(_pop_tip_choice) + self._pop_tip_choice = _pop_tip_choice +end + +function M:CheckRatioCard(_tiplist, index, chicard, _biid, list) + if _biid ~= nil then + self.bilist = {} + self.bilist[#self.bilist + 1] = _biid + end + if self._pop_tip_choice == nil then + -- statements + return + end + self._pop_tip_choice:GetController('bipai').selectedIndex = index + local Bilist_choose = self._pop_tip_choice:GetChild('Bi_Lst_choose' .. index) + Bilist_choose:RemoveChildrenToPool() + for i = 1, #_tiplist do + local item = UIPackage.CreateObjectFromURL('ui://Main_RunBeard/Comp_choose') + local item_choose = Bilist_choose:AddChild(item) + item_choose:GetChild('card' .. 2).icon = + UIPackage.GetItemURL('Main_RunBeard', self:getCardItem('201_', _tiplist[i].opcard[1])) + item_choose:GetChild('card' .. 3).icon = + UIPackage.GetItemURL('Main_RunBeard', self:getCardItem('201_', _tiplist[i].opcard[2])) + item_choose:GetChild('card' .. 1).icon = + UIPackage.GetItemURL('Main_RunBeard', self:getCardItem('201_', chicard)) + item_choose:GetController('zhong').selectedIndex = 0 + item_choose.onClick:Add( + function() + for k = 1, Bilist_choose.numChildren do + Bilist_choose:GetChildAt(k - 1):GetController('zhong').selectedIndex = 0 + end + item_choose:GetController('zhong').selectedIndex = 1 + if _tiplist[i].bi_list == nil then + if index == 1 then + self.bilist = {} + end + self.bilist[#self.bilist + 1] = i - 1 + if tip_hu then + local guo_msg = MsgWindow.new(self._root_view, '确定取消胡吗?', MsgWindow.MsgMode.OkAndCancel) + guo_msg.onOk:Add( + function() + self._gamectr:SendAction(self._chiid, self.bilist) + guo_msg:Close() + self:__CloseTip() + local info = self._player_card_info[1] + info:UpdateIsOnClick(false) + end + ) + guo_msg:Show() + else + self._gamectr:SendAction(self._chiid, self.bilist) + self:__CloseTip() + local info = self._player_card_info[1] + info:UpdateIsOnClick(false) + end + else + self:CheckRatioCard(_tiplist[i].bi_list, 2, chicard, i - 1, #_tiplist) + end + end + ) + end + Bilist_choose:ResizeToFit(#_tiplist) + self._pop_tip_choice:GetChild('di' .. index + 1).width = Bilist_choose.width + 110 +end + +-- lua table 深拷贝 +function M:deepcopy(object) + local lookup_table = {} + local function _copy(object) + if type(object) ~= 'table' then + return object + elseif lookup_table[object] then + return lookup_table[object] + end + local new_table = {} + lookup_table[object] = new_table + for index, value in pairs(object) do + new_table[_copy(index)] = _copy(value) + end + return setmetatable(new_table, getmetatable(object)) + end + return _copy(object) +end + +function M:OnFangziAction(...) + local arg = {...} + local _player_card_info = self._player_card_info + local fz = arg[1] + local player = arg[2] + local num = arg[3] + --if fz.type == RB_FZType.Peng or fz.type == RB_FZType.Chi or fz.type == RB_FZType.Bi then + self:__CloseTip() + --end + if (player == self._room.self_player) then + local info = _player_card_info[self:GetPos(player.seat)] + info:UpdateIsOnClick(false) + end + self._popEvent = false + + local info = _player_card_info[self:GetPos(player.seat)] + info:UpdateFzList(player.fz_list, true, player.seat) --更新放子数组 + if (player == self._room.self_player) then + if fz.type == RB_FZType.Chi then + for i = 1, #fz.opcard do + info:DeleteHandCard(fz.opcard[i]) + end + elseif fz.type == RB_FZType.Bi then + for i = 1, #fz.opcard do + info:DeleteHandCard(fz.opcard[i]) + end + info:DeleteHandCard(fz.card) + elseif fz.type == RB_FZType.Peng then + for i = 1, #fz.opcard do + info:DeleteHandCard(fz.opcard[i]) + end + elseif fz.type == RB_FZType.Kan then + if #fz.opcard == 2 then + info:InitHandCard(false) + end + info:UpdateKan(fz.card) + elseif fz.type == RB_FZType.Wei then + for i = 1, #fz.opcard do + info:DeleteHandCard(fz.opcard[i]) + end + elseif fz.type == RB_FZType.ChouWei then + for i = 1, #fz.opcard do + info:DeleteHandCard(fz.opcard[i]) + end + elseif fz.type == RB_FZType.Pao then + if num > 0 then + for i = 1, #fz.opcard do + info:DeleteHandCard(fz.opcard[i]) + end + end + elseif fz.type == RB_FZType.Ti then + if num > 0 then + for i = 1, #fz.opcard do + info:DeleteHandCard(fz.opcard[i]) + end + end + end + coroutine.start( + function() + coroutine.wait(0.3) + if fz.type ~= RB_FZType.Kan then + info:SendChangeCard() + end + end + ) + end + if fz.type ~= RB_FZType.Kan and fz.type ~= RB_FZType.Bi then + local info = _player_card_info[self:GetPos(player.seat)] + local pNode = info._mask_liangpai + local effect = UIPackage.CreateObject('Extend_Poker_FanPaoFa', 'FzEffect') + + if fz.type == RB_FZType.Peng then + -- effect:GetChild("icon2").icon = UIPackage.GetItemURL("Main_RunBeard", "peng") + self:PlaySound(player.self_user.sex, 'F_Peng') + effect:GetChild('icon1').icon = UIPackage.GetItemURL('Main_RunBeard', 'peng') + elseif fz.type == RB_FZType.Chi then + -- effect:GetChild("icon2").icon = UIPackage.GetItemURL("Main_RunBeard", "chi") + self:PlaySound(player.self_user.sex, 'F_Chi') + effect:GetChild('icon1').icon = UIPackage.GetItemURL('Main_RunBeard', 'chi') + elseif fz.type == RB_FZType.Wei then + -- effect:GetChild("icon2").icon = UIPackage.GetItemURL("Main_RunBeard", "wei") + self:PlaySound(player.self_user.sex, 'F_Wai') + effect:GetChild('icon1').icon = UIPackage.GetItemURL('Main_RunBeard', 'wai') + elseif fz.type == RB_FZType.ChouWei then + -- effect:GetChild("icon2").icon = UIPackage.GetItemURL("Extend_Poker_RunBeard", "chouwei") + self:PlaySound(player.self_user.sex, 'F_Wai') + effect:GetChild('icon1').icon = UIPackage.GetItemURL('Extend_Poker_FanPaoFa', 'chouwei') + elseif fz.type == RB_FZType.Pao then + -- effect:GetChild("icon2").icon = UIPackage.GetItemURL("Main_RunBeard", "pao") + self:PlaySound(player.self_user.sex, 'F_KaiDuo') + effect:GetChild('icon1').icon = UIPackage.GetItemURL('Main_RunBeard', 'pao') + elseif fz.type == RB_FZType.Ti then + self:PlaySound(player.self_user.sex, 'F_SaoChuan') + effect:GetChild('icon1').icon = UIPackage.GetItemURL('Main_RunBeard', 'ti') + -- effect:GetChild("icon2").icon = UIPackage.GetItemURL("Main_RunBeard", "ti") + end + effect.touchable = false + effect.x, effect.y = 0, 0 + effect:GetTransition('t0'):Play() + pNode:AddChild(effect) + coroutine.start( + function() + coroutine.wait(1) + effect:Dispose() + end + ) + end + if (player == self._room.self_player) then + coroutine.start( + function() + coroutine.wait(0.5) + local info = _player_card_info[self:GetPos(player.seat)] + info:ShowHuTip() + end + ) + end + local removeOutcard = _player_card_info[self:GetPos(fz.from_seat)] + local p = self._room:GetPlayerBySeat(fz.from_seat) + if p.DiceCard ~= nil and fz.active_card == p.DiceCard then + removeOutcard:ClearOutCard() + p.DiceCard = nil + end + local list = self._room.player_list + for i = 1, #list do + local p = list[i] + local info = self._player_info[self:GetPos(p.seat)] + --print(p.hu_xi) + info._view:GetChild('huxi').text = p.hu_xi + end + + if player == self._room.self_player then + local info = _player_card_info[self:GetPos(player.seat)] + info:SetNotPutCard() + end + + self._popEvent = true + coroutine.start( + function() + coroutine.wait(0.15) + local info = _player_card_info[1] + info:UpdateIsOnClick(true) + end + ) +end + +function M:ReloadRoom() + local _gamectr = self._gamectr + local room = self._room + if not room.playing then + self._state.selectedIndex = 2 + else + self._state.selectedIndex = 1 + end + if room.discard == 0 then + self._leftcard = 1 + else + self._leftcard = 0 + end + for i = 1, #room.player_list do + local p = room.player_list[i] + if p.seat == room.banker_seat then + local head = self._player_info[self:GetPos(p.seat)] + head:MarkBank(true) + end + if p.ready then + self._player_info[self:GetPos(p.seat)]:Ready(true) + else + self._player_info[self:GetPos(p.seat)]:Ready(false) + end + + --if p.piao then + -- self._player_info[self:GetPos(p.seat)]:UpdatePiao(-1) + --else + self._player_info[self:GetPos(p.seat)]:UpdatePiao(p.piao) + --end + + if self._state.selectedIndex == 1 then + local info = self._player_info[self:GetPos(p.seat)] + info._view:GetController('huxi').selectedIndex = 1 + info._view:GetChild('huxi').text = p.hu_xi + info._view:GetController('zhanji').selectedIndex = 0 + if room.hpOnOff == 1 or room:checkHpNonnegative() then + if p.total_hp == nil then + p.total_hp = 0 + end + info._view:GetController('zhanji').selectedIndex = 1 + info._view:GetChild('tex_jifen').text = d2ad(p.total_hp) + end + end + + local card_info = self._player_card_info[self:GetPos(p.seat)] + card_info:UpdateQiPai(p.outcard_list) + card_info:UpdateFzList(p.fz_list, false, p.seat) + if p.DiceCard ~= nil and p.DiceCard ~= 0 then + card_info:UpdateOutCardList(p.DiceCard) + end + if DataManager.CurrenRoom.curren_outcard_seat == p.seat then + local info = self._player_info[self:GetPos(p.seat)] + info._view:GetController('time').selectedIndex = 1 + end + if p.seat == self._room.self_player.seat then + card_info:ChuPaiTiShi() + if + self._room.self_player.card_list ~= nil and + #self._room.self_player.handcard_list == #self._room.self_player.card_list + then + local _list = self:deepcopy(self._room.self_player.card_list) + local cards = {} + for i = 1, #_list do + cards[#cards + 1] = _list[i].card_item + end + table.sort(cards, ViewUtil.HandCardSort) + table.sort(self._room.self_player.handcard_list, ViewUtil.HandCardSort) + + local isNot = false + for i = 1, #cards do + if cards[i] ~= self._room.self_player.handcard_list[i] then + isNot = true + end + end + if isNot == true then + card_info:InitHandCard(false) + else + card_info:UpdateHandCards(self._room.self_player.card_list) + end + else + card_info:InitHandCard(false) + end + -- card_info:ChuPaiTiShi() + card_info:ShowHuTip() + for i = 1, #p.fz_list do + if p.fz_list[i].type == RB_FZType.Kan then + card_info:UpdateKan(3, p.fz_list[i].card) + end + end + end + end + + self._tex_LeftCard.text = '剩余 ' .. room.left_count .. ' 张牌' + local rightpanel = self._view:GetChild('right_panel') + local tex_round = rightpanel:GetChild('tex_round') + if tex_round ~= nil then + tex_round.text = '第 ' .. room.curren_round .. ' 局' + end + self._view:GetChild('tex_round').text = '第 ' .. room.curren_round .. '/' .. room.room_config.round .. ' 局' +end + +function M:PlayChatSound(sex, chat_index) + local sex_path = ViewUtil.Sex_Chat[sex] + local path1 = string.format('extend/zipai/fanpaofa/sound/%s/chat_%s.mp3', sex_path, tostring(chat_index)) + ViewUtil.PlaySound('FanPaoFa_ZP', path1) +end + +function M:PlaySound(sex, path) + local sex_path = ViewUtil.Sex_Chat[1] -- 1 男 2 女 + local sound_path = string.format('extend/zipai/fanpaofa/sound/%s/%s.mp3', sex_path, path) + ViewUtil.PlaySound('FanPaoFa_ZP', sound_path) +end + +function M:__CloseTip() + if (self._chipeng_tip) then + self._chipeng_tip:Dispose() + self._chipeng_tip = nil + end + if (self._pop_tip_choice) then + self._pop_tip_choice:Dispose() + self._pop_tip_choice = nil + end +end + +function M:Destroy() + ZPMainView.Destroy(self) + UIPackage.RemovePackage('extend/zipai/fanpaofa/ui/Extend_Poker_FanPaoFa') +end + +return M diff --git a/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/EXPlayBackView.lua b/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/EXPlayBackView.lua new file mode 100644 index 00000000..d6d9262e --- /dev/null +++ b/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/EXPlayBackView.lua @@ -0,0 +1,627 @@ +local ZPPlayBackView = import('.main.ZPPlayBackView') +local PlayerSelfCardInfoView = import('.PlayerSelfCardInfoView') +local PlayerCardInfoView = import('.PlayerCardInfoView') +local RunBeard_ResultView = import('.RunBeard_ResultView') +local M = {} + +local Record_Event = { + Evt_OutCard = 'OutCard', + Evt_GetCard = 'GetCard', + Evt_Action = 'Action', + Evt_ThrowCard = 'ThrowCard', + Evt_AddCard = 'AddCard', + Evt_ChangePaiXing = 'ChangePaiXing', + Evt_Win = 'Win', + Evt_result = 'result' +} + +local function tableSortNumber(a, b) + return a.card_code_number > b.card_code_number +end + +--- Create a new +function M.new() + setmetatable(M, {__index = PlayBackView}) + local self = setmetatable({}, {__index = M}) + self.class = 'PlayBackView' + self:init() + + return self +end + +function M:InitView(url) + local room = self._room + self._gamectr = ControllerManager.GetController(GameController) + UIPackage.AddPackage('base/main_zipai/ui/Main_RunBeard') + UIPackage.AddPackage('extend/zipai/fanpaofa/ui/Extend_Poker_FanPaoFa') + ZPPlayBackView.InitView(self, 'ui://Main_RunBeard/Main_' .. room.room_config.people_num) + UpdateBeat:Add(self.OnUpdate, self) + + local user_id = DataManager.SelfUser.account_id + local json_data = Utils.LoadLocalFile(user_id .. room.game_id) + if json_data ~= nil then + local _data = json.decode(json_data) + local typeface = _data['game_typeface'] + if typeface == 1 then + room.change_card_display = '2_' + else + room.change_card_display = '1_' + end + end + self._player_card_info = {} + local _player_card_info = self._player_card_info + for i = 1, room.room_config.people_num do + local tem = self._view:GetChild('player_card_info' .. i) + self._player_card_info[i] = self:NewPlayerPokerInfoView(tem, i) + end + local rightpanel = self._view:GetChild('right_panel') + self.btn_setting = rightpanel:GetChild('btn_setting') + self.btn_setting.visible = false + + self.tex_time = rightpanel:GetChild('tex_time') + self.tex_time.visible = false + + self.gcm_xinhao = rightpanel:GetChild('gcm_xinhao') + self.gcm_xinhao.visible = false + + self.pb_batteryLevel = rightpanel:GetChild('pb_batteryLevel') + self.pb_batteryLevel.visible = false + + local tex_round_item = rightpanel:GetChild('tex_round') + if tex_round_item ~= nil then + tex_round_item.text = '第 ' .. room.curren_round .. ' 局' + end + local btn_rule = rightpanel:GetChild('btn_log') + if btn_rule ~= nil then + btn_rule.onClick:Set( + function() + if self.RuleView == nil or self.RuleView._is_destroy then + self.RuleView = RoomInfoView.new(self._room) + end + self.RuleView:Show() + end + ) + end + local tex_roomid = rightpanel:GetChild('tex_roomid') + tex_roomid.text = room.room_id + rightpanel:GetChild('tex_gametype').text = room.room_config:GetGameName() + + self._tex_round = self._view:GetChild('tex_round') + self._tex_LeftCard = self._view:GetChild('remaining_card') + self._eventmap = {} + self._cmdmap = {} + self._cmdmap[Record_Event.Evt_OutCard] = self.CmdOutCard + self._cmdmap[Record_Event.Evt_GetCard] = self.CmdGetCard + self._cmdmap[Record_Event.Evt_Action] = self.CmdAction + self._cmdmap[Record_Event.Evt_ThrowCard] = self.CmdThrowCard + self._cmdmap[Record_Event.Evt_AddCard] = self.CmdAddCard + self._cmdmap[Record_Event.Evt_Win] = self.CmdWin + self._cmdmap[Record_Event.Evt_ChangePaiXing] = self.CmdChangePaiXing + self._cmdmap[Record_Event.Evt_result] = self.onResult +end + +function M:NewPlayerPokerInfoView(view, index) + if index == 1 then + return PlayerSelfCardInfoView.new(view, self) + end + return PlayerCardInfoView.new(view, self) +end + +function M:FillRoomData(data) + if self._win_pic then + self._win_pic:Dispose() + end + self._currentStep = 0 + local room = DataManager.CurrenRoom + local _player_card_info = self._player_card_info + local roominfo_panel = self._view:GetChild('roominfo_panel1') + roominfo_panel:GetChild('tex_roomid').text = room.room_id + roominfo_panel:GetChild('tex_gametype').text = room.room_config:GetGameName() + for i = 1, #room.player_list do + local p = room.player_list[i] + local card_info = _player_card_info[self:GetPos(p.seat)] + card_info:Clear() + card_info:SetPlayer(p) + if p.seat == room.self_player.seat then + card_info:UpdateIsOnClick(false) + end + local infoHand = self._player_info[self:GetPos(p.seat)] + infoHand._view:GetController('huxi').selectedIndex = 1 + infoHand._view:GetChild('huxi').text = p.hu_xi + if p.total_hp then + infoHand._view:GetController('zhanji').selectedIndex = 0 + if room.hpOnOff == 1 or room:checkHpNonnegative() then + infoHand._view:GetController('zhanji').selectedIndex = 1 + infoHand._view:GetChild('tex_jifen').text = d2ad(p.total_hp) + end + infoHand:UpdateScore() + end + end + self:UpdateRound(self._room.curren_round) + self:GenerateAllStepData(data) + self:ShowStep(1) + self:UpdateStep(1) +end + +function M:ShowStep(index) + local step = self._step[index + 1] + self:UpdateStep(index + 1) + self:UpdateLeftCard(step.left_card) + for i = 1, #step.player_card_data do + local p = self._room:GetPlayerBySeat(i) + local info = self._player_card_info[self:GetPos(i)] + p.card_list = step.player_card_data[i].card_list + p.outcard_list = step.player_card_data[i].outcard_list + p.fz_list = step.player_card_data[i].fz_list + p.hu_xi = step.player_card_data[i].hu_xi + p.hand_left_count = #p.card_list + + if index == 1 then + info:Clear() + if p.total_hp then + local avHand = self._player_info[self:GetPos(p.seat)] + local room = DataManager.CurrenRoom + avHand._view:GetController('zhanji').selectedIndex = 0 + if room.hpOnOff == 1 or room:checkHpNonnegative() then + avHand._view:GetController('zhanji').selectedIndex = 1 + avHand._view:GetChild('tex_jifen').text = d2ad(p.total_hp) + end + avHand:UpdateScore() + end + end + if p.hu_xi ~= nil then + local infoHand = self._player_info[self:GetPos(p.seat)] + infoHand._view:GetChild('huxi').text = p.hu_xi + end + if step.cmd == Record_Event.Evt_Action then + if p.fz_list ~= nil and #p.fz_list > 0 then + info:UpdateFzList(p.fz_list) + end + end + + if p.seat ~= self._room.self_player.seat then + info:InitHandCard(p.card_list) + else + self._room.self_player.handcard_list = p.card_list + info:InitHandCard(false) + end + + --[[if step.cmd == Record_Event.Evt_ChangePaiXing then + local _card_list = {} + for i = 1, #step.card_list do + local data = {} + data.card_item = step.card_list[i].card + data.index_X = step.card_list[i].X + data.index_Y = step.card_list[i].Y + _card_list[#_card_list + 1] = data + end + local info = self._player_card_info[self:GetPos(step.seat)] + if step.card_list[1].card ~= nil then + info:UpdateHandCards(_card_list) + else + info:UpdateHandCards(step.card_list) + end + end--]] + + if step.cmd == Record_Event.Evt_OutCard or step.cmd == Record_Event.Evt_GetCard then + if step.DiceCard ~= nil and step.DiceCard ~= 0 then + if p.seat == step.seat then + info:UpdateOutCardList(step.DiceCard) + coroutine.start( + function() + coroutine.wait(1.5) + info:ClearOutCard() + end + ) + end + end + end + if p.outcard_list ~= nil then + info:UpdateQiPai(p.outcard_list) + end + end + -- print("step.cmd ",step.cmdm,Record_Event.Evt_Win) + if step.cmd == Record_Event.Evt_result then + --[[local _room = DataManager.CurrenRoom + local result = step.result + self._win_pic = UIPackage.CreateObjectFromURL('ui://Main_RunBeard/胡') + local info = self._player_card_info[self:GetPos(step.win)] + info._mask_liangpai:AddChild(self._win_pic) + self._win_pic:Center() + + if result ~= nil then + if self._clearingView == nil then + self._clearingView = RunBeard_ResultView.new(self._view) + coroutine.start( + function() + coroutine.wait(0.5) + self._clearingView:Show() + end + ) + end + local data = result.data.info_list + self._clearingView:InitData( + 0, + _room, + result.data, + nil, + function(...) + for i = 1, #data do + local p = _room:GetPlayerBySeat(data[i].seat) + p.total_score = data[i].total_score + -- p.cur_hp = data[i]['cur_hp'] or 0 + -- if data[i]['hp_info'] then + -- p.cur_hp = data[i].hp_info.cur_hp + -- end + local card_info = self._player_card_info[self:GetPos(p.seat)] + local info = self._player_info[self:GetPos(p.seat)] + card_info:Clear() + if data[i]['hp_info'] then + p.total_score = d2ad(data[i].hp_info.cur_hp) + local stotal_hp = data[i].hp_info.total_hp + info._view:GetController('zhanji').selectedIndex = 0 + if _room.hpOnOff == 1 or _room:checkHpNonnegative() then + info._view:GetController('zhanji').selectedIndex = 1 + info._view:GetChild('tex_jifen').text = d2ad(stotal_hp) + end + end + info:UpdateScore(p.total_score) + end + self._clearingView = nil + end + ) + end--]] + else + if self._win_pic then + self._win_pic:Dispose() + end + end +end + +function M:GenerateAllStepData(data) + local cmdList = self.cmdList + self._step = {} + local step = {} + local info = data.info + step.cmd = '' + step.left_card = info.left_card + step.win = 0 + + step.player_card_data = {} + for i = 1, #self._room.player_list do + local p = info.playerData[i] + local u = {} + u.seat = p.seat + u.card_list = p.hand_card + u.hand_left_count = #u.card_list + u.fz_list = {} + u.outcard_list = {} + u.hu_xi = 0 + step.player_card_data[u.seat] = u + end + self._step[#self._step + 1] = step + + for i = 1, #cmdList do + local tem = cmdList[i] + self._cmdmap[tem.cmd](self, tem, i) + end +end + +function M:CmdOutCard(cmd, index) + local data = self:CopyLastStep(index) + data.cmd = cmd.cmd + data.current_out_seat = cmd.seat + local u = data.player_card_data[cmd.seat] + list_remove(u.card_list, cmd.data.card) + data.seat = cmd.seat + data.DiceCard = cmd.data.card +end + +function M:CmdGetCard(cmd, index) + local data = self:CopyLastStep(index) + data.cmd = cmd.cmd + data.left_card = cmd.data.left_count + local u = data.player_card_data[cmd.seat] + data.seat = cmd.seat + data.DiceCard = cmd.data.card +end +function M:CmdThrowCard(cmd, index) + local data = self:CopyLastStep(index) + data.cmd = cmd.cmd + data.seat = cmd.seat + data.current_seat = cmd.seat + local u = data.player_card_data[cmd.seat] + data.out_card_list = cmd.data.card + u.outcard_list[#u.outcard_list + 1] = cmd.data.card +end +function M:CmdAddCard(cmd, index) + local data = self:CopyLastStep(index) + data.cmd = cmd.cmd + local _room = self._room + local u = data.player_card_data[cmd.seat] + u.card_list[#u.card_list + 1] = cmd.data.card +end + +function M:onResult(cmd, index) + local data = self:CopyLastStep(index) + data.cmd = cmd.cmd + data.result = cmd.result +end + +function M:CmdChangePaiXing(cmd, index) + local data = self:CopyLastStep(index) + data.cmd = cmd.cmd + data.seat = cmd.seat + data.card_list = cmd.data.card_list +end + +function M:CmdAction(cmd, index) + local data = self:CopyLastStep(index) + data.cmd = cmd.cmd + data.seat = cmd.seat + local p = data.player_card_data[cmd.seat] + local fz = {} + p.hu_xi = cmd.data.hu_xi + fz.type = cmd.data.type + fz.card = cmd.data.card + fz.active_card = cmd.data.card + fz.opcard = cmd.data.opcard + local opcard = fz.opcard + local ftype = fz.type + local card = fz.card + local remove_num = #opcard + if ftype == RB_FZType.Chi then + p.fz_list[#p.fz_list + 1] = fz + for i = 1, remove_num do + list_remove(p.card_list, opcard[i]) + end + elseif ftype == RB_FZType.Bi then + p.fz_list[#p.fz_list + 1] = fz + for i = 1, remove_num do + list_remove(p.card_list, opcard[i]) + end + list_remove(p.card_list, fz.card) + elseif ftype == RB_FZType.Peng then + p.fz_list[#p.fz_list + 1] = fz + for i = 1, remove_num do + list_remove(p.card_list, opcard[i]) + end + elseif ftype == RB_FZType.Kan then + local _room = self._room + if #opcard == 2 then + p.card_list[#p.card_list + 1] = card + end + elseif ftype == RB_FZType.ChouWei then + p.fz_list[#p.fz_list + 1] = fz + for i = 1, 2 do + list_remove(p.card_list, opcard[i]) + end + elseif ftype == RB_FZType.Wei then + p.fz_list[#p.fz_list + 1] = fz + for i = 1, remove_num do + list_remove(p.card_list, opcard[i]) + end + elseif ftype == RB_FZType.Pao then + local num = 0 + for i = 1, #p.card_list do + if card == p.card_list[i] then + num = num + 1 + end + end + local isAddTi = false + for i = 1, #p.fz_list do + if p.fz_list[i].card == card then + p.fz_list[i].type = RB_FZType.Pao + isAddTi = true + end + end + if num > 0 then + for i = 1, num do + list_remove(p.card_list, card) + end + + if isAddTi == false then + p.fz_list[#p.fz_list + 1] = fz + end + end + elseif ftype == RB_FZType.Ti then + local num = 0 + for i = 1, #p.card_list do + if card == p.card_list[i] then + num = num + 1 + end + end + local isAddTi = false + for i = 1, #p.fz_list do + if p.fz_list[i].card == card then + p.fz_list[i].type = RB_FZType.Ti + isAddTi = true + end + end + if num > 0 then + for i = 1, num do + list_remove(p.card_list, card) + end + + if isAddTi == false then + p.fz_list[#p.fz_list + 1] = fz + end + end + end +end + +function M:CmdWin(cmd, index) + local data = self:CopyLastStep(index) + data.cmd = cmd.cmd + data.win = cmd.seat +end + +function M:UpdateLeftCard(num) + self._tex_LeftCard.text = '剩余 ' .. num .. ' 张牌' +end + +function M:UpdateRound(round) + self._tex_round.text = '第 ' .. round .. '/' .. self._room.room_config.round .. ' 局' +end + +function M:CopyLastStep(index) + local step = {} + local last_step = self._step[index] + step = self:deepcopy(last_step) + step.player_card_data = {} + local card_data = step.player_card_data + for i = 1, #last_step.player_card_data do + card_data[i] = {} + card_data[i].card_list = self:deepcopy(last_step.player_card_data[i].card_list) + card_data[i].outcard_list = self:deepcopy(last_step.player_card_data[i].outcard_list) + card_data[i].fz_list = self:deepcopy(last_step.player_card_data[i].fz_list) + card_data[i].hand_left_count = #card_data[i].card_list + card_data[i].hu_xi = self:deepcopy(last_step.player_card_data[i].hu_xi) + end + self._step[#self._step + 1] = step + return step +end + +-- lua table 深拷贝 +function M:deepcopy(object) + local lookup_table = {} + local function _copy(object) + if type(object) ~= 'table' then + return object + elseif lookup_table[object] then + return lookup_table[object] + end + local new_table = {} + lookup_table[object] = new_table + for index, value in pairs(object) do + new_table[_copy(index)] = _copy(value) + end + return setmetatable(new_table, getmetatable(object)) + end + return _copy(object) +end + +function M:NextRecordPlay() + local result = PlayBackView.NextRecordPlay(self) + if not result then + return + end + self:ChangePlayState(false) + self._speed = 1 + self._playFoward = true + self:ChangeTextSpeed() +end + +function M:LastRecordPlay() + local result = PlayBackView.LastRecordPlay(self) + if not result then + return + end + self:ChangePlayState(false) + self._speed = 1 + self._playFoward = true + self:ChangeTextSpeed() +end + +function M:Play() + self:ChangeAlpha() + self:ChangePlayState(not self._play) + if not self._play then + return + end + if (self._currentStep == #self.cmdList and self._playFoward) or (self._currentStep == 0 and not self._playFoward) then + self._currentStep = 0 + self._speed = 1 + self._playFoward = true + self:ChangeTextSpeed() + end +end + +function M:ChangePlayState(state) + self._play = state + self:ChangeTextSpeed() + local btn_play = self._view:GetChild('panel_record'):GetChild('btn_play') + if self._play then + btn_play:GetController('state').selectedIndex = 1 + else + btn_play:GetController('state').selectedIndex = 0 + end +end + +function M:ChangeTextSpeed() + local str1 = self._play and self._speed or '' + self._view:GetChild('panel_record'):GetChild('tex_speed').text = str1 + local str2 = + not self._play and (self._playFoward and '播放暂停' or '回退暂停') or + self._playFoward and (self._speed == 1 and '播放' or '快进') or + (self._speed == 1 and '回退' or '快退') + self._view:GetChild('panel_record'):GetChild('tex_2').text = str2 + local str3 = self._play and '倍速度' or '' + self._view:GetChild('panel_record'):GetChild('tex_1').text = str3 +end + +function M:CmdLeftArrows() + self:ChangeAlpha() + self:ChangePlayState(true) + if not self._playFoward then + if self._speed < 16 then + self._speed = self._speed * 2 + else + self._speed = 1 + end + self:ChangeTextSpeed() + else + self._speed = 1 + self._playFoward = false + self:ChangeTextSpeed() + end +end + +function M:CmdRightArrows() + self:ChangeAlpha() + self:ChangePlayState(true) + if self._playFoward then + if self._speed < 16 then + self._speed = self._speed * 2 + else + self._speed = 1 + end + self:ChangeTextSpeed() + else + self._speed = 1 + self._playFoward = true + self:ChangeTextSpeed() + end +end + +function M:OnUpdate() + if self._play then + if (self._currentStep == #self.cmdList and self._playFoward) then + self:ChangePlayState(false) + ViewUtil.ErrorTip(nil, '当前已是录像结尾了,再次点击播放按钮可重新播放') + return + elseif (self._currentStep == 0 and not self._playFoward) then + self:ChangePlayState(false) + ViewUtil.ErrorTip(nil, '当前已是录像开头了,再次点击播放按钮可重新播放') + return + end + self._timer = self._timer + Time.deltaTime + if self._timer >= 1 / self._speed then + self._timer = 0 + local step = self._playFoward and 1 or -1 + self._currentStep = self._currentStep + step + self:ShowStep(self._currentStep) + end + end +end + +function M:Destroy() + UpdateBeat:Remove(self.OnUpdate, self) + PlayBackView.Destroy(self) +end + +function M:UpdateStep(step) + self._record:GetChild('tex_step').text = '第 ' .. step .. ' / ' .. #self._step .. '步' +end + +return M diff --git a/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/EXPlayer.lua b/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/EXPlayer.lua new file mode 100644 index 00000000..fe112fd2 --- /dev/null +++ b/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/EXPlayer.lua @@ -0,0 +1,37 @@ + + +local EXPlayer ={ + -- 手牌列表 + card_list = nil, + -- 剩余牌数 + hand_left_count = 0, + -- 出牌列表 + outcard_list = nil, + -- 牌组列表 + fz_list = nil, + hu_xi =0 +} + +local M = EXPlayer + +--- Create a new EXPlayer +function M.new() + setmetatable(M,{__index = Player}) + local self = setmetatable({}, {__index = M}) + self.card_list = {} + self.outcard_list = {} + self.fz_list = {} + return self +end + +-- 清理玩家数据 +function M:Clear() + Player.Clear(self) + self.card_list = {} + self.outcard_list = {} + self.fz_list = {} + self.hand_left_count = 0 + self.hu_xi =0 +end + +return M \ No newline at end of file diff --git a/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/EXPlayerInfoView.lua b/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/EXPlayerInfoView.lua new file mode 100644 index 00000000..7d32adea --- /dev/null +++ b/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/EXPlayerInfoView.lua @@ -0,0 +1,52 @@ +local PlayerInfoView = require("Game.View.PlayerInfoView") + +local M = {} + +function M.new(view, mainView) + setmetatable(M, {__index = PlayerInfoView}) + local self = setmetatable({}, {__index = M}) + self._view = view + self._main_view = mainView + self:init() + return self +end + + +--[[function M:FillData(player) + + + PlayerInfoView.FillData(self, player) + if player.cur_hp ~= nil then + self:UpdateScore(d2ad(player.cur_hp)) + else + local rt = 1 + if self._main_view._room.hpOnOff == 1 then + rt = self._main_view._room.score_times + end + self:UpdateScore(player.total_score * rt) + end + + +end--]] + +function M:UpdatePiao(piao) + + if piao == nil or piao == -1 then + self._view:GetChild("piao").text = "" + elseif piao == 0 then + self._view:GetChild("piao").text = "不飘" + elseif piao == 1 then + self._view:GetChild("piao").text = "飘1分" + elseif piao == 2 then + self._view:GetChild("piao").text = "飘2分" + elseif piao == 3 then + self._view:GetChild("piao").text = "飘3分" + elseif piao == 5 then + self._view:GetChild("piao").text = "飘5分" + elseif piao == 8 then + self._view:GetChild("piao").text = "飘8分" + end +end + + +return M diff --git a/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/EXRoomConfig.lua b/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/EXRoomConfig.lua new file mode 100644 index 00000000..70675100 --- /dev/null +++ b/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/EXRoomConfig.lua @@ -0,0 +1,506 @@ + +local M = {} + +--- Create a new RoomConfig +function M.new(config) + setmetatable(M,{__index = RoomConfig}) + local self = setmetatable({}, {__index = M}) + RoomConfig.init(self,config) +self.config=config + self.class = "RoomConfig" + self.round = config["times"] + self.mode = config["mode"] + self.tun = config["tun"] + self.fengding = config["fengding"] + self.tuanyuan = config["tuanyuan"] + self.hanghangxi = config["hanghangxi"] + self.siqi = config["siqi"] + self.shuahou = config["shuahou"] + self.huangfan = config["huangfan"] + self.jiaxingxing = config["jiaxingxing"] + self.tinghu = config["tinghu"] + self.duizifu = config["duizifu"] + self.back = config["back"] + self.yuan = config["yuan"] + self.tianhu =config["tianhu"] + self.dihu =config["dihu"] + self.haihu =config["haihu"] + self.maxPlayers = config["maxPlayers"] + self.qupai = config["qupai"] + self.isHidden = config.isHidden + + self.hh = config["hh"] or 0 + self.dh = config["dh"] or 0 + self.hw = config["hw"] or 0 + self.wh = config["wh"] or 0 + + self.hd = config["hd"] or 0 + self.wd = config["wd"] or 0 + self.jhd = config["jhd"] or 0 + + self.dhdf = config["dhdf"] or 0 + return self +end + +--[[function M:GetDes(sp) + sp = sp or " " + local count=0 + local str = self.round and self.round .. "局" .. " " or "" + str = str .. RoomConfig.GetDes(self, sp).."\n" + + + if self.config["kawai"]==0 then + str = str .."卡歪" + count=count+1 + if count%2==0 then + str = str .."\n" + else + sp1="" + local strL=4 + for i=1,strL do + sp1=sp1.." " + end + str = str .. sp1..sp + end + else + tr = str .."不卡歪" + count=count+1 + if count%2==0 then + str = str .."\n" + else + sp1="" + local strL=3 + for i=1,strL do + sp1=sp1.." " + end + str = str .. sp1..sp + end + end + + + if self.config["first_rand_zhuang"] then + str = str .."首局随机庄" + count=count+1 + if count%2==0 then + str = str .."\n" + else + sp1="" + local strL=1 + for i=1,strL do + sp1=sp1.." " + end + str = str .. sp1..sp + end + end + + if self.config["zhuang_di_hu"]==0 then + str = str .."庄家地胡" + count=count+1 + if count%2==0 then + str = str .."\n" + else + sp1="" + local strL=2 + for i=1,strL do + sp1=sp1.." " + end + str = str .. sp1..sp + end + else + tr = str .."庄家不地胡" + count=count+1 + if count%2==0 then + str = str .."\n" + else + sp1="" + local strL=1 + for i=1,strL do + sp1=sp1.." " + end + str = str .. sp1..sp + end + end + + + if self.config["hao_config"]==0 then + str = str .."豪123" + count=count+1 + if count%2==0 then + str = str .."\n" + else + sp1="" + local strL=4 + for i=1,strL do + sp1=sp1.." " + end + str = str .. sp1..sp + end + else + tr = str .."豪234" + count=count+1 + if count%2==0 then + str = str .."\n" + else + sp1="" + local strL=4 + for i=1,strL do + sp1=sp1.." " + end + str = str .. sp1..sp + end + end + + if self.config["hao_jiabei"]==0 then + str = str .."-不加倍" + count=count+1 + if count%2==0 then + str = str .."\n" + else + sp1="" + local strL=2 + for i=1,strL do + sp1=sp1.." " + end + str = str .. sp1..sp + end + elseif self.config["hao_jiabei"]==1 then + str = str .."低于10分加倍" + count=count+1 + if count%2==0 then + str = str .."\n" + else + sp1="" + local strL=0 + for i=1,strL do + sp1=sp1.." " + end + str = str .. sp1..sp + end + elseif self.config["hao_jiabei"]==2 then + str = str .."低于20分加倍" + count=count+1 + if count%2==0 then + str = str .."\n" + else + sp1="" + local strL=0 + for i=1,strL do + sp1=sp1.." " + end + str = str .. sp1..sp + end + elseif self.config["hao_jiabei"]==3 then + str = str .."低于30分加倍" + count=count+1 + if count%2==0 then + str = str .."\n" + else + sp1="" + local strL=0 + for i=1,strL do + sp1=sp1.." " + end + str = str .. sp1..sp + end + elseif self.config["hao_jiabei"]==4 then + str = str .."低于40分加倍" + count=count+1 + if count%2==0 then + str = str .."\n" + else + sp1="" + local strL=0 + for i=1,strL do + sp1=sp1.." " + end + str = str .. sp1..sp + end + elseif self.config["hao_jiabei"]==5 then + str = str .."低于50分加倍" + count=count+1 + if count%2==0 then + str = str .."\n" + else + sp1="" + local strL=0 + for i=1,strL do + sp1=sp1.." " + end + str = str .. sp1..sp + end + end + + if self.config["ming_tang"]==0 then + str = str .."名堂60/80/100" + count=count+1 + if count%2==0 then + str = str .."\n" + else + sp1="" + local strL=0 + for i=1,strL do + sp1=sp1.." " + end + str = str .. sp1..sp + end + else + str = str .."名堂80/100/120" + count=count+1 + if count%2==0 then + str = str .."\n" + else + sp1="" + local strL=0 + for i=1,strL do + sp1=sp1.." " + end + str = str .. sp1..sp + end + end + + + if self.config["piao"]==0 then + str = str .."不飘" + count=count+1 + if count%2==0 then + str = str .."\n" + else + sp1="" + local strL=4 + for i=1,strL do + sp1=sp1.." " + end + str = str .. sp1..sp + end + elseif self.config["piao"]==1 then + str = str .."飘123" + count=count+1 + if count%2==0 then + str = str .."\n" + else + sp1="" + local strL=4 + for i=1,strL do + sp1=sp1.." " + end + str = str .. sp1..sp + end + elseif self.config["piao"]==2 then + str = str .."飘235" + count=count+1 + if count%2==0 then + str = str .."\n" + else + sp1="" + local strL=4 + for i=1,strL do + sp1=sp1.." " + end + str = str .. sp1..sp + end + elseif self.config["piao"]==3 then + str = str .."飘258" + count=count+1 + if count%2==0 then + str = str .."\n" + else + sp1="" + local strL=4 + for i=1,strL do + sp1=sp1.." " + end + str = str .. sp1..sp + end + end + + + if self.config["qupai"]==0 then + str = str .."不抽" + count=count+1 + if count%2==0 then + str = str .."\n" + else + sp1="" + local strL=4 + for i=1,strL do + sp1=sp1.." " + end + str = str .. sp1..sp + end + elseif self.config["piao"]==1 then + str = str .."抽10" + count=count+1 + if count%2==0 then + str = str .."\n" + else + sp1="" + local strL=4 + for i=1,strL do + sp1=sp1.." " + end + str = str .. sp1..sp + end + elseif self.config["piao"]==2 then + str = str .."抽19" + count=count+1 + if count%2==0 then + str = str .."\n" + else + sp1="" + local strL=4 + for i=1,strL do + sp1=sp1.." " + end + str = str .. sp1..sp + end + end + + return str +end--]] + + +function M:GetDes(sp) + + sp = sp or " " + local str = self.round and self.round .. "局" .. sp or "" + str = str .. RoomConfig.GetDes(self, sp) + + if self.config["kawai"]==0 then + str = str .."卡歪" + str = str ..sp + + else + str = str .."不卡歪" + str = str ..sp + end + + + if self.config["first_rand_zhuang"] then + str = str .."首局随机庄" + str = str .. sp + end + + if self.config["zhuang_di_hu"]==0 then + str = str .."庄家地胡" + str = str ..sp + + else + str = str .."庄家不地胡" + str = str ..sp + + end + + --printlog("1111111111111111111111111",self.config["hao_config"]) + if self.config["hao_config"]==0 then + str = str .."豪123" + + str = str ..sp + + else + str = str .."豪234" + + str = str ..sp + end + + if self.config["hao_jiabei"]==0 then + str = str .."-不加倍" + + str = str ..sp + + elseif self.config["hao_jiabei"]==1 then + str = str .."低于10分加倍" + + str = str ..sp + + elseif self.config["hao_jiabei"]==2 then + str = str .."低于20分加倍" + + str = str ..sp + + elseif self.config["hao_jiabei"]==3 then + str = str .."低于30分加倍" + + str = str ..sp + + elseif self.config["hao_jiabei"]==4 then + str = str .."低于40分加倍" + + str = str ..sp + + elseif self.config["hao_jiabei"]==5 then + str = str .."低于50分加倍" + + str = str ..sp + + end + + if self.config["ming_tang"]==0 then + str = str .."名堂60/80/100" + + str = str ..sp + + else + str = str .."名堂80/100/120" + + str = str ..sp + + end + + + if self.config["piao"]==0 then + str = str .."不飘" + + str = str ..sp + + elseif self.config["piao"]==1 then + str = str .."飘123" + str = str ..sp + + elseif self.config["piao"]==2 then + str = str .."飘235" + str = str ..sp + + elseif self.config["piao"]==3 then + str = str .."飘258" + + str = str ..sp + + end + + + if self.config["qupai"]==0 then + str = str .."不抽" + + str = str ..sp + + elseif self.config["piao"]==1 then + str = str .."抽10" + + str = str ..sp + + elseif self.config["piao"]==2 then + str = str .."抽19" + + str = str ..sp + + end + + return str +end + + +function M:GetGameName() + return self.maxPlayers .. '人放炮罚' +end + +function M:GetGameJS() + local gamerulepanel= UIPackage.CreateObjectFromURL("ui://Extend_Poker_FanPaoFa/gamerule") + return gamerulepanel +end + + +function M:GetGameSMSize() + return 467,500 +end + +return M \ No newline at end of file diff --git a/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/ExtendConfig.lua b/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/ExtendConfig.lua new file mode 100644 index 00000000..98cac7a2 --- /dev/null +++ b/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/ExtendConfig.lua @@ -0,0 +1,241 @@ +local EXTEND_MODEL_NAME = ... + +local EXGameInfo = import('.EXGameInfo') +local EXMainView = import('.EXMainView') +local EXGameController = import('.EXGameController') +local EXRoomConfig = import('.EXRoomConfig') +local EXPlayBackView = import('.EXPlayBackView') +local explayer = import('.EXPlayer') +local ExtendConfig = {} + +local M = ExtendConfig + +function ExtendConfig.new() + setmetatable(M, {__index = IExtendConfig}) + local self = setmetatable({}, {__index = M}) + self.class = 'ExtendConfig' + self.extend_id = 13 + self._viewMap = {} + self._viewMap[ViewManager.View_Main] = EXMainView + self._viewMap[ViewManager.View_PlayBack] = EXPlayBackView + return self +end + +--卸载资源 +function M:UnAllAssets() + UIPackage.RemovePackage('extend/zipai/fanpaofa/ui/Info_Poker_FanPaoFa') + self:UnAssets() +end + +--卸载资源 +function M:UnAssets() + UIPackage.RemovePackage('extend/zipai/fanpaofa/ui/Extend_Poker_FanPaoFa') + ResourcesManager.UnLoadGroup('FanPaoFa_ZP') +end + +local _gameInfo = nil +function M:GetGameInfo() + if not _gameInfo then + _gameInfo = EXGameInfo.new() + end + return _gameInfo +end + +local _ctr_game = nil +function M:GetGameController() + if _ctr_game == nil then + _ctr_game = EXGameController.new() + end + return _ctr_game +end + +function M:FillRoomConfig(room, _config) + room.room_config = EXRoomConfig.new(_config) +end + +function M:FillRoomData(s2croom) + printlog("初始化数据===>>>") + pt(s2croom) + local room = DataManager.CurrenRoom + local reload = s2croom['reload'] + local _tableInfo = s2croom['tableInfo'] + + local _config = _tableInfo['config'] + room.room_config = EXRoomConfig.new(_config) + + local playerList = _tableInfo['playerData'] + room.curren_round = _tableInfo['round'] + for i = 1, #playerList do + local _jp = playerList[i] + + local p = explayer.new() + p.seat = _jp['seat'] + local online = _jp['online'] + p.line_state = online + p.ready = _jp['ready'] == 1 and true or false + --p.piao=_jp['piao'] + local pid = _jp['aid'] + if (DataManager.SelfUser.account_id == pid) then + room.self_player = p + p.self_user = DataManager.SelfUser + else + local u = User.new() + u.account_id = pid + p.self_user = u + u.nick_name = _jp['nick'] + u.head_url = _jp['portrait'] + u.sex = _jp['sex'] + end + p.entrust = _jp['entrust'] + p.self_user.host_ip = _jp['ip'] + p.self_user.location = Location.new(_jp['pos'] or '') + p.cur_hp = _jp['cur_hp'] or 0 + p.total_hp = _jp['total_hp'] or 0 + if _jp['hp_info'] then + p.cur_hp = _jp.hp_info.cur_hp + p.total_hp = _jp.hp_info.total_hp + end + room:AddPlayer(p) + end + + -- 如果重写了player类,就需要传第二个参数 + -- self:FillPlayerData(playerList, explayer) + + if (reload) then + local _reloadInfo = s2croom['reloadInfo'] + room.self_player.currentNotPutCardList=_reloadInfo['notput'] + local _hand_card = _reloadInfo['hand_card'] + local _card_list = _reloadInfo['card_list'] + local _discard = _reloadInfo['discard'] + room.discard = _discard + -- local _index = _reloadInfo["typeface"] + -- if _index ==1 then + -- room.change_card_display = "2_" + -- else + -- room.change_card_display = "1_" + -- end + room.self_player.handcard_list = _hand_card + room.self_player.card_list = {} + for i = 1, #_card_list do + local data = {} + data.card_item = _card_list[i].card + data.index_X = _card_list[i].X + data.index_Y = _card_list[i].Y + room.self_player.card_list[#room.self_player.card_list + 1] = data + end + local active_seat = _reloadInfo['active_seat'] + local bank_seat = _reloadInfo['banker_seat'] + local playing = _reloadInfo['playing'] + local _info_list = _reloadInfo['info_list'] + local last_outcard_seat = _reloadInfo['last_outcard_seat'] + + room.left_count = _reloadInfo['left_card'] + room.banker_seat = bank_seat + room.curren_outcard_seat = _reloadInfo['curren_outcard_seat'] + if active_seat ~= 0 then + local player = room:GetPlayerBySeat(active_seat) + player.DiceCard = _reloadInfo['acitve_card'] + end + room.last_outcard_seat = last_outcard_seat + room.playing = playing + for i = 1, #_info_list do + local tem = _info_list[i] + local playerid = tem['playerid'] + local p = room:GetPlayerById(playerid) + local outcard_list = tem['outcard_list'] + p.outcard_list = outcard_list + p.total_score = tem['score'] + p.hu_xi = tem['hu_xi'] + p.hand_left_count = tem['card_count'] + p.cur_hp = tem['cur_hp'] or 0 + p.total_hp = tem['total_hp'] or 0 + if tem['hp_info'] then + p.cur_hp = tem.hp_info.cur_hp + p.total_hp = tem.hp_info.total_hp + end + p.entrust = tem['entrust'] + p.piao=tem['piao'] + local opcard = tem['opcard'] + for k = 1, #opcard do + local op = opcard[k] + local fz = {} + fz.type = op['type'] + local data = {} + data[1] = op['card1'] + data[2] = op['card3'] + fz.opcard = data + fz.card = op['card2'] + fz.active_card = op['card2'] + + p.fz_list[#p.fz_list + 1] = fz + if p.seat == room.self_player.seat then + if fz.type == RB_FZType.Kan then + for i = 1, 3 do + room.self_player.handcard_list[#room.self_player.handcard_list + 1] = fz.card + end + end + end + end + pt(p) + if not playing and room.curren_round > 0 then + self.GetGameController():PlayerReady() + end + end + end +end + +function M:FillPlayBackData(pd_data) + local room = DataManager.CurrenRoom + local _tableInfo = pd_data['info'] + + local _config = _tableInfo['config'] + room.room_id = _tableInfo.roomid + room.room_config = EXRoomConfig.new(_config) + room.owner_id = _config['ownerid'] + local active_seat = _tableInfo['active_seat'] + local bank_seat = _tableInfo['banker_seat'] + room.left_count = _tableInfo['left_card'] + room.banker_seat = bank_seat + room.curren_turn_seat = active_seat + room.curren_round = _tableInfo['round'] + + local _info_list = _tableInfo['playerData'] + for i = 1, #_info_list do + local _jp = _info_list[i] + local p = room:NewPlayer() + p.seat = _jp['seat'] + local online = _jp['online'] + p.line_state = online + p.ready = _jp['ready'] == 1 and true or false + local pid = _jp['aid'] + if pid == DataManager.SelfUser.account_id then + room.self_player = p + end + local u = User.new() + u.account_id = pid + p.self_user = u + u.nick_name = _jp['nick'] + u.head_url = _jp['portrait'] + u.sex = _jp['sex'] + p.self_user.host_ip = p.self_user.host_ip + local _hand_card = _jp['hand_card'] + p.hand_card = _hand_card + if room.self_player ~= nil and p.seat == room.self_player.seat then + room.self_player.handcard_list = _hand_card + end + p.total_score = _jp['score'] + p.hand_left_count = #_hand_card + p.cur_hp = _jp['cur_hp'] or 0 + p.total_hp = _jp['total_hp'] or 0 + if _jp['hp_info'] then + p.cur_hp = _jp.hp_info.cur_hp + p.total_hp = _jp.hp_info.total_hp + end + + room:AddPlayer(p) + end + room.cmdList = pd_data['cmdList'] + room.result = pd_data['result'] +end + +return M diff --git a/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/PlayerCardInfoView.lua b/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/PlayerCardInfoView.lua new file mode 100644 index 00000000..2a3b48b6 --- /dev/null +++ b/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/PlayerCardInfoView.lua @@ -0,0 +1,268 @@ +local PlayerCardInfoView = import(".main.ZPPlayerCardInfoView") + +local M = {} +function M.new(view,mainView) + + setmetatable(M, {__index = PlayerCardInfoView}) + local self = setmetatable({},{__index = M}) + self.class = "PlayerCardInfoView" + self._view = view + self._mainView = mainView + self:init() + return self +end + + + +function M:UpdateFzList( fz_list ,ispaly,seat) + self._area_fz_list:RemoveChildren(0,-1,true) + for i = 1,#fz_list do + local fzitem = nil + if fz_list[i].type ~= RB_FZType.Kan then + fzitem =UIPackage.CreateObjectFromURL("ui://Main_RunBeard/ComponentNew") + if(ispaly == false)then + fzitem:RemoveChildren(0,-1,true) + end + end + if fz_list[i].type == RB_FZType.Chi or fz_list[i].type == RB_FZType.Bi then + + local fzcards =UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Fz_0_3") + fzcards:GetController("c2").selectedIndex =1 + fzcards:GetChild("card_"..1).icon = self:getCardItem("ui://Main_RunBeard/202_",fz_list[i].active_card) + fzcards:GetChild("card_"..2).icon = self:getCardItem("ui://Main_RunBeard/202_",fz_list[i].opcard[1]) + fzcards:GetChild("card_"..3).icon = self:getCardItem("ui://Main_RunBeard/202_",fz_list[i].opcard[2]) + fzcards.x,fzcards.y = 0,0 + self:playAnim(fzitem,fzcards,#fz_list,i,ispaly,seat) + + elseif fz_list[i].type == RB_FZType.Peng then + + local fzcards =UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Fz_0_3") + for j=1,3 do + fzcards:GetChild("card_"..j).icon =self:getCardItem("ui://Main_RunBeard/202_",fz_list[i].card) + end + fzcards.x,fzcards.y = 0,0 + self:playAnim(fzitem,fzcards,#fz_list,i,ispaly,seat) + + elseif fz_list[i].type == RB_FZType.Wei then + + local fzcards =UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Fz_0_3") + for j=1,2 do + fzcards:GetChild("card_"..j).icon ="ui://Main_RunBeard/202_1_300" + end + fzcards:GetChild("card_"..3).icon =self:getCardItem("ui://Main_RunBeard/202_",fz_list[i].card) + fzcards.x,fzcards.y = 0,0 + self:playAnim(fzitem,fzcards,#fz_list,i,ispaly,seat) + + elseif fz_list[i].type == RB_FZType.ChouWei then + local fzcards =UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Fz_0_3") + for j=1,2 do + fzcards:GetChild("card_"..j).icon ="ui://Main_RunBeard/202_1_300" + end + fzcards:GetChild("card_"..3).icon =self:getCardItem("ui://Main_RunBeard/202_",fz_list[i].card) + fzcards.x,fzcards.y = 0,0 + self:playAnim(fzitem,fzcards,#fz_list,i,ispaly,seat) + + elseif fz_list[i].type == RB_FZType.Pao then + + local fzcards =UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Fz_0_4") + for j=1,4 do + fzcards:GetChild("card_"..j).icon =self:getCardItem("ui://Main_RunBeard/202_",fz_list[i].card) + end + fzcards.x,fzcards.y = 0,0 + self:playAnim(fzitem,fzcards,#fz_list,i,ispaly,seat) + + elseif fz_list[i].type == RB_FZType.Ti then + + local fzcards =UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Fz_0_4") + if self._mainView._leftcard ==1 and self._player.seat ~= DataManager.CurrenRoom.banker_seat then + for j=1,4 do + fzcards:GetChild("card_"..j).icon ="ui://Main_RunBeard/202_1_300" + end + else + for j=1,4 do + if j==4 then + fzcards:GetChild("card_"..j).icon =self:getCardItem("ui://Main_RunBeard/202_",fz_list[i].card) + else + fzcards:GetChild("card_"..j).icon ="ui://Main_RunBeard/202_1_300" + end + end + end + fzcards.x,fzcards.y = 0,0 + self:playAnim(fzitem,fzcards,#fz_list,i,ispaly,seat) + end + end +end + +function M:playAnim(fzitem,fzcards, size,i,ispaly,seat) + if(ispaly == nil)then + ispaly =false + end + + local isaddLast = false + if(ispaly and i == size)then --匹配最后一个牌 + local faArray= fzitem:GetChild("chiwei1") + + if(DataManager.CurrenRoom.room_config.people_num ==3)then + if(DataManager.CurrenRoom.self_player.seat == 1)then + if(seat == 2)then + faArray= fzitem:GetChild("chiwei1") + else + faArray= fzitem:GetChild("chiwei") + end + elseif(DataManager.CurrenRoom.self_player.seat == 2) then + if(seat == 3)then + faArray= fzitem:GetChild("chiwei1") + else + faArray= fzitem:GetChild("chiwei") + end + elseif(DataManager.CurrenRoom.self_player.seat == 3)then + if(seat == 1)then + faArray= fzitem:GetChild("chiwei1") + else + faArray= fzitem:GetChild("chiwei") + end + end + end + + if(faArray~=nil)then + faArray:AddChild(fzcards) + else + fzitem:AddChild(fzcards) + end + else + fzitem:AddChild(fzcards) + end + if(seat~=nil)then + isaddLast = self:isAddFirst(seat) + end + if(isaddLast)then + local index_postion = 0 + self._area_fz_list:AddChildAt(fzitem,index_postion) + else + self._area_fz_list:AddChild(fzitem) + end +end + +function M:isAddFirst(seat) + local isaddLast = false + if(DataManager.CurrenRoom.room_config.people_num ==3)then + if(DataManager.CurrenRoom.self_player.seat == 1)then + if(seat == 2)then + isaddLast = true + end + elseif(DataManager.CurrenRoom.self_player.seat == 2)then + if(seat == 3)then + isaddLast = true + end + elseif(DataManager.CurrenRoom.self_player.seat == 3)then + if(seat == 1)then + isaddLast = true + end + end + elseif DataManager.CurrenRoom.room_config.people_num ==2 then + isaddLast = true + end + return isaddLast +end + +function M:PlayingOutCardAnima(card) + coroutine.start(function() + coroutine.wait(0.1) + self:ClearOutCard() + end) +end + +function M:UpdateOutCardList(outcard,isShow,isMopai,seat) + if(isShow == nil) then + isShow = false + end + if(isMopai == nil) then + isMopai = false + end + + self._area_outcard_list:RemoveChildren(0,-1,true) + local outcards =UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Gcm_OutCard") + + if outcard==0 then + outcards:GetChild("icon").icon ="ui://Main_RunBeard/202_1_300" + else + outcards:GetChild("icon").icon =self:getCardItem("ui://Main_RunBeard/203_",outcard) + end + outcards.x,outcards.y = 0,0 + local show_di_bg = outcards:GetChild("show_di_bg") + --show_di_bg.visible = true + if(isShow)then + if outcard == 0 then + show_di_bg.visible = false + end + if(seat ~= nil and outcards~=nil)then + if(DataManager.CurrenRoom.room_config.people_num ==3)then + if(seat ==2)then + seat = 3 + elseif(seat == 3)then + seat =2 + end + elseif DataManager.CurrenRoom.room_config.people_num ==2 then + seat = 3 + end + if(isMopai)then + if outcard ~= 0 then + outcards:GetTransition("mopai"..seat):Play(function( ) + -- show_di_bg.visible = true + + end) + end + else + show_di_bg.visible = false + outcards:GetTransition("cpai"..seat):Play() + end + else + --show_di_bg.visible = true + end + else + show_di_bg.visible = false + end + self._area_outcard_list:AddChild(outcards) +end + +--弃牌 +function M:UpdateQiPai( qi_list,ispaly,seat) + self._area_qipai_list:RemoveChildren(0,-1,true) + for i=1,#qi_list do + local qicards =UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Qipai") + qicards:GetChild("icon").icon = self:getCardItem("ui://Main_RunBeard/202_",qi_list[i]) + if(ispaly)then + if(i == #qi_list) then + if(DataManager.CurrenRoom.room_config.people_num ==2)then + qicards:GetTransition("t0"):Play() + else + if(DataManager.CurrenRoom.self_player.seat == 1)then + if(seat == 2)then + qicards:GetTransition("t0"):Play() + else + qicards:GetTransition("t1"):Play() + end + elseif(DataManager.CurrenRoom.self_player.seat == 2)then + if(seat == 3)then + qicards:GetTransition("t0"):Play() + else + qicards:GetTransition("t1"):Play() + end + elseif(DataManager.CurrenRoom.self_player.seat == 3)then + if(seat == 1)then + qicards:GetTransition("t0"):Play() + else + qicards:GetTransition("t1"):Play() + end + else + qicards:GetTransition("t0"):Play() + end + + end + end + end + self._area_qipai_list:AddChild(qicards) + end + +end +return M \ No newline at end of file diff --git a/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/PlayerSelfCardInfoView.lua b/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/PlayerSelfCardInfoView.lua new file mode 100644 index 00000000..22462dbb --- /dev/null +++ b/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/PlayerSelfCardInfoView.lua @@ -0,0 +1,503 @@ +local PlayerSelfCardInfoView = import(".main.ZPPlayerSelfCardInfoView") +local CardCheck = import(".main.CardCheck") +local M = {} +-- +function M.new(view,mainView) + setmetatable(M, {__index = PlayerSelfCardInfoView}) + local self = setmetatable({},{__index = M}) + self.class = "PlayerSelfCardInfoView" + self._view = view + self._mainView = mainView + self._full = true + self:init() + return self +end + + +function M:onTouchBegin(context) + if DataManager.CurrenRoom ==nil or DataManager.CurrenRoom.self_player ==nil then + return + end + local button = context.sender + local card = button.data + if DataManager.CurrenRoom.curren_outcard_seat == DataManager.CurrenRoom.self_player.seat then + self:ShowHuTip(card.card_item) + end + card.btn_card:GetChild("icon").icon = self:getCardItem("ui://Main_RunBeard/203_",card.card_item) + card.btn_card.sortingOrder = 100 + local xy = self._area_handcard_list:GlobalToLocal(Vector2.New(context.inputEvent.x,context.inputEvent.y)) + card.btn_card.xy = Vector2.New(card.btn_card.x+20 ,card.btn_card.y-50) + card.touch_pos = xy - button.xy + +end + +function M:ClearMpList(mpList) + local tempList={} + for k,v in pairs(mpList) do + if #v>0 then + table.insert(tempList,v) + end + end + + return tempList +end + +function M:__OnDragEnd(context) + if DataManager.CurrenRoom ==nil or DataManager.CurrenRoom.self_player ==nil then + return + end + if self.outcard_button then + self.outcard_button = nil + end + local button = context.sender + + local card = button.data + + local _room = DataManager.CurrenRoom + card.btn_card.sortingOrder = 0 + -- print("button.y"..button.y .. "_room.curren_outcard_seat".._room.curren_outcard_seat) + local currentCtrS=IsHasDictionary(card.card_item,DataManager.CurrenRoom.self_player.currentNotPutCardList) + if currentCtrS==nil then currentCtrS=false end + if (button.y < -380 and _room.curren_outcard_seat == _room.self_player.seat) and currentCtrS==false then + button.touchable = false + self.outcard_button = card + self:UpdateIsOnClick(false) + self._mainView:OutCard(card.card_item) + else + local isChangeCard = false + self.outcard_button = nil + card.btn_card:GetChild("icon").icon = self:getCardItem("ui://Main_RunBeard/201_",card.card_item) + self._area_handcard_list:AddChild(button) + if #self.card_list == 1 then + isChangeCard = false + self:UpdateHandCardsPos() + return + end + local CountCards = {} + for i=1,#self.card_list do + local lists = {} + if CountCards[self.card_list[i].index_X] == nil then + lists[#lists+1] = self.card_list[i] + CountCards[self.card_list[i].index_X]= lists + else + CountCards[self.card_list[i].index_X][#CountCards[self.card_list[i].index_X]+1] =self.card_list[i] + end + end + + CountCards=self:ClearMpList(CountCards) + + local minmark = 1 + local maxmark = #self.card_list + if card == self.card_list[1] or card == self.card_list[#self.card_list] then + if self.card_list[1].index_X == self.card_list[2].index_X then + minmark =2 + end + if self.card_list[#self.card_list].index_X == self.card_list[#self.card_list-1].index_X then + maxmark =#self.card_list-1 + end + end + if button.x+button.width/2 < self.card_list[minmark].btn_card.x and #CountCards<12 then + list_remove(self.card_list,card) + local num = 0 + for i=1,#self.card_list do + if card.index_X == self.card_list[i].index_X and card.index_Y < self.card_list[i].index_Y then + self.card_list[i].index_Y = self.card_list[i].index_Y - 1 + end + if card.index_X == self.card_list[i].index_X then + num = num+1 + end + end + if num ==0 then + for i=1,#self.card_list do + if self.card_list[i].index_X < card.index_X then + self.card_list[i].index_X = self.card_list[i].index_X + 1 + end + end + else + for i=1,#self.card_list do + self.card_list[i].index_X = self.card_list[i].index_X + 1 + end + end + card.index_X =1 + card.index_Y =1 + table.insert(self.card_list,1,card) + isChangeCard = true + elseif button.x+button.width/2 > (self.card_list[maxmark].btn_card.x +button.width) and #CountCards<12 then + list_remove(self.card_list,card) + local num = 0 + for i=1,#self.card_list do + if card.index_X == self.card_list[i].index_X then + num = num+1 + end + if card.index_X == self.card_list[i].index_X and card.index_Y < self.card_list[i].index_Y then + self.card_list[i].index_Y = self.card_list[i].index_Y - 1 + end + end + if num ==0 then + for i=1,#self.card_list do + if self.card_list[i].index_X > card.index_X then + self.card_list[i].index_X = self.card_list[i].index_X - 1 + end + end + end + card.index_X =self.card_list[#self.card_list].index_X+1 + card.index_Y =1 + self.card_list[#self.card_list+1] =card + isChangeCard = true + else + local MoveCard = false + local MoveCardPos = 0 + local MoveCardY = 0 + for i=1,#CountCards do + if CountCards[i] then + local card_view = CountCards[i][1] + if card_view~=nil then + if button.x+button.width/2 > card_view.old_postion.x and button.x+button.width/2 < (card_view.old_postion.x+button.width) then + if card ~= card_view and #CountCards[i] <4 and card.index_X ~= card_view.index_X then + + MoveCardPos = i + MoveCardY = #CountCards[i]+1 + MoveCard = true + list_remove(self.card_list,card) + end + end + end + end + + end + local MoveCardindex = 0 + -- local MoveCardY = 0 + if button.x+button.width/2 > card.old_postion.x and button.x+button.width/2 < (card.old_postion.x+button.width) then + if #CountCards[card.index_X]>1 then + for i=1,#CountCards[card.index_X] do + local _cv = CountCards[card.index_X][i] + if _cv ~= card then + if button.y+button.height/2 > _cv.btn_card.y and button.y+button.height/2 < (_cv.btn_card.y+button.height) then + --向下移動 + if ((button.y+button.height/2) +20) > (card.old_postion.y+button.height) then + MoveCardindex = -1 + MoveCardPos = card.index_X + MoveCardY = _cv.index_Y + MoveCard = true + list_remove(self.card_list,card) + --向上移動 + elseif ((button.y+button.height/2) -20) < card.old_postion.y then + MoveCardindex = 1 + MoveCardPos = card.index_X + MoveCardY = _cv.index_Y + MoveCard = true + list_remove(self.card_list,card) + end + elseif i == #CountCards[card.index_X] and button.y+button.height/2 < _cv.btn_card.y then + MoveCardindex = 1 + MoveCardPos = card.index_X + MoveCardY = _cv.index_Y + MoveCard = true + list_remove(self.card_list,card) + elseif i == 1 and button.y+button.height/2 > (_cv.btn_card.y+button.width) then + MoveCardindex = -1 + MoveCardPos = card.index_X + MoveCardY = _cv.index_Y + MoveCard = true + list_remove(self.card_list,card) + end + end + end + end + + end + if MoveCard ==true and MoveCardindex ==0 then + local num = 0 + for i=1,#self.card_list do + if card.index_X == self.card_list[i].index_X and card.index_Y < self.card_list[i].index_Y then + self.card_list[i].index_Y = self.card_list[i].index_Y - 1 + end + if card.index_X == self.card_list[i].index_X then + num = num+1 + end + end + if num ==0 then + for i=1,#self.card_list do + if self.card_list[i].index_X > card.index_X then + self.card_list[i].index_X = self.card_list[i].index_X - 1 + end + end + if MoveCardPos > card.index_X then + MoveCardPos = MoveCardPos-1 + end + end + card.index_X =MoveCardPos + card.index_Y =MoveCardY + for i=#self.card_list,1,-1 do + if MoveCardPos == self.card_list[i].index_X then + table.insert(self.card_list,(i+1),card) + break + end + end + isChangeCard = true + --上下移动 + elseif MoveCard ==true and MoveCardindex ~= 0 then + for i=1,#self.card_list do + if card.index_X == self.card_list[i].index_X then + --向下移动 + if MoveCardindex == -1 then + if self.card_list[i].index_Y < card.index_Y and self.card_list[i].index_Y >= MoveCardY then + self.card_list[i].index_Y = self.card_list[i].index_Y + 1 + + end + --向上移动 + else + if self.card_list[i].index_Y > card.index_Y and self.card_list[i].index_Y <= MoveCardY then + self.card_list[i].index_Y = self.card_list[i].index_Y - 1 + + end + end + end + end + card.index_X =MoveCardPos + card.index_Y =MoveCardY + for i=#self.card_list,1,-1 do + if MoveCardPos == self.card_list[i].index_X and self.card_list[i].index_Y == (MoveCardY-1) then + table.insert(self.card_list,(i+1),card) + break + elseif MoveCardPos == self.card_list[i].index_X and self.card_list[i].index_Y == (MoveCardY+1) then + table.insert(self.card_list,i,card) + break + end + end + isChangeCard = true + else + isChangeCard = false + self._area_handcard_list:AddChild(button) + end + + end + self:UpdateHandCardsPos() + if isChangeCard ==true then + self:SendChangeCard() + end + end +end + +function M:UpdateOutCardList(outcard,isShow,isMopai,seat) + if(isShow == nil) then + isShow = false + end + if(isMopai == nil) then + isMopai = false + end + self._area_outcard_list:RemoveChildren(0,-1,true) + local outcards =UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Gcm_OutCard") + + if outcard==0 then + outcards:GetChild("icon").icon ="ui://Main_RunBeard/202_1_300" + else + outcards:GetChild("icon").icon =self:getCardItem("ui://Main_RunBeard/203_",outcard) + end + outcards.x,outcards.y = 0,0 + local show_di_bg = outcards:GetChild("show_di_bg") + -- show_di_bg.visible = true + if(isShow)then + if outcard == 0 then + show_di_bg.visible = false + end + if(seat ~= nil and outcards~=nil)then + if(isMopai)then + if outcard ~= 0 then + outcards:GetTransition("mopai"..seat):Play(function( ) + -- show_di_bg.visible = true + + end) + end + else + show_di_bg.visible = false + outcards:GetTransition("cpai"..seat):Play() + end + else + --show_di_bg.visible = true + end + else + show_di_bg.visible = false + end + self._area_outcard_list:AddChild(outcards) +end + +--弃牌 +function M:UpdateQiPai( qi_list,isplay) + self._area_qipai_list:RemoveChildren(0,-1,true) + for i=1,#qi_list do + local qicards =UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Qipai") + qicards:GetChild("icon").icon =self:getCardItem("ui://Main_RunBeard/202_",qi_list[i]) + if(isplay)then + if(i == #qi_list) then + qicards:GetTransition("t0"):Play() + end + end + self._area_qipai_list:AddChild(qicards) + end +end + +--摸牌动画 +function M:PlayingOutCardAnima( card) + coroutine.start(function() + coroutine.wait(0.1) + self:ClearOutCard() + end) +end + +function M:UpdateFzList( fz_list ,ispaly) + self._area_fz_list:RemoveChildren(0,-1,true) + for i = 1,#fz_list do + local fzitem=nil + if fz_list[i].type ~= RB_FZType.Kan then + fzitem =UIPackage.CreateObjectFromURL("ui://Main_RunBeard/ComponentNew") + if(ispaly == false)then + fzitem:RemoveChildren(0,-1,true) + end + end + if fz_list[i].type == RB_FZType.Chi or fz_list[i].type == RB_FZType.Bi then + + local fzcards =UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Fz_0_3") + fzcards:GetChild("card_"..1).icon = self:getCardItem("ui://Main_RunBeard/202_",fz_list[i].active_card) + fzcards:GetController("c2").selectedIndex = 1 + fzcards:GetChild("card_"..2).icon = self:getCardItem("ui://Main_RunBeard/202_",fz_list[i].opcard[1]) + fzcards:GetChild("card_"..3).icon = self:getCardItem("ui://Main_RunBeard/202_",fz_list[i].opcard[2]) + fzcards.x,fzcards.y = 0,0 + self:playAnim(fzitem,fzcards,#fz_list,i,ispaly) + + elseif fz_list[i].type == RB_FZType.Peng then + + local fzcards =UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Fz_0_3") + for j=1,3 do + fzcards:GetChild("card_"..j).icon =self:getCardItem("ui://Main_RunBeard/202_",fz_list[i].card) + end + fzcards.x,fzcards.y = 0,0 + self:playAnim(fzitem,fzcards,#fz_list,i,ispaly) + + elseif fz_list[i].type == RB_FZType.Wei then + + --[[ local fzcards =UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Fz_0_3") + fzcards:GetController("c1").selectedIndex=1 + for j=1,3 do + fzcards:GetChild("card_"..j).icon =self:getCardItem("ui://Main_RunBeard/202_",fz_list[i].card) + end + fzcards.x,fzcards.y = 0,0 + self:playAnim(fzitem,fzcards,#fz_list,i,ispaly)--]] + local fzcards =UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Fz_0_3") + for j=1,2 do + fzcards:GetChild("card_"..j).icon ="ui://Main_RunBeard/202_1_300" + end + fzcards:GetChild("card_"..3).icon =self:getCardItem("ui://Main_RunBeard/202_",fz_list[i].card) + fzcards.x,fzcards.y = 0,0 + self:playAnim(fzitem,fzcards,#fz_list,i,ispaly) + elseif fz_list[i].type == RB_FZType.ChouWei then + local fzcards =UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Fz_0_3") + for j=1,2 do + fzcards:GetChild("card_"..j).icon ="ui://Main_RunBeard/202_1_300" + end + fzcards:GetChild("card_"..3).icon =self:getCardItem("ui://Main_RunBeard/202_",fz_list[i].card) + fzcards.x,fzcards.y = 0,0 + self:playAnim(fzitem,fzcards,#fz_list,i,ispaly) + + elseif fz_list[i].type == RB_FZType.Pao then + + local fzcards =UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Fz_0_4") + for j=1,4 do + fzcards:GetChild("card_"..j).icon =self:getCardItem("ui://Main_RunBeard/202_",fz_list[i].card) + end + fzcards.x,fzcards.y = 0,0 + self:playAnim(fzitem,fzcards,#fz_list,i,ispaly) + + elseif fz_list[i].type == RB_FZType.Ti then + + local fzcards =UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Fz_0_4") + for j=1,4 do + if j==4 then + fzcards:GetChild("card_"..j).icon =self:getCardItem("ui://Main_RunBeard/202_",fz_list[i].card) + else + fzcards:GetChild("card_"..j).icon ="ui://Main_RunBeard/202_1_300" + end + end + fzcards.x,fzcards.y = 0,0 + self:playAnim(fzitem,fzcards,#fz_list,i,ispaly) + + end + end +end + + +function M:playAnim( fzitem,fzcards, size,i,ispaly ) + if(ispaly == nil)then + ispaly =false + end + if(ispaly and i == size)then + local faArray= fzitem:GetChild("chiwei") + if(faArray~=nil)then + faArray:AddChild(fzcards) + else + fzitem:AddChild(fzcards) + end + else + fzitem:AddChild(fzcards) + end + self._area_fz_list:AddChild(fzitem) +end + + + --出牌提示动画 + function M:ChuPaiTiShi() + if DataManager.CurrenRoom ==nil or DataManager.CurrenRoom.self_player ==nil then + return + end + local chu_player = DataManager.CurrenRoom.self_player + local selfplayeTable = {} + selfplayeTable.handcard_list = chu_player.handcard_list + selfplayeTable.fz_list = chu_player.fz_list + selfplayeTable.tiCount = chu_player.tiCount + selfplayeTable.paoCount = chu_player.paoCount + selfplayeTable.hu_xi = chu_player.hu_xi + local player = membe_deep_clone(selfplayeTable) + local mark_ting= {} + for i=1,#DataManager.CurrenRoom.self_player.handcard_list do + local card = DataManager.CurrenRoom.self_player.handcard_list[i] + list_remove(player.handcard_list, card) + local _player = membe_deep_clone(player) + local tingList = CardCheck.tingPai(_player,DataManager.CurrenRoom) + local isKan = false + for j=1,#player.fz_list do + if card == player.fz_list[j].card and player.fz_list[j].type == RB_FZType.Kan then + isKan =true + end + end + if #tingList > 0 and isKan == false then + + mark_ting[#mark_ting+1] = card + end + table.insert(player.handcard_list, card) + table.sort( player.handcard_list, ViewUtil.HandCardSort) + end + -- print("ChuPaiTiShi",#mark_ting) + --pt(mark_ting) + if DataManager.CurrenRoom.curren_outcard_seat == DataManager.CurrenRoom.self_player.seat then + self._view :GetController("chupai").selectedIndex =1 + if #mark_ting>0 then + for i=1,#mark_ting do + for k=1,#self.card_list do + local card_view= self.card_list[k] + if card_view.card_item == mark_ting[i] then + card_view.btn_card:GetController("mark_ting").selectedIndex = 1 + end + end + end + end + else + self._view :GetController("chupai").selectedIndex =0 + for k=1,#self.card_list do + local card_view= self.card_list[k] + card_view.btn_card:GetController("mark_ting").selectedIndex = 0 + + end + end +end + +return M \ No newline at end of file diff --git a/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/Protocol.lua b/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/Protocol.lua new file mode 100644 index 00000000..cf0df3be --- /dev/null +++ b/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/Protocol.lua @@ -0,0 +1,55 @@ +local Protocol = { + + + -- 出牌 + GAME_DIS_CARD = "611", + -- 提示选择行为 + GAME_ACTION = "612", + + -- 通知服务器手牌队形改变 + GAME_CHANGE_CARD = "613", + -- 通知服务器牌字体改变 + GAME_CHANGE_TYPEfACE = "615", + + -- 发牌协议 + GAME_EVT_PLAYER_DEAL = "811", + + -- 出牌事件 + GAME_EVT_DISCARD = "812", + + -- 出牌提示事件 + GAME_EVT_DISCARD_TIP = "813", + + -- 放子提示事件 + GAME_EVT_FZTIPS = "814", + + -- action 事件 + GAME_EVT_ACTION = "815", + + -- 胡牌事件 + GAME_EVT_HU = "816", + + -- 结算 + GAME_EVT_RESULT1 = "817", + + -- 弃牌 + GAME_EVT_QIPAI = "818", + + -- 抓牌 + GAME_EVT_DRAW = "819", + + -- 转盘指向事件 + GAME_EVT_CHANGE_ACTIVE_PLAYER = "820", + --第二十一张牌 + GAME_EVT_ADD_CARD = "821", + + GAME_EVT_Send_Piao = "1015", + GAME_EVT_Piao_Tip = "2031", + GAME_EVT_Piao_Action = "2032", + + GAME_XIPAI = "20836", + GAME_EVENT_XIPAI = "20837", + GAME_EVENT_NOTIFY_XIPAI = "20838", +} + +return Protocol \ No newline at end of file diff --git a/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/RunBeard_GameEvent.lua b/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/RunBeard_GameEvent.lua new file mode 100644 index 00000000..3af8734d --- /dev/null +++ b/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/RunBeard_GameEvent.lua @@ -0,0 +1,41 @@ + +local RunBeard_GameEvent = { + -- 换座 + + -- 发牌 + SendCards = "SendCards", + + -- 胡牌 + ZPHuCard = "ZPHuCard", + -- 结算事件 + ZPResult1 = "ZPResult1", + -- 大结算事件 + ZPResult2 = "ZPResult2", + + + EventDicelCard ="EventDicelCard", + OnEventTake = "OnEventTake", + + OnEcentRecond = "OnEcentRecond", + + EventTurn = "EventTurn", + + OutHint = "OutHint", + + + GetCard = "GetCard", + + OutCard = "OutCard", + + FangziAction = "FangziAction", + + FZTips = "FZTips", + QiCard = "QiCard", + AddCard = "AddCard", + + OnPiaoTips="OnPiaoTips", + OnPiaoAction="OnPiaoAction", + EventXiPai="EventXiPai", + +} +return RunBeard_GameEvent diff --git a/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/RunBeard_ResultView.lua b/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/RunBeard_ResultView.lua new file mode 100644 index 00000000..8c691f9d --- /dev/null +++ b/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/RunBeard_ResultView.lua @@ -0,0 +1,823 @@ +require('Game.View.ResultView') +local PendulumRule = import('.main.PendulumRule') +local RunBeard_ResultView = {} + +local M = RunBeard_ResultView + +function RunBeard_ResultView.new(blur_view, index) + setmetatable(M, {__index = ResultView}) + local self = setmetatable({}, {__index = M}) + self.class = 'RunBeard_ResultView' + self._currenIndex = 0 + if index ~= 1 then + self._blur_view = blur_view + end + self._close_zone = false + + self:init('ui://Extend_Poker_FanPaoFa/clearing') + self.xiPaiCtr=self._view:GetController("xipai") + return self +end + +function M:init(url) + ResultView.init(self, url) + local btn_share = self._view:GetChild('btn_share') + btn_share.onClick:Set( + function() + ShareScreenShot() + end + ) +end + +function M:InitData(over, room, result, total_result, callback) + local _overCtr = self._view:GetController('over') + local btn_confirm = self._view:GetChild('btn_confirm') + local btn_result = self._view:GetChild('btn_showResult') + local _btnCtr = self._view:GetController('button') + local _sdkCtr = self._view:GetController('sdk') + local _icon = self._view:GetChild('win_base') + local btn_close = self._view:GetChild('btn_close') + self._view:GetChild('tex_roomnum').text = room.room_id + self._view:GetChild('tex_data').text = os.date('%Y-%m-%d %H:%M', os.time()) + + + local round=DataManager.CurrenRoom.room_config.config.times or 1 + local xpconfig=DataManager.CurrenRoom.room_config.config.xi_pai + if xpconfig and round>1 then + self.xiPaiCtr.selectedIndex=1 + else + self.xiPaiCtr.selectedIndex=0 + end + + local xipai=self._view:GetChild("btn_xipai") + xipai.touchable=true + xipai.onClick:Add(function() + local xiPaiCallBack=function () + xipai.touchable=false + self.xiPaiCtr.selectedIndex=0 + ViewUtil.ErrorTip(1000000,"申请洗牌成功") + end + local _gamectr = ControllerManager.GetController(GameController) + _gamectr:SendXiPaiAction(xiPaiCallBack) + end) + if result and result.xipai_score then + --xipai.text="洗牌 积分x"..result.xipai_score + end + + + if result ~= nil and result.liuju == true then + _icon.icon = 'ui://Main_RunBeard/liuju' + _btnCtr.selectedIndex = 0 + _sdkCtr.selectedIndex = 1 + _overCtr.selectedIndex = 2 + + if over ~= 1 then + btn_confirm.onClick:Add( + function() + local _gamectr = ControllerManager.GetController(GameController) + _gamectr:PlayerReady() + self:Close() + + if callback then + callback() + end + end + ) + self:AddClearItem(room, result, nil, over) + return + else + self.xiPaiCtr.selectedIndex=0 + _btnCtr.selectedIndex = 1 + _sdkCtr.selectedIndex = 1 + btn_result.onClick:Add( + function() + _overCtr.selectedIndex = 3 + _btnCtr.selectedIndex = 0 + _sdkCtr.selectedIndex = 0 + end + ) + btn_close.onClick:Add( + function() + ViewManager.ChangeView(ViewManager.View_Lobby) + end + ) + self:AddClearItem(room, result, total_result.info_list, over) + end + end + + if over == 0 and result.liuju == false then + _icon.icon = 'ui://Main_RunBeard/jiesuan' + _btnCtr.selectedIndex = 0 + _sdkCtr.selectedIndex = 1 + _overCtr.selectedIndex = 0 + btn_confirm.onClick:Add( + function() + local _gamectr = ControllerManager.GetController(GameController) + _gamectr:PlayerReady() + self:Close() + + if callback then + callback() + end + end + ) + self:AddClearItem(room, result, nil, over) + elseif over == 1 and result.liuju == false then + _icon.icon = 'ui://Main_RunBeard/jiesuan' + _btnCtr.selectedIndex = 1 + _sdkCtr.selectedIndex = 1 + _overCtr.selectedIndex = 0 + btn_result.onClick:Add( + function() + _overCtr.selectedIndex = 3 + _btnCtr.selectedIndex = 0 + _sdkCtr.selectedIndex = 0 + end + ) + btn_close.onClick:Add( + function() + ViewManager.ChangeView(ViewManager.View_Lobby) + end + ) + self:AddClearItem(room, result, total_result.info_list, over) + else + if result ~= nil then + if result.liuju == false then + _icon.icon = 'ui://Main_RunBeard/jiesuan' + over = 2 + _overCtr.selectedIndex = 3 + btn_close.onClick:Add( + function() + ViewManager.ChangeView(ViewManager.View_Lobby) + end + ) + self:AddClearItem(room, nil, total_result.info_list, over) + end + else + _icon.icon = 'ui://Main_RunBeard/jiesuan' + over = 2 + _overCtr.selectedIndex = 3 + self.xiPaiCtr.selectedIndex=0 + btn_close.onClick:Add( + function() + ViewManager.ChangeView(ViewManager.View_Lobby) + end + ) + self:AddClearItem(room, nil, total_result.info_list, over) + end + end +end + +function M:AddClearItem(room, data, total_data, over) + local n = over + 1 + local list_view1 = self._view:GetChild('player_list') + local list_view2 = self._view:GetChild('player_list_2') + + if data ~= nil and data.liuju == true then + self:FillLiuJuItemData(room, data) + if over == 1 then + self:FillItemData2(room, total_data, list_view2) + end + else + if 0 == over or 1 == over and data.liuju == false then + self:FillItemData(room, data, list_view1) + if 1 == over then + self:FillItemData2(room, total_data, list_view2) + end + elseif 2 == over then + self:FillItemData2(room, total_data, list_view2) + end + end +end + +function M:GetPos(room, seat) + return ViewUtil.GetPos(room.self_player.seat, seat, room.room_config.people_num) +end +function M:FillLiuJuItemData(room, data) + local qipai_list = self._view:GetChild('qipai_listl') + local _dipaiC = self._view:GetController('qipai') + qipai_list:RemoveChildrenToPool() + if data.throw_card ~= nil and #data.throw_card > 0 then + _dipaiC.selectedIndex = 1 + local hand_card = PendulumRule.GetHandCard(data.throw_card, 3) + for k = 1, #hand_card do + local cards = qipai_list:AddItemFromPool() + for j = 1, #hand_card[k] do + cards:GetChild('card_' .. (j)).icon = self:getCardItem('ui://Main_RunBeard/202_', hand_card[k][j]) + end + end + else + _dipaiC.selectedIndex = 0 + end + for i = 1, #data.info_list do + if data.info_list[i].seat ~= room.self_player.seat and #data.info_list[i].hand_card > 0 then + local card_list + if #data.info_list == 2 then + card_list = self._view:GetChild('card_list_2') + else + if self:GetPos(room, data.info_list[i].seat) == 2 then + card_list = self._view:GetChild('card_list_1') + else + card_list = self._view:GetChild('card_list_3') + end + end + + card_list:RemoveChildrenToPool() + for k = 1, #data.info_list[i].opCardList do + local fztype = data.info_list[i].opCardList[k].type + if fztype == RB_FZType.Kan then + local cards = card_list:AddItemFromPool() + for j = 1, 3 do + cards:GetChild('card_' .. j).icon = + self:getCardItem('ui://Main_RunBeard/202_', data.info_list[i].opCardList[k].card1) + end + end + end + local hand_card = PendulumRule.GetHandCard(data.info_list[i].hand_card, 3) + for k = 1, #hand_card do + local item = card_list:AddItemFromPool() + for j = 1, #hand_card[k] do + item:GetChild('card_' .. (j)).icon = self:getCardItem('ui://Main_RunBeard/202_', hand_card[k][j]) + end + end + end + end +end + +local haoNameList={"散毫","清溜","内毫","外毫"} +local huxiList={40,30,20,10} +function M:FillItemData(room, data, item) + local dipai_list = self._view:GetChild('dipai_list') + dipai_list:RemoveChildren(0, -1, true) + if data.left_card ~= nil and #data.left_card > 0 then + for i = 1, #data.left_card do + local dipais = UIPackage.CreateObjectFromURL('ui://Main_RunBeard/Qipai') + dipais:GetChild('icon').icon = self:getCardItem('ui://Main_RunBeard/202_', data.left_card[i]) + dipai_list:AddChild(dipais) + end + end + local qipai_list = self._view:GetChild('qipai_list') + local _dipaiC = self._view:GetController('qipai') + qipai_list:RemoveChildrenToPool() + if data.throw_card ~= nil and #data.throw_card > 0 then + _dipaiC.selectedIndex = 1 + local hand_card = PendulumRule.GetHandCard(data.throw_card, 3) + for k = 1, #hand_card do + local cards = qipai_list:AddItemFromPool() + for j = 1, #hand_card[k] do + cards:GetChild('card_' .. (j)).icon = self:getCardItem('ui://Main_RunBeard/202_', hand_card[k][j]) + end + end + else + _dipaiC.selectedIndex = 0 + end + local info_list = data.info_list + local Yes_win = false + local win_data = {} + for i = 1, #info_list do + if info_list[i].is_win == true then + Yes_win = true + win_data = info_list[i] + end + end + --printlog("win_data===>>>") + --pt(win_data) + if win_data.seat == room.self_player.seat then + self._view:GetChild('show_win').visible = true + self._view:GetChild('show_low').visible = false + else + self._view:GetChild('show_win').visible = false + self._view:GetChild('show_low').visible = true + end + + if Yes_win == true then + local isWin_Card = true + local p = room:GetPlayerBySeat(win_data.seat) + if p.self_user.account_id == room.owner_id then + self._view:GetController('owner').selectedIndex = 1 + end + if p.seat == room.banker_seat then + self._view:GetController('bank').selectedIndex = 1 + end + self._view:GetChild('WinerName').text = p.self_user.nick_name + --self._view:GetChild('chongtunshu').text = '充囤:' .. room.room_config.tun .. ' 囤' + self._view:GetChild('huxi').text = '胡息:' .. win_data.hu_xi + --self._view:GetChild('tunshu').text = '基础囤数:' .. win_data.tun + --self._view:GetChild('zongtunshu').text = '总囤数:' .. win_data.total_tun + if win_data.round_score >= 0 then + self._view:GetChild('score').text = '游戏分:+' .. win_data.round_score + self._view:GetChild('score').grayed = false + else + self._view:GetChild('score').text = '游戏分:' .. win_data.round_score + self._view:GetChild('score').grayed = true + end + local hp_info = win_data.hp_info + if (hp_info ~= nil and room.hpOnOff == 1 or room:checkHpNonnegative()) then + local round_actual_hp = d2ad(hp_info.round_actual_hp) --// 本局实际输赢体力值 + self._view:GetChild('tili_score').visible = true + self._view:GetChild('tili_title').visible = true + if (round_actual_hp > 0) then + self._view:GetChild('tili_score').text = '积分:+' .. round_actual_hp + self._view:GetChild('tili_score').grayed = false + else + self._view:GetChild('tili_score').text = '积分:' .. round_actual_hp + self._view:GetChild('tili_score').grayed = true + end + end + + if (hp_info ~= nil and room.hpOnOff == 1 or room:checkHpNonnegative()) then + local isupper_limit = hp_info.upper_limit -- // 输赢是否已达上限 + if (isupper_limit) then + self._view:GetChild('yidashangxian').text = '已达上限' + else + self._view:GetChild('yidashangxian').text = '' + end + end + + local btn_head = self._view:GetChild('btn_head') + ImageLoad.Load(p.self_user.head_url, btn_head._iconObject) + local fullname_list = self._view:GetChild('fullname_list') + fullname_list:RemoveChildren(0, -1, true) + if win_data.mingtang ~= nil and #win_data.mingtang > 0 then + for i = 1, #win_data.mingtang do + local dipais = UIPackage.CreateObjectFromURL('ui://Extend_Poker_FanPaoFa/FullName') + dipais:GetChild('n0').icon = 'ui://Extend_Poker_FanPaoFa/hu_' .. win_data.mingtang[i].mingtang + --[[if win_data.mingtang[i].type == 1 and win_data.mingtang[i].score ~= 0 then + dipais:GetChild('n2').text = win_data.mingtang[i].score .. ' 番' + elseif win_data.mingtang[i].type == 2 and win_data.mingtang[i].score ~= 0 then + dipais:GetChild('n2').text = win_data.mingtang[i].score .. ' 囤' + elseif win_data.mingtang[i].type == 3 and win_data.mingtang[i].score ~= 0 then + dipais:GetChild('n2').text = win_data.mingtang[i].score .. ' 倍' + end--]] + if win_data.mingtang[i].score ~= 0 then + dipais:GetChild('n2').text = win_data.mingtang[i].score .. '胡息' + end + fullname_list:AddChild(dipais) + end + end + local card_list = self._view:GetChild('card_list') + card_list:RemoveChildrenToPool() + if #win_data.cardList > 0 then + for i = 1, #win_data.cardList do + -- 1 是对子 2 是三个的 + local fztype = win_data.cardList[i].type + if fztype == 1 then + local cards = card_list:AddItemFromPool() + cards:GetChild('card_type').text = '将' + cards:GetChild('card_huxi').text = win_data.cardList[i].hu_xi + cards:GetController('c1').selectedIndex = 0 + if win_data.cardList[i].card1 == win_data.win_card and isWin_Card == true then + isWin_Card = false + cards:GetController('hu').selectedIndex = 1 + cards:GetChild('card_huxi').text = win_data.cardList[i].hu_xi+1 + end + for j = 1, 2 do + cards:GetChild('card_' .. j).icon = + self:getCardItem('ui://Main_RunBeard/201_', win_data.cardList[i]['card'..j]) + end + else + local cards = card_list:AddItemFromPool() + cards:GetChild('card_type').text = '顺' + if + win_data.cardList[i].card1 == win_data.cardList[i].card2 and + win_data.cardList[i].card1 == win_data.cardList[i].card3 + then + cards:GetChild('card_type').text = '碰' + end + if fztype == 4 then + cards:GetChild('card_type').text = '歪' + end + cards:GetChild('card_huxi').text = win_data.cardList[i].hu_xi + cards:GetController('c1').selectedIndex = 1 + cards:GetChild('card_1').icon = + self:getCardItem('ui://Main_RunBeard/201_', win_data.cardList[i].card1) + cards:GetChild('card_2').icon = + self:getCardItem('ui://Main_RunBeard/201_', win_data.cardList[i].card2) + cards:GetChild('card_3').icon = + self:getCardItem('ui://Main_RunBeard/201_', win_data.cardList[i].card3) + if isWin_Card == true then + if win_data.cardList[i].card1 == win_data.win_card then + isWin_Card = false + cards:GetController('hu').selectedIndex = 1 + cards:GetChild('card_huxi').text = win_data.cardList[i].hu_xi+1 + elseif win_data.cardList[i].card2 == win_data.win_card then + isWin_Card = false + cards:GetController('hu').selectedIndex = 2 + cards:GetChild('card_huxi').text = win_data.cardList[i].hu_xi+1 + elseif win_data.cardList[i].card3 == win_data.win_card then + isWin_Card = false + cards:GetController('hu').selectedIndex = 3 + cards:GetChild('card_huxi').text = win_data.cardList[i].hu_xi+1 + end + + end + end + end + end + for i = 1, #win_data.opCardList do + local fztype = win_data.opCardList[i].type + if fztype == RB_FZType.Chi then + local cards = card_list:AddItemFromPool() + cards:GetChild('card_type').text = '顺' + cards:GetChild('card_huxi').text = win_data.opCardList[i].hu_xi + cards:GetController('c1').selectedIndex = 1 + cards:GetChild('card_1').icon = + self:getCardItem('ui://Main_RunBeard/201_', win_data.opCardList[i].card1) + cards:GetChild('card_2').icon = + self:getCardItem('ui://Main_RunBeard/201_', win_data.opCardList[i].card2) + cards:GetChild('card_3').icon = + self:getCardItem('ui://Main_RunBeard/201_', win_data.opCardList[i].card3) + --[[if isWin_Card == true then + if win_data.opCardList[i].card1 == win_data.win_card then + isWin_Card = false + cards:GetController('hu').selectedIndex = 1 + cards:GetChild('card_huxi').text = win_data.opCardList[i].hu_xi+1 + elseif win_data.opCardList[i].card2 == win_data.win_card then + isWin_Card = false + cards:GetController('hu').selectedIndex = 2 + cards:GetChild('card_huxi').text = win_data.opCardList[i].hu_xi+1 + elseif win_data.opCardList[i].card3 == win_data.win_card then + isWin_Card = false + cards:GetController('hu').selectedIndex = 3 + cards:GetChild('card_huxi').text = win_data.opCardList[i].hu_xi+1 + end + + end--]] + elseif fztype == RB_FZType.Peng then + local cards = card_list:AddItemFromPool() + cards:GetChild('card_type').text = '碰' + cards:GetChild('card_huxi').text = win_data.opCardList[i].hu_xi + cards:GetController('c1').selectedIndex = 1 + for j = 1, 3 do + cards:GetChild('card_' .. j).icon = + self:getCardItem('ui://Main_RunBeard/201_', win_data.opCardList[i].card1) + end + --[[if win_data.opCardList[i].card1 == win_data.win_card and isWin_Card == true then + isWin_Card = false + cards:GetController('hu').selectedIndex = 1 + cards:GetChild('card_huxi').text = win_data.opCardList[i].hu_xi+1 + end--]] + elseif fztype == RB_FZType.Kan then + local cards = card_list:AddItemFromPool() + cards:GetChild('card_type').text = '坎' + cards:GetChild('card_huxi').text = win_data.opCardList[i].hu_xi + cards:GetController('c1').selectedIndex = 1 + --[[if win_data.opCardList[i].card1 == win_data.win_card and isWin_Card == true then + isWin_Card = false + cards:GetController('hu').selectedIndex = 1 + cards:GetChild('card_huxi').text = win_data.opCardList[i].hu_xi+1 + end--]] + for j = 1, 3 do + cards:GetChild('card_' .. j).icon = + self:getCardItem('ui://Main_RunBeard/201_', win_data.opCardList[i].card1) + end + elseif fztype == RB_FZType.Wei or fztype == RB_FZType.ChouWei then + local cards = card_list:AddItemFromPool() + cards:GetChild('card_type').text = '歪' + cards:GetChild('card_huxi').text = win_data.opCardList[i].hu_xi + cards:GetController('c1').selectedIndex = 1 + --[[ if win_data.opCardList[i].card1 == win_data.win_card and isWin_Card == true then + isWin_Card = false + cards:GetController('hu').selectedIndex = 1 + cards:GetChild('card_huxi').text = win_data.opCardList[i].hu_xi+1 + end--]] + for j = 1, 3 do + cards:GetChild('card_' .. j).icon = + self:getCardItem('ui://Main_RunBeard/201_', win_data.opCardList[i].card1) + end + elseif fztype == RB_FZType.Pao then + local cards = card_list:AddItemFromPool() + cards:GetChild('card_type').text = '跑' + cards:GetChild('card_huxi').text = win_data.opCardList[i].hu_xi + cards:GetController('c1').selectedIndex = 2 + --[[if win_data.opCardList[i].card1 == win_data.win_card and isWin_Card == true then + isWin_Card = false + cards:GetController('hu').selectedIndex = 1 + cards:GetChild('card_huxi').text = win_data.opCardList[i].hu_xi+1 + end--]] + for j = 1, 4 do + cards:GetChild('card_' .. j).icon = + self:getCardItem('ui://Main_RunBeard/201_', win_data.opCardList[i].card1) + end + elseif fztype == RB_FZType.Ti then + local cards = card_list:AddItemFromPool() + cards:GetChild('card_type').text = '溜' + cards:GetChild('card_huxi').text = win_data.opCardList[i].hu_xi + cards:GetController('c1').selectedIndex = 2 + --[[if win_data.opCardList[i].card1 == win_data.win_card and isWin_Card == true then + isWin_Card = false + cards:GetController('hu').selectedIndex = 1 + cards:GetChild('card_huxi').text = win_data.opCardList[i].hu_xi+1 + end--]] + for j = 1, 4 do + cards:GetChild('card_' .. j).icon = + self:getCardItem('ui://Main_RunBeard/201_', win_data.opCardList[i].card1) + end + end + end + + if #win_data.hand_card > 0 then + for i = 1, #win_data.hand_card, 4 do + local cards = card_list:AddItemFromPool() + cards:GetChild('card_type').text = '散' + cards:GetChild('card_huxi').text = 0 + cards:GetController('c1').selectedIndex = 2 + for j = 0, 3 do + if (i + j) <= #win_data.hand_card then + cards:GetChild('card_' .. (j + 1)).icon = + self:getCardItem('ui://Main_RunBeard/201_', win_data.hand_card[i + j]) + if win_data.hand_card[i + j] == win_data.win_card and isWin_Card == true then + isWin_Card = false + cards:GetController('hu').selectedIndex = j + 1 + cards:GetChild('card_huxi').text = 1 + end + end + end + end + end + + + if win_data.haoList and #win_data.haoList then + local tempHaoList={} + for i=1,#win_data.haoList do + if win_data.haoList[i].hao>0 then + if tempHaoList[win_data.haoList[i].hao]==nil then + tempHaoList[win_data.haoList[i].hao]={} + end + table.insert(tempHaoList[win_data.haoList[i].hao],win_data.haoList[i]) + + end + end + + + for k,v in pairs(tempHaoList) do + local count=#v + printlog(count) + if count<5 then + local cards = card_list:AddItemFromPool() + cards:GetChild('card_type').text = haoNameList[tonumber(k)] + local haoNum=huxiList[tonumber(k)] + if DataManager.CurrenRoom.room_config.config.hao_config and DataManager.CurrenRoom.room_config.config.hao_config==1 then + haoNum=(haoNum+10)*count + else + haoNum=(haoNum)*count + end + cards:GetChild('card_huxi').text = haoNum + cards:GetController('c1').selectedIndex = 2 + for i=1,count do + cards:GetChild('card_' .. i).icon = + self:getCardItem('ui://Main_RunBeard/201_', v[i].hao_card) + end + + + end + end + + + + end + + end + + item:RemoveChildrenToPool() + for i = 1, #info_list do + if info_list[i].is_win == false then + local player = item:AddItemFromPool() + local p = room:GetPlayerBySeat(info_list[i].seat) + if p.self_user.account_id == room.owner_id then + player:GetController('owner').selectedIndex = 1 + end + if p.seat == room.banker_seat then + player:GetController('bank').selectedIndex = 1 + end + local btn_head = player:GetChild('btn_head') + ImageLoad.Load(p.self_user.head_url, btn_head._iconObject) + player:GetChild('playerName').text = p.self_user.nick_name + if info_list[i].round_score >= 0 then + player:GetChild('score').text = '+' .. info_list[i].round_score + player:GetChild('score').grayed = false + else + player:GetChild('score').text = info_list[i].round_score + player:GetChild('score').grayed = true + end + local hp_info = info_list[i].hp_info + if (hp_info ~= nil and room.hpOnOff == 1 or room:checkHpNonnegative()) then + local round_actual_hp = d2ad(hp_info.round_actual_hp) --// 本局实际输赢体力值 + player:GetChild('tili_score').visible = true + player:GetChild('tili_title').visible = true + if (round_actual_hp > 0) then + player:GetChild('tili_score').text = '+' .. round_actual_hp + player:GetChild('tili_score').grayed = false + else + player:GetChild('tili_score').text = '' .. round_actual_hp + player:GetChild('tili_score').grayed = true + end + end + if (hp_info ~= nil and room.hpOnOff == 1 or room:checkHpNonnegative()) then + local isupper_limit = hp_info.upper_limit -- // 输赢是否已达上限 + if (isupper_limit) then + player:GetChild('yidashangxian').text = '已达上限' + else + player:GetChild('yidashangxian').text = '' + end + end + local card_list = player:GetChild('card_list') + card_list:RemoveChildrenToPool() + for k = 1, #info_list[i].opCardList do + local fztype = info_list[i].opCardList[k].type + if fztype == RB_FZType.Chi then + local cards = card_list:AddItemFromPool() + cards:GetChild('card_1').icon = + self:getCardItem('ui://Main_RunBeard/202_', info_list[i].opCardList[k].card1) + cards:GetChild('card_2').icon = + self:getCardItem('ui://Main_RunBeard/202_', info_list[i].opCardList[k].card2) + cards:GetChild('card_3').icon = + self:getCardItem('ui://Main_RunBeard/202_', info_list[i].opCardList[k].card3) + elseif fztype == RB_FZType.Peng then + local cards = card_list:AddItemFromPool() + for j = 1, 3 do + cards:GetChild('card_' .. j).icon = + self:getCardItem('ui://Main_RunBeard/202_', info_list[i].opCardList[k].card1) + end + elseif fztype == RB_FZType.Kan then + local cards = card_list:AddItemFromPool() + for j = 1, 3 do + cards:GetChild('card_' .. j).icon = + self:getCardItem('ui://Main_RunBeard/202_', info_list[i].opCardList[k].card1) + end + elseif fztype == RB_FZType.Wei or fztype == RB_FZType.ChouWei then + local cards = card_list:AddItemFromPool() + for j = 1, 3 do + cards:GetChild('card_' .. j).icon = + self:getCardItem('ui://Main_RunBeard/202_', info_list[i].opCardList[k].card1) + end + elseif fztype == RB_FZType.Pao then + local cards = card_list:AddItemFromPool() + for j = 1, 4 do + cards:GetChild('card_' .. j).icon = + self:getCardItem('ui://Main_RunBeard/202_', info_list[i].opCardList[k].card1) + end + elseif fztype == RB_FZType.Ti then + local cards = card_list:AddItemFromPool() + for j = 1, 4 do + cards:GetChild('card_' .. j).icon = + self:getCardItem('ui://Main_RunBeard/202_', info_list[i].opCardList[k].card1) + end + end + end + if #info_list[i].hand_card > 0 then + local hand_card = PendulumRule.GetHandCard(info_list[i].hand_card, 3) + for k = 1, #hand_card do + local cards = card_list:AddItemFromPool() + for j = 1, #hand_card[k] do + cards:GetChild('card_' .. (j)).icon = + self:getCardItem('ui://Main_RunBeard/202_', hand_card[k][j]) + end + end + end + end + end +end + +function M:FillItemData2(room, data, list) + -- 赋值result_info,聊天室分享需要 + local player_list = {} + for i = 1, #data do + player_list[i] = {} + local user = room:GetPlayerBySeat(data[i].seat).self_user + local p = room:GetPlayerBySeat(data[i].seat) + player_list[i].id = user.account_id + local total_score = data[i].total_score + player_list[i].hp_info = data[i].hp_info + player_list[i].score = total_score + player_list[i].house = room.owner_id == player_list[i].id and 1 or 0 + player_list[i].nick = user.nick_name + player_list[i].head_url = user.head_url + local entrust = data[i].entrust + if entrust == nil then + entrust = false + end + player_list[i].entrust = entrust + player_list[i].param = {} + local wcount = 0 + if (data[i].win_count ~= nil) then + wcount = data[i].win_count + end + local hxcount = 0 + if (data[i].total_huxi ~= nil) then + hxcount = data[i].total_huxi + end + player_list[i].param[1] = {} + player_list[i].param[1].key = '胡牌次数:' + player_list[i].param[1].value = tostring(wcount) + player_list[i].param[2] = {} + player_list[i].param[2].key = '胡息总数:' + player_list[i].param[2].value = tostring(hxcount) + end + local round = room.room_config.round + self:GenerateRoomResultInfo(round, room.room_config:GetGameName(), room.room_id, room.create_time, player_list) + self:SetGSListlineGap(5) + self:InitBigResult(room, 26) + DataManager.CurrenRoom = nil + -- list:RemoveChildrenToPool() + -- for i =1, #data do + -- local total_score = room:GetTotalScore(data[i].total_score) + -- local item = list:AddItemFromPool() + -- local p = room:GetPlayerBySeat(data[i].seat) + -- if p.self_user.account_id == room.owner_id then + -- item:GetController("owner").selectedIndex = 1 + -- end + + -- local btn_head = item:GetChild("btn_head") + -- ImageLoad.Load(p.self_user.head_url, btn_head._iconObject) + -- item:GetChild("win_count").text = "胡牌次数:"..data[i].win_count.."次" + -- item:GetChild("total_huxi").text = "胡息总数:"..data[i].total_huxi + -- --点赞 + -- self:Click_zan(item, p.self_user.account_id) + + -- item:GetChild("name").text = p.self_user.nick_name + + -- local hp_info = data[i].hp_info + -- if(hp_info ~=nil and room.hpOnOff == 1 or room:checkHpNonnegative()) then + -- -- --体力值 + -- -- local round_actual_hp = d2ad(hp_info.round_actual_hp) --// 本局实际输赢体力值 + -- local isupper_limit = hp_info.upper_limit -- // 输赢是否已达上限 + -- if(isupper_limit)then + -- item:GetChild("yidashangxian").text = "已达上限" + -- else + -- item:GetChild("yidashangxian").text = "" + -- end + -- end + -- local x = room:GetOriginScore(total_score) + -- if total_score >= 0 then + -- item:GetChild("score").text = "+"..x + -- item:GetChild("score").grayed = false + -- else + -- item:GetChild("score").text = x + -- item:GetChild("score").grayed = true + -- end + -- if room.hpOnOff == 1 and room.score_times ~= 1 or room:checkHpNonnegative() then + -- item:GetController("bei") .selectedIndex=1 + -- item:GetChild("sss").text = room.score_times + -- if(hp_info ~= nil)then + -- local round_actual_hp = d2ad(hp_info.total_hp) --// 本局实际输赢体力值 + -- total_score = round_actual_hp + -- end + -- if total_score >= 0 then + -- item:GetChild("score1").text = "+"..total_score + -- item:GetChild("score1").grayed = false + -- else + -- item:GetChild("score1").text = total_score + -- item:GetChild("score1").grayed = true + -- end + -- end + -- if #data ==3 then + -- if i ==1 then + -- if total_score >data[2].total_score and total_score >data[3].total_score then + -- item:GetController("winer") .selectedIndex=1 + -- end + -- elseif i ==2 then + -- if total_score >data[1].total_score and total_score >data[3].total_score then + -- item:GetController("winer") .selectedIndex=1 + -- end + -- elseif i ==3 then + -- if total_score >data[2].total_score and total_score >data[1].total_score then + -- item:GetController("winer") .selectedIndex=1 + -- end + -- end + -- else + -- if i ==1 then + -- if total_score >data[2].total_score then + -- item:GetController("winer") .selectedIndex=1 + -- end + -- elseif i ==2 then + -- if total_score >data[1].total_score then + -- item:GetController("winer") .selectedIndex=1 + -- end + -- end + + -- end + -- end + + -- DataManager.CurrenRoom = nil +end + +function M:LoadHead(p, room) + local btn_head = self._view:GetChild('btn_head') + for i = 1, #room.player_list do + local player = room.player_list[i] + if p.seat == player.seat and player.self_user.head_url ~= '' then + ImageLoad.Load(player.self_user.head_url, btn_head.icon) + end + end +end +function M:getCardItem(card_1, card_2) + local _room = DataManager.CurrenRoom + if _room ~= nil and _room.change_card_display ~= nil then + return card_1 .. _room.change_card_display .. card_2 + else + return card_1 .. '2_' .. card_2 + end +end + +return M diff --git a/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/main/CardCheck.lua b/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/main/CardCheck.lua new file mode 100644 index 00000000..eca6fda3 --- /dev/null +++ b/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/main/CardCheck.lua @@ -0,0 +1,648 @@ +-- 检测牌是否存在 +local function checkCard(eventCard, cardList, num) + if num == nil then + num = 1 + end + local result = 0 + for i = 1, #cardList do + if (cardList[i] == eventCard) then + result = result + 1 + if (result == num) then + return true + end + end + end + return false +end + +-- 移除指定数量的牌 +local function removeCard(cardList, card, count) + for i = 1, count do + list_remove(cardList, card) + end +end + +local function checkCardAndRomve(eventCard, cardList, num) + if (checkCard(eventCard, cardList, num)) then + removeCard(cardList, eventCard, num) + return true + end + return false +end + +-- 获取列表中牌数量 +local function cardNum(eventCard, cardList) + local result = 0 + for i = 1, #cardList do + local card = cardList[i] + if (card == eventCard) then + result = result + 1 + end + end + return result +end + +local M = { + pair_count = 0, + cardList = nil, + stack = nil, + stackHuxi = nil +} + +function M:push(cardGroup) + self.stack[#self.stack + 1] = cardGroup +end +function M:pushhuxi(cardGroup) + self.stackHuxi[#self.stackHuxi + 1] = cardGroup +end + +function M:rollBack() + local cardGroup = self.stack[#self.stack] + table.remove(self.stack, #self.stack) + for _, card in ipairs(cardGroup) do + self.cardList[#self.cardList + 1] = card + end + table.sort(self.cardList) +end +-- 顺子 +function M:tryShunzi1(card, player) + if card < 300 and card % 100 > 8 then + return false + end + if card == 106 then + printlog("jefesc:",card) + pt(self.cardList) + end + if (checkCard(card + 1, self.cardList) and checkCard(card + 2, self.cardList)) then + + removeCard(self.cardList, card + 1, 1) + removeCard(self.cardList, card + 2, 1) + removeCard(self.cardList, card, 1) + local cardGroup = {card, card + 1, card + 2} + self:push(cardGroup) + local _huxi = 0 + self:pushhuxi(_huxi) + return true + end + return false +end + + +-- 2 7 10 +function M:tryShunzi3(card, player) + if card % 100 == 2 then + if (checkCard(card + 5, self.cardList, 1)) and (checkCard(card + 8, self.cardList, 1)) then + removeCard(self.cardList, card, 1) + removeCard(self.cardList, card + 5, 1) + removeCard(self.cardList, card + 8, 1) + local cardGroup = {card, card + 5, card + 8} + self:push(cardGroup) + local _huxi = 1 + self:pushhuxi(_huxi) + return true + end + end + return false +end + + +-- 坎 +function M:tryKezi(card, player) + if (checkCard(card, self.cardList, 3)) then + removeCard(self.cardList, card, 3) + local cardGroup = {card, card, card} + self:push(cardGroup) + local _huxi = 1 + if self.drawCard~=card then + --printlog("tryKezi====>>>",self.drawCard,card) + _huxi = 3 + end + self:pushhuxi(_huxi) + return true + end + return false +end + + + +function M:tryPair(card) + if (self.pair_count > 0) then + return false + end + if (checkCard(card, self.cardList, 2)) then + removeCard(self.cardList, card, 2) + local cardGroup = {card, card} + self:push(cardGroup) + local _huxi = 0 + self:pushhuxi(_huxi) + self.pair_count = 1 + return true + elseif (checkCard(card, self.cardList, 1)) then + if card % 100 <=9 then + if (checkCard(card+1, self.cardList, 1)) then + removeCard(self.cardList, card, 1) + removeCard(self.cardList, card+1, 1) + local cardGroup = {card, card+1} + self:push(cardGroup) + local _huxi = 0 + self:pushhuxi(_huxi) + self.pair_count = 1 + return true + end + end + + if card % 100 <=8 then + if (checkCard(card+2, self.cardList, 1)) then + removeCard(self.cardList, card, 1) + removeCard(self.cardList, card+2, 1) + local cardGroup = {card, card+2} + self:push(cardGroup) + local _huxi = 0 + self:pushhuxi(_huxi) + self.pair_count = 1 + return true + end + end + + if card % 100 >=2 then + if (checkCard(card-1, self.cardList, 1)) then + removeCard(self.cardList, card, 1) + removeCard(self.cardList, card-1, 1) + local cardGroup = {card, card-1} + self:push(cardGroup) + local _huxi = 0 + self:pushhuxi(_huxi) + self.pair_count = 1 + return true + end + end + + if card % 100 >=3 then + if (checkCard(card-2, self.cardList, 1)) then + removeCard(self.cardList, card, 1) + removeCard(self.cardList, card-2, 1) + local cardGroup = {card, card-2} + self:push(cardGroup) + local _huxi = 0 + self:pushhuxi(_huxi) + self.pair_count = 1 + return true + end + end + + if card % 100 ==2 then + if (checkCard(card+5, self.cardList, 1)) then + removeCard(self.cardList, card, 1) + removeCard(self.cardList, card+5, 1) + local cardGroup = {card, card+5} + self:push(cardGroup) + local _huxi = 1 + self:pushhuxi(_huxi) + self.pair_count = 1 + return true + end + + if (checkCard(card+8, self.cardList, 1)) then + removeCard(self.cardList, card, 1) + removeCard(self.cardList, card+8, 1) + local cardGroup = {card, card+8} + self:push(cardGroup) + local _huxi = 1 + self:pushhuxi(_huxi) + self.pair_count = 1 + return true + end + + + end + + + if card % 100 ==7 then + if (checkCard(card-5, self.cardList, 1)) then + removeCard(self.cardList, card, 1) + removeCard(self.cardList, card-5, 1) + local cardGroup = {card, card-5} + self:push(cardGroup) + local _huxi = 1 + self:pushhuxi(_huxi) + self.pair_count = 1 + return true + end + + if (checkCard(card+3, self.cardList, 1)) then + removeCard(self.cardList, card, 1) + removeCard(self.cardList, card+3, 1) + local cardGroup = {card, card+3} + self:push(cardGroup) + local _huxi = 1 + self:pushhuxi(_huxi) + self.pair_count = 1 + return true + end + + + end + + if card % 100 ==10 then + if (checkCard(card-8, self.cardList, 1)) then + removeCard(self.cardList, card, 1) + removeCard(self.cardList, card-8, 1) + local cardGroup = {card, card-8} + self:push(cardGroup) + local _huxi = 1 + self:pushhuxi(_huxi) + self.pair_count = 1 + return true + end + + if (checkCard(card-3, self.cardList, 1)) then + removeCard(self.cardList, card, 1) + removeCard(self.cardList, card-3, 1) + local cardGroup = {card, card-3} + self:push(cardGroup) + local _huxi = 1 + self:pushhuxi(_huxi) + self.pair_count = 1 + return true + end + + + end + + + end + + return false +end + + +function M:tryPair2(card) + if (self.pair_count > 0) then + return false + end + + if (checkCard(card, self.cardList, 1)) then + if card % 100 ==2 then + if (checkCard(card+5, self.cardList, 1)) then + removeCard(self.cardList, card, 1) + removeCard(self.cardList, card+5, 1) + local cardGroup = {card, card+5} + self:push(cardGroup) + local _huxi = 1 + self:pushhuxi(_huxi) + self.pair_count = 1 + return true + end + + if (checkCard(card+8, self.cardList, 1)) then + removeCard(self.cardList, card, 1) + removeCard(self.cardList, card+8, 1) + local cardGroup = {card, card+8} + self:push(cardGroup) + local _huxi = 1 + self:pushhuxi(_huxi) + self.pair_count = 1 + return true + end + + + end + + + if card % 100 ==7 then + if (checkCard(card-5, self.cardList, 1)) then + removeCard(self.cardList, card, 1) + removeCard(self.cardList, card-5, 1) + local cardGroup = {card, card-5} + self:push(cardGroup) + local _huxi = 1 + self:pushhuxi(_huxi) + self.pair_count = 1 + return true + end + + if (checkCard(card+3, self.cardList, 1)) then + removeCard(self.cardList, card, 1) + removeCard(self.cardList, card+3, 1) + local cardGroup = {card, card+3} + self:push(cardGroup) + local _huxi = 1 + self:pushhuxi(_huxi) + self.pair_count = 1 + return true + end + + + end + + if card % 100 ==10 then + if (checkCard(card-8, self.cardList, 1)) then + removeCard(self.cardList, card, 1) + removeCard(self.cardList, card-8, 1) + local cardGroup = {card, card-8} + self:push(cardGroup) + local _huxi = 1 + self:pushhuxi(_huxi) + self.pair_count = 1 + return true + end + + if (checkCard(card-3, self.cardList, 1)) then + removeCard(self.cardList, card, 1) + removeCard(self.cardList, card-3, 1) + local cardGroup = {card, card-3} + self:push(cardGroup) + local _huxi = 1 + self:pushhuxi(_huxi) + self.pair_count = 1 + return true + end + + + end + + + end + + return false +end + + + +function M:tryWin(player) + + if #self.cardList == 0 then + if (self.pair_count == 1) then + return true + elseif self.pair_count == 2 and #self.stack==2 then + local tempPList={} + for i=1,#self.stack do + local card1=self.stack[i][1] + local card2=self.stack[i][2] + table.insert(tempPList,card1) + table.insert(tempPList,card2) + end + + if #tempPList~=4 then return false end + + table.sort(tempPList) + + if tempPList[1]==tempPList[2]+1 and tempPList[2]==tempPList[3]+1 and tempPList[3]==tempPList[4]+1 then + return true + end + + end + + return false + end + + + local activeCard = 0 + for i = 1, #self.cardList do + if (self.cardList[i] == 201 or self.cardList[i] == 202) then + activeCard = self.cardList[i] + break + end + end + if (activeCard == 0) then + activeCard = self.cardList[1] + end + + if (activeCard % 100 == 1) then + if self:tryShunzi1(activeCard, player) then + if self:tryWin(player) then + return true + end + self:rollBack() + table.remove(self.stackHuxi, #self.stackHuxi) + end + if self:tryKezi(activeCard, player) then + if self:tryWin(player) then + return true + end + self:rollBack() + table.remove(self.stackHuxi, #self.stackHuxi) + end + + if self:tryPair(activeCard) then + if self:tryWin(player) then + return true + end + self.pair_count = 0 + self:rollBack() + table.remove(self.stackHuxi, #self.stackHuxi) + end + + if self:tryPair2(activeCard) then + if self:tryWin(player) then + return true + end + self.pair_count = 0 + self:rollBack() + table.remove(self.stackHuxi, #self.stackHuxi) + end + + elseif activeCard % 100 == 2 then + if self:tryShunzi3(activeCard, player) then + if self:tryWin(player) then + return true + end + self:rollBack() + table.remove(self.stackHuxi, #self.stackHuxi) + end + if self:tryKezi(activeCard, player) then + if self:tryWin(player) then + return true + end + self:rollBack() + table.remove(self.stackHuxi, #self.stackHuxi) + end + + if self:tryPair(activeCard) then + if self:tryWin(player) then + return true + end + self.pair_count = 0 + self:rollBack() + table.remove(self.stackHuxi, #self.stackHuxi) + end + + if self:tryPair2(activeCard) then + if self:tryWin(player) then + return true + end + self.pair_count = 0 + self:rollBack() + table.remove(self.stackHuxi, #self.stackHuxi) + end + + if self:tryShunzi1(activeCard, player) then + if self:tryWin(player) then + return true + end + self:rollBack() + table.remove(self.stackHuxi, #self.stackHuxi) + end + + else + + + if self:tryKezi(activeCard, player) then + + if self:tryWin(player) then + return true + end + self:rollBack() + table.remove(self.stackHuxi, #self.stackHuxi) + end + + if self:tryPair(activeCard) then + + if self:tryWin(player) then + return true + end + self.pair_count = 0 + self:rollBack() + table.remove(self.stackHuxi, #self.stackHuxi) + end + + if self:tryPair2(activeCard) then + + if self:tryWin(player) then + return true + end + self.pair_count = 0 + self:rollBack() + table.remove(self.stackHuxi, #self.stackHuxi) + end + + + if self:tryShunzi1(activeCard, player) then + + if self:tryWin(player) then + return true + end + self:rollBack() + table.remove(self.stackHuxi, #self.stackHuxi) + end + end + return false +end + +local function init(self, player, cardInhand, addCard) + self.stack = {} + self.stackHuxi = {} + self.pair_count = 0 + self.kong_count = 0 + self.drawCard=0 + self.cardList = membe_clone(cardInhand) + if addCard == nil then + self.kong_count = 1 + else + self.kong_count = 0 + self.cardList[#self.cardList + 1] = addCard + self.drawCard=addCard + end + table.sort(self.cardList) + return self:tryWin(player) +end + +function M.tingPai(player, room) + local self = setmetatable({}, {__index = M}) + local tingList = {} + local cardInhand = player.handcard_list + if not cardInhand or #cardInhand == 0 then + return tingList + end + local kan_huxi = 0 + local kan_cards = {} + for j = 1, #player.fz_list do + for i = 1, #cardInhand do + if cardInhand[i] == player.fz_list[j].active_card and player.fz_list[j].type == 3 then + kan_cards[#kan_cards + 1] = cardInhand[i] + break + end + end + end + if #kan_cards > 0 then + for i = 1, #kan_cards do + kan_huxi = kan_huxi + 3 + removeCard(cardInhand, kan_cards[i], 3) + end + end + player.tiCount = 0 + player.paoCount = 0 + + + for k = 100, 200, 100 do + for i = 1, 10 do + local tem = k + i + local result = init(self, player, cardInhand, tem) + if result then + --printlog("是否胡牌===>>>",tem) + end + + local num = 0 + for k = 1, #self.stackHuxi do + num = num + self.stackHuxi[k] + end + + if result then + local num1 = 0 + --pt(self.stackHuxi) + for k = 1, #self.stackHuxi do + num1 = num1 + self.stackHuxi[k] + --printlog(self.stackHuxi[k]) + end + --printlog("胡息数量===>>>",player.hu_xi,num1,kan_huxi) + if (player.hu_xi + num1 + kan_huxi) >= (self:getHuxi(room)-1) then + tingList[#tingList + 1] = tem + end + end + + + + end + end + printlog("jefe2:") + pt(tingList) + return tingList +end + +function M:getHuxi(room) + if room.game_id == 301 then + return 8 + end + if room.game_id == 13 or room.game_id == 14 or room.game_id == 23 then + return 15 + elseif room.game_id == 26 then + return 10 + elseif room.game_id == 29 then + if room.room_config.maxPlayers == 3 then + return 15 + else + return 9 + end + end +end + +function M:GetFzData(tem, ctype) + local huxi + + if ctype == 1 then + huxi=1 + elseif ctype == 2 then + huxi=1 + elseif ctype == 3 then + huxi = 3 + elseif ctype == 4 then + huxi = 3 + elseif ctype == 5 then + huxi = 3 + elseif ctype == 7 then + huxi = 5 + end + return huxi +end + +return M diff --git a/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/main/FZData.lua b/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/main/FZData.lua new file mode 100644 index 00000000..e5bb09cd --- /dev/null +++ b/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/main/FZData.lua @@ -0,0 +1,45 @@ +RB_FZType = +{ + Chi = 1, + Peng = 2, + Kan = 3, + Wei = 4, + ChouWei=5, + Pao = 6, + Ti = 7, + HU = 8, + Bi = 9, + PengPao =10, + WeiPao =11, + WeiTi =12, + KanTi =13, + DuiZi = 14, + zhao = 15, +} + +local FZTipList = { + tip_map_id = nil, + tip_map_type = nil +} + +local M = FZTipList + +function M.new() + local self = {} + setmetatable(self,{__index = FZTipList}) + self.tip_map_id = {} + self.tip_map_type = {} + return self +end + +function M:AddTip(tip) + self.tip_map_id[tip.id] = tip + local tiplist = self.tip_map_type[tip.weight] + if not tiplist then + tiplist = {} + self.tip_map_type[tip.weight] = tiplist + end + tiplist[#tiplist+1] = tip +end + +return M \ No newline at end of file diff --git a/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/main/HuTipView.lua b/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/main/HuTipView.lua new file mode 100644 index 00000000..d6e6e97b --- /dev/null +++ b/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/main/HuTipView.lua @@ -0,0 +1,69 @@ +local HuTipView = { + _view_start_pos = nil, + _touch_start_pos = nil, +} + +local M = HuTipView + +function M.new(main_view) + local self = {} + self.class = "HuTipView" + setmetatable(self,{__index = HuTipView}) + self._main_view = main_view + self:init() + return self +end + +local function SetObjEnabled(obj, enabled) + obj.visible = enabled + obj.touchable = enabled +end +function M:OnTouchBegin(context) + self._view_start_pos = Vector2(self._view.x, self._view.y) + self._touch_start_pos = self._main_view._view:GlobalToLocal(Vector2(context.inputEvent.x, context.inputEvent.y)) +end +function M:OnTouchMove(context) + local xy = self._main_view._view:GlobalToLocal(Vector2.New(context.inputEvent.x,context.inputEvent.y)) + local dist = Vector2(xy.x - self._touch_start_pos.x, xy.y - self._touch_start_pos.y) + local posx = self._view_start_pos.x + dist.x + local posy = self._view_start_pos.y + dist.y + local max_x = self._main_view._view.width - self._view.width + local max_y = self._main_view._view.height - self._view.height + self._view.x = posx < 0 and 0 or posx > max_x and max_x or posx + self._view.y = posy < 0 and 0 or posy > max_y and max_y or posy +end + +function M:init() + self._view = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Hu_Tip") + self._main_view._view:AddChild(self._view) + local width = self._view.width + local m_width = self._main_view._view.width + local m_height = self._main_view._view.height + -- self._view.x = 0.5 * m_width - 0.5 * width + self._view.x = 0 + self._view.y = 0.7 * m_height + SetObjEnabled(self._view, false) + self._view.onTouchBegin:Add(handler(self, self.OnTouchBegin)) + self._view.onTouchMove:Add(handler(self, self.OnTouchMove)) +end + +function M:FillData(cards) + local lst_card = self._view:GetChild("tingpai") + lst_card:RemoveChildrenToPool() + local num = #cards + if num > 0 then + if num > 4 and num < 28 then + self._view.width = 191 + ((num > 4 and 6 or num) - 3) * 38 + self._view.height = 69 + (math.ceil(num / 5) - 1) * 56 + end + for i = 1, num do + local item = lst_card:AddItemFromPool() + item:GetChild("icon").icon = "ui://Main_RunBeard/202_1_" .. cards[i] + end + SetObjEnabled(self._view, true) + else + SetObjEnabled(self._view, false) + end +end + +return M \ No newline at end of file diff --git a/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/main/PendulumRule.lua b/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/main/PendulumRule.lua new file mode 100644 index 00000000..8f6b21cc --- /dev/null +++ b/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/main/PendulumRule.lua @@ -0,0 +1,1177 @@ + +-- 检测牌是否存在 +local function checkCard(eventCard,cardList,num) + if num ==nil then + num =1 + end + local result = 0 + for i = 1,#cardList do + if (cardList[i] == eventCard) then + result = result + 1 + end + end + if(result ==num) then + return true + end + return false +end + +-- 移除指定数量的牌 +local function removeCard(cardList, card,count) + for i=1,count do + list_remove(cardList,card) + end +end + +local function checkCardAndRomve(eventCard,cardList,num) + + if(checkCard(eventCard,cardList,num)) then + removeCard(cardList,eventCard,num) + return true + end + return false +end + +-- 获取列表中牌数量 +local function cardNum(eventCard,cardList) + local result = 0 + for i=1,#cardList do + local card = cardList[i] + if (card == eventCard) then + result = result + 1 + end + end + return result +end + +local M = { + cardList = nil, + stack = nil, +} + + +function M:push(cardGroup) + self.stack[#self.stack+1] = cardGroup +end + +function M:rollBack() + local cardGroup = self.stack[#self.stack] + table.remove(self.stack,#self.stack) + for _,card in ipairs(cardGroup) do + self.cardList[#self.cardList + 1] = card + end + table.sort(self.cardList) +end + +function M:tryShunzi1(card,type1 ) + if card < 300 and card % 100 > 8 then + return false + end + if (checkCard(card, self.cardList)) and (checkCard(card + 1, self.cardList) and checkCard(card + 2, self.cardList)) then + if type1 ~=nil then + return true + end + removeCard(self.cardList,card+1,1) + removeCard(self.cardList,card+2,1) + removeCard(self.cardList,card,1) + local cardGroup = {card,card+1,card+2} + self:push(cardGroup) + return true + end + return false +end +function M:tryShunzi2( card ,type1) + if card -card%100 == 100 then + if self:tryShunzi1(card+100,0) or self:tryShunzi3(card+100,0) then + return false + end + if checkCard(card+100,self.cardList,1) and checkCard(card,self.cardList,2) then + if type1 ~=nil then + return true + end + removeCard(self.cardList,card,2) + removeCard(self.cardList,card+100,1) + local cardGroup = {card,card,card+100} + self:push(cardGroup) + return true + end + if (checkCard(card+100,self.cardList,2)) and (checkCard(card,self.cardList,1)) then + if type1 ~=nil then + return true + end + removeCard(self.cardList,card,1) + removeCard(self.cardList,card+100,2) + local cardGroup = {card+100,card+100,card} + self:push(cardGroup) + return true + end + else + if self:tryShunzi1(card-100) or self:tryShunzi3(card-100) then + return false + end + if (checkCard(card-100,self.cardList,1)) and checkCard(card,self.cardList,2) then + if type1 ~=nil then + return true + end + removeCard(self.cardList,card,2) + removeCard(self.cardList,card-100,1) + local cardGroup = {card,card,card-100} + self:push(cardGroup) + return true + end + if (checkCard(card-100,self.cardList,2)) and checkCard(card,self.cardList,1) then + if type1 ~=nil then + return true + end + removeCard(self.cardList,card,1) + removeCard(self.cardList,card-100,2) + local cardGroup = {card-100,card-100,card} + self:push(cardGroup) + return true + end + end + return false +end +function M:tryShunzi3( card,type1 ) + if card % 100 == 2 then + if (checkCard(card, self.cardList, 1)) and (checkCard(card+5, self.cardList, 1)) and (checkCard(card+8, self.cardList, 1)) then + if type1 ~=nil then + return true + end + removeCard(self.cardList,card,1) + removeCard(self.cardList,card+5,1) + removeCard(self.cardList,card+8,1) + local cardGroup = {card,card+5,card+8} + self:push(cardGroup) + return true + + end + return false + end + return false +end + +function M:tryKezi(card) + if (checkCard(card, self.cardList, 3)) then + removeCard(self.cardList,card,3) + local cardGroup = {card,card,card} + self:push(cardGroup) + return true + end + return false +end + +function M:tryTi(card) + if (checkCard(card, self.cardList, 4)) then + removeCard(self.cardList,card,4) + local cardGroup = {card,card,card,card} + self:push(cardGroup) + return true + end + return false +end + +function M:tryPair(card) + if (checkCard(card, self.cardList, 2)) then + removeCard(self.cardList,card,2) + local cardGroup = {card,card} + self:push(cardGroup) + return true + end + return false +end + +function M:tryShunzi4( card ) + if card -card%100 == 100 then + if self:tryShunzi1(card+100,0) or self:tryShunzi3(card+100,0) or self:tryShunzi5(card+100,0) then + return false + end + if checkCard(card+100,self.cardList,1) and checkCard(card,self.cardList,1) then + removeCard(self.cardList,card,1) + removeCard(self.cardList,card+100,1) + local cardGroup = {card,card+100} + self:push(cardGroup) + return true + end + if (checkCard(card+100,self.cardList,1)) and (checkCard(card,self.cardList,1)) then + removeCard(self.cardList,card,1) + removeCard(self.cardList,card+100,1) + local cardGroup = {card,card+100} + self:push(cardGroup) + return true + end + else + if self:tryShunzi1(card-100,0) or self:tryShunzi3(card-100,0) or self:tryShunzi5(card-100,0) then + return false + end + if (checkCard(card-100,self.cardList,1)) and checkCard(card,self.cardList,1) then + removeCard(self.cardList,card,1) + removeCard(self.cardList,card-100,1) + local cardGroup = {card-100,card} + self:push(cardGroup) + return true + end + if (checkCard(card-100,self.cardList,1)) and checkCard(card,self.cardList,1) then + removeCard(self.cardList,card,1) + removeCard(self.cardList,card-100,1) + local cardGroup = {card,card-100} + self:push(cardGroup) + return true + end + end + return false +end +function M:tryShunzi5( card ,type1) + if card % 100 == 2 then + if (checkCard(card, self.cardList, 1)) and (checkCard(card+5, self.cardList, 1)) then + if self:tryShunzi2(card+5,0) or self:tryShunzi1(card+5,0) then + return false + end + if type1 ~=nil then + return true + end + removeCard(self.cardList,card,1) + removeCard(self.cardList,card+5,1) + local cardGroup = {card,card+5} + self:push(cardGroup) + return true + end + if (checkCard(card, self.cardList, 1)) and (checkCard(card+8, self.cardList, 1)) then + if self:tryShunzi2(card+8,0) or self:tryShunzi1(card+8,0) then + return false + end + if type1 ~=nil then + return true + end + removeCard(self.cardList,card,1) + removeCard(self.cardList,card+8,1) + local cardGroup = {card,card+8} + self:push(cardGroup) + return true + end + elseif card % 100 == 7 then + if (checkCard(card, self.cardList, 1)) and (checkCard(card+3, self.cardList, 1)) then + if self:tryShunzi2(card+3,0) or self:tryShunzi1(card+3,0) then + return false + end + if type1 ~=nil then + return true + end + removeCard(self.cardList,card,1) + removeCard(self.cardList,card+3,1) + local cardGroup = {card,card+3} + self:push(cardGroup) + return true + end + end + return false +end + +function M:tryMenzi1( card ) + + if (checkCard(card, self.cardList, 1)) and (checkCard(card+1, self.cardList, 1)) then + if self:tryShunzi2(card+1,0) or self:tryShunzi1(card+1,0) or self:tryShunzi3(card+1,0) then + return false + end + removeCard(self.cardList,card,1) + removeCard(self.cardList,card+1,1) + local cardGroup = {card,card+1} + self:push(cardGroup) + return true + end + if (checkCard(card, self.cardList, 1)) and (checkCard(card+2, self.cardList, 1)) then + if self:tryShunzi2(card+2,0) or self:tryShunzi1(card+2,0) or self:tryShunzi3(card+2,0) then + return false + end + removeCard(self.cardList,card,1) + removeCard(self.cardList,card+2,1) + local cardGroup = {card,card+2} + self:push(cardGroup) + return true + end + + return false +end + +function M:tryOneCard(card) + if (checkCard(card, self.cardList, 1)) then + removeCard(self.cardList,card,1) + local cardGroup = {card} + self:push(cardGroup) + return true + end + return false +end + -- 摆牌规则 先四后三 对子 顺子 单个 +function M:tryPendulumRule() + for i=1,10 do + for k=100,200,100 do + local tem = k + i + local x = true + if x and self:tryTi(tem) then + x =false + end + if x and self:tryKezi(tem) then + x =false + end + if x and self:tryShunzi2(tem) then + x =false + end + if x and self:tryPair(tem) then + x =false + end + if x and self:tryShunzi3(tem) then + x =false + end + if x and self:tryShunzi1(tem) then + x =false + end + if x and self:tryShunzi5(tem) then + x =false + end + if x and self:tryShunzi4(tem) then + x =false + end + if x and self:tryMenzi1(tem) then + x =false + end + if x and self:tryOneCard(tem) then + x =false + end + end + end + if #self.stack >10 then + --变成10列--这里牌多了也不会报错了 + local removeitem = 0 + local card = 0 + for i=#self.stack,1,-1 do + if #self.stack[i] == 1 and removeitem ==0 then + removeitem = i + card = self.stack[i][1] + list_remove(self.stack[i],self.stack[i][1]) + end + end + if card ~= 0 then + list_remove(self.stack,self.stack[removeitem]) + for i=#self.stack,1,-1 do + if #self.stack[i] >0 and #self.stack[i] <3 then + self.stack[i][#self.stack[i] +1] = card + break + end + end + end + end + return self.stack +end + + + + +--摆牌规则 优先胡息 +function M:tryPendulumRule2() + local card_count = #self.cardList + local cards_map = {} + local CountCards = {} + for i=1,#self.cardList do + CountCards[self.cardList[i]]= CountCards[self.cardList[i]] == nil and 1 or CountCards[self.cardList[i]] + 1 + end + --pt(self.cardList) + --printlog("摆牌规则 优先胡息====》》》") + --pt(CountCards) + + + --find4 + for k,v in pairs(CountCards) do + if (v == 4 and k<200) then + local cs = {} + cs[1]= k + cs[2]= k + cs[3]= k + cs[4]= k + cards_map[#cards_map+1]=cs + CountCards[k] = 0 + card_count =card_count- 4 + end + end + + --find3 + for k,v in pairs(CountCards) do + if (v >= 3 and k<200) then + local cs = {} + cs[1]= k + cs[2]= k + cs[3]= k + cards_map[#cards_map+1]=cs + CountCards[k] = CountCards[k] -3 + card_count =card_count- 3 + end + end + + + --find2 + for k,v in pairs(CountCards) do + if (v >= 2 and k<200) then + local cs = {} + cs[1] = k + cs[2] = k + cards_map[#cards_map+1]=cs + CountCards[k] = CountCards[k] - 2 + card_count =card_count- 2 + end + end + + + + + --find 小 2 7 10 + local counta = CountCards[102] + if counta ~=nil and counta>0 then + for i=1,counta do + if CountCards[102]~=nil and CountCards[107]~=nil and CountCards[110]~=nil and CountCards[102] >0 and CountCards[107] >0 and CountCards[110] >0 then + local cs = {} + cs[1]= 102 + cs[2]= 107 + cs[3]= 110 + cards_map[#cards_map+1] = cs + CountCards[102] = CountCards[102]-1 + CountCards[107] = CountCards[107]-1 + CountCards[110] = CountCards[110]-1 + card_count = card_count - 3 + end + end + end + + + --find 小 123 + local counta = CountCards[101] + if counta ~=nil and counta>0 then + for i=1,counta do + if CountCards[101]~=nil and CountCards[102]~=nil and CountCards[103]~=nil and CountCards[101] >0 and CountCards[102] >0 and CountCards[103] >0 then + local cs = {} + cs[1]= 101 + cs[2]= 102 + cs[3]= 103 + cards_map[#cards_map+1] = cs + CountCards[101] = CountCards[101]-1 + CountCards[102] = CountCards[102]-1 + CountCards[103] = CountCards[103]-1 + card_count = card_count - 3 + end + end + end + + + --find abc + for i=101,110 do + if (CountCards[i] ~=nil and CountCards[i + 1] ~=nil and CountCards[i + 2] ~=nil) and CountCards[i] == CountCards[i + 1] and CountCards[i] == CountCards[i + 2] then + if CountCards[i] >0 then + local cs = {} + cs[1]= i + cs[2]= i+1 + cs[3]= i+2 + cards_map[#cards_map+1]=cs + CountCards[i] = CountCards[i]-1 + CountCards[i+1] = CountCards[i+1]-1 + CountCards[i+2] = CountCards[i+2]-1 + card_count = card_count - 3 + end + end + end + + + + + --find ab + for i=101,110 do + if (CountCards[i] ~=nil and CountCards[i + 1] ~=nil ) and (CountCards[i] > 0 and CountCards[i + 1] > 0 ) then + local cs = {} + cs[1]= i + cs[2]= i+1 + cards_map[#cards_map+1]=cs + CountCards[i] = CountCards[i]-1 + CountCards[i+1] = CountCards[i+1]-1 + card_count = card_count - 2 + end + end + + + + + --find 小 2 7 两个 + for i=101,110 do + if CountCards[102]~=nil and CountCards[107]~=nil and CountCards[102] ==1 and CountCards[107] ==1 then + local cs = {} + cs[1]= 102 + cs[2]= 107 + cards_map[#cards_map+1]=cs + CountCards[102] = CountCards[102]-1 + CountCards[107] = CountCards[107]-1 + card_count = card_count - 2 + end + end + + for i=101,110 do + if CountCards[102]~=nil and CountCards[110]~=nil and CountCards[102] ==1 and CountCards[110] ==1 then + local cs = {} + cs[1]= 102 + cs[2]= 110 + cards_map[#cards_map+1]=cs + CountCards[102] = CountCards[102]-1 + CountCards[110] = CountCards[110]-1 + card_count = card_count - 2 + end + end + + for i=101,110 do + if CountCards[107]~=nil and CountCards[110]~=nil and CountCards[107] ==1 and CountCards[110] ==1 then + local cs = {} + cs[1]= 107 + cs[2]= 110 + cards_map[#cards_map+1]=cs + CountCards[107] = CountCards[107]-1 + CountCards[110] = CountCards[110]-1 + card_count = card_count - 2 + end + end + + local tempCardList={} + for i = 101, 110 do + if CountCards[i]~=nil and (CountCards[i] == 1) then + table.insert(tempCardList,i) + CountCards[i]=CountCards[i]-1 + end + end + + + local cs={} + local count=1 + for i=1,#tempCardList do + --[[if i%3==1 then + cs[count]={} + end + + table.insert(cs[count],tempCardList[i]) + + if i%3==0 then + count=count+1 + end--]] + + local cst={} + table.insert(cst,tempCardList[i]) + table.insert(cs,cst) + + end + + for i=1 , #cs do + cards_map[#cards_map+1]=cs[i] + card_count =card_count- #cs[i] + end + + + ----------------------------- + --find4 + for k,v in pairs(CountCards) do + if (v == 4 and k>200) then + local cs = {} + cs[1]= k + cs[2]= k + cs[3]= k + cs[4]= k + cards_map[#cards_map+1]=cs + CountCards[k] = 0 + card_count =card_count- 4 + end + end + + --find3 + for k,v in pairs(CountCards) do + if (v >= 3 and k>200) then + local cs = {} + cs[1]= k + cs[2]= k + cs[3]= k + cards_map[#cards_map+1]=cs + CountCards[k] = CountCards[k] -3 + card_count =card_count- 3 + end + end + + --find2 + for k,v in pairs(CountCards) do + if (v >= 2 and k>200) then + local cs = {} + cs[1] = k + cs[2] = k + cards_map[#cards_map+1]=cs + CountCards[k] = CountCards[k] - 2 + card_count =card_count- 2 + end + end + + --find 大 2 7 10 + local countA = CountCards[202] + if countA ~=nil and countA>0 then + for i=1,countA do + if CountCards[202]~=nil and CountCards[207]~=nil and CountCards[210]~=nil and CountCards[202] >0 and CountCards[207] >0 and CountCards[210] >0 then + local cs = {} + cs[1]= 202 + cs[2]= 207 + cs[3]= 210 + cards_map[#cards_map+1]=cs + CountCards[202] = CountCards[202]-1 + CountCards[207] = CountCards[207]-1 + CountCards[210] = CountCards[210]-1 + card_count = card_count - 3 + end + end + end + + --find 大 123 + local countA = CountCards[201] + if countA ~=nil and countA>0 then + for i=1,countA do + if CountCards[201]~=nil and CountCards[202]~=nil and CountCards[203]~=nil and CountCards[201] >0 and CountCards[202] >0 and CountCards[203] >0 then + local cs = {} + cs[1]= 201 + cs[2]= 202 + cs[3]= 203 + cards_map[#cards_map+1]=cs + CountCards[201] = CountCards[201]-1 + CountCards[202] = CountCards[202]-1 + CountCards[203] = CountCards[203]-1 + card_count = card_count - 3 + end + end + end + + --find ABC + for i=201,210 do + if (CountCards[i] ~=nil and CountCards[i + 1] ~=nil and CountCards[i + 2] ~=nil) and CountCards[i] == CountCards[i + 1] and CountCards[i] == CountCards[i + 2] then + if CountCards[i] >0 then + local cs = {} + cs[1]= i + cs[2]= i+1 + cs[3]= i+2 + cards_map[#cards_map+1]=cs + CountCards[i] = CountCards[i]-1 + CountCards[i+1] = CountCards[i+1]-1 + CountCards[i+2] = CountCards[i+2]-1 + card_count = card_count - 3 + end + end + end + + --[[ --find AAa + for i = 201, 210 do + if CountCards[i]~=nil and CountCards[i] >= 2 then + if CountCards[i-100]~=nil and CountCards[i-100] == 1 then + local cs = {} + cs[1]= i + cs[2]= i + cs[3]= i-100 + cards_map[#cards_map+1]=cs + CountCards[i] = CountCards[i]- 2; + CountCards[i - 100] = CountCards[i - 100]-1 + card_count = card_count-3; + end + end + end + + --find Aa + for i = 201, 210 do + if CountCards[i]~=nil and CountCards[i] == 1 then + if CountCards[i-100]~=nil and CountCards[i-100] == 1 then + local cs = {} + cs[1]= i + cs[2]= i-100 + cards_map[#cards_map+1]=cs + CountCards[i] = CountCards[i]- 1; + CountCards[i - 100] = CountCards[i - 100]-1 + card_count = card_count-2 + end + end + end --]] + + --find AB + for i=201,210 do + if (CountCards[i] ~=nil and CountCards[i + 1] ~=nil ) and (CountCards[i] > 0 and CountCards[i + 1] > 0 ) then + local cs = {} + cs[1]= i + cs[2]= i+1 + cards_map[#cards_map+1]=cs + CountCards[i] = CountCards[i]-1 + CountCards[i+1] = CountCards[i+1]-1 + card_count = card_count - 2 + end + end + --find 大 2 7 两个 + for i=201,210 do + if CountCards[202]~=nil and CountCards[207]~=nil and CountCards[202] ==1 and CountCards[207] ==1 then + local cs = {} + cs[1]= 202 + cs[2]= 207 + cards_map[#cards_map+1]=cs + CountCards[202] = CountCards[202]-1 + CountCards[207] = CountCards[207]-1 + card_count = card_count - 2 + end + end + + + for i=201,210 do + if CountCards[202]~=nil and CountCards[210]~=nil and CountCards[202] ==1 and CountCards[210] ==1 then + local cs = {} + cs[1]= 202 + cs[2]= 210 + cards_map[#cards_map+1]=cs + CountCards[202] = CountCards[202]-1 + CountCards[210] = CountCards[210]-1 + card_count = card_count - 2 + end + end + + for i=201,210 do + if CountCards[207]~=nil and CountCards[210]~=nil and CountCards[207] ==1 and CountCards[210] ==1 then + local cs = {} + cs[1]= 207 + cs[2]= 210 + cards_map[#cards_map+1]=cs + CountCards[207] = CountCards[207]-1 + CountCards[210] = CountCards[210]-1 + card_count = card_count - 2 + end + end + + + + -------------------- + + + + + local singleList = {} + --find else + for k,v in pairs(CountCards) do + if (v == 1) then + singleList[#singleList+1] = k + CountCards[k] = CountCards[k] -1 + + end + end + + for i=1,#singleList do + local cs={} + table.insert(cs,singleList[i]) + cards_map[#cards_map + 1]= cs + end + + --[[local index = 3 + for i=1,#singleList,index do + local cs ={} + cs[#cs+1] = singleList[i] + if i < #singleList then cs[#cs+1] = singleList[i+1] end + if i < #singleList - 1 then cs[#cs+1] = singleList[i+2] end + cards_map[#cards_map + 1]=cs + end--]] + --变成9列--这里牌多了也不会报错了 + --[[for i=9 ,1,-1 do + for j = #cards_map , 9,-1 do + if #cards_map[i] < 3 then + cards_map[i][#cards_map[i]+1] = cards_map[j][1] + list_remove(cards_map[j],cards_map[j][1]) + end + end + end--]] + + --pt(cards_map) + --printlog("11111111111111111111") + local mapCount=#cards_map + if mapCount>12 then + local tempCardMpList1={} + local tempCardMpList2={} + local tempCardMpList3={} + for i=1,mapCount do + if #cards_map[i]>=2 then + table.insert(tempCardMpList1,cards_map[i]) + else + if cards_map[i][1]<200 then + table.insert(tempCardMpList2,cards_map[i][1]) + elseif cards_map[i][1]>200 then + table.insert(tempCardMpList3,cards_map[i][1]) + end + end + end + + --pt(tempCardMpList1) + --pt(tempCardMpList2) + --pt(tempCardMpList3) + + local cs={} + local count=1 + for i=1,#tempCardMpList2 do + if i%3==1 then + cs[count]={} + end + + table.insert(cs[count],tempCardMpList2[i]) + + if i%3==0 then + count=count+1 + end + + end + + for i=1 , #cs do + tempCardMpList1[#tempCardMpList1+1]=cs[i] + end + + + local cs={} + local count=1 + for i=1,#tempCardMpList3 do + if i%3==1 then + cs[count]={} + end + + table.insert(cs[count],tempCardMpList3[i]) + + if i%3==0 then + count=count+1 + end + + end + + for i=1 , #cs do + tempCardMpList1[#tempCardMpList1+1]=cs[i] + end + + + cards_map=tempCardMpList1 + end + + table.sort(cards_map, ViewUtil.HandCardSort3) + --pt(cards_map) + return cards_map + +end + + +--摆牌规则 优先顺子 -AAa- 对子 - 单牌 +function M:tryPendulumRule3() + local card_count = #self.cardList + local cards_map = {} + local CountCards = {} + for i=1,#self.cardList do + CountCards[self.cardList[i]]= CountCards[self.cardList[i]] == nil and 1 or CountCards[self.cardList[i]] + 1 + end + --find4 + for k,v in pairs(CountCards) do + if (v == 4) then + local cs = {} + cs[1]= k + cs[2]= k + cs[3]= k + cs[4]= k + cards_map[#cards_map+1]=cs + CountCards[k] = 0 + card_count =card_count- 4 + end + end + + --find3 + for k,v in pairs(CountCards) do + if (v >= 3) then + local cs = {} + cs[1]= k + cs[2]= k + cs[3]= k + cards_map[#cards_map+1]=cs + CountCards[k] = CountCards[k] -3 + card_count =card_count- 3 + end + end + --find abc + for i=101,110 do + if (CountCards[i] ~=nil and CountCards[i + 1] ~=nil and CountCards[i + 2] ~=nil) and CountCards[i] >0 and CountCards[i + 1]>0 and CountCards[i + 2]>0 then + if CountCards[i] >0 then + local cs = {} + cs[1]= i + cs[2]= i+1 + cs[3]= i+2 + cards_map[#cards_map+1]=cs + CountCards[i] = CountCards[i]-1 + CountCards[i+1] = CountCards[i+1]-1 + CountCards[i+2] = CountCards[i+2]-1 + card_count = card_count - 3 + end + end + end + --find ABC + for i=201,210 do + if (CountCards[i] ~=nil and CountCards[i + 1] ~=nil and CountCards[i + 2] ~=nil) and CountCards[i] >0 and CountCards[i + 1]>0 and CountCards[i + 2]>0 then + if CountCards[i] >0 then + local cs = {} + cs[1]= i + cs[2]= i+1 + cs[3]= i+2 + cards_map[#cards_map+1]=cs + CountCards[i] = CountCards[i]-1 + CountCards[i+1] = CountCards[i+1]-1 + CountCards[i+2] = CountCards[i+2]-1 + card_count = card_count - 3 + end + end + end + --find 大 2 7 10 + local countA = CountCards[202] + if countA ~=nil and countA>0 then + for i=1,countA do + if CountCards[202]~=nil and CountCards[207]~=nil and CountCards[210]~=nil and CountCards[202] >0 and CountCards[207] >0 and CountCards[210] >0 then + local cs = {} + cs[1]= 202 + cs[2]= 207 + cs[3]= 210 + cards_map[#cards_map+1]=cs + CountCards[202] = CountCards[202]-1 + CountCards[207] = CountCards[207]-1 + CountCards[210] = CountCards[210]-1 + card_count = card_count - 3 + end + end + end + + --find 小 2 7 10 + local counta = CountCards[102] + if counta ~=nil and counta>0 then + for i=1,counta do + if CountCards[102]~=nil and CountCards[107]~=nil and CountCards[110]~=nil and CountCards[102] >0 and CountCards[107] >0 and CountCards[110] >0 then + local cs = {} + cs[1]= 102 + cs[2]= 107 + cs[3]= 110 + cards_map[#cards_map+1] = cs + CountCards[102] = CountCards[102]-1 + CountCards[107] = CountCards[107]-1 + CountCards[110] = CountCards[110]-1 + card_count = card_count - 3 + end + end + end + + --find AAa + for i = 201, 210 do + if CountCards[i]~=nil and CountCards[i] >= 2 then + if CountCards[i-100]~=nil and CountCards[i-100] == 1 then + local cs = {} + cs[1]= i + cs[2]= i + cs[3]= i-100 + cards_map[#cards_map+1]=cs + CountCards[i] = CountCards[i]- 2; + CountCards[i - 100] = CountCards[i - 100]-1 + card_count = card_count-3; + end + end + end + --find aaA + for i = 101, 110 do + if CountCards[i]~=nil and (CountCards[i] >= 2) then + if CountCards[i + 100]~=nil and (CountCards[i + 100] == 1) then + local cs = {} + cs[1]= i + cs[2]= i + cs[3]= i+100 + cards_map[#cards_map+1]=cs + CountCards[i] = CountCards[i]- 2; + CountCards[i +100] = CountCards[i +100] - 1 + card_count = card_count-3; + end + end + end + + --find2 + for k,v in pairs(CountCards) do + if (v >= 2) then + local cs = {} + cs[1] = k + cs[2] = k + cards_map[#cards_map+1]=cs + CountCards[k] = CountCards[k] - 2 + card_count =card_count- 2 + end + end + --find Aa + for i = 201, 210 do + if CountCards[i]~=nil and CountCards[i] == 1 then + if CountCards[i-100]~=nil and CountCards[i-100] == 1 then + local cs = {} + cs[1]= i + cs[2]= i-100 + cards_map[#cards_map+1]=cs + CountCards[i] = CountCards[i]- 1; + CountCards[i - 100] = CountCards[i - 100]-1 + card_count = card_count-2 + end + end + end + --find ab + for i=101,110 do + if (CountCards[i] ~=nil and CountCards[i + 1] ~=nil ) and (CountCards[i] > 0 and CountCards[i + 1] > 0 ) then + local cs = {} + cs[1]= i + cs[2]= i+1 + cards_map[#cards_map+1]=cs + CountCards[i] = CountCards[i]-1 + CountCards[i+1] = CountCards[i+1]-1 + card_count = card_count - 2 + end + end + --find AB + for i=201,210 do + if (CountCards[i] ~=nil and CountCards[i + 1] ~=nil ) and (CountCards[i] > 0 and CountCards[i + 1] > 0 ) then + local cs = {} + cs[1]= i + cs[2]= i+1 + cards_map[#cards_map+1]=cs + CountCards[i] = CountCards[i]-1 + CountCards[i+1] = CountCards[i+1]-1 + card_count = card_count - 2 + end + end + --find 大 2 7 两个 + for i=201,210 do + if CountCards[202]~=nil and CountCards[207]~=nil and CountCards[202] ==1 and CountCards[207] ==1 then + local cs = {} + cs[1]= 202 + cs[2]= 207 + cards_map[#cards_map+1]=cs + CountCards[202] = CountCards[202]-1 + CountCards[207] = CountCards[207]-1 + card_count = card_count - 2 + end + end + + for i=201,210 do + if CountCards[202]~=nil and CountCards[210]~=nil and CountCards[202] ==1 and CountCards[210] ==1 then + local cs = {} + cs[1]= 202 + cs[2]= 210 + cards_map[#cards_map+1]=cs + CountCards[202] = CountCards[202]-1 + CountCards[210] = CountCards[210]-1 + card_count = card_count - 2 + end + end + + for i=201,210 do + if CountCards[207]~=nil and CountCards[210]~=nil and CountCards[207] ==1 and CountCards[210] ==1 then + local cs = {} + cs[1]= 207 + cs[2]= 210 + cards_map[#cards_map+1]=cs + CountCards[207] = CountCards[207]-1 + CountCards[210] = CountCards[210]-1 + card_count = card_count - 2 + end + end + + --find 小 2 7 两个 + for i=101,110 do + if CountCards[102]~=nil and CountCards[107]~=nil and CountCards[102] ==1 and CountCards[107] ==1 then + local cs = {} + cs[1]= 102 + cs[2]= 107 + cards_map[#cards_map+1]=cs + CountCards[102] = CountCards[102]-1 + CountCards[107] = CountCards[107]-1 + card_count = card_count - 2 + end + end + + for i=101,110 do + if CountCards[102]~=nil and CountCards[110]~=nil and CountCards[102] ==1 and CountCards[110] ==1 then + local cs = {} + cs[1]= 102 + cs[2]= 110 + cards_map[#cards_map+1]=cs + CountCards[102] = CountCards[102]-1 + CountCards[110] = CountCards[110]-1 + card_count = card_count - 2 + end + end + + for i=101,110 do + if CountCards[107]~=nil and CountCards[110]~=nil and CountCards[107] ==1 and CountCards[110] ==1 then + local cs = {} + cs[1]= 107 + cs[2]= 110 + cards_map[#cards_map+1]=cs + CountCards[107] = CountCards[107]-1 + CountCards[110] = CountCards[110]-1 + card_count = card_count - 2 + end + end + + local singleList = {} + --find else + for k,v in pairs(CountCards) do + if (v == 1) then + singleList[#singleList+1] = k + CountCards[k] = CountCards[k] -1 + + end + end + local index = 3 + for i=1,#singleList,index do + local cs ={} + cs[#cs+1] = singleList[i] + if i < #singleList then cs[#cs+1] = singleList[i+1] end + if i < #singleList - 1 then cs[#cs+1] = singleList[i+2] end + cards_map[#cards_map + 1]=cs + end + --变成9列--这里牌多了也不会报错了 + for i=10 ,1,-1 do + for j = #cards_map , 10,-1 do + if #cards_map[i] < 3 then + cards_map[i][#cards_map[i]+1] = cards_map[j][1] + list_remove(cards_map[j],cards_map[j][1]) + end + end + end + + return cards_map + +end + +local function init(self,cardInhand,index) + self.cardList= {} + self.stack = {} + self.cardList = membe_clone(cardInhand) + table.sort(self.cardList) + if index== nil or index ==0 then + return self:tryPendulumRule2() + elseif index == 1 then + return self:tryPendulumRule() + elseif index == 2 then + return self:tryPendulumRule2() + elseif index == 3 then + return self:tryPendulumRule3() + end +end + +function M.GetHandCard(cardInhand,index) + local self = setmetatable({}, {__index = M}) + if not cardInhand or #cardInhand == 0 then + return nil + end + local HandCardList = init(self,cardInhand,index) + return HandCardList +end + + +return M + + + + + diff --git a/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/main/ZPCardView.lua b/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/main/ZPCardView.lua new file mode 100644 index 00000000..2c24f342 --- /dev/null +++ b/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/main/ZPCardView.lua @@ -0,0 +1,119 @@ + + +local M = { + btn_card = nil, + card_item = 0, + Hierarchy = 0, + index_X = 0, + index_Y = 0, + isUser = false, + initPos = Vector2.zero +} + + +function M.InitCardView(card_code, index_X, index_Y, type) + -- setmetatable(M, {__index = CardView}) + local self = setmetatable({}, {__index = M}) + self._room = DataManager.CurrenRoom + self.btn_card = self:InitUI(card_code, type) + self.card_item = card_code + self.index_X = index_X + self.index_Y = index_Y + self.btn_card.data = self + + self:Init() + return self, self.btn_card +end + +function M:Init() + self.card_width = 87 + self.initPos = Vector2.zero +end + +function M:InitUI(card_code, type) + local card + if type == 0 then + card = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Btn_Card") + self.icon = card:GetChild("icon") + self.icon.icon = self:getHandCardItem("ui://Main_RunBeard/201_", card_code) + self.icon:SetScale(self:getCardSize(), self:getCardSize()) + card:GetChild("n6"):SetScale(self:getCardSize(), self:getCardSize()) + elseif type == 1 then + card = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Gcm_OutCard") + self.icon = card:GetChild("icon") + if card_code == 0 then + self.icon = "ui://Main_RunBeard/202_1_300" + else + self.icon = self:GetCardItem("ui://Main_RunBeard/203_", card_code) + end + end + return card +end + +function M:GetCardItem(card_1, card_2) + local room = DataManager.CurrenRoom + if room.change_card_display ~= nil then + return card_1 .. room.change_card_display .. card_2 + else + return card_1 .. "2_" .. card_2 + end +end + +function M:getCardSize() + if self._room.change_card_size ~= nil then + return self._room.change_card_size + else + return 1 + end +end + +function M:getHandCardItem(card_1, card_2) + if self._room.change_card_display ~= nil then + if self._room.change_card_display == "1_" then + if self._room.change_card_size ~= nil then + self.card_width = 94 * self._room.change_card_size + else + self.card_width = 94 + end + + return card_1 .. "4_" .. card_2 + end + if self._room.change_card_size ~= nil then + self.card_width = 87 * self._room.change_card_size + else + self.card_width = 87 + end + return card_1 .. self._room.change_card_display .. card_2 + else + if self._room.change_card_size ~= nil then + self.card_width = 90 * self._room.change_card_size + else + self.card_width = 90 + end + return card_1 .. "6_" .. card_2 + end +end + +function M:UpdateKan() + self.btn_card.touchable = false + self.btn_card:GetController("Kan").selectedIndex = 1 +end + +function M:UpdateTing(isting) + self.btn_card:GetController("mark_ting").selectedIndex = isting and 1 or 0 +end + +function M:UpdateIcon() + self.icon.icon = self:getHandCardItem("ui://Main_RunBeard/201_", self.card_item) + -- self.btn_card:TweenMove(self:GetHandCardPos(self, #CountCards), 0.02) +end + +function M:UpdateScale() + local size = self._room.change_card_size + -- card_view.btn_card:GetChild("icon").icon = self:getHandCardItem("ui://Main_RunBeard/201_", card_view.card_item) + self.icon:SetScale(size, size) + self.btn_card:GetChild("n6"):SetScale(size, size) + -- self:getCardWidth() +end + +return M diff --git a/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/main/ZPChiView.lua b/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/main/ZPChiView.lua new file mode 100644 index 00000000..66b171b5 --- /dev/null +++ b/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/main/ZPChiView.lua @@ -0,0 +1,131 @@ +local M = {} + +function M.InitChiView(gamectr, view, cardInfo) + local self = setmetatable({}, {__index = M}) + self._room = DataManager.CurrenRoom + self.class = "ChiView" + self._gamectr = gamectr + self._mainView = view + self._cardInfo = cardInfo + return self +end + +function M:UpdateChiView(list, tip_hu, callback, cardInfo) + self:ShowView(list, tip_hu, callback, cardInfo) +end + +function M:ShowView(tiplist, tip_hu, callback, cardInfo) + local _pop_tip_choice = UIPackage.CreateObject("Main_RunBeard", "Pop_tip_choice") + local list_choose = _pop_tip_choice:GetChild("Lst_choose") + _pop_tip_choice:GetChild("dibtn").onClick:Add(function() + _pop_tip_choice:Dispose() + end) + + -- --list 去重复的 + if #tiplist == 1 then + _pop_tip_choice:GetController("bipai").selectedIndex = 3 + end + + local tip_list = membe_deep_clone(tiplist) + for i = 1, #tiplist do + for k = 1, #tip_list do + if tip_list[k].weight ~= 4 and tiplist[i].id ~= tip_list[k].id then + if tiplist[i].OpCard[1] == tip_list[k].OpCard[1] and tiplist[i].OpCard[2] == tip_list[k].OpCard[2] then + tip_list[i].weight = 4 + end + end + end + end + + list_choose:RemoveChildrenToPool() + for i = 1, #tip_list do + if tip_list[i].weight ~=4 then + local item_choose = list_choose:AddItemFromPool() + self:SetIcon(item_choose, 2, tip_list[i].OpCard[1]) + self:SetIcon(item_choose, 3, tip_list[i].OpCard[2]) + self:SetIcon(item_choose, 1, tip_list[i].card) + + item_choose.onClick:Add(function() + for k=1,list_choose.numChildren do + list_choose:GetChildAt(k-1):GetController("zhong") .selectedIndex = 0 + end + item_choose:GetController("zhong").selectedIndex = 1 + if tip_list[i].bi_list ==nil then + callback(tip_list[i].id) + self:CloseTip() + else + self.bilist={} + self._chiid = tip_list[i].id + self:CheckRatioCard(tip_list[i].bi_list,1,tip_list[i].card) + + end + end) + end + end + list_choose:ResizeToFit(#tip_list) + _pop_tip_choice:GetChild("di1").width = list_choose.width+110 + _pop_tip_choice.xy = Vector2((self._mainView.width - _pop_tip_choice.width)/2, -100) + self._mainView:AddChild(_pop_tip_choice) + self._pop_tip_choice = _pop_tip_choice + end + --比牌显示 + function M:CheckRatioCard(_tiplist,index,chicard,_biid) + if _biid ~=nil then + self.bilist={} + self.bilist[#self.bilist+1] = _biid + end + self._pop_tip_choice:GetController("bipai").selectedIndex = index + local Bilist_choose = self._pop_tip_choice:GetChild("Bi_Lst_choose"..index) + Bilist_choose:RemoveChildrenToPool() + for i = 1, #_tiplist do + local item = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Comp_choose") + local item_choose = Bilist_choose:AddChild(item) + self:SetIcon(item_choose, 2, _tiplist[i].opcard[1]) + self:SetIcon(item_choose, 3, _tiplist[i].opcard[2]) + self:SetIcon(item_choose, 1, chicard) + item_choose:GetController("zhong") .selectedIndex = 0 + item_choose.onClick:Add(function() + for k=1,Bilist_choose.numChildren do + Bilist_choose:GetChildAt(k-1):GetController("zhong") .selectedIndex = 0 + end + item_choose:GetController("zhong") .selectedIndex = 1 + if _tiplist[i].bi_list ==nil then + if tip_hu then + local guo_msg = MsgWindow.new(self._root_view, "确定取消胡吗?", MsgWindow.MsgMode.OkAndCancel) + guo_msg.onOk:Add(function() + self.bilist[#self.bilist+1] = i-1 + self._gamectr:SendAction(self._chiid,self.bilist) + guo_msg:Close() + self:CloseTip() + self._cardInfo:UpdateIsOnClick(false) + end) + guo_msg:Show() + else + self.bilist[#self.bilist+1] = i-1 + self._gamectr:SendAction(self._chiid,self.bilist) + self:CloseTip() + self._cardInfo:UpdateIsOnClick(false) + end + else + self:CheckRatioCard(_tiplist[i].bi_list,2,chicard,i-1) + end + end) + end + Bilist_choose:ResizeToFit(#_tiplist) + self._pop_tip_choice:GetChild("di"..index+1).width = Bilist_choose.width+110 + + end + + +function M:SetIcon(item, index, card) + item:GetChild("card" .. index).icon = UIPackage.GetItemURL("Main_RunBeard", CommonFun:GetCardItem("201_", card)) +end + +function M:CloseTip() + if (self._pop_tip_choice) then + self._pop_tip_choice:Dispose() + self._pop_tip_choice = nil + end +end + +return M diff --git a/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/main/ZPFzCardView.lua b/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/main/ZPFzCardView.lua new file mode 100644 index 00000000..1f64ef41 --- /dev/null +++ b/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/main/ZPFzCardView.lua @@ -0,0 +1,181 @@ +local M = {} + +local source_fz_03 = "ui://Main_RunBeard/Fz_0_3" +local source_fz_04 = "ui://Main_RunBeard/Fz_0_4" +local source_card = "ui://Main_RunBeard/202_" + +function M:getCardItem(card_1, card_2) + local room = DataManager.CurrenRoom + if room.change_card_display ~= nil then + return card_1 .. room.change_card_display .. card_2 + else + return card_1 .. "6_" .. card_2 + end +end + +function M.InitFzView(fz,isMy,isplay,index,count) + local self = setmetatable({}, {__index = M}) + local item,fzcards + if fz.type ~= RB_FZType.Kan then + item = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Component1")--Extend_Poker_AHRunBeard + item:RemoveChildren(0, -1, true) + end + + -- local fzItem + if fz.type == RB_FZType.Bi or fz.type == RB_FZType.Chi then + fzcards = self:UpateChiBi(item,fz) + elseif fz.type == RB_FZType.Peng then + fzcards = self:UpdatePeng(item,fz) + elseif fz.type == RB_FZType.Wei or fz.type == RB_FZType.ChouWei then + fzcards = self:UpdateWei(item,fz,isMy) + elseif fz.type == RB_FZType.Ti then + fzcards = self:UpateTi(item,fz) + elseif fz.type == RB_FZType.Pao then + fzcards = self:UpatePao(item,fz) + end + + if item ~= nil and fzcards ~= nil then + self:PlayEffect(item,fzcards,isplay,index,count) + end + + return item,fzcards +end + +function M:UpateChiBi(item,fz) + local fzcards = UIPackage.CreateObjectFromURL(source_fz_03) + local cardId1,cardId2,cardId3 + if #fz.opcard == 2 then + cardId1 = fz.card + cardId2 = fz.opcard[1] + cardId3 = fz.opcard[2] + else + cardId1 = fz.opcard[1] + cardId2 = fz.opcard[2] + cardId3 = fz.opcard[3] + end + fzcards:GetChild("card_" .. 1).icon = self:getCardItem(source_card, cardId1) + fzcards:GetController("c2").selectedIndex = 1 + fzcards:GetChild("card_" .. 2).icon = self:getCardItem(source_card, cardId2) + -- local card = fz.opcard[2] == nil and fz.opcard[1] or fz.opcard[2] + fzcards:GetChild("card_" .. 3).icon = self:getCardItem(source_card, cardId3) + fzcards.x, fzcards.y = 0, 0 + item:AddChildAt(fzcards, 0) + return fzcards +end + +function M:UpdatePeng(item,fz) + local fzcards = UIPackage.CreateObjectFromURL(source_fz_03) + for j = 1, 3 do + fzcards:GetChild("card_" .. j).icon = self:getCardItem(source_card, fz.opcard[1]) + end + fzcards.x, fzcards.y = 0, 0 + item:AddChildAt(fzcards, 0) + return fzcards +end + +function M:UpdateWei(item,fz,isMy) + local fzcards = UIPackage.CreateObjectFromURL(source_fz_03) + --fzcards:GetController("c1").selectedIndex=1 + local room = DataManager.CurrenRoom + for j = 1, 3 do + if room.room_config.mingwei or fz.type==RB_FZType.ChouWei or isMy then + if j == 3 then + fzcards:GetChild("card_" .. j).icon = self:getCardItem(source_card, fz.opcard[1]) + else + fzcards:GetChild("card_" .. j).icon = "ui://Main_RunBeard/202_1_300" + end + else + --未勾选明偎 + -- if isMy then + -- fzcards:GetChild("card_" .. j).icon = self:getCardItem(source_card, fz.opcard[1]) + -- fzcards:GetController("c1").selectedIndex = 1 + -- else + fzcards:GetChild("card_" .. j).icon = "ui://Main_RunBeard/202_1_300" + -- end + end + + end + fzcards.x, fzcards.y = 0, 0 + item:AddChildAt(fzcards,0) + return fzcards +end + +function M:UpateTi(item, fz,icon) + local fzcards = UIPackage.CreateObjectFromURL(source_fz_04) + for i = 1, 4 do + if i == 4 and fz.type == RB_FZType.Ti then + fzcards:GetChild("card_" .. i).icon = self:getCardItem(source_card, fz.card) + else + fzcards:GetChild("card_" .. i).icon = "ui://Main_RunBeard/202_1_300" + end + end + fzcards.x, fzcards.y = 0, 0 + -- item:AddChildAt(fzcards,0) + return fzcards +end + +function M:UpatePao(item, fz,icon) + local fzcards = UIPackage.CreateObjectFromURL(source_fz_04) + for i = 1, 4 do + fzcards:GetChild("card_" .. i).icon = self:getCardItem(source_card, fz.opcard[1]) + end + fzcards.x, fzcards.y = 0, 0 + return fzcards +end + +function M:PlayEffect(fzitem,fzcards,isplay,index,count) + if (isplay == nil) then + isplay = false + end + if (isplay and index == count) then + local faArray = fzitem:GetChild("chiwei") + if (faArray ~= nil) then + faArray:AddChild(fzcards) + else + fzitem:AddChild(fzcards) + end + else + fzitem:AddChild(fzcards) + end +end + +function M:PlayEffectOther(fzitem,fzcards, size,i,isplay,seat) + isplay = isplay == nil and false or isplay + local isAddlast = false + + local room = DataManager.CurrenRoom + if isplay and i== size then + local faArray = fzitem:GetChild("chiwei") + if room.room_config.people_num == 3 then + if (room.self_player.seat == 1) then + if (seat == 2) then + faArray = fzitem:GetChild("chiwei1") + else + faArray = fzitem:GetChild("chiwei") + end + elseif (room.self_player.seat == 2) then + if (seat == 3) then + faArray = fzitem:GetChild("chiwei1") + else + faArray = fzitem:GetChild("chiwei") + end + elseif (room.self_player.seat == 3) then + if (seat == 1) then + faArray = fzitem:GetChild("chiwei1") + else + faArray = fzitem:GetChild("chiwei") + end + end + end + + if (faArray ~= nil) then + faArray:AddChild(fzcards) + else + fzitem:AddChild(fzcards) + end + else + fzitem:AddChild(fzcards) + end +end + +return M diff --git a/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/main/ZPGameController.lua b/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/main/ZPGameController.lua new file mode 100644 index 00000000..ab5e5a19 --- /dev/null +++ b/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/main/ZPGameController.lua @@ -0,0 +1,10 @@ + +local M = {} + +setmetatable(M,{__index = GameController}) + +function M:init(name) + GameController.init(self,name) +end + +return M diff --git a/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/main/ZPGameEvent.lua b/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/main/ZPGameEvent.lua new file mode 100644 index 00000000..22d92845 --- /dev/null +++ b/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/main/ZPGameEvent.lua @@ -0,0 +1,22 @@ +local ZPGameEvent = { + -- 发牌 + SendCards = 'SendCards', + --发最后一张牌 + AddCard = 'AddCard', + -- 胡牌 + ZPHuCard = 'ZPHuCard', + -- 结算事件 + ZPResult1 = 'ZPResult1', + -- 大结算事件 + ZPResult2 = 'ZPResult2', + -- 转盘指向事件 + EventTurn = 'EventTurn', + OutHint = 'OutHint', --出牌tips + GetCard = 'GetCard', --摸牌 + OutCard = 'OutCard', --出牌 + FangziAction = 'FangziAction', --吃碰等操作事件 + FZTips = 'FZTips', --放子提示 + QiCard = 'QiCard' --弃牌 +} + +return ZPGameEvent diff --git a/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/main/ZPMainView.lua b/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/main/ZPMainView.lua new file mode 100644 index 00000000..9b22561d --- /dev/null +++ b/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/main/ZPMainView.lua @@ -0,0 +1,401 @@ +local PlayerSelfCardInfoView = import('.ZPPlayerSelfCardInfoView') +local PlayerCardInfoView = import('.ZPPlayerCardInfoView') +local ZPSettingView = import('.ZPSettingView') +local ZPTableBG = import('.ZPTableBG') +local HuTipView = import('.HuTipView') +local ZPGameEvent = import('.ZPGameEvent') +local M = { + default_btn = false +} + +setmetatable(M, {__index = MainView}) + +local default_bg = 1 + +function M:InitView(url, isdisplay, open_social, change_card_size, qihu) + UIPackage.AddPackage('base/main_zipai/ui/Main_RunBeard') + MainView.InitView(self, url) + self._full_offset = false + --显示背景 + ZPTableBG.LoadTableBG(default_bg, self._room.game_id, self._root_view) + self.qihu = qihu + if qihu ~= nil then + local id = ZPTableBG.GetTableBG(self._room.game_id) + if id > 3 or id <= 0 then + id = 1 + end + if self._room.score_times ~= nil and self._room.score_times > 0 then + self._view:GetChild('di_text').text = + self._room.room_config:GetGameName() .. ' ' .. qihu .. '胡息起 ' .. self._room.score_times .. '倍' + else + self._view:GetChild('di_text').text = self._room.room_config:GetGameName() .. ' ' .. qihu .. '胡息起' + end + self._view:GetController('bg_state').selectedIndex = id - 1 + end + self.cd_time = 0 + self.default_btn = open_social + if isdisplay == nil then + isdisplay = false + end + local tex_round = self._view:GetChild('tex_round') + self._tex_leftTime = self._view:GetChild('time') + local remaining_card = self._view:GetChild('remaining_card') + self._tex_LeftCard = self._view:GetChild('remaining_card') + self._rightPanelView._opt = 2 + self._rightPanelView:__UpdateTime() + local rightpanel = self._view:GetChild('right_panel') + if (rightpanel ~= nil) then + self.tex_gametype = rightpanel:GetChild('tex_gametype') + if (self.tex_gametype ~= nil) then + self.tex_gametype.text = self._room.room_config:GetGameName() + end + end + self._player_card_info = {} + local _room = self._room + self._hu_tip = HuTipView.new(self) + --加载上次游戏的牌字体 + local user_id = DataManager.SelfUser.account_id + local json_data = Utils.LoadLocalFile(user_id .. _room.game_id) + if json_data ~= nil then + local _data = json.decode(json_data) + local typeface = _data['game_typeface'] + + local _gamectr = self._gamectr + _gamectr:SendChangeTypeFace(typeface) + if typeface == 1 then + if isdisplay then + self._room.change_card_display = '7_' + else + self._room.change_card_display = '2_' + end + elseif typeface == 2 then + self._room.change_card_display = '1_' + elseif typeface == 3 then + self._room.change_card_display = '3_' + elseif typeface == 4 then + self._room.change_card_display = '8_' + end + end + -- self._view.fairyBatching = true + --加载上次游戏的手牌大小 + + local user_id = DataManager.SelfUser.account_id + local json_data = Utils.LoadLocalFile(user_id .. _room.game_id .. 'cardsize_new') + if json_data ~= nil then + local _data = json.decode(json_data) + local typeface = _data['game_cardsize'] + local _gamectr = self._gamectr + if typeface == 0 then + self._room.change_card_size = 1.2 + elseif typeface == 1 then + self._room.change_card_size = 1 + elseif typeface == 2 then + self._room.change_card_size = 0.8 + end + else + self._room.change_card_size = change_card_size + end + + --加载上次游戏的接收语音 + if self.default_btn then + local user_id = DataManager.SelfUser.account_id + local json_data = Utils.LoadLocalFile(user_id .. _room.game_id .. 'yuyin') + local json_data1 = Utils.LoadLocalFile(user_id .. _room.game_id .. 'chupai') + local json_data2 = Utils.LoadLocalFile(user_id .. _room.game_id .. 'fangyan') + self._room.yuyin_typeface = 1 + self._room.chupai_typeface = 1 + self._room.fangyan_typeface = 1 + if json_data ~= nil then + local _data = json.decode(json_data) + local typeface = _data['game_typeface'] + self._room.yuyin_typeface = typeface + self:SetInteractEnabled(typeface == 1 and 0 or 1) + end + if json_data1 ~= nil then + local _data = json.decode(json_data1) + local typeface = _data['game_typeface'] + self._room.chupai_typeface = typeface + end + if json_data2 ~= nil then + local _data = json.decode(json_data2) + local typeface = _data['game_typeface'] + self._room.fangyan_typeface = typeface + end + end + + local _player_card_info = self._player_card_info + for i = 1, _room.room_config.people_num do + local tem = self._view:GetChild('player_card_info' .. i) + _player_card_info[i] = self:NewPlayerCardInfoView(tem, i) + end + + local list = _room.player_list + for i = 1, #list do + local p = list[i] + local info = _player_card_info[self:GetPos(p.seat)] + info:SetPlayer(p) + info:FillData() + end + + self._rightPanelView.ctr_log.selectedIndex = 0 + local list = _room.player_list + local readyNum = 0 + for i = 1, #list do + local p = list[i] + local info = self._player_info[self:GetPos(p.seat)] + info._view.visible = true + info:FillData(p) + if p.ready then + readyNum = readyNum + 1 + end + end + if (_room.curren_round > 0) then + self._rightPanelView.ctr_log.selectedIndex = 0 + end + + self._ctr_action = self._view:GetController('action') + if _room.banker_seat == _room.self_player.seat and readyNum > 1 and readyNum == _room.room_config.people_num then + elseif not _room.self_player.ready then + local round=DataManager.CurrenRoom.room_config.config.times or 1 + local xpconfig=DataManager.CurrenRoom.room_config.config.xi_pai + if xpconfig then + if round>1 then + self._ctr_action.selectedIndex = 1 + else + self._ctr_action.selectedIndex = 2 + end + + else + self._ctr_action.selectedIndex = 1 + end + + + else + self._ctr_action.selectedIndex = 0 + end + self:ResetHandCard() + self:showBackBtnView() + self:InitXiPai() + self:InitXiPai1() +end + +function M:InitXiPai() + self._xipaiPanel = UIPackage.CreateObjectFromURL("ui://Common/panel_handzipai02") + self._root_view:AddChild(self._xipaiPanel) + + local offset = get_offset(self._full_offset) + + self._xipaiPanel.width = GRoot.inst.width - (offset * 2) + self._xipaiPanel.height = GRoot.inst.height + self._xipaiPanel.x = offset + + self._xipaiPanel.visible=false + --self:PlayXiPai() +end + +function M:PlayXiPai(xipaiCallBack) + if self._xipaiPanel then + coroutine.start(function() + self._xipaiPanel.visible=true + self._xipaiPanel:GetTransition("XiPai"):Play() + coroutine.wait(3.5) + self._xipaiPanel.visible=false + if xipaiCallBack then + xipaiCallBack() + end + end) + + + end +end + +function M:InitXiPai1() + self._xipaiPanel1 = UIPackage.CreateObjectFromURL("ui://Common/panel_handzipai03") + self._root_view:AddChild(self._xipaiPanel1) + + local offset = get_offset(self._full_offset) + + self._xipaiPanel1.width = GRoot.inst.width - (offset * 2) + self._xipaiPanel1.height = GRoot.inst.height + self._xipaiPanel1.x = offset + + self._xipaiPanel1.visible=false + --self:PlayXiPai() +end + +function M:PlayXiPai1(xipaiCallBack) + if self._xipaiPanel1 then + coroutine.start(function() + self._xipaiPanel1.visible=true + self._xipaiPanel1:GetTransition("XiPai"):Play() + coroutine.wait(3.5) + self._xipaiPanel1.visible=false + if xipaiCallBack then + xipaiCallBack() + end + end) + + + end +end + + +function M:NewSettingView(cardIndex) + local settingView = ZPSettingView.new(self._view, 2, self.default_btn,cardIndex) + settingView:FillBgSection( + function(url) + LoadGameBg(url, self._root_view) + end, + self._room.game_id, + default_bg, + self._room, + self.qihu + ) + return settingView +end + +function M:EventInit() + MainView.EventInit(self) +end + +function M:NewPlayerCardInfoView(view, index) + if index == 1 then + return PlayerSelfCardInfoView.new(view, self) + end + return PlayerCardInfoView.new(view, self) +end + +-- 设置 更新 手牌字体 三套 +function M:UpdateCardDisplay(index) + local _gamectr = self._gamectr + _gamectr:SendChangeTypeFace(index) + if index == 1 then + self._room.change_card_display = '2_' + elseif index == 2 then + self._room.change_card_display = '1_' + elseif index == 3 then + self._room.change_card_display = '3_' + elseif index == 4 then + self._room.change_card_display = '8_' + end + for i = 1, #self._room.player_list do + local p = self._room.player_list[i] + local info = self._player_card_info[self:GetPos(p.seat)] + if p.DiceCard ~= nil and p.DiceCard ~= 0 then + info:UpdateOutCardList(p.DiceCard) + end + if p.outcard_list ~= nil and #p.outcard_list > 0 then + info:UpdateQiPai(p.outcard_list) + end + if p.fz_list ~= nil and #p.fz_list > 0 then + info:UpdateFzList(p.fz_list) + end + if p.seat == self._room.self_player.seat then + info:UpdateCardDisplay() + end + end +end + +-- 设置 更新 手牌大小 +function M:UpdateCardSize(index) + if index == 0 then + self._room.change_card_size = 1.2 + elseif index == 1 then + self._room.change_card_size = 1 + elseif index == 2 then + self._room.change_card_size = 0.8 + end + local info = self._player_card_info[1] + info:UpdateCardSize() +end + +-- 设置 更新 方言 +function M:UpdateFangyan(index) + self._room.fangyan_typeface = index +end +--刷新手牌排列 按钮 三种 排列方法 在 PendulumRule 里 +function M:ResetHandCard(...) + local btn_reset = self._view:GetChild('btn_reset') + btn_reset.visible=false + btn_reset.onClick:Set( + function(...) + if self._popEvent == false then + return + end + --加载上次的 + local index = 1 + local user_id = DataManager.SelfUser.account_id + local json_data = Utils.LoadLocalFile(user_id .. 'ResetHandCard') + if json_data ~= nil then + local _data = json.decode(json_data) + index = _data['index'] + end + --点击换牌按钮后保存当前游戏的牌字体 + local user_id = DataManager.SelfUser.account_id + local _data = {} + _data['ResetHandCard'] = true + if index == 1 then + _data['index'] = 2 + elseif index == 2 then + _data['index'] = 3 + elseif index == 3 then + _data['index'] = 1 + end + local key = user_id .. 'ResetHandCard' + Utils.SaveLocalFile(key, json.encode(_data)) + local x = _data['index'] + local card_info = self._player_card_info[1] + --printlog("1111111111111111111111111",x) + card_info:InitHandCard(false, x) + end + ) +end + +function M:showBackBtnView() + local btn_back_lobby = self._view:GetChild('btn_back_lobby') + local btn_jiesan_lobby1 = self._view:GetChild('Btn_jiesan_lobby') + --btn_jiesan_lobby1.displayObject.gameObject:SetActive(false) + --btn_jiesan_lobby1:GetChild("n8").displayObject.gameObject:SetActive(false) + if (btn_jiesan_lobby1 ~= nil) then + btn_jiesan_lobby1.onClick:Set( + function() + if (self.cd_time > 0) then + ViewUtil.ErrorTip(nil, '您还处于解散冷却时间当中,请稍后再试') + else + self.cd_time = 30 + self._gamectr:AskDismissRoom( + function(res) + ViewUtil.ErrorTip(res.ReturnCode, '') + end + ) + self:onDisBandTimer() + end + end + ) + end +end + +--解散计时器 +function M:onDisBandTimer() + if self.cd_coroutine ~= nil then + coroutine.stop(self.cd_coroutine) + end + self.cd_coroutine = + coroutine.start( + function() + while (self.cd_time > 0) do + self.cd_time = self.cd_time - 1 + self.cd_time = math.max(0, self.cd_time) + if self.cd_time > 0 then + coroutine.wait(1) + end + end + end + ) +end + +function M:Destroy() + UIPackage.RemovePackage('base/main_zipai/ui/Main_RunBeard') + MainView.Destroy(self) +end +return M diff --git a/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/main/ZPPlayBackView.lua b/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/main/ZPPlayBackView.lua new file mode 100644 index 00000000..5633fd43 --- /dev/null +++ b/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/main/ZPPlayBackView.lua @@ -0,0 +1,13 @@ +local ZPTableBG = import('.ZPTableBG') + +local M = {} + +setmetatable(M, {__index = PlayBackView}) + +function M:InitView(url) + PlayBackView.InitView(self, url) + local _view = self._view + ZPTableBG.LoadTableBG(1, self._room.game_id, self._root_view) +end + +return M diff --git a/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/main/ZPPlayer.lua b/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/main/ZPPlayer.lua new file mode 100644 index 00000000..fe112fd2 --- /dev/null +++ b/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/main/ZPPlayer.lua @@ -0,0 +1,37 @@ + + +local EXPlayer ={ + -- 手牌列表 + card_list = nil, + -- 剩余牌数 + hand_left_count = 0, + -- 出牌列表 + outcard_list = nil, + -- 牌组列表 + fz_list = nil, + hu_xi =0 +} + +local M = EXPlayer + +--- Create a new EXPlayer +function M.new() + setmetatable(M,{__index = Player}) + local self = setmetatable({}, {__index = M}) + self.card_list = {} + self.outcard_list = {} + self.fz_list = {} + return self +end + +-- 清理玩家数据 +function M:Clear() + Player.Clear(self) + self.card_list = {} + self.outcard_list = {} + self.fz_list = {} + self.hand_left_count = 0 + self.hu_xi =0 +end + +return M \ No newline at end of file diff --git a/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/main/ZPPlayerCardInfoView.lua b/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/main/ZPPlayerCardInfoView.lua new file mode 100644 index 00000000..3139e761 --- /dev/null +++ b/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/main/ZPPlayerCardInfoView.lua @@ -0,0 +1,476 @@ +local PendulumRule = import('.PendulumRule') +AreaOderType = { + left_right = "left_right", + right_left = "right_left", + up_down = "up_down", + down_up = "down_up" +} + +local PlayerCardInfoView = { + _view = nil, + _mainView = nil, + + _mask_liangpai = nil, + _area_outcard_list = nil, + _area_handcard_list = nil, + + +} +local function NewCardView(card,cardItem,index_X,index_Y) + local self = {} + setmetatable(self,{__index = CardView}) + self.btn_card = card + self.card_item = cardItem + self.index_X = index_X + self.index_Y = index_Y + return self +end + + +local M = PlayerCardInfoView + +function M.new(view,mainView) + local self = {} + setmetatable(self, {__index = M}) + self._view = view + self._mainView = mainView + self:init() + return self +end + +function M:init() + + local view = self._view + self._room = DataManager.CurrenRoom + self._area_outcard_list = view:GetChild("area_outcard_list") + self._area_handcard_list = view:GetChild("area_handcard_list") + self._area_fz_list = view:GetChild("area_fz_list") + self._area_qipai_list = view:GetChild("windcard_list") + self._mask_liangpai = view:GetChild("mask_liangpai") + UIPackage.AddPackage("base/main_zipai/ui/Main_RunBeard") +end + +function M:SetPlayer(p) + self._player = p +end + +function M:FillData(begin) + +end + +function M:Clear() + self._area_outcard_list:RemoveChildren(0, -1, true) + self._area_fz_list:RemoveChildren(0, -1, true) + self._area_handcard_list:RemoveChildren(0, -1, true) + self._area_qipai_list:RemoveChildren(0, -1, true) + self._mask_liangpai:RemoveChildren(0, -1, true) +end + + +function M:fillCard(obj,card_type,card) + +end + + +function M:ClearOutCard() + self._area_outcard_list:RemoveChildren(0, -1, true) + +end + +--弃牌 +function M:UpdateQiPai( qi_list) + self._area_qipai_list:RemoveChildren(0,-1,true) + for i=1,#qi_list do + local qicards =UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Qipai") + qicards:GetChild("icon").icon = self:getCardItem("ui://Main_RunBeard/202_",qi_list[i]) + self._area_qipai_list:AddChild(qicards) + end + +end + + --放字 +function M:UpdateFzList( fz_list ) + printlog("UpdateFzList=======") + pt(fz_list) + self._area_fz_list:RemoveChildren(0,-1,true) + for i = 1,#fz_list do + local fzitem = nil + if fz_list[i].type ~= RB_FZType.Kan then + fzitem =UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Component1") + fzitem:RemoveChildren(0,-1,true) + end + if fz_list[i].type == RB_FZType.Chi or fz_list[i].type == RB_FZType.Bi then + + local fzcards =UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Fz_0_3") + fzcards:GetController("c2").selectedIndex =1 + fzcards:GetChild("card_"..1).icon = self:getCardItem("ui://Main_RunBeard/202_",fz_list[i].active_card) + fzcards:GetChild("card_"..2).icon = self:getCardItem("ui://Main_RunBeard/202_",fz_list[i].opcard[1]) + fzcards:GetChild("card_"..3).icon = self:getCardItem("ui://Main_RunBeard/202_",fz_list[i].opcard[2]) + fzcards.x,fzcards.y = 0,0 + fzitem:AddChildAt(fzcards,0) + self._area_fz_list:AddChild(fzitem) + + elseif fz_list[i].type == RB_FZType.Peng then + + local fzcards =UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Fz_0_3") + for j=1,3 do + fzcards:GetChild("card_"..j).icon =self:getCardItem("ui://Main_RunBeard/202_",fz_list[i].card) + end + fzcards.x,fzcards.y = 0,0 + fzitem:AddChildAt(fzcards,0) + self._area_fz_list:AddChild(fzitem) + + elseif fz_list[i].type == RB_FZType.Wei then + + local fzcards =UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Fz_0_3") + for j=1,2 do + fzcards:GetChild("card_"..j).icon ="ui://Main_RunBeard/202_1_300" + end + fzcards:GetChild("card_"..3).icon =self:getCardItem("ui://Main_RunBeard/202_",fz_list[i].card) + fzcards.x,fzcards.y = 0,0 + fzitem:AddChildAt(fzcards,0) + self._area_fz_list:AddChild(fzitem) + + elseif fz_list[i].type == RB_FZType.ChouWei then + local fzcards =UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Fz_0_3") + for j=1,2 do + fzcards:GetChild("card_"..j).icon ="ui://Main_RunBeard/202_1_300" + end + fzcards:GetChild("card_"..3).icon =self:getCardItem("ui://Main_RunBeard/202_",fz_list[i].card) + fzcards.x,fzcards.y = 0,0 + fzitem:AddChildAt(fzcards,0) + self._area_fz_list:AddChild(fzitem) + + elseif fz_list[i].type == RB_FZType.Pao then + + local fzcards =UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Fz_0_4") + for j=1,4 do + fzcards:GetChild("card_"..j).icon =self:getCardItem("ui://Main_RunBeard/202_",fz_list[i].card) + end + fzcards.x,fzcards.y = 0,0 + fzitem:AddChildAt(fzcards,0) + self._area_fz_list:AddChild(fzitem) + + elseif fz_list[i].type == RB_FZType.Ti then + + local fzcards =UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Fz_0_4") + for j=1,4 do + if j==4 then + fzcards:GetChild("card_"..j).icon =self:getCardItem("ui://Main_RunBeard/202_",fz_list[i].card) + else + fzcards:GetChild("card_"..j).icon ="ui://Main_RunBeard/202_1_300" + end + end + fzcards.x,fzcards.y = 0,0 + fzitem:AddChildAt(fzcards,0) + self._area_fz_list:AddChild(fzitem) + end + end +end + +--回放手牌 +function M:InitHandCard(handcard) + self._area_handcard_list:RemoveChildren(0,-1,true) + local pokerList =PendulumRule.GetHandCard(handcard) --self:PendulumRule(handcard) + self.card_lists ={} + for i =1,#pokerList do + for j =1,#pokerList[i] do + local card_code = pokerList[i][j] + local btn_card =UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Qipai") + btn_card:GetChild("icon").icon = self:getCardItem("ui://Main_RunBeard/202_",card_code) + self._area_handcard_list:AddChild(btn_card) + self._area_handcard_list:SetChildIndex(btn_card,5-j) + local card_view = NewCardView(btn_card,card_code,i,j) + self.card_lists[#self.card_lists+1] = card_view + end + end + for j=#self.card_lists,1,-1 do + local card_view = self.card_lists[j] + card_view.btn_card:RemoveFromParent() + self._area_handcard_list:AddChild(card_view.btn_card) + card_view.btn_card.xy = self:GetHandCardPos(card_view,#pokerList) + end + + if self._player.fz_list~=nil then + for i=1,#self._player.fz_list do + if self._player.fz_list[i].type == RB_FZType.Kan then + self:UpdateKan(self._player.fz_list[i].card) + end + end + end +end + + + +function M:UpdateHandCards( list ) + self.card_lists = {} + self._area_handcard_list:RemoveChildren(0,-1,true) + local CountCards = {} + for i=1,#list do + CountCards[list[i].index_X]=CountCards[list[i].index_X] == nil and 1 or CountCards[list[i].index_X] + 1 + end + for i=1,#list do + local card_code = list[i].card_item + local btn_card =UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Qipai") + btn_card:GetChild("icon").icon = self:getCardItem("ui://Main_RunBeard/202_",card_code) + local card_view = NewCardView(btn_card,card_code,list[i].index_X,list[i].index_Y) + --存牌堆 + self.card_lists[#self.card_lists+1] =card_view + end + for j=#self.card_lists,1,-1 do + local card_view = self.card_lists[j] + card_view.btn_card:RemoveFromParent() + self._area_handcard_list:AddChild(card_view.btn_card) + card_view.btn_card.xy = self:GetHandCardPos(card_view,#CountCards) + end + +end + +--牌位置 +function M:GetHandCardPos(cards_view,cards) + local x,y = 0,0 + local card_width = 42 -- 牌的宽度 + local middle_x = self._area_handcard_list.width / 2 + local start_x = middle_x - (cards / 2 * (card_width)) + x = start_x + (card_width) * (cards_view.index_X - 1) + y = 0 - (42*cards_view.index_Y) + return Vector2.New(x,y) +end + + + +function M:UpdateOutCardList(outcard) + + self._area_outcard_list:RemoveChildren(0,-1,true) + local outcards =UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Gcm_OutCard") + if outcard==0 then + outcards:GetChild("icon").icon ="ui://Main_RunBeard/201_1_300" + else + outcards:GetChild("icon").icon =self:getCardItem("ui://Main_RunBeard/203_",outcard) + end + outcards.x,outcards.y = 0,0 + self._area_outcard_list:AddChild(outcards) +end + +--摸牌动画 +function M:PlayingOutCardAnima(card) + if(self._area_outcard_list ~=nil and self._area_outcard_list.numChildren>0)then + self._area_outcard_list:GetChildAt(0):GetChild("icon").icon =self:getCardItem("ui://Main_RunBeard/202_",card) + self._view:GetTransition("t0"):Play() + end + coroutine.start(function() + coroutine.wait(0.1) + self:ClearOutCard() + end) + -- +end + + +--摆牌规则 +function M:PendulumRule(handcard) + local room = DataManager.CurrenRoom + local card_list = handcard + local card_count = #card_list + local cards_map = {} + local CountCards = {} + for i=1,#card_list do + CountCards[card_list[i]]= CountCards[card_list[i]] == nil and 1 or CountCards[card_list[i]] + 1 + end + --find4 + for k,v in pairs(CountCards) do + if (v == 4) then + local cs = {} + cs[1]= k + cs[2]= k + cs[3]= k + cs[4]= k + cards_map[#cards_map+1]=cs + CountCards[k] = 0 + card_count =card_count- 4 + end + end + + + --find3 + for k,v in pairs(CountCards) do + if (v >= 3) then + local cs = {} + cs[1]= k + cs[2]= k + cs[3]= k + cards_map[#cards_map+1]=cs + CountCards[k] = CountCards[k] -3 + card_count =card_count- 3 + end + end + --find AAa + for i = 201, 210 do + if CountCards[i]~=nil and CountCards[i] >= 2 then + if CountCards[i-100]~=nil and CountCards[i-100] == 1 then + local cs = {} + cs[1]= i + cs[2]= i + cs[3]= i-100 + cards_map[#cards_map+1]=cs + CountCards[i] = CountCards[i]- 2; + CountCards[i - 100] = CountCards[i - 100]-1 + card_count = card_count-3 + end + end + end + --find aaA + for i = 101, 110 do + if CountCards[i]~=nil and (CountCards[i] >= 2) then + if CountCards[i + 100]~=nil and (CountCards[i + 100] == 1) then + local cs = {} + cs[1]= i + cs[2]= i + cs[3]= i+100 + cards_map[#cards_map+1]=cs + CountCards[i] = CountCards[i]- 2; + CountCards[i +100] = CountCards[i +100] - 1 + card_count = card_count-3 + end + end + end + + --find2 + for k,v in pairs(CountCards) do + if (v >= 2) then + local cs = {} + cs[1] = k + cs[2] = k + cards_map[#cards_map+1]=cs + CountCards[k] = CountCards[k] - 2 + card_count =card_count- 2 + end + end + --find 小 2 7 10 + local counta = CountCards[102] + if counta ~=nil and counta>0 then + for i=1,counta do + if CountCards[102]~=nil and CountCards[107]~=nil and CountCards[110]~=nil and CountCards[102] >0 and CountCards[107] >0 and CountCards[110] >0 then + local cs = {} + cs[1]= 102 + cs[2]= 107 + cs[3]= 110 + cards_map[#cards_map+1] = cs + CountCards[102] = CountCards[102]-1 + CountCards[107] = CountCards[107]-1 + CountCards[110] = CountCards[110]-1 + card_count = card_count - 3 + end + end + end + + --find 大 2 7 10 + local countA = CountCards[202] + if countA ~=nil and countA>0 then + for i=1,countA do + if CountCards[202]~=nil and CountCards[207]~=nil and CountCards[210]~=nil and CountCards[202] >0 and CountCards[207] >0 and CountCards[210] >0 then + local cs = {} + cs[1]= 202 + cs[2]= 207 + cs[3]= 210 + cards_map[#cards_map+1]=cs + CountCards[202] = CountCards[202]-1 + CountCards[207] = CountCards[207]-1 + CountCards[210] = CountCards[210]-1 + card_count = card_count - 3 + end + end + end + + --find abc + for i=101,110 do + if (CountCards[i] ~=nil and CountCards[i + 1] ~=nil and CountCards[i + 2] ~=nil) and (CountCards[i] > 0 and CountCards[i + 1] > 0 and CountCards[i + 2] > 0) then + local cs = {} + cs[1]= i + cs[2]= i+1 + cs[3]= i+2 + cards_map[#cards_map+1]=cs + CountCards[i] = CountCards[i]-1 + CountCards[i+1] = CountCards[i+1]-1 + CountCards[i+2] = CountCards[i+2]-1 + card_count = card_count - 3 + end + end + --find ABC + for i=201,210 do + if (CountCards[i] ~=nil and CountCards[i + 1] ~=nil and CountCards[i + 2] ~=nil) and (CountCards[i] > 0 and CountCards[i + 1] > 0 and CountCards[i + 2] > 0) then + local cs = {} + cs[1]= i + cs[2]= i+1 + cs[3]= i+2 + cards_map[#cards_map+1]=cs + CountCards[i] = CountCards[i]-1 + CountCards[i+1] = CountCards[i+1]-1 + CountCards[i+2] = CountCards[i+2]-1 + card_count = card_count - 3 + end + end + --find Aa + for i = 201, 210 do + if CountCards[i]~=nil and CountCards[i] == 1 then + if CountCards[i-100]~=nil and CountCards[i-100] == 1 then + local cs = {} + cs[1]= i + cs[2]= i-100 + cards_map[#cards_map+1]=cs + CountCards[i] = CountCards[i]- 1; + CountCards[i - 100] = CountCards[i - 100]-1 + card_count = card_count-2 + end + end + end + + local r_count = 9 - #cards_map + local merge = false + merge = r_count0 then + for i=1,#tempNotPutList do + self:UpdateKan(tempNotPutList[i]) + end + end +end + +--手牌 +function M:InitHandCard(isPlayAni, index) + if DataManager.CurrenRoom == nil or DataManager.CurrenRoom.self_player == nil then + return + end + self.outcard_button = nil + + if self.cor_init_poker ~= nil then + coroutine.stop(self.cor_init_poker) + end + self.cor_init_poker = nil + local _room = DataManager.CurrenRoom + --得到排序好的 list + local pokerList = PendulumRule.GetHandCard(_room.self_player.handcard_list, index) + if pokerList == nil or #pokerList == 0 then + return + end + self.cards_count = #pokerList + self.card_list = {} + self._area_handcard_list:RemoveChildren(0, -1, true) + --开始发牌动画 + if isPlayAni == true then + self.cor_init_poker = + coroutine.start( + function() + self._mainView._popEvent = false + if self._mainView._rightPanelView._settingView ~= nil then + self._mainView._rightPanelView._settingView:SetBtnUpdateCardEnable(false) + end + for i = 1, #pokerList do + local pokerListNum = 0 + for j = 1, #pokerList[i] do + local card_code = pokerList[i][j] + local btn_card = UIPackage.CreateObjectFromURL('ui://Main_RunBeard/Btn_Card') + btn_card:GetChild('icon').icon = self:getCardItem('ui://Main_RunBeard/201_', card_code) + btn_card:GetChild('icon'):SetScale(self:getCardSize(), self:getCardSize()) + btn_card:GetChild('n6'):SetScale(self:getCardSize(), self:getCardSize()) + self.card_width = 95 * self:getCardSize() + self.card_hight = 123 * self:getCardSize() + local x, y = 500, (j * 85) - 500 + btn_card:SetXY(x, y) + self._area_handcard_list:AddChild(btn_card) + self._area_handcard_list:SetChildIndex(btn_card, 5 - j) + local card_view = NewCardView(btn_card, card_code, i, j) + --存牌堆 + self.card_list[#self.card_list + 1] = card_view + btn_card.data = card_view + btn_card.onTouchBegin:Set(handler(self, self.onTouchBegin)) + btn_card.onTouchMove:Set(handler(self, self.onTouchMove)) + btn_card.onTouchEnd:Set(handler(self, self.__OnDragEnd)) + end + for j = #self.card_list, 1, -1 do + coroutine.wait(0.005) + if pokerListNum == #pokerList[i] then + break + end + pokerListNum = pokerListNum + 1 + local card_view = self.card_list[j] + card_view.btn_card:RemoveFromParent() + self._area_handcard_list:AddChild(card_view.btn_card) + card_view.btn_card:TweenMove(self:GetHandCardPos(card_view, self.cards_count), 0.08) + end + end + self:UpdateHandCardsPos() + self._mainView._popEvent = true + self:UpdateIsOnClick(true) + if self._mainView._rightPanelView._settingView ~= nil then + coroutine.start( + function() + coroutine.wait(1) + self._mainView._rightPanelView._settingView:SetBtnUpdateCardEnable(true) + end + ) + end + end + ) + else + --没有发牌动画 + for i = 1, #pokerList do + for j = 1, #pokerList[i] do + local card_code = pokerList[i][j] + local btn_card = UIPackage.CreateObjectFromURL('ui://Main_RunBeard/Btn_Card') + btn_card:GetChild('icon').icon = self:getCardItem('ui://Main_RunBeard/201_', card_code) + btn_card:GetChild('icon'):SetScale(self:getCardSize(), self:getCardSize()) + btn_card:GetChild('n6'):SetScale(self:getCardSize(), self:getCardSize()) + self.card_width = 95 * self:getCardSize() + self.card_hight = 123 * self:getCardSize() + self._area_handcard_list:AddChild(btn_card) + self._area_handcard_list:SetChildIndex(btn_card, 5 - j) + local card_view = NewCardView(btn_card, card_code, i, j) + --存牌堆 + self.card_list[#self.card_list + 1] = card_view + btn_card.data = card_view + btn_card.onTouchBegin:Set(handler(self, self.onTouchBegin)) + btn_card.onTouchMove:Set(handler(self, self.onTouchMove)) + btn_card.onTouchEnd:Set(handler(self, self.__OnDragEnd)) + end + --存牌堆 + for j = 1, #self.card_list do + local card_view = self.card_list[j] + card_view.btn_card.xy = self:GetHandCardPos(card_view, self.cards_count) + end + end + if self._player.fz_list ~= nil then + for i = 1, #self._player.fz_list do + if self._player.fz_list[i].type == RB_FZType.Kan then + self:UpdateKan(self._player.fz_list[i].card) + end + end + end + self:UpdateHandCardsPos() + end + + self:SetNotPutCard() +end +--更新手牌 +function M:UpdateHandCards(list) + self.card_list = {} + self._area_handcard_list:RemoveChildren(0, -1, true) + + self.outcard_button = nil + + local CountCards = {} + for i = 1, #list do + CountCards[list[i].index_X] = CountCards[list[i].index_X] == nil and 1 or CountCards[list[i].index_X] + 1 + end + for i = 1, #list do + local card_code = list[i].card_item + local btn_card = UIPackage.CreateObjectFromURL('ui://Main_RunBeard/Btn_Card') + btn_card:GetChild('icon').icon = self:getCardItem('ui://Main_RunBeard/201_', card_code) + btn_card:GetChild('icon'):SetScale(self:getCardSize(), self:getCardSize()) + btn_card:GetChild('n6'):SetScale(self:getCardSize(), self:getCardSize()) + self.card_width = 87 * self:getCardSize() + self.card_hight = 110 * self:getCardSize() + local card_view = NewCardView(btn_card, card_code, list[i].index_X, list[i].index_Y) + --存牌堆 + self.card_list[#self.card_list + 1] = card_view + btn_card.data = card_view + btn_card.onTouchBegin:Set(handler(self, self.onTouchBegin)) + btn_card.onTouchMove:Set(handler(self, self.onTouchMove)) + btn_card.onTouchEnd:Set(handler(self, self.__OnDragEnd)) + end + for j = #self.card_list, 1, -1 do + local card_view = self.card_list[j] + card_view.btn_card:RemoveFromParent() + self._area_handcard_list:AddChild(card_view.btn_card) + card_view.btn_card.xy = self:GetHandCardPos(card_view, #CountCards) + end + if self._player.fz_list ~= nil then + for i = 1, #self._player.fz_list do + if self._player.fz_list[i].type == RB_FZType.Kan then + self:UpdateKan(self._player.fz_list[i].card) + end + end + end + self:SetNotPutCard() +end + +-- -- +function M:onTouchBegin(context) + if DataManager.CurrenRoom == nil or DataManager.CurrenRoom.self_player == nil then + return + end + local button = context.sender + local card = button.data + if DataManager.CurrenRoom.curren_outcard_seat == DataManager.CurrenRoom.self_player.seat then + self:ShowHuTip(card.card_item) + end + card.btn_card:GetChild('icon').icon = self:getCardItem('ui://Main_RunBeard/203_', card.card_item) + -- card.btn_card.sortingOrder = 100 + local xy = self._area_handcard_list:GlobalToLocal(Vector2.New(context.inputEvent.x, context.inputEvent.y)) + card.btn_card.xy = Vector2.New(card.btn_card.x + 20, card.btn_card.y - 50) + card.touch_pos = xy - button.xy +end + +function M:onTouchMove(context) + local button = context.sender + local card = button.data + local xy = self._area_handcard_list:GlobalToLocal(Vector2.New(context.inputEvent.x, context.inputEvent.y)) + button.xy = xy - card.touch_pos +end + +--出牌提示动画 +function M:ChuPaiTiShi() + if DataManager.CurrenRoom == nil or DataManager.CurrenRoom.self_player == nil then + return + end + if DataManager.CurrenRoom.curren_outcard_seat == DataManager.CurrenRoom.self_player.seat then + self._view:GetController('chupai').selectedIndex = 1 + else + self._view:GetController('chupai').selectedIndex = 0 + end +end +-- 删手牌 +function M:DeleteHandCard(carditem) + local card = nil + if self.outcard_button ~= nil and carditem == self.outcard_button.card_item then + list_remove(self.card_list, self.outcard_button) + self._area_handcard_list:RemoveChild(self.outcard_button.btn_card, true) + + card = self.outcard_button + self.outcard_button = nil + else + for i = 1, #self.card_list do + local card_view = self.card_list[i] + if carditem == card_view.card_item then + card_view.btn_card.touchable = false + list_remove(self.card_list, card_view) + card = card_view + --card_view.btn_card:RemoveFromParent() + self._area_handcard_list:RemoveChild(card_view.btn_card, true) + break + end + end + end + if card ~= nil then + local num = 0 + for i = 1, #self.card_list do + if card.index_X == self.card_list[i].index_X and card.index_Y < self.card_list[i].index_Y then + self.card_list[i].index_Y = self.card_list[i].index_Y - 1 + end + if card.index_X == self.card_list[i].index_X then + num = num + 1 + end + end + if num == 0 then + for i = 1, #self.card_list do + if self.card_list[i].index_X > card.index_X then + self.card_list[i].index_X = self.card_list[i].index_X - 1 + end + end + end + end + self:UpdateHandCardsPos() +end +--更新手牌的坎 +function M:UpdateKan(card) + for i = 1, #self.card_list do + local card_view = self.card_list[i] + if card_view.card_item == card then + --card_view.btn_card.touchable = false + card_view.btn_card:GetController('Kan').selectedIndex = 1 + end + end +end + +-- 手牌更新位置方法 self.card_list 里面的对象 NewCardView,index_X index_Y 就是xy序号 +function M:UpdateHandCardsPos() + --得到有 多少列 + local CountCards = {} + for i = 1, #self.card_list do + CountCards[self.card_list[i].index_X] = + CountCards[self.card_list[i].index_X] == nil and 1 or CountCards[self.card_list[i].index_X] + 1 + end + for i = #self.card_list, 1, -1 do + local card_view = self.card_list[i] + card_view.btn_card:RemoveFromParent() + self._area_handcard_list:AddChild(card_view.btn_card) + card_view.old_postion = self:GetHandCardPos(card_view, #CountCards) + card_view.btn_card:TweenMove(card_view.old_postion, 0.3) + end + self:ShowHuTip() +end + +--刷新手牌字体 +function M:UpdateCardDisplay() + local CountCards = {} + for i = 1, #self.card_list do + CountCards[self.card_list[i].index_X] = + CountCards[self.card_list[i].index_X] == nil and 1 or CountCards[self.card_list[i].index_X] + 1 + end + for i = #self.card_list, 1, -1 do + local card_view = self.card_list[i] + card_view.btn_card:RemoveFromParent() + card_view.btn_card:GetChild('icon').icon = self:getCardItem('ui://Main_RunBeard/201_', card_view.card_item) + self._area_handcard_list:AddChild(card_view.btn_card) + card_view.btn_card:TweenMove(self:GetHandCardPos(card_view, #CountCards), 0.3) + end +end +--更新手牌大小 +function M:UpdateCardSize() + local CountCards = {} + for i = 1, #self.card_list do + CountCards[self.card_list[i].index_X] = + CountCards[self.card_list[i].index_X] == nil and 1 or CountCards[self.card_list[i].index_X] + 1 + end + for i = #self.card_list, 1, -1 do + local card_view = self.card_list[i] + card_view.btn_card:RemoveFromParent() + card_view.btn_card:GetChild('icon').icon = self:getCardItem('ui://Main_RunBeard/201_', card_view.card_item) + card_view.btn_card:GetChild('icon'):SetScale(self:getCardSize(), self:getCardSize()) + card_view.btn_card:GetChild('n6'):SetScale(self:getCardSize(), self:getCardSize()) + self.card_width = 87 * self:getCardSize() + self.card_hight = 110 * self:getCardSize() + self._area_handcard_list:AddChild(card_view.btn_card) + card_view.btn_card:TweenMove(self:GetHandCardPos(card_view, #CountCards), 0.3) + end +end + +function M:UpdateIsOnClick(isOut) + self._view.touchable = isOut +end + +-- 结束 拖拽事件 +-- 根据牌结束点的位置 判断是出牌还是调整位置 button.xy 和 牌的xy比较 +function M:__OnDragEnd(context) + if DataManager.CurrenRoom == nil or DataManager.CurrenRoom.self_player == nil then + return + end + if self.outcard_button then + self.outcard_button = nil + end + local button = context.sender + local card = button.data + -- card.btn_card.sortingOrder = 0 + local _room = DataManager.CurrenRoom + + if (button.y < -320 and _room ~= nil and _room.curren_outcard_seat == _room.self_player.seat) then + button.touchable = false + self.outcard_button = card + self:UpdateIsOnClick(false) + self._mainView:OutCard(card.card_item) + else + local isChangeCard = false + self.outcard_button = nil + card.btn_card:GetChild('icon').icon = self:getCardItem('ui://Main_RunBeard/201_', card.card_item) + self._area_handcard_list:AddChild(button) + if #self.card_list == 1 then + isChangeCard = false + self:UpdateHandCardsPos() + return + end + local CountCards = {} + for i = 1, #self.card_list do + local lists = {} + if CountCards[self.card_list[i].index_X] == nil then + lists[#lists + 1] = self.card_list[i] + CountCards[self.card_list[i].index_X] = lists + else + CountCards[self.card_list[i].index_X][#CountCards[self.card_list[i].index_X] + 1] = self.card_list[i] + end + end + local minmark = 1 + local maxmark = #self.card_list + if card == self.card_list[1] or card == self.card_list[#self.card_list] then + if self.card_list[1].index_X == self.card_list[2].index_X then + minmark = 2 + end + if self.card_list[#self.card_list].index_X == self.card_list[#self.card_list - 1].index_X then + maxmark = #self.card_list - 1 + end + end + --位置x小于第一张牌 放第一排 + if button.x + button.width / 2 < self.card_list[minmark].btn_card.x and #CountCards < 10 then + --位置大于最后一张牌 放最后一排 + list_remove(self.card_list, card) + local num = 0 + for i = 1, #self.card_list do + if card.index_X == self.card_list[i].index_X and card.index_Y < self.card_list[i].index_Y then + self.card_list[i].index_Y = self.card_list[i].index_Y - 1 + end + if card.index_X == self.card_list[i].index_X then + num = num + 1 + end + end + if num == 0 then + for i = 1, #self.card_list do + if self.card_list[i].index_X < card.index_X then + self.card_list[i].index_X = self.card_list[i].index_X + 1 + end + end + else + for i = 1, #self.card_list do + self.card_list[i].index_X = self.card_list[i].index_X + 1 + end + end + card.index_X = 1 + card.index_Y = 1 + table.insert(self.card_list, 1, card) + isChangeCard = true + elseif button.x + button.width / 2 > (self.card_list[maxmark].btn_card.x + button.width) and #CountCards < 10 then + list_remove(self.card_list, card) + local num = 0 + for i = 1, #self.card_list do + if card.index_X == self.card_list[i].index_X then + num = num + 1 + end + if card.index_X == self.card_list[i].index_X and card.index_Y < self.card_list[i].index_Y then + self.card_list[i].index_Y = self.card_list[i].index_Y - 1 + end + end + if num == 0 then + for i = 1, #self.card_list do + if self.card_list[i].index_X > card.index_X then + self.card_list[i].index_X = self.card_list[i].index_X - 1 + end + end + end + card.index_X = self.card_list[#self.card_list].index_X + 1 + card.index_Y = 1 + self.card_list[#self.card_list + 1] = card + isChangeCard = true + else + --放已有的牌堆上 判断放第几列 + local MoveCard = false + local MoveCardPos = 0 + local MoveCardY = 0 + for i = 1, #CountCards do + local card_view = CountCards[i][1] + if card_view ~= nil then + if + button.x + button.width / 2 > card_view.old_postion.x and + button.x + button.width / 2 < (card_view.old_postion.x + button.width) + then + if card ~= card_view and #CountCards[i] < 4 and card.index_X ~= card_view.index_X then + MoveCardPos = i + MoveCardY = #CountCards[i] + 1 + MoveCard = true + list_remove(self.card_list, card) + end + end + end + end + local MoveCardindex = 0 + -- local MoveCardY = 0 + if + button.x + button.width / 2 > card.old_postion.x and + button.x + button.width / 2 < (card.old_postion.x + button.width) + then + if #CountCards[card.index_X] > 1 then + for i = 1, #CountCards[card.index_X] do + local _cv = CountCards[card.index_X][i] + if _cv ~= card then + if + button.y + button.height / 2 > _cv.btn_card.y and + button.y + button.height / 2 < (_cv.btn_card.y + button.height) + then + --向下移動 + if ((button.y + button.height / 2) + 20) > (card.old_postion.y + button.height) then + --向上移動 + MoveCardindex = -1 + MoveCardPos = card.index_X + MoveCardY = _cv.index_Y + MoveCard = true + list_remove(self.card_list, card) + elseif ((button.y + button.height / 2) - 20) < card.old_postion.y then + MoveCardindex = 1 + MoveCardPos = card.index_X + MoveCardY = _cv.index_Y + MoveCard = true + list_remove(self.card_list, card) + end + elseif i == #CountCards[card.index_X] and button.y + button.height / 2 < _cv.btn_card.y then + MoveCardindex = 1 + MoveCardPos = card.index_X + MoveCardY = _cv.index_Y + MoveCard = true + list_remove(self.card_list, card) + elseif i == 1 and button.y + button.height / 2 > (_cv.btn_card.y + button.width) then + MoveCardindex = -1 + MoveCardPos = card.index_X + MoveCardY = _cv.index_Y + MoveCard = true + list_remove(self.card_list, card) + end + end + end + end + end + if MoveCard == true and MoveCardindex == 0 then + --上下移动 + local num = 0 + for i = 1, #self.card_list do + if card.index_X == self.card_list[i].index_X and card.index_Y < self.card_list[i].index_Y then + self.card_list[i].index_Y = self.card_list[i].index_Y - 1 + end + if card.index_X == self.card_list[i].index_X then + num = num + 1 + end + end + if num == 0 then + for i = 1, #self.card_list do + if self.card_list[i].index_X > card.index_X then + self.card_list[i].index_X = self.card_list[i].index_X - 1 + end + end + if MoveCardPos > card.index_X then + MoveCardPos = MoveCardPos - 1 + end + end + card.index_X = MoveCardPos + card.index_Y = MoveCardY + for i = #self.card_list, 1, -1 do + if MoveCardPos == self.card_list[i].index_X then + table.insert(self.card_list, (i + 1), card) + break + end + end + isChangeCard = true + elseif MoveCard == true and MoveCardindex ~= 0 then + for i = 1, #self.card_list do + if card.index_X == self.card_list[i].index_X then + --向下移动 + if MoveCardindex == -1 then + --向上移动 + if self.card_list[i].index_Y < card.index_Y and self.card_list[i].index_Y >= MoveCardY then + self.card_list[i].index_Y = self.card_list[i].index_Y + 1 + end + else + if self.card_list[i].index_Y > card.index_Y and self.card_list[i].index_Y <= MoveCardY then + self.card_list[i].index_Y = self.card_list[i].index_Y - 1 + end + end + end + end + card.index_X = MoveCardPos + card.index_Y = MoveCardY + for i = #self.card_list, 1, -1 do + if MoveCardPos == self.card_list[i].index_X and self.card_list[i].index_Y == (MoveCardY - 1) then + table.insert(self.card_list, (i + 1), card) + break + elseif MoveCardPos == self.card_list[i].index_X and self.card_list[i].index_Y == (MoveCardY + 1) then + table.insert(self.card_list, i, card) + break + end + end + isChangeCard = true + else + isChangeCard = false + self._area_handcard_list:AddChild(button) + end + end + self:UpdateHandCardsPos() + --每次改变手牌排列发给服务器 重连 回放需要用 --回放需要没次改变都要显示 + if isChangeCard == true then + self:SendChangeCard() + end + end +end + +--改变手牌排列发给服务器 +function M:SendChangeCard(...) + local list = {} + for i = 1, #self.card_list do + local data = {} + data.card = self.card_list[i].card_item + data.X = self.card_list[i].index_X + data.Y = self.card_list[i].index_Y + list[#list + 1] = data + end + self._mainView:ChangeCards(list) +end + +--计算手牌位置 +function M:GetHandCardPos(cards_view, cards) + local x, y = 0, 0 + local card_width = self.card_width -- 牌的宽度 + local middle_x = self._area_handcard_list.width / 2 + local start_x = middle_x - (cards / 2 * (card_width)) + x = start_x + (card_width) * (cards_view.index_X - 1) + + if self:getCardSize() == 1 then + y = 90 - (85 * cards_view.index_Y) + elseif self:getCardSize() == 1.2 then + y = 70 - (110 * cards_view.index_Y) + elseif self:getCardSize() == 0.8 then + y = 100 - (65 * cards_view.index_Y) + end + return Vector2.New(x, y) +end + +--更新 吃碰 +function M:UpdateFzList(fz_list) + printlog("UpdateFzList=======") + pt(fz_list) + self._area_fz_list:RemoveChildren(0, -1, true) + for i = 1, #fz_list do + local fzitem = nil + if fz_list[i].type ~= RB_FZType.Kan then + fzitem = UIPackage.CreateObjectFromURL('ui://Main_RunBeard/Component1') + fzitem:RemoveChildren(0, -1, true) + end + if fz_list[i].type == RB_FZType.Chi or fz_list[i].type == RB_FZType.Bi then + local fzcards = UIPackage.CreateObjectFromURL('ui://Main_RunBeard/Fz_0_3') + fzcards:GetChild('card_' .. 1).icon = self:getCardItem('ui://Main_RunBeard/202_', fz_list[i].active_card) + fzcards:GetController('c2').selectedIndex = 1 + fzcards:GetChild('card_' .. 2).icon = self:getCardItem('ui://Main_RunBeard/202_', fz_list[i].opcard[1]) + fzcards:GetChild('card_' .. 3).icon = self:getCardItem('ui://Main_RunBeard/202_', fz_list[i].opcard[2]) + fzcards.x, fzcards.y = 0, 0 + fzitem:AddChildAt(fzcards, 0) + self._area_fz_list:AddChild(fzitem) + elseif fz_list[i].type == RB_FZType.Peng then + local fzcards = UIPackage.CreateObjectFromURL('ui://Main_RunBeard/Fz_0_3') + for j = 1, 3 do + fzcards:GetChild('card_' .. j).icon = self:getCardItem('ui://Main_RunBeard/202_', fz_list[i].card) + end + fzcards.x, fzcards.y = 0, 0 + fzitem:AddChildAt(fzcards, 0) + self._area_fz_list:AddChild(fzitem) + elseif fz_list[i].type == RB_FZType.Wei then + local fzcards = UIPackage.CreateObjectFromURL('ui://Main_RunBeard/Fz_0_3') + fzcards:GetController('c1').selectedIndex = 1 + for j = 1, 3 do + fzcards:GetChild('card_' .. j).icon = self:getCardItem('ui://Main_RunBeard/202_', fz_list[i].card) + end + fzcards.x, fzcards.y = 0, 0 + fzitem:AddChildAt(fzcards, 0) + self._area_fz_list:AddChild(fzitem) + elseif fz_list[i].type == RB_FZType.ChouWei then + local fzcards = UIPackage.CreateObjectFromURL('ui://Main_RunBeard/Fz_0_3') + fzcards:GetController('c1').selectedIndex = 1 + for j = 1, 3 do + fzcards:GetChild('card_' .. j).icon = self:getCardItem('ui://Main_RunBeard/202_', fz_list[i].card) + end + fzcards.x, fzcards.y = 0, 0 + fzitem:AddChildAt(fzcards, 0) + self._area_fz_list:AddChild(fzitem) + elseif fz_list[i].type == RB_FZType.Pao then + local fzcards = UIPackage.CreateObjectFromURL('ui://Main_RunBeard/Fz_0_4') + for j = 1, 4 do + fzcards:GetChild('card_' .. j).icon = self:getCardItem('ui://Main_RunBeard/202_', fz_list[i].card) + end + fzcards.x, fzcards.y = 0, 0 + fzitem:AddChildAt(fzcards, 0) + self._area_fz_list:AddChild(fzitem) + elseif fz_list[i].type == RB_FZType.Ti then + local fzcards = UIPackage.CreateObjectFromURL('ui://Main_RunBeard/Fz_0_4') + for j = 1, 4 do + if j == 4 then + fzcards:GetChild('card_' .. j).icon = self:getCardItem('ui://Main_RunBeard/202_', fz_list[i].card) + else + fzcards:GetChild('card_' .. j).icon = 'ui://Main_RunBeard/202_1_300' + end + end + fzcards.x, fzcards.y = 0, 0 + fzitem:AddChildAt(fzcards, 0) + self._area_fz_list:AddChild(fzitem) + end + end +end + +function M:ClearOutCard() + self._area_outcard_list:RemoveChildren(0, -1, true) +end +--出牌 +function M:UpdateOutCardList(outcard) + self._area_outcard_list:RemoveChildren(0, -1, true) + local outcards = UIPackage.CreateObjectFromURL('ui://Main_RunBeard/Gcm_OutCard') + if outcard == 0 then + outcards:GetChild('icon').icon = 'ui://Main_RunBeard/201_1_300' + else + outcards:GetChild('icon').icon = self:getCardItem('ui://Main_RunBeard/203_', outcard) + end + outcards.x, outcards.y = 0, 0 + self._area_outcard_list:AddChild(outcards) +end + +--弃牌 +function M:UpdateQiPai(qi_list) + self._area_qipai_list:RemoveChildren(0, -1, true) + for i = 1, #qi_list do + local qicards = UIPackage.CreateObjectFromURL('ui://Main_RunBeard/Qipai') + qicards:GetChild('icon').icon = self:getCardItem('ui://Main_RunBeard/202_', qi_list[i]) + self._area_qipai_list:AddChild(qicards) + end +end + +--摸牌动画 +function M:PlayingOutCardAnima(card) + if (self._area_outcard_list ~= nil and self._area_outcard_list.numChildren > 0) then + self._area_outcard_list:GetChildAt(0):GetChild('icon').icon = self:getCardItem('ui://Main_RunBeard/202_', card) + self._view:GetTransition('t0'):Play() + end + coroutine.start( + function() + coroutine.wait(0.1) + self:ClearOutCard() + end + ) +end + +--得到设置的牌字体 +function M:getCardItem(card_1, card_2) + if self._room.change_card_display ~= nil then + --printlog("===========",self._room.change_card_display) + return card_1 .. self._room.change_card_display .. card_2 + else + return card_1 .. '2_' .. card_2 + end +end +--得到设置的牌大小 +function M:getCardSize() + if self._room.change_card_size ~= nil then + return self._room.change_card_size + else + return 1 + end +end + +return M diff --git a/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/main/ZPProtocol.lua b/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/main/ZPProtocol.lua new file mode 100644 index 00000000..7c0b7ff3 --- /dev/null +++ b/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/main/ZPProtocol.lua @@ -0,0 +1,36 @@ +local Protocol = { + -- 通知服务器出牌 + GAME_DIS_CARD = "611", + -- 通知服务器提示选择行为 + GAME_ACTION = "612", + -- 通知服务器手牌队形改变 + GAME_CHANGE_CARD = "613", + -- 通知服务器牌字体改变 + GAME_CHANGE_TYPEfACE = "615", + + -- 发牌协议 + GAME_EVT_PLAYER_DEAL = "811", + -- 出牌事件 + GAME_EVT_DISCARD = "812", + -- 出牌提示事件 + GAME_EVT_DISCARD_TIP = "813", + -- 放子提示事件 + GAME_EVT_FZTIPS = "814", + -- action 事件 + GAME_EVT_ACTION = "815", + -- 胡牌事件 + GAME_EVT_HU = "816", + -- 结算 + GAME_EVT_RESULT1 = "817", + -- 弃牌 + GAME_EVT_QIPAI = "818", + -- 抓牌 + GAME_EVT_DRAW = "819", + -- 转盘指向事件 + GAME_EVT_CHANGE_ACTIVE_PLAYER = "820", + --第二十一张牌 + GAME_EVT_ADD_CARD = "821", + +} + +return Protocol \ No newline at end of file diff --git a/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/main/ZPSettingView.lua b/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/main/ZPSettingView.lua new file mode 100644 index 00000000..58080559 --- /dev/null +++ b/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/main/ZPSettingView.lua @@ -0,0 +1,336 @@ +local SettingView = require('Game.View.SettingView') +local ZPTableBG = import('.ZPTableBG') + +local ZPSettingView = { + -- 修改牌字体 + onEXMainCallback = nil, + -- 修改手牌大小 + onUpdataCardSizeCallback = nil, + -- 语音 + onEXVoiceCallback = nil, + -- 快速出牌 + onEXChuPaiCallback = nil, + -- 方言 + onEXFangYanCallback = nil +} +local M = ZPSettingView + +function ZPSettingView.new(blur_view, index, open_social,cardIndex) + setmetatable(SettingView, {__index = BaseWindow}) + setmetatable(M, {__index = SettingView}) + local self = setmetatable({}, {__index = M}) + self.class = 'ZPSettingView' + self._currenIndex = 0 + self._blur_view = blur_view + self.onCallback = event('onCallback', true) + self.stateIndex = 0 + self.cd_time = 0 + self._btn_dismiss_room_enable = false + self._close_destroy = true + self.bigSize = 1.2 + self.mediumSize = 1 + self.smallSize = 0.8 + self._full = true + self._anim_pop = 2 + self._open_social = open_social + self._cardType=cardIndex + self:init('ui://Main_RunBeard/New_SettingWindow') + return self +end + +function M:init(url) + SettingView.init(self, url) + if DataManager.CurrenRoom == nil then + return + end + self._view = self._view:GetChild('showview') + + local view = self._view + local slider_sound = view:GetChild('slider_sound') + local slider_music = view:GetChild('slider_music') + -- local btn_music = view:GetChild('btn_music') + -- local btn_sound = view:GetChild('btn_sound') + + -- btn_music.selected = (GameApplication.Instance.MusicValue < 5 and false or true) + slider_sound.value = GameApplication.Instance.SoundValue + slider_music.value = GameApplication.Instance.MusicValue + -- btn_sound.selected = GameApplication.Instance.SoundValue < 5 and false or true + + slider_music.onChanged:Add( + function() + GameApplication.Instance.MusicValue = slider_music.value + -- btn_music.selected = GameApplication.Instance.MusicValue < 5 and false or true + end + ) + + slider_sound.onChanged:Add( + function() + GameApplication.Instance.SoundValue = slider_sound.value + -- btn_sound.selected = GameApplication.Instance.SoundValue < 5 and false or true + end + ) + + local room = DataManager.CurrenRoom + local c1 = self._view:GetController('cards') + if self._cardType then + c1.selectedIndex = self._cardType + end + + local size = self._view:GetController('size') + if room.change_card_size ~= nil then + + if room.change_card_size == self.bigSize then + size.selectedIndex = 0 + elseif room.change_card_size == self.mediumSize then + size.selectedIndex = 1 + elseif room.change_card_size == self.smallSize then + size.selectedIndex = 2 + end + else + room.change_card_size = 0 + size.selectedIndex = 0 + end + printlog("room.change_card_display===>>>",room.change_card_display) + if room.change_card_display ~= nil then + local _str = string.sub(room.change_card_display, 1, 1) + local n = tonumber(_str) + if n == 1 then + c1.selectedIndex = 1 + elseif n == 2 then + c1.selectedIndex = 0 + elseif n == 8 then + c1.selectedIndex = 3 + else + c1.selectedIndex = 2 + end + end + if self._open_social then + self._view:GetChild('n78').visible = true + self._view:GetChild('n88').visible = true + self._view:GetChild('n57').visible = true + + local yuyin = self._view:GetController('yuyin') + local chupai = self._view:GetController('chupai') + local fangyan = self._view:GetController('fangyan') + local user_id = DataManager.SelfUser.account_id + local json_data = Utils.LoadLocalFile(user_id .. room.game_id .. 'yuyin') + local json_data1 = Utils.LoadLocalFile(user_id .. room.game_id .. 'chupai') + local json_data2 = Utils.LoadLocalFile(user_id .. room.game_id .. 'fangyan') + yuyin.selectedIndex = 1 + chupai.selectedIndex = 1 + room.yuyin_typeface = 1 + room.chupai_typeface = 1 + fangyan.selectedIndex = 1 + room.fangyan_typeface = 1 + if json_data ~= nil then + local _data = json.decode(json_data) + local typeface = _data['game_typeface'] + room.yuyin_typeface = typeface + end + if json_data1 ~= nil then + local _data = json.decode(json_data1) + local typeface = _data['game_typeface'] + room.chupai_typeface = typeface + end + if json_data2 ~= nil then + local _data = json.decode(json_data2) + local typeface = _data['game_typeface'] + room.fangyan_typeface = typeface + end + if room.yuyin_typeface ~= nil then + yuyin.selectedIndex = room.yuyin_typeface + end + if room.chupai_typeface ~= nil then + chupai.selectedIndex = room.chupai_typeface + end + if room.fangyan_typeface ~= nil then + fangyan.selectedIndex = room.fangyan_typeface + end + else + self._view:GetChild('n78').visible = false + self._view:GetChild('n88').visible = false + self._view:GetChild('n57').visible = false + end + + c1.onChanged:Set( + function() + if self.onEXMainCallback then + self.onEXMainCallback(c1.selectedIndex + 1) + end + --点击换牌按钮后保存当前游戏的牌字体 + local user_id = DataManager.SelfUser.account_id + local _data = {} + _data['game_typeface'] = c1.selectedIndex + 1 + local key = user_id .. room.game_id + Utils.SaveLocalFile(key, json.encode(_data)) + end + ) + + size.onChanged:Set( + function() + if self.onUpdataCardSizeCallback then + self.onUpdataCardSizeCallback(size.selectedIndex) + end + --点击换牌按钮后保存当前游戏的牌字体 + local user_id = DataManager.SelfUser.account_id + local _data = {} + _data['game_cardsize'] = size.selectedIndex + local key = user_id .. room.game_id .. 'cardsize_new' + Utils.SaveLocalFile(key, json.encode(_data)) + end + ) + if self._open_social then + self._view:GetChild('n78').visible = false + local yuyin = self._view:GetController('yuyin') + local chupai = self._view:GetController('chupai') + local fangyan = self._view:GetController('fangyan') + yuyin.onChanged:Set( + function() + if self.onEXVoiceCallback then + room.yuyin_typeface = yuyin.selectedIndex + self.onEXVoiceCallback(yuyin.selectedIndex) + end + --点击换牌按钮后保存当前游戏的牌字体 + local user_id = DataManager.SelfUser.account_id + local _data = {} + _data['game_typeface'] = yuyin.selectedIndex + local key = user_id .. room.game_id .. 'yuyin' + Utils.SaveLocalFile(key, json.encode(_data)) + end + ) + chupai.onChanged:Set( + function() + if self.onEXChuPaiCallback then + room.chupai_typeface = chupai.selectedIndex + self.onEXChuPaiCallback(chupai.selectedIndex) + end + --点击换牌按钮后保存当前游戏的牌字体 + local user_id = DataManager.SelfUser.account_id + local _data = {} + _data['game_typeface'] = chupai.selectedIndex + local key = user_id .. room.game_id .. 'chupai' + Utils.SaveLocalFile(key, json.encode(_data)) + end + ) + fangyan.onChanged:Set( + function() + if self.onEXFangYanCallback then + room.fangyan_typeface = fangyan.selectedIndex + self.onEXFangYanCallback(fangyan.selectedIndex) + end + --点击换牌按钮后保存当前游戏的牌字体 + local user_id = DataManager.SelfUser.account_id + local _data = {} + _data['game_typeface'] = fangyan.selectedIndex + local key = user_id .. room.game_id .. 'fangyan' + Utils.SaveLocalFile(key, json.encode(_data)) + end + ) + else + self._view:GetChild('n78').visible = false + end +end + +function M:Show() + SettingView.Show(self) + self:UpdateIndex() + self:UpdateCardSizeIndex() +end +--根据存的数据改变设置里面的控制器 + +function M:UpdateIndex() + local room = DataManager.CurrenRoom + local c1 = self._view:GetController('cards') + if room.change_card_display ~= nil then + local _str = string.sub(room.change_card_display, 1, 1) + local n = tonumber(_str) + if n == 7 then + n = 2 + end + if n == 1 then + c1.selectedIndex = 1 + elseif n == 2 then + c1.selectedIndex = 0 + elseif n == 8 then + c1.selectedIndex = 3 + else + c1.selectedIndex = 2 + end + end +end +function M:UpdateCardSizeIndex() + local room = DataManager.CurrenRoom + local size = self._view:GetController('size') + if room.change_card_size ~= nil then + if room.change_card_size == self.bigSize then + size.selectedIndex = 0 + elseif room.change_card_size == self.mediumSize then + size.selectedIndex = 1 + elseif room.change_card_size == self.smallSize then + size.selectedIndex = 2 + end + else + size.selectedIndex = 0 + end +end + +function M:SetBtnUpdateCardEnable(enable) + self._view:GetChild('n37').enabled = enable + self._view:GetChild('n38').enabled = enable + self._view:GetChild('n49').enabled = enable +end + +function M:FillBgSection(cb, game_id, default_bg, room, qihu) + if (default_bg == nil) then + default_bg = 1 + end + local view = self._view + local lst_bg = view:GetChild('lst_bg') + local ctr_bg = view:GetController('bg') + for i = 1, #bg_config_zipai do + local config = bg_config_zipai[i] + local item = lst_bg:AddItemFromPool() + item.icon = config.thumb + if i > 3 then + ctr_bg:AddPage(i - 1) + end + item.onClick:Add( + function() + cb(config.url) + ctr_bg.selectedIndex = i - 1 + if qihu ~= nil then + -- self._blur_view:GetChild('di_text').text = room.room_config:GetGameName() .. ' ' .. qihu .. '胡息起' + self._blur_view:GetController('bg_state').selectedIndex = i - 1 + end + end + ) + end + self._game_id = game_id + self._bg = ZPTableBG.GetTableBG(game_id) + local index = 0 + if self._bg > 0 then + lst_bg.selectedIndex = self._bg - 1 + index = lst_bg.selectedIndex + else + ctr_bg.selectedIndex = default_bg - 1 + index = ctr_bg.selectedIndex + end + if qihu ~= nil then + -- self._blur_view:GetChild('di_text').text = room.room_config:GetGameName() .. ' ' .. qihu .. '胡息起' + if index < 3 then + self._blur_view:GetController('bg_state').selectedIndex = index + else + self._blur_view:GetController('bg_state').selectedIndex = 0 + end + end +end +function M:Destroy() + local bg_id = self._view:GetController('bg').selectedIndex + 1 + if self._bg ~= bg_id then + self._bg = bg_id + ZPTableBG.SaveTableBG(self._game_id, self._bg) + end + SettingView.Destroy(self) +end + +return M diff --git a/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/main/ZPTableBG.lua b/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/main/ZPTableBG.lua new file mode 100644 index 00000000..e11083ee --- /dev/null +++ b/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/main/ZPTableBG.lua @@ -0,0 +1,84 @@ +-- 记录各游戏的桌面背景 +json = require 'cjson' + +local ZPTableBG = {} + +local M = ZPTableBG + bg_config_zipai = { + {id = 1, url = "base/main_zipai/bg/bg_1", thumb = "ui://Main_RunBeard/table_bg1"}, + {id = 2, url = "base/main_zipai/bg/bg_2", thumb = "ui://Main_RunBeard/table_bg2"}, + {id = 3, url = "base/main_zipai/bg/bg_3", thumb = "ui://Main_RunBeard/table_bg3"}, + -- {id = 4, url = "base/main_zipai/bg/bg_gold", thumb = "ui://Main_RunBeard/table_bg3"}, + -- {id = 5, url = "base/main_zipai/bg/bg8", thumb = "ui://Main_RunBeard/table_bg1"}, + -- {id = 6, url = "base/tablebg/bg/bg1", thumb = "ui://Common/b04"}, +} + +local function GetBG(data, game_id) + local bg_id = 0 + for i = 1, #data do + if data[i].game_id == game_id then + bg_id = data[i].bg_id + break + end + end + return bg_id +end +local function SetBG(data, game_id, bg_id) + local contain_key = false + for i = 1, #data do + if data[i].game_id == game_id then + contain_key = true + if data[i].bg_id ~= bg_id then + data[i].bg_id = bg_id + break + end + end + end + if not contain_key then + local _data = {} + _data.game_id = game_id + _data.bg_id = bg_id + table.insert(data, _data) + end +end + +function ZPTableBG.GetTableBG(game_id) + local id = -1 + local json_data = Utils.LoadLocalFile(DataManager.SelfUser.account_id .. DataManager.SelfUser.invite_code) + if json_data ~= nil then + local config_data = json.decode(json_data) + id = GetBG(config_data, game_id) + end + return id +end + +function ZPTableBG.LoadTableBG(id, game_id, main_view) + local bg_id = M.GetTableBG(game_id) + local index + if bg_id > 0 then + index = bg_id + else + index = id + end + + if index>3 then + -- body + index=1 + end + local url = bg_config_zipai[index].url + LoadGameBg(url, main_view) +end + +function ZPTableBG.SaveTableBG(game_id, bg_id) + local config_data + local json_data = Utils.LoadLocalFile(DataManager.SelfUser.account_id .. DataManager.SelfUser.invite_code) + if json_data ~= nil then + config_data = json.decode(json_data) + else + config_data = {} + end + SetBG(config_data, game_id, bg_id) + Utils.SaveLocalFile(DataManager.SelfUser.account_id .. DataManager.SelfUser.invite_code, json.encode(config_data)) +end + +return M \ No newline at end of file diff --git a/wb_new_ui/.objs/metas/v6yvqp7w/f55qvx.info b/wb_new_ui/.objs/metas/v6yvqp7w/f55qvx.info index 3d14a8aa..22178475 100644 --- a/wb_new_ui/.objs/metas/v6yvqp7w/f55qvx.info +++ b/wb_new_ui/.objs/metas/v6yvqp7w/f55qvx.info @@ -1,8 +1,3 @@ { - "objectStatus": { - "n45_j34t": { - "collapsed": true - } - }, "fitScreen": "FitSize" } \ No newline at end of file diff --git a/wb_new_ui/.objs/metas/v6yvqp7w/f55qwa.info b/wb_new_ui/.objs/metas/v6yvqp7w/f55qwa.info index 47888bd8..c0ce1590 100644 --- a/wb_new_ui/.objs/metas/v6yvqp7w/f55qwa.info +++ b/wb_new_ui/.objs/metas/v6yvqp7w/f55qwa.info @@ -1,8 +1,18 @@ { "objectStatus": { + "n36_k3io": { + "collapsed": true + }, "n34_k3io": { "hidden": true }, + "n163_o49p": { + "hidden": true, + "collapsed": true + }, + "n154_r1mo": { + "collapsed": true + }, "n150_8th3": { "collapsed": true }, @@ -11,10 +21,6 @@ }, "n35_k3io": { "hidden": true - }, - "n163_o49p": { - "hidden": true, - "collapsed": true } }, "adaptiveTest": true, diff --git a/wb_new_ui/.objs/workspace.json b/wb_new_ui/.objs/workspace.json index a0172881..c1edec0a 100644 --- a/wb_new_ui/.objs/workspace.json +++ b/wb_new_ui/.objs/workspace.json @@ -1,5 +1,5 @@ { - "libview.firstColumnWidth": 522, + "libview.firstColumnWidth": 297, "expanded_nodes": [ "27vd145b", "/", @@ -10,22 +10,41 @@ "doc.openedDocs": [ "ui://m7iejg4610snh5j", "ui://2d9xdj6zfn7fao", + "ui://2d9xdj6zker3jg", "ui://m7iejg46hsbhhjn", + "ui://v6yvqp7wf55qvt", + "ui://v6yvqp7wf55qwa", + "ui://v6yvqp7wf55qvx", + "ui://v6yvqp7wf55qw4", + "ui://v6yvqp7w99we1h1", + "ui://v6yvqp7wf55qw5", "ui://m7iejg46r0qx7i6v" ], "packageGroup.mine": [], "test.device": "720p Phone", "canvasColor": 10066329, "auxline2": true, - "doc.activeDoc": "ui://m7iejg46r0qx7i6v", + "doc.activeDoc": "ui://v6yvqp7wf55qwa", "libview.twoColumn": false, "libview.expandedNodes": [ - "m7iejg46", + "ppu1wv76", "/", - "m7iejg46", - "/images/", - "m7iejg46", - "/images/bxx/" + "ppu1wv76", + "/component/", + "ppu1wv76", + "/component/Main/", + "v6yvqp7w", + "/", + "v6yvqp7w", + "/component/", + "v6yvqp7w", + "/component/Main/", + "v6yvqp7w", + "/component/Main/component/", + "v6yvqp7w", + "/component/Main/images/", + "v6yvqp7w", + "/component/niao/" ], "auxline1": true, "snapToGrid": true, diff --git a/wb_new_ui/assets/Lobby/package.xml b/wb_new_ui/assets/Lobby/package.xml index 192b02e9..1ff8fcc8 100644 --- a/wb_new_ui/assets/Lobby/package.xml +++ b/wb_new_ui/assets/Lobby/package.xml @@ -410,6 +410,9 @@ + + + diff --git a/wb_new_ui/assets/Main_RunBeard/component/Main/Main_2.xml b/wb_new_ui/assets/Main_RunBeard/component/Main/Main_2.xml index 14cab067..190eb2c0 100644 --- a/wb_new_ui/assets/Main_RunBeard/component/Main/Main_2.xml +++ b/wb_new_ui/assets/Main_RunBeard/component/Main/Main_2.xml @@ -3,7 +3,7 @@ - + @@ -73,25 +73,25 @@ - + - - - - + + + + - + - + - + - + @@ -128,7 +128,7 @@ - + diff --git a/wb_new_ui/assets/Main_RunBeard/component/Main/component/PlayerHead_1.xml b/wb_new_ui/assets/Main_RunBeard/component/Main/component/PlayerHead_1.xml index 6557165c..fa07d0f9 100644 --- a/wb_new_ui/assets/Main_RunBeard/component/Main/component/PlayerHead_1.xml +++ b/wb_new_ui/assets/Main_RunBeard/component/Main/component/PlayerHead_1.xml @@ -7,16 +7,17 @@ - + - + - + + - + @@ -24,7 +25,7 @@ - + @@ -42,14 +43,14 @@ - + - + @@ -62,10 +63,10 @@ - - - - + + + + @@ -74,7 +75,7 @@ - + @@ -90,16 +91,24 @@ - + - - - - + + + + - + + + + + + + + + \ No newline at end of file diff --git a/wb_new_ui/assets/Main_RunBeard/component/Main/component/PlayerHead_2.xml b/wb_new_ui/assets/Main_RunBeard/component/Main/component/PlayerHead_2.xml index ae08f2df..bac776fd 100644 --- a/wb_new_ui/assets/Main_RunBeard/component/Main/component/PlayerHead_2.xml +++ b/wb_new_ui/assets/Main_RunBeard/component/Main/component/PlayerHead_2.xml @@ -8,14 +8,15 @@ - + - + + - + @@ -29,7 +30,7 @@ - + @@ -38,7 +39,7 @@ - + @@ -54,10 +55,10 @@ - + - + @@ -79,13 +80,13 @@ - + - + - + @@ -100,6 +101,13 @@ + + + + + + + \ No newline at end of file diff --git a/wb_new_ui/assets/Main_RunBeard/component/Main/component/Player_card_info_1.xml b/wb_new_ui/assets/Main_RunBeard/component/Main/component/Player_card_info_1.xml index e0571c30..b4b0d89c 100644 --- a/wb_new_ui/assets/Main_RunBeard/component/Main/component/Player_card_info_1.xml +++ b/wb_new_ui/assets/Main_RunBeard/component/Main/component/Player_card_info_1.xml @@ -55,7 +55,7 @@ - + diff --git a/wb_new_ui/assets/Main_RunBeard/component/Main/component/Player_card_info_1_1.xml b/wb_new_ui/assets/Main_RunBeard/component/Main/component/Player_card_info_1_1.xml deleted file mode 100644 index 78835911..00000000 --- a/wb_new_ui/assets/Main_RunBeard/component/Main/component/Player_card_info_1_1.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/wb_new_ui/assets/Main_RunBeard/component/Main/component/Player_card_info_3_1.xml b/wb_new_ui/assets/Main_RunBeard/component/Main/component/Player_card_info_3_1.xml deleted file mode 100644 index 85030d8e..00000000 --- a/wb_new_ui/assets/Main_RunBeard/component/Main/component/Player_card_info_3_1.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/wb_new_ui/assets/Main_RunBeard/package.xml b/wb_new_ui/assets/Main_RunBeard/package.xml index efdc4345..655f97fd 100644 --- a/wb_new_ui/assets/Main_RunBeard/package.xml +++ b/wb_new_ui/assets/Main_RunBeard/package.xml @@ -650,8 +650,6 @@ - - @@ -853,8 +851,8 @@ - - + + \ No newline at end of file diff --git a/wb_unity_pro_2/Assets/ART/base/common/ui/Common_atlas0.png b/wb_unity_pro_2/Assets/ART/base/common/ui/Common_atlas0.png index 18571608..7d15ac13 100644 Binary files a/wb_unity_pro_2/Assets/ART/base/common/ui/Common_atlas0.png and b/wb_unity_pro_2/Assets/ART/base/common/ui/Common_atlas0.png differ diff --git a/wb_unity_pro_2/Assets/ART/base/common/ui/Common_atlas0_1.png b/wb_unity_pro_2/Assets/ART/base/common/ui/Common_atlas0_1.png index 452b6700..9d6e437f 100644 Binary files a/wb_unity_pro_2/Assets/ART/base/common/ui/Common_atlas0_1.png and b/wb_unity_pro_2/Assets/ART/base/common/ui/Common_atlas0_1.png differ diff --git a/wb_unity_pro_2/Assets/ART/base/common/ui/Common_atlas0_10.png b/wb_unity_pro_2/Assets/ART/base/common/ui/Common_atlas0_10.png index b2d3211c..f00d162d 100644 Binary files a/wb_unity_pro_2/Assets/ART/base/common/ui/Common_atlas0_10.png and b/wb_unity_pro_2/Assets/ART/base/common/ui/Common_atlas0_10.png differ diff --git a/wb_unity_pro_2/Assets/ART/base/common/ui/Common_atlas0_11.png b/wb_unity_pro_2/Assets/ART/base/common/ui/Common_atlas0_11.png index ba5e502b..fdc0c1be 100644 Binary files a/wb_unity_pro_2/Assets/ART/base/common/ui/Common_atlas0_11.png and b/wb_unity_pro_2/Assets/ART/base/common/ui/Common_atlas0_11.png differ diff --git a/wb_unity_pro_2/Assets/ART/base/common/ui/Common_atlas0_12.png b/wb_unity_pro_2/Assets/ART/base/common/ui/Common_atlas0_12.png index 8133fb61..c0aa9240 100644 Binary files a/wb_unity_pro_2/Assets/ART/base/common/ui/Common_atlas0_12.png and b/wb_unity_pro_2/Assets/ART/base/common/ui/Common_atlas0_12.png differ diff --git a/wb_unity_pro_2/Assets/ART/base/common/ui/Common_atlas0_13.png b/wb_unity_pro_2/Assets/ART/base/common/ui/Common_atlas0_13.png index 6d2c7e86..68f8ac05 100644 Binary files a/wb_unity_pro_2/Assets/ART/base/common/ui/Common_atlas0_13.png and b/wb_unity_pro_2/Assets/ART/base/common/ui/Common_atlas0_13.png differ diff --git a/wb_unity_pro_2/Assets/ART/base/common/ui/Common_atlas0_2.png b/wb_unity_pro_2/Assets/ART/base/common/ui/Common_atlas0_2.png index 6bf2b388..a119d987 100644 Binary files a/wb_unity_pro_2/Assets/ART/base/common/ui/Common_atlas0_2.png and b/wb_unity_pro_2/Assets/ART/base/common/ui/Common_atlas0_2.png differ diff --git a/wb_unity_pro_2/Assets/ART/base/common/ui/Common_atlas0_3.png b/wb_unity_pro_2/Assets/ART/base/common/ui/Common_atlas0_3.png index b14983f9..8170f3b2 100644 Binary files a/wb_unity_pro_2/Assets/ART/base/common/ui/Common_atlas0_3.png and b/wb_unity_pro_2/Assets/ART/base/common/ui/Common_atlas0_3.png differ diff --git a/wb_unity_pro_2/Assets/ART/base/common/ui/Common_atlas0_4.png b/wb_unity_pro_2/Assets/ART/base/common/ui/Common_atlas0_4.png index 8170f3b2..210ee9b2 100644 Binary files a/wb_unity_pro_2/Assets/ART/base/common/ui/Common_atlas0_4.png and b/wb_unity_pro_2/Assets/ART/base/common/ui/Common_atlas0_4.png differ diff --git a/wb_unity_pro_2/Assets/ART/base/common/ui/Common_atlas0_5.png b/wb_unity_pro_2/Assets/ART/base/common/ui/Common_atlas0_5.png index de797677..0602d1c0 100644 Binary files a/wb_unity_pro_2/Assets/ART/base/common/ui/Common_atlas0_5.png and b/wb_unity_pro_2/Assets/ART/base/common/ui/Common_atlas0_5.png differ diff --git a/wb_unity_pro_2/Assets/ART/base/common/ui/Common_atlas0_6.png b/wb_unity_pro_2/Assets/ART/base/common/ui/Common_atlas0_6.png index 0602d1c0..4a632fc7 100644 Binary files a/wb_unity_pro_2/Assets/ART/base/common/ui/Common_atlas0_6.png and b/wb_unity_pro_2/Assets/ART/base/common/ui/Common_atlas0_6.png differ diff --git a/wb_unity_pro_2/Assets/ART/base/common/ui/Common_atlas0_7.png b/wb_unity_pro_2/Assets/ART/base/common/ui/Common_atlas0_7.png index 4a632fc7..e3a18e00 100644 Binary files a/wb_unity_pro_2/Assets/ART/base/common/ui/Common_atlas0_7.png and b/wb_unity_pro_2/Assets/ART/base/common/ui/Common_atlas0_7.png differ diff --git a/wb_unity_pro_2/Assets/ART/base/common/ui/Common_atlas0_8.png b/wb_unity_pro_2/Assets/ART/base/common/ui/Common_atlas0_8.png index 7a06ed3c..1fe24d6f 100644 Binary files a/wb_unity_pro_2/Assets/ART/base/common/ui/Common_atlas0_8.png and b/wb_unity_pro_2/Assets/ART/base/common/ui/Common_atlas0_8.png differ diff --git a/wb_unity_pro_2/Assets/ART/base/common/ui/Common_atlas0_9.png b/wb_unity_pro_2/Assets/ART/base/common/ui/Common_atlas0_9.png index ac527387..456bae39 100644 Binary files a/wb_unity_pro_2/Assets/ART/base/common/ui/Common_atlas0_9.png and b/wb_unity_pro_2/Assets/ART/base/common/ui/Common_atlas0_9.png differ diff --git a/wb_unity_pro_2/Assets/ART/base/common/ui/Common_fui.bytes b/wb_unity_pro_2/Assets/ART/base/common/ui/Common_fui.bytes index 4f20af1f..1973767f 100644 Binary files a/wb_unity_pro_2/Assets/ART/base/common/ui/Common_fui.bytes and b/wb_unity_pro_2/Assets/ART/base/common/ui/Common_fui.bytes differ diff --git a/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas0.png b/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas0.png index 809abcf4..5bfba8f2 100644 Binary files a/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas0.png and b/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas0.png differ diff --git a/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas0_1.png b/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas0_1.png index f0cdc0b2..1a3d6cc8 100644 Binary files a/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas0_1.png and b/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas0_1.png differ diff --git a/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas0_1.png.meta b/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas0_1.png.meta index a874586d..9d53a9d8 100644 --- a/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas0_1.png.meta +++ b/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas0_1.png.meta @@ -1,12 +1,12 @@ fileFormatVersion: 2 -guid: ea6888f59d45c5a4abf3af733fde63a1 +guid: 8395dc5e9c4802c45b0da68db8cd10e4 TextureImporter: internalIDToNameTable: [] externalObjects: {} serializedVersion: 11 mipmaps: mipMapMode: 0 - enableMipMap: 0 + enableMipMap: 1 sRGBTexture: 1 linearTexture: 0 fadeOut: 0 @@ -57,68 +57,20 @@ TextureImporter: maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 - applyGammaDecoding: 1 + applyGammaDecoding: 0 platformSettings: - serializedVersion: 3 buildTarget: DefaultTexturePlatform maxTextureSize: 2048 resizeAlgorithm: 0 textureFormat: -1 - textureCompression: 2 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - androidETC2FallbackOverride: 0 - forceMaximumCompressionQuality_BC6H_BC7: 1 - - serializedVersion: 3 - buildTarget: Standalone - maxTextureSize: 2048 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 2 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - androidETC2FallbackOverride: 0 - forceMaximumCompressionQuality_BC6H_BC7: 1 - - serializedVersion: 3 - buildTarget: iPhone - maxTextureSize: 2048 - resizeAlgorithm: 0 - textureFormat: 4 textureCompression: 1 compressionQuality: 50 crunchedCompression: 0 allowsAlphaSplitting: 0 - overridden: 1 - androidETC2FallbackOverride: 0 - forceMaximumCompressionQuality_BC6H_BC7: 1 - - serializedVersion: 3 - buildTarget: Android - maxTextureSize: 2048 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 2 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 overridden: 0 androidETC2FallbackOverride: 0 - forceMaximumCompressionQuality_BC6H_BC7: 1 - - serializedVersion: 3 - buildTarget: Windows Store Apps - maxTextureSize: 2048 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 2 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - androidETC2FallbackOverride: 0 - forceMaximumCompressionQuality_BC6H_BC7: 1 + forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 sprites: [] diff --git a/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas0_2.png b/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas0_2.png new file mode 100644 index 00000000..c460a328 Binary files /dev/null and b/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas0_2.png differ diff --git a/wb_unity_pro_2/Assets/ART/base/main_majiang/bg/bg1_bak.png.meta b/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas0_2.png.meta similarity index 94% rename from wb_unity_pro_2/Assets/ART/base/main_majiang/bg/bg1_bak.png.meta rename to wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas0_2.png.meta index 0c6f1387..f104713c 100644 --- a/wb_unity_pro_2/Assets/ART/base/main_majiang/bg/bg1_bak.png.meta +++ b/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas0_2.png.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: f310028a1728c6149b92bf48333f2575 +guid: 29e6b1868cbd5c548b21f35c6e554639 TextureImporter: internalIDToNameTable: [] externalObjects: {} @@ -88,5 +88,5 @@ TextureImporter: pSDRemoveMatte: 0 pSDShowRemoveMatteOption: 0 userData: - assetBundleName: base/main_majiang/0fdb386eb39db9d2ad7506202c0fb797 + assetBundleName: base/lobby/4a425335ab0e1c246f741e6da62b244f assetBundleVariant: diff --git a/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas0_3.png b/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas0_3.png new file mode 100644 index 00000000..370048a3 Binary files /dev/null and b/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas0_3.png differ diff --git a/wb_unity_pro_2/Assets/ART/base/main_zipaimajiang/bg/bg_1_bak (2).png.meta b/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas0_3.png.meta similarity index 94% rename from wb_unity_pro_2/Assets/ART/base/main_zipaimajiang/bg/bg_1_bak (2).png.meta rename to wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas0_3.png.meta index 89856456..5452cb8c 100644 --- a/wb_unity_pro_2/Assets/ART/base/main_zipaimajiang/bg/bg_1_bak (2).png.meta +++ b/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas0_3.png.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 91da37e8e8899c44b90c0db77fe276b5 +guid: 6a005157276da5046a0de4d317f5ef8d TextureImporter: internalIDToNameTable: [] externalObjects: {} @@ -88,5 +88,5 @@ TextureImporter: pSDRemoveMatte: 0 pSDShowRemoveMatteOption: 0 userData: - assetBundleName: base/main_zipaimajiang/ef0594aacc01364a973af9643e09d3d3 + assetBundleName: base/lobby/4a425335ab0e1c246f741e6da62b244f assetBundleVariant: diff --git a/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas10.png b/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas10.png new file mode 100644 index 00000000..e15a9f8d Binary files /dev/null and b/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas10.png differ diff --git a/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas10.png.meta b/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas10.png.meta new file mode 100644 index 00000000..13c6819b --- /dev/null +++ b/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas10.png.meta @@ -0,0 +1,92 @@ +fileFormatVersion: 2 +guid: cad84ae4a17cb6140a910433f4c0f95e +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -100 + wrapU: -1 + wrapV: -1 + wrapW: -1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas10_1.png b/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas10_1.png new file mode 100644 index 00000000..2a9aa6db Binary files /dev/null and b/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas10_1.png differ diff --git a/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas10_1.png.meta b/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas10_1.png.meta new file mode 100644 index 00000000..9e8920c0 --- /dev/null +++ b/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas10_1.png.meta @@ -0,0 +1,92 @@ +fileFormatVersion: 2 +guid: 84f12a0f6b1b0f342ae38dc1551a615d +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -100 + wrapU: -1 + wrapV: -1 + wrapW: -1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas10_10.png b/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas10_10.png new file mode 100644 index 00000000..567f40ab Binary files /dev/null and b/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas10_10.png differ diff --git a/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas10_10.png.meta b/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas10_10.png.meta new file mode 100644 index 00000000..5940f741 --- /dev/null +++ b/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas10_10.png.meta @@ -0,0 +1,92 @@ +fileFormatVersion: 2 +guid: c056ed0fe1ecaaa4f8271726a4b5347d +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -100 + wrapU: -1 + wrapV: -1 + wrapW: -1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas10_11.png b/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas10_11.png new file mode 100644 index 00000000..9529a99e Binary files /dev/null and b/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas10_11.png differ diff --git a/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas10_11.png.meta b/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas10_11.png.meta new file mode 100644 index 00000000..5eda83cd --- /dev/null +++ b/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas10_11.png.meta @@ -0,0 +1,92 @@ +fileFormatVersion: 2 +guid: 6eca3583b33e5e94392a353cc9dbf211 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -100 + wrapU: -1 + wrapV: -1 + wrapW: -1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas10_2.png b/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas10_2.png new file mode 100644 index 00000000..91565285 Binary files /dev/null and b/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas10_2.png differ diff --git a/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas10_2.png.meta b/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas10_2.png.meta new file mode 100644 index 00000000..86ffeafa --- /dev/null +++ b/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas10_2.png.meta @@ -0,0 +1,92 @@ +fileFormatVersion: 2 +guid: 6a9468bb1727d4a4b90a3edb1101156d +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -100 + wrapU: -1 + wrapV: -1 + wrapW: -1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas10_3.png b/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas10_3.png new file mode 100644 index 00000000..cc96d86a Binary files /dev/null and b/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas10_3.png differ diff --git a/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas10_3.png.meta b/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas10_3.png.meta new file mode 100644 index 00000000..fcc9c425 --- /dev/null +++ b/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas10_3.png.meta @@ -0,0 +1,92 @@ +fileFormatVersion: 2 +guid: 0d0672a8c0aacdf47ac7def3cdccf176 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -100 + wrapU: -1 + wrapV: -1 + wrapW: -1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas10_4.png b/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas10_4.png new file mode 100644 index 00000000..9d95bc10 Binary files /dev/null and b/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas10_4.png differ diff --git a/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas10_4.png.meta b/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas10_4.png.meta new file mode 100644 index 00000000..51307e34 --- /dev/null +++ b/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas10_4.png.meta @@ -0,0 +1,92 @@ +fileFormatVersion: 2 +guid: db567c3e73021554e92661527e078385 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -100 + wrapU: -1 + wrapV: -1 + wrapW: -1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas10_5.png b/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas10_5.png new file mode 100644 index 00000000..f302c5b8 Binary files /dev/null and b/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas10_5.png differ diff --git a/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas10_5.png.meta b/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas10_5.png.meta new file mode 100644 index 00000000..6521a0aa --- /dev/null +++ b/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas10_5.png.meta @@ -0,0 +1,92 @@ +fileFormatVersion: 2 +guid: abbccf47d80fccb4d9103fbcf8977081 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -100 + wrapU: -1 + wrapV: -1 + wrapW: -1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas10_6.png b/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas10_6.png new file mode 100644 index 00000000..00b9e4c1 Binary files /dev/null and b/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas10_6.png differ diff --git a/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas10_6.png.meta b/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas10_6.png.meta new file mode 100644 index 00000000..6f20af85 --- /dev/null +++ b/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas10_6.png.meta @@ -0,0 +1,92 @@ +fileFormatVersion: 2 +guid: b780d7a5f12634747b0d611d75256be9 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -100 + wrapU: -1 + wrapV: -1 + wrapW: -1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas10_7.png b/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas10_7.png new file mode 100644 index 00000000..4f0a02b4 Binary files /dev/null and b/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas10_7.png differ diff --git a/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas10_7.png.meta b/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas10_7.png.meta new file mode 100644 index 00000000..2867accc --- /dev/null +++ b/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas10_7.png.meta @@ -0,0 +1,92 @@ +fileFormatVersion: 2 +guid: 6c7fee5037557e546bad14aa849ea35d +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -100 + wrapU: -1 + wrapV: -1 + wrapW: -1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas10_8.png b/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas10_8.png new file mode 100644 index 00000000..cb4bb88c Binary files /dev/null and b/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas10_8.png differ diff --git a/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas10_8.png.meta b/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas10_8.png.meta new file mode 100644 index 00000000..18f03018 --- /dev/null +++ b/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas10_8.png.meta @@ -0,0 +1,92 @@ +fileFormatVersion: 2 +guid: aa8b7613270bbdc498ea1db151294d3d +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -100 + wrapU: -1 + wrapV: -1 + wrapW: -1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas10_9.png b/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas10_9.png new file mode 100644 index 00000000..261751bc Binary files /dev/null and b/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas10_9.png differ diff --git a/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas10_9.png.meta b/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas10_9.png.meta new file mode 100644 index 00000000..c3cb8423 --- /dev/null +++ b/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_atlas10_9.png.meta @@ -0,0 +1,92 @@ +fileFormatVersion: 2 +guid: bb21421b5697b50408d07835c195f38c +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -100 + wrapU: -1 + wrapV: -1 + wrapW: -1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_fui.bytes b/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_fui.bytes index 0bcfa5ba..63663623 100644 Binary files a/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_fui.bytes and b/wb_unity_pro_2/Assets/ART/base/lobby/ui/Lobby_fui.bytes differ diff --git a/wb_unity_pro_2/Assets/ART/base/main_majiang/bg/bg1.png b/wb_unity_pro_2/Assets/ART/base/main_majiang/bg/bg1.png index 73c171be..45c8a384 100644 Binary files a/wb_unity_pro_2/Assets/ART/base/main_majiang/bg/bg1.png and b/wb_unity_pro_2/Assets/ART/base/main_majiang/bg/bg1.png differ diff --git a/wb_unity_pro_2/Assets/ART/base/main_majiang/bg/bg1_bak.png b/wb_unity_pro_2/Assets/ART/base/main_majiang/bg/bg1_bak.png deleted file mode 100644 index 49377423..00000000 Binary files a/wb_unity_pro_2/Assets/ART/base/main_majiang/bg/bg1_bak.png and /dev/null differ diff --git a/wb_unity_pro_2/Assets/ART/base/main_majiang/bg/bg2.png b/wb_unity_pro_2/Assets/ART/base/main_majiang/bg/bg2.png index 6ee9829e..45c8a384 100644 Binary files a/wb_unity_pro_2/Assets/ART/base/main_majiang/bg/bg2.png and b/wb_unity_pro_2/Assets/ART/base/main_majiang/bg/bg2.png differ diff --git a/wb_unity_pro_2/Assets/ART/base/main_majiang/bg/bg3.png b/wb_unity_pro_2/Assets/ART/base/main_majiang/bg/bg3.png index 6331a5b0..45c8a384 100644 Binary files a/wb_unity_pro_2/Assets/ART/base/main_majiang/bg/bg3.png and b/wb_unity_pro_2/Assets/ART/base/main_majiang/bg/bg3.png differ diff --git a/wb_unity_pro_2/Assets/ART/base/main_majiang/ui/Main_Majiang_atlas0_1.png.meta b/wb_unity_pro_2/Assets/ART/base/main_majiang/ui/Main_Majiang_atlas0_1.png.meta index 95de65f3..872d4b44 100644 --- a/wb_unity_pro_2/Assets/ART/base/main_majiang/ui/Main_Majiang_atlas0_1.png.meta +++ b/wb_unity_pro_2/Assets/ART/base/main_majiang/ui/Main_Majiang_atlas0_1.png.meta @@ -1,12 +1,12 @@ fileFormatVersion: 2 -guid: 7e113dd17f83db54cb58e1c5259b21dc +guid: 431f7e2d464ddc942ad915022cabcefd TextureImporter: internalIDToNameTable: [] externalObjects: {} serializedVersion: 11 mipmaps: mipMapMode: 0 - enableMipMap: 1 + enableMipMap: 0 sRGBTexture: 1 linearTexture: 0 fadeOut: 0 @@ -57,20 +57,68 @@ TextureImporter: maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 - applyGammaDecoding: 0 + applyGammaDecoding: 1 platformSettings: - serializedVersion: 3 buildTarget: DefaultTexturePlatform maxTextureSize: 2048 resizeAlgorithm: 0 textureFormat: -1 - textureCompression: 1 + textureCompression: 2 compressionQuality: 50 crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 androidETC2FallbackOverride: 0 - forceMaximumCompressionQuality_BC6H_BC7: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 2 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: 4 + textureCompression: 2 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 1 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 2 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + - serializedVersion: 3 + buildTarget: Windows Store Apps + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 2 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 spriteSheet: serializedVersion: 2 sprites: [] diff --git a/wb_unity_pro_2/Assets/ART/base/main_majiang/ui/Main_Majiang_atlas0_2.png.meta b/wb_unity_pro_2/Assets/ART/base/main_majiang/ui/Main_Majiang_atlas0_2.png.meta index ac7ad44b..c557cd37 100644 --- a/wb_unity_pro_2/Assets/ART/base/main_majiang/ui/Main_Majiang_atlas0_2.png.meta +++ b/wb_unity_pro_2/Assets/ART/base/main_majiang/ui/Main_Majiang_atlas0_2.png.meta @@ -1,12 +1,12 @@ fileFormatVersion: 2 -guid: 09c53ef273006524b8ce84d2151871c5 +guid: 7055831bde7c93045aa6190395e4773b TextureImporter: internalIDToNameTable: [] externalObjects: {} serializedVersion: 11 mipmaps: mipMapMode: 0 - enableMipMap: 1 + enableMipMap: 0 sRGBTexture: 1 linearTexture: 0 fadeOut: 0 @@ -57,20 +57,68 @@ TextureImporter: maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 - applyGammaDecoding: 0 + applyGammaDecoding: 1 platformSettings: - serializedVersion: 3 buildTarget: DefaultTexturePlatform maxTextureSize: 2048 resizeAlgorithm: 0 textureFormat: -1 - textureCompression: 1 + textureCompression: 2 compressionQuality: 50 crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 androidETC2FallbackOverride: 0 - forceMaximumCompressionQuality_BC6H_BC7: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 2 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: 4 + textureCompression: 2 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 1 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 2 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + - serializedVersion: 3 + buildTarget: Windows Store Apps + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 2 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 spriteSheet: serializedVersion: 2 sprites: [] diff --git a/wb_unity_pro_2/Assets/ART/base/main_majiang/ui/Main_Majiang_atlas0_3.png.meta b/wb_unity_pro_2/Assets/ART/base/main_majiang/ui/Main_Majiang_atlas0_3.png.meta index e406357a..53114a90 100644 --- a/wb_unity_pro_2/Assets/ART/base/main_majiang/ui/Main_Majiang_atlas0_3.png.meta +++ b/wb_unity_pro_2/Assets/ART/base/main_majiang/ui/Main_Majiang_atlas0_3.png.meta @@ -1,12 +1,12 @@ fileFormatVersion: 2 -guid: 03573dbd9e1239340bb752956dcf1c11 +guid: 24ee6d91cbcc3b342a2ef13543161f2b TextureImporter: internalIDToNameTable: [] externalObjects: {} serializedVersion: 11 mipmaps: mipMapMode: 0 - enableMipMap: 1 + enableMipMap: 0 sRGBTexture: 1 linearTexture: 0 fadeOut: 0 @@ -57,20 +57,68 @@ TextureImporter: maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 - applyGammaDecoding: 0 + applyGammaDecoding: 1 platformSettings: - serializedVersion: 3 buildTarget: DefaultTexturePlatform maxTextureSize: 2048 resizeAlgorithm: 0 textureFormat: -1 - textureCompression: 1 + textureCompression: 2 compressionQuality: 50 crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 androidETC2FallbackOverride: 0 - forceMaximumCompressionQuality_BC6H_BC7: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 2 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: 4 + textureCompression: 2 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 1 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 2 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + - serializedVersion: 3 + buildTarget: Windows Store Apps + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 2 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 spriteSheet: serializedVersion: 2 sprites: [] diff --git a/wb_unity_pro_2/Assets/ART/base/main_pokemajiang/bg/bg1.png b/wb_unity_pro_2/Assets/ART/base/main_pokemajiang/bg/bg1.png index 73c171be..49377423 100644 Binary files a/wb_unity_pro_2/Assets/ART/base/main_pokemajiang/bg/bg1.png and b/wb_unity_pro_2/Assets/ART/base/main_pokemajiang/bg/bg1.png differ diff --git a/wb_unity_pro_2/Assets/ART/base/main_pokemajiang/bg/bg1.png.meta b/wb_unity_pro_2/Assets/ART/base/main_pokemajiang/bg/bg1.png.meta index 38b28914..c6e1630e 100644 --- a/wb_unity_pro_2/Assets/ART/base/main_pokemajiang/bg/bg1.png.meta +++ b/wb_unity_pro_2/Assets/ART/base/main_pokemajiang/bg/bg1.png.meta @@ -6,8 +6,8 @@ TextureImporter: serializedVersion: 11 mipmaps: mipMapMode: 0 - enableMipMap: 1 - sRGBTexture: 1 + enableMipMap: 0 + sRGBTexture: 0 linearTexture: 0 fadeOut: 0 borderMipMap: 0 @@ -34,10 +34,10 @@ TextureImporter: filterMode: -1 aniso: -1 mipBias: -100 - wrapU: -1 - wrapV: -1 - wrapW: -1 - nPOTScale: 1 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 lightmap: 0 compressionQuality: 50 spriteMode: 0 @@ -48,7 +48,7 @@ TextureImporter: spritePixelsToUnits: 100 spriteBorder: {x: 0, y: 0, z: 0, w: 0} spriteGenerateFallbackPhysicsShape: 1 - alphaUsage: 1 + alphaUsage: 0 alphaIsTransparency: 0 spriteTessellationDetail: -1 textureType: 0 @@ -57,20 +57,56 @@ TextureImporter: maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 - applyGammaDecoding: 0 + applyGammaDecoding: 1 platformSettings: - serializedVersion: 3 buildTarget: DefaultTexturePlatform maxTextureSize: 2048 resizeAlgorithm: 0 textureFormat: -1 - textureCompression: 1 + textureCompression: 0 compressionQuality: 50 crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 androidETC2FallbackOverride: 0 - forceMaximumCompressionQuality_BC6H_BC7: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 spriteSheet: serializedVersion: 2 sprites: [] diff --git a/wb_unity_pro_2/Assets/ART/base/main_pokemajiang/bg/bg2.png b/wb_unity_pro_2/Assets/ART/base/main_pokemajiang/bg/bg2.png index 6ee9829e..898e4943 100644 Binary files a/wb_unity_pro_2/Assets/ART/base/main_pokemajiang/bg/bg2.png and b/wb_unity_pro_2/Assets/ART/base/main_pokemajiang/bg/bg2.png differ diff --git a/wb_unity_pro_2/Assets/ART/base/main_pokemajiang/bg/bg2.png.meta b/wb_unity_pro_2/Assets/ART/base/main_pokemajiang/bg/bg2.png.meta index 2099fdc3..7955f7d4 100644 --- a/wb_unity_pro_2/Assets/ART/base/main_pokemajiang/bg/bg2.png.meta +++ b/wb_unity_pro_2/Assets/ART/base/main_pokemajiang/bg/bg2.png.meta @@ -6,8 +6,8 @@ TextureImporter: serializedVersion: 11 mipmaps: mipMapMode: 0 - enableMipMap: 1 - sRGBTexture: 1 + enableMipMap: 0 + sRGBTexture: 0 linearTexture: 0 fadeOut: 0 borderMipMap: 0 @@ -34,10 +34,10 @@ TextureImporter: filterMode: -1 aniso: -1 mipBias: -100 - wrapU: -1 - wrapV: -1 - wrapW: -1 - nPOTScale: 1 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 lightmap: 0 compressionQuality: 50 spriteMode: 0 @@ -48,7 +48,7 @@ TextureImporter: spritePixelsToUnits: 100 spriteBorder: {x: 0, y: 0, z: 0, w: 0} spriteGenerateFallbackPhysicsShape: 1 - alphaUsage: 1 + alphaUsage: 0 alphaIsTransparency: 0 spriteTessellationDetail: -1 textureType: 0 @@ -57,20 +57,56 @@ TextureImporter: maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 - applyGammaDecoding: 0 + applyGammaDecoding: 1 platformSettings: - serializedVersion: 3 buildTarget: DefaultTexturePlatform maxTextureSize: 2048 resizeAlgorithm: 0 textureFormat: -1 - textureCompression: 1 + textureCompression: 0 compressionQuality: 50 crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 androidETC2FallbackOverride: 0 - forceMaximumCompressionQuality_BC6H_BC7: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 spriteSheet: serializedVersion: 2 sprites: [] diff --git a/wb_unity_pro_2/Assets/ART/base/main_pokemajiang/bg/bg3.png b/wb_unity_pro_2/Assets/ART/base/main_pokemajiang/bg/bg3.png index 6331a5b0..a87c69a2 100644 Binary files a/wb_unity_pro_2/Assets/ART/base/main_pokemajiang/bg/bg3.png and b/wb_unity_pro_2/Assets/ART/base/main_pokemajiang/bg/bg3.png differ diff --git a/wb_unity_pro_2/Assets/ART/base/main_pokemajiang/bg/bg3.png.meta b/wb_unity_pro_2/Assets/ART/base/main_pokemajiang/bg/bg3.png.meta index 72213d7e..2b07dfa9 100644 --- a/wb_unity_pro_2/Assets/ART/base/main_pokemajiang/bg/bg3.png.meta +++ b/wb_unity_pro_2/Assets/ART/base/main_pokemajiang/bg/bg3.png.meta @@ -6,7 +6,7 @@ TextureImporter: serializedVersion: 11 mipmaps: mipMapMode: 0 - enableMipMap: 1 + enableMipMap: 0 sRGBTexture: 1 linearTexture: 0 fadeOut: 0 @@ -37,7 +37,7 @@ TextureImporter: wrapU: -1 wrapV: -1 wrapW: -1 - nPOTScale: 1 + nPOTScale: 0 lightmap: 0 compressionQuality: 50 spriteMode: 0 @@ -48,7 +48,7 @@ TextureImporter: spritePixelsToUnits: 100 spriteBorder: {x: 0, y: 0, z: 0, w: 0} spriteGenerateFallbackPhysicsShape: 1 - alphaUsage: 1 + alphaUsage: 0 alphaIsTransparency: 0 spriteTessellationDetail: -1 textureType: 0 @@ -57,20 +57,56 @@ TextureImporter: maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 - applyGammaDecoding: 0 + applyGammaDecoding: 1 platformSettings: - serializedVersion: 3 buildTarget: DefaultTexturePlatform maxTextureSize: 2048 resizeAlgorithm: 0 textureFormat: -1 - textureCompression: 1 + textureCompression: 0 compressionQuality: 50 crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 androidETC2FallbackOverride: 0 - forceMaximumCompressionQuality_BC6H_BC7: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 spriteSheet: serializedVersion: 2 sprites: [] diff --git a/wb_unity_pro_2/Assets/ART/base/main_zipai/ui/Main_RunBeard_atlas0.png b/wb_unity_pro_2/Assets/ART/base/main_zipai/ui/Main_RunBeard_atlas0.png index a1b8a04d..c8c13cc1 100644 Binary files a/wb_unity_pro_2/Assets/ART/base/main_zipai/ui/Main_RunBeard_atlas0.png and b/wb_unity_pro_2/Assets/ART/base/main_zipai/ui/Main_RunBeard_atlas0.png differ diff --git a/wb_unity_pro_2/Assets/ART/base/main_zipai/ui/Main_RunBeard_atlas0_1.png b/wb_unity_pro_2/Assets/ART/base/main_zipai/ui/Main_RunBeard_atlas0_1.png index 124cef1c..171c66f1 100644 Binary files a/wb_unity_pro_2/Assets/ART/base/main_zipai/ui/Main_RunBeard_atlas0_1.png and b/wb_unity_pro_2/Assets/ART/base/main_zipai/ui/Main_RunBeard_atlas0_1.png differ diff --git a/wb_unity_pro_2/Assets/ART/base/main_zipai/ui/Main_RunBeard_atlas0_2.png b/wb_unity_pro_2/Assets/ART/base/main_zipai/ui/Main_RunBeard_atlas0_2.png index 54f85369..bd736a0d 100644 Binary files a/wb_unity_pro_2/Assets/ART/base/main_zipai/ui/Main_RunBeard_atlas0_2.png and b/wb_unity_pro_2/Assets/ART/base/main_zipai/ui/Main_RunBeard_atlas0_2.png differ diff --git a/wb_unity_pro_2/Assets/ART/base/main_zipai/ui/Main_RunBeard_fui.bytes b/wb_unity_pro_2/Assets/ART/base/main_zipai/ui/Main_RunBeard_fui.bytes index b054b993..1221bb28 100644 Binary files a/wb_unity_pro_2/Assets/ART/base/main_zipai/ui/Main_RunBeard_fui.bytes and b/wb_unity_pro_2/Assets/ART/base/main_zipai/ui/Main_RunBeard_fui.bytes differ diff --git a/wb_unity_pro_2/Assets/ART/base/main_zipaimajiang/bg/bg_1.png b/wb_unity_pro_2/Assets/ART/base/main_zipaimajiang/bg/bg_1.png index 73c171be..4a26a13a 100644 Binary files a/wb_unity_pro_2/Assets/ART/base/main_zipaimajiang/bg/bg_1.png and b/wb_unity_pro_2/Assets/ART/base/main_zipaimajiang/bg/bg_1.png differ diff --git a/wb_unity_pro_2/Assets/ART/base/main_zipaimajiang/bg/bg_1.png.meta b/wb_unity_pro_2/Assets/ART/base/main_zipaimajiang/bg/bg_1.png.meta index 031ba72a..00c29773 100644 --- a/wb_unity_pro_2/Assets/ART/base/main_zipaimajiang/bg/bg_1.png.meta +++ b/wb_unity_pro_2/Assets/ART/base/main_zipaimajiang/bg/bg_1.png.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 46633c00b05995b45a4e9e8e9acdb86f +guid: a6e64fb6cf4a704469654bd782f02234 TextureImporter: internalIDToNameTable: [] externalObjects: {} diff --git a/wb_unity_pro_2/Assets/ART/base/main_zipaimajiang/bg/bg_1_bak (2).png b/wb_unity_pro_2/Assets/ART/base/main_zipaimajiang/bg/bg_1_bak (2).png deleted file mode 100644 index 3b0ae30f..00000000 Binary files a/wb_unity_pro_2/Assets/ART/base/main_zipaimajiang/bg/bg_1_bak (2).png and /dev/null differ diff --git a/wb_unity_pro_2/Assets/ART/base/main_zipaimajiang/bg/bg_2.png b/wb_unity_pro_2/Assets/ART/base/main_zipaimajiang/bg/bg_2.png index 6ee9829e..4a26a13a 100644 Binary files a/wb_unity_pro_2/Assets/ART/base/main_zipaimajiang/bg/bg_2.png and b/wb_unity_pro_2/Assets/ART/base/main_zipaimajiang/bg/bg_2.png differ diff --git a/wb_unity_pro_2/Assets/ART/base/main_zipaimajiang/bg/bg_2.png.meta b/wb_unity_pro_2/Assets/ART/base/main_zipaimajiang/bg/bg_2.png.meta index 3624f48f..bd35777d 100644 --- a/wb_unity_pro_2/Assets/ART/base/main_zipaimajiang/bg/bg_2.png.meta +++ b/wb_unity_pro_2/Assets/ART/base/main_zipaimajiang/bg/bg_2.png.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: c0d78995b75254b46a9c0409c425f3e2 +guid: b9fc5fb9e3bc7f34f9ff69ec2481d723 TextureImporter: internalIDToNameTable: [] externalObjects: {} diff --git a/wb_unity_pro_2/Assets/ART/base/main_zipaimajiang/bg/bg_3.png b/wb_unity_pro_2/Assets/ART/base/main_zipaimajiang/bg/bg_3.png index 6331a5b0..4a26a13a 100644 Binary files a/wb_unity_pro_2/Assets/ART/base/main_zipaimajiang/bg/bg_3.png and b/wb_unity_pro_2/Assets/ART/base/main_zipaimajiang/bg/bg_3.png differ diff --git a/wb_unity_pro_2/Assets/ART/base/main_zipaimajiang/bg/bg_3.png.meta b/wb_unity_pro_2/Assets/ART/base/main_zipaimajiang/bg/bg_3.png.meta index 50176395..5c8ca23b 100644 --- a/wb_unity_pro_2/Assets/ART/base/main_zipaimajiang/bg/bg_3.png.meta +++ b/wb_unity_pro_2/Assets/ART/base/main_zipaimajiang/bg/bg_3.png.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: e56c74e2ed064624db12bdc9006f5725 +guid: 06a22e3e0d33fb5448725ba7492da417 TextureImporter: internalIDToNameTable: [] externalObjects: {} diff --git a/wb_unity_pro_2/Assets/ART/base/newgroup/ui/NewGroup_atlas0.png b/wb_unity_pro_2/Assets/ART/base/newgroup/ui/NewGroup_atlas0.png index e479956a..ec6aacb0 100644 Binary files a/wb_unity_pro_2/Assets/ART/base/newgroup/ui/NewGroup_atlas0.png and b/wb_unity_pro_2/Assets/ART/base/newgroup/ui/NewGroup_atlas0.png differ diff --git a/wb_unity_pro_2/Assets/ART/base/newgroup/ui/NewGroup_atlas0_1.png b/wb_unity_pro_2/Assets/ART/base/newgroup/ui/NewGroup_atlas0_1.png index 244d8736..74d16034 100644 Binary files a/wb_unity_pro_2/Assets/ART/base/newgroup/ui/NewGroup_atlas0_1.png and b/wb_unity_pro_2/Assets/ART/base/newgroup/ui/NewGroup_atlas0_1.png differ diff --git a/wb_unity_pro_2/Assets/ART/base/newgroup/ui/NewGroup_atlas0_2.png b/wb_unity_pro_2/Assets/ART/base/newgroup/ui/NewGroup_atlas0_2.png new file mode 100644 index 00000000..fe83ab44 Binary files /dev/null and b/wb_unity_pro_2/Assets/ART/base/newgroup/ui/NewGroup_atlas0_2.png differ diff --git a/wb_unity_pro_2/Assets/ART/base/newgroup/ui/NewGroup_atlas0_2.png.meta b/wb_unity_pro_2/Assets/ART/base/newgroup/ui/NewGroup_atlas0_2.png.meta new file mode 100644 index 00000000..eb0aed74 --- /dev/null +++ b/wb_unity_pro_2/Assets/ART/base/newgroup/ui/NewGroup_atlas0_2.png.meta @@ -0,0 +1,92 @@ +fileFormatVersion: 2 +guid: 8e51851e8fd22b44095e51fc289145e6 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -100 + wrapU: -1 + wrapV: -1 + wrapW: -1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: base/newgroup/1876b2140d79b7dc6c2674f954027415 + assetBundleVariant: diff --git a/wb_unity_pro_2/Assets/ART/base/newgroup/ui/NewGroup_fui.bytes b/wb_unity_pro_2/Assets/ART/base/newgroup/ui/NewGroup_fui.bytes index be3d73c6..6b1c6648 100644 Binary files a/wb_unity_pro_2/Assets/ART/base/newgroup/ui/NewGroup_fui.bytes and b/wb_unity_pro_2/Assets/ART/base/newgroup/ui/NewGroup_fui.bytes differ