local UIPushInterfaceGuildWar = UIViewClass() local IDS_Dic = { titleIDS1 = "IDS_CrossSever_PushInterFaceText1", desIDS1 = "IDS_CrossSever_PushInterFaceText2", titleIDS2 = "IDS_CrossSever_PushInterFaceText6", desIDS2 = "IDS_CrossSever_PushInterFaceText7", countDownDesFirst1 = "IDS_GuildActivity_Preview", countDownDesFirst2 = "IDS_FunctionUnlock_Hint3", countDownDesSecond1 = "IDS_CrossSever_PushInterFaceText4", countDownDesSecond2 = "IDS_CrossSever_PushInterFaceText5", } function UIPushInterfaceGuildWar:OnOpened() UTL.Item.SetLocalizationImage(self.loc_State, self.img_Title, "UI_PushInterface/slzb_msz_01.png") self:RefreshPanel() end function UIPushInterfaceGuildWar:RefreshPanel() local crossInfo = MDL.GuildWar.GetCrossServerInfo() local remainTime = crossInfo.startTime - UTL.Time.GetServerTimestamp() local isFirst = CTL.GuildWar.IsFirstCrossServer() if remainTime > 0 then self:StartRepeatFunc(self.RefreshPanel, 1) UIUtils.SetLabel(self.txt_Time, string.FormatByIdsId(isFirst and Const_IDS[IDS_Dic.countDownDesFirst1] or Const_IDS[IDS_Dic.countDownDesSecond1], UTL.Time.GetLocalShowTimeCountDownByTimestamp(crossInfo.startTime))) else self:StopRepeatFunc(self.RefreshPanel) UIUtils.SetLabelText(self.txt_Time, isFirst and Const_IDS[IDS_Dic.countDownDesFirst2] or Const_IDS[IDS_Dic.countDownDesSecond2]) end UIUtils.SetLabelText(self.txt_Title, isFirst and Const_IDS[IDS_Dic.titleIDS1] or Const_IDS[IDS_Dic.titleIDS2]) UIUtils.SetLabelText(self.txt_StoryDes, CTL.GuildWar.IsFirstCrossServer() and Const_IDS[IDS_Dic.desIDS1] or Const_IDS[IDS_Dic.desIDS2]) end function UIPushInterfaceGuildWar:OnBackButtonPressed() self:OnButtonClicked(self.btn_Close) end function UIPushInterfaceGuildWar:OnButtonClicked(comp) if comp == self.btn_Close then CTL.PushInterface.HidePushInterface(self.__viewClassPath, self.toggle_Skip) self:CloseView() elseif comp == self.btn_Get then if MDL.Unlock.IsUnlock(MDL.Unlock.FunctionType.GuildWar) then UIManager.OpenView(Const_UI_Lua.UIEnum.UIGuildWarCrossServerActivities) end end end return UIPushInterfaceGuildWar