local UIGuildWarTips = UIViewClass() function UIGuildWarTips:OnOpened(context) self:RegistSystemEvent(EventID.UI_CloseGuildWarTips, self.CloseGuildWarTips) self:RegistSystemEvent(EventID.UI_GuildWarSelfDead, self.TryHideView) self:RegistSystemEvent(EventID.UI_GuildWarCloseRevive, self.TryActiveView) self.txt_Info:SetText(context.str) if context.tipType == 1 then UIUtils.SetActive(self.icon_car, true) UIUtils.SetActive(self.icon_bom, false) elseif context.tipType == 2 then UIUtils.SetActive(self.icon_car, false) UIUtils.SetActive(self.icon_bom, true) self.group1:SetLocalPosition(0, 112, 0) elseif context.tipType == 3 then UIUtils.SetActive(self.icon_Btn, false) end if UIManager.IsViewOpened(Const_UI_Lua.UIEnum.UIGuildWarRevive) then self:TryHideView() end end function UIGuildWarTips:TryHideView() UIUtils.SetActive(self.gameObject, false) end function UIGuildWarTips:TryActiveView(entity) if entity and entity:IsPlayerSelf() then UIUtils.SetActive(self.gameObject, true) end end function UIGuildWarTips:CloseGuildWarTips(tipType) if tipType == self.context.tipType then self:CloseView() UIManager.CloseView(Const_UI_Lua.UIEnum.UIDescriptionPanel) end end function UIGuildWarTips:OnButtonClicked(comp) if comp == self.btn_Close then self:CloseView() elseif comp == self.icon_Btn then if self.context.tipType == 1 then UIManager.OpenView(Const_UI_Lua.UIEnum.UIDescriptionPanel, {target = self.descPos, posType = LuaConst.DescriptionPanelType.LeftUpper, text = UIUtils.GetLocalizedTxt(Const_IDS.IDS_GuildWar_SuperSiegeEnginesDes)},"GuildWar/UIGuildWarDescriptionPanel") else UIManager.OpenView(Const_UI_Lua.UIEnum.UIDescriptionPanel, {target = self.descPos, posType = LuaConst.DescriptionPanelType.LeftUpper, text = UIUtils.GetLocalizedTxt(Const_IDS.IDS_GuildWar_BombDes)},"GuildWar/UIGuildWarDescriptionPanel") end end end function UIGuildWarTips:OnClosed() CTL.GuildWar.OnCloseTipsView(self.context.tipType) logging.log(LTAG.LOG," OnClosed ") end return UIGuildWarTips