【山河社稷图优化】关卡编队界面显示三星条件(主关卡)和特殊要求(副关卡)

dev_chengFeng
ZhangBiao 2021-11-02 16:24:01 +08:00
parent 672fcaf974
commit f12a83ec53
3 changed files with 44657 additions and 80 deletions

View File

@ -170,6 +170,9 @@ function this:InitComponent()
--七界试炼
this.conditionBar = Util.GetGameObject(self.transform, "ConditionBar")
this.conditionBar:SetActive(false)
--山河社稷图
this.fightlevelconditionBar = Util.GetGameObject(self.transform, "FightLevelConditionBar")
this.fightlevelconditionBar:SetActive(false)
end
function this:BindEvent()
@ -273,7 +276,8 @@ function this:OnShow()
isPress = false
this.ElementalResonanceView:OnOpen({sortOrder=self.sortingOrder})
this.SetDrawLevel()
this.CheckQiJieCondition()
--部分界面有特殊条件显示,集体管理
this.CheckCondition()
end
function this:OnClose()
@ -395,7 +399,8 @@ function this.SetCardsData()
UIManager.OpenPanel(UIName.WarPowerChangeNotifyPanelV2,{oldValue = tempPowerNum,newValue = newPowerNum,pos=Vector3.New(-467,837.2),duration=0.7,isShowBg=false,isShowOldNum=false,pivot=Vector2.New(0,0.5)})
end
tempPowerNum = this.formationPower
this.CheckQiJieCondition()
--部分界面有特殊条件显示,集体管理
this.CheckCondition()
end
-- 设置编队上阵位置显隐
function this.InitArmPos()
@ -1101,10 +1106,12 @@ function this.SetDrawLevel()
canvas.overrideSorting = false
end
--检测七界试炼条件
function this.CheckQiJieCondition()
--部分界面有特殊条件显示,集体管理
function this.CheckCondition()
if this.curFormationIndex == FormationTypeDef.FORMATION_QIJIESHILIAN then
this.opView.RefreshConditon(this.choosedList)
elseif this.curFormationIndex == FormationTypeDef.FIGHT_LEVEL or this.curFormationIndex == FormationTypeDef.FIGHT_ASSISTANTLEVEL then
--山河社稷图不随阵容变化儿变化,不用写
end
end

View File

@ -1,6 +1,8 @@
----- 山河社稷图 -----
local FightLevelFormation = {}
local this = FightLevelFormation
local HardStageBuff = ConfigManager.GetConfig(ConfigName.HardStageBuff)
local HardStageCondition = ConfigManager.GetConfig(ConfigName.HardStageCondition)
--- 是否需要切换编队的功能
this.IsNeedChangeFormation = false
local hadClick = false
@ -40,8 +42,7 @@ function this.On_Btn2_Click()
return
end
-- 编队为空
if this.nodeData.config.StageType == FIGHTLEVEL_STAGETYPE.MainLevel then
curFormationTypeDef = FormationTypeDef.FIGHT_LEVEL
else
@ -68,8 +69,46 @@ function this.InitView()
hadClick = false
this.root.UpView:OnOpen({ showType = UpViewOpenType.ShowLeft, panelType = PanelType.Main })
end
--山河试炼条件区域
this.root.fightlevelconditionBar:SetActive(true)
this.conditionList = {}
this.starListEffect = {}
for i = 1, 3 do
this.conditionList[i] = Util.GetGameObject(this.root.fightlevelconditionBar,"goal ("..i..")")
this.starListEffect[i] = Util.GetGameObject(this.conditionList[i], "star/Fx_star_looping")
Util.SetParticleSortLayer(this.starListEffect[i], this.root.sortingOrder + 1)
this.starListEffect[i]:SetActive(false)
this.conditionList[i]:SetActive(false)
end
this.Tips = Util.GetGameObject(this.root.fightlevelconditionBar,"Tips"):GetComponent("Text")
this.Tips.gameObject:SetActive(false)
local condition = this.nodeData.config.ConditionValue or {}
if this.nodeData.config.StageType == FIGHTLEVEL_STAGETYPE.MainLevel then
for i, v in pairs(condition) do
local conditionGo = this.conditionList[i]
conditionGo:SetActive(true)
local noStarImage = Util.GetGameObject(conditionGo, "star/noStarImage")
local getStarImage = Util.GetGameObject(conditionGo, "star/getStarImage")
local state = FightLevelManager.GetCurLevelStarState(this.nodeData.state,i)
noStarImage:SetActive(not state)
getStarImage:SetActive(state)
Util.GetGameObject(conditionGo, "star/Num"):GetComponent("Text").text = i
local color = state and "00FF66" or "FDEBC2"
Util.GetGameObject(conditionGo, "Text"):GetComponent("Text").text = string.format( "<color=#%s>%s</color>",color,HardStageCondition[v].Describe)
end
if this.nodeData.isFirst then
for i = 1, 3 do
this.starListEffect[i]:SetActive(true)
end
end
else
this.Tips.gameObject:SetActive(true)
this.Tips.text = HardStageBuff[this.nodeData.config.HardStageBuff] and HardStageBuff[this.nodeData.config.HardStageBuff].Describe or ""
end
end
-- 开始战斗
function this.StartFight()