diff --git a/lua_probject/extend_project/extend/majiang/lichuan/EXMainView_jaingxi.lua b/lua_probject/extend_project/extend/majiang/lichuan/EXMainView_jaingxi.lua index 7a0b4fc0..b7aea63a 100644 --- a/lua_probject/extend_project/extend/majiang/lichuan/EXMainView_jaingxi.lua +++ b/lua_probject/extend_project/extend/majiang/lichuan/EXMainView_jaingxi.lua @@ -1,11 +1,11 @@ local MJPlayerSelfCardInfoView = import(".MJPlayerSelfCardInfoView_jiangxi") -local MJPlayerCardInfoView = require(".MJPlayerCardInfoView_jiangxi") +local MJPlayerCardInfoView = import(".MJPlayerCardInfoView_jiangxi") local MJMainView = require("main.majiang.MJMainView") local EXClearingView = import(".EXClearingView") local TX_GameEvent = import(".GameEvent") local HuTipView = import("main.majiang.HuTipView") local SettingView = import(".EXSettingView") -local PlayerInfoView = import(".EXPlayerInfoView") +local PlayerInfoView = import(".EXPlayerInfoView_jiangxi") local M = {} --- Create a new ZZ_MainView @@ -56,7 +56,7 @@ function M:InitView(url) local btn_closeRoom = self._view:GetChild("btn_setting") local conterBoxComp = self._view:GetChild("Comp_ConterBox") - self._ctr_cardbox = conterBoxComp:GetController("type") + self._ctr_cardbox = conterBoxComp:GetController("seat") self._tex_leftTime = conterBoxComp:GetChild("Text_Time") self._view:GetChild('btn_closeRoom').onClick:Set(function() diff --git a/lua_probject/extend_project/extend/majiang/lichuan/EXPlayerInfoView_jiangxi.lua b/lua_probject/extend_project/extend/majiang/lichuan/EXPlayerInfoView_jiangxi.lua new file mode 100644 index 00000000..89a128b5 --- /dev/null +++ b/lua_probject/extend_project/extend/majiang/lichuan/EXPlayerInfoView_jiangxi.lua @@ -0,0 +1,51 @@ +local PlayerInfoView = require("Game.View.PlayerInfoView_copy") + +local M = {} + +function M.new(view, mainView) + setmetatable(M, { __index = PlayerInfoView }) + local self = setmetatable({}, { __index = M }) + self._view = view + self._main_view = mainView + self:init() + return self +end + +function M:init() + PlayerInfoView.init(self) +end + +function M:ShowInteraction(type, str) + if type == 3 then + Voice.DownLoad(str, function(clip) + if (clip) then + self:ShowMaskVoice(clip.length) + GameApplication.Instance:PlayVoice(clip) + end + end) + elseif type == 4 then + self:SetChat(str) + elseif type == 2 then + local chat_index = tonumber(str) + self._main_view:PlayChatSound(self._player.self_user.sex, chat_index) + local language, index = self._main_view:GetChatMsgLanguage(chat_index) + self:SetChat(self._main_view.Fix_Msg_Chat[index]) + elseif type == 1 then + self:SetBiaoqing("ui://Chat/" .. str) + end +end + +function M:UpdateRemainCard(card_num, hide) + if hide then + self._view:GetController("show_remain").selectedIndex = 0 + else + self._view:GetController("show_remain").selectedIndex = 1 + end + self._view:GetChild("com_remain"):GetChild("tex_remain").text = card_num +end + +function M:FillData(player) + PlayerInfoView.FillData(self, player) +end + +return M diff --git a/lua_probject/extend_project/extend/majiang/lichuan/ExtendConfig.lua b/lua_probject/extend_project/extend/majiang/lichuan/ExtendConfig.lua index 2307cf22..e4baebc7 100644 --- a/lua_probject/extend_project/extend/majiang/lichuan/ExtendConfig.lua +++ b/lua_probject/extend_project/extend/majiang/lichuan/ExtendConfig.lua @@ -1,7 +1,7 @@ local EXTEND_MODEL_NAME = ... local EXGameInfo = import(".EXGameInfo") -local EXMainView = import(".EXMainView") +local EXMainView = import(".EXMainView_jaingxi") local EXGameController = import(".EXGameController") local EXRoomConfig = import(".EXRoomConfig") local EXPlayBackView = import(".EXPlayBackView") diff --git a/lua_probject/extend_project/extend/majiang/lichuan/MJPlayerSelfCardInfoView_jiangxi.lua b/lua_probject/extend_project/extend/majiang/lichuan/MJPlayerSelfCardInfoView_jiangxi.lua index f855e2f3..7f249e89 100644 --- a/lua_probject/extend_project/extend/majiang/lichuan/MJPlayerSelfCardInfoView_jiangxi.lua +++ b/lua_probject/extend_project/extend/majiang/lichuan/MJPlayerSelfCardInfoView_jiangxi.lua @@ -3,6 +3,26 @@ local MJPlayerCardInfoView = require("main.majiang.MJPlayerCardInfoView") local CardCheck = import(".CardCheck") local M = {} + +-----------------------lingmeng--------------------------- +--原有mianmajiang +local CardView = { + card = nil, + -- 牌序号 + card_item = 0, + -- 索引 + index = 0, + -- 原始位置 + old_postion = Vector2.zero +} +local function NewCardView(card, cardItem) + local self = {} + setmetatable(self, { __index = CardView }) + self.card = card + self.card_item = cardItem + return self +end +---------------------------------------------------------- -- function M.new(view, mainView) setmetatable(MJPlayerSelfCardInfoView, { __index = MJPlayerCardInfoView }) @@ -15,6 +35,20 @@ function M.new(view, mainView) return self end +function M:init() + MJPlayerSelfCardInfoView.init(self) + + local CardInfo = self._view:GetChild('Text_CardInfo') + self._viewText_cardInfo = json.decode(CardInfo.text) + + self._view_handCardList = self._view:GetChild('List_HandCard') + self._view_FZList = self._view:GetChild('List_FZ') + self._view_outCardList = self._view:GetChild('List_OutCard') + self._viewBtn_getCard = self._view:GetChild('Btn_HandCard') + + self._ctr_getCard = self._view:GetController('getCard') +end + function M:ShowHuTip(card_list) printlog("ShowHuTip") local tingList = CardCheck.MuiltiplteCaculateTingPai(card_list, true, DataManager.CurrenRoom.room_config.Qidui, @@ -33,7 +67,6 @@ function M:ShowHuTip(card_list) end function M:UpdateHandCard(getcard, mp) - print("====================================UpdateHandCard1", mp) MJPlayerSelfCardInfoView.UpdateHandCard(self, getcard, mp) local _carViewList = self._carViewList @@ -58,7 +91,6 @@ function M:UpdateHandCard(getcard, mp) end end - print("====================================UpdateHandCard3") local card_list = DataManager.CurrenRoom.self_player.card_list -- self:ShowHuTip(card_list) if getcard then @@ -108,6 +140,38 @@ function M:UpdateHandCard(getcard, mp) end self._out_card = false end + + + -----------------------lingmeng--------------------------- + + getcard = getcard or false + mp = mp or false + + local handCardName = self._viewText_cardInfo['Hand_Card'] + + for i = 0, (#card_list) - 1 do + local tem_card = card_list[i + 1] + local btn_card + if getcard and i == (#card_list) - 1 then + btn_card = self._viewBtn_getCard + self._ctr_getCard.selectedIndex = 1 + else + btn_card = self._view_handCardList:AddItemFromPool() + self._ctr_getCard.selectedIndex = 0 + end + self:fillCard2(btn_card, handCardName, tem_card) + local c_v = NewCardView(btn_card, tem_card) + c_v.index = i + c_v.old_postion = btn_card.xy + _carViewList[#_carViewList + 1] = c_v + + btn_card.data = c_v + btn_card.onTouchBegin:Set(handler(self, self.onTouchBegin)) + btn_card.onTouchMove:Set(handler(self, self.onTouchMove)) + btn_card.onTouchEnd:Set(handler(self, self.__OnDragEnd)) + btn_card.onClick:Set(self.__OnClickHandCard, self) + end + ---------------------------------------------------------- end function M:__OnClickHandCard(context) diff --git a/lua_probject/main_project/main/majiang/MJPlayerCardInfoView.lua b/lua_probject/main_project/main/majiang/MJPlayerCardInfoView.lua index bab71c42..72088559 100644 --- a/lua_probject/main_project/main/majiang/MJPlayerCardInfoView.lua +++ b/lua_probject/main_project/main/majiang/MJPlayerCardInfoView.lua @@ -127,6 +127,13 @@ function M:fillCard(obj, pos_str, card, use3d) end end +function M:fillCard2(obj, pos_str, card) + if DataManager.CurrenRoom.jing and card == DataManager.CurrenRoom.jing and obj:GetController('jing') then + obj:GetController('jing').selectedIndex = 1 + end + obj.icon = 'ui://Main_Majiang/' .. pos_str .. card +end + function M:getBackCard(card) return 'ui://Main_Majiang/' .. card end @@ -138,8 +145,6 @@ function M:GetCard(btn) end function M:UpdateHandCard(getcard, mp) - print("====================================UpdateHandCard4") - getcard = getcard or false mp = mp or false local handcard_list = self._mask_data['handcard_list'] diff --git a/wb_unity_pro/Assets/ART/base/main_majiang/ui/main_majiang_fui.bytes b/wb_unity_pro/Assets/ART/base/main_majiang/ui/main_majiang_fui.bytes index 53b3e746..a7ca8fa6 100644 Binary files a/wb_unity_pro/Assets/ART/base/main_majiang/ui/main_majiang_fui.bytes and b/wb_unity_pro/Assets/ART/base/main_majiang/ui/main_majiang_fui.bytes differ