local UIGuildWarCrossServerActivities = UIViewClass() function UIGuildWarCrossServerActivities:OnOpened() self:RegistSystemEvent(EventID.UI_CrossServerUpdate, self.RefreshPage) UTL.Item.SetLocalizationImage(self.loc_Title, self.img_Title, "slzkf_msz_slzkf.png") MDL.CrossServer.GetZoneGroupInfoReq(MDL.CrossServer.CrossServerZoneGroupType[LuaConst.ActivityType.GuildWar]) end function UIGuildWarCrossServerActivities:RefreshPage(info) if GameAppInfo.IsVietnamPackage() then local month = UTL.Time.OsDateOriginal("%m", MDL.GuildWar.GetCrossServerInfo().startTime) local day = UTL.Time.OsDateOriginal("%d", MDL.GuildWar.GetCrossServerInfo().startTime) UIUtils.SetLabel(self.txt_TopHint, string.FormatByIdsId(Const_IDS["IDS_GuildWar_CrossSeverListIntro1"], day, month)) else local date = UTL.Time.OsDateOriginal("*t", MDL.GuildWar.GetCrossServerInfo().startTime) local monthStr = string.FormatByIdsId(Const_IDS["IDS_MonthCommon"], date.month) local dayStr = string.FormatByIdsId(Const_IDS["IDS_DayCommon"], date.day) UIUtils.SetLabel(self.txt_TopHint, string.FormatByIdsId(Const_IDS["IDS_GuildWar_CrossSeverListIntro1"], monthStr, dayStr)) end if IsServerDataNotNil(info) then for i, v in ipairs(info.zoneGroup) do self.zoneInfo_LoopScroll:AddData(v, 0) end end end function UIGuildWarCrossServerActivities:OnBackButtonPressed() self:OnButtonClicked(self.btn_Close) end function UIGuildWarCrossServerActivities:OnButtonClicked(comp) if comp == self.btn_Close then self:CloseView() end end function UIGuildWarCrossServerActivities:OnCellInit(scrollRect, index, cellTable, data) UIUtils.SetLabel(cellTable.txt_ServerName, string.FormatByIdsId(Const_IDS["IDS_CrossSever_SeverInfoText"], data.serverId, data.serverId)) end return UIGuildWarCrossServerActivities