|
@@ -150,7 +150,14 @@ namespace GFGGame
|
|
|
if (_ui.m_comFavorites.m_comScroll.m_listRecommend.numItems > 0) _ui.m_comFavorites.m_comScroll.m_listRecommend.ScrollToView(0);
|
|
|
if (_ui.m_comFavorites.m_comScroll.m_listRecommend1.numItems > 0) _ui.m_comFavorites.m_comScroll.m_listRecommend1.ScrollToView(0);
|
|
|
|
|
|
+ _ui.m_comNormal.m_comScroll.m_listRecommend.numItems = 0;
|
|
|
+ _ui.m_comNormal.m_comScroll.m_listRecommend1.numItems = 0;
|
|
|
+ _ui.m_comFavorites.m_comScroll.m_listRecommend.numItems = 0;
|
|
|
+ _ui.m_comFavorites.m_comScroll.m_listRecommend1.numItems = 0;
|
|
|
+
|
|
|
+ OnFavoritesTabChange();
|
|
|
OnNormalTabChange();
|
|
|
+
|
|
|
}
|
|
|
|
|
|
_ui.m_c1.selectedIndex = _tabIndex;
|
|
@@ -164,6 +171,7 @@ namespace GFGGame
|
|
|
base.OnHide();
|
|
|
ResetPullRelease();
|
|
|
_ui.m_comNormal.m_comBoBox.selectedIndex = 0;
|
|
|
+
|
|
|
}
|
|
|
|
|
|
protected override void RemoveEventListener()
|
|
@@ -215,6 +223,7 @@ namespace GFGGame
|
|
|
_tabIndex = _ui.m_c1.selectedIndex;
|
|
|
_subtabIndex = _ui.m_comNormal.m_c1.selectedIndex;
|
|
|
_comScroll = _ui.m_comNormal.m_comScroll.target;
|
|
|
+
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -231,15 +240,14 @@ namespace GFGGame
|
|
|
/// </summary>
|
|
|
private void OnBtnFavoritesClick()
|
|
|
{
|
|
|
- ResetPullRelease();
|
|
|
+ if (_tabIndex == TabType.FAVORITES) return;
|
|
|
|
|
|
+ ResetPullRelease();
|
|
|
_tabIndex = _ui.m_c1.selectedIndex;
|
|
|
_comScroll = _ui.m_comFavorites.m_comScroll.target;
|
|
|
- if (_ui.m_comFavorites.m_c1.selectedIndex != FavoritesType.FAVORITE)
|
|
|
- {
|
|
|
- _ui.m_comFavorites.m_c1.selectedIndex = FavoritesType.FAVORITE;
|
|
|
- }
|
|
|
+ _ui.m_comFavorites.m_c1.selectedIndex = FavoritesType.FAVORITE;
|
|
|
_subtabIndex = _ui.m_comFavorites.m_c1.selectedIndex;
|
|
|
+ OnFavoritesTabChange();
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -292,15 +300,15 @@ namespace GFGGame
|
|
|
if (_ui.m_comFavorites.m_c1.selectedIndex == FavoritesType.FAVORITE)//我的收藏
|
|
|
{
|
|
|
_sortType = (int)GallerySortType.MyCollect;
|
|
|
- _galleryDatas = PoemGalleryDataManager.Instance.FrinedDatas;
|
|
|
+ _galleryDatas = PoemGalleryDataManager.Instance.FavoriteDatas;
|
|
|
}
|
|
|
else if (_ui.m_comFavorites.m_c1.selectedIndex == FavoritesType.MY_SELF)//我的作品
|
|
|
{
|
|
|
_sortType = (int)GallerySortType.MyWorks;
|
|
|
- _galleryDatas = PoemGalleryDataManager.Instance.FrinedDatas;
|
|
|
+ _galleryDatas = PoemGalleryDataManager.Instance.MySelfDatas;
|
|
|
}
|
|
|
- _list = _ui.m_comNormal.m_comScroll.m_listRecommend;
|
|
|
- _list1 = _ui.m_comNormal.m_comScroll.m_listRecommend1;
|
|
|
+ _list = _ui.m_comFavorites.m_comScroll.m_listRecommend;
|
|
|
+ _list1 = _ui.m_comFavorites.m_comScroll.m_listRecommend1;
|
|
|
if (_list.numItems > 0) _list.ScrollToView(0);
|
|
|
if (_list1.numItems > 0) _list.ScrollToView(0);
|
|
|
ReqGalleryList(0);
|
|
@@ -327,15 +335,22 @@ namespace GFGGame
|
|
|
}
|
|
|
private void UpdateGalleryList()
|
|
|
{
|
|
|
- if (_galleryDatas.Count % 2 == 0)
|
|
|
+ if (_ui.m_comNormal.m_c1.selectedIndex == RecommendType.RANK)
|
|
|
{
|
|
|
- _list.numItems = _galleryDatas.Count / 2;
|
|
|
- _list1.numItems = _galleryDatas.Count / 2;
|
|
|
+ _ui.m_comNormal.m_listRank.numItems = _galleryDatas.Count;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- _list.numItems = (_galleryDatas.Count + 1) / 2;
|
|
|
- _list1.numItems = (_galleryDatas.Count - 1) / 2;
|
|
|
+ if (_galleryDatas.Count % 2 == 0)
|
|
|
+ {
|
|
|
+ _list.numItems = _galleryDatas.Count / 2;
|
|
|
+ _list1.numItems = _galleryDatas.Count / 2;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ _list.numItems = (_galleryDatas.Count + 1) / 2;
|
|
|
+ _list1.numItems = (_galleryDatas.Count - 1) / 2;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
_list.ResizeToFit();
|
|
@@ -355,19 +370,19 @@ namespace GFGGame
|
|
|
UpdateView();
|
|
|
}
|
|
|
|
|
|
- private void RefreshList()
|
|
|
- {
|
|
|
- if (_ui.m_comNormal.m_c1.selectedIndex == RecommendType.RANK)
|
|
|
- {
|
|
|
- _ui.m_comNormal.m_listRank.RefreshVirtualList();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- _list.RefreshVirtualList();
|
|
|
- _list1.RefreshVirtualList();
|
|
|
- }
|
|
|
- UpdateView();
|
|
|
- }
|
|
|
+ // private void RefreshList()
|
|
|
+ // {
|
|
|
+ // if (_ui.m_comNormal.m_c1.selectedIndex == RecommendType.RANK)
|
|
|
+ // {
|
|
|
+ // _ui.m_comNormal.m_listRank.numItems = _galleryDatas.Count;
|
|
|
+ // }
|
|
|
+ // else
|
|
|
+ // {
|
|
|
+ // _list.numItems = _galleryDatas.Count;
|
|
|
+ // _list1.numItems = _galleryDatas.Count;
|
|
|
+ // }
|
|
|
+ // UpdateView();
|
|
|
+ // }
|
|
|
|
|
|
|
|
|
/********************************************************界面更新*************************************************/
|
|
@@ -377,7 +392,7 @@ namespace GFGGame
|
|
|
_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_txtRewardCount.text = string.Format("奖励次数:{0}/{1}", PoemGalleryDataManager.Instance.VoteCount, GalleryRewardCfgArray.Instance.dataArray.Length);
|
|
|
- _ui.m_comNormal.m_txtTime.text = PoemGalleryDataManager.Instance.GetThemeTime();
|
|
|
+ _ui.m_comNormal.m_txtTime.text = string.Format("截止日期:{0}", PoemGalleryDataManager.Instance.GetThemeTime());
|
|
|
_ui.m_comNormal.m_grpResult.visible = PoemGalleryDataManager.Instance.IsResulting();
|
|
|
}
|
|
|
|
|
@@ -399,19 +414,19 @@ namespace GFGGame
|
|
|
PoemGalleryData data = PoemGalleryDataManager.Instance.GetGalleryDataById(workId);
|
|
|
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.height = item.m_loaIcon.width * item.m_loaIcon.texture.height / item.m_loaIcon.texture.width;
|
|
|
+ // 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.height = item.m_loaIcon.width * item.m_loaIcon.texture.height / item.m_loaIcon.texture.width;
|
|
|
item.m_txtName.text = data.AuthorName;
|
|
|
item.m_btnCollect.title = data.CollectCount.ToString();
|
|
|
item.m_btnCollect.selected = data.CollectOrNot;
|
|
@@ -441,31 +456,42 @@ namespace GFGGame
|
|
|
long workId = _galleryDatas[index];
|
|
|
PoemGalleryData data = PoemGalleryDataManager.Instance.GetGalleryDataById(workId);
|
|
|
UI_ListRankItem item = UI_ListRankItem.Proxy(obj);
|
|
|
-
|
|
|
- // item.target.height = item.m_loaIcon.height + 80;
|
|
|
- // item.m_loaIcon.texture = data.Ntexture;
|
|
|
- // item.m_txtName.text = data.AuthorName;
|
|
|
- // item.m_btnCollect.title = data.CollectCount.ToString();
|
|
|
- // item.m_btnCollect.selected = data.CollectOrNot;
|
|
|
- // item.m_btnVote.title = data.VoteCount.ToString();
|
|
|
- // item.m_btnVote.selected = data.VoteOrNot;
|
|
|
- // item.m_c1.selectedIndex = index < 3 ? index : 3;
|
|
|
-
|
|
|
- // if (item.m_loaIcon.data == null)
|
|
|
+ // if (data.Ntexture == null)
|
|
|
// {
|
|
|
- // item.m_loaIcon.onClick.Add(OnLoaIconClick);
|
|
|
+ // Timers.inst.StartCoroutine(PictureStorageHelper.DownloadFile(data.PictureTempUrl, (Texture2D texture) =>
|
|
|
+ // {
|
|
|
+ // data.Ntexture = new NTexture(texture);
|
|
|
+ // item.m_loaIcon.texture = data.Ntexture;
|
|
|
+ // }));
|
|
|
// }
|
|
|
- // item.m_loaIcon.data = workId;
|
|
|
- // if (item.m_btnCollect.data == null)
|
|
|
+ // else
|
|
|
// {
|
|
|
- // item.m_btnCollect.onClick.Add(OnBtnCollectClick);
|
|
|
+ // item.m_loaIcon.texture = data.Ntexture;
|
|
|
// }
|
|
|
- // item.m_btnCollect.data = workId;
|
|
|
- // if (item.m_btnVote.data == null)
|
|
|
- // {
|
|
|
- // item.m_btnVote.onClick.Add(OnBtnVoteClick);
|
|
|
- // }
|
|
|
- // item.m_btnVote.data = workId;
|
|
|
+ // 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_btnCollect.title = data.CollectCount.ToString();
|
|
|
+ item.m_btnCollect.selected = data.CollectOrNot;
|
|
|
+ item.m_btnVote.title = data.VoteCount.ToString();
|
|
|
+ item.m_btnVote.selected = data.VoteOrNot;
|
|
|
+ item.m_c1.selectedIndex = index < 3 ? index : 3;
|
|
|
+
|
|
|
+ if (item.m_loaIcon.data == null)
|
|
|
+ {
|
|
|
+ item.m_loaIcon.onClick.Add(OnLoaIconClick);
|
|
|
+ }
|
|
|
+ item.m_loaIcon.data = workId;
|
|
|
+ if (item.m_btnCollect.data == null)
|
|
|
+ {
|
|
|
+ item.m_btnCollect.onClick.Add(OnBtnCollectClick);
|
|
|
+ }
|
|
|
+ item.m_btnCollect.data = workId;
|
|
|
+ if (item.m_btnVote.data == null)
|
|
|
+ {
|
|
|
+ item.m_btnVote.onClick.Add(OnBtnVoteClick);
|
|
|
+ }
|
|
|
+ item.m_btnVote.data = workId;
|
|
|
UI_ListRankItem.ProxyEnd();
|
|
|
}
|
|
|
|
|
@@ -473,7 +499,7 @@ namespace GFGGame
|
|
|
|
|
|
private void OnLoaIconClick(EventContext context)
|
|
|
{
|
|
|
- GObject obj = context.data as GObject;
|
|
|
+ GObject obj = context.sender as GObject;
|
|
|
long workId = (long)obj.data;
|
|
|
object[] gobackParamDatas = new object[] { _tabIndex, _subtabIndex, _ui.m_comNormal.m_comBoBox.selectedIndex };
|
|
|
ViewManager.Show<PoemGalleryPreviewView>(new object[] { _sortType, workId }, new object[] { typeof(PoemGalleryView).FullName, gobackParamDatas });
|
|
@@ -481,7 +507,7 @@ namespace GFGGame
|
|
|
|
|
|
private async void OnBtnCollectClick(EventContext context)
|
|
|
{
|
|
|
- GObject obj = context.data as GObject;
|
|
|
+ GObject obj = context.sender as GObject;
|
|
|
long workId = (long)obj.data;
|
|
|
PoemGalleryData galleryData = PoemGalleryDataManager.Instance.GetGalleryDataById(workId);
|
|
|
|
|
@@ -496,7 +522,7 @@ namespace GFGGame
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- RefreshList();
|
|
|
+ UpdateGalleryList();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -511,7 +537,7 @@ namespace GFGGame
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- RefreshList();
|
|
|
+ UpdateGalleryList();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -519,7 +545,7 @@ namespace GFGGame
|
|
|
|
|
|
private async void OnBtnVoteClick(EventContext context)
|
|
|
{
|
|
|
- GObject obj = context.data as GObject;
|
|
|
+ GObject obj = context.sender as GObject;
|
|
|
long workId = (long)obj.data;
|
|
|
PoemGalleryData galleryData = PoemGalleryDataManager.Instance.GetGalleryDataById(workId);
|
|
|
|
|
@@ -528,7 +554,7 @@ namespace GFGGame
|
|
|
if (result)
|
|
|
{
|
|
|
|
|
|
- RefreshList();
|
|
|
+ UpdateGalleryList();
|
|
|
|
|
|
int Count = GameGlobal.myNumericComponent.GetAsInt(NumericType.LikeGalleryWorksCountDaily);
|
|
|
GalleryIntegralCfg integralCfg = GalleryIntegralCfgArray.Instance.GetCfg(Count);
|