diff --git a/lua_probject/base_project/Game/View/ChatView.lua b/lua_probject/base_project/Game/View/ChatView.lua index 52e382d5..ebe8d79a 100644 --- a/lua_probject/base_project/Game/View/ChatView.lua +++ b/lua_probject/base_project/Game/View/ChatView.lua @@ -1,4 +1,3 @@ - ---聊天View对象 local ChatView = {} @@ -6,25 +5,26 @@ local M = ChatView function ChatView.new(main_view) UIPackage.AddPackage("base/chat/ui/Chat") - setmetatable(M, {__index = BaseWindow}) - local self = setmetatable({}, {__index = M}) + setmetatable(M, { __index = BaseWindow }) + local self = setmetatable({}, { __index = M }) self.class = "ChatView" + -- self._animation = false self._main_view = main_view self._blur_view = main_view._root_view - + self:init("ui://Chat/Main") return self -end +end function M:init(url) - BaseWindow.init(self,url) + BaseWindow.init(self, url) local lit_biaoqing1 = self._view:GetChild("lit_biaoqing1") - lit_biaoqing1.onClickItem:Set(function (context) + lit_biaoqing1.onClickItem:Set(function(context) local _gamectr = ControllerManager.GetController(GameController) - _gamectr:SendInteraction(DataManager.SelfUser.account_id, 1, context.data.name ) + _gamectr:SendInteraction(DataManager.SelfUser.account_id, 1, context.data.name) self:Close() end) - + -- local lit_biaoqing2 = self._view:GetChild("lit_biaoqing2") -- lit_biaoqing2.onClickItem:Set(function (context) @@ -46,15 +46,14 @@ function M:init(url) local tex_chat = self._view:GetChild("tex_chat") local btn_send = self._view:GetChild("btn_send") - btn_send.onClick:Set(function( ... ) + btn_send.onClick:Set(function(...) local chat_text = tex_chat.text - if string.utf8len(chat_text) >0 then + if string.utf8len(chat_text) > 0 then local _gamectr = ControllerManager.GetController(GameController) - _gamectr:SendInteraction(DataManager.SelfUser.account_id, 4,chat_text) + _gamectr:SendInteraction(DataManager.SelfUser.account_id, 4, chat_text) self:Close() end end) - end function M:FillChatMsg() @@ -63,18 +62,18 @@ function M:FillChatMsg() if language == 1 then chat_msg = self._main_view.Fix_Msg_Chat2 else - chat_msg = self._main_view.Fix_Msg_Chat + chat_msg = self._main_view.Fix_Msg_Chat end local lit_yuyin = self._view:GetChild("lit_yuyin") lit_yuyin:RemoveChildrenToPool() - for i = 1 , #chat_msg do + for i = 1, #chat_msg do local btn = lit_yuyin:AddItemFromPool() btn.data = tostring(i) btn.text = chat_msg[i] - btn.onClick:Set(function(context) + btn.onClick:Set(function(context) local g = context.sender local _gamectr = ControllerManager.GetController(GameController) - local msg = g.data + language * 100 + local msg = g.data + language * 100 _gamectr:SendInteraction(DataManager.SelfUser.account_id, 2, msg) self:Close() end) diff --git a/lua_probject/base_project/Game/View/Common/BaseWindow.lua b/lua_probject/base_project/Game/View/Common/BaseWindow.lua index 3232b1a6..e654134c 100644 --- a/lua_probject/base_project/Game/View/Common/BaseWindow.lua +++ b/lua_probject/base_project/Game/View/Common/BaseWindow.lua @@ -12,7 +12,7 @@ BaseWindow = { --弹出动画,0关闭,1左边,2右边 _anim_pop = 0, --关闭摧毁 - _close_destroy = true, + _close_destroy = false, --点击窗口以外关闭 _close_zone = true, diff --git a/lua_probject/base_project/Game/View/FamilyView.lua b/lua_probject/base_project/Game/View/FamilyView.lua index 02240f8a..cf316512 100644 --- a/lua_probject/base_project/Game/View/FamilyView.lua +++ b/lua_probject/base_project/Game/View/FamilyView.lua @@ -668,7 +668,7 @@ function M:UpdateFamilyRoom(fgCtr, id) end obj:GetChild('Label_joinPlayers').text = insertName obj:GetChild('text_playerNum').text = string.format("%s/%s", playInfo.maxPlayers, playInfo.maxPlayers) - obj:GetChild('text_roundNum').text = string.format("%s/%s", startRoom[newIndex].round, + obj:GetChild('text_roundNum').text = string.format("局数:%s/%s", startRoom[newIndex].round, startRoom[newIndex].times) obj:GetChild('btn_joinGame').onClick:Clear() obj:GetChild('btn_watch').onClick:Set(function() diff --git a/lua_probject/base_project/Game/View/MainView.lua b/lua_probject/base_project/Game/View/MainView.lua index 8b1656b9..97971789 100644 --- a/lua_probject/base_project/Game/View/MainView.lua +++ b/lua_probject/base_project/Game/View/MainView.lua @@ -181,6 +181,7 @@ function M:InitView(url, isHideIpAdds) local btn_rule = self._view:GetChild('btn_rule') if btn_rule ~= nil then btn_rule.onClick:Set(function() + self._ctr_more.selectedIndex = 0 if self.RuleView == nil or self.RuleView._is_destroy then self.RuleView = RoomInfoView.new(self._room) end @@ -281,6 +282,7 @@ function M:InitView(url, isHideIpAdds) local chatText = _view:GetChild('btn_sendText') if chatText then chatText.onClick:Add(function() + self._ctr_more.selectedIndex = 0 if self._room.room_config.config.hpData.BanChat == 1 then ViewUtil.ShowBannerOnScreenCenter("本房间禁止快捷聊天") return @@ -563,6 +565,7 @@ function M:InitView(url, isHideIpAdds) if self._viewBtn_pangGuang and self._view_WitnessPlayer and self._ctr_showWitness then self._viewBtn_pangGuang.onClick:Set(function() + self._ctr_more.selectedIndex = 0 self._ctr_showWitness.selectedIndex = 1 self:ShowWitnessPlayer() end) @@ -1182,7 +1185,8 @@ function M:MarkSelfTuoguan() self._com_tuoguan = UIPackage.CreateObjectFromURL('ui://Common/com_tuoguan_self') local com_tuoguan = self._com_tuoguan GRoot.inst:AddChild(com_tuoguan) - --com_tuoguan:Center() + com_tuoguan:MakeFullScreen() + com_tuoguan:Center() --com_tuoguan.y = GRoot.inst.height - com_tuoguan.height --com_tuoguan.x = (GRoot.inst.width - com_tuoguan.width) * 0.5 local _msg_view = nil @@ -1219,9 +1223,10 @@ function M:MarkSelfTuoguan() num = 250 end com_tuoguan:AddChild(_msg_view) + _msg_view:Center() _msg_view:GetChild('tex_message').text = '确定要取消托管吗?' - _msg_view.x = (com_tuoguan.width - _msg_view.width) * 0.5 - num - _msg_view.y = (com_tuoguan.height - com_tuoguan.y - _msg_view.height) * 0.5 + -- _msg_view.x = (com_tuoguan.width - _msg_view.width) * 0.5 - num + -- _msg_view.y = (com_tuoguan.height - com_tuoguan.y - _msg_view.height) * 0.5 end ) end diff --git a/lua_probject/base_project/Game/View/PlayBackView.lua b/lua_probject/base_project/Game/View/PlayBackView.lua index 2bb272a2..8c5f311e 100644 --- a/lua_probject/base_project/Game/View/PlayBackView.lua +++ b/lua_probject/base_project/Game/View/PlayBackView.lua @@ -60,6 +60,7 @@ function M:InitView(url) btn_restart.onClick:Add(handler(self, self.RestartRecordPlay)) btn_play.onClick:Add(handler(self, self.Play)) + self.com_logocType = self._view:GetChild("com_logo"):GetController("cType") local _view = self._view local _room = self._room self._player_info = {} diff --git a/lua_probject/base_project/Game/View/WitnessView.lua b/lua_probject/base_project/Game/View/WitnessView.lua index fe3281af..cf478d8a 100644 --- a/lua_probject/base_project/Game/View/WitnessView.lua +++ b/lua_probject/base_project/Game/View/WitnessView.lua @@ -208,7 +208,8 @@ function M:MarkSelfTuoguan() self._com_tuoguan = UIPackage.CreateObjectFromURL('ui://Common/com_tuoguan_self') local com_tuoguan = self._com_tuoguan GRoot.inst:AddChild(com_tuoguan) - --com_tuoguan:Center() + com_tuoguan:MakeFullScreen() + com_tuoguan:Center() --com_tuoguan.y = GRoot.inst.height - com_tuoguan.height --com_tuoguan.x = (GRoot.inst.width - com_tuoguan.width) * 0.5 -- local _msg_view = nil diff --git a/lua_probject/base_project/table/Table_Error_code.lua b/lua_probject/base_project/table/Table_Error_code.lua index 68f9d958..8bf4b150 100644 --- a/lua_probject/base_project/table/Table_Error_code.lua +++ b/lua_probject/base_project/table/Table_Error_code.lua @@ -19,15 +19,15 @@ Table_Error_code_Map = { [4]={id=4,note=""}, [5]={id=5,note="玩法不可用"}, [6]={id=6,note="游戏已停用"}, - [7]={id=7,note="钻石不足"}, - [8]={id=8,note="已经在公会中"}, + [7]={id=7,note="房卡不足"}, + [8]={id=8,note="已经在亲友圈中"}, [9]={id=9,note="邀请码无效"}, [10]={id=10,note="房间已满"}, [11]={id=11,note="房间号不存在"}, [12]={id=12,note="此邮件不存在"}, [13]={id=13,note="邮件已经领取"}, [14]={id=14,note="此任务不存在"}, - [15]={id=15,note="没有公会"}, + [15]={id=15,note="没有亲友圈"}, [16]={id=16,note="任务奖励已领取"}, [18]={id=18,note="牛牛有玩家未重连成功"}, [20]={id=20,note="排行&战绩数据获取失败"}, @@ -38,19 +38,19 @@ Table_Error_code_Map = { [28]={id=28,note="多次登录失败,禁止登录,请过段时间再次尝试"}, [101]={id=101,note="请检查您的网络设置"}, [102]={id=102,note="网络连接超时"}, - [500]={id=500,note="服务器内部错误"}, + [500]={id=500,note=""}, [999]={id=999,note="未知错误"}, [17]={id=17,note="奖券不足"}, [53]={id=53,note="与桌上玩家IP相同,进入房间失败"}, [54]={id=54,note="与桌上玩家距离过近,进入房间失败"}, [55]={id=55,note="GPS服务未开启,请开启GPS服务!"}, - [56]={id=56,note="不是大联盟"}, - [57]={id=57,note="大联盟不能退出"}, + [56]={id=56,note="不是亲友圈"}, + [57]={id=57,note="亲友圈不能退出"}, [59]={id=59,note="无效的验证码"}, [61]={id=61,note="手机号码已绑定玩家"}, [80]={id=80,note="房间已删除"}, - [81]={id=81,note="是大联盟房间"}, - [83]={id=83,note="积分不足,无法坐下"}, + [81]={id=81,note="是亲友圈房间"}, + [83]={id=83,note="分数已被限制,请联系管理员"}, [1000]={id=1000,note="已申请加入"}, [1001]={id=1001,note="成员已存在"}, [1002]={id=1002,note="成员不存在"}, @@ -63,35 +63,35 @@ Table_Error_code_Map = { [1010]={id=1010,note="目标是管理员"}, [1011]={id=1011,note="目标是合伙人"}, [1012]={id=1012,note="目标积分不足"}, - [1013]={id=1013,note="积分不足!"}, + [1013]={id=1013,note="房卡不足"}, [1014]={id=1014,note="没有权限"}, [1015]={id=1015,note="积分不为0"}, [1016]={id=1016,note="成员在房间内"}, [1017]={id=1017,note="成员积分事件正在执行"}, - [1018]={id=1018,note="大联盟不存在"}, - [1019]={id=1019,note="大联盟已满"}, - [1020]={id=1020,note="大联盟还有房间"}, - [1021]={id=1021,note="大联盟禁止娱乐"}, - [1022]={id=1022,note="不是盟主"}, + [1018]={id=1018,note="亲友圈不存在"}, + [1019]={id=1019,note="亲友圈已满"}, + [1020]={id=1020,note="亲友圈还有房间"}, + [1021]={id=1021,note="亲友圈禁止娱乐"}, + [1022]={id=1022,note="不是群主"}, [1023]={id=1023,note="目標玩家是合伙人"}, [1024]={id=1024,note="目標玩家不是合伙人"}, [1025]={id=1025,note="已被管理员禁止娱乐"}, - [1026]={id=1026,note="积分不足,无法进入房间"}, - [1027]={id=1027,note="只能创建一个大联盟"}, - [1028]={id=1028,note="大联盟玩法必须开启积分"}, + [1026]={id=1026,note="房卡不足,无法进入房间"}, + [1027]={id=1027,note="只能创建一个亲友圈"}, + [1028]={id=1028,note="亲友圈玩法必须开启积分"}, [1029]={id=1029,note="还存在该玩法的房间,操作失败"}, - [1030]={id=1030,note="不在此大联盟的房间中"}, + [1030]={id=1030,note="不在此亲友圈的房间中"}, [1031]={id=1031,note="玩家关闭被邀请"}, - [1032]={id=1032,note="创建大联盟数达到上限"}, - [1033]={id=1033,note="大联盟人数已满"}, + [1032]={id=1032,note="创建亲友圈数达到上限"}, + [1033]={id=1033,note="亲友圈人数已满"}, [1034]={id=1034,note="玩家在游戏中,不能下分"}, [1035]={id=1035,note="奖励池积分不足"}, [1036]={id=1036,note=" 奖励池没提取"}, [1037]={id=1037,note="禁止同桌"}, [1038]={id=1038,note="玩法禁止娱乐"}, - [1039]={id=1039,note="大联盟已关闭申请"}, - [1040]={id=1040,note="大联盟已停止服务"}, - [1041]={id=1041,note="不能退出大联盟"}, + [1039]={id=1039,note="亲友圈已关闭申请"}, + [1040]={id=1040,note="亲友圈已停止服务"}, + [1041]={id=1041,note="不能退出亲友圈"}, [1047]={id=1047,note="携带值超越上线, 请保存到保险箱里"}, [1048]={id=1048,note="玩家携带值值超越上线, 请提醒保险箱里"}, [1049]={id=1049,note="本房间禁止扔表情"}, diff --git a/lua_probject/extend_project/extend/majiang/fuzhou/EXMainView.lua b/lua_probject/extend_project/extend/majiang/fuzhou/EXMainView.lua index ecaa7eab..d121f4d2 100644 --- a/lua_probject/extend_project/extend/majiang/fuzhou/EXMainView.lua +++ b/lua_probject/extend_project/extend/majiang/fuzhou/EXMainView.lua @@ -164,7 +164,7 @@ function M:UpdatePlayerInfoView() local _player_info = self._player_info local list = self._room.player_list - for i = 1, self._room.room_config.people_num do + for i = 1, #list do local seat = self:GetPos(list[i].seat) local tem = self._view:GetChild(string.format("player_info%d_%d", seat, (self._state.selectedIndex % 2) + 1)) _player_info[seat] = PlayerInfoView.new(tem, self) @@ -404,7 +404,6 @@ function M:EventInit() end) _gamectr:AddEventListener(TX_GameEvent.ZPResult1, function(...) - self:PlayMJSound("end_music.mp3") MJMainView.OnResult1(self, ...) --[[ self._popEvent = false @@ -571,6 +570,8 @@ function M:OutCard(card) info:UpdateOutCardList(nil, card, self._cursor) info._ctr_tip.selectedIndex = 0 + info._ctr_showGuoHu.selectedIndex = 0 + self:markOutCards(false, card) self:PlaySound("FuZhou_MJ", self._room.self_player.self_user.sex, tostring(card)) self:PlayMJSound("chupai.mp3") -- self:ShowHuTip() @@ -773,57 +774,6 @@ function M:_ChiView(tiplist, callback) self._pop_tip_choice = _pop_tip_choice end -function M:OnFangziAction(...) - self:__CloseTip() - local arg = { ... } - local _player_card_info = self._player_card_info - local fz = arg[1] - local player = arg[2] - local index = arg[3] - printlog("OnFangziAction") - local info = _player_card_info[self:GetPos(player.seat)] - -- local pNode = info._mask_liangpai - local effect = UIPackage.CreateObject("Extend_MJ_FuZhou", "FzEffect") - if fz.type == FZType.Peng then - self:PlaySound("FuZhou_MJ", player.self_user.sex, "peng") - effect:GetChild("word1").icon = UIPackage.GetItemURL("Main_Majiang", "碰") - effect:GetChild("word2").icon = UIPackage.GetItemURL("Main_Majiang", "碰") - -- effect:GetChild("kuang").icon = UIPackage.GetItemURL("Main_Majiang", "碰框") - elseif fz.type == FZType.Chi then - self:PlaySound("FuZhou_MJ", player.self_user.sex, "chi") - effect:GetChild("word1").icon = UIPackage.GetItemURL("Main_Majiang", "吃") - effect:GetChild("word2").icon = UIPackage.GetItemURL("Main_Majiang", "吃") - else - self:PlaySound("FuZhou_MJ", player.self_user.sex, "gang") - effect:GetChild("word1").icon = UIPackage.GetItemURL("Main_Majiang", "杠") - effect:GetChild("word2").icon = UIPackage.GetItemURL("Main_Majiang", "杠") - -- effect:GetChild("kuang").icon = UIPackage.GetItemURL("Main_Majiang", "杠框") - end - effect.touchable = false - effect:GetTransition("t2"):Play() - -- pNode:AddChild(effect) - coroutine.start(function() - coroutine.wait(0.3) - self._popEvent = true - end) - coroutine.start(function() - coroutine.wait(2) - effect:Dispose() - end) - - self:RemoveCursor() - if (player.seat ~= fz.from_seat) then - local fs_info = _player_card_info[self:GetPos(fz.from_seat)] - fs_info:UpdateOutCardList() - end - local seat = (self._room.room_config.people_num == 2 and fz.from_seat == 2) and 2 or fz.from_seat - 1 - info:UpdateFzList(fz, index, true, seat) - local getcard = fz.type == FZType.Peng or fz.type == FZType.Chi - printlog(getcard) - info:UpdateHandCard(getcard) - self:__CloseTip() -end - function M:RunNiao(list, start_seat) local _room = self._room --local _niao_View = self._niao_View @@ -941,6 +891,9 @@ function M:ReloadRoom(bskip) if bskip == nil or bskip == false then if p.ready and room.playing == false then self._player_info[self:GetPos(p.seat)]:Ready(true) + if room.self_player.seat == p.seat then + self._ctr_action.selectedIndex = 0 + end end end if p.piao_niao ~= nil and p.piao_niao > 0 then diff --git a/lua_probject/extend_project/extend/majiang/fuzhou/EXPlayBackView.lua b/lua_probject/extend_project/extend/majiang/fuzhou/EXPlayBackView.lua index 3610a980..552e6904 100644 --- a/lua_probject/extend_project/extend/majiang/fuzhou/EXPlayBackView.lua +++ b/lua_probject/extend_project/extend/majiang/fuzhou/EXPlayBackView.lua @@ -27,6 +27,10 @@ function M:InitView(url) self._tex_round = self._view:GetChild("tex_round") self._tex_LeftCard = self._view:GetChild("remaining_card") self._anchor = self._view:GetChild("mask_tips") + local config = ExtendManager.GetExtendConfig(room.game_id) + local mode = config:GetGameInfo() + local gamePlay = mode:LoadConfigToDetail(json.encode(room.room_config.config), json.encode(room.room_config.hpData)) + self._view:GetChild('wanfa_text').text = gamePlay self._eventmap = {} self._cmdmap = {} @@ -37,6 +41,7 @@ function M:InitView(url) self._cmdmap[Record_Event.Evt_Niao] = self.CmdNiao self._cmdmap[Record_Event.Evt_Piao] = self.CmdPiao self._cmdmap[Record_Event.Evt_Result] = self.CmdResult + self.com_logocType.selectedIndex = 0 end function M:FillRoomData(data) diff --git a/lua_probject/extend_project/extend/majiang/fuzhou/EXWitnessView.lua b/lua_probject/extend_project/extend/majiang/fuzhou/EXWitnessView.lua index 3ae81a7e..ea49b32a 100644 --- a/lua_probject/extend_project/extend/majiang/fuzhou/EXWitnessView.lua +++ b/lua_probject/extend_project/extend/majiang/fuzhou/EXWitnessView.lua @@ -190,8 +190,6 @@ function M:EventInit() print("lingmeng witness FZTips") end) - _gamectr:AddEventListener(TX_GameEvent.FangziAction, handler(self, self.OnFangziAction)) - _gamectr:AddEventListener(TX_GameEvent.ZPHuCard, function(...) self._popEvent = false self._left_time = 0 @@ -445,67 +443,6 @@ function M:UpdateCardBox(seat) self._ctr_cardbox.selectedIndex = index end -function M:OnFangziAction(...) - local arg = { ... } - local _player_card_info = self._player_card_info - local fz = arg[1] - local player = arg[2] - local index = arg[3] - local info = _player_card_info[self:GetPos(player.seat)] - -- local pNode = info._mask_liangpai - - - - local arg = { ... } - local _player_card_info = self._player_card_info - local fz = arg[1] - local player = arg[2] - local index = arg[3] - local info = _player_card_info[self:GetPos(player.seat)] - -- local pNode = info._mask_liangpai - local effect = UIPackage.CreateObject("Extend_MJ_JinXi", "FzEffect") - if fz.type == FZType.Peng then - self:PlaySound("JinXi_MJ", player.self_user.sex, "peng") - effect:GetChild("word1").icon = UIPackage.GetItemURL("Main_Majiang", "碰") - effect:GetChild("word2").icon = UIPackage.GetItemURL("Main_Majiang", "碰") - -- effect:GetChild("kuang").icon = UIPackage.GetItemURL("Main_Majiang", "碰框") - elseif fz.type == FZType.Chi then - self:PlaySound("JinXi_MJ", player.self_user.sex, "chi") - effect:GetChild("word1").icon = UIPackage.GetItemURL("Main_Majiang", "吃") - effect:GetChild("word2").icon = UIPackage.GetItemURL("Main_Majiang", "吃") - else - self:PlaySound("JinXi_MJ", player.self_user.sex, "gang") - effect:GetChild("word1").icon = UIPackage.GetItemURL("Main_Majiang", "杠") - effect:GetChild("word2").icon = UIPackage.GetItemURL("Main_Majiang", "杠") - -- effect:GetChild("kuang").icon = UIPackage.GetItemURL("Main_Majiang", "杠框") - end - effect.touchable = false - effect:GetTransition("t2"):Play() - -- pNode:AddChild(effect) - coroutine.start(function() - coroutine.wait(0.3) - self._popEvent = true - end) - coroutine.start(function() - coroutine.wait(2) - effect:Dispose() - end) - - self:RemoveCursor() - if (player.seat ~= fz.from_seat) then - local fs_info = _player_card_info[self:GetPos(fz.from_seat)] - fs_info:UpdateOutCardList() - end - local seat = (self._room.room_config.people_num == 2 and fz.from_seat == 2) and 2 or fz.from_seat - 1 - info:UpdateFzList(fz, index, true, seat) - - --因为观战没有手牌,等预处理完扣牌数之后矫正一次(最粗暴的修正方式,手牌数等于13-3*吃碰数) - - info._player.hand_left_count = 14 - 3 * #info._player.fz_list - info:UpdateHandCardWitness(true) - -- self:__CloseTip() -end - local majiang_asset_path = "base/main_majiang/sound/" function M:PlayMJSound(path) ViewUtil.PlaySound(self.asset_group, majiang_asset_path .. path) diff --git a/lua_probject/extend_project/extend/majiang/fuzhou/ExtendConfig.lua b/lua_probject/extend_project/extend/majiang/fuzhou/ExtendConfig.lua index 61e51516..e8aa1ed9 100644 --- a/lua_probject/extend_project/extend/majiang/fuzhou/ExtendConfig.lua +++ b/lua_probject/extend_project/extend/majiang/fuzhou/ExtendConfig.lua @@ -92,9 +92,17 @@ function M:FillRoomData(s2croom) room.curren_outcard_seat = _reloadInfo["curren_outcard_seat"] room.last_outcard_seat = last_outcard_seat room.playing = playing + --将排序放在精牌后面,并把自己的拿牌放在最后 local _hand_card = _reloadInfo["hand_card"] room.self_player.card_list = _hand_card - table.sort(_hand_card, self.HandCardSortAndJing) + if room.self_player.seat == room.curren_outcard_seat then + local getCard = _hand_card[#_hand_card] + table.remove(_hand_card, #_hand_card) + table.sort(_hand_card, ViewUtil.HandCardSort) + table.insert(_hand_card, getCard) + else + table.sort(_hand_card, ViewUtil.HandCardSort) + end for i = 1, #_info_list do local tem = _info_list[i] local playerid = tem["playerid"] diff --git a/lua_probject/extend_project/extend/majiang/fuzhou/HuCardImg.lua b/lua_probject/extend_project/extend/majiang/fuzhou/HuCardImg.lua index c60c7f27..3a614c86 100644 --- a/lua_probject/extend_project/extend/majiang/fuzhou/HuCardImg.lua +++ b/lua_probject/extend_project/extend/majiang/fuzhou/HuCardImg.lua @@ -15,7 +15,7 @@ HuCardImg[11] = { "tile_cs_qingyisezhenhu" } HuCardImg[12] = { "tile_cs_qingyisejiahu" } HuCardImg[13] = { "tile_cs_ziyisezhenhu" } HuCardImg[14] = { "tile_cs_ziyisejiahu" } -HuCardImg[15] = { "缺失" } +HuCardImg[15] = { "tile_cs_tianhu" } HuCardImg[16] = { "tile_cs_dihu" } HuCardImg[17] = { "tile_cs_pinghu" } HuCardImg[18] = { "tile_cs_qiangganghu" } @@ -24,5 +24,27 @@ HuCardImg[20] = { "缺失" } HuCardImg[21] = { "tile_cs_siguiyi" } HuCardImg[22] = { "tile_cs_baguiyi" } HuCardImg[23] = { "tile_cs_seguiyi" } +HuCardImg[24] = { "tile_cs_qingyisejiahu","tile_cs_siguiyi" } +HuCardImg[25] = { "tile_cs_qingyisezhenhu","tile_cs_siguiyi" } +HuCardImg[26] = { "tile_cs_qingyisejiahu","tile_cs_baguiyi" } +HuCardImg[27] = { "tile_cs_qingyisezhenhu","tile_cs_baguiyi" } +HuCardImg[28] = { "tile_cs_qingyisejiahu","tile_cs_seguiyi" } +HuCardImg[29] = { "tile_cs_qingyisezhenhu","tile_cs_seguiyi" } +HuCardImg[30] = { "tile_cs_ziyisejiahu","tile_cs_siguiyi" } +HuCardImg[31] = { "tile_cs_ziyisezhenhu","tile_cs_siguiyi" } +HuCardImg[32] = { "tile_cs_ziyisejiahu","tile_cs_baguiyi" } +HuCardImg[33] = { "tile_cs_ziyisezhenhu","tile_cs_baguiyi" } +HuCardImg[34] = { "tile_cs_ziyisejiahu","tile_cs_seguiyi" } +HuCardImg[35] = { "tile_cs_ziyisezhenhu","tile_cs_seguiyi" } +HuCardImg[36] = { "tile_cs_qingyise","tile_cs_qidui","tile_cs_siguiyi" } +HuCardImg[37] = { "tile_cs_qingyise","tile_cs_qidui","tile_cs_baguiyi" } +HuCardImg[38] = { "tile_cs_qingyise","tile_cs_qidui","tile_cs_seguiyi" } +HuCardImg[39] = { "tile_cs_ziyise","tile_cs_qidui","tile_cs_siguiyi" } +HuCardImg[40] = { "tile_cs_ziyise","tile_cs_qidui","tile_cs_baguiyi" } +HuCardImg[41] = { "tile_cs_ziyise","tile_cs_qidui","tile_cs_seguiyi" } +HuCardImg[42] = { "tile_cs_qidui","tile_cs_siguiyi" } +HuCardImg[43] = { "tile_cs_qidui","tile_cs_baguiyi" } +HuCardImg[44] = { "tile_cs_qidui","tile_cs_seguiyi" } + return HuCardImg diff --git a/lua_probject/extend_project/extend/majiang/jinxi/CS_Win_Type.lua b/lua_probject/extend_project/extend/majiang/jinxi/CS_Win_Type.lua index 39c4692b..6326e4fc 100644 --- a/lua_probject/extend_project/extend/majiang/jinxi/CS_Win_Type.lua +++ b/lua_probject/extend_project/extend/majiang/jinxi/CS_Win_Type.lua @@ -10,11 +10,13 @@ local CS_Win_Type = { "七小对清一色", "七小对字一色", "清一色真胡", - "清一色假胡", - "字一色真胡", - "字一色假胡", - "天胡", - "地胡", + "杠上花", + "", + "", + "", + "", "平胡", + "抢杠胡", + "烧庄", } return CS_Win_Type diff --git a/lua_probject/extend_project/extend/majiang/jinxi/EXMainView.lua b/lua_probject/extend_project/extend/majiang/jinxi/EXMainView.lua index 27359c23..2fb1a8f4 100644 --- a/lua_probject/extend_project/extend/majiang/jinxi/EXMainView.lua +++ b/lua_probject/extend_project/extend/majiang/jinxi/EXMainView.lua @@ -163,7 +163,7 @@ function M:UpdatePlayerInfoView() local _player_info = self._player_info local list = self._room.player_list - for i = 1, self._room.room_config.people_num do + for i = 1, #list do local seat = self:GetPos(list[i].seat) local tem = self._view:GetChild(string.format("player_info%d_%d", seat, (self._state.selectedIndex % 2) + 1)) _player_info[seat] = PlayerInfoView.new(tem, self) @@ -572,6 +572,8 @@ function M:OutCard(card) info:UpdateOutCardList(nil, card, self._cursor) info._ctr_tip.selectedIndex = 0 + info._ctr_showGuoHu.selectedIndex = 0 + self:markOutCards(false, card) self:PlaySound("JinXi_MJ", self._room.self_player.self_user.sex, tostring(card)) self:PlayMJSound("chupai.mp3") -- self:ShowHuTip() @@ -774,57 +776,6 @@ function M:_ChiView(tiplist, callback) self._pop_tip_choice = _pop_tip_choice end -function M:OnFangziAction(...) - self:__CloseTip() - local arg = { ... } - local _player_card_info = self._player_card_info - local fz = arg[1] - local player = arg[2] - local index = arg[3] - printlog("OnFangziAction") - local info = _player_card_info[self:GetPos(player.seat)] - -- local pNode = info._mask_liangpai - local effect = UIPackage.CreateObject("Extend_MJ_JinXi", "FzEffect") - if fz.type == FZType.Peng then - self:PlaySound("FuZhou_MJ", player.self_user.sex, "peng") - effect:GetChild("word1").icon = UIPackage.GetItemURL("Main_Majiang", "碰") - effect:GetChild("word2").icon = UIPackage.GetItemURL("Main_Majiang", "碰") - -- effect:GetChild("kuang").icon = UIPackage.GetItemURL("Main_Majiang", "碰框") - elseif fz.type == FZType.Chi then - self:PlaySound("JinXi_MJ", player.self_user.sex, "chi") - effect:GetChild("word1").icon = UIPackage.GetItemURL("Main_Majiang", "吃") - effect:GetChild("word2").icon = UIPackage.GetItemURL("Main_Majiang", "吃") - else - self:PlaySound("JinXi_MJ", player.self_user.sex, "gang") - effect:GetChild("word1").icon = UIPackage.GetItemURL("Main_Majiang", "杠") - effect:GetChild("word2").icon = UIPackage.GetItemURL("Main_Majiang", "杠") - -- effect:GetChild("kuang").icon = UIPackage.GetItemURL("Main_Majiang", "杠框") - end - effect.touchable = false - effect:GetTransition("t2"):Play() - -- pNode:AddChild(effect) - coroutine.start(function() - coroutine.wait(0.3) - self._popEvent = true - end) - coroutine.start(function() - coroutine.wait(2) - effect:Dispose() - end) - - self:RemoveCursor() - if (player.seat ~= fz.from_seat) then - local fs_info = _player_card_info[self:GetPos(fz.from_seat)] - fs_info:UpdateOutCardList() - end - local seat = (self._room.room_config.people_num == 2 and fz.from_seat == 2) and 2 or fz.from_seat - 1 - info:UpdateFzList(fz, index, true, seat) - local getcard = fz.type == FZType.Peng or fz.type == FZType.Chi - printlog(getcard) - info:UpdateHandCard(getcard) - self:__CloseTip() -end - function M:RunNiao(list, start_seat) local _room = self._room --local _niao_View = self._niao_View @@ -942,6 +893,9 @@ function M:ReloadRoom(bskip) if bskip == nil or bskip == false then if p.ready and room.playing == false then self._player_info[self:GetPos(p.seat)]:Ready(true) + if room.self_player.seat == p.seat then + self._ctr_action.selectedIndex = 0 + end end end if p.piao_niao ~= nil and p.piao_niao > 0 then diff --git a/lua_probject/extend_project/extend/majiang/jinxi/EXPlayBackView.lua b/lua_probject/extend_project/extend/majiang/jinxi/EXPlayBackView.lua index 677ff84d..ef2d47b8 100644 --- a/lua_probject/extend_project/extend/majiang/jinxi/EXPlayBackView.lua +++ b/lua_probject/extend_project/extend/majiang/jinxi/EXPlayBackView.lua @@ -27,6 +27,10 @@ function M:InitView(url) self._tex_round = self._view:GetChild("tex_round") self._tex_LeftCard = self._view:GetChild("remaining_card") self._anchor = self._view:GetChild("mask_tips") + local config = ExtendManager.GetExtendConfig(room.game_id) + local mode = config:GetGameInfo() + local gamePlay = mode:LoadConfigToDetail(json.encode(room.room_config.config), json.encode(room.room_config.hpData)) + self._view:GetChild('wanfa_text').text = gamePlay self._eventmap = {} self._cmdmap = {} @@ -37,6 +41,7 @@ function M:InitView(url) self._cmdmap[Record_Event.Evt_Niao] = self.CmdNiao self._cmdmap[Record_Event.Evt_Piao] = self.CmdPiao self._cmdmap[Record_Event.Evt_Result] = self.CmdResult + self.com_logocType.selectedIndex = 3 end function M:FillRoomData(data) diff --git a/lua_probject/extend_project/extend/majiang/jinxi/EXWitnessView.lua b/lua_probject/extend_project/extend/majiang/jinxi/EXWitnessView.lua index ee2950c8..1424b397 100644 --- a/lua_probject/extend_project/extend/majiang/jinxi/EXWitnessView.lua +++ b/lua_probject/extend_project/extend/majiang/jinxi/EXWitnessView.lua @@ -190,8 +190,6 @@ function M:EventInit() print("lingmeng witness FZTips") end) - _gamectr:AddEventListener(TX_GameEvent.FangziAction, handler(self, self.OnFangziAction)) - _gamectr:AddEventListener(TX_GameEvent.ZPHuCard, function(...) self._popEvent = false self._left_time = 0 @@ -445,67 +443,6 @@ function M:UpdateCardBox(seat) self._ctr_cardbox.selectedIndex = index end -function M:OnFangziAction(...) - local arg = { ... } - local _player_card_info = self._player_card_info - local fz = arg[1] - local player = arg[2] - local index = arg[3] - local info = _player_card_info[self:GetPos(player.seat)] - -- local pNode = info._mask_liangpai - - - - local arg = { ... } - local _player_card_info = self._player_card_info - local fz = arg[1] - local player = arg[2] - local index = arg[3] - local info = _player_card_info[self:GetPos(player.seat)] - -- local pNode = info._mask_liangpai - local effect = UIPackage.CreateObject("Extend_MJ_JinXi", "FzEffect") - if fz.type == FZType.Peng then - self:PlaySound("JinXi_MJ", player.self_user.sex, "peng") - effect:GetChild("word1").icon = UIPackage.GetItemURL("Main_Majiang", "碰") - effect:GetChild("word2").icon = UIPackage.GetItemURL("Main_Majiang", "碰") - -- effect:GetChild("kuang").icon = UIPackage.GetItemURL("Main_Majiang", "碰框") - elseif fz.type == FZType.Chi then - self:PlaySound("JinXi_MJ", player.self_user.sex, "chi") - effect:GetChild("word1").icon = UIPackage.GetItemURL("Main_Majiang", "吃") - effect:GetChild("word2").icon = UIPackage.GetItemURL("Main_Majiang", "吃") - else - self:PlaySound("JinXi_MJ", player.self_user.sex, "gang") - effect:GetChild("word1").icon = UIPackage.GetItemURL("Main_Majiang", "杠") - effect:GetChild("word2").icon = UIPackage.GetItemURL("Main_Majiang", "杠") - -- effect:GetChild("kuang").icon = UIPackage.GetItemURL("Main_Majiang", "杠框") - end - effect.touchable = false - effect:GetTransition("t2"):Play() - -- pNode:AddChild(effect) - coroutine.start(function() - coroutine.wait(0.3) - self._popEvent = true - end) - coroutine.start(function() - coroutine.wait(2) - effect:Dispose() - end) - - self:RemoveCursor() - if (player.seat ~= fz.from_seat) then - local fs_info = _player_card_info[self:GetPos(fz.from_seat)] - fs_info:UpdateOutCardList() - end - local seat = (self._room.room_config.people_num == 2 and fz.from_seat == 2) and 2 or fz.from_seat - 1 - info:UpdateFzList(fz, index, true, seat) - - --因为观战没有手牌,等预处理完扣牌数之后矫正一次(最粗暴的修正方式,手牌数等于13-3*吃碰数) - - info._player.hand_left_count = 14 - 3 * #info._player.fz_list - info:UpdateHandCardWitness(true) - -- self:__CloseTip() -end - local majiang_asset_path = "base/main_majiang/sound/" function M:PlayMJSound(path) ViewUtil.PlaySound(self.asset_group, majiang_asset_path .. path) diff --git a/lua_probject/extend_project/extend/majiang/jinxi/ExtendConfig.lua b/lua_probject/extend_project/extend/majiang/jinxi/ExtendConfig.lua index e897b39e..c173be96 100644 --- a/lua_probject/extend_project/extend/majiang/jinxi/ExtendConfig.lua +++ b/lua_probject/extend_project/extend/majiang/jinxi/ExtendConfig.lua @@ -97,10 +97,17 @@ function M:FillRoomData(s2croom) if jing then room.jing = jing end - --将排序放在精牌后面 + --将排序放在精牌后面,并把自己的拿牌放在最后 local _hand_card = _reloadInfo["hand_card"] room.self_player.card_list = _hand_card - table.sort(_hand_card, self.HandCardSortAndJing) + if room.self_player.seat == room.curren_outcard_seat then + local getCard = _hand_card[#_hand_card] + table.remove(_hand_card, #_hand_card) + table.sort(_hand_card, self.HandCardSortAndJing) + table.insert(_hand_card, getCard) + else + table.sort(_hand_card, self.HandCardSortAndJing) + end for i = 1, #_info_list do local tem = _info_list[i] local playerid = tem["playerid"] diff --git a/lua_probject/extend_project/extend/majiang/jinxi/HuCardImg.lua b/lua_probject/extend_project/extend/majiang/jinxi/HuCardImg.lua index b2189179..9fbacf33 100644 --- a/lua_probject/extend_project/extend/majiang/jinxi/HuCardImg.lua +++ b/lua_probject/extend_project/extend/majiang/jinxi/HuCardImg.lua @@ -1,5 +1,6 @@ local HuCardImg = {} +HuCardImg[12] = { "tile_cs_gangshanghua" } HuCardImg[14] = { "tile_cs_shisanlan", "tile_cs_deguo" } HuCardImg[15] = { "tile_cs_qxshisanlan", "tile_cs_deguo" } HuCardImg[16] = { "tile_cs_dihu" } diff --git a/lua_probject/extend_project/extend/majiang/lichuan/EXMainView.lua b/lua_probject/extend_project/extend/majiang/lichuan/EXMainView.lua index ecdf4b5f..17b6908a 100644 --- a/lua_probject/extend_project/extend/majiang/lichuan/EXMainView.lua +++ b/lua_probject/extend_project/extend/majiang/lichuan/EXMainView.lua @@ -402,7 +402,6 @@ function M:EventInit() end) _gamectr:AddEventListener(TX_GameEvent.ZPResult1, function(...) - self:PlayMJSound("end_music.mp3") MJMainView.OnResult1(self, ...) --[[ self._popEvent = false @@ -562,13 +561,17 @@ function M:OutCard(card) printlog("当前出牌为===>>>" .. card) local _gamectr = ControllerManager.GetController(GameController) self._room.curren_outcard_seat = -1 - _gamectr:SendOutCard({ card = card, isTip = self._player_card_info[1]._ctr_tip.selectedIndex == 1 }, function() + _gamectr:SendOutCard( + { card = card, isTip = self._player_card_info[1]._ctr_tip.selectedIndex == 1 or + self._player_card_info[1]._ctr_showGuoHu.selectedIndex == 1 }, function() local info = self._player_card_info[1] self:RemoveCursor() info:UpdateHandCard() info:UpdateOutCardList(nil, card, self._cursor) info._ctr_tip.selectedIndex = 0 + info._ctr_showGuoHu.selectedIndex = 0 + self:markOutCards(false, card) self:PlaySound("LiChuan_MJ", self._room.self_player.self_user.sex, tostring(card)) self:PlayMJSound("chupai.mp3") -- self:ShowHuTip() diff --git a/lua_probject/extend_project/extend/majiang/lichuan/EXPlayBackView.lua b/lua_probject/extend_project/extend/majiang/lichuan/EXPlayBackView.lua index 26797c87..0ce88f8f 100644 --- a/lua_probject/extend_project/extend/majiang/lichuan/EXPlayBackView.lua +++ b/lua_probject/extend_project/extend/majiang/lichuan/EXPlayBackView.lua @@ -27,6 +27,10 @@ function M:InitView(url) self._tex_round = self._view:GetChild("tex_round") self._tex_LeftCard = self._view:GetChild("remaining_card") self._anchor = self._view:GetChild("mask_tips") + local config = ExtendManager.GetExtendConfig(room.game_id) + local mode = config:GetGameInfo() + local gamePlay = mode:LoadConfigToDetail(json.encode(room.room_config.config), json.encode(room.room_config.hpData)) + self._view:GetChild('wanfa_text').text = gamePlay self._eventmap = {} self._cmdmap = {} @@ -37,6 +41,8 @@ function M:InitView(url) self._cmdmap[Record_Event.Evt_Niao] = self.CmdNiao self._cmdmap[Record_Event.Evt_Piao] = self.CmdPiao self._cmdmap[Record_Event.Evt_Result] = self.CmdResult + + self.com_logocType.selectedIndex = 2 end function M:FillRoomData(data) diff --git a/lua_probject/extend_project/extend/majiang/lichuan/ExtendConfig.lua b/lua_probject/extend_project/extend/majiang/lichuan/ExtendConfig.lua index fc18c369..807e9a66 100644 --- a/lua_probject/extend_project/extend/majiang/lichuan/ExtendConfig.lua +++ b/lua_probject/extend_project/extend/majiang/lichuan/ExtendConfig.lua @@ -98,10 +98,17 @@ function M:FillRoomData(s2croom) if jing then room.jing = jing end - --将排序放在精牌后面 + --将排序放在精牌后面,并把自己的拿牌放在最后 local _hand_card = _reloadInfo["hand_card"] room.self_player.card_list = _hand_card - table.sort(_hand_card, self.HandCardSortAndJing) + if room.self_player.seat == room.curren_outcard_seat then + local getCard = _hand_card[#_hand_card] + table.remove(_hand_card, #_hand_card) + table.sort(_hand_card, self.HandCardSortAndJing) + table.insert(_hand_card, getCard) + else + table.sort(_hand_card, self.HandCardSortAndJing) + end for i = 1, #_info_list do local tem = _info_list[i] local playerid = tem["playerid"] diff --git a/lua_probject/extend_project/extend/majiang/nancheng/EXMainView.lua b/lua_probject/extend_project/extend/majiang/nancheng/EXMainView.lua index 263c203d..f6d42619 100644 --- a/lua_probject/extend_project/extend/majiang/nancheng/EXMainView.lua +++ b/lua_probject/extend_project/extend/majiang/nancheng/EXMainView.lua @@ -161,7 +161,7 @@ function M:UpdatePlayerInfoView() local _player_info = self._player_info local list = self._room.player_list - for i = 1, self._room.room_config.people_num do + for i = 1, #list do local seat = self:GetPos(list[i].seat) local tem = self._view:GetChild(string.format("player_info%d_%d", seat, (self._state.selectedIndex % 2) + 1)) _player_info[seat] = PlayerInfoView.new(tem, self) @@ -403,7 +403,6 @@ function M:EventInit() end) _gamectr:AddEventListener(TX_GameEvent.ZPResult1, function(...) - self:PlayMJSound("end_music.mp3") MJMainView.OnResult1(self, ...) --[[ self._popEvent = false @@ -571,6 +570,8 @@ function M:OutCard(card) info:UpdateOutCardList(nil, card, self._cursor) info._ctr_tip.selectedIndex = 0 + info._ctr_showGuoHu.selectedIndex = 0 + self:markOutCards(false, card) self:PlaySound("NanCheng_MJ", self._room.self_player.self_user.sex, tostring(card)) self:PlayMJSound("chupai.mp3") -- self:ShowHuTip() @@ -773,57 +774,6 @@ function M:_ChiView(tiplist, callback) self._pop_tip_choice = _pop_tip_choice end -function M:OnFangziAction(...) - self:__CloseTip() - local arg = { ... } - local _player_card_info = self._player_card_info - local fz = arg[1] - local player = arg[2] - local index = arg[3] - printlog("OnFangziAction") - local info = _player_card_info[self:GetPos(player.seat)] - -- local pNode = info._mask_liangpai - local effect = UIPackage.CreateObject("Extend_MJ_NanCheng", "FzEffect") - if fz.type == FZType.Peng then - self:PlaySound("FuZhou_MJ", player.self_user.sex, "peng") - effect:GetChild("word1").icon = UIPackage.GetItemURL("Main_Majiang", "碰") - effect:GetChild("word2").icon = UIPackage.GetItemURL("Main_Majiang", "碰") - -- effect:GetChild("kuang").icon = UIPackage.GetItemURL("Main_Majiang", "碰框") - elseif fz.type == FZType.Chi then - self:PlaySound("NanCheng_MJ", player.self_user.sex, "chi") - effect:GetChild("word1").icon = UIPackage.GetItemURL("Main_Majiang", "吃") - effect:GetChild("word2").icon = UIPackage.GetItemURL("Main_Majiang", "吃") - else - self:PlaySound("NanCheng_MJ", player.self_user.sex, "gang") - effect:GetChild("word1").icon = UIPackage.GetItemURL("Main_Majiang", "杠") - effect:GetChild("word2").icon = UIPackage.GetItemURL("Main_Majiang", "杠") - -- effect:GetChild("kuang").icon = UIPackage.GetItemURL("Main_Majiang", "杠框") - end - effect.touchable = false - effect:GetTransition("t2"):Play() - -- pNode:AddChild(effect) - coroutine.start(function() - coroutine.wait(0.3) - self._popEvent = true - end) - coroutine.start(function() - coroutine.wait(2) - effect:Dispose() - end) - - self:RemoveCursor() - if (player.seat ~= fz.from_seat) then - local fs_info = _player_card_info[self:GetPos(fz.from_seat)] - fs_info:UpdateOutCardList() - end - local seat = (self._room.room_config.people_num == 2 and fz.from_seat == 2) and 2 or fz.from_seat - 1 - info:UpdateFzList(fz, index, true, seat) - local getcard = fz.type == FZType.Peng or fz.type == FZType.Chi - printlog(getcard) - info:UpdateHandCard(getcard) - self:__CloseTip() -end - function M:RunNiao(list, start_seat) local _room = self._room --local _niao_View = self._niao_View @@ -893,13 +843,13 @@ function M:ReloadRoom(bskip) -- self._room._reload_flag = true -- end - local flag_action = 0 if bskip == nil or bskip == false then if not room.playing then self._state.selectedIndex = 2 self._ctr_action.selectedIndex = 1 else self._state.selectedIndex = 1 + self._ctr_action.selectedIndex = 0 self._room._reload_flag = true end end diff --git a/lua_probject/extend_project/extend/majiang/nancheng/EXPlayBackView.lua b/lua_probject/extend_project/extend/majiang/nancheng/EXPlayBackView.lua index bd11db46..eff22ffe 100644 --- a/lua_probject/extend_project/extend/majiang/nancheng/EXPlayBackView.lua +++ b/lua_probject/extend_project/extend/majiang/nancheng/EXPlayBackView.lua @@ -42,6 +42,7 @@ function M:InitView(url) self._cmdmap[Record_Event.Evt_Niao] = self.CmdNiao self._cmdmap[Record_Event.Evt_Piao] = self.CmdPiao self._cmdmap[Record_Event.Evt_Result] = self.CmdResult + self.com_logocType.selectedIndex = 1 end function M:FillRoomData(data) diff --git a/lua_probject/extend_project/extend/majiang/nancheng/EXWitnessView.lua b/lua_probject/extend_project/extend/majiang/nancheng/EXWitnessView.lua index 3a4e6b40..f502c835 100644 --- a/lua_probject/extend_project/extend/majiang/nancheng/EXWitnessView.lua +++ b/lua_probject/extend_project/extend/majiang/nancheng/EXWitnessView.lua @@ -190,8 +190,6 @@ function M:EventInit() print("lingmeng witness FZTips") end) - _gamectr:AddEventListener(TX_GameEvent.FangziAction, handler(self, self.OnFangziAction)) - _gamectr:AddEventListener(TX_GameEvent.ZPHuCard, function(...) self._popEvent = false self._left_time = 0 @@ -445,67 +443,6 @@ function M:UpdateCardBox(seat) self._ctr_cardbox.selectedIndex = index end -function M:OnFangziAction(...) - local arg = { ... } - local _player_card_info = self._player_card_info - local fz = arg[1] - local player = arg[2] - local index = arg[3] - local info = _player_card_info[self:GetPos(player.seat)] - -- local pNode = info._mask_liangpai - - - - local arg = { ... } - local _player_card_info = self._player_card_info - local fz = arg[1] - local player = arg[2] - local index = arg[3] - local info = _player_card_info[self:GetPos(player.seat)] - -- local pNode = info._mask_liangpai - local effect = UIPackage.CreateObject("Extend_MJ_NanCheng", "FzEffect") - if fz.type == FZType.Peng then - self:PlaySound("NanCheng_MJ", player.self_user.sex, "peng") - effect:GetChild("word1").icon = UIPackage.GetItemURL("Main_Majiang", "碰") - effect:GetChild("word2").icon = UIPackage.GetItemURL("Main_Majiang", "碰") - -- effect:GetChild("kuang").icon = UIPackage.GetItemURL("Main_Majiang", "碰框") - elseif fz.type == FZType.Chi then - self:PlaySound("NanCheng_MJ", player.self_user.sex, "chi") - effect:GetChild("word1").icon = UIPackage.GetItemURL("Main_Majiang", "吃") - effect:GetChild("word2").icon = UIPackage.GetItemURL("Main_Majiang", "吃") - else - self:PlaySound("NanCheng_MJ", player.self_user.sex, "gang") - effect:GetChild("word1").icon = UIPackage.GetItemURL("Main_Majiang", "杠") - effect:GetChild("word2").icon = UIPackage.GetItemURL("Main_Majiang", "杠") - -- effect:GetChild("kuang").icon = UIPackage.GetItemURL("Main_Majiang", "杠框") - end - effect.touchable = false - effect:GetTransition("t2"):Play() - -- pNode:AddChild(effect) - coroutine.start(function() - coroutine.wait(0.3) - self._popEvent = true - end) - coroutine.start(function() - coroutine.wait(2) - effect:Dispose() - end) - - self:RemoveCursor() - if (player.seat ~= fz.from_seat) then - local fs_info = _player_card_info[self:GetPos(fz.from_seat)] - fs_info:UpdateOutCardList() - end - local seat = (self._room.room_config.people_num == 2 and fz.from_seat == 2) and 2 or fz.from_seat - 1 - info:UpdateFzList(fz, index, true, seat) - - --因为观战没有手牌,等预处理完扣牌数之后矫正一次(最粗暴的修正方式,手牌数等于13-3*吃碰数) - - info._player.hand_left_count = 14 - 3 * #info._player.fz_list - info:UpdateHandCardWitness(true) - -- self:__CloseTip() -end - local majiang_asset_path = "base/main_majiang/sound/" function M:PlayMJSound(path) ViewUtil.PlaySound(self.asset_group, majiang_asset_path .. path) diff --git a/lua_probject/extend_project/extend/majiang/nancheng/ExtendConfig.lua b/lua_probject/extend_project/extend/majiang/nancheng/ExtendConfig.lua index f24ef048..93f1f29b 100644 --- a/lua_probject/extend_project/extend/majiang/nancheng/ExtendConfig.lua +++ b/lua_probject/extend_project/extend/majiang/nancheng/ExtendConfig.lua @@ -96,7 +96,14 @@ function M:FillRoomData(s2croom) room.reload = reload local _hand_card = _reloadInfo["hand_card"] room.self_player.card_list = _hand_card - table.sort(_hand_card, self.HandCardSortAndJing) + if room.self_player.seat == room.curren_outcard_seat then + local getCard = _hand_card[#_hand_card] + table.remove(_hand_card, #_hand_card) + table.sort(_hand_card, ViewUtil.HandCardSort) + table.insert(_hand_card, getCard) + else + table.sort(_hand_card, ViewUtil.HandCardSort) + end for i = 1, #_info_list do local tem = _info_list[i] local playerid = tem["playerid"] diff --git a/lua_probject/main_project/main/majiang/MJMainView.lua b/lua_probject/main_project/main/majiang/MJMainView.lua index 139eb7fc..8891e0c6 100644 --- a/lua_probject/main_project/main/majiang/MJMainView.lua +++ b/lua_probject/main_project/main/majiang/MJMainView.lua @@ -50,6 +50,7 @@ function M:InitView(url, use_custom_bg, custom_bg_config) self.loader_selfHuCardEffect = self._view:GetChild("loader_selfHuCardEffect") self.cHuCardEffect = self._view:GetController("cHuCardEffect") -- self.effect_ZiMo = self._view:GetChild("effect_ZiMo") + self._ctr_more = self._view:GetController("more") self.com_notice = self._view:GetChild("com_notice") @@ -433,10 +434,21 @@ function M:markOutCards(showTip, data) 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)] - for j = 1, #p.outcard_list do + -- for j = 1, #p.outcard_list do + -- local card = p.outcard_list[j] + -- if card == data then + -- for k = 1, #p.outcard_list do + -- local obj = info:GetOutCardByIndex(k) + -- if obj.data == card then + -- obj:GetController("gray").selectedIndex = showTip and 1 or 0 + -- end + -- end + -- end + -- end + for j = 1, info._view_outCardList.numItems do local card = p.outcard_list[j] if card == data then - for k = 1, #p.outcard_list do + for k = 1, info._view_outCardList.numItems do local obj = info:GetOutCardByIndex(k) if obj.data == card then obj:GetController("gray").selectedIndex = showTip and 1 or 0 @@ -711,20 +723,17 @@ function M:OnResult1(...) local liuju = result.liuju local data = result.info_list local niao = result.niao - -- if liuju then - -- local le = UIPackage.CreateObjectFromURL("ui://Main_Majiang/LiuJu") - -- self._view:AddChild(le) - -- le:Center() - -- le:GetTransition("t0"):Play() - -- coroutine.start(function() - -- coroutine.wait(1) - -- le:Dispose() - -- end) - -- end -- self:RemoveCursor() self._clearingView = self.EXClearingViewClass.new(self._root_view) self._clearingView._view:GetChild('btn_setting').onClick:Set(handler(self, self.ClickSetting)) coroutine.start(function() + if liuju then + self:PlayMJSound("liuju.mp3") + coroutine.wait(2.7) + self:PlayMJSound("end_music.mp3") + else + self:PlayMJSound("end_music.mp3") + end coroutine.wait(0.5) self._clearingView:Show() self._popEvent = true @@ -825,6 +834,23 @@ function M:OnHuCard(...) loader_HuEffect.visible = false local Effects = {} + --先循环一遍把杠上开花放在最前面 + for i = 1, #win_list do + local HuMsg = win_list[i] + if HuMsg.type > 2 and HuMsg.type < 32 then + if self.HuCardImg[HuMsg.type][1] == "tile_cs_gangshanghua" then + local imgPath = "ui://Main_Majiang/tile_cs_gangshanghua" + local imgObj = list_HuCardEffect:AddItemFromPool() + local imgLoader = imgObj:GetChild("loader_img") + imgLoader.url = imgPath + imgObj.visible = false + Effects[#Effects + 1] = imgObj + table.remove(win_list, i) + break + end + end + end + for i = 1, #win_list do local HuMsg = win_list[i] @@ -891,10 +917,12 @@ function M:OnFangziAction(...) local loader_HuEffect = info._viewClip_Peng_Gang local effects = "" if fz.type == FZType.Peng then + self:PlaySound("Main_Majiang", player.self_user.sex, "peng") effects = "clip_peng" elseif fz.type == FZType.Chi then else + self:PlaySound("Main_Majiang", player.self_user.sex, "gang") effects = "clip_gang" end local clip = UIPackage.CreateObjectFromURL(string.format("ui://Main_Majiang/%s", effects)) diff --git a/lua_probject/main_project/main/majiang/MJPlayerCardInfoView.lua b/lua_probject/main_project/main/majiang/MJPlayerCardInfoView.lua index 93e061ac..ad2cc0fb 100644 --- a/lua_probject/main_project/main/majiang/MJPlayerCardInfoView.lua +++ b/lua_probject/main_project/main/majiang/MJPlayerCardInfoView.lua @@ -294,6 +294,7 @@ function M:UpdateOutCardList(outcard, card_item, cursor) for i = 0, #outlist - 1 do local outcard = self._view_outCardList:AddItemFromPool() + outcard.data = outlist[i + 1] self:fillCard2(outcard, outCardName, outlist[i + 1]) if cursor and i == #outlist - 1 then Timer.New(function() @@ -387,18 +388,19 @@ function M:UpdateFzList(fz, index, show_card) end function M:GetOutCardByIndex(index) - local outcard_list = self._mask_data['outcard_list'] - local oder = outcard_list['oder'] - local multi_draw_oder = 0 - if (outcard_list['multi_draw_oder']) then - multi_draw_oder = outcard_list['multi_draw_oder'] - end + -- local outcard_list = self._mask_data['outcard_list'] + -- local oder = outcard_list['oder'] + -- local multi_draw_oder = 0 + -- if (outcard_list['multi_draw_oder']) then + -- multi_draw_oder = outcard_list['multi_draw_oder'] + -- end - if (oder == AreaOderType.down_up or (multi_draw_oder == 1)) then - return self._area_outcard_list:GetChildAt(self._area_outcard_list.numChildren - index) - else - return self._area_outcard_list:GetChildAt(index - 1) - end + -- if (oder == AreaOderType.down_up or (multi_draw_oder == 1)) then + -- return self._area_outcard_list:GetChildAt(self._area_outcard_list.numChildren - index) + -- else + -- return self._area_outcard_list:GetChildAt(index - 1) + -- end + return self._view_outCardList:GetChildAt(index - 1) end function M:ResetFzList() diff --git a/lua_probject/main_project/main/majiang/MJPlayerSelfCardInfoView.lua b/lua_probject/main_project/main/majiang/MJPlayerSelfCardInfoView.lua index 22938a74..13e885cc 100644 --- a/lua_probject/main_project/main/majiang/MJPlayerSelfCardInfoView.lua +++ b/lua_probject/main_project/main/majiang/MJPlayerSelfCardInfoView.lua @@ -80,6 +80,7 @@ function M:UpdateHandCard(getcard, mp) if getcard and i == (#card_list) - 1 then btn_card = self._view_getCard:AddItemFromPool() btn_card.onClick:Add(function(context) + self:ChangeMarkOutCards(context.sender.data.card_item) self:__OnClickGetCard(context) end) else @@ -97,9 +98,9 @@ function M:UpdateHandCard(getcard, mp) end self._view_handCardList.onClickItem:Set(function(context) self._mainView:PlayMJSound("clickCard.mp3") + self:ChangeMarkOutCards(context.data.data.card_item) self:__OnClickHandCard(context) end) - self:ClearMove() end @@ -246,6 +247,20 @@ function M:outCardMove(context) self._outCardMove.xy = xy - card.touch_pos end +function M:ChangeMarkOutCards(card) + local lastCard + if self._click_index == -1 and self._flag_seletedGet == 0 then + self._mainView:markOutCards(true, card) + return + elseif self._click_index ~= -1 then + lastCard = self._view_handCardList:GetChildAt(self._click_index).data.card_item + elseif self._flag_seletedGet ~= 0 then + lastCard = self._view_getCard:GetChildAt(0).data.card_item + end + self._mainView:markOutCards(false, lastCard) + self._mainView:markOutCards(true, card) +end + function M:__OnClickHandCard(context) self._ctr_seletedGet.selectedIndex = 1 self._flag_seletedGet = 0 @@ -299,6 +314,7 @@ function M:__OnClickGetCard(context, flag) end function M:ChooseHand(index) + self:ChangeMarkOutCards(self._view_handCardList:GetChildAt(index).data.card_item) self._click_index = index self._view_handCardList.selectedIndex = index self._ctr_seletedGet.selectedIndex = 1 @@ -306,6 +322,7 @@ function M:ChooseHand(index) end function M:ChooseOut() + self:ChangeMarkOutCards(self._view_getCard:GetChildAt(0).data.card_item) self._click_index = -1 self._view_handCardList.selectedIndex = -1 self._ctr_seletedGet.selectedIndex = 0 @@ -313,6 +330,9 @@ function M:ChooseOut() end function M:ClearChoose() + if self._click_index and self._click_index ~= -1 then + self:ChangeMarkOutCards("") + end self._click_index = -1 self._view_handCardList.selectedIndex = -1 self._ctr_seletedGet.selectedIndex = 1 diff --git a/lua_probject/main_project/main/majiang/MJWitnessView.lua b/lua_probject/main_project/main/majiang/MJWitnessView.lua index ca83b66a..cd291cd4 100644 --- a/lua_probject/main_project/main/majiang/MJWitnessView.lua +++ b/lua_probject/main_project/main/majiang/MJWitnessView.lua @@ -165,10 +165,12 @@ function M:OnFangziAction(...) local loader_HuEffect = info._viewClip_Peng_Gang local effects = "" if fz.type == FZType.Peng then + self:PlaySound("Main_Majiang", player.self_user.sex, "peng") effects = "clip_peng" elseif fz.type == FZType.Chi then else + self:PlaySound("Main_Majiang", player.self_user.sex, "gang") effects = "clip_gang" end local clip = UIPackage.CreateObjectFromURL(string.format("ui://Main_Majiang/%s", effects)) diff --git a/wb_new_ui/assets/Chat/Main.xml b/wb_new_ui/assets/Chat/Main.xml index e71667bc..f2c4d0ac 100644 --- a/wb_new_ui/assets/Chat/Main.xml +++ b/wb_new_ui/assets/Chat/Main.xml @@ -1,17 +1,9 @@ - + - - - - -