临时上传,四人界面进行中

master
罗家炜 2025-04-18 19:08:32 +08:00
parent 5f6d3f15ea
commit 1b7fe6e1c6
6 changed files with 128 additions and 8 deletions

View File

@ -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()

View File

@ -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

View File

@ -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")

View File

@ -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)

View File

@ -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']