diff --git a/lua_probject/base_project/Game/View/LoginView.lua b/lua_probject/base_project/Game/View/LoginView.lua index 24c24796..b9f28795 100644 --- a/lua_probject/base_project/Game/View/LoginView.lua +++ b/lua_probject/base_project/Game/View/LoginView.lua @@ -6,8 +6,8 @@ local M = {} --- Create a new LoginView function LoginView.new() - setmetatable(M, {__index = BaseView}) - local self = setmetatable({}, {__index = M}) + setmetatable(M, { __index = BaseView }) + local self = setmetatable({}, { __index = M }) self.class = "LoginView" self._full = true self:init() @@ -18,54 +18,53 @@ end --@function [parent=#LoginView] init --@param self function M:init() - UIPackage.AddPackage("base/login/ui/Login") - - --UIPackage.AddPackage("UI/Card") - ViewUtil.PlaySoundBg() - self:InitView("ui://Login/Main") - - local view = self._view - view:GetChild("tex_version").text = "Version:" .. GetGameInfoPlatform("version") - -- print(GameApplication.Instance.accountTest and 1 or 0) - view:GetController("test").selectedIndex = GameApplication.Instance.accountTest and 1 or 0 - - -- Utils.LoadBg("loginbg", view) - if GameApplication.Instance.accountTest then - local json_data = Utils.LoadLocalFile("userId") - if json_data then - local _data = json.decode(json_data) - view:GetChild("tex_unionid").text = _data.userId + UIPackage.AddPackage("base/login/ui/Login") + + --UIPackage.AddPackage("UI/Card") + ViewUtil.PlaySoundBg() + self:InitView("ui://Login/Main") + + local view = self._view + view:GetChild("tex_version").text = "Version:" .. GetGameInfoPlatform("version") + -- print(GameApplication.Instance.accountTest and 1 or 0) + view:GetController("test").selectedIndex = GameApplication.Instance.accountTest and 1 or 0 + + -- Utils.LoadBg("loginbg", view) + if GameApplication.Instance.accountTest then + local json_data = Utils.LoadLocalFile("userId") + if json_data then + local _data = json.decode(json_data) + view:GetChild("tex_unionid").text = _data.userId + end end - end - local _btn_login = view:GetChild("btn_wx") + local _btn_login = view:GetChild("btn_wx") - _btn_login.onClick:Add(function() - ViewUtil.ShowModalWait(self._root_view,"正在登录游戏...") - coroutine.start(function() - coroutine.wait(8) - if self.isWXCallBackMark then - return - end - ViewUtil.CloseModalWait() - ViewUtil.ErrorTip(10000,"微信登录失败!") - - end) + _btn_login.onClick:Add(function() + ViewUtil.ShowModalWait(self._root_view, "正在登录游戏...") + coroutine.start(function() + coroutine.wait(8) + if self.isWXCallBackMark then + return + end + ViewUtil.CloseModalWait() + ViewUtil.ErrorTip(10000, "微信登录失败!") + end) if (not GameApplication.Instance.accountTest) then - GameApplication.Instance:WXLogin(handler(self,self.LoginCallBack)) + GameApplication.Instance:WXLogin(handler(self, self.LoginCallBack)) else --local ctr_user = view:GetController("user") - + local _tex_unionid = view:GetChild("tex_unionid") local utez = _tex_unionid.text --.. (ctr_user.selectedIndex + 1) - + local _data = {} _data["userId"] = utez local key = "userId" - local s,e = pcall(function() - Utils.SaveLocalFile(key,json.encode(_data)) - end) + local s, e = pcall(function() + Utils.SaveLocalFile(key, json.encode(_data)) + end) if not s then print("Error:" .. e) end @@ -82,6 +81,8 @@ function M:init() btn_phone.onClick:Set(function() self:PhoneLogin() end) + + self:InitClip() end function M:Destroy() @@ -89,21 +90,23 @@ function M:Destroy() self._agreement:Destroy() end BaseView.Destroy(self) + coroutine.stop(self.donhua) end function M:Show() BaseView.Show(self) self:QuickLogin() + self:InitClip() end local function __goto_lobby(response) if response.Data then local notices = response.Data.notice_list if notices and #notices > 0 then - local tem = {} - tem.data = notices - tem.auto_show = true - DataManager.SelfUser.notices = tem + local tem = {} + tem.data = notices + tem.auto_show = true + DataManager.SelfUser.notices = tem end end ControllerManager.ChangeController(LoddyController) @@ -112,21 +115,21 @@ end local function __join_room(roomid, res) local loddyctr = ControllerManager.GetController(LoddyController) - loddyctr:JoinRoom(roomid, function (res1) + loddyctr:JoinRoom(roomid, function(res1) ViewUtil.CloseModalWait() if res1.ReturnCode == -2 then __join_room(roomid, res) elseif res1.ReturnCode == 0 then - ViewManager.ChangeView(ViewManager.View_Main,DataManager.CurrenRoom.game_id) + ViewManager.ChangeView(ViewManager.View_Main, DataManager.CurrenRoom.game_id) elseif res1.ReturnCode == 101 or res1.ReturnCode == 6 then __goto_lobby(res) else - ViewUtil.ErrorTip(res1.ReturnCode,"登录失败!") + ViewUtil.ErrorTip(res1.ReturnCode, "登录失败!") end end) end -local function __login_response(self,response) +local function __login_response(self, response) ViewUtil.CloseModalWait() local skey = "session_id" if (response.ReturnCode == 0) then @@ -134,89 +137,85 @@ local function __login_response(self,response) -- if (user.guild) then ExtendManager.Destroy() - local function f_enterLobby( ... ) - -- body - local _client = ControllerManager.WebClient - - PlayerPrefs.SetString(skey,_client:getSession()) - PlayerPrefs.Save() + local function f_enterLobby(...) + -- body + local _client = ControllerManager.WebClient - ExtendManager.Init(user.games) - - local roomid = user.room_id - if (string.len(roomid) > 1) then - if user.group_id == 0 then - ViewUtil.ShowModalWait(self._root_view,"正在加入房间...") - __join_room(roomid, response) - return - end - end - __goto_lobby(response) + PlayerPrefs.SetString(skey, _client:getSession()) + PlayerPrefs.Save() + + ExtendManager.Init(user.games) + + local roomid = user.room_id + if (string.len(roomid) > 1) then + if user.group_id == 0 then + ViewUtil.ShowModalWait(self._root_view, "正在加入房间...") + __join_room(roomid, response) + return + end + end + __goto_lobby(response) end - + if user.update ~= 0 then - - ExtendHotupdate.UpdateGameList(user.games,f_enterLobby) + ExtendHotupdate.UpdateGameList(user.games, f_enterLobby) else - f_enterLobby() + f_enterLobby() end else - if(response.ReturnCode == Table_Error_code.ERR_SERVER or response.ReturnCode == Table_Error_code.ERR_LOGOUT) then + if (response.ReturnCode == Table_Error_code.ERR_SERVER or response.ReturnCode == Table_Error_code.ERR_LOGOUT) then PlayerPrefs.DeleteKey(skey) PlayerPrefs.Save() end - ViewUtil.ErrorTip(response.ReturnCode,"登录失败!") + ViewUtil.ErrorTip(response.ReturnCode, "登录失败!") end end function M:PhoneLogin() - local _phoneView=nil + local _phoneView = nil _phoneView = PhoneLoginView.new(function(res) if res.ReturnCode == 0 then _phoneView:Destroy() end - __login_response(self,res) - end) + __login_response(self, res) + end) _phoneView:Show() end - function M:IDLogin() - local _idView=nil + local _idView = nil _idView = IDLoginView.new(function(res) if res.ReturnCode == 0 then _idView:Destroy() end - __login_response(self,res) - end) + __login_response(self, res) + end) _idView:Show() end - function M:QuickLogin() if (not GameApplication.Instance.accountTest) then local session_id = PlayerPrefs.GetString("session_id") - print("session_id:"..session_id) - if session_id and string.len(session_id) > 3 then - ViewUtil.ShowModalWait(self._root_view,"正在登录游戏...") - local loginCtr = ControllerManager.GetController(LoginController) - loginCtr:QuickLogin(session_id,function(response) - __login_response(self,response) - end) + print("session_id:" .. session_id) + if session_id and string.len(session_id) > 3 then + ViewUtil.ShowModalWait(self._root_view, "正在登录游戏...") + local loginCtr = ControllerManager.GetController(LoginController) + loginCtr:QuickLogin(session_id, function(response) + __login_response(self, response) + end) end end end - -function M:LoginCallBack(result,data) - self.isWXCallBackMark=true - --print("微信登录返回================================================================") - --print("result===>"..result) - --pt(data) - if (not result) or result ~= 0 then +function M:LoginCallBack(result, data) + self.isWXCallBackMark = true + --print("微信登录返回================================================================") + --print("result===>"..result) + --pt(data) + if (not result) or result ~= 0 then if result == 10 then - ViewUtil.ShowModalWait(self._root_view) - return + ViewUtil.ShowModalWait(self._root_view) + return end ViewUtil.CloseModalWait() return @@ -224,7 +223,7 @@ function M:LoginCallBack(result,data) if data then local jd = json.decode(data) - pt(jd) + pt(jd) local headurl = jd["headimgurl"] local unionid = jd["unionid"] local sex = jd["sex"] @@ -235,17 +234,17 @@ function M:LoginCallBack(result,data) DataManager.SelfUser.nick_name = nickname DataManager.SelfUser.sex = sex DataManager.SelfUser.head_url = headurl - if not DataManager.SelfUser.acc or string.len(DataManager.SelfUser.acc)<1 then + if not DataManager.SelfUser.acc or string.len(DataManager.SelfUser.acc) < 1 then ViewUtil.CloseModalWait() return end end - - + + local loginCtr = ControllerManager.GetController(LoginController) loginCtr:Login(function(response) - __login_response(self,response) + __login_response(self, response) end) end @@ -254,4 +253,34 @@ function M:Destroy() -- UIPackage.RemovePackage("base/embed/ui/Hotupdate") UIPackage.RemovePackage("base/login/ui/Login") -- ResourcesManager.UnLoad("base/ui/Login.bytes") -end \ No newline at end of file +end + +function M:InitClip() + local yunqueEnd = 120 + local yunqueName = "ui://Login/yunque_00" + local yunque = self._view:GetChild('clip_yueque') + local yunqueIndex = 0 + + local xuehuaEnd = 120 + local xuehuaName = "ui://Login/xuehua_00" + local xuehua = self._view:GetChild('clip_xuehua') + local xuehuaIndex = 0 + + self.donhua = coroutine.start( + function() + while true do + yunqueIndex = self:ReplaceClip1(yunqueEnd, yunque, yunqueIndex, yunqueName) + xuehuaIndex = self:ReplaceClip1(xuehuaEnd, xuehua, xuehuaIndex, xuehuaName) + coroutine.wait(0.080) + end + end + ) +end + +function M:ReplaceClip1(e, t, i, n) + if i > e then + i = 0 + end + t.url = string.format("%s%03d", n, i) + return i + 2 +end diff --git a/lua_probject/base_project/Game/View/NewGroup/GroupManagerView.lua b/lua_probject/base_project/Game/View/NewGroup/GroupManagerView.lua index 4ee53ab7..c84445b5 100644 --- a/lua_probject/base_project/Game/View/NewGroup/GroupManagerView.lua +++ b/lua_probject/base_project/Game/View/NewGroup/GroupManagerView.lua @@ -66,6 +66,7 @@ function M:init(url, btn_type) local item = lst_index:AddItemFromPool() local title = page.title item:GetChild("title").text = title + item:GetChild("title2").text = title if i == 1 then item.selected = true end diff --git a/lua_probject/base_project/Game/View/NewGroup/MngView/MngPageConfig.lua b/lua_probject/base_project/Game/View/NewGroup/MngView/MngPageConfig.lua index fade21e6..f10c2e38 100644 --- a/lua_probject/base_project/Game/View/NewGroup/MngView/MngPageConfig.lua +++ b/lua_probject/base_project/Game/View/NewGroup/MngView/MngPageConfig.lua @@ -64,12 +64,12 @@ MngPageConfig.Config = { { -- 盟主 --{19, 16, 7, 3, 8, 9, 13, 17}, - { 19, 16, 7, 3, 8, 13, 17, 9, 22 }, + { 9, 17, 16, 7 }, -- 管理员 --{19, 16, 7, 3, 8, 9, 13, 17}, - { 19, 16, 7, 3, 8, 13, 17, 9, 22 }, + { 9, 17, 16, 7 }, -- 合伙人 - { 19, 9, 7, 17 }, + { 17, 16, 7 }, --{19,16,7, 8,17,22}, -- 普通玩家 --{9, 17}, diff --git a/lua_probject/base_project/Game/View/NewGroup/MngView/TimeSettingPanel.lua b/lua_probject/base_project/Game/View/NewGroup/MngView/TimeSettingPanel.lua index 58efb820..34bd3fc6 100644 --- a/lua_probject/base_project/Game/View/NewGroup/MngView/TimeSettingPanel.lua +++ b/lua_probject/base_project/Game/View/NewGroup/MngView/TimeSettingPanel.lua @@ -4,7 +4,7 @@ local TimeSettingPanel = {} local M = TimeSettingPanel function TimeSettingPanel.new(parent, btn_date1, btn_date2, posX, posY, callback, flag) - local self = setmetatable({}, {__index = M}) + local self = setmetatable({}, { __index = M }) self.class = "TimeSettingPanel" self.parent = parent self.btn1 = btn_date1 @@ -12,7 +12,7 @@ function TimeSettingPanel.new(parent, btn_date1, btn_date2, posX, posY, callback self.posX = posX or 0 self.posY = posY or 0 self.callback = callback - self.show_day = flag and 3 or 3 + self.show_day = flag and 7 or 7 self:initView() return self end @@ -26,10 +26,10 @@ local function initButton(self, btn_date, today) end function M:initView() - local now_time = os.date("*t",now) - local today = os.time({year=now_time.year, month=now_time.month, day=now_time.day, hour=0,min=0,sec=0}) - initButton(self, self.btn1, today) - initButton(self, self.btn2, today) + local now_time = os.date("*t", now) + local today = os.time({ year = now_time.year, month = now_time.month, day = now_time.day, hour = 0, min = 0, sec = 0 }) + initButton(self, self.btn1, today) + initButton(self, self.btn2, today) end function M:GetDate() @@ -41,8 +41,8 @@ function M:GetDate() end function M:SetTenDay() - local now_time = os.date("*t",now) - local today = os.time({year=now_time.year, month=now_time.month, day=now_time.day, hour=0,min=0,sec=0}) + local now_time = os.date("*t", now) + local today = os.time({ year = now_time.year, month = now_time.month, day = now_time.day, hour = 0, min = 0, sec = 0 }) local nine_day_ago = today - 86400 * 9 self.btn1.data = nine_day_ago self.btn1.title = os.date("%Y年%m月%d日", nine_day_ago) @@ -76,8 +76,8 @@ end -- 显示日期 -- +/-2的原因是列表中需要两个看不见的组件 local function initList(lst, date, show_day) - local now_time = os.date("*t",now) - local today = os.time({year=now_time.year, month=now_time.month, day=now_time.day, hour=0,min=0,sec=0}) + local now_time = os.date("*t", now) + local today = os.time({ year = now_time.year, month = now_time.month, day = now_time.day, hour = 0, min = 0, sec = 0 }) lst:RemoveChildrenToPool() local index = -1 local num = show_day - 1 @@ -120,4 +120,4 @@ function M:ShowSetDatePanel(btn) -- com_set_date.y = GRoot.inst.height - com_set_date.height - (GRoot.inst.height - self.parent.height) * 0.5 + self.posY end -return M \ No newline at end of file +return M diff --git a/lua_probject/extend_project/extend/poker/runfast/RunFast_GameController.lua b/lua_probject/extend_project/extend/poker/runfast/RunFast_GameController.lua index a22b323f..f8f9defa 100644 --- a/lua_probject/extend_project/extend/poker/runfast/RunFast_GameController.lua +++ b/lua_probject/extend_project/extend/poker/runfast/RunFast_GameController.lua @@ -18,8 +18,8 @@ local RunFast_GameController = {} local M = RunFast_GameController function M.new() - setmetatable(M, {__index = GameController}) - local self = setmetatable({}, {__index = M}) + setmetatable(M, { __index = GameController }) + local self = setmetatable({}, { __index = M }) self:init("跑得快") self.class = "RunFast_GameController" return self @@ -47,13 +47,14 @@ function M:RegisterEvt() --self._eventmap[RunFast_Protocol.RunFast_Oener] = self.Oener -- self._eventmap[Protocol.GAME_EVT_PLAYER_JOIN] = self.OnEventPlayerEnter self._eventmap[RunFast_Protocol.PT_GAMETUOGUAN] = self.Game_TuoGuan - - self._eventmap[RunFast_Protocol.GAME_EVENT_XIPAI] = self.OnEventXiPai - self._eventmap[RunFast_Protocol.GAME_EVENT_NOTIFY_XIPAI] = self.OnEventXiPaiAnim - - self._eventmap[RunFast_Protocol.GAME_EVT_CARDINHAND] = self.OnPlaySuccCheckHandCard - + + self._eventmap[RunFast_Protocol.GAME_EVENT_XIPAI] = self.OnEventXiPai + self._eventmap[RunFast_Protocol.GAME_EVENT_NOTIFY_XIPAI] = self.OnEventXiPaiAnim + + self._eventmap[RunFast_Protocol.GAME_EVT_CARDINHAND] = self.OnPlaySuccCheckHandCard + self._eventmap[RunFast_Protocol.GAME_EVT_DANIAO_TIP] = self.OnDaNiao end + -- function M:Oener(evt_data) -- local seat = evt_data["owner"] -- self._cacheEvent:Enqueue(function() @@ -79,7 +80,7 @@ end -- p.total_score=evt_data["score"] -- p.hp_info = evt_data["hp_info"] -- -- p.total_score=self._room.room_config.energyTab==0 and evt_data["score"] or evt_data["score"]/10 - + -- DataManager.CurrenRoom:AddPlayer(p) -- DispatchEvent(self._dispatcher,GameEvent.PlayerEnter, p) -- end @@ -87,51 +88,54 @@ end function M:SendXiPaiAction(callBack) local _data = {} - local _client = ControllerManager.GameNetClinet + local _client = ControllerManager.GameNetClinet _client:send(RunFast_Protocol.GAME_XIPAI, _data) - self.XiPaiCallBack=callBack + self.XiPaiCallBack = callBack +end + +function M:SendDaNiaoAction(flag) + local _data = {} + _data["niaoflag"] = flag + local _client = ControllerManager.GameNetClinet + _client:send(RunFast_Protocol.GAME_DANIAO, _data) end function M:OnEventXiPai(evt_data) - if evt_data["result"]==0 then - if self.XiPaiCallBack then - self.XiPaiCallBack() - end - else - ViewUtil.ErrorTip(1000000,"申请洗牌失败") - end - + 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,RunFast_GameEvent.EventXiPai,my_isXiPai,other_isXiPai) - end) + 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, RunFast_GameEvent.EventXiPai, my_isXiPai, other_isXiPai) + end) end - -function M:SendCard(cards,currentCard) +function M:SendCard(cards, currentCard) local _data = {} _data["card"] = cards - _data["all_card"] = currentCard + _data["all_card"] = currentCard local _client = ControllerManager.GameNetClinet _client:send(RunFast_Protocol.RunFast_Send_Card, _data) end @@ -210,16 +214,16 @@ end function M:OnPlaySucc(evt_data) if pcall( - self.OnPlaySuccCheck,self,evt_data - ) then - - else - printlog("数据异常OnPlaySucc==>>>") - end + self.OnPlaySuccCheck, self, evt_data + ) then + + else + printlog("数据异常OnPlaySucc==>>>") + end end function M:OnPlaySuccCheck(evt_data) - local seat = evt_data["player"] + local seat = evt_data["player"] local card_obj = evt_data["card_obj"] local cards = card_obj["card_list"] local remain = evt_data["remain"] -- 报单 @@ -231,31 +235,37 @@ function M:OnPlaySuccCheck(evt_data) player.hand_count = remain local card_type, number, length, plan_three_count = self:GetCardListInfo(out_card_list) player.out_card_list = self:GetSortOutCardList(out_card_list, card_type, number, plan_three_count) - DispatchEvent(self._dispatcher, RunFast_GameEvent.OnPlaySucc, player, remain, card_type, number, otherList,length) + DispatchEvent(self._dispatcher, RunFast_GameEvent.OnPlaySucc, player, remain, card_type, number, otherList, + length) end ) end function M:OnPlaySuccCheckHandCard(evt_data) - local seat = evt_data["player"] - local cards = evt_data["handCards"] + local seat = evt_data["player"] + local cards = evt_data["handCards"] self._cacheEvent:Enqueue( - function() - DispatchEvent(self._dispatcher, RunFast_GameEvent.OnPassSuccCheckCard,seat,cards) + function() + DispatchEvent(self._dispatcher, RunFast_GameEvent.OnPassSuccCheckCard, seat, cards) end ) - end - - +function M:OnDaNiao(evt_data) + self._cacheEvent:Enqueue( + function() + DispatchEvent(self._dispatcher, RunFast_GameEvent.OnDaNiao) + ControllerManager.IsSendCard = true + end + ) +end function M:OnPassSucc(evt_data) local seat = evt_data["seat"] self._cacheEvent:Enqueue( function() local p = self._room:GetPlayerBySeat(seat) - p.out_card_list = {0} + p.out_card_list = { 0 } DispatchEvent(self._dispatcher, RunFast_GameEvent.OnPassSucc, p) end ) @@ -270,6 +280,7 @@ function M:OnPutError(evt_data) end ) end + function M:TuoGuan(isTuo) local _data = {} _data["tuoguan"] = isTuo @@ -284,6 +295,7 @@ function M:Game_TuoGuan(evt_data) DispatchEvent(self._dispatcher, RunFast_GameEvent.Game_TuoGuan, tuoguan, seat) end) end + function M:OnIndexMove(evt_data) local seat = evt_data["index"] self._cacheEvent:Enqueue( @@ -303,7 +315,7 @@ function M:OnOptions(evt_data) function() local lastCardList = self:GetLastCardList(self._room.self_player.seat) local cardType, cardNum, cardLength = self:GetCardListInfo(lastCardList) - + DispatchEvent(self._dispatcher, RunFast_GameEvent.OnOptions, play, cardType, cardNum, cardLength, pass) end ) @@ -319,8 +331,7 @@ function M:OnPiaoTip(evt_data) local reload = evt_data["reload"] self._cacheEvent:Enqueue( function() - - DispatchEvent(self._dispatcher, RunFast_GameEvent.OnPiaoTips, piao,reload) + DispatchEvent(self._dispatcher, RunFast_GameEvent.OnPiaoTips, piao, reload) end ) end @@ -331,19 +342,18 @@ function M:OnPiaoAction(evt_data) self._cacheEvent:Enqueue( function() - - DispatchEvent(self._dispatcher, RunFast_GameEvent.OnPiaoAction, seat,piao) + DispatchEvent(self._dispatcher, RunFast_GameEvent.OnPiaoAction, seat, piao) end ) end function M:OnResult(evt_data) local result_type = evt_data["type"] - + local info = evt_data["info"] local winseat = evt_data["winseat"] local remaincards = evt_data["remaincards"] - DataManager.CurrenRoom.xipaiScore=evt_data["xipai_score"] + DataManager.CurrenRoom.xipaiScore = evt_data["xipai_score"] --printlog("wwwwwwwwwwwwwwwwwwwww1111111 ",result_type) --pt(evt_data) if result_type == 1 then @@ -356,7 +366,7 @@ function M:OnResult(evt_data) p.total_score = info[i]["score"] info[i]["self_user"] = p.self_user end - + DispatchEvent(self._dispatcher, RunFast_GameEvent.OnResult, over, info, winseat, remaincards) end ) @@ -393,6 +403,7 @@ function M:OnConfrimToNextGameSucc(evt_data) end ) end + function M:Game_TuoGuan(evt_data) local tuoguan = evt_data["tuoguan"] local seat = evt_data["seat"] @@ -400,6 +411,7 @@ function M:Game_TuoGuan(evt_data) DispatchEvent(self._dispatcher, RunFast_GameEvent.Game_TuoGuan, tuoguan, seat) end) end + function M:ChangeCodeByFrom(cardList, isSort) isSort = isSort or false local new_card_list = {} @@ -520,14 +532,13 @@ end --Bomb = 11 -- 牌型,大小, 长度 function M:GetCardListInfo(cardlist) - if #cardlist == 0 then return 0, 0, 0, 0 end -- 检测牌型 local card_type, card_num, card_length, plan_three_count = RunFast_CardType.None, 0, #cardlist, 0 local card_map = self:GetCardMapByList(cardlist) - + if #cardlist == 1 then card_type = RunFast_CardType.OneCard card_num = math.floor(cardlist[1] / 10) @@ -536,14 +547,12 @@ function M:GetCardListInfo(cardlist) card_num = math.floor(cardlist[1] / 10) elseif #cardlist == 3 then card_num = math.floor(cardlist[1] / 10) - if card_num==14 and DataManager.CurrenRoom.room_config.threeA==1 then + if card_num == 14 and DataManager.CurrenRoom.room_config.threeA == 1 then -- body card_type = RunFast_CardType.Bomb else card_type = RunFast_CardType.Three - end - elseif #cardlist == 4 then local max_key = 0 for k, v in pairs(card_map) do @@ -598,11 +607,9 @@ function M:GetCardListInfo(cardlist) else local one_count, two_count, three_count = 0, 0, 0 local max_one_key, max_two_key, max_three_key = 0, 0, 0 - + for k, v in pairs(card_map) do - if #v == 2 then - if k > max_two_key then max_two_key = k end @@ -612,7 +619,6 @@ function M:GetCardListInfo(cardlist) card_num = max_two_key end elseif #v == 1 then - if k > max_one_key then max_one_key = k end @@ -622,7 +628,6 @@ function M:GetCardListInfo(cardlist) card_num = max_one_key end elseif #v == 3 then - if max_three_key == 0 then max_three_key = k three_count = three_count + 1 @@ -632,10 +637,10 @@ function M:GetCardListInfo(cardlist) elseif k < max_three_key and k == max_three_key - 1 then max_three_key = k three_count = three_count + 1 - -- else - -- max_three_key = k + -- else + -- max_three_key = k end - + --three_count = three_count + 1 end end @@ -651,25 +656,17 @@ function M:GetCardListInfo(cardlist) -- card_num = max_three_key -- end plan_three_count = three_count - - if three_count * 3 == #cardlist then + + if three_count * 3 == #cardlist then card_type = RunFast_CardType.Plane card_num = max_three_key - - elseif three_count * 4 >= #cardlist and #cardlist%4==0 then + elseif three_count * 4 >= #cardlist and #cardlist % 4 == 0 then card_type = RunFast_CardType.PlaneAndOne card_num = max_three_key - - - elseif three_count * 5 >= #cardlist and #cardlist%5==0 then + elseif three_count * 5 >= #cardlist and #cardlist % 5 == 0 then card_type = RunFast_CardType.PlaneAndTwo card_num = max_three_key - - end - - - end return card_type, card_num, card_length, plan_three_count @@ -681,7 +678,7 @@ function M:GetCardMapByList(cardlist) local card = cardlist[i] local card_num = math.floor(cardlist[i] / 10) if card_map[card_num] == nil then - card_map[card_num] = {card} + card_map[card_num] = { card } else card_map[card_num][#card_map[card_num] + 1] = card end diff --git a/lua_probject/extend_project/extend/poker/runfast/RunFast_GameEvent.lua b/lua_probject/extend_project/extend/poker/runfast/RunFast_GameEvent.lua index dcb139a5..c678e8aa 100644 --- a/lua_probject/extend_project/extend/poker/runfast/RunFast_GameEvent.lua +++ b/lua_probject/extend_project/extend/poker/runfast/RunFast_GameEvent.lua @@ -16,8 +16,9 @@ local RunFast_GameEvent = { OnResult = "OnResult", OnResultByDissolve = "OnResultByDissolve", OnConfrimToNextGameSucc = "OnConfrimToNextGameSucc", - Game_TuoGuan="Game_TuoGuan", - EventXiPai="EventXiPai", - OnPassSuccCheckCard="OnPassSuccCheckCard", + Game_TuoGuan = "Game_TuoGuan", + EventXiPai = "EventXiPai", + OnPassSuccCheckCard = "OnPassSuccCheckCard", + OnDaNiao = "OnDaNiao", } -return RunFast_GameEvent \ No newline at end of file +return RunFast_GameEvent diff --git a/lua_probject/extend_project/extend/poker/runfast/RunFast_MainView.lua b/lua_probject/extend_project/extend/poker/runfast/RunFast_MainView.lua index 0a87a0c1..b69db642 100644 --- a/lua_probject/extend_project/extend/poker/runfast/RunFast_MainView.lua +++ b/lua_probject/extend_project/extend/poker/runfast/RunFast_MainView.lua @@ -12,8 +12,8 @@ local PlayerInfoView = import(".EXPlayerInfoView") local TableBG = import('Game.Data.TableBG') local M = {} function M.new() - setmetatable(M, {__index = PKMainView}) - local self = setmetatable({}, {__index = M}) + setmetatable(M, { __index = PKMainView }) + local self = setmetatable({}, { __index = M }) self.class = "RunFast_MainView" self:init() self._gamectr = ControllerManager.GetController(GameController) @@ -22,18 +22,19 @@ end local default_bg = 1 local bg_config = { - {id = 1, url = 'extend/poker/runfast/bg/bg1', thumb = 'ui://Extend_Poker_RunFastNew/table_bg1'}, - {id = 2, url = 'extend/poker/runfast/bg/bg2', thumb = 'ui://Extend_Poker_RunFastNew/table_bg2'}, - {id = 3, url = 'extend/poker/runfast/bg/bg3', thumb = 'ui://Extend_Poker_RunFastNew/table_bg3'} + { id = 1, url = 'extend/poker/runfast/bg/bg1', thumb = 'ui://Extend_Poker_RunFastNew/table_bg1' }, + { id = 2, url = 'extend/poker/runfast/bg/bg2', thumb = 'ui://Extend_Poker_RunFastNew/table_bg2' }, + { id = 3, url = 'extend/poker/runfast/bg/bg3', thumb = 'ui://Extend_Poker_RunFastNew/table_bg3' } } function M:InitView(url) local room = self._room UIPackage.AddPackage("extend/poker/runfast/ui/Extend_Poker_RunFastNew") - PKMainView.InitView(self, "ui://Extend_Poker_RunFastNew/RunFast_Main_" .. room.room_config.people_num,nil,1,default_bg,bg_config,nil,"ui://Extend_Poker_RunFastNew/SettingWindow1") + PKMainView.InitView(self, "ui://Extend_Poker_RunFastNew/RunFast_Main_" .. room.room_config.people_num, nil, 1, + default_bg, bg_config, nil, "ui://Extend_Poker_RunFastNew/SettingWindow1") local _room = DataManager.CurrenRoom local user_id = DataManager.SelfUser.account_id - local json_data = Utils.LoadLocalFile(user_id.._room.game_id.."pai") + local json_data = Utils.LoadLocalFile(user_id .. _room.game_id .. "pai") if json_data == nil then local _gamectr = self._gamectr self._room.pai = 0 @@ -43,7 +44,7 @@ function M:InitView(url) self._room.pai = pai end - json_data = Utils.LoadLocalFile(user_id.._room.game_id.."cardsize") + json_data = Utils.LoadLocalFile(user_id .. _room.game_id .. "cardsize") if json_data == nil then local _gamectr = self._gamectr self._room.cardsize = 1 @@ -62,7 +63,7 @@ function M:InitView(url) tem.visible = false end local list = self._room.player_list - for i=1,#list do + for i = 1, #list do local p = list[i] local info = _player_info[self:GetPos(p.seat)] info._view.visible = true @@ -74,11 +75,10 @@ function M:InitView(url) if self._rightPanelView ~= nil then self._rightPanelView:Destroy() end - - self._rightPanelView = RunFast_RightPanelView.new(self, rightpanel) - for i=1,#self._room.player_list do - - if self._room.self_player.seat==self._room.player_list[i].seat and self._room.self_player.self_user.account_id ~= self._room.player_list[i].self_user.account_id then + + self._rightPanelView = RunFast_RightPanelView.new(self, rightpanel) + for i = 1, #self._room.player_list do + if self._room.self_player.seat == self._room.player_list[i].seat and self._room.self_player.self_user.account_id ~= self._room.player_list[i].self_user.account_id then -- body local ErrorMsgTip = UIPackage.CreateObject("Common", "Win_ConnectTip") local _action = self._view:AddChild(ErrorMsgTip) @@ -87,30 +87,30 @@ function M:InitView(url) local btn1 = _action:GetChild("btn_connect") local btn2 = _action:GetChild("btn_back") text.text = "您来晚了,座位有人,请重新进牌桌" - btn1.visible=false + btn1.visible = false btn2:Center() - btn2.y=btn2.y+50 + btn2.y = btn2.y + 50 btn2.onClick:Set(function() - -- body - ErrorMsgTip:Destroy() - ErrorMsgTip = nil - self._gamectr:LevelRoom(function(res) - ViewUtil.CloseModalWait() - NetResetConnectWindow.CloseNetReset() - ControllerManager.ChangeController(LoddyController) - ViewManager.ChangeView(ViewManager.View_Lobby) - end) + -- body + ErrorMsgTip:Destroy() + ErrorMsgTip = nil + self._gamectr:LevelRoom(function(res) + ViewUtil.CloseModalWait() + NetResetConnectWindow.CloseNetReset() + ControllerManager.ChangeController(LoddyController) + ViewManager.ChangeView(ViewManager.View_Lobby) + end) end) end end - - if self._room.hpOnOff == 1 and self._room.score_times ~= 1 then + + if self._room.hpOnOff == 1 and self._room.score_times ~= 1 then -- body - self._view:GetChild("roominfo_panel1"):GetChild("tex_beishu").text=self._room.score_times .."倍" + self._view:GetChild("roominfo_panel1"):GetChild("tex_beishu").text = self._room.score_times .. "倍" else - self._view:GetChild("roominfo_panel1"):GetChild("tex_beishu").text="" + self._view:GetChild("roominfo_panel1"):GetChild("tex_beishu").text = "" end - + self.ctr_state = self._view:GetController("state") self._ctr_action = self._view:GetController("action") self._tex_leftTime = self._view:GetChild("time"):GetChild("title") @@ -118,27 +118,26 @@ function M:InitView(url) self._text_round = self._view:GetChild("round") self.ctr_card_eff = self._view:GetController("card_eff") 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) _player_card_info[i] = self:NewPlayerCardInfoView(tem, i) end - + local list = room.player_list if 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 + 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 @@ -152,60 +151,72 @@ function M:InitView(url) self:ReConnectForStart() end else - self._state.selectedIndex = StateType.Palying self:ReconnectForClearing() - end - - self._view:GetChild("btn_back_jiesan").onClick:Set(function () + + self._view:GetChild("btn_back_jiesan").onClick:Set(function() if self.dismiss_room_cd_time > 0 then ViewUtil.ErrorTip(nil, "您还处于解散冷却时间当中,请稍后重试!") else local _gamectr = ControllerManager.GetController(GameController) _gamectr:AskDismissRoom() end - end) - --local tempdsaf=self._view:GetChild("btn_back_jiesan") - --tempdsaf:GetChild("n3").displayObject.gameObject:SetActive(false) - --self._view:GetChild("btn_back_jiesan").displayObject.gameObject:SetActive(false) - + --local tempdsaf=self._view:GetChild("btn_back_jiesan") + --tempdsaf:GetChild("n3").displayObject.gameObject:SetActive(false) + --self._view:GetChild("btn_back_jiesan").displayObject.gameObject:SetActive(false) + self:ChangeBgmMusic() self:EventInit() - + self._view:GetChild("mask").onClick:Set(function() self:ResetPoker() end) local btn_rule = self._view:GetChild("right_panel"):GetChild("btn_log") self._view:GetChild('info_text'):GetChild('text').text = room.room_config:GetDes() if room.room_config.Leaf == 1 then - if room.room_config.people_num ==2 then + if room.room_config.people_num == 2 then self._view:GetChild('wanfa_text').text = '十五张' .. '二人跑得快' .. room.score_times .. '倍' else self._view:GetChild('wanfa_text').text = '十五张' .. '三人跑得快' .. room.score_times .. '倍' end else if room.room_config.people_num == 2 then - self._view:GetChild('wanfa_text').text = '十六张' .. '二人跑得快' .. room.score_times .. '倍' + self._view:GetChild('wanfa_text').text = '十六张' .. '二人跑得快' .. room.score_times .. '倍' else self._view:GetChild('wanfa_text').text = '十六张' .. '三人跑得快' .. room.score_times .. '倍' end end - if self._view:GetChild("shengyu")~=nil then + if self._view:GetChild("shengyu") ~= nil then -- body - if room.room_config.Leaf==1 then + if room.room_config.Leaf == 1 then -- body - self._view:GetChild("shengyu"):GetChild("shengyu").text="剩余15张" + self._view:GetChild("shengyu"):GetChild("shengyu").text = "剩余15张" else - self._view:GetChild("shengyu"):GetChild("shengyu").text="剩余16张" + self._view:GetChild("shengyu"):GetChild("shengyu").text = "剩余16张" end end + + --打鸟 + if self._view:GetChild('btn_daNiao') then + self._view:GetChild('btn_daNiao').onClick:Set(function() + self._gamectr:SendDaNiaoAction(1) + self._ctr_action.selectedIndex = 0 + end) + end + if self._view:GetChild('btn_buDaNiao') then + self._view:GetChild('btn_buDaNiao').onClick:Set(function() + self._gamectr:SendDaNiaoAction(0) + self._ctr_action.selectedIndex = 0 + end) + end end -function M:UpdateCard( index ) - self._room.pai=index + +function M:UpdateCard(index) + self._room.pai = index local card_info = self._player_card_info[1] -- for i=1,#self._room.player_list do -- print(i) @@ -213,7 +224,7 @@ function M:UpdateCard( index ) card_info:updatePoker() for _, player in ipairs(self._room.player_list) do local player_card_info = self._player_card_info[self:GetPos(player.seat)] - + if self._room.curren_turn_seat ~= player.seat then if player.out_card_list[1] == 0 then player_card_info:SetOutCardInfo(nil, true) @@ -222,7 +233,7 @@ function M:UpdateCard( index ) end end end - if self.caozuo==1 then + if self.caozuo == 1 then local ctr_number = self.pass == nil and 2 or 1 local lastCardList = self._gamectr:GetLastCardList(self._room.self_player.seat) local cardType, cardNum, cardLength = self._gamectr:GetCardListInfo(lastCardList) @@ -235,12 +246,12 @@ function M:UpdateCard( index ) m = true end local zdts = self._view:GetController("zidongtishi").selectedIndex - self._player_card_info[1]:ShowOutCardOption(ctr_number, cardType, cardNum, cardLength,m) + self._player_card_info[1]:ShowOutCardOption(ctr_number, cardType, cardNum, cardLength, m) end end function M:UpdateCardSize(index) - self._room.cardsize=index + self._room.cardsize = index local card_info = self._player_card_info[1] card_info:updatePoker() end @@ -254,7 +265,7 @@ end function M:OnPlayerEnter(...) MainView.OnPlayerEnter(self, ...) - local arg = {...} + local arg = { ... } local p = arg[1] local index = self:GetPos(p.seat) local info = self._player_info[index] @@ -269,7 +280,7 @@ function M:OnPlayerEnter(...) end function M:OnPlayerReady(...) - local arg = {...} + local arg = { ... } local p = arg[1] local _room = self._room local _player_info = self._player_info @@ -278,18 +289,18 @@ function M:OnPlayerReady(...) end local info = _player_info[self:GetPos(p.seat)] info:Ready(true) ---local readyNum = 0 ---for i = 1, #_room.player_list do --- local player = _room.player_list[i] --- if player.ready then readyNum = readyNum + 1 end ---end ---if _room.banker_seat == _room.self_player.seat and readyNum > 1 and readyNum == _room.room_config.people_num then --- if self._state.selectedIndex == 2 then --- local _gamectr = ControllerManager.GetController(GameController) --- _gamectr:StartGame() --- end --- --self._ctr_action.selectedIndex = 2 ---end + --local readyNum = 0 + --for i = 1, #_room.player_list do + -- local player = _room.player_list[i] + -- if player.ready then readyNum = readyNum + 1 end + --end + --if _room.banker_seat == _room.self_player.seat and readyNum > 1 and readyNum == _room.room_config.people_num then + -- if self._state.selectedIndex == 2 then + -- local _gamectr = ControllerManager.GetController(GameController) + -- _gamectr:StartGame() + -- end + -- --self._ctr_action.selectedIndex = 2 + --end end function M:OnPlayerLeave(...) @@ -297,89 +308,82 @@ function M:OnPlayerLeave(...) local _room = self._room if not _room.self_player.ready then --self._ctr_action.selectedIndex = 1 - 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 + 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 end - function M:EventInit() local _gamectr = ControllerManager.GetController(GameController) MainView.EventInit(self) local _player_info = self._player_info local _player_card_info = self._player_card_info local _room = self._room - - _gamectr:AddEventListener(RunFast_GameEvent.EventXiPai,function( ... ) - - if self.result_view ~= nil then + + _gamectr:AddEventListener(RunFast_GameEvent.EventXiPai, function(...) + if self.result_view ~= nil then self.result_view:Destroy() self.result_view = nil end - - self._player_card_info[1]:HidePiao() - - if self._room.room_config.people_num==3 and self._room.room_config.fangzuobi==1 then + + self._player_card_info[1]:HidePiao() + + if self._room.room_config.people_num == 3 and self._room.room_config.fangzuobi == 1 then -- body self.MypokerList = cardlist end local otherpoker_list = self._view:GetChild("otherpoker_list") - - if otherpoker_list ~= nil then - -- body - otherpoker_list.visible=false - otherpoker_list:RemoveChildrenToPool() - end + + 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 - - local list = _room.player_list + + local list = _room.player_list for i = 1, #list do local p = list[i] local head_info = self._player_info[self:GetPos(p.seat)] - if head_info._view:GetChild("shengyu")~=nil and head_info._view:GetController("shengyu")~=nil then + if head_info._view:GetChild("shengyu") ~= nil and head_info._view:GetController("shengyu") ~= nil then -- body - - if self._room.room_config.showlength==1 then + + if self._room.room_config.showlength == 1 then -- body - head_info._view:GetController("shengyu").selectedIndex=1 + head_info._view:GetController("shengyu").selectedIndex = 1 else - head_info._view:GetController("shengyu").selectedIndex=0 + head_info._view:GetController("shengyu").selectedIndex = 0 end - - -- body - head_info._view:GetChild("shengyu"):GetChild("shengyu").text="剩"..p.hand_count.."张" - - - + + -- body + head_info._view:GetChild("shengyu"):GetChild("shengyu").text = "剩" .. p.hand_count .. "张" end p:Clear() head_info:FillData(p) local card_info = self._player_card_info[self:GetPos(p.seat)] card_info:Clear() head_info:Ready(false) - - end - - - --[[if ( currentPlayer ) then + end + + + --[[if ( currentPlayer ) then self._popEvent = false local xipaiCB=function () self._popEvent = true @@ -396,42 +400,37 @@ function M:EventInit() end--]] - 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) - + 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(RunFast_GameEvent.OnMingCard, function(...) - local arg = {...} + local arg = { ... } local card = arg[1] self.ctr_state.selectedIndex = 1 self.ctr_card_eff.selectedIndex = 1 self:PlayCardEff(card) end) - + _gamectr:AddEventListener(RunFast_GameEvent.OnInitCard, function(...) - local arg = {...} + local arg = { ... } local round = arg[1] local cardlist = arg[2] @@ -440,20 +439,20 @@ function M:EventInit() self.result_view:Destroy() self.result_view = nil end - + self._player_card_info[1]:HidePiao() - - if self._room.room_config.people_num==3 and self._room.room_config.fangzuobi==1 then + + if self._room.room_config.people_num == 3 and self._room.room_config.fangzuobi == 1 then -- body self.MypokerList = cardlist end local otherpoker_list = self._view:GetChild("otherpoker_list") - - if otherpoker_list ~= nil then - -- body - otherpoker_list.visible=false - otherpoker_list:RemoveChildrenToPool() - end + + 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 @@ -466,44 +465,40 @@ function M:EventInit() for i = 1, #list do local p = list[i] local head_info = self._player_info[self:GetPos(p.seat)] - if head_info._view:GetChild("shengyu")~=nil and head_info._view:GetController("shengyu")~=nil then + if head_info._view:GetChild("shengyu") ~= nil and head_info._view:GetController("shengyu") ~= nil then -- body - - if self._room.room_config.showlength==1 then + + if self._room.room_config.showlength == 1 then -- body - head_info._view:GetController("shengyu").selectedIndex=1 + head_info._view:GetController("shengyu").selectedIndex = 1 else - head_info._view:GetController("shengyu").selectedIndex=0 + head_info._view:GetController("shengyu").selectedIndex = 0 end - - -- body - head_info._view:GetChild("shengyu"):GetChild("shengyu").text="剩"..p.hand_count.."张" - - - + + -- body + head_info._view:GetChild("shengyu"):GetChild("shengyu").text = "剩" .. p.hand_count .. "张" end p:Clear() head_info:FillData(p) local card_info = self._player_card_info[self:GetPos(p.seat)] card_info:Clear() head_info:Ready(false) - + if p.seat == self._room.self_player.seat then - if self._room.room_config.people_num==3 and self._room.room_config.fangzuobi==1 then + if self._room.room_config.people_num == 3 and self._room.room_config.fangzuobi == 1 then -- body - card_info:InitPoker(cardlist,true,1) + card_info:InitPoker(cardlist, true, 1) else - card_info:InitPoker(cardlist,true) + card_info:InitPoker(cardlist, true) end - else --card_info:UpdateHandPoker(#cardlist,true,false) --todo --card_info:UpdateRemainCard(#cardlist,true) end end end) - - + + -- _gamectr:AddEventListener(RunFast_GameEvent.Oener,function ( ... ) -- local arg = {...} -- local seat = arg[1] @@ -511,11 +506,11 @@ function M:EventInit() -- head_info._view:GetController("Oener").selectedIndex=1 -- end) _gamectr:AddEventListener(RunFast_GameEvent.OnIndexMove, function(...) - local arg = {...} + local arg = { ... } local seat = arg[1] local isNewBout = arg[2] local index = self:GetPos(seat) - + self.ctr_time.selectedIndex = index -- for i=1,#self._player_info do -- if index==i then @@ -527,16 +522,16 @@ function M:EventInit() -- head_info:MarkBank(false) -- end -- end - + if index == 1 then local card_info = self._player_card_info[index] card_info:SetOutCardInfo(nil, false) - -- if self.MypokerList ~= nil then - -- -- body - -- card_info:Clear() - -- card_info:InitPoker(self.MypokerList, false) - -- self.MypokerList = nil - -- end + -- if self.MypokerList ~= nil then + -- -- body + -- card_info:Clear() + -- card_info:InitPoker(self.MypokerList, false) + -- self.MypokerList = nil + -- end end self._left_time = 20 if self._room.ming_card ~= nil then @@ -548,9 +543,9 @@ function M:EventInit() end end end) - + _gamectr:AddEventListener(RunFast_GameEvent.OnBombScore, function(...) - local arg = {...} + local arg = { ... } local scoreList = arg[1] -- for i = 1, #scoreList do -- local player = self._room:GetPlayerBySeat(i) @@ -560,9 +555,9 @@ function M:EventInit() -- head_info:UpdateScore(player.total_score) -- end end) - + _gamectr:AddEventListener(RunFast_GameEvent.OnPlaySucc, function(...) - local arg = {...} + local arg = { ... } local p = arg[1] local card_number = arg[2] local cardstype = arg[3] @@ -570,21 +565,19 @@ function M:EventInit() local otherList = arg[5] local length = arg[6] self.ctr_time.selectedIndex = 0 - + local index = self:GetPos(p.seat) - if index==1 then - self.caozuo=0 + if index == 1 then + self.caozuo = 0 end local head_info = self._player_info[index] - if head_info._view:GetChild("shengyu")~=nil then + if head_info._view:GetChild("shengyu") ~= nil then -- body -- body - if card_number~=nil then + if card_number ~= nil then -- body - head_info._view:GetChild("shengyu"):GetChild("shengyu").text="剩"..card_number.."张" + head_info._view:GetChild("shengyu"):GetChild("shengyu").text = "剩" .. card_number .. "张" end - - end local card_info = self._player_card_info[index] card_info:SetOutCardInfo(p.out_card_list, false, true) @@ -598,7 +591,7 @@ function M:EventInit() card_info:DeleteHandCards(p.out_card_list) else card_info:SetRemainCardNumber(card_number == 1) - --card_info:UpdateHandPoker(card_number,false,false) -- todo + --card_info:UpdateHandPoker(card_number,false,false) -- todo end if self._room.is_new_bout == true then for i = 1, #self._room.player_list do @@ -611,13 +604,13 @@ function M:EventInit() -- card_info:PlayCardTypeEff(cardstype) -- if cardstype~=12 then -- -- body - - + + -- if cardstype==10 and length>=6 then -- -- card_info_i -- local chuan = UIPackage.CreateObject("Extend_Poker_RunFast", "chuan1") -- local card_info_i = self._player_card_info[self:GetPos(p.seat)] - + -- card_info_i._mask_liangpai:AddChild(chuan) -- chuan:GetChild("n0").asMovieClip.playing = true -- ViewUtil.PlaySound("RunFastNew_PK", "extend/poker/paodekuai/sound/sunzi.mp3") @@ -627,7 +620,7 @@ function M:EventInit() -- -- body -- chuan:Dispose() -- end - + -- end) -- else @@ -635,9 +628,8 @@ function M:EventInit() -- end -- end self:_Effect(cardstype, p) - else - if cardstype == 11 and cardstype~=12 then + if cardstype == 11 and cardstype ~= 12 then self:_Effect(cardstype, p) end end @@ -654,41 +646,39 @@ function M:EventInit() self:PlaySound(p.self_user.sex, "card_1") end) end - end) - - - _gamectr:AddEventListener(RunFast_GameEvent.OnPassSuccCheckCard, function(...) - self._popEvent = false - local arg = {...} - local seat = arg[1] + + + _gamectr:AddEventListener(RunFast_GameEvent.OnPassSuccCheckCard, function(...) + self._popEvent = false + local arg = { ... } + local seat = arg[1] local cards = arg[2] --self.MypokerList=cards self.ctr_time.selectedIndex = 0 local card_info = self._player_card_info[self:GetPos(seat)] - if seat == self._room.self_player.seat then - card_info:ClearCheck() - card_info:InitPoker(cards, false) - - --local player=self._room:GetPlayerBySeat(seat) - --if player.out_card_list[1] == 0 then + if seat == self._room.self_player.seat then + card_info:ClearCheck() + card_info:InitPoker(cards, false) + + --local player=self._room:GetPlayerBySeat(seat) + --if player.out_card_list[1] == 0 then -- player_card_info:SetOutCardInfo(nil, true) --else - --player:SetOutCardInfo({207}, false) - -- end - end - + --player:SetOutCardInfo({207}, false) + -- end + end + self._popEvent = true - end) - + _gamectr:AddEventListener(RunFast_GameEvent.OnPassSucc, function(...) - local arg = {...} + local arg = { ... } local p = arg[1] - + self.ctr_time.selectedIndex = 0 local card_info = self._player_card_info[self:GetPos(p.seat)] - + --card_info:SetOutCardInfo(nil, false) if p.seat == self._room.self_player.seat and self.MypokerList ~= nil then -- body @@ -699,31 +689,30 @@ function M:EventInit() card_info:SetOutCardInfo(nil, true) self:PlaySound(p.self_user.sex, "pass_" .. math.random(1, 4)) end) - + _gamectr:AddEventListener(RunFast_GameEvent.OnErrorTip, function(...) - local arg = {...} + local arg = { ... } local error_str = arg[1] self._player_card_info[1]:ErrorTip(error_str) -- self._player_card_info[1]:ResetPoker() end) - + _gamectr:AddEventListener(RunFast_GameEvent.OnPiaoTips, function(...) - local arg = {...} + local arg = { ... } local piao = arg[1] local reload = arg[2] if reload == 0 then - - if self._room.room_config.people_num==3 and self._room.room_config.fangzuobi==1 then + if self._room.room_config.people_num == 3 and self._room.room_config.fangzuobi == 1 then -- body self.MypokerList = cardlist end local otherpoker_list = self._view:GetChild("otherpoker_list") - - if otherpoker_list ~= nil then - -- body - otherpoker_list.visible=false - otherpoker_list:RemoveChildrenToPool() - end + + 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 @@ -745,12 +734,12 @@ function M:EventInit() head_info:UpdatePiao(-1) end end - + self._player_card_info[1]:ShowPiao(piao) end) _gamectr:AddEventListener(RunFast_GameEvent.OnPiaoAction, function(...) - local arg = {...} + local arg = { ... } local seat = arg[1] local piao = arg[2] local head_info = self._player_info[self:GetPos(seat)] @@ -758,15 +747,15 @@ function M:EventInit() end) _gamectr:AddEventListener(RunFast_GameEvent.OnOptions, function(...) - local arg = {...} + local arg = { ... } local play = arg[1] local pass = arg[5] local card_type = arg[2] local card_number = arg[3] local card_length = arg[4] local ctr_number = pass == nil and 2 or 1 - self.caozuo=1 --记录是否是自己出牌的阶段 - self.pass=pass + self.caozuo = 1 --记录是否是自己出牌的阶段 + self.pass = pass local m = false local next_seat = self._room.self_player.seat + 1 local card_info = self._player_card_info[1] @@ -784,19 +773,19 @@ function M:EventInit() m = true end local zdts = self._view:GetController("zidongtishi").selectedIndex - self._player_card_info[1]:ShowOutCardOption(ctr_number, card_type, card_number, card_length,m,play,zdts) + self._player_card_info[1]:ShowOutCardOption(ctr_number, card_type, card_number, card_length, m, play, zdts) end) - -- 托管 - _gamectr:AddEventListener(RunFast_GameEvent.Game_TuoGuan, function(...) - local arg = {...} + -- 托管 + _gamectr:AddEventListener(RunFast_GameEvent.Game_TuoGuan, function(...) + local arg = { ... } local tuoguan = arg[1] local seat = arg[2] - + local tuoguanzhong = self._view:GetChild("tuoguanzhong") local zhezhao = self._view:GetChild("n109") local head_info = self._player_info[self:GetPos(seat)] if (tuoguan == 1) then - if (seat == self._room.self_player.seat ) then + if (seat == self._room.self_player.seat) then tuoguanzhong.visible = true -- tuoguanzhong.sortingOrder = 2 zhezhao.visible = true @@ -806,10 +795,10 @@ function M:EventInit() else head_info._view:GetController("tuoguan").selectedIndex = 1 end - -- if self.ispanguangzhe == true then - -- -- body - -- zhezhao.visible = false - -- end + -- if self.ispanguangzhe == true then + -- -- body + -- zhezhao.visible = false + -- end else if (seat == self._room.self_player.seat) then tuoguanzhong.visible = false @@ -825,14 +814,14 @@ function M:EventInit() end end) _gamectr:AddEventListener(RunFast_GameEvent.OnResult, function(...) - local arg = {...} + local arg = { ... } local over = arg[1] local info = arg[2] local win_seat = arg[3] local remaincards = arg[4] -- local energyTab = arg[5] local otherpoker_list = self._view:GetChild("otherpoker_list") - + if self.MypokerList ~= nil then -- body local card_info = self._player_card_info[self:GetPos(self._room.self_player.seat)] @@ -843,12 +832,12 @@ function M:EventInit() if otherpoker_list ~= nil then -- body otherpoker_list:RemoveChildrenToPool() - otherpoker_list.visible=true + otherpoker_list.visible = true end - - if remaincards then + + if remaincards then -- body - local newremaincards = _gamectr:ChangeCodeByFrom(remaincards,true) + local newremaincards = _gamectr:ChangeCodeByFrom(remaincards, true) table.sort(remaincards) for i = #newremaincards, 1, -1 do coroutine.start(function() @@ -858,27 +847,27 @@ function M:EventInit() local num = (newremaincards[i] - (newremaincards[i] % 10)) / 10 local card_n = flow * 100 + num local poker_item = UIPackage.CreateObject("Extend_Poker_RunFastNew", "poker6") - + --local code = self:ChangeCodeByTo(card_n) -- local card_code_obj = UIPackage.CreateObjectFromURL("ui://Extend_Poker_RunFast/" .. card_n) -- local card_code_obj = UIPackage.CreateObjectFromURL("ui://Main_Poker/" .. card_n .. "_2") local card_code_obj = nil - if DataManager.CurrenRoom.pai==0 then - if card_n==310 and DataManager.CurrenRoom.room_config.Heart10 == 1 then + if DataManager.CurrenRoom.pai == 0 then + if card_n == 310 and DataManager.CurrenRoom.room_config.Heart10 == 1 then -- body - card_code_obj = UIPackage.CreateObjectFromURL("ui://Extend_Poker_RunFastNew/"..card_n.."_1") + card_code_obj = UIPackage.CreateObjectFromURL("ui://Extend_Poker_RunFastNew/" .. card_n .. + "_1") else - card_code_obj = UIPackage.CreateObjectFromURL("ui://Extend_Poker_RunFastNew/"..card_n) + card_code_obj = UIPackage.CreateObjectFromURL("ui://Extend_Poker_RunFastNew/" .. card_n) end - else - if card_n==310 and DataManager.CurrenRoom.room_config.Heart10 == 1 then + if card_n == 310 and DataManager.CurrenRoom.room_config.Heart10 == 1 then -- body - card_code_obj = UIPackage.CreateObjectFromURL("ui://Extend_Poker_RunFastNew/"..card_n.."_2") + card_code_obj = UIPackage.CreateObjectFromURL("ui://Extend_Poker_RunFastNew/" .. card_n .. + "_2") else card_code_obj = UIPackage.CreateObjectFromURL("ui://Main_Poker/" .. card_n .. "_2") end - end if card_code_obj ~= nil then card_code_obj:SetScale(0.6, 0.6) @@ -886,29 +875,24 @@ function M:EventInit() poker_item:AddChild(card_code_obj) otherpoker_list:AddChild(poker_item) end - end - end) - - end - end if self._cor_sound ~= nil then coroutine.stop(self._cor_sound) self._cor_sound = nil end - - if self.destory_win ~= nil then - coroutine.stop(self.destory_win) + + if self.destory_win ~= nil then + coroutine.stop(self.destory_win) end - + self.destory_win = nil self.destory_win = coroutine.start(function() -- print("11111111111111") -- coroutine.wait(1) - if self._room.self_player.seat == win_seat then + if self._room.self_player.seat == win_seat then local sprint_seat_list = self:GetSpringSeats(info) if #sprint_seat_list > 0 then local url = "ui://Extend_Poker_RunFastNew/Spring" @@ -919,27 +903,23 @@ function M:EventInit() ViewUtil.PlaySound("RunFastNew_PK", "base/common/sound/win new.mp3") end -- local url = #sprint_seat_list > 0 and "ui://Extend_Poker_RunFastNew/Spring" or "ui://Extend_Poker_RunFastNew/Win_Mine" - - else local beigang = false - if #self:GetSpringSeats(info)>0 then - for i=1,#self:GetSpringSeats(info) do - if self:GetSpringSeats(info)[i]==self._room.self_player.seat then - local url = "ui://Extend_Poker_RunFastNew/spring2" + if #self:GetSpringSeats(info) > 0 then + for i = 1, #self:GetSpringSeats(info) do + if self:GetSpringSeats(info)[i] == self._room.self_player.seat then + local url = "ui://Extend_Poker_RunFastNew/spring2" self.WinItem_view = UIPackage.CreateObjectFromURL(url) self._view:AddChild(self.WinItem_view) self.WinItem_view:Center() self.WinItem_view:GetTransition("t0"):Play() - beigang=true + beigang = true end end - end -- if beigang == false then -- self:CreateRankEff() -- end - end for i = 1, #info do local player = info[i] @@ -965,13 +945,13 @@ function M:EventInit() rt = self._room.score_times end if over == 1 and self._room.hpOnOff == 1 then - head_info:UpdateScore(player.score / 10) --不可负分 + head_info:UpdateScore(player.score / 10) --不可负分 else head_info:UpdateScore(player.score * rt) end card_info:PlayScore(player.winscore * rt, false, win_seat == player.seat) end - + if player.seat ~= self._room.self_player.seat then card_info:UpdateHandPoker(player.cards, false, true) @@ -987,8 +967,9 @@ function M:EventInit() -- print("333333333333333333") -- coroutine.wait(2) end - - self.result_view = RunFast_ResultView.new(self._root_view, info, self._room.room_id, over, win_seat, 0, remaincards) + + self.result_view = RunFast_ResultView.new(self._root_view, info, self._room.room_id, over, win_seat, 0, + remaincards) self.result_view:Show() if self.WinItem_view ~= nil then self.WinItem_view:Dispose() @@ -1000,50 +981,48 @@ function M:EventInit() end if self._room.self_player.entrust == true then - local btn_confirm = self.result_view._view:GetChild("btn_confirm") + local btn_confirm = self.result_view._view:GetChild("btn_confirm") btn_confirm.onClick:Call() end - -- local _actionView = UIPackage.CreateObject("Common", "Btn_Yellow") - -- _actionView.icon = "ui://Common/btn_comfirm" - -- _actionView.onClick:Set(function () - -- --local _gamectr = ControllerManager.GetController(GameController) - -- _gamectr:ConformToNextGame() - -- _actionView:Dispose() - -- end) - -- _actionView.xy = Vector2(900, 625) - -- self._view:AddChild(_actionView) - -- else - -- coroutine.wait(4) - -- self.result_view = RunFast_ResultView.new(self._root_view,info,self._room.room_id) - -- self.result_view:Show() - -- end + -- local _actionView = UIPackage.CreateObject("Common", "Btn_Yellow") + -- _actionView.icon = "ui://Common/btn_comfirm" + -- _actionView.onClick:Set(function () + -- --local _gamectr = ControllerManager.GetController(GameController) + -- _gamectr:ConformToNextGame() + -- _actionView:Dispose() + -- end) + -- _actionView.xy = Vector2(900, 625) + -- self._view:AddChild(_actionView) + -- else + -- coroutine.wait(4) + -- self.result_view = RunFast_ResultView.new(self._root_view,info,self._room.room_id) + -- self.result_view:Show() + -- end end) - if over==1 then + if over == 1 then -- body self:UnmarkSelfTuoguan() ControllerManager.ChangeController(LoddyController) - end end) - - _gamectr:AddEventListener(RunFast_GameEvent.OnResultByDissolve, function(...) - - local arg = {...} - local over = arg[1] - local info = arg[2] - local winseat = arg[3] - local dissolve = arg[4] - self.result_view = RunFast_ResultView.new(self._root_view, info, self._room.room_id, over, winseat, dissolve,nil) - self.result_view:Show() - ControllerManager.ChangeController(LoddyController) - self:UnmarkSelfTuoguan() + _gamectr:AddEventListener(RunFast_GameEvent.OnResultByDissolve, function(...) + local arg = { ... } + local over = arg[1] + local info = arg[2] + local winseat = arg[3] + local dissolve = arg[4] + + self.result_view = RunFast_ResultView.new(self._root_view, info, self._room.room_id, over, winseat, dissolve, nil) + self.result_view:Show() + ControllerManager.ChangeController(LoddyController) + self:UnmarkSelfTuoguan() end) - + -- 确定开始下一局 成功 _gamectr:AddEventListener(RunFast_GameEvent.OnConfrimToNextGameSucc, function(...) - local arg = {...} + local arg = { ... } local aid = arg[1] local p = self._room:GetPlayerById(aid) if p.seat == self._room.self_player.seat then @@ -1062,24 +1041,31 @@ function M:EventInit() local otherpoker_list = self._view:GetChild("otherpoker_list") if otherpoker_list ~= nil then -- body - otherpoker_list.visible=false + otherpoker_list.visible = false otherpoker_list:RemoveChildrenToPool() end - --player_head._view:GetController("Oener").selectedIndex=0 + --player_head._view:GetController("Oener").selectedIndex=0 end end local player_info = self._player_info[self:GetPos(p.seat)] player_info:Ready(true) end) + + _gamectr:AddEventListener(RunFast_GameEvent.OnDaNiao, function(...) + local arg = { ... } + -- local seat = arg[1] + -- local piao = arg[2] + -- local head_info = self._player_info[self:GetPos(1)] + self._ctr_action.selectedIndex = 3 + end) end function M:ReConnectForStart() - local _gamectr = ControllerManager.GetController(GameController) self._room.is_new_bout = _gamectr:GetIsNewBout(self._room.curren_turn_seat) self._state.selectedIndex = 1 self._view:GetController("time").selectedIndex = self:GetPos(self._room.curren_turn_seat) - + self:UpdateRound(self._room.curren_round) for _, player in ipairs(self._room.player_list) do local player_card_info = self._player_card_info[self:GetPos(player.seat)] @@ -1105,40 +1091,33 @@ function M:ReConnectForStart() end head_info:UpdateScore(player.total_score * rt) end - + head_info:UpdateLineState(player.line_state) head_info:UpdatePiao(player.piao) - - if head_info._view:GetChild("shengyu")~=nil and head_info._view:GetController("shengyu")~=nil then + + if head_info._view:GetChild("shengyu") ~= nil and head_info._view:GetController("shengyu") ~= nil then -- body - - - if self._room.room_config.showlength==1 then + + + if self._room.room_config.showlength == 1 then -- body - head_info._view:GetController("shengyu").selectedIndex=1 + head_info._view:GetController("shengyu").selectedIndex = 1 else - head_info._view:GetController("shengyu").selectedIndex=0 + head_info._view:GetController("shengyu").selectedIndex = 0 end - - -- body - head_info._view:GetChild("shengyu"):GetChild("shengyu").text="剩"..player.hand_count.."张" - - - + + -- body + head_info._view:GetChild("shengyu"):GetChild("shengyu").text = "剩" .. player.hand_count .. "张" end if player.seat == self._room.self_player.seat then - if player.open ~= nil and player.open == 0 and self._room.room_config.people_num==3 and self._room.room_config.fangzuobi==1 then + if player.open ~= nil and player.open == 0 and self._room.room_config.people_num == 3 and self._room.room_config.fangzuobi == 1 then -- body self.MypokerList = player.hand_list player_card_info:InitPoker(player.hand_list, false, 1) - else - player_card_info:InitPoker(player.hand_list, false) end - else - player_card_info:SetRemainCardNumber(player.hand_count == 1) if player.hand_count == 1 then self.bgm_index = 2 @@ -1164,7 +1143,7 @@ function M:ReconnectForClearing() for _, player in ipairs(self._room.player_list) do local head_info = self._player_info[self:GetPos(player.seat)] local player_card_info = self._player_card_info[self:GetPos(player.seat)] - + --如果是体力值不可负分模式 则显示当前的hp值 if player.hp_info ~= nil and player.hp_info.cur_hp ~= nil then head_info:UpdateScore(d2ad(player.hp_info.cur_hp)) @@ -1190,93 +1169,88 @@ function M:ReconnectForClearing() head_info:UpdateLineState(player.line_state) --head_info._view:GetController("Oener").selectedIndex=0 head_info:UpdatePiao(player.piao) - if head_info._view:GetChild("shengyu")~=nil and head_info._view:GetController("shengyu")~=nil then + if head_info._view:GetChild("shengyu") ~= nil and head_info._view:GetController("shengyu") ~= nil then -- body - - if self._room.room_config.showlength==1 then - -- body - head_info._view:GetController("shengyu").selectedIndex=1 - else - head_info._view:GetController("shengyu").selectedIndex=0 - end - - -- body - head_info._view:GetChild("shengyu"):GetChild("shengyu").text="剩"..player.hand_count.."张" - - end - - - if player.seat == self._room.self_player.seat then + if self._room.room_config.showlength == 1 then + -- body + head_info._view:GetController("shengyu").selectedIndex = 1 + else + head_info._view:GetController("shengyu").selectedIndex = 0 + end + + -- body + head_info._view:GetChild("shengyu"):GetChild("shengyu").text = "剩" .. player.hand_count .. "张" + end + + + if player.seat == self._room.self_player.seat then player_card_info:InitPoker(player.hand_list, false) else player_card_info:UpdateHandPoker(player.hand_list, false, true) end if player.out_card_list[1] == 0 then - player_card_info:SetOutCardInfo(nil, false) else player_card_info:SetOutCardInfo(player.out_card_list, false) end end - win_seat=self._room.winseat + win_seat = self._room.winseat self._room.winseat = nil - + local remaincards = self._room.remaincards - if self._room.game_status==1 then - - + if self._room.game_status == 1 then -- body coroutine.start(function() coroutine.wait(0.3) - - self.result_view = RunFast_ResultView.new(self._root_view, self._room.player_list, self._room.room_id, 0, win_seat,0,remaincards) - self.result_view:Show() - local card_info = self._player_card_info[1] - card_info._view:GetChild("out_card_list").visible=true - end) - if remaincards then - local newremaincards = self._gamectr:ChangeCodeByFrom(remaincards,true) - + self.result_view = RunFast_ResultView.new(self._root_view, self._room.player_list, self._room.room_id, 0, + win_seat, 0, remaincards) + self.result_view:Show() + local card_info = self._player_card_info[1] + card_info._view:GetChild("out_card_list").visible = true + end) + if remaincards then + local newremaincards = self._gamectr:ChangeCodeByFrom(remaincards, true) + -- body local otherpoker_list = self._view:GetChild("otherpoker_list") - + if otherpoker_list ~= nil then -- body otherpoker_list:RemoveChildrenToPool() - otherpoker_list.visible=true + otherpoker_list.visible = true end for i = #newremaincards, 1, -1 do coroutine.start(function() coroutine.wait(0.1 * (15 - i)) - + local flow = newremaincards[i] % 10 local num = (newremaincards[i] - (newremaincards[i] % 10)) / 10 local card_n = flow * 100 + num local poker_item = UIPackage.CreateObject("Extend_Poker_RunFastNew", "poker6") - + --local code = self:ChangeCodeByTo(card_n) -- local card_code_obj = UIPackage.CreateObjectFromURL("ui://Extend_Poker_RunFast/" .. card_n) -- local card_code_obj = UIPackage.CreateObjectFromURL("ui://Main_Poker/" .. card_n .. "_2") local card_code_obj - if DataManager.CurrenRoom.pai==0 then - card_code_obj = UIPackage.CreateObjectFromURL("ui://Extend_Poker_RunFastNew/"..card_n) + if DataManager.CurrenRoom.pai == 0 then + card_code_obj = UIPackage.CreateObjectFromURL("ui://Extend_Poker_RunFastNew/" .. card_n) else - card_code_obj = UIPackage.CreateObjectFromURL("ui://Main_Poker/" .. card_n .. "_2") + card_code_obj = UIPackage.CreateObjectFromURL("ui://Main_Poker/" .. card_n .. "_2") end - if card_n==310 and DataManager.CurrenRoom.room_config.Heart10 == 1 then + if card_n == 310 and DataManager.CurrenRoom.room_config.Heart10 == 1 then -- body - card_code_obj = UIPackage.CreateObjectFromURL("ui://Extend_Poker_RunFastNew/"..card_n.."_1") + card_code_obj = UIPackage.CreateObjectFromURL("ui://Extend_Poker_RunFastNew/" .. card_n .. "_1") end card_code_obj:SetScale(0.6, 0.6) poker_item:AddChild(card_code_obj) otherpoker_list:AddChild(poker_item) end) end - end + end end end @@ -1287,11 +1261,11 @@ function M:CreateRankEff() self.rank_view:GetTransition("t0"):Play() end -function M:_Effect( type1 ,player) +function M:_Effect(type1, player) -- body - - if type1 < 7 and type1 ~= 4 and type1 ~= 5 then - return + + if type1 < 7 and type1 ~= 4 and type1 ~= 5 then + return end local eff_code = 0 if type1 == 10 then @@ -1309,35 +1283,35 @@ function M:_Effect( type1 ,player) end local info = self._player_card_info[self:GetPos(player.seat)] local pNode = info._mask_liangpai - local effect = UIPackage.CreateObjectFromURL("ui://Extend_Poker_RunFastNew/eff_"..eff_code) + local effect = UIPackage.CreateObjectFromURL("ui://Extend_Poker_RunFastNew/eff_" .. eff_code) -- local effect = UIPackage.CreateObjectFromURL("ui://Extend_Poker_RunFastNew/eff2_1") effect.touchable = false effect:GetTransition("t0"):Play() -- effect:SetXY((self._view.width - effect.width) / 2,(self._view.hight - effect.hight) / 2) - if eff_code==3 then + if eff_code == 3 then self._view:AddChild(effect) else pNode:AddChild(effect) end - - if eff_code==1 then + + if eff_code == 1 then self.eff_feiji = UIPackage.CreateObjectFromURL("ui://Extend_Poker_RunFastNew/eff_feiji") self._view:AddChild(self.eff_feiji) self.eff_feiji:Center() self.eff_feiji:GetTransition("t0"):Play() end - if eff_code==3 then + if eff_code == 3 then effect:Center() else - if self:GetPos(player.seat)== 1 then - effect.x,effect.y = 0,24 + if self:GetPos(player.seat) == 1 then + effect.x, effect.y = 0, 24 else - effect.x,effect.y = 24,67 + effect.x, effect.y = 24, 67 end end - - + + -- effect:Center() -- if eff_code ==3 then -- coroutine.start(function() @@ -1347,53 +1321,54 @@ function M:_Effect( type1 ,player) -- else coroutine.start(function() coroutine.wait(1) - if self.eff_feiji~=nil then + if self.eff_feiji ~= nil then self.eff_feiji:Dispose() end effect:Dispose() end) -- end end + -- function M:_Effect(type1, player) - -- if type1 < 7 and type1 ~= 4 then return end - -- local eff_code = 0 - -- if type1 == 10 then --顺子 - -- eff_code = 2 - -- elseif type1 == 11 then --炸 - -- eff_code = 3 - -- elseif type1 == 4 then --连对 - -- eff_code = 4 - -- else - -- eff_code = 6 - -- end - -- local info = self._player_card_info[self:GetPos(player.seat)] - -- local pNode = info._mask_liangpai - -- local effect = UIPackage.CreateObjectFromURL("ui://Extend_Poker_RunFast/MovieClip" .. eff_code) - - -- effect.touchable = false - - -- --effect:SetXY((self._view.width - effect.width) / 2,(self._view.hight - effect.hight) / 2) - -- pNode:AddChild(effect) - -- if type1 == 10 then --顺子 - -- effect.x, effect.y = -400, -200 - -- elseif type1 == 11 then --炸 - -- effect.x, effect.y = -80, -225 - -- elseif type1 == 4 then --连对 - -- effect.x, effect.y = -400, -200 - -- else - -- effect.x, effect.y = -157, -140 - -- end - -- coroutine.start(function() - -- if type1== 10 or type1== 11 or type1== 4 then - -- -- body - -- coroutine.wait(2) - -- effect:Dispose() - -- else - -- coroutine.wait(1.2) - -- effect:Dispose() - -- end - - -- end) +-- if type1 < 7 and type1 ~= 4 then return end +-- local eff_code = 0 +-- if type1 == 10 then --顺子 +-- eff_code = 2 +-- elseif type1 == 11 then --炸 +-- eff_code = 3 +-- elseif type1 == 4 then --连对 +-- eff_code = 4 +-- else +-- eff_code = 6 +-- end +-- local info = self._player_card_info[self:GetPos(player.seat)] +-- local pNode = info._mask_liangpai +-- local effect = UIPackage.CreateObjectFromURL("ui://Extend_Poker_RunFast/MovieClip" .. eff_code) + +-- effect.touchable = false + +-- --effect:SetXY((self._view.width - effect.width) / 2,(self._view.hight - effect.hight) / 2) +-- pNode:AddChild(effect) +-- if type1 == 10 then --顺子 +-- effect.x, effect.y = -400, -200 +-- elseif type1 == 11 then --炸 +-- effect.x, effect.y = -80, -225 +-- elseif type1 == 4 then --连对 +-- effect.x, effect.y = -400, -200 +-- else +-- effect.x, effect.y = -157, -140 +-- end +-- coroutine.start(function() +-- if type1== 10 or type1== 11 or type1== 4 then +-- -- body +-- coroutine.wait(2) +-- effect:Dispose() +-- else +-- coroutine.wait(1.2) +-- effect:Dispose() +-- end + +-- end) -- if eff_code ==3 then -- coroutine.start(function() -- coroutine.wait(1) @@ -1467,17 +1442,17 @@ function M:PlayCardEff(card) -- local card_code_obj = UIPackage.CreateObjectFromURL("ui://Extend_Poker_RunFast/" .. card) -- local card_code_obj = UIPackage.CreateObjectFromURL("ui://Main_Poker/" .. card .. "_2") local card_code_obj - if DataManager.CurrenRoom.pai==0 then - card_code_obj = UIPackage.CreateObjectFromURL("ui://Extend_Poker_RunFastNew/"..card) + if DataManager.CurrenRoom.pai == 0 then + card_code_obj = UIPackage.CreateObjectFromURL("ui://Extend_Poker_RunFastNew/" .. card) else - card_code_obj = UIPackage.CreateObjectFromURL("ui://Main_Poker/" .. card .. "_2") + card_code_obj = UIPackage.CreateObjectFromURL("ui://Main_Poker/" .. card .. "_2") end - if card_code_obj then - card_code_obj:SetScale(1, 1) - poker_obj:AddChild(card_code_obj) - card_code_obj.visible = true - end - + if card_code_obj then + card_code_obj:SetScale(1, 1) + poker_obj:AddChild(card_code_obj) + card_code_obj.visible = true + end + self.tween = TweenUtils.TweenFloat(0, 2340, cor_time, function(x) poker_back.rotationY = x poker_obj.rotationY = -180 + x @@ -1493,7 +1468,6 @@ function M:PlayCardEff(card) coroutine.wait(1) self._popEvent = true end) - end function M:ResetPoker() @@ -1504,8 +1478,7 @@ function M:ResetPoker() end function M:PlaySound(sex, path) - - local sex_path = ViewUtil.Sex_Chat[sex]-- 1 男 2 女 + local sex_path = ViewUtil.Sex_Chat[sex] -- 1 男 2 女 local sound_path = string.format("extend/poker/runfast/sound/%s/%s.mp3", sex_path, path) ViewUtil.PlaySound("RunFastNew_PK", sound_path) end @@ -1518,11 +1491,12 @@ function M:ChangeBgmMusic(bgm_index) end ViewUtil.PlayMuisc("RunFastNew_PK", string.format("extend/poker/runfast/sound/bgm%d.mp3", 1)) end -function M:OnPlayerEnter( ... ) - local arg = {...} + +function M:OnPlayerEnter(...) + local arg = { ... } local p = arg[1] - for i=1,#self._room.player_list do - if self._room.self_player.seat==self._room.player_list[i].seat and self._room.self_player.self_user.account_id ~= self._room.player_list[i].self_user.account_id then + for i = 1, #self._room.player_list do + if self._room.self_player.seat == self._room.player_list[i].seat and self._room.self_player.self_user.account_id ~= self._room.player_list[i].self_user.account_id then -- body local ErrorMsgTip = UIPackage.CreateObject("Common", "Win_ConnectTip") local _action = self._view:AddChild(ErrorMsgTip) @@ -1531,26 +1505,26 @@ function M:OnPlayerEnter( ... ) local btn1 = _action:GetChild("btn_connect") local btn2 = _action:GetChild("btn_back") text.text = "您来晚了,座位有人,请重新进牌桌" - btn1.visible=false + btn1.visible = false btn2:Center() - btn2.y=btn2.y+50 + btn2.y = btn2.y + 50 btn2.onClick:Set(function() - -- body - ErrorMsgTip:Destroy() - ErrorMsgTip = nil - self._gamectr:LevelRoom(function(res) - ViewUtil.CloseModalWait() - NetResetConnectWindow.CloseNetReset() - ControllerManager.ChangeController(LoddyController) - ViewManager.ChangeView(ViewManager.View_Lobby) - end) + -- body + ErrorMsgTip:Destroy() + ErrorMsgTip = nil + self._gamectr:LevelRoom(function(res) + ViewUtil.CloseModalWait() + NetResetConnectWindow.CloseNetReset() + ControllerManager.ChangeController(LoddyController) + ViewManager.ChangeView(ViewManager.View_Lobby) + end) end) end end -- if p ~= self._room.self_player and self._room.room_config.people_num <= 4 and self._room.room_config.people_num >= 3 and self._gamectr:CheckGPS() then -- if self.distance_view then -- self.distance_view:Destroy() - -- end + -- end -- self.distance_view = PlayerDistanceView.new(true) -- self.distance_view:Show() -- end diff --git a/lua_probject/extend_project/extend/poker/runfast/RunFast_Protocol.lua b/lua_probject/extend_project/extend/poker/runfast/RunFast_Protocol.lua index 6fcf50a9..b5a937b8 100644 --- a/lua_probject/extend_project/extend/poker/runfast/RunFast_Protocol.lua +++ b/lua_probject/extend_project/extend/poker/runfast/RunFast_Protocol.lua @@ -3,41 +3,45 @@ --- DateTime: 2017/12/13 10:51 --- local RunFast_Protocol = { - RunFast_ConfirmToNextGame = "1003", + RunFast_ConfirmToNextGame = "1003", - RunFast_Send_Card = "1013", + RunFast_Send_Card = "1013", - RunFast_Send_Guo = "1014", + RunFast_Send_Guo = "1014", - RunFast_Send_Piao = "1015", + RunFast_Send_Piao = "1015", - RunFast_Ming_Card = "2117", + RunFast_Ming_Card = "2117", - RunFast_Init_Card = "2011", + RunFast_Init_Card = "2011", - RunFast_Options = "2004", + RunFast_Options = "2004", - RunFast_Index_Move = "2016", + RunFast_Index_Move = "2016", - RunFast_Play_Succ = "2021", + RunFast_Play_Succ = "2021", - RunFast_Pass_Succ = "2030", + RunFast_Pass_Succ = "2030", - RunFast_Put_Error = "2111", + RunFast_Put_Error = "2111", - RunFast_Bomb_Score = "2118", + RunFast_Bomb_Score = "2118", - RunFast_Result = "2007", - RunFast_Piao_Tip = "2031", - RunFast_Piao_Action = "2032", + RunFast_Result = "2007", + RunFast_Piao_Tip = "2031", + RunFast_Piao_Action = "2032", RunFast_ConfirmToNextGameSucc = "2010", - PT_GAMETUOGUAN = "2029",--托管 - SEND_TUOGUAN = "1018",--托管 - GAME_XIPAI = "20836", - GAME_EVENT_XIPAI = "20837", - GAME_EVENT_NOTIFY_XIPAI = "20838", - GAME_EVT_CARDINHAND = "202022", + PT_GAMETUOGUAN = "2029", --托管 + SEND_TUOGUAN = "1018", --托管 + GAME_XIPAI = "20836", + GAME_EVENT_XIPAI = "20837", + GAME_EVENT_NOTIFY_XIPAI = "20838", + GAME_EVT_CARDINHAND = "202022", + + --打鸟 + GAME_EVT_DANIAO_TIP = "832", + GAME_DANIAO = "831" } -return RunFast_Protocol \ No newline at end of file +return RunFast_Protocol diff --git a/wb_new_ui/.objs/fonts.json b/wb_new_ui/.objs/fonts.json index e5dd2085..af36c5ed 100644 --- a/wb_new_ui/.objs/fonts.json +++ b/wb_new_ui/.objs/fonts.json @@ -53,3 +53,4 @@ ui://4skil1l6vmtu1kv ui://4skil1l6vmtu1l8 ui://4skil1l6piv91ln ui://4skil1l6jsw9117 +ui://m7iejg46eany7iev diff --git a/wb_new_ui/.objs/metas/0khx14ar/e0py2.info b/wb_new_ui/.objs/metas/0khx14ar/e0py2.info index 92f8ad93..2b254b08 100644 --- a/wb_new_ui/.objs/metas/0khx14ar/e0py2.info +++ b/wb_new_ui/.objs/metas/0khx14ar/e0py2.info @@ -1,10 +1,16 @@ { "objectStatus": { + "n28_thxk": { + "hidden": true + }, "n24_xn94": { "hidden": true }, "n18_nld2": { "hidden": true + }, + "n20_nld2": { + "hidden": true } }, "adaptiveTest": true, diff --git a/wb_new_ui/.objs/metas/9n9stu2e/prgzet.info b/wb_new_ui/.objs/metas/9n9stu2e/prgzet.info index b0834075..b1e22b80 100644 --- a/wb_new_ui/.objs/metas/9n9stu2e/prgzet.info +++ b/wb_new_ui/.objs/metas/9n9stu2e/prgzet.info @@ -1,6 +1,6 @@ { "objectStatus": { - "n7": { + "n1": { "hidden": true }, "n20_qpk6": { @@ -8,6 +8,12 @@ }, "n15_qpk6": { "hidden": true + }, + "n7": { + "hidden": true + }, + "n21_n6fs": { + "hidden": true } } } \ No newline at end of file diff --git a/wb_new_ui/.objs/metas/9n9stu2e/prgzf0.info b/wb_new_ui/.objs/metas/9n9stu2e/prgzf0.info index dadf2836..e52e1aac 100644 --- a/wb_new_ui/.objs/metas/9n9stu2e/prgzf0.info +++ b/wb_new_ui/.objs/metas/9n9stu2e/prgzf0.info @@ -1,8 +1,5 @@ { "objectStatus": { - "n13": { - "collapsed": true - }, "n93_eclw": { "collapsed": true }, diff --git a/wb_new_ui/.objs/metas/m7iejg46/10snh5j.info b/wb_new_ui/.objs/metas/m7iejg46/10snh5j.info index 3ac0cd9a..53873452 100644 --- a/wb_new_ui/.objs/metas/m7iejg46/10snh5j.info +++ b/wb_new_ui/.objs/metas/m7iejg46/10snh5j.info @@ -9,6 +9,9 @@ "n214_ovii": { "hidden": true }, + "n74_i7lq": { + "locked": true + }, "n229_csp4": { "hidden": true }, diff --git a/wb_new_ui/.objs/metas/m7iejg46/kwi0hmd.info b/wb_new_ui/.objs/metas/m7iejg46/kwi0hmd.info index 9e26dfee..b593e373 100644 --- a/wb_new_ui/.objs/metas/m7iejg46/kwi0hmd.info +++ b/wb_new_ui/.objs/metas/m7iejg46/kwi0hmd.info @@ -1 +1,7 @@ -{} \ No newline at end of file +{ + "objectStatus": { + "n44_ugxq": { + "hidden": true + } + } +} \ No newline at end of file diff --git a/wb_new_ui/.objs/metas/m7iejg46/kwi0hme.info b/wb_new_ui/.objs/metas/m7iejg46/kwi0hme.info index f893ff4d..b8a5af26 100644 --- a/wb_new_ui/.objs/metas/m7iejg46/kwi0hme.info +++ b/wb_new_ui/.objs/metas/m7iejg46/kwi0hme.info @@ -1,7 +1,7 @@ { "objectStatus": { - "n2_l0gd": { - "locked": true + "n16_hp03": { + "hidden": true } } } \ No newline at end of file diff --git a/wb_new_ui/.objs/metas/m7iejg46/l679hws.info b/wb_new_ui/.objs/metas/m7iejg46/l679hws.info index a086b7cd..178964c4 100644 --- a/wb_new_ui/.objs/metas/m7iejg46/l679hws.info +++ b/wb_new_ui/.objs/metas/m7iejg46/l679hws.info @@ -1,11 +1,5 @@ { "objectStatus": { - "n121_l679": { - "collapsed": true - }, - "n112_kwi0": { - "collapsed": true - }, "n122_j120": { "hidden": true } diff --git a/wb_new_ui/.objs/metas/m7iejg46/r0qx7i6v.info b/wb_new_ui/.objs/metas/m7iejg46/r0qx7i6v.info index 6f7a9a6a..8b6fe231 100644 --- a/wb_new_ui/.objs/metas/m7iejg46/r0qx7i6v.info +++ b/wb_new_ui/.objs/metas/m7iejg46/r0qx7i6v.info @@ -3,8 +3,8 @@ "n68_joap": { "hidden": true }, - "n28_r8m8": { - "collapsed": true + "n51_r0qx": { + "hidden": true }, "n67_joap": { "hidden": true diff --git a/wb_new_ui/.objs/metas/m7iejg46/t1hqhxw.info b/wb_new_ui/.objs/metas/m7iejg46/t1hqhxw.info new file mode 100644 index 00000000..9e26dfee --- /dev/null +++ b/wb_new_ui/.objs/metas/m7iejg46/t1hqhxw.info @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/wb_new_ui/.objs/workspace.json b/wb_new_ui/.objs/workspace.json index c1edec0a..788a233d 100644 --- a/wb_new_ui/.objs/workspace.json +++ b/wb_new_ui/.objs/workspace.json @@ -1,5 +1,5 @@ { - "libview.firstColumnWidth": 297, + "libview.firstColumnWidth": 522, "expanded_nodes": [ "27vd145b", "/", diff --git a/wb_new_ui/assets/Common/font/images/win/cha.png b/wb_new_ui/assets/Common/font/images/win/cha.png index 34a915ae..e477920b 100644 Binary files a/wb_new_ui/assets/Common/font/images/win/cha.png and b/wb_new_ui/assets/Common/font/images/win/cha.png differ diff --git a/wb_new_ui/assets/Extend_Poker_RunFastNew/component/Result/Group 643.png b/wb_new_ui/assets/Extend_Poker_RunFastNew/component/Result/Group 643.png new file mode 100644 index 00000000..ea7d29de Binary files /dev/null and b/wb_new_ui/assets/Extend_Poker_RunFastNew/component/Result/Group 643.png differ diff --git a/wb_new_ui/assets/Extend_Poker_RunFastNew/component/Result/Group 644.png b/wb_new_ui/assets/Extend_Poker_RunFastNew/component/Result/Group 644.png new file mode 100644 index 00000000..fe236be3 Binary files /dev/null and b/wb_new_ui/assets/Extend_Poker_RunFastNew/component/Result/Group 644.png differ diff --git a/wb_new_ui/assets/Extend_Poker_RunFastNew/component/Result/Group 645.png b/wb_new_ui/assets/Extend_Poker_RunFastNew/component/Result/Group 645.png new file mode 100644 index 00000000..74d6fa19 Binary files /dev/null and b/wb_new_ui/assets/Extend_Poker_RunFastNew/component/Result/Group 645.png differ diff --git a/wb_new_ui/assets/Extend_Poker_RunFastNew/component/Result/Group 646.png b/wb_new_ui/assets/Extend_Poker_RunFastNew/component/Result/Group 646.png new file mode 100644 index 00000000..5b3f5b9d Binary files /dev/null and b/wb_new_ui/assets/Extend_Poker_RunFastNew/component/Result/Group 646.png differ diff --git a/wb_new_ui/assets/Extend_Poker_RunFastNew/component/Result/btn_buDaNiao.xml b/wb_new_ui/assets/Extend_Poker_RunFastNew/component/Result/btn_buDaNiao.xml new file mode 100644 index 00000000..99ecbdcd --- /dev/null +++ b/wb_new_ui/assets/Extend_Poker_RunFastNew/component/Result/btn_buDaNiao.xml @@ -0,0 +1,10 @@ + + + + + + + + +