Branch_DNA
parent
a8f8a12afe
commit
45b3c365e1
|
|
@ -7,15 +7,15 @@ local ArtResourcesConfig = ConfigManager.GetConfig(ConfigName.ArtResourcesConfig
|
||||||
local expressionConfig = ConfigManager.GetAllConfigsData(ConfigName.ExpressionConfig)
|
local expressionConfig = ConfigManager.GetAllConfigsData(ConfigName.ExpressionConfig)
|
||||||
local TabBox = require("Modules/Common/TabBox")
|
local TabBox = require("Modules/Common/TabBox")
|
||||||
local _TabData = {
|
local _TabData = {
|
||||||
{text = GetLanguageStrById(10401), channel = CHAT_CHANNEL.FRIEND, rpType = RedPointType.Chat_Friend, image = "X1_guaji_liaotiantubiao_04"},
|
{ text = GetLanguageStrById(10401), channel = CHAT_CHANNEL.FRIEND, rpType = RedPointType.Chat_Friend, image = "X1_guaji_liaotiantubiao_04" },
|
||||||
{text = GetLanguageStrById(10402), channel = CHAT_CHANNEL.FAMILY, image = "X1_guaji_liaotiantubiao_03"},
|
{ text = GetLanguageStrById(10402), channel = CHAT_CHANNEL.FAMILY, image = "X1_guaji_liaotiantubiao_03" },
|
||||||
{text = GetLanguageStrById(10403), channel = CHAT_CHANNEL.GLOBAL, image = "X1_guaji_liaotiantubiao_02"},
|
{ text = GetLanguageStrById(10403), channel = CHAT_CHANNEL.GLOBAL, image = "X1_guaji_liaotiantubiao_02" },
|
||||||
{text = GetLanguageStrById(23004), channel = CHAT_CHANNEL.CrossRealm, image = "X1_guaji_liaotiantubiao_05"},
|
{ text = GetLanguageStrById(23004), channel = CHAT_CHANNEL.CrossRealm, image = "X1_guaji_liaotiantubiao_05" },
|
||||||
{text = GetLanguageStrById(10384), channel = CHAT_CHANNEL.SYSTEM, image = "X1_guaji_liaotiantubiao_01"},
|
{ text = GetLanguageStrById(10384), channel = CHAT_CHANNEL.SYSTEM, image = "X1_guaji_liaotiantubiao_01" },
|
||||||
}
|
}
|
||||||
local txtColor = {
|
local txtColor = {
|
||||||
default = Color.New(199/255,190/255,220/255,153/255),
|
default = Color.New(199 / 255, 190 / 255, 220 / 255, 153 / 255),
|
||||||
select = Color.New(255/255,209/255,43/255,255/255),
|
select = Color.New(255 / 255, 209 / 255, 43 / 255, 255 / 255),
|
||||||
}
|
}
|
||||||
local chatImgViewShow = false
|
local chatImgViewShow = false
|
||||||
-- 当前所在的聊天通道
|
-- 当前所在的聊天通道
|
||||||
|
|
@ -84,7 +84,7 @@ function ChatPanel:BindEvent()
|
||||||
-- this:ClosePanel()
|
-- this:ClosePanel()
|
||||||
-- UIManager.OpenPanel(UIName.MainPanel)
|
-- UIManager.OpenPanel(UIName.MainPanel)
|
||||||
-- else
|
-- else
|
||||||
this:ClosePanel()
|
this:ClosePanel()
|
||||||
-- end
|
-- end
|
||||||
end)
|
end)
|
||||||
Util.AddClick(this.chatImgBtn, function()
|
Util.AddClick(this.chatImgBtn, function()
|
||||||
|
|
@ -109,7 +109,6 @@ function ChatPanel:BindEvent()
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
ChatManager.RequestSendChatMsg(this.curChannel, content, function()
|
ChatManager.RequestSendChatMsg(this.curChannel, content, function()
|
||||||
-- 清空聊天显示
|
-- 清空聊天显示
|
||||||
|
|
@ -119,11 +118,13 @@ function ChatPanel:BindEvent()
|
||||||
this.freeCount:SetActive(PrivilegeManager.GetPrivilegeRemainValue(91001) > 0)
|
this.freeCount:SetActive(PrivilegeManager.GetPrivilegeRemainValue(91001) > 0)
|
||||||
this.buyCount:SetActive(PrivilegeManager.GetPrivilegeRemainValue(91001) <= 0)
|
this.buyCount:SetActive(PrivilegeManager.GetPrivilegeRemainValue(91001) <= 0)
|
||||||
if PrivilegeManager.GetPrivilegeRemainValue(91001) > 0 then
|
if PrivilegeManager.GetPrivilegeRemainValue(91001) > 0 then
|
||||||
this.freeCount:GetComponent("Text").text = string.format(GetLanguageStrById(10647),PrivilegeManager.GetPrivilegeRemainValue(91001))
|
this.freeCount:GetComponent("Text").text = string.format(GetLanguageStrById(10647),
|
||||||
|
PrivilegeManager.GetPrivilegeRemainValue(91001))
|
||||||
else
|
else
|
||||||
local costItem = string.split(G_SpecialConfig[155].Value,"#")
|
local costItem = string.split(G_SpecialConfig[155].Value, "#")
|
||||||
this.buyCount:GetComponent("Image").sprite = Util.LoadSprite(GetResourcePath(G_ItemConfig[tonumber(costItem[1])].ResourceID))
|
this.buyCount:GetComponent("Image").sprite = Util.LoadSprite(GetResourcePath(G_ItemConfig
|
||||||
this.buyCountText:GetComponent("Text").text = "x"..costItem[2]
|
[tonumber(costItem[1])].ResourceID))
|
||||||
|
this.buyCountText:GetComponent("Text").text = "x" .. costItem[2]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
--this.RefreshShow(true)
|
--this.RefreshShow(true)
|
||||||
|
|
@ -140,7 +141,7 @@ function ChatPanel:BindEvent()
|
||||||
this.playerInfo:SetActive(false)
|
this.playerInfo:SetActive(false)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
Util.AddClick(this.btnNew, function ()
|
Util.AddClick(this.btnNew, function()
|
||||||
this.RefreshShow(true)
|
this.RefreshShow(true)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|
@ -165,11 +166,10 @@ end
|
||||||
--界面打开时调用(用于子类重写)
|
--界面打开时调用(用于子类重写)
|
||||||
function ChatPanel:OnOpen(...)
|
function ChatPanel:OnOpen(...)
|
||||||
-- 参数保存
|
-- 参数保存
|
||||||
local args = {...}
|
local args = { ... }
|
||||||
this.jumpType = args[2] or 1
|
this.jumpType = args[2] or 1
|
||||||
this.curTabIndex = args[1] or 4
|
this.curTabIndex = args[1] or 4
|
||||||
this.curChannel = _TabData[this.curTabIndex].channel
|
this.curChannel = _TabData[this.curTabIndex].channel
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--界面打开或者重新打开后,界面刷新时调用(用于子类重写)
|
--界面打开或者重新打开后,界面刷新时调用(用于子类重写)
|
||||||
|
|
@ -280,6 +280,7 @@ function this.TabIsLockCheck(index)
|
||||||
end
|
end
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
-- 节点状态改变回调事件
|
-- 节点状态改变回调事件
|
||||||
function this.OnTabChange(index, lastIndex)
|
function this.OnTabChange(index, lastIndex)
|
||||||
-- 关闭上个界面
|
-- 关闭上个界面
|
||||||
|
|
@ -298,7 +299,7 @@ function this.OnTabChange(index, lastIndex)
|
||||||
|
|
||||||
-- 是否能够发言
|
-- 是否能够发言
|
||||||
this.curChannel = _TabData[index].channel
|
this.curChannel = _TabData[index].channel
|
||||||
if this.curChannel == 1 or this.curChannel == 2 then
|
if this.curChannel == 1 or this.curChannel == 2 then
|
||||||
ChatPanel:SetInputPosition(1)
|
ChatPanel:SetInputPosition(1)
|
||||||
elseif this.curChannel == 16 then
|
elseif this.curChannel == 16 then
|
||||||
ChatPanel:SetInputPosition(2)
|
ChatPanel:SetInputPosition(2)
|
||||||
|
|
@ -307,36 +308,46 @@ function this.OnTabChange(index, lastIndex)
|
||||||
end
|
end
|
||||||
if this.curChannel == 1 or this.curChannel == 2 or this.curChannel == 16 then
|
if this.curChannel == 1 or this.curChannel == 2 or this.curChannel == 16 then
|
||||||
if ActTimeCtrlManager.SingleFuncState(FUNCTION_OPEN_TYPE.CHAT) then
|
if ActTimeCtrlManager.SingleFuncState(FUNCTION_OPEN_TYPE.CHAT) then
|
||||||
this.input:SetActive(true)
|
if this.curChannel == 1 and VipManager.GetChargedNum() < 30 then
|
||||||
this.chatImgBtn:SetActive(true)
|
this.chatImgBtn:SetActive(false)
|
||||||
this.noInputTip:SetActive(false)
|
this.chatImgBtn:SetActive(false)
|
||||||
if this.curChannel == 16 then
|
this.input:SetActive(false)
|
||||||
this.btncount:SetActive(true)
|
this.noInputTip:SetActive(true)
|
||||||
this.freeCount:SetActive(PrivilegeManager.GetPrivilegeRemainValue(91001) > 0)
|
this.noInputTip:GetComponent("Text").text = "充值30元可解锁发言!"
|
||||||
this.buyCount:SetActive(PrivilegeManager.GetPrivilegeRemainValue(91001) <= 0)
|
|
||||||
if PrivilegeManager.GetPrivilegeRemainValue(91001)>0 then
|
|
||||||
this.freeCount:GetComponent("Text").text = string.format(GetLanguageStrById(10647),PrivilegeManager.GetPrivilegeRemainValue(91001))
|
|
||||||
else
|
|
||||||
local costItem = string.split(G_SpecialConfig[155].Value,"#")
|
|
||||||
this.buyCount:GetComponent("Image").sprite = Util.LoadSprite(GetResourcePath(G_ItemConfig[tonumber(costItem[1])].ResourceID))
|
|
||||||
this.buyCountText:GetComponent("Text").text = "x"..costItem[2]
|
|
||||||
end
|
|
||||||
else
|
else
|
||||||
this.btncount:SetActive(false)
|
this.input:SetActive(true)
|
||||||
|
this.chatImgBtn:SetActive(true)
|
||||||
|
this.noInputTip:SetActive(false)
|
||||||
|
if this.curChannel == 16 then
|
||||||
|
this.btncount:SetActive(true)
|
||||||
|
this.freeCount:SetActive(PrivilegeManager.GetPrivilegeRemainValue(91001) > 0)
|
||||||
|
this.buyCount:SetActive(PrivilegeManager.GetPrivilegeRemainValue(91001) <= 0)
|
||||||
|
if PrivilegeManager.GetPrivilegeRemainValue(91001) > 0 then
|
||||||
|
this.freeCount:GetComponent("Text").text = string.format(GetLanguageStrById(10647),
|
||||||
|
PrivilegeManager.GetPrivilegeRemainValue(91001))
|
||||||
|
else
|
||||||
|
local costItem = string.split(G_SpecialConfig[155].Value, "#")
|
||||||
|
this.buyCount:GetComponent("Image").sprite = Util.LoadSprite(GetResourcePath(G_ItemConfig
|
||||||
|
[tonumber(costItem[1])].ResourceID))
|
||||||
|
this.buyCountText:GetComponent("Text").text = "x" .. costItem[2]
|
||||||
|
end
|
||||||
|
else
|
||||||
|
this.btncount:SetActive(false)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
this.chatImgBtn:SetActive(false)
|
this.chatImgBtn:SetActive(false)
|
||||||
this.chatImgBtn:SetActive(false)
|
this.chatImgBtn:SetActive(false)
|
||||||
this.input:SetActive(false)
|
this.input:SetActive(false)
|
||||||
this.noInputTip:SetActive(true)
|
this.noInputTip:SetActive(true)
|
||||||
local dataLv = tonumber(ConfigManager.GetConfigData(ConfigName.SpecialConfig,2024).Value)
|
local dataLv = tonumber(ConfigManager.GetConfigData(ConfigName.SpecialConfig, 2024).Value)
|
||||||
this.noInputTip:GetComponent("Text").text = string.format(GetLanguageStrById(10387),dataLv)
|
this.noInputTip:GetComponent("Text").text = string.format(GetLanguageStrById(10387), dataLv)
|
||||||
end
|
end
|
||||||
elseif this.curChannel == 0 or this.curChannel == 3 then
|
elseif this.curChannel == 0 or this.curChannel == 3 then
|
||||||
this.chatImgBtn:SetActive(false)
|
this.chatImgBtn:SetActive(false)
|
||||||
this.input:SetActive(false)
|
this.input:SetActive(false)
|
||||||
this.chatImgBtn:SetActive(false)
|
this.chatImgBtn:SetActive(false)
|
||||||
this.noInputTip:SetActive(true)
|
this.noInputTip:SetActive(true)
|
||||||
this.noInputTip:GetComponent("Text").text = GetLanguageStrById(10406)
|
this.noInputTip:GetComponent("Text").text = GetLanguageStrById(10406)
|
||||||
end
|
end
|
||||||
-- 刷新显示
|
-- 刷新显示
|
||||||
|
|
@ -354,20 +365,19 @@ function ChatPanel:SetScrollItem(go, data, index)
|
||||||
-- local desc = Util.GetGameObject(go.gameObject, "desc"):GetComponent("Text")
|
-- local desc = Util.GetGameObject(go.gameObject, "desc"):GetComponent("Text")
|
||||||
img.sprite = Util.LoadSprite(data.ResourceName)
|
img.sprite = Util.LoadSprite(data.ResourceName)
|
||||||
Util.AddOnceClick(go.gameObject, function()
|
Util.AddOnceClick(go.gameObject, function()
|
||||||
this.inputText.text = this.inputText.text..data.Esc
|
this.inputText.text = this.inputText.text .. data.Esc
|
||||||
end)
|
end)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- 数据变化回调
|
-- 数据变化回调
|
||||||
function this.RefreshBottomShow()
|
function this.RefreshBottomShow()
|
||||||
local data = tonumber(ConfigManager.GetConfigData(ConfigName.SpecialConfig,2015).Value)
|
local data = tonumber(ConfigManager.GetConfigData(ConfigName.SpecialConfig, 2015).Value)
|
||||||
local dataLv = tonumber(ConfigManager.GetConfigData(ConfigName.SpecialConfig,2024).Value)
|
local dataLv = tonumber(ConfigManager.GetConfigData(ConfigName.SpecialConfig, 2024).Value)
|
||||||
if data == 0 then
|
if data == 0 then
|
||||||
this.bottomTip:SetActive(false)
|
this.bottomTip:SetActive(false)
|
||||||
elseif data > 0 then
|
elseif data > 0 then
|
||||||
this.bottomTip:SetActive(true)
|
this.bottomTip:SetActive(true)
|
||||||
local str = FirstRechargeManager.GetAccumRechargeValue().."/"..data
|
local str = FirstRechargeManager.GetAccumRechargeValue() .. "/" .. data
|
||||||
if FirstRechargeManager.GetAccumRechargeValue() >= data then
|
if FirstRechargeManager.GetAccumRechargeValue() >= data then
|
||||||
str = string.format("<color=#32e17c>%s</color>", str)
|
str = string.format("<color=#32e17c>%s</color>", str)
|
||||||
if PlayerManager.level >= dataLv then
|
if PlayerManager.level >= dataLv then
|
||||||
|
|
@ -377,7 +387,7 @@ function this.RefreshBottomShow()
|
||||||
str = string.format("<color=#bd3937>%s</color>", str)
|
str = string.format("<color=#bd3937>%s</color>", str)
|
||||||
end
|
end
|
||||||
|
|
||||||
this.tips_1.text = string.format(GetLanguageStrById(50409),dataLv,str)
|
this.tips_1.text = string.format(GetLanguageStrById(50409), dataLv, str)
|
||||||
this.tips_2.text = GetLanguageStrById(50410)
|
this.tips_2.text = GetLanguageStrById(50410)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
@ -398,7 +408,7 @@ function this.RefreshShow(isForceBottom)
|
||||||
if this.curChannel ~= CHAT_CHANNEL.FRIEND then
|
if this.curChannel ~= CHAT_CHANNEL.FRIEND then
|
||||||
GoToIndex = #datalist
|
GoToIndex = #datalist
|
||||||
end
|
end
|
||||||
|
|
||||||
curSV:SetData(datalist, function(dataIndex, go)
|
curSV:SetData(datalist, function(dataIndex, go)
|
||||||
-- 判断是否要显示聊天的时间
|
-- 判断是否要显示聊天的时间
|
||||||
local isShowTime = false
|
local isShowTime = false
|
||||||
|
|
@ -415,12 +425,12 @@ function this.RefreshShow(isForceBottom)
|
||||||
this.ChatItemAdapter(go, data, false, false, true)
|
this.ChatItemAdapter(go, data, false, false, true)
|
||||||
elseif this.curChannel == CHAT_CHANNEL.SYSTEM then
|
elseif this.curChannel == CHAT_CHANNEL.SYSTEM then
|
||||||
this.SystemItemAdapter(go, data, isShowTime)
|
this.SystemItemAdapter(go, data, isShowTime)
|
||||||
-- elseif this.curChannel == CHAT_CHANNEL.CrossRealm then
|
-- elseif this.curChannel == CHAT_CHANNEL.CrossRealm then
|
||||||
-- this.CrossRealmChatItemAdapter(go, data, isShowTime)
|
-- this.CrossRealmChatItemAdapter(go, data, isShowTime)
|
||||||
else
|
else
|
||||||
this.ChatItemAdapter(go, data, isShowTime, this.curChannel == CHAT_CHANNEL.CrossRealm)
|
this.ChatItemAdapter(go, data, isShowTime, this.curChannel == CHAT_CHANNEL.CrossRealm)
|
||||||
end
|
end
|
||||||
end)--, _GoToIndex)
|
end) --, _GoToIndex)
|
||||||
|
|
||||||
|
|
||||||
if isForceBottom and GoToIndex then
|
if isForceBottom and GoToIndex then
|
||||||
|
|
@ -442,18 +452,17 @@ function this.GetScrollView(index)
|
||||||
if not this.FriendScrollView then
|
if not this.FriendScrollView then
|
||||||
local rootHight = this.scrollRoot.transform.rect.height
|
local rootHight = this.scrollRoot.transform.rect.height
|
||||||
local sv = SubUIManager.Open(SubUIConfig.ScrollFitterView, this.scrollRoot.transform,
|
local sv = SubUIManager.Open(SubUIConfig.ScrollFitterView, this.scrollRoot.transform,
|
||||||
this.chatItem, Vector2.New(1080, rootHight - 10), 1, 10)
|
this.chatItem, Vector2.New(1080, rootHight - 10), 1, 10)
|
||||||
sv.gameObject:GetComponent("RectTransform").anchoredPosition = Vector2.New(0, -5)
|
sv.gameObject:GetComponent("RectTransform").anchoredPosition = Vector2.New(0, -5)
|
||||||
sv.moveTween.Strength = 2
|
sv.moveTween.Strength = 2
|
||||||
this.FriendScrollView = sv
|
this.FriendScrollView = sv
|
||||||
end
|
end
|
||||||
return this.FriendScrollView
|
return this.FriendScrollView
|
||||||
|
|
||||||
elseif index == 2 then
|
elseif index == 2 then
|
||||||
if not this.GongHuiScrollView then
|
if not this.GongHuiScrollView then
|
||||||
local rootHight = this.scrollRoot.transform.rect.height
|
local rootHight = this.scrollRoot.transform.rect.height
|
||||||
local sv = SubUIManager.Open(SubUIConfig.ScrollFitterView, this.scrollRoot.transform,
|
local sv = SubUIManager.Open(SubUIConfig.ScrollFitterView, this.scrollRoot.transform,
|
||||||
this.chatItem, Vector2.New(1080, rootHight - 10), 1, 10)
|
this.chatItem, Vector2.New(1080, rootHight - 10), 1, 10)
|
||||||
sv.gameObject:GetComponent("RectTransform").anchoredPosition = Vector2.New(0, -5)
|
sv.gameObject:GetComponent("RectTransform").anchoredPosition = Vector2.New(0, -5)
|
||||||
sv.moveTween.Strength = 2
|
sv.moveTween.Strength = 2
|
||||||
this.GongHuiScrollView = sv
|
this.GongHuiScrollView = sv
|
||||||
|
|
@ -463,7 +472,7 @@ function this.GetScrollView(index)
|
||||||
if not this.ChatScrollView then
|
if not this.ChatScrollView then
|
||||||
local rootHight = this.scrollRoot.transform.rect.height
|
local rootHight = this.scrollRoot.transform.rect.height
|
||||||
local sv = SubUIManager.Open(SubUIConfig.ScrollFitterView, this.scrollRoot.transform,
|
local sv = SubUIManager.Open(SubUIConfig.ScrollFitterView, this.scrollRoot.transform,
|
||||||
this.chatItem, Vector2.New(1080, rootHight - 10), 1, 10)
|
this.chatItem, Vector2.New(1080, rootHight - 10), 1, 10)
|
||||||
sv.gameObject:GetComponent("RectTransform").anchoredPosition = Vector2.New(0, -5)
|
sv.gameObject:GetComponent("RectTransform").anchoredPosition = Vector2.New(0, -5)
|
||||||
sv.moveTween.Strength = 2
|
sv.moveTween.Strength = 2
|
||||||
this.ChatScrollView = sv
|
this.ChatScrollView = sv
|
||||||
|
|
@ -473,7 +482,7 @@ function this.GetScrollView(index)
|
||||||
if not this.SystemScrollView then
|
if not this.SystemScrollView then
|
||||||
local rootHight = this.scrollRoot.transform.rect.height
|
local rootHight = this.scrollRoot.transform.rect.height
|
||||||
local sv = SubUIManager.Open(SubUIConfig.ScrollFitterView, this.scrollRoot.transform,
|
local sv = SubUIManager.Open(SubUIConfig.ScrollFitterView, this.scrollRoot.transform,
|
||||||
this.systemItem, Vector2.New(980, rootHight - 10), 1, 20)
|
this.systemItem, Vector2.New(980, rootHight - 10), 1, 20)
|
||||||
sv.gameObject:GetComponent("RectTransform").anchoredPosition = Vector2.New(0, -5)
|
sv.gameObject:GetComponent("RectTransform").anchoredPosition = Vector2.New(0, -5)
|
||||||
sv.moveTween.Strength = 2
|
sv.moveTween.Strength = 2
|
||||||
this.SystemScrollView = sv
|
this.SystemScrollView = sv
|
||||||
|
|
@ -483,7 +492,7 @@ function this.GetScrollView(index)
|
||||||
if not this.CrossRealmScrollView then
|
if not this.CrossRealmScrollView then
|
||||||
local rootHight = this.scrollRoot.transform.rect.height
|
local rootHight = this.scrollRoot.transform.rect.height
|
||||||
local sv = SubUIManager.Open(SubUIConfig.ScrollFitterView, this.scrollRoot.transform,
|
local sv = SubUIManager.Open(SubUIConfig.ScrollFitterView, this.scrollRoot.transform,
|
||||||
this.chatItem, Vector2.New(1080, rootHight - 10), 1, 10)
|
this.chatItem, Vector2.New(1080, rootHight - 10), 1, 10)
|
||||||
sv.gameObject:GetComponent("RectTransform").anchoredPosition = Vector2.New(0, -5)
|
sv.gameObject:GetComponent("RectTransform").anchoredPosition = Vector2.New(0, -5)
|
||||||
sv.moveTween.Strength = 2
|
sv.moveTween.Strength = 2
|
||||||
this.CrossRealmScrollView = sv
|
this.CrossRealmScrollView = sv
|
||||||
|
|
@ -503,17 +512,17 @@ function this.SystemItemAdapter(node, data, isShowTime)
|
||||||
isShowTime = false
|
isShowTime = false
|
||||||
time:SetActive(isShowTime)
|
time:SetActive(isShowTime)
|
||||||
if isShowTime then
|
if isShowTime then
|
||||||
time:GetComponent("Text").text = TimeStampToDateStr(tonumber(data.times)/1000)
|
time:GetComponent("Text").text = TimeStampToDateStr(tonumber(data.times) / 1000)
|
||||||
end
|
end
|
||||||
|
|
||||||
local sTypeInfo = ChatManager.SYS_MSG_TYPE[data.messageType]
|
local sTypeInfo = ChatManager.SYS_MSG_TYPE[data.messageType]
|
||||||
if sTypeInfo then
|
if sTypeInfo then
|
||||||
this.SetActive(sType,true)
|
this.SetActive(sType, true)
|
||||||
sTypeStr.text = sTypeInfo.name
|
sTypeStr.text = sTypeInfo.name
|
||||||
content.text = GetMailConfigDesc(data.msg,data.chatparms)
|
content.text = GetMailConfigDesc(data.msg, data.chatparms)
|
||||||
else
|
else
|
||||||
this.SetActive(sType,false)
|
this.SetActive(sType, false)
|
||||||
content.text = GetMailConfigDesc(data.msg,data.chatparms)
|
content.text = GetMailConfigDesc(data.msg, data.chatparms)
|
||||||
end
|
end
|
||||||
|
|
||||||
Util.AddOnceClick(bg, function()
|
Util.AddOnceClick(bg, function()
|
||||||
|
|
@ -524,8 +533,9 @@ function this.SystemItemAdapter(node, data, isShowTime)
|
||||||
local itemDataConFig = itemConfig[data.itemId]
|
local itemDataConFig = itemConfig[data.itemId]
|
||||||
if not itemDataConFig then return end
|
if not itemDataConFig then return end
|
||||||
if itemDataConFig.ItemType == ItemType.Hero then
|
if itemDataConFig.ItemType == ItemType.Hero then
|
||||||
local heroConfigData = ConfigManager.GetConfigData(ConfigName.HeroConfig, itemConfig[data.itemId].HeroStar[1])
|
local heroConfigData = ConfigManager.GetConfigData(ConfigName.HeroConfig, itemConfig[data.itemId].HeroStar
|
||||||
UIManager.OpenPanel(UIName.RoleGetInfoPopup,false,heroConfigData.Id,itemConfig[data.itemId].HeroStar[2])
|
[1])
|
||||||
|
UIManager.OpenPanel(UIName.RoleGetInfoPopup, false, heroConfigData.Id, itemConfig[data.itemId].HeroStar[2])
|
||||||
elseif itemDataConFig.ItemType == ItemType.Equip then
|
elseif itemDataConFig.ItemType == ItemType.Equip then
|
||||||
UIManager.OpenPanel(UIName.HandBookEquipInfoPanel, data.itemId)
|
UIManager.OpenPanel(UIName.HandBookEquipInfoPanel, data.itemId)
|
||||||
else
|
else
|
||||||
|
|
@ -556,9 +566,9 @@ function this.ChatItemAdapter(node, data, isShowTime, isShowServerName, isFriend
|
||||||
local name = Util.GetGameObject(node, "contentroot/bg/info/name/name"):GetComponent("Text")
|
local name = Util.GetGameObject(node, "contentroot/bg/info/name/name"):GetComponent("Text")
|
||||||
local zw = Util.GetGameObject(node, "contentroot/bg/info/pos")
|
local zw = Util.GetGameObject(node, "contentroot/bg/info/pos")
|
||||||
local zwName = Util.GetGameObject(node, "contentroot/bg/info/pos/pos/Text"):GetComponent("Text")
|
local zwName = Util.GetGameObject(node, "contentroot/bg/info/pos/pos/Text"):GetComponent("Text")
|
||||||
local CH = Util.GetGameObject(node, "contentroot/bg/info/title/title"):GetComponent("Image")
|
local CH = Util.GetGameObject(node, "contentroot/bg/info/title/title"):GetComponent("Image")
|
||||||
local CHEffect = Util.GetGameObject(node, "contentroot/bg/info/title/title/Image"):GetComponent("Image")
|
local CHEffect = Util.GetGameObject(node, "contentroot/bg/info/title/title/Image"):GetComponent("Image")
|
||||||
local CHison = Util.GetGameObject(node, "contentroot/bg/info/title")
|
local CHison = Util.GetGameObject(node, "contentroot/bg/info/title")
|
||||||
local vip = Util.GetGameObject(node, "base/vip"):GetComponent("Image")
|
local vip = Util.GetGameObject(node, "base/vip"):GetComponent("Image")
|
||||||
-- 判断是否显示时间
|
-- 判断是否显示时间
|
||||||
-- time:SetActive(isShowTime)
|
-- time:SetActive(isShowTime)
|
||||||
|
|
@ -586,13 +596,13 @@ function this.ChatItemAdapter(node, data, isShowTime, isShowServerName, isFriend
|
||||||
-- PopupTipPanel.ShowTip("公会战期间无法加入公会")
|
-- PopupTipPanel.ShowTip("公会战期间无法加入公会")
|
||||||
-- return
|
-- return
|
||||||
--end
|
--end
|
||||||
MsgPanel.ShowTwo(string.format(GetLanguageStrById(10409), chat.gName),nil, function()
|
MsgPanel.ShowTwo(string.format(GetLanguageStrById(10409), chat.gName), nil, function()
|
||||||
if PlayerManager.level < chat.gLimitLv then
|
if PlayerManager.level < chat.gLimitLv then
|
||||||
PopupTipPanel.ShowTipByLanguageId(10410)
|
PopupTipPanel.ShowTipByLanguageId(10410)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if chat.joinType == GUILD_JOIN_TYPE.NO_LIMIT then
|
if chat.joinType == GUILD_JOIN_TYPE.NO_LIMIT then
|
||||||
GuildManager.RequestJoinGuild(chat.gId, function ()
|
GuildManager.RequestJoinGuild(chat.gId, function()
|
||||||
-- -- 关闭当前界面
|
-- -- 关闭当前界面
|
||||||
-- if this._JumpType == 1 then
|
-- if this._JumpType == 1 then
|
||||||
-- this:ClosePanel()
|
-- this:ClosePanel()
|
||||||
|
|
@ -605,17 +615,15 @@ function this.ChatItemAdapter(node, data, isShowTime, isShowServerName, isFriend
|
||||||
PopupTipPanel.ShowTipByLanguageId(10411)
|
PopupTipPanel.ShowTipByLanguageId(10411)
|
||||||
end)
|
end)
|
||||||
elseif chat.joinType == GUILD_JOIN_TYPE.LIMIT then
|
elseif chat.joinType == GUILD_JOIN_TYPE.LIMIT then
|
||||||
GuildManager.RequestApplyManyGuilds({chat.gId}, function()
|
GuildManager.RequestApplyManyGuilds({ chat.gId }, function()
|
||||||
PopupTipPanel.ShowTipByLanguageId(10412)
|
PopupTipPanel.ShowTipByLanguageId(10412)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
elseif chat.joinType == GUILD_JOIN_TYPE.FORBID then
|
elseif chat.joinType == GUILD_JOIN_TYPE.FORBID then
|
||||||
PopupTipPanel.ShowTipByLanguageId(10413)
|
PopupTipPanel.ShowTipByLanguageId(10413)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
elseif this.curChannel == CHAT_CHANNEL.FAMILY then
|
elseif this.curChannel == CHAT_CHANNEL.FAMILY then
|
||||||
local chat = ChatManager.AnalysisGlobalChat(data.msg)
|
local chat = ChatManager.AnalysisGlobalChat(data.msg)
|
||||||
contentStr = chat.content
|
contentStr = chat.content
|
||||||
|
|
@ -650,7 +658,7 @@ function this.ChatItemAdapter(node, data, isShowTime, isShowServerName, isFriend
|
||||||
CHison:SetActive(false)
|
CHison:SetActive(false)
|
||||||
vip.gameObject:SetActive(false)
|
vip.gameObject:SetActive(false)
|
||||||
local fdata = GoodFriendManager.GetFriendInfo(data.friendId)
|
local fdata = GoodFriendManager.GetFriendInfo(data.friendId)
|
||||||
name.text = fdata.name.."[Lv."..fdata.lv.."]"
|
name.text = fdata.name .. "[Lv." .. fdata.lv .. "]"
|
||||||
head.sprite = GetPlayerHeadSprite(fdata.head)
|
head.sprite = GetPlayerHeadSprite(fdata.head)
|
||||||
headKuang.sprite = GetPlayerHeadFrameSprite(fdata.frame)
|
headKuang.sprite = GetPlayerHeadFrameSprite(fdata.frame)
|
||||||
-- redpot:SetActive(FriendChatManager.IsFriendNewChat(data.friendId))
|
-- redpot:SetActive(FriendChatManager.IsFriendNewChat(data.friendId))
|
||||||
|
|
@ -662,7 +670,8 @@ function this.ChatItemAdapter(node, data, isShowTime, isShowServerName, isFriend
|
||||||
if data.senderId == PlayerManager.uid then
|
if data.senderId == PlayerManager.uid then
|
||||||
-- lv.text = "Lv." .. PlayerManager.level
|
-- lv.text = "Lv." .. PlayerManager.level
|
||||||
if isShowServerName then
|
if isShowServerName then
|
||||||
name.text = PlayerManager.nickName .. "[Lv." .. PlayerManager.level .. "]" .. "<color='#9fff88'> [" .. data.serverName .. "]</color>"
|
name.text = PlayerManager.nickName ..
|
||||||
|
"[Lv." .. PlayerManager.level .. "]" .. "<color='#9fff88'> [" .. data.serverName .. "]</color>"
|
||||||
else
|
else
|
||||||
name.text = PlayerManager.nickName .. "[Lv." .. PlayerManager.level .. "]"
|
name.text = PlayerManager.nickName .. "[Lv." .. PlayerManager.level .. "]"
|
||||||
end
|
end
|
||||||
|
|
@ -678,7 +687,7 @@ function this.ChatItemAdapter(node, data, isShowTime, isShowServerName, isFriend
|
||||||
else
|
else
|
||||||
vip.gameObject:SetActive(false)
|
vip.gameObject:SetActive(false)
|
||||||
end
|
end
|
||||||
|
|
||||||
if PlayerManager.designation > 0 then
|
if PlayerManager.designation > 0 then
|
||||||
CHison:SetActive(true)
|
CHison:SetActive(true)
|
||||||
CH.sprite = this.GetTitleIcon(PlayerManager.designation)
|
CH.sprite = this.GetTitleIcon(PlayerManager.designation)
|
||||||
|
|
@ -692,7 +701,8 @@ function this.ChatItemAdapter(node, data, isShowTime, isShowServerName, isFriend
|
||||||
else
|
else
|
||||||
-- lv.text = "Lv." .. data.senderlevel
|
-- lv.text = "Lv." .. data.senderlevel
|
||||||
if isShowServerName then
|
if isShowServerName then
|
||||||
name.text = data.senderName .. "[Lv." .. data.senderlevel .. "]" .. "<color='#9fff88'> [" .. data.serverName .. "]</color>"
|
name.text = data.senderName ..
|
||||||
|
"[Lv." .. data.senderlevel .. "]" .. "<color='#9fff88'> [" .. data.serverName .. "]</color>"
|
||||||
else
|
else
|
||||||
name.text = data.senderName .. "[Lv." .. data.senderlevel .. "]"
|
name.text = data.senderName .. "[Lv." .. data.senderlevel .. "]"
|
||||||
end
|
end
|
||||||
|
|
@ -719,7 +729,7 @@ function this.ChatItemAdapter(node, data, isShowTime, isShowServerName, isFriend
|
||||||
CHison:SetActive(false)
|
CHison:SetActive(false)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- 头像添加点击事件
|
-- 头像添加点击事件
|
||||||
Util.AddOnceClick(head.gameObject, function()
|
Util.AddOnceClick(head.gameObject, function()
|
||||||
if this.curChannel == CHAT_CHANNEL.CrossRealm then
|
if this.curChannel == CHAT_CHANNEL.CrossRealm then
|
||||||
|
|
@ -728,13 +738,13 @@ function this.ChatItemAdapter(node, data, isShowTime, isShowServerName, isFriend
|
||||||
-- 自己不做任何操作
|
-- 自己不做任何操作
|
||||||
if data.senderId ~= PlayerManager.uid then
|
if data.senderId ~= PlayerManager.uid then
|
||||||
this.playerFriend:SetActive(true)
|
this.playerFriend:SetActive(true)
|
||||||
for i,v in pairs(GoodFriendManager.friendAllData) do
|
for i, v in pairs(GoodFriendManager.friendAllData) do
|
||||||
if i == data.senderId and v ~= nil then
|
if i == data.senderId and v ~= nil then
|
||||||
this.playerFriend:SetActive(false)
|
this.playerFriend:SetActive(false)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
--this.ShowPlayerInfo(node, data)
|
--this.ShowPlayerInfo(node, data)
|
||||||
UIManager.OpenPanel(UIName.PlayerInfoPopup,data.senderId)
|
UIManager.OpenPanel(UIName.PlayerInfoPopup, data.senderId)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
@ -765,7 +775,7 @@ end
|
||||||
--显示玩家信息
|
--显示玩家信息
|
||||||
function this.ShowPlayerInfo(node, data)
|
function this.ShowPlayerInfo(node, data)
|
||||||
-- 显示
|
-- 显示
|
||||||
this.SetActive(this.playerInfo,true)
|
this.SetActive(this.playerInfo, true)
|
||||||
-- 设置位置
|
-- 设置位置
|
||||||
local v2 = RectTransformUtility.WorldToScreenPoint(UIManager.camera, node.transform.position)
|
local v2 = RectTransformUtility.WorldToScreenPoint(UIManager.camera, node.transform.position)
|
||||||
this.playerBg.transform.localPosition = Vector3(v2.x + 200, v2.y, 0)
|
this.playerBg.transform.localPosition = Vector3(v2.x + 200, v2.y, 0)
|
||||||
|
|
@ -785,7 +795,7 @@ function this.ShowPlayerInfo(node, data)
|
||||||
Util.AddOnceClick(this.playerFriend, function()
|
Util.AddOnceClick(this.playerFriend, function()
|
||||||
GoodFriendManager.InviteFriendRequest(data.senderId, function()
|
GoodFriendManager.InviteFriendRequest(data.senderId, function()
|
||||||
PopupTipPanel.ShowTip(GetLanguageStrById(10415))
|
PopupTipPanel.ShowTip(GetLanguageStrById(10415))
|
||||||
this.SetActive(this.playerInfo,false)
|
this.SetActive(this.playerInfo, false)
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
@ -798,13 +808,13 @@ function this.MoveTip()
|
||||||
local finalPos = 1080 + tipRect.rect.width
|
local finalPos = 1080 + tipRect.rect.width
|
||||||
|
|
||||||
DoTween.To(DG.Tweening.Core.DOGetter_int(function()
|
DoTween.To(DG.Tweening.Core.DOGetter_int(function()
|
||||||
return 0
|
return 0
|
||||||
end),
|
end),
|
||||||
DG.Tweening.Core.DOSetter_int(function(progress)
|
DG.Tweening.Core.DOSetter_int(function(progress)
|
||||||
tipRect.anchoredPosition3D = Vector3.New(0 - progress, 0, 0)
|
tipRect.anchoredPosition3D = Vector3.New(0 - progress, 0, 0)
|
||||||
end),
|
end),
|
||||||
finalPos,
|
finalPos,
|
||||||
finalPos/100):SetEase(Ease.Linear):OnComplete(function()
|
finalPos / 100):SetEase(Ease.Linear):OnComplete(function()
|
||||||
this.SetActive(this.tip, false)
|
this.SetActive(this.tip, false)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
@ -828,4 +838,4 @@ function this:SetInputPosition(type)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
return ChatPanel
|
return ChatPanel
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue