只有一个公告显示bug
parent
7966d2e4ca
commit
56e5a68b0f
|
|
@ -807,20 +807,33 @@ public class UI_MainPanelController : UIWindow
|
|||
Sprite tabNormal = LoadAsset<Sprite>("Assets/Art/UI/Texture/UI_Pic_MainPannel/UI_Pic_NewMain/UI_SmallBarW.png");
|
||||
|
||||
var listNoticeInfo = AppConfig.Instance.NoticeInfos;
|
||||
// 真实公告数据
|
||||
var realNoticeInfo = new Dictionary<int, NoticeInfo>();
|
||||
for (var i = 0; i < listNoticeInfo.Count; i++)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(listNoticeInfo[i].Title))
|
||||
{
|
||||
realNoticeInfo.Add(i, listNoticeInfo[i]);
|
||||
}
|
||||
}
|
||||
|
||||
if (realNoticeInfo.Count <= 0) return;
|
||||
var firstKey = realNoticeInfo.First().Key;
|
||||
|
||||
var bannerList = TableManager.Instance.Tables.bannerCfg.DataList;
|
||||
if (firstKey >= bannerList.Count) return;
|
||||
|
||||
listBanner.Add(new BannerItem(goBanner, bannerList[0].BannerImgPath));
|
||||
listBanner.Add(new BannerItem(goBanner, bannerList[firstKey].BannerImgPath));
|
||||
listTab.Add(new TabItem(goTab, tabSelect, tabNormal));
|
||||
|
||||
for (int i = 1; i < bannerList.Count; ++i)
|
||||
|
||||
foreach (var notice in realNoticeInfo)
|
||||
{
|
||||
if (i < listNoticeInfo.Count && !string.IsNullOrEmpty(listNoticeInfo[i].Title))
|
||||
{
|
||||
var path = bannerList[i].BannerImgPath;
|
||||
listBanner.Add(new BannerItem(goBanner, i, path));
|
||||
listTab.Add(new TabItem(goTab, i, tabSelect, tabNormal));
|
||||
}
|
||||
if(notice.Key == firstKey)continue;
|
||||
var key = notice.Key;
|
||||
if(key>=bannerList.Count) continue;
|
||||
var path = bannerList[key].BannerImgPath;
|
||||
listBanner.Add(new BannerItem(goBanner, key, path));
|
||||
listTab.Add(new TabItem(goTab, key, tabSelect, tabNormal));
|
||||
}
|
||||
|
||||
bannerView.Init(OnChangeBanner);
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ using Gameplay.Net;
|
|||
using PhxhSDK;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Framework;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
|
|
@ -435,6 +436,7 @@ public class UI_NoticeController : UIWindow
|
|||
|
||||
rawImageGaussianBlurMask.texture = CommonUtils.GetScreenTexture2D();
|
||||
tabRecycleView.Init(OnRefreshTab);
|
||||
|
||||
|
||||
BindButton(buttonClose, OnClose);
|
||||
}
|
||||
|
|
@ -446,6 +448,11 @@ public class UI_NoticeController : UIWindow
|
|||
inputData = (InputData)data;
|
||||
}
|
||||
|
||||
if (!noticeInfo.TryGetValue(inputData.Idx, out var info))
|
||||
{
|
||||
inputData.Idx = noticeInfo.First().Key;
|
||||
}
|
||||
|
||||
OnNoticeTypeTab(inputData.OpenType); // 默认选中活动公告
|
||||
}
|
||||
|
||||
|
|
@ -505,6 +512,7 @@ public class UI_NoticeController : UIWindow
|
|||
if (!noticeIndexDic.TryGetValue(index, out var noticeIndex)) return;
|
||||
|
||||
noticeTab.SetInfo(noticeInfo[noticeIndex], noticeIndex);
|
||||
|
||||
if (inputData.Idx == noticeTab.ID)
|
||||
{
|
||||
curSelectTab = noticeTab;
|
||||
|
|
|
|||
Loading…
Reference in New Issue