【特权优化】将界面顶部的特权等级移回

dev_chengFeng
gaoxin 2021-03-30 18:10:39 +08:00
parent 81a87576a3
commit 202658d6d9
8 changed files with 6854 additions and 6779 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 516ffdf1e12522247a1e2225930c4cf5
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -393,5 +393,6 @@ SubUIConfig = {
PlayerLiveView = { name = "PlayerLiveView", assetName = "PlayerLiveView", script = "View/PlayerLiveView" }, -- 玩家动态例会(小人) PlayerLiveView = { name = "PlayerLiveView", assetName = "PlayerLiveView", script = "View/PlayerLiveView" }, -- 玩家动态例会(小人)
HarmonyView={ name = "HarmonyView",assetName = "HarmonyView",script = "View/HarmonyView" }, --鸿蒙阵内容 HarmonyView={ name = "HarmonyView",assetName = "HarmonyView",script = "View/HarmonyView" }, --鸿蒙阵内容
FetterItem = { name = "FetterItem",assetName = "FetterItem",script = "View/FetterItem" }, --鸿蒙阵内容 FetterItem = { name = "FetterItem",assetName = "FetterItem",script = "View/FetterItem" }, --鸿蒙阵内容
PlayerInfoView = { name = "PlayerInfoView",assetName = "PlayerInfoView",script = "View/PlayerInfoView" }, -- 玩家信息条
} }

View File

@ -69,19 +69,8 @@ function this:InitComponent()
this.decorateRoot = Util.GetGameObject(self.gameObject, "bg/decorate") this.decorateRoot = Util.GetGameObject(self.gameObject, "bg/decorate")
self.ctrl = Util.GetGameObject(self.gameObject, "scene/ctrl") self.ctrl = Util.GetGameObject(self.gameObject, "scene/ctrl")
this.heroTeamPowerBtn = Util.GetGameObject(self.gameObject, "Up/powerBtn")
this.heroTeamPower = Util.GetGameObject(self.gameObject, "Up/powerBtn/value"):GetComponent("Text")
---------------topLeftPart---------------- ---------------topLeftPart----------------
--headBox
this.level = Util.GetGameObject(self.gameObject, "Up/headBox/lvFrame/lv"):GetComponent("Text")
this.playName = Util.GetGameObject(self.gameObject, "Up/headBox/name"):GetComponent("Text")
this.expSliderValue = Util.GetGameObject(self.gameObject, "Up/headBox/exp"):GetComponent("Slider")
this.expSliderValue.transform.localScale = Vector3.New(UIManager.adapterScale, 1, 1)
this.headBox = Util.GetGameObject(self.gameObject, "Up/headBox")
this.headPos = Util.GetGameObject(self.gameObject, "Up/headBox/headpos")
this.headRedpot = Util.GetGameObject(self.gameObject, "Up/headBox/redpot")
-- 七日登陆奖励预览入口 -- 七日登陆奖励预览入口
this.sgBtn=Util.GetGameObject(self.gameObject,"LeftUp/sevenGift") this.sgBtn=Util.GetGameObject(self.gameObject,"LeftUp/sevenGift")
@ -96,11 +85,6 @@ function this:InitComponent()
end end
effectAdapte(Util.GetGameObject(this.sgEffect[2], "ziti mask (1)")) effectAdapte(Util.GetGameObject(this.sgEffect[2], "ziti mask (1)"))
-- 特权
this.vipPrivilegeBtn = Util.GetGameObject(self.gameObject, "Up/vipPrivilege/vipPrivilegeBtn")
this.vipLevelText = Util.GetGameObject(this.vipPrivilegeBtn, "bg/vip"):GetComponent("Image")
this.vipRedPoint = Util.GetGameObject(self.gameObject, "Up/vipPrivilege/redPoint")
screenAdapte(this.vipPrivilegeBtn)
---------------topRightPart---------------- ---------------topRightPart----------------
-- 邮件 -- 邮件
this.btnYouJian = Util.GetGameObject(self.gameObject, "LeftDown/btnRoot/btnYouJian") this.btnYouJian = Util.GetGameObject(self.gameObject, "LeftDown/btnRoot/btnYouJian")
@ -189,6 +173,9 @@ function this:InitComponent()
this.rpPokemon = Util.GetGameObject(this.btnPokemon, "redPoint")--灵兽 this.rpPokemon = Util.GetGameObject(this.btnPokemon, "redPoint")--灵兽
this.rpbtnTianShuMiJuan = Util.GetGameObject(this.btnTianShuMiJuan, "redPoint")--灵兽 this.rpbtnTianShuMiJuan = Util.GetGameObject(this.btnTianShuMiJuan, "redPoint")--灵兽
if not this.playerInfoView then
this.playerInfoView = SubUIManager.Open(SubUIConfig.PlayerInfoView, this.transform)
end
this.BtView = SubUIManager.Open(SubUIConfig.BtView, self.transform) this.BtView = SubUIManager.Open(SubUIConfig.BtView, self.transform)
this.UpView = SubUIManager.Open(SubUIConfig.UpView, self.transform) this.UpView = SubUIManager.Open(SubUIConfig.UpView, self.transform)
@ -235,6 +222,7 @@ function this:InitComponent()
this.activityTabPrefab = Util.GetGameObject(self.gameObject, "RightUp/activityTabPrefab") this.activityTabPrefab = Util.GetGameObject(self.gameObject, "RightUp/activityTabPrefab")
this.RightUp = Util.GetGameObject(self.gameObject, "RightUp") this.RightUp = Util.GetGameObject(self.gameObject, "RightUp")
this.RightUp.transform.localScale = Vector3.one * UIManager.adapterScale this.RightUp.transform.localScale = Vector3.one * UIManager.adapterScale
end end
function this:SetPosFunc(v2) function this:SetPosFunc(v2)
@ -318,21 +306,6 @@ function this:BindEvent()
end) end)
--实例化自己 --实例化自己
this:OnChangeTitleOrRideOrSkin(rect) this:OnChangeTitleOrRideOrSkin(rect)
--GM工具
Util.AddClick(this.headBox, function()
if AppConst.isOpenGM then
UIManager.OpenPanel(UIName.GMPanel)
else
UIManager.OpenPanel(UIName.SettingPanel)
end
end)
--特权
Util.AddClick(this.vipPrivilegeBtn, function()
UIManager.OpenPanel(UIName.VipPanelV2)
end)
--八日登陆礼预览 --八日登陆礼预览
Util.AddClick(this.sgBtn,function() Util.AddClick(this.sgBtn,function()
--UIManager.OpenPanel(UIName.PassGiftPopup,true)ActivityTypeDef.SevenDayRegister --UIManager.OpenPanel(UIName.PassGiftPopup,true)ActivityTypeDef.SevenDayRegister
@ -564,7 +537,6 @@ end
-- 绑定红点 -- 绑定红点
function this.BindRedPoint() function this.BindRedPoint()
BindRedPointObject(RedPointType.VipPrivilege, this.vipRedPoint)
BindRedPointObject(RedPointType.Mail, this.mailRedPoint) BindRedPointObject(RedPointType.Mail, this.mailRedPoint)
BindRedPointObject(RedPointType.DailyTaskMain, this.DailyRedPoint) BindRedPointObject(RedPointType.DailyTaskMain, this.DailyRedPoint)
BindRedPointObject(RedPointType.Shop, this.rpShangdian) BindRedPointObject(RedPointType.Shop, this.rpShangdian)
@ -572,7 +544,6 @@ function this.BindRedPoint()
BindRedPointObject(RedPointType.Arena, this.rpJingjichang) BindRedPointObject(RedPointType.Arena, this.rpJingjichang)
BindRedPointObject(RedPointType.Friend, this.friendRed) BindRedPointObject(RedPointType.Friend, this.friendRed)
BindRedPointObject(RedPointType.RankingSort, this.rankRed) BindRedPointObject(RedPointType.RankingSort, this.rankRed)
BindRedPointObject(RedPointType.Setting, this.headRedpot)
BindRedPointObject(RedPointType.Recruit, this.rpRecruit) BindRedPointObject(RedPointType.Recruit, this.rpRecruit)
BindRedPointObject(RedPointType.SecretBox, this.rpSecretBox) BindRedPointObject(RedPointType.SecretBox, this.rpSecretBox)
BindRedPointObject(RedPointType.Alien, this.rpAlien) BindRedPointObject(RedPointType.Alien, this.rpAlien)
@ -584,7 +555,6 @@ function this.BindRedPoint()
end end
-- 绑定红点 -- 绑定红点
function this.ClearRedPoint() function this.ClearRedPoint()
ClearRedPointObject(RedPointType.VipPrivilege, this.vipRedPoint)
ClearRedPointObject(RedPointType.Mail, this.mailRedPoint) ClearRedPointObject(RedPointType.Mail, this.mailRedPoint)
ClearRedPointObject(RedPointType.DailyTaskMain, this.DailyRedPoint) ClearRedPointObject(RedPointType.DailyTaskMain, this.DailyRedPoint)
ClearRedPointObject(RedPointType.Shop, this.rpShangdian) ClearRedPointObject(RedPointType.Shop, this.rpShangdian)
@ -592,7 +562,6 @@ function this.ClearRedPoint()
ClearRedPointObject(RedPointType.Arena, this.rpJingjichang) ClearRedPointObject(RedPointType.Arena, this.rpJingjichang)
ClearRedPointObject(RedPointType.Friend, this.friendRed) ClearRedPointObject(RedPointType.Friend, this.friendRed)
ClearRedPointObject(RedPointType.RankingSort, this.rankRed) ClearRedPointObject(RedPointType.RankingSort, this.rankRed)
ClearRedPointObject(RedPointType.Setting, this.headRedpot)
ClearRedPointObject(RedPointType.Recruit, this.rpRecruit) ClearRedPointObject(RedPointType.Recruit, this.rpRecruit)
ClearRedPointObject(RedPointType.SecretBox, this.rpSecretBox) ClearRedPointObject(RedPointType.SecretBox, this.rpSecretBox)
ClearRedPointObject(RedPointType.Alien, this.rpAlien) ClearRedPointObject(RedPointType.Alien, this.rpAlien)
@ -611,7 +580,6 @@ function this:AddListener()
Game.GlobalEvent:AddEvent(GameEvent.Activity.OnActivityOpenOrClose, this.RefreshActivityBtn) Game.GlobalEvent:AddEvent(GameEvent.Activity.OnActivityOpenOrClose, this.RefreshActivityBtn)
Game.GlobalEvent:AddEvent(GameEvent.Activity.OnPatFaceRedRefresh, this.RefreshShowPatPaceActivity) Game.GlobalEvent:AddEvent(GameEvent.Activity.OnPatFaceRedRefresh, this.RefreshShowPatPaceActivity)
Game.GlobalEvent:AddEvent(GameEvent.Adventure.OnEnemyListChanged, this.OnAlienListChanged) Game.GlobalEvent:AddEvent(GameEvent.Adventure.OnEnemyListChanged, this.OnAlienListChanged)
Game.GlobalEvent:AddEvent(GameEvent.Player.OnPlayerLvChange, this.RefreshPlayerInfoShow)
Game.GlobalEvent:AddEvent(GameEvent.EightDay.GetRewardSuccess, this.RefreshEightGiftPreview) Game.GlobalEvent:AddEvent(GameEvent.EightDay.GetRewardSuccess, this.RefreshEightGiftPreview)
Game.GlobalEvent:AddEvent(GameEvent.FiveAMRefresh.ServerNotifyRefresh, this.RefreshEightGiftPreview) Game.GlobalEvent:AddEvent(GameEvent.FiveAMRefresh.ServerNotifyRefresh, this.RefreshEightGiftPreview)
Game.GlobalEvent:AddEvent(GameEvent.FindFairy.RefreshBuyOpenState, this.RefreshGiftBtnShow) Game.GlobalEvent:AddEvent(GameEvent.FindFairy.RefreshBuyOpenState, this.RefreshGiftBtnShow)
@ -626,7 +594,6 @@ function this:RemoveListener()
Game.GlobalEvent:RemoveEvent(GameEvent.Activity.OnActivityOpenOrClose, this.RefreshActivityBtn) Game.GlobalEvent:RemoveEvent(GameEvent.Activity.OnActivityOpenOrClose, this.RefreshActivityBtn)
Game.GlobalEvent:RemoveEvent(GameEvent.Activity.OnPatFaceRedRefresh, this.RefreshShowPatPaceActivity) Game.GlobalEvent:RemoveEvent(GameEvent.Activity.OnPatFaceRedRefresh, this.RefreshShowPatPaceActivity)
Game.GlobalEvent:RemoveEvent(GameEvent.Adventure.OnEnemyListChanged, this.OnAlienListChanged) Game.GlobalEvent:RemoveEvent(GameEvent.Adventure.OnEnemyListChanged, this.OnAlienListChanged)
Game.GlobalEvent:RemoveEvent(GameEvent.Player.OnPlayerLvChange, this.RefreshPlayerInfoShow)
Game.GlobalEvent:RemoveEvent(GameEvent.EightDay.GetRewardSuccess, this.RefreshEightGiftPreview) Game.GlobalEvent:RemoveEvent(GameEvent.EightDay.GetRewardSuccess, this.RefreshEightGiftPreview)
Game.GlobalEvent:RemoveEvent(GameEvent.FiveAMRefresh.ServerNotifyRefresh, this.RefreshEightGiftPreview) Game.GlobalEvent:RemoveEvent(GameEvent.FiveAMRefresh.ServerNotifyRefresh, this.RefreshEightGiftPreview)
Game.GlobalEvent:RemoveEvent(GameEvent.FindFairy.RefreshBuyOpenState, this.RefreshGiftBtnShow) Game.GlobalEvent:RemoveEvent(GameEvent.FindFairy.RefreshBuyOpenState, this.RefreshGiftBtnShow)
@ -644,12 +611,11 @@ function this:OnSortingOrderChange()
Util.AddParticleSortLayer(Util.GetGameObject(this.decorateRoot, "effect"), self.sortingOrder - orginLayer) Util.AddParticleSortLayer(Util.GetGameObject(this.decorateRoot, "effect"), self.sortingOrder - orginLayer)
Util.AddParticleSortLayer(this.sgEffect[1], self.sortingOrder - orginLayer) Util.AddParticleSortLayer(this.sgEffect[1], self.sortingOrder - orginLayer)
Util.AddParticleSortLayer(this.sgEffect[2], self.sortingOrder - orginLayer) Util.AddParticleSortLayer(this.sgEffect[2], self.sortingOrder - orginLayer)
Util.AddParticleSortLayer(this.vipPrivilegeBtn, self.sortingOrder - orginLayer)
orginLayer = self.sortingOrder orginLayer = self.sortingOrder
this.BtView:SetOrderStatus({ sortOrder = self.sortingOrder }) this.BtView:SetOrderStatus({ sortOrder = self.sortingOrder })
-- 头像层级
if this.playerHead then if this.playerInfoView then
this.playerHead:SetLayer(self.sortingOrder) this.playerInfoView:SetLayer(self.sortingOrder)
end end
end end
@ -788,30 +754,14 @@ end
--界面打开时调用(用于子类重写) --界面打开时调用(用于子类重写)
function this:OnShow() function this:OnShow()
-- 音效 -- 音效
if isFirstOpen >= 2 then if isFirstOpen >= 2 then
-- PlaySoundWithoutClick(SoundConfig.Sound_interface) -- PlaySoundWithoutClick(SoundConfig.Sound_interface)
end end
isFirstOpen = isFirstOpen + 1 isFirstOpen = isFirstOpen + 1
isRefeshIcon = true isRefeshIcon = true
this.vipLevelText.sprite = VipManager.SetVipLevelImg()
timePressStarted = Time.realtimeSinceStartup timePressStarted = Time.realtimeSinceStartup
SoundManager.PlayMusic(SoundConfig.BGM_Main) SoundManager.PlayMusic(SoundConfig.BGM_Main)
this.level.text = PlayerManager.level
this.expSliderValue.value = PlayerManager.exp / PlayerManager.userLevelData[PlayerManager.level].Exp
this.playName.text = PlayerManager.nickName
this.heroTeamPower.text = FormationManager.GetFormationPower(FormationManager.curFormationIndex)
if not this.playerHead then
this.playerHead = SubUIManager.Open(SubUIConfig.PlayerHeadView, this.headPos.transform)
end
this.playerHead:SetHead(PlayerManager.head)
this.playerHead:SetFrame(HeadManager.GetCurFrameId())
this.playerHead:SetScale(Vector3.one * 0.9)
this.playerHead:SetPosition(Vector3.New(-5, 8, 0))
this.playerHead:SetLayer(this.sortingOrder)
this.playerHead:SetEffectScale(0.85)
--刷新主城npc --刷新主城npc
this:OnChangeTitleOrRideOrSkin() this:OnChangeTitleOrRideOrSkin()
@ -896,14 +846,6 @@ function this.OnUpdate()
--主城人物层级处理 --主城人物层级处理
this.OnMainPlayerNPCRefresh() this.OnMainPlayerNPCRefresh()
end end
-- 刷新玩家基础信息显示
function this.RefreshPlayerInfoShow()
this.vipLevelText.sprite = VipManager.SetVipLevelImg()
this.level.text = PlayerManager.level
this.expSliderValue.value = PlayerManager.exp / PlayerManager.userLevelData[PlayerManager.level].Exp
this.playName.text = PlayerManager.nickName
this.heroTeamPower.text = FormationManager.GetFormationPower(FormationManager.curFormationIndex)
end
-- 刷新功能显示 -- 刷新功能显示
function this.InitFuncShow(funcType) function this.InitFuncShow(funcType)
@ -1151,15 +1093,11 @@ function this:OnDestroy()
activityTabs = {} activityTabs = {}
SubUIManager.Close(this.UpView) SubUIManager.Close(this.UpView)
SubUIManager.Close(this.BtView) SubUIManager.Close(this.BtView)
-- SubUIManager.Close(this.HorseRaceLampView)
SubUIManager.Close(this.ChatTipView) SubUIManager.Close(this.ChatTipView)
SubUIManager.Close(this.playerInfoView)
this.playerInfoView = nil
-- 清楚红点 -- 清楚红点
this.ClearRedPoint() this.ClearRedPoint()
-- 头像回收
if this.playerHead then
this.playerHead:Recycle()
this.playerHead = nil
end
-- 计时器 -- 计时器
if this._TimeCounter then if this._TimeCounter then
this._TimeCounter:Stop() this._TimeCounter:Stop()

View File

@ -432,7 +432,7 @@ function this.SetVipLevelImg()
--- vip 0 暂时没有资源 --- vip 0 暂时没有资源
local level = this.GetVipLevel() local level = this.GetVipLevel()
level = level or 0 level = level or 0
local img = Util.LoadSprite("r_zjm_tequanpaizi_0" .. level) local img = Util.LoadSprite("r_zjm_tequanpaizi_0" .. level.."_zh")
return img return img
end end

View File

@ -0,0 +1,121 @@
PlayerInfoView = {}
function PlayerInfoView:New(gameObject)
local b = {}
b.gameObject = gameObject
b.transform = gameObject.transform
setmetatable(b, { __index = PlayerInfoView })
return b
end
--初始化组件(用于子类重写)
function PlayerInfoView:InitComponent()
self.heroTeamPowerBtn = Util.GetGameObject(self.gameObject, "powerBtn")
self.heroTeamPower = Util.GetGameObject(self.gameObject, "powerBtn/value"):GetComponent("Text")
--headBox
self.level = Util.GetGameObject(self.gameObject, "headBox/lvFrame/lv"):GetComponent("Text")
self.playName = Util.GetGameObject(self.gameObject, "headBox/name"):GetComponent("Text")
self.expSliderValue = Util.GetGameObject(self.gameObject, "headBox/exp"):GetComponent("Slider")
self.expSliderValue.transform.localScale = Vector3.New(UIManager.adapterScale, 1, 1)
self.headBox = Util.GetGameObject(self.gameObject, "headBox")
self.headPos = Util.GetGameObject(self.gameObject, "headBox/headpos")
self.headRedpot = Util.GetGameObject(self.gameObject, "headBox/redpot")
-- 特权
self.vipPrivilegeBtn = Util.GetGameObject(self.gameObject, "vipPrivilege/vipPrivilegeBtn")
self.vipLevelText = Util.GetGameObject(self.vipPrivilegeBtn, "bg/vip"):GetComponent("Image")
self.vipRedPoint = Util.GetGameObject(self.gameObject, "vipPrivilege/redPoint")
screenAdapte(self.vipPrivilegeBtn)
end
--绑定事件(用于子类重写)
function PlayerInfoView:BindEvent()
--GM工具
Util.AddClick(self.headBox, function()
if AppConst.isOpenGM then
UIManager.OpenPanel(UIName.GMPanel)
else
UIManager.OpenPanel(UIName.SettingPanel)
end
end)
--特权
Util.AddClick(self.vipPrivilegeBtn, function()
UIManager.OpenPanel(UIName.VipPanelV2)
end)
end
--添加事件监听(用于子类重写)
function PlayerInfoView:AddListener()
Game.GlobalEvent:AddEvent(GameEvent.Player.OnPlayerLvChange, self.OnShow, self)
-- 绑定红点
BindRedPointObject(RedPointType.Setting, self.headRedpot)
BindRedPointObject(RedPointType.VipPrivilege, self.vipRedPoint)
end
--移除事件监听(用于子类重写)
function PlayerInfoView:RemoveListener()
Game.GlobalEvent:RemoveEvent(GameEvent.Player.OnPlayerLvChange, self.OnShow, self)
-- 解除绑定
ClearRedPointObject(RedPointType.Setting, self.headRedpot)
ClearRedPointObject(RedPointType.VipPrivilege, self.vipRedPoint)
end
--界面打开时调用(用于子类重写)
function PlayerInfoView:OnOpen(...)
self.orginLayer = 0
self:OnShow()
end
--界面打开或者重新打开后,界面刷新时调用(用于子类重写)
function PlayerInfoView:OnShow()
self.level.text = PlayerManager.level
self.expSliderValue.value = PlayerManager.exp / PlayerManager.userLevelData[PlayerManager.level].Exp
self.playName.text = PlayerManager.nickName
self.heroTeamPower.text = FormationManager.GetFormationPower(FormationManager.curFormationIndex)
self.vipLevelText.sprite = VipManager.SetVipLevelImg()
if not self.playerHead then
self.playerHead = SubUIManager.Open(SubUIConfig.PlayerHeadView, self.headPos.transform)
end
self.playerHead:SetHead(PlayerManager.head)
self.playerHead:SetFrame(HeadManager.GetCurFrameId())
self.playerHead:SetScale(Vector3.one * 0.9)
self.playerHead:SetPosition(Vector3.New(-5, 8, 0))
self.playerHead:SetLayer(self.sortingOrder)
self.playerHead:SetEffectScale(0.85)
end
--界面关闭时调用(用于子类重写)
function PlayerInfoView:OnClose()
-- 头像回收
if self.playerHead then
self.playerHead:Recycle()
self.playerHead = nil
end
-- 还原特效层级
Util.AddParticleSortLayer(self.vipPrivilegeBtn, - self.orginLayer)
end
-- 设置层级
function PlayerInfoView:SetLayer(sortingOrder)
Util.AddParticleSortLayer(self.vipPrivilegeBtn, sortingOrder - self.orginLayer)
if self.playerHead then
self.playerHead:SetLayer(sortingOrder)
end
self.orginLayer = sortingOrder
end
return PlayerInfoView

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: e4a594afca1e5b347bd5a7a11d24b5fc
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant: