|
@@ -120,8 +120,8 @@ namespace GFGGame
|
|
{
|
|
{
|
|
base.AddEventListener();
|
|
base.AddEventListener();
|
|
|
|
|
|
- EventAgent.AddEventListener(ConstMessage.GALLERY_DATA_CHANGE, UpdateGalleryList);
|
|
|
|
- EventAgent.AddEventListener(ConstMessage.GALLERY_RANK_DATA_CHANGE, UpdateGalleryRankList);
|
|
|
|
|
|
+ // EventAgent.AddEventListener(ConstMessage.GALLERY_DATA_CHANGE, UpdateGalleryList);
|
|
|
|
+ // EventAgent.AddEventListener(ConstMessage.GALLERY_RANK_DATA_CHANGE, UpdateGalleryRankList);
|
|
}
|
|
}
|
|
protected override async void OnShown()
|
|
protected override async void OnShown()
|
|
{
|
|
{
|
|
@@ -194,8 +194,8 @@ namespace GFGGame
|
|
protected override void RemoveEventListener()
|
|
protected override void RemoveEventListener()
|
|
{
|
|
{
|
|
base.RemoveEventListener();
|
|
base.RemoveEventListener();
|
|
- EventAgent.RemoveEventListener(ConstMessage.GALLERY_DATA_CHANGE, UpdateGalleryList);
|
|
|
|
- EventAgent.RemoveEventListener(ConstMessage.GALLERY_RANK_DATA_CHANGE, UpdateGalleryRankList);
|
|
|
|
|
|
+ // EventAgent.RemoveEventListener(ConstMessage.GALLERY_DATA_CHANGE, UpdateGalleryList);
|
|
|
|
+ // EventAgent.RemoveEventListener(ConstMessage.GALLERY_RANK_DATA_CHANGE, UpdateGalleryRankList);
|
|
}
|
|
}
|
|
|
|
|
|
private void OnBtnBackClick()
|
|
private void OnBtnBackClick()
|
|
@@ -291,9 +291,11 @@ namespace GFGGame
|
|
else
|
|
else
|
|
{
|
|
{
|
|
UpdateList();
|
|
UpdateList();
|
|
|
|
+
|
|
if (_list.numItems > 0) _list.ScrollToView(0);
|
|
if (_list.numItems > 0) _list.ScrollToView(0);
|
|
if (_list1.numItems > 0) _list.ScrollToView(0);
|
|
if (_list1.numItems > 0) _list.ScrollToView(0);
|
|
-
|
|
|
|
|
|
+ _list.numItems = 0;
|
|
|
|
+ _list1.numItems = 0;
|
|
ReqGalleryList(0);
|
|
ReqGalleryList(0);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -362,7 +364,7 @@ namespace GFGGame
|
|
bool result = await PoemGallerySProxy.ReqGalleryList(_sortType, startIndex, _pageCount);
|
|
bool result = await PoemGallerySProxy.ReqGalleryList(_sortType, startIndex, _pageCount);
|
|
if (result)
|
|
if (result)
|
|
{
|
|
{
|
|
- Timers.inst.StartCoroutine(PictureStorageHelper.Download(_galleryDatas, startIndex));
|
|
|
|
|
|
+ Timers.inst.StartCoroutine(PictureStorageHelper.Download(_galleryDatas, startIndex, UpdateGalleryList));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
private void UpdateGalleryList()
|
|
private void UpdateGalleryList()
|
|
@@ -392,9 +394,13 @@ namespace GFGGame
|
|
}
|
|
}
|
|
|
|
|
|
//请求排行榜刷新
|
|
//请求排行榜刷新
|
|
- private void ReqGalleryRankList()
|
|
|
|
|
|
+ private async void ReqGalleryRankList()
|
|
{
|
|
{
|
|
- PoemGallerySProxy.ReqRankList().Coroutine();
|
|
|
|
|
|
+ bool result = await PoemGallerySProxy.ReqRankList();
|
|
|
|
+ if (result)
|
|
|
|
+ {
|
|
|
|
+ Timers.inst.StartCoroutine(PictureStorageHelper.Download(_galleryDatas, 0, UpdateGalleryRankList));
|
|
|
|
+ }
|
|
}
|
|
}
|
|
private void UpdateGalleryRankList()
|
|
private void UpdateGalleryRankList()
|
|
{
|
|
{
|
|
@@ -408,7 +414,7 @@ namespace GFGGame
|
|
{
|
|
{
|
|
GalleryThemeCfg themeCfg = GalleryThemeCfgArray.Instance.GetCfg((int)PoemGalleryDataManager.Instance.ThemeId);
|
|
GalleryThemeCfg themeCfg = GalleryThemeCfgArray.Instance.GetCfg((int)PoemGalleryDataManager.Instance.ThemeId);
|
|
_ui.m_comNormal.m_txtTheme.text = string.Format("本期主题:{0}", themeCfg.theme);
|
|
_ui.m_comNormal.m_txtTheme.text = string.Format("本期主题:{0}", themeCfg.theme);
|
|
- _ui.m_comNormal.m_txtRank.text = string.Format("我的排名:{0}", PoemGalleryDataManager.Instance.MyRank);
|
|
|
|
|
|
+ _ui.m_comNormal.m_txtRank.text = string.Format("我的排名: {0}", PoemGalleryDataManager.Instance.MyRank > 0 ? PoemGalleryDataManager.Instance.MyRank.ToString() : "- -");
|
|
_ui.m_comNormal.m_txtRewardCount.text = string.Format("奖励次数:{0}/{1}", GameGlobal.myNumericComponent.GetAsInt(NumericType.LikeGalleryWorksCountDaily), GalleryRewardCfgArray.Instance.dataArray.Length);
|
|
_ui.m_comNormal.m_txtRewardCount.text = string.Format("奖励次数:{0}/{1}", GameGlobal.myNumericComponent.GetAsInt(NumericType.LikeGalleryWorksCountDaily), GalleryRewardCfgArray.Instance.dataArray.Length);
|
|
_ui.m_comNormal.m_txtTime.text = string.Format("截止日期:{0}", PoemGalleryDataManager.Instance.GetThemeTime());
|
|
_ui.m_comNormal.m_txtTime.text = string.Format("截止日期:{0}", PoemGalleryDataManager.Instance.GetThemeTime());
|
|
_ui.m_comNormal.m_grpResult.visible = PoemGalleryDataManager.Instance.IsResulting();
|
|
_ui.m_comNormal.m_grpResult.visible = PoemGalleryDataManager.Instance.IsResulting();
|
|
@@ -432,18 +438,7 @@ namespace GFGGame
|
|
PoemGalleryData data = PoemGalleryDataManager.Instance.GetGalleryDataById(workId);
|
|
PoemGalleryData data = PoemGalleryDataManager.Instance.GetGalleryDataById(workId);
|
|
UI_ListItem item = UI_ListItem.Proxy(obj);
|
|
UI_ListItem item = UI_ListItem.Proxy(obj);
|
|
|
|
|
|
- // if (data.Ntexture == null)
|
|
|
|
- // {
|
|
|
|
- // Timers.inst.StartCoroutine(PictureStorageHelper.DownloadFile(data.PictureTempUrl, (Texture2D texture) =>
|
|
|
|
- // {
|
|
|
|
- // data.Ntexture = new NTexture(texture);
|
|
|
|
- // item.m_loaIcon.texture = data.Ntexture;
|
|
|
|
- // }));
|
|
|
|
- // }
|
|
|
|
- // else
|
|
|
|
- // {
|
|
|
|
item.m_loaIcon.texture = data.Ntexture;
|
|
item.m_loaIcon.texture = data.Ntexture;
|
|
- // }
|
|
|
|
item.m_loaIcon.height = item.m_loaIcon.width * item.m_loaIcon.texture.height / item.m_loaIcon.texture.width;
|
|
item.m_loaIcon.height = item.m_loaIcon.width * item.m_loaIcon.texture.height / item.m_loaIcon.texture.width;
|
|
item.m_txtName.text = data.AuthorName;
|
|
item.m_txtName.text = data.AuthorName;
|
|
item.m_btnCollect.title = data.CollectCount.ToString();
|
|
item.m_btnCollect.title = data.CollectCount.ToString();
|
|
@@ -474,20 +469,9 @@ namespace GFGGame
|
|
long workId = _galleryDatas[index];
|
|
long workId = _galleryDatas[index];
|
|
PoemGalleryData data = PoemGalleryDataManager.Instance.GetGalleryDataById(workId);
|
|
PoemGalleryData data = PoemGalleryDataManager.Instance.GetGalleryDataById(workId);
|
|
UI_ListRankItem item = UI_ListRankItem.Proxy(obj);
|
|
UI_ListRankItem item = UI_ListRankItem.Proxy(obj);
|
|
- // if (data.Ntexture == null)
|
|
|
|
- // {
|
|
|
|
- // Timers.inst.StartCoroutine(PictureStorageHelper.DownloadFile(data.PictureTempUrl, (Texture2D texture) =>
|
|
|
|
- // {
|
|
|
|
- // data.Ntexture = new NTexture(texture);
|
|
|
|
- // item.m_loaIcon.texture = data.Ntexture;
|
|
|
|
- // }));
|
|
|
|
- // }
|
|
|
|
- // else
|
|
|
|
- // {
|
|
|
|
|
|
+
|
|
item.m_loaIcon.texture = data.Ntexture;
|
|
item.m_loaIcon.texture = data.Ntexture;
|
|
- // }
|
|
|
|
item.m_loaIcon.height = item.m_loaIcon.width * item.m_loaIcon.texture.height / item.m_loaIcon.texture.width;
|
|
item.m_loaIcon.height = item.m_loaIcon.width * item.m_loaIcon.texture.height / item.m_loaIcon.texture.width;
|
|
-
|
|
|
|
item.m_txtName.text = data.AuthorName;
|
|
item.m_txtName.text = data.AuthorName;
|
|
item.m_btnCollect.title = data.CollectCount.ToString();
|
|
item.m_btnCollect.title = data.CollectCount.ToString();
|
|
item.m_btnCollect.selected = data.CollectOrNot;
|
|
item.m_btnCollect.selected = data.CollectOrNot;
|
|
@@ -607,7 +591,7 @@ namespace GFGGame
|
|
// OnPullDownTimeComplete();
|
|
// OnPullDownTimeComplete();
|
|
if (result)
|
|
if (result)
|
|
{
|
|
{
|
|
- Timers.inst.StartCoroutine(PictureStorageHelper.Download(_galleryDatas, 0));
|
|
|
|
|
|
+ Timers.inst.StartCoroutine(PictureStorageHelper.Download(_galleryDatas, 0, UpdateGalleryList));
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
@@ -633,7 +617,7 @@ namespace GFGGame
|
|
// OnPullUpTimeComplete();
|
|
// OnPullUpTimeComplete();
|
|
if (result)
|
|
if (result)
|
|
{
|
|
{
|
|
- Timers.inst.StartCoroutine(PictureStorageHelper.Download(_galleryDatas, _galleryDatas.Count));
|
|
|
|
|
|
+ Timers.inst.StartCoroutine(PictureStorageHelper.Download(_galleryDatas, _galleryDatas.Count, UpdateGalleryList));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|