local UIMiniMapMain = require "View/MiniMap/UIMiniMapMain" local UIMiniMapFightThrone = UIViewClass(UIMiniMapMain) local WAITING_ANIM_PATH = ConstAssetPathConfig.WAITING_ANIM_PATH --全部显示旗子的时间 local SHOW_ALL_FLAG = 60 --几个需要显示令旗的怪物常量 local FLAG_ID = 37000001 local MONSTER_FLAG_ID1 = 37001101 local MONSTER_FLAG_ID2 = 37002101 --大乱斗小地图 function UIMiniMapFightThrone:OnCreated() self.showFlagAnimDic = {} local levelType = BattleDataGetter.GetCurLevelType() if levelType == LuaConst.LevelType.FightThroneFirstFloor or levelType == LuaConst.LevelType.FightThroneSecondFloor then self.showFlagRemainTime = SHOW_ALL_FLAG end end function UIMiniMapFightThrone:ShowMiniMap() UIMiniMapMain.ShowMiniMap(self) --显示分线和坐标 UIUtils.SetActive(self.img_BgTown, true) UIUtils.SetActive(self.Img_Bg, true) UIUtils.SetActive(self.lab_Branch, true) self.lab_Branch.text = string.FormatByIdsId(Const_IDS.IDS_MapLine, BattleDataGetter.GetBattleBranchLine() or 1) self.lab_Pos.text = nil end function UIMiniMapFightThrone:UpdatePosShow() local myPos = BattleDataGetter.GetMainPlayerLastLogicPos() if myPos then self:SetMapPosition(myPos, self.lab_TownName) end end function UIMiniMapFightThrone:OnUpdateFun(deltaTime, timeSinceUpdate) UIMiniMapMain.OnUpdateFun(self, deltaTime, timeSinceUpdate) if self:GetIfTimeToShowFlag() then self.showFlagRemainTime = nil end end function UIMiniMapFightThrone:IsAddMapPoint(entity, showRedPointType) return true end function UIMiniMapFightThrone:IsEntityShowFlag(id) return id == FLAG_ID or id == MONSTER_FLAG_ID1 or id == MONSTER_FLAG_ID2 end function UIMiniMapFightThrone:GetMapShowType(entity) local id = entity._logicInitData.CharacterID local isTimeShow = self:GetIfTimeToShowFlag() if isTimeShow then --全局令旗展示时,需要全部显示出来 if self:IsEntityShowFlag(id) then return CTL.MiniMap.MiniMapPointType.Flag end else --如果是旗子,需要显示 if id == FLAG_ID then return CTL.MiniMap.MiniMapPointType.Flag end end if entity:IsHero() and isTimeShow then if BattleDataGetter.GetFlagAmountOfPlayer(entity) > 0 then return CTL.MiniMap.MiniMapPointType.Flag end end if entity == BattleDataGetter.GetMainBoss() then return CTL.MiniMap.MiniMapPointType.PurpleBoss end return UIMiniMapMain.GetMapShowType(self, entity) end function UIMiniMapFightThrone:GetIfTimeToShowFlag() if self.showFlagRemainTime then local remainTime = BattleDataGetter.GetRemainTime() return remainTime <= self.showFlagRemainTime end return true end --大乱斗旗兵或者旗子出来时需要播放动效 function UIMiniMapFightThrone:GetMapPoint(index, type, effect, entity) local isPlayAnim = false if self:IsEntityShowFlag(entity._logicInitData.CharacterID) then if (self:GetIfTimeToShowFlag() and self.showFlagRemainTime) then --全图通知 isPlayAnim = true else local animType = self.showFlagAnimDic[entity:GetEntityID()] if animType == nil or animType ~= type then isPlayAnim = true end end end local mapPointItem = UIMiniMapMain.GetMapPoint(self, index, type, effect, entity) if isPlayAnim then mapPointItem:SetAsLastSibling() mapPointItem:PlayPointAnimationByPath(WAITING_ANIM_PATH) self.showFlagAnimDic[entity:GetEntityID()] = type end return mapPointItem end return UIMiniMapFightThrone