miduo_client/Assets/ManagedResources/~Lua/Modules/Popup/PlayerInfoPopup.lua

1020 lines
41 KiB
Lua
Raw Normal View History

2020-08-25 15:46:38 +08:00
require("Base/BasePanel")
2020-05-09 13:31:21 +08:00
local PlayerInfoPopup = Inherit(BasePanel)
local this = PlayerInfoPopup
2021-06-15 20:08:14 +08:00
local netserverName = nil
local XiuXianSkillConfig = ConfigManager.GetConfig(ConfigName.XiuXianSkillConfig)
local GemConfig = ConfigManager.GetConfig(ConfigName.GemConfig)
local ItemConfig = ConfigManager.GetConfig(ConfigName.ItemConfig)
local ChangingCard = ConfigManager.GetConfig(ConfigName.ChangingCard)
2024-11-12 16:22:23 +08:00
local isNpc = false --是否是机器人
2020-05-09 13:31:21 +08:00
local _ViewConfig = {
[PLAYER_INFO_VIEW_TYPE.NORMAL] = {
formationType = FormationTypeDef.FORMATION_NORMAL,
2021-04-09 12:26:35 +08:00
tip = Language[10933],
isAddFriend = true,
2020-05-09 13:31:21 +08:00
btnType = {
--{name = "举 报", func = 1},
2024-11-12 16:22:23 +08:00
{ name = Language[11496], func = 2 },
{ name = Language[11497], func = 3 },
2020-05-09 13:31:21 +08:00
}
},
[PLAYER_INFO_VIEW_TYPE.BLACK_REMOVE] = {
formationType = FormationTypeDef.FORMATION_NORMAL,
2021-04-09 12:26:35 +08:00
tip = Language[10933],
isAddFriend = true,
2020-05-09 13:31:21 +08:00
btnType = {
2024-11-12 16:22:23 +08:00
{ name = Language[11498], func = 4 },
2020-05-09 13:31:21 +08:00
}
},
[PLAYER_INFO_VIEW_TYPE.GO_TO_BLACK] = {
formationType = FormationTypeDef.FORMATION_NORMAL,
2021-04-09 12:26:35 +08:00
tip = Language[10933],
isAddFriend = true,
2020-05-09 13:31:21 +08:00
btnType = {
2024-11-12 16:22:23 +08:00
{ name = Language[11499], func = 5 },
2020-05-09 13:31:21 +08:00
}
},
[PLAYER_INFO_VIEW_TYPE.ARENA] = {
formationType = FormationTypeDef.FORMATION_ARENA_DEFEND,
2021-04-09 12:26:35 +08:00
tip = Language[11500],
isAddFriend = true,
2020-05-09 13:31:21 +08:00
},
[PLAYER_INFO_VIEW_TYPE.MIND_DEMON] = {
formationType = FormationTypeDef.MONSTER_CAMP_ATTACK,
2021-05-11 17:03:09 +08:00
tip = Language[12306],
isAddFriend = true,
2021-11-17 11:12:49 +08:00
btnType = {}
2021-05-29 18:37:45 +08:00
},
[PLAYER_INFO_VIEW_TYPE.TSLX] = {
formationType = FormationTypeDef.FORMATION_TSLX,
tip = "挑战阵容",
isAddFriend = true,
2021-11-17 11:12:49 +08:00
btnType = {}
},
2021-06-15 20:08:14 +08:00
[PLAYER_INFO_VIEW_TYPE.JUPMSERVER] = {
formationType = FormationTypeDef.JUMPSERVER_HIGHTLADDER,
2025-08-29 16:19:47 +08:00
tip = "宇宙武道会阵容:",
isAddFriend = false,
2021-06-15 20:08:14 +08:00
btnType = {
-- {name = "挑战", func = 6},
2024-11-12 16:22:23 +08:00
{ name = "切磋", func = 6 },
2021-06-15 20:08:14 +08:00
}
},
[PLAYER_INFO_VIEW_TYPE.JUPMSERVER_NORMAL] = {
formationType = FormationTypeDef.FORMATION_NORMAL,
tip = Language[10933],
isAddFriend = false,
btnType = {
2024-11-12 16:22:23 +08:00
{ name = "切磋", func = 7 },
}
},
2024-11-12 16:22:23 +08:00
[PLAYER_INFO_VIEW_TYPE.TOP_MATCH] = {
formationType = FormationTypeDef.ARENA_TOM_MATCH,
tip = "巅峰赛阵容",
isAddFriend = false,
},
2021-09-16 19:36:16 +08:00
[PLAYER_INFO_VIEW_TYPE.QIJIESHILIAN] = {
formationType = FormationTypeDef.FORMATION_QIJIESHILIAN,
2024-09-12 19:37:04 +08:00
tip = "宇宙生存挑战阵容:",
2021-09-16 19:36:16 +08:00
isAddFriend = false,
btnType = {
-- {name = "切磋", func = 7},
2021-09-16 19:36:16 +08:00
}
},
2021-11-16 17:34:37 +08:00
[PLAYER_INFO_VIEW_TYPE.LINGMAIMIJING] = {
formationType = FormationTypeDef.FORMATION_LINGMAIMIJING,
2024-02-21 15:01:32 +08:00
tip = "空岛阵容:",
2021-11-16 17:34:37 +08:00
isAddFriend = false,
btnType = {
2024-11-12 16:22:23 +08:00
{ name = "切磋", func = 9 },
{ name = "挑战", func = 8 },
{ name = "调整编队", func = 8 },
2021-11-16 17:34:37 +08:00
}
},
2020-05-09 13:31:21 +08:00
}
2022-01-13 15:23:59 +08:00
local InfoBtns = {
[1] = {
name = "紫府神印",
gridName = "imprintInfo",
2024-11-12 16:22:23 +08:00
func = function(data, obj)
this.imprintInfoShow(data, obj)
2022-01-13 18:29:12 +08:00
end
2024-11-12 16:22:23 +08:00
},
2022-01-13 15:23:59 +08:00
[2] = {
2024-01-30 14:35:33 +08:00
name = "奥义卡",
2022-01-13 15:23:59 +08:00
gridName = "huashenInfo",
2024-11-12 16:22:23 +08:00
func = function(data, obj)
this.huashenInfoShow(data, obj)
2022-01-13 18:29:12 +08:00
end
2024-11-12 16:22:23 +08:00
},
2022-01-13 15:23:59 +08:00
[3] = {
name = "四象心法",
gridName = "fourElementInfo",
2024-11-12 16:22:23 +08:00
func = function(data, obj)
this.fourElementInfoShow(data, obj)
2022-01-13 18:29:12 +08:00
end
2024-11-12 16:22:23 +08:00
},
2022-01-13 18:29:12 +08:00
[4] = {
name = "命 格",
gridName = "GemInfo",
2024-11-12 16:22:23 +08:00
func = function(data, obj)
this.GemInfoShow(data, obj)
2022-01-13 18:29:12 +08:00
end
2024-11-12 16:22:23 +08:00
},
2022-01-13 18:29:12 +08:00
[5] = {
name = "坐 骑",
gridName = "RideInfo",
2024-11-12 16:22:23 +08:00
func = function(data, obj)
this.RideInfoShow(data, obj)
2022-01-13 18:29:12 +08:00
end
2024-11-12 16:22:23 +08:00
},
2023-09-13 15:44:06 +08:00
[6] = {
name = "礼 物",
gridName = "giftInfo",
2024-11-12 16:22:23 +08:00
func = function(data, obj)
this.GiftInfoShow(data, obj)
2023-09-13 15:44:06 +08:00
end
2024-11-12 16:22:23 +08:00
},
2022-01-13 15:23:59 +08:00
}
local curPlayerName = ""
2020-05-09 13:31:21 +08:00
local _PlayerHead = nil
--初始化组件(用于子类重写)
function PlayerInfoPopup:InitComponent()
2021-04-21 13:12:04 +08:00
this.spLoader = SpriteLoader.New()
2021-11-17 16:14:47 +08:00
this.extraInfo = require("Modules/Popup/PlayerInfoPopup_extra")
2020-05-09 13:31:21 +08:00
this.btnBack = Util.GetGameObject(self.transform, "btnClose")
2021-11-17 16:14:47 +08:00
this.BgMask = Util.GetGameObject(self.transform, "BgMask")
2020-05-09 13:31:21 +08:00
this.memHead = Util.GetGameObject(self.transform, "tipImage/panel/info/head")
this.memName = Util.GetGameObject(self.transform, "tipImage/panel/info/name"):GetComponent("Text")
this.memProfess = Util.GetGameObject(self.transform, "tipImage/panel/info/profess"):GetComponent("Text")
2024-02-05 19:00:08 +08:00
this.rankName = Util.GetGameObject(self.transform, "tipImage/panel/info/rankName"):GetComponent("Text")
2020-05-09 13:31:21 +08:00
this.addFriendBtn = Util.GetGameObject(self.transform, "tipImage/panel/info/btnAdd")
this.addFriendBtnText = Util.GetGameObject(this.addFriendBtn, "text"):GetComponent("Text")
this.starBox = Util.GetGameObject(self.transform, "tipImage/panel/info/starBox")
this.star = Util.GetGameObject(self.transform, "tipImage/panel/info/starBox/star")
this.titlePar = Util.GetGameObject(self.transform, "tipImage/panel/info/titlePar")
2020-05-09 13:31:21 +08:00
this.memPower = Util.GetGameObject(self.transform, "tipImage/panel/defendbox/power"):GetComponent("Text")
2023-11-03 18:43:17 +08:00
this.formationTip = Util.GetGameObject(self.transform, "tipImage/panel/defendbox/Image/tip"):GetComponent("Text")
2020-05-09 13:31:21 +08:00
2024-11-12 16:22:23 +08:00
this.demonsHeroList = Util.GetGameObject(self.gameObject, "tipImage/panel/defendbox/demons")
this.diffDemonsHeroList = Util.GetGameObject(self.gameObject, "tipImage/panel/defendbox/diffdemons")
2020-05-09 13:31:21 +08:00
this.Demons = {}
for i = 1, 6 do
2021-11-05 10:18:10 +08:00
this.Demons[i] = {}
this.Demons[i].go = Util.GetGameObject(self.gameObject, "tipImage/panel/defendbox/Demons/heroPro (" .. i .. ")")
2024-11-12 16:22:23 +08:00
this.Demons[i].frameBtn = Util.GetGameObject(this.Demons[i].go, "frame")
this.Demons[i].frame = this.Demons[i].frameBtn:GetComponent("Image")
2021-11-05 10:18:10 +08:00
this.Demons[i].hero = Util.GetGameObject(this.Demons[i].go, "hero")
this.Demons[i].starGrid = Util.GetGameObject(this.Demons[i].hero, "starGrid")
this.Demons[i].proIcon = Util.GetGameObject(this.Demons[i].hero, "proIcon"):GetComponent("Image")
this.Demons[i].levelText = Util.GetGameObject(this.Demons[i].hero, "lvbg/levelText"):GetComponent("Text")
2024-11-12 16:22:23 +08:00
this.Demons[i].icon = Util.GetGameObject(this.Demons[i].hero, "icon"):GetComponent("Image")
2020-05-09 13:31:21 +08:00
end
2024-11-12 16:22:23 +08:00
Util.GetGameObject(self.transform, "tipImage/panel/pokemonInfo/Image/tip"):GetComponent("Text").text = Language
[11501]
this.Pokemons = {}
for i = 1, 6 do
2024-11-12 16:22:23 +08:00
table.insert(this.Pokemons,
Util.GetGameObject(self.gameObject, "tipImage/panel/pokemonInfo/Demons/heroPro (" .. i .. ")"))
end
2024-11-12 16:22:23 +08:00
this.Weapons = {}
2023-03-29 10:48:35 +08:00
for i = 1, 6 do
2024-11-12 16:22:23 +08:00
table.insert(this.Weapons,
Util.GetGameObject(self.gameObject, "tipImage/panel/weaponInfo/Demons/heroPro (" .. i .. ")"))
2023-03-29 10:48:35 +08:00
end
2024-11-12 16:22:23 +08:00
this.newGems = {}
for i = 1, 16 do
table.insert(this.newGems,
Util.GetGameObject(self.gameObject, "tipImage/panel/InfoGrids/Bg/GemInfo/Grid/heroPro (" .. i .. ")"))
2023-08-31 19:12:02 +08:00
end
2024-11-12 16:22:23 +08:00
this.pokemonObj = Util.GetGameObject(self.transform, "tipImage/panel/pokemonInfo").gameObject
this.weaponInfo = Util.GetGameObject(self.transform, "tipImage/panel/weaponInfo")
this.newGemInfo = Util.GetGameObject(self.transform, "tipImage/panel/newGemInfo")
this.newGemInfo:SetActive(false)
2023-11-03 18:43:17 +08:00
--this.boxLine = Util.GetGameObject(self.transform, "tipImage/panel/defendbox/line")
2024-01-30 18:34:38 +08:00
this.btnBox = Util.GetGameObject(self.transform, "tipImage/box")
-- this.bgImg= Util.GetGameObject(self.transform, "tipImage/tipImage"):GetComponent("RectTransform")
2020-05-09 13:31:21 +08:00
this.btnList = {}
this.btnList[1] = Util.GetGameObject(this.btnBox, "btn1")
this.btnList[2] = Util.GetGameObject(this.btnBox, "btn2")
this.btnList[3] = Util.GetGameObject(this.btnBox, "btn3")
--神印信息
2022-01-13 15:23:59 +08:00
-- this.imprintObj = Util.GetGameObject(self.transform, "tipImage/panel/imprintInfo")
-- this.imprintGrid = Util.GetGameObject(this.imprintObj, "Imprints")
-- this.imprintPre = Util.GetGameObject(self.transform, "imprintPre")
--所有信息Obj的PreList
this.InfoBtns = Util.GetGameObject(self.transform, "tipImage/panel/InfoBtns")
this.InfoBtnsGrid = Util.GetGameObject(this.InfoBtns, "Grid")
2022-01-15 13:26:22 +08:00
this.InfoContentGrid = Util.GetGameObject(self.transform, "tipImage/panel/InfoGrids")
this.InfoContent = Util.GetGameObject(this.InfoContentGrid, "Bg")
2024-11-12 16:22:23 +08:00
this.infoBtnPre = Util.GetGameObject(self.transform, "btnPre") --按钮的Pre
this.imprintPre = Util.GetGameObject(self.transform, "imprintPre") --神印的Pre
this.emptyPre = Util.GetGameObject(self.transform, "emptyPre") --空的Pre
2022-01-13 15:23:59 +08:00
this.InfoBtnsList = {}
this.ItemPreList = {}
this.ItemList = {}
2020-05-09 13:31:21 +08:00
end
--绑定事件(用于子类重写)
function PlayerInfoPopup:BindEvent()
Util.AddClick(this.btnBack, function()
PlaySoundWithoutClick(SoundConfig.Sound_UICancel)
this:ClosePanel()
end)
2021-11-17 16:14:47 +08:00
Util.AddClick(this.BgMask, function()
PlaySoundWithoutClick(SoundConfig.Sound_UICancel)
this:ClosePanel()
end)
2020-05-09 13:31:21 +08:00
Util.AddClick(this.addFriendBtn, function()
if this.serverName and this.serverName ~= "" then
PopupTipPanel.ShowTip("无法跨服添加好友")
2024-11-12 16:22:23 +08:00
return
end
2020-05-09 13:31:21 +08:00
if not ActTimeCtrlManager.SingleFuncState(FUNCTION_OPEN_TYPE.GOODFRIEND) then
PopupTipPanel.ShowTip(ActTimeCtrlManager.GetFuncTip(FUNCTION_OPEN_TYPE.GOODFRIEND))
return
end
if GoodFriendManager.IsInBlackList(this._PlayerId) then
2021-04-09 12:26:35 +08:00
PopupTipPanel.ShowTip(Language[10814])
2020-05-09 13:31:21 +08:00
return
end
if this._PlayerId == PlayerManager.uid then
2021-04-09 12:26:35 +08:00
PopupTipPanel.ShowTip(Language[10931])
2020-05-09 13:31:21 +08:00
return
end
if GoodFriendManager.IsMyFriend(this._PlayerId) then
2021-04-09 12:26:35 +08:00
PopupTipPanel.ShowTip(Language[10932])
2020-05-09 13:31:21 +08:00
return
end
if this._PlayerData.isApplyed == 1 then
2021-04-09 12:26:35 +08:00
PopupTipPanel.ShowTip(Language[10819])
2020-05-09 13:31:21 +08:00
return
end
GoodFriendManager.InviteFriendRequest(this._PlayerId, function()
2021-04-09 12:26:35 +08:00
PopupTipPanel.ShowTip(Language[11502])
2020-05-09 13:31:21 +08:00
this._PlayerData.isApplyed = 1
this.RefreshFunction()
end)
end)
end
--添加事件监听(用于子类重写)
function PlayerInfoPopup:AddListener()
end
--移除事件监听(用于子类重写)
function PlayerInfoPopup:RemoveListener()
end
--界面打开时调用(用于子类重写)
2024-11-12 16:22:23 +08:00
function PlayerInfoPopup:OnOpen(playerId, viewType, serverName, _otherdata)
2020-05-09 13:31:21 +08:00
this._PlayerId = playerId
this._ViewType = viewType or PLAYER_INFO_VIEW_TYPE.NORMAL
2024-11-12 16:22:23 +08:00
this.serverName = serverName --跨服加的服务器数据
2021-11-16 17:34:37 +08:00
this.data = _otherdata
isNpc = this._PlayerId <= 1000000
2020-05-09 13:31:21 +08:00
-- 界面类型修正
if this._ViewType == PLAYER_INFO_VIEW_TYPE.NORMAL and GoodFriendManager.IsInBlackList(this._PlayerId) then
this._ViewType = PLAYER_INFO_VIEW_TYPE.GO_TO_BLACK
end
this._Config = _ViewConfig[this._ViewType]
-- 注册按钮事件
this.btnFunc = {
[1] = this.Report,
[2] = this.AddToBlackList,
[3] = this.BeatHim,
[4] = this.RemoveFromBlackList,
[5] = this.GoToBlack,
2021-06-15 20:08:14 +08:00
[6] = this.JumpServerBattle,
2021-07-30 17:52:49 +08:00
[7] = this.JumpServerBattle_NORMAL,
2021-11-16 17:34:37 +08:00
[8] = this.LingMaiFormaion,
2021-11-19 17:23:06 +08:00
[9] = this.LingMaiQieCuo,
2020-05-09 13:31:21 +08:00
}
end
-- 设置界面类型
function PlayerInfoPopup:SetViewType(viewType)
this._ViewType = viewType or PLAYER_INFO_VIEW_TYPE.NORMAL
this._Config = _ViewConfig[this._ViewType]
this:OnShow()
end
--界面打开或者重新打开后,界面刷新时调用(用于子类重写)
function PlayerInfoPopup:OnShow()
2021-11-16 17:34:37 +08:00
-- this.RefreshBtnShow()
2020-05-09 13:31:21 +08:00
-- 请求数据
2024-11-12 16:22:23 +08:00
if this._ViewType == PLAYER_INFO_VIEW_TYPE.JUPMSERVER then
this._Config.formationType = JumpServerManager.showRankType
2024-06-18 15:54:02 +08:00
end
2024-11-12 16:22:23 +08:00
LogGreen("角色Id:" .. tostring(this._PlayerId) .. " 编队Id" .. tostring(this._Config.formationType))
if this._PlayerId > 0 then --如果PlayerId > 0 说明是真人或者机器人为0暂时为灵脉使用直接是怪物组数据需要自己拼接
2021-11-16 17:34:37 +08:00
netserverName = nil
2024-11-12 16:22:23 +08:00
if this.serverName and this.serverName ~= "" then --and this.serverName ~= PlayerManager.serverInfo.name
2021-11-16 17:34:37 +08:00
netserverName = 1
end
this.curPlayerData = {}
2024-11-12 16:22:23 +08:00
NetManager.RequestPlayerInfo(this._PlayerId, this._Config.formationType, netserverName, 0, function(msg)
2021-11-16 17:34:37 +08:00
-- 如果是好友更新好友数据
this.curPlayerData = msg.teamInfo
2021-11-16 17:34:37 +08:00
curPlayerName = msg.teamInfo.name
2024-11-12 16:22:23 +08:00
GoodFriendManager.UpdateFriendData(this._PlayerId, msg.teamInfo.level, JingJiShouWeiToEn(msg.teamInfo.name),
msg.teamInfo.head, msg.teamInfo.headFrame)
2021-11-16 17:34:37 +08:00
this._PlayerData = msg.teamInfo
this.RefreshPlayerInfo(msg.teamInfo)
local teamInfo = msg.teamInfo.team
this.FormationAdapter(teamInfo)
--
this.RefreshFunction()
this.RefreshBtnShow()
end)
2021-11-17 11:12:49 +08:00
else
2021-11-17 16:14:47 +08:00
--目前只给灵脉,如果还有其他请写明备注
2022-01-15 18:17:46 +08:00
this.InfoBtns:SetActive(false)
this.InfoContentGrid:SetActive(false)
this.pokemonObj:SetActive(false)
2024-01-30 18:34:38 +08:00
this.weaponInfo:SetActive(false)
2024-11-12 16:22:23 +08:00
this.extraInfo.Init(this, this.data, _ViewConfig[this._ViewType])
2021-06-15 20:08:14 +08:00
end
2020-05-09 13:31:21 +08:00
end
-- 刷新基础信息显示
local titleLiveStr
local titleLive
2020-05-09 13:31:21 +08:00
function this.RefreshPlayerInfo(data)
2021-06-15 20:08:14 +08:00
local curname = ""
2022-03-04 18:26:36 +08:00
if data.serverName and data.serverName ~= "" then
2024-11-12 16:22:23 +08:00
curname = data.serverName .. " " .. data.name
2022-03-04 18:26:36 +08:00
elseif this.serverName and this.serverName ~= "" then
2024-11-12 16:22:23 +08:00
curname = this.serverName .. " " .. data.name
2021-06-15 20:08:14 +08:00
else
curname = data.name
end
2024-11-12 16:22:23 +08:00
this.memName.text = PracticeManager.SetNameColor(curname, data.practiceLevel) --data.name
if (data.guildName ~= "") then
this.memProfess.text = Language[10633] .. data.guildName --GUILD_GRANT_STR[data.position]
2020-05-09 13:31:21 +08:00
else
2024-11-12 16:22:23 +08:00
this.memProfess.text = Language[10633] .. Language[10086]
2020-05-09 13:31:21 +08:00
end
2024-11-12 16:22:23 +08:00
if data.arenaLvId > 0 then
2024-02-05 19:00:08 +08:00
this.rankName.gameObject:SetActive(true)
2024-11-12 16:22:23 +08:00
this.rankName.text = ConfigManager.GetConfigData(ConfigName.ArenaLevel, data.arenaLvId).ArenaLevelName
2024-02-05 19:00:08 +08:00
else
this.rankName.gameObject:SetActive(true)
2024-11-12 16:22:23 +08:00
this.rankName.text = ArenaManager.GetArenaMyRankName()
2024-02-05 19:00:08 +08:00
end
2024-11-12 16:22:23 +08:00
2020-05-09 13:31:21 +08:00
-- 头像
if not _PlayerHead then
_PlayerHead = SubUIManager.Open(SubUIConfig.PlayerHeadView, this.memHead.transform)
end
_PlayerHead:Reset()
_PlayerHead:SetScale(Vector3.one * 0.85)
_PlayerHead:SetHead(data.head)
_PlayerHead:SetFrame(data.headFrame)
_PlayerHead:SetLevel(data.level)
2020-09-25 21:19:01 +08:00
_PlayerHead:SetLayer(this.sortingOrder)
_PlayerHead:SetEffectScale(0.9)
2024-11-12 16:22:23 +08:00
local title = data.userTitle
if title and title > 0 then
this.titlePar:SetActive(true)
if titleLive then
SubUIManager.Close(titleLive)
titleLive = nil
end
if not titleLive then
titleLive = SubUIManager.Open(SubUIConfig.PlayerTitle, this.titlePar.transform)
2024-11-12 16:22:23 +08:00
titleLive:SetShow(title, Vector3.New(0, 0, 0), 0.5, 0.03 * 20, this.sortingOrder)
end
else
this.titlePar:SetActive(false)
end
2020-09-25 21:19:01 +08:00
end
function this:OnSortingOrderChange()
if _PlayerHead then
_PlayerHead:SetLayer(self.sortingOrder)
end
2021-11-04 10:46:25 +08:00
for i, demon in ipairs(this.Demons) do
2024-11-12 16:22:23 +08:00
Util.SetParticleSortLayer(demon.starGrid, self.sortingOrder + 1)
2021-11-04 10:46:25 +08:00
end
2020-05-09 13:31:21 +08:00
end
-- 刷新功能区
function this.RefreshFunction()
this.addFriendBtn:SetActive(false)
this.starBox:SetActive(false)
if this._ViewType == PLAYER_INFO_VIEW_TYPE.NORMAL or this._ViewType == PLAYER_INFO_VIEW_TYPE.MIND_DEMON then
2020-05-09 13:31:21 +08:00
this.addFriendBtn:SetActive(true)
local isSelf = this._PlayerId == PlayerManager.uid
local isMyFriend = isSelf and true or GoodFriendManager.IsMyFriend(this._PlayerId)
local isApplyed = this._PlayerData.isApplyed == 1
Util.SetGray(this.addFriendBtn, isMyFriend or isApplyed)
2021-04-09 12:26:35 +08:00
this.addFriendBtnText.text = isApplyed and Language[10816] or Language[10937]
2020-05-09 13:31:21 +08:00
end
end
-- 编队数据匹配
function this.FormationAdapter(teamInfo)
2022-01-13 15:23:59 +08:00
--====================编队信息======================
2020-05-09 13:31:21 +08:00
this.formationTip.text = _ViewConfig[this._ViewType].tip
-- 战斗力
this.memPower.text = teamInfo.totalForce
for i, demon in ipairs(this.Demons) do
2021-11-04 10:46:25 +08:00
demon.frame.sprite = this.spLoader:LoadSprite(GetQuantityImageByquality(1))
demon.hero:SetActive(false)
2024-11-12 16:22:23 +08:00
demon.frame.transform:GetComponent("Button").enabled = false
end
--队伍阵容
for i, hero in ipairs(teamInfo.team) do
local demonId = teamInfo.team[i].heroTid
if demonId then
2021-11-04 10:46:25 +08:00
this.Demons[hero.position].hero:SetActive(true)
2024-11-12 16:22:23 +08:00
local star, starType = GetStarOrGodSoulLv(1, hero)
local starSize = Vector2.New(35, 35)
2021-11-04 09:27:56 +08:00
local starScale = -8
2024-11-12 16:22:23 +08:00
if starType == 3 then
starSize = Vector2.New(1, -15.65)
2021-11-04 09:27:56 +08:00
starScale = -13
2021-11-03 10:13:44 +08:00
elseif starType == 2 then
2024-11-12 16:22:23 +08:00
starSize = Vector2.New(60, 57)
2021-10-27 12:50:15 +08:00
end
2024-11-12 16:22:23 +08:00
SetHeroStars(this.spLoader, this.Demons[hero.position].starGrid, star, starType, starSize, starScale)
Util.SetParticleSortLayer(this.Demons[hero.position].starGrid, this.sortingOrder + 1)
local heroConfig = ConfigManager.GetConfigData(ConfigName.HeroConfig, demonId)
this.Demons[hero.position].proIcon.sprite = this.spLoader:LoadSprite(GetProStrImageByProNum(hero.propertyId))
2021-11-04 10:46:25 +08:00
this.Demons[hero.position].levelText.text = hero.level
2024-11-12 16:22:23 +08:00
this.Demons[hero.position].frame.sprite = this.spLoader:LoadSprite(GetQuantityImageByquality(
heroConfig.Quality, hero.star))
SetHeroIcon(this.spLoader, hero, this.Demons[hero.position].icon, heroConfig)
SetHeroFlyEffect(this.Demons[hero.position].hero, this.spLoader, hero.star, this.sortingOrder + 1, 0.9, 2)
local heroData = {}
2024-11-12 16:22:23 +08:00
local frameBtn = this.Demons[hero.position].frameBtn
frameBtn.transform:GetComponent("Button").enabled = true
2021-05-29 18:37:45 +08:00
if this._Config.formationType == FormationTypeDef.FORMATION_TSLX then
2024-01-15 16:59:11 +08:00
Util.AddOnceClick(frameBtn, function()
2024-11-12 16:22:23 +08:00
UIManager.OpenPanel(UIName.RoleGetInfoPopup, false, demonId, hero.star)
2021-05-29 18:37:45 +08:00
end)
else
2024-01-15 16:59:11 +08:00
Util.AddOnceClick(frameBtn, function()
if not hero.heroid or not heroConfig then
return
end
2024-11-12 16:22:23 +08:00
NetManager.ViewHeroInfoRequest(this._PlayerId, hero.heroid, netserverName, this._Config
.formationType, function(msg)
heroData = GoodFriendManager.GetHeroDatas(msg.hero, msg.force, msg.SpecialEffects, msg
.guildSkill)
GoodFriendManager.InitEquipData(msg.equip, heroData) --HeroManager.GetSingleHeroData(heroData.dynamicId)
LogError("msg.playerGiftLv===================" .. msg.playerGiftLv)
for k, v in pairs(heroData.potential) do
v.giftLv = msg.playerGiftLv
end
UIManager.OpenPanel(UIName.RoleInfoPopup, heroData, true)
end)
2020-05-09 13:31:21 +08:00
end)
2021-05-29 18:37:45 +08:00
end
end
2020-05-09 13:31:21 +08:00
end
2024-11-12 16:22:23 +08:00
local len = #teamInfo.PokemonInfos
-- LogError("长度:"..len)
2024-11-12 16:22:23 +08:00
if len > 0 then
this.pokemonObj:SetActive(true)
for i, demon in ipairs(this.Pokemons) do
demon.gameObject:SetActive(false)
2024-11-12 16:22:23 +08:00
Util.GetGameObject(demon, "frame"):GetComponent("Image").sprite = this.spLoader:LoadSprite(
GetQuantityImageByquality(1))
Util.GetGameObject(demon, "hero"):SetActive(false)
2024-01-30 18:34:38 +08:00
Util.GetGameObject(demon, "pos"):SetActive(true)
end
else
this.pokemonObj:SetActive(false)
end
2022-01-13 15:23:59 +08:00
--====================队伍灵兽信息======================
for i, hero in ipairs(teamInfo.PokemonInfos) do
local demonId = teamInfo.PokemonInfos[i].heroTid
this.Pokemons[i].gameObject:SetActive(true)
if demonId then
local heroGo = Util.GetGameObject(this.Pokemons[i], "hero")
heroGo:SetActive(true)
2024-11-12 16:22:23 +08:00
local starSize = Vector2.New(35, 35)
local star = hero.star
local type = 1
2023-09-15 13:56:38 +08:00
local starScale = -10
2024-11-12 16:22:23 +08:00
if star > 5 then
star = star + 5
starSize = Vector2.New(0.8, -25)
starScale = -20
type = 3
2023-09-15 13:56:38 +08:00
else
2024-11-12 16:22:23 +08:00
starScale = -15
2023-09-15 13:56:38 +08:00
end
2024-01-30 18:34:38 +08:00
Util.GetGameObject(this.Pokemons[i], "pos"):SetActive(false)
2024-11-12 16:22:23 +08:00
local grid = Util.GetGameObject(heroGo, "starGrid")
SetHeroStars(this.spLoader, grid, star, type, starSize, starScale)
2023-09-15 13:56:38 +08:00
--SetHeroStars(this.spLoader,grid ,star,type,starSize, starScale,Vector2.New(0.5,1))
2024-11-12 16:22:23 +08:00
Util.AddParticleSortLayer(Util.GetGameObject(heroGo, "starGrid"), this.sortingOrder + 1)
local heroConfig = ConfigManager.GetConfigData(ConfigName.SpiritAnimal, demonId)
Util.GetGameObject(heroGo, "lvbg/levelText"):GetComponent("Text").text = hero.level
2024-11-12 16:22:23 +08:00
Util.GetGameObject(this.Pokemons[i], "frame"):GetComponent("Image").sprite = this.spLoader:LoadSprite(
GetQuantityImageByquality(heroConfig.Quality))
Util.GetGameObject(heroGo, "icon"):GetComponent("Image").sprite = this.spLoader:LoadSprite(GetResourcePath(
heroConfig.Icon))
local frameBtn = Util.GetGameObject(this.Pokemons[i], "frame")
local heroData = {}
Util.AddOnceClick(frameBtn, function()
2024-11-12 16:22:23 +08:00
local pokemonData = { tempId = demonId, id = demonId, star = hero.star, level = hero.level }
UIManager.OpenPanel(UIName.PokemonGetInfoPopup, true, pokemonData)
end)
end
end
2023-03-29 10:48:35 +08:00
--====================队伍神兵信息======================
2024-11-12 16:22:23 +08:00
local len2 = #teamInfo.MagicSoldier
LogError("长度:" .. len)
if len2 > 0 and type(teamInfo.MagicSoldier[1].heroTid) ~= "userdata" then
LogError("teamInfo.MagicSoldier[1].heroTid==" .. teamInfo.MagicSoldier[1].heroTid)
2023-03-29 10:48:35 +08:00
this.weaponInfo:SetActive(true)
for i, demon in ipairs(this.Weapons) do
--demon.gameObject:SetActive(false)
2024-11-12 16:22:23 +08:00
Util.GetGameObject(demon, "frame"):GetComponent("Image").sprite = this.spLoader:LoadSprite(
GetQuantityImageByquality(1))
2023-03-29 10:48:35 +08:00
Util.GetGameObject(demon, "hero"):SetActive(false)
2024-01-30 18:34:38 +08:00
Util.GetGameObject(demon, "pos"):SetActive(true)
2023-03-29 10:48:35 +08:00
end
else
this.weaponInfo:SetActive(false)
end
for i, hero in ipairs(teamInfo.MagicSoldier) do
local demonId = teamInfo.MagicSoldier[i].heroTid
--this.Weapons[].gameObject:SetActive(true)
if demonId then
2024-11-12 16:22:23 +08:00
LogError("hero.position==" .. teamInfo.MagicSoldier[i].position)
2023-03-29 10:48:35 +08:00
local heroGo = Util.GetGameObject(this.Weapons[hero.position], "hero")
heroGo:SetActive(true)
2024-11-12 16:22:23 +08:00
SetHeroStars(this.spLoader, Util.GetGameObject(heroGo, "starGrid"), hero.star, 1)
2023-03-29 10:48:35 +08:00
local heroConfig = ConfigManager.GetConfigData(ConfigName.ShenBing, demonId)
2024-01-30 18:34:38 +08:00
Util.GetGameObject(this.Weapons[hero.position], "pos"):SetActive(false)
2023-03-29 10:48:35 +08:00
Util.GetGameObject(heroGo, "lvbg/levelText"):GetComponent("Text").text = hero.level
2024-11-12 16:22:23 +08:00
Util.GetGameObject(this.Weapons[hero.position], "frame"):GetComponent("Image").sprite = this.spLoader
:LoadSprite(GetQuantityImageByquality(heroConfig.Quality))
Util.GetGameObject(heroGo, "icon"):GetComponent("Image").sprite = this.spLoader:LoadSprite(GetResourcePath(
heroConfig.Icon))
2023-03-30 13:11:09 +08:00
local frameBtn = Util.GetGameObject(this.Weapons[hero.position], "frame")
2023-03-29 10:48:35 +08:00
local heroData = {}
Util.AddOnceClick(frameBtn, function()
2024-11-12 16:22:23 +08:00
local pokemonData = { tempId = demonId, id = demonId, star = hero.star, level = hero.level }
UIManager.OpenPanel(UIName.GodWeaponGetInfoPopup, true, pokemonData)
2023-03-29 10:48:35 +08:00
end)
end
end
2024-11-12 16:22:23 +08:00
2022-01-13 15:23:59 +08:00
--====================其他信息按钮显示======================
2022-01-13 18:29:12 +08:00
this.infoIndex = 0
2022-01-13 15:23:59 +08:00
for index, value in ipairs(InfoBtns) do
2024-11-12 16:22:23 +08:00
LogError("teamInfo.giftEquipIds len=============" .. #teamInfo.giftEquipIds)
2022-01-13 18:29:12 +08:00
--添加按钮
2022-01-13 15:23:59 +08:00
local item = this.InfoBtnsList[index]
if not item then
2024-11-12 16:22:23 +08:00
item = newObjToParent(this.infoBtnPre, this.InfoBtnsGrid.transform)
2022-01-13 15:23:59 +08:00
this.InfoBtnsList[index] = item
item.gameObject:SetActive(true)
end
2024-11-12 16:22:23 +08:00
local name = Util.GetGameObject(item, "btnName"):GetComponent("Text")
2022-01-13 18:29:12 +08:00
name.text = value.name
--判断按钮是否显示
2024-11-12 16:22:23 +08:00
if (index == 1 and teamInfo.sealShow and #teamInfo.sealShow > 0) or --神印
(index == 2 and teamInfo.transformationCardInfo and #teamInfo.transformationCardInfo > 0) or --身外化身
(index == 3 and teamInfo.sixiangxinfaInfo and #teamInfo.sixiangxinfaInfo > 0) or --四象心法
(index == 5 and teamInfo.userMountInfo and #teamInfo.userMountInfo > 0) then --坐骑
item.gameObject:SetActive(true)
2022-01-13 18:29:12 +08:00
if this.infoIndex == 0 then
this.infoIndex = index
end
2024-11-12 16:22:23 +08:00
elseif (index == 4 and teamInfo.gemNews and #teamInfo.gemNews > 0) then --命石
2023-09-13 14:57:48 +08:00
-- local num = 0
-- for i = 1, #teamInfo.gemNews do
-- local data = teamInfo.gemNews[i]
-- if data.itemId and data.itemId > 0 then
-- num = num + 1
-- end
-- end
2024-11-12 16:22:23 +08:00
item.gameObject:SetActive(#teamInfo.gemNews > 0)
2022-01-15 15:05:26 +08:00
if this.infoIndex == 0 then
this.infoIndex = index
end
2023-09-13 15:44:06 +08:00
elseif (index == 6 and teamInfo.giftEquipIds and #teamInfo.giftEquipIds > 0) then
2024-11-12 16:22:23 +08:00
item.gameObject:SetActive(#teamInfo.giftEquipIds > 0)
2023-09-13 15:44:06 +08:00
if this.infoIndex == 0 then
this.infoIndex = index
end
2022-01-13 18:29:12 +08:00
else
item.gameObject:SetActive(false)
end
2022-01-13 18:29:12 +08:00
--添加点击事件
2024-11-12 16:22:23 +08:00
Util.AddOnceClick(item, function()
2022-01-13 18:29:12 +08:00
this.infoIndex = index
this.ShowInfos(teamInfo)
end)
end
--初始化一次
2022-01-15 13:26:22 +08:00
if this.infoIndex == 0 then
this.InfoBtns:SetActive(false)
this.InfoContentGrid:SetActive(false)
else
2022-01-15 13:26:22 +08:00
this.InfoBtns:SetActive(true)
this.InfoContentGrid:SetActive(true)
this.ShowInfos(teamInfo)
end
2022-01-13 18:29:12 +08:00
end
2022-01-13 18:29:12 +08:00
--选择展示下方框框中显示的内容
function this.ShowInfos(teamInfo)
for index, value in ipairs(this.InfoBtnsList) do
local img = value:GetComponent("Image")
2024-11-12 16:22:23 +08:00
local text = Util.GetGameObject(value, "btnName"):GetComponent("Text")
2022-01-13 18:29:12 +08:00
if this.infoIndex == index then
2024-01-30 14:35:33 +08:00
img.sprite = this.spLoader:LoadSprite("Btn_hz_tongyong_001")
--text.color = Color.New(253 / 255, 244 / 255, 214 / 255, 1)
2022-01-13 18:29:12 +08:00
else
2024-01-30 14:35:33 +08:00
img.sprite = this.spLoader:LoadSprite("UI_hz_gonghui_28")
--text.color = Color.New(181 / 255, 164 / 255, 129 / 255, 1)
2022-01-13 18:29:12 +08:00
end
2024-11-12 16:22:23 +08:00
Util.GetGameObject(this.InfoContent, InfoBtns[index].gridName):SetActive(false)
2022-01-13 18:29:12 +08:00
end
2024-11-12 16:22:23 +08:00
local MainContent = Util.GetGameObject(this.InfoContent, InfoBtns[this.infoIndex].gridName)
local Grid = Util.GetGameObject(MainContent, "Grid")
2022-01-13 18:29:12 +08:00
MainContent:SetActive(true)
if not this.ItemPreList[this.infoIndex] then
this.ItemPreList[this.infoIndex] = {}
end
for i = 1, #this.ItemPreList[this.infoIndex] do
this.ItemPreList[this.infoIndex][i].gameObject:SetActive(false)
end
2024-11-12 16:22:23 +08:00
InfoBtns[this.infoIndex].func(teamInfo, Grid)
end
--===========================滑动条中的信息展示====================
--神印的
2024-11-12 16:22:23 +08:00
function this.imprintInfoShow(teamInfo, Grid)
2022-01-13 18:29:12 +08:00
for i = 1, #teamInfo.sealShow do
local item = this.ItemPreList[this.infoIndex][i]
local value = teamInfo.sealShow[i]
if not item then
2024-11-12 16:22:23 +08:00
item = newObjToParent(this.imprintPre, Grid.transform)
2022-01-13 18:29:12 +08:00
item:SetActive(true)
this.ItemPreList[this.infoIndex][i] = item
end
item.gameObject:SetActive(true)
2024-11-12 16:22:23 +08:00
local icon = Util.GetGameObject(item, "icon"):GetComponent("Image")
2022-01-13 18:29:12 +08:00
icon.sprite = this.spLoader:LoadSprite(GetResourcePath(XiuXianSkillConfig[value.id].Icon))
2024-11-12 16:22:23 +08:00
Util.AddOnceClick(item.gameObject, function()
UIManager.OpenPanel(UIName.GeneralInfoPopup, GENERALINFO_TYPE.Imprint, value.id, value.heroTId)
2022-01-13 18:29:12 +08:00
end)
end
2020-05-09 13:31:21 +08:00
end
--身外化身
2024-11-12 16:22:23 +08:00
function this.huashenInfoShow(teamInfo, Grid)
-- for i = 1, #teamInfo.transformationCardInfo do
-- local data = teamInfo.transformationCardInfo[i]
-- LogGreen("身外化身卡 id"..tostring(data.id).." 位置:"..tostring(data.index).." 状态:"..tostring(data.status))
-- end
for i = 1, #teamInfo.transformationCardInfo do
local item = this.ItemPreList[this.infoIndex][i]
local value = teamInfo.transformationCardInfo[i]
if not item then
2024-11-12 16:22:23 +08:00
item = newObjToParent(this.emptyPre, Grid.transform)
item:SetActive(true)
this.ItemPreList[this.infoIndex][i] = item
local itemview = SubUIManager.Open(SubUIConfig.ItemView, item.transform)
this.ItemList[i] = itemview
this.ItemList[i].transform:SetSiblingIndex(1)
end
2024-11-12 16:22:23 +08:00
this.ItemList[i]:OnOpen(false, { ChangingCard[value.id].CardId, 0, 0, value.level, value.star }, 1, false, false,
false, this.sortingOrder)
Util.GetGameObject(item, "Name"):GetComponent("Text").text = ItemConfig[ChangingCard[value.id].CardId].Name
Util.GetGameObject(item, "lvbg/levelText"):GetComponent("Text").text = value.level
Util.GetGameObject(item, "lvbg"):SetActive(true)
local starGrid = Util.GetGameObject(item, "starGrid")
2022-07-20 14:26:09 +08:00
starGrid.gameObject:SetActive(true)
for i = 0, 5 do
2024-11-12 16:22:23 +08:00
if i < value.star then
starGrid.transform:GetChild(i).gameObject:SetActive(true)
else
starGrid.transform:GetChild(i).gameObject:SetActive(false)
end
2024-11-12 16:22:23 +08:00
end
this.ItemList[i].gameObject:SetActive(true)
item:SetActive(true)
end
end
--四象心法
2024-11-12 16:22:23 +08:00
function this.fourElementInfoShow(teamInfo, Grid)
local textList = {}
2024-11-12 16:22:23 +08:00
local TRANS = { [1] = 2, [2] = 1, [3] = 3, [4] = 4, }
for i = 1, 4 do
2024-11-12 16:22:23 +08:00
textList[i] = Util.GetGameObject(Grid, "fourPre (" .. i .. ")/lv/Text")
textList[i]:GetComponent("Text").text = "0"
end
for i = 1, #teamInfo.sixiangxinfaInfo do
local data = teamInfo.sixiangxinfaInfo[i]
-- LogYellow("四象心法 职业id"..tostring(data.professionId).." 等级:"..tostring(data.level))
2022-01-15 15:44:08 +08:00
textList[TRANS[data.professionId]]:GetComponent("Text").text = data.level
end
end
--命格
2024-11-12 16:22:23 +08:00
function this.GemInfoShow(teamInfo, Grid)
2023-09-13 14:57:48 +08:00
-- local iconList = {}
-- local levelList = {}
-- for i = 1, 8 do
-- iconList[i] = {}
-- levelList[i] = {}
-- for j = 1, 3 do
-- iconList[i][j] = Util.GetGameObject(Grid,"item ("..i..")/stone ("..j..")/icon")
-- levelList[i][j] = Util.GetGameObject(Grid,"item ("..i..")/stone ("..j..")/Text")
-- iconList[i][j]:SetActive(false)
-- levelList[i][j]:GetComponent("Text").text = ""
-- end
-- end
-- for i = 1, #teamInfo.lifeGridInfo do
-- local data = teamInfo.lifeGridInfo[i]
-- -- LogBlue("命格 id"..tostring(data.gridId).." 位置:"..tostring(data.gridIndex).." 命石Id"..tostring(data.itemId))
-- if data.itemId and data.itemId > 0 then
-- iconList[data.gridId][data.gridIndex]:GetComponent("Image").sprite = this.spLoader:LoadSprite(GetSpriteNameByItemId(data.itemId))
-- levelList[data.gridId][data.gridIndex]:GetComponent("Text").text = GemConfig[data.itemId].Level
-- iconList[data.gridId][data.gridIndex]:SetActive(true)
-- end
-- end
--队伍命石信息
2024-11-12 16:22:23 +08:00
local gems = teamInfo.gemNews
if gems and #gems > 0 then
this.newGemInfo:SetActive(false)
for i = 1, 16 do
if gems[i] then
this.newGems[i]:SetActive(true)
local data = GemNewManager.ChangeOneGemData(gems[i])
Util.GetGameObject(this.newGems[i], "frame"):GetComponent("Image").sprite = this.spLoader:LoadSprite(
data.frame)
Util.GetGameObject(this.newGems[i], "hero/icon"):GetComponent("Image").sprite = this.spLoader:LoadSprite(
data.icon)
local frameBtn = Util.GetGameObject(this.newGems[i], "frame")
local heroData = {}
Util.AddOnceClick(frameBtn, function()
UIManager.OpenPanel(UIName.RewardGemSingleShowPopup, data, 3)
end)
else
this.newGems[i]:SetActive(false)
end
end
2023-09-13 14:57:48 +08:00
else
2024-11-12 16:22:23 +08:00
this.newGemInfo:SetActive(false)
end
2020-05-09 13:31:21 +08:00
end
--坐骑
2024-11-12 16:22:23 +08:00
function this.RideInfoShow(teamInfo, Grid)
-- for i = 1, #teamInfo.userMountInfo do
-- local data = teamInfo.userMountInfo[i]
-- LogPink("坐骑 id"..tostring(data.mountId).." 过期时间:"..tostring(data.overTime))
-- end
for i = 1, #teamInfo.userMountInfo do
local item = this.ItemPreList[this.infoIndex][i]
local value = teamInfo.userMountInfo[i]
if not item then
item = SubUIManager.Open(SubUIConfig.ItemView, Grid.transform)
this.ItemPreList[this.infoIndex][i] = item
end
2024-11-12 16:22:23 +08:00
item:OnOpen(false, { value.mountId, 0 }, 1, true, false, false, this.sortingOrder)
item.gameObject:SetActive(true)
end
2022-01-15 15:05:26 +08:00
if #teamInfo.userMountInfo > 4 then
2022-01-15 15:44:08 +08:00
-- Grid:GetComponent("HorizontalLayoutGroup").padding.left = 30
2022-01-15 15:05:26 +08:00
Grid:GetComponent("RectTransform").pivot = Vector2.New(0, 0.5)
else
2022-01-15 15:44:08 +08:00
-- Grid:GetComponent("HorizontalLayoutGroup").padding.left = -30
2022-01-15 15:05:26 +08:00
Grid:GetComponent("RectTransform").pivot = Vector2.New(0.5, 0.5)
end
end
2023-09-13 15:44:06 +08:00
--礼物
2024-11-12 16:22:23 +08:00
function this.GiftInfoShow(teamInfo, Grid)
2023-09-13 15:44:06 +08:00
for i = 1, #teamInfo.giftEquipIds do
local item = this.ItemPreList[this.infoIndex][i]
local value = teamInfo.giftEquipIds[i]
if not item then
item = SubUIManager.Open(SubUIConfig.ItemView, Grid.transform)
this.ItemPreList[this.infoIndex][i] = item
end
2024-11-12 16:22:23 +08:00
item:OnOpen(false, { value, 0 }, 1, true, false, false, this.sortingOrder)
2023-09-13 15:44:06 +08:00
item.gameObject:SetActive(true)
end
if #teamInfo.giftEquipIds > 4 then
-- Grid:GetComponent("HorizontalLayoutGroup").padding.left = 30
Grid:GetComponent("RectTransform").pivot = Vector2.New(0, 0.5)
else
-- Grid:GetComponent("HorizontalLayoutGroup").padding.left = -30
Grid:GetComponent("RectTransform").pivot = Vector2.New(0.5, 0.5)
end
end
2024-11-12 16:22:23 +08:00
2022-01-13 15:23:59 +08:00
--============================底部按钮显示===========================
2020-05-09 13:31:21 +08:00
function this.RefreshBtnShow()
this.btnBox:SetActive(true)
2021-11-16 17:34:37 +08:00
-- 按钮功能
2024-11-12 16:22:23 +08:00
local btnType = this._Config.btnType or {}
2020-05-09 13:31:21 +08:00
for index, btn in ipairs(this.btnList) do
btn:SetActive(btnType[index] ~= nil)
if btnType[index] then
Util.GetGameObject(btn, "Text"):GetComponent("Text").text = btnType[index].name
Util.AddOnceClick(btn, function()
local funcType = btnType[index].func
if not this.btnFunc[funcType] then
Log("方法不存在")
2020-05-09 13:31:21 +08:00
return
end
this.btnFunc[funcType](btnType[index].param)
end)
end
end
2021-11-16 17:34:37 +08:00
-- 自己
if this._PlayerId == PlayerManager.uid or curPlayerName == Language[12230] then
2023-11-03 18:43:17 +08:00
--this.boxLine:SetActive(false)
2021-11-16 17:34:37 +08:00
this.btnBox:SetActive(false)
this.addFriendBtn:SetActive(false)
end
-- 判断该界面类型是否有按钮显示
2024-11-12 16:22:23 +08:00
if not this._Config or not this._Config.btnType or isNpc then
2023-11-03 18:43:17 +08:00
--this.boxLine:SetActive(false)
2021-11-16 17:34:37 +08:00
this.btnBox:SetActive(false)
this.addFriendBtn:SetActive(false)
end
this.addFriendBtn:SetActive(this._Config.isAddFriend)
--一些按钮需要特殊显示
this.SpecialBtnShow()
end
2024-11-12 16:22:23 +08:00
2022-01-13 15:23:59 +08:00
--按钮特殊显示
2021-11-16 17:34:37 +08:00
function this.SpecialBtnShow()
if this._ViewType == PLAYER_INFO_VIEW_TYPE.LINGMAIMIJING then
this.btnBox:SetActive(true)
local bool = this._PlayerId == PlayerManager.uid
2021-11-17 18:28:59 +08:00
if UIManager.IsOpen(UIName.RankingSingleListPanel) then
this.btnList[1]:SetActive(not bool)
this.btnList[2]:SetActive(false)
this.btnList[3]:SetActive(false)
else
this.btnList[1]:SetActive(not bool)
this.btnList[2]:SetActive(not bool)
this.btnList[3]:SetActive(bool)
2021-11-18 14:10:57 +08:00
if LingMaiMiJingManager.myPlaceId ~= 0 and LingMaiMiJingManager.myPlaceId < this.data.Id then
2021-11-18 11:35:20 +08:00
this.btnList[2]:SetActive(false)
end
2021-11-17 18:28:59 +08:00
end
2023-02-20 15:06:47 +08:00
--临时修改如果灵脉已占领无法抢夺挑战
2024-11-12 16:22:23 +08:00
if this._PlayerId > 0 then
2023-02-20 15:06:47 +08:00
this.btnBox:SetActive(false)
end
2021-11-16 17:34:37 +08:00
end
2020-05-09 13:31:21 +08:00
end
----=============================== 按钮事件==================================
-- 举报
function this.Report()
Log("举报")
2020-05-09 13:31:21 +08:00
end
2024-11-12 16:22:23 +08:00
2020-05-09 13:31:21 +08:00
-- 拉黑
function this.AddToBlackList()
if this.serverName and this.serverName ~= "" then
PopupTipPanel.ShowTip("无法跨服添加黑名单")
2024-11-12 16:22:23 +08:00
return
end
2020-05-09 13:31:21 +08:00
if not ActTimeCtrlManager.SingleFuncState(FUNCTION_OPEN_TYPE.GOODFRIEND) then
2021-04-09 12:26:35 +08:00
PopupTipPanel.ShowTip(Language[10828])
2020-05-09 13:31:21 +08:00
return
end
if table.nums(GoodFriendManager.blackFriendList) >= GoodFriendManager.blackFriendLimit then
2021-04-09 12:26:35 +08:00
PopupTipPanel.ShowTip(Language[11503])
2020-05-09 13:31:21 +08:00
return
end
GoodFriendManager.RequestAddToBlackList(this._PlayerId, function()
2021-04-09 12:26:35 +08:00
PopupTipPanel.ShowTip(Language[11504])
2020-05-09 13:31:21 +08:00
this:SetViewType(PLAYER_INFO_VIEW_TYPE.GO_TO_BLACK)
end)
end
2024-11-12 16:22:23 +08:00
2020-05-09 13:31:21 +08:00
-- 移除黑名单
function this.RemoveFromBlackList()
if not ActTimeCtrlManager.SingleFuncState(FUNCTION_OPEN_TYPE.GOODFRIEND) then
2021-04-09 12:26:35 +08:00
PopupTipPanel.ShowTip(Language[10828])
2020-05-09 13:31:21 +08:00
return
end
GoodFriendManager.RequestDeleteFromBlackList(this._PlayerId, function()
2021-04-09 12:26:35 +08:00
PopupTipPanel.ShowTip(Language[11505])
2020-05-09 13:31:21 +08:00
this:ClosePanel()
end)
end
2024-11-12 16:22:23 +08:00
2020-05-09 13:31:21 +08:00
-- 移除黑名单
function this.GoToBlack()
if not ActTimeCtrlManager.SingleFuncState(FUNCTION_OPEN_TYPE.GOODFRIEND) then
2021-04-09 12:26:35 +08:00
PopupTipPanel.ShowTip(Language[10828])
2020-05-09 13:31:21 +08:00
return
end
this:ClosePanel()
UIManager.OpenPanel(UIName.GoodFriendMainPanel, true, 4)
end
2024-11-12 16:22:23 +08:00
2020-05-09 13:31:21 +08:00
-- 打他
function this.BeatHim()
this:ClosePanel()
2020-08-25 20:28:32 +08:00
UIManager.OpenPanel(UIName.FormationPanelV2, FORMATION_TYPE.PLAY, this._PlayerData)
2020-05-09 13:31:21 +08:00
end
2024-11-12 16:22:23 +08:00
2021-06-15 20:08:14 +08:00
-- 跨服天梯
function this.JumpServerBattle()
this:ClosePanel()
2024-11-12 16:22:23 +08:00
UIManager.OpenPanel(UIName.FormationPanelV2, FORMATION_TYPE.JUMPSERVER_HIGHTLADDER, true, this._PlayerData)
2021-06-15 20:08:14 +08:00
end
2024-11-12 16:22:23 +08:00
2021-07-30 17:52:49 +08:00
-- 跨服天梯
function this.JumpServerBattle_NORMAL()
this:ClosePanel()
2024-11-12 16:22:23 +08:00
UIManager.OpenPanel(UIName.FormationPanelV2, FORMATION_TYPE.PLAY, this._PlayerData, true)
2021-07-30 17:52:49 +08:00
end
2021-11-16 17:34:37 +08:00
--灵脉秘境
function this.LingMaiFormaion()
2021-11-18 14:10:57 +08:00
if this.data.uid == PlayerManager.uid then
this:ClosePanel()
2021-11-19 16:16:45 +08:00
Log("调整编队")
2021-11-18 14:10:57 +08:00
UIManager.OpenPanel(UIName.FormationPanelV2, FORMATION_TYPE.LINGMAIMIJING, this.data)
else
2024-11-12 16:22:23 +08:00
LingMaiMiJingManager.CheckPrivilage(function()
2021-11-18 14:10:57 +08:00
this:ClosePanel()
2021-11-19 16:16:45 +08:00
Log("正常战斗")
2021-11-18 14:10:57 +08:00
UIManager.OpenPanel(UIName.FormationPanelV2, FORMATION_TYPE.LINGMAIMIJING, this.data)
end)
end
2021-11-16 17:34:37 +08:00
end
2024-11-12 16:22:23 +08:00
2021-11-19 17:23:06 +08:00
--灵脉秘境
function this.LingMaiQieCuo()
this:ClosePanel()
local sdata = {}
sdata.uid = this._PlayerId
sdata.name = this.curPlayerData.name
sdata.head = this.curPlayerData.head
sdata.headFrame = this.curPlayerData.headFrame
2024-11-12 16:22:23 +08:00
UIManager.OpenPanel(UIName.FormationPanelV2, FORMATION_TYPE.LINGMAIMIJING, sdata, true)
2021-11-19 17:23:06 +08:00
end
2024-11-12 16:22:23 +08:00
2022-01-13 15:23:59 +08:00
--=====================================按钮事件结束======================================
2021-11-16 17:34:37 +08:00
2020-05-09 13:31:21 +08:00
--界面关闭时调用(用于子类重写)
function PlayerInfoPopup:OnClose()
2022-01-13 18:29:12 +08:00
-- this.imprintObj:SetActive(false)
2021-06-15 20:08:14 +08:00
JumpServerManager.SetCurPersonInfo(nil)
if titleLive then
SubUIManager.Close(titleLive)
titleLive = nil
end
curPlayerData = {}
2020-05-09 13:31:21 +08:00
end
--界面销毁时调用(用于子类重写)
function PlayerInfoPopup:OnDestroy()
2021-04-21 13:12:04 +08:00
this.spLoader:Destroy()
2020-05-09 13:31:21 +08:00
-- 头像
if _PlayerHead then
_PlayerHead:Recycle()
_PlayerHead = nil
end
titleLive = nil
titleLiveStr = nil
2022-01-13 15:23:59 +08:00
-- this.imprintItemList = {}
this.InfoBtnsList = {}
this.ItemPreList = {}
2021-11-04 10:46:25 +08:00
this.Demons = {}
2021-11-17 16:14:47 +08:00
if this.extraInfo then
this.extraInfo.OnDestroy()
end
2020-05-09 13:31:21 +08:00
end
2021-04-21 13:12:04 +08:00
return PlayerInfoPopup