|
@@ -9,6 +9,7 @@ namespace GFGGame
|
|
public class PoemGalleryView : BaseWindow
|
|
public class PoemGalleryView : BaseWindow
|
|
{
|
|
{
|
|
private UI_PoemGalleryUI _ui;
|
|
private UI_PoemGalleryUI _ui;
|
|
|
|
+ private GList _list;
|
|
private List<PoemGalleryData> _galleryDatas = new List<PoemGalleryData>();
|
|
private List<PoemGalleryData> _galleryDatas = new List<PoemGalleryData>();
|
|
private int _infoType = 0;//0推荐1好友2收藏3我的
|
|
private int _infoType = 0;//0推荐1好友2收藏3我的
|
|
|
|
|
|
@@ -59,12 +60,14 @@ namespace GFGGame
|
|
{
|
|
{
|
|
base.AddEventListener();
|
|
base.AddEventListener();
|
|
|
|
|
|
- // EventAgent.AddEventListener(ConstMessage.GALLERY_DATA_CHANGE,)
|
|
|
|
|
|
+ EventAgent.AddEventListener(ConstMessage.GALLERY_DATA_CHANGE, UpdateGalleryList);
|
|
|
|
+ EventAgent.AddEventListener(ConstMessage.GALLERY_RANK_DATA_CHANGE, UpdateGalleryRankList);
|
|
}
|
|
}
|
|
protected override void OnShown()
|
|
protected override void OnShown()
|
|
{
|
|
{
|
|
base.OnShown();
|
|
base.OnShown();
|
|
|
|
|
|
|
|
+ _list = _ui.m_comNormal.m_listRecommend;
|
|
}
|
|
}
|
|
|
|
|
|
protected override void OnHide()
|
|
protected override void OnHide()
|
|
@@ -76,7 +79,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);
|
|
}
|
|
}
|
|
|
|
|
|
private void OnBtnBackClick()
|
|
private void OnBtnBackClick()
|
|
@@ -118,16 +122,26 @@ namespace GFGGame
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- if (_ui.m_comNormal.m_c1.selectedIndex == 0)//推荐
|
|
|
|
|
|
+ if (_ui.m_comNormal.m_c1.selectedIndex == 0)//首页
|
|
{
|
|
{
|
|
// _infoType = GalleryType.Recommend;
|
|
// _infoType = GalleryType.Recommend;
|
|
- // _galleryIds = PoemGalleryDataManager.Instance.RecommendInfos;
|
|
|
|
- _ui.m_comNormal.m_listRecommend.numItems = 5;
|
|
|
|
|
|
+ if (_ui.m_comNormal.m_comBoBox.selectedIndex == 0)//推荐
|
|
|
|
+ {
|
|
|
|
+ _infoType = (int)GallerySortType.Recommend;
|
|
|
|
+ _galleryDatas = PoemGalleryDataManager.Instance.RecommendDatas;
|
|
|
|
+ }
|
|
|
|
+ else//最新
|
|
|
|
+ {
|
|
|
|
+ _infoType = (int)GallerySortType.Newest;
|
|
|
|
+ _galleryDatas = PoemGalleryDataManager.Instance.NewestDatas;
|
|
|
|
+ }
|
|
|
|
+ _list = _ui.m_comNormal.m_listRecommend;
|
|
}
|
|
}
|
|
else if (_ui.m_comNormal.m_c1.selectedIndex == 1)//好友
|
|
else if (_ui.m_comNormal.m_c1.selectedIndex == 1)//好友
|
|
{
|
|
{
|
|
- // _infoType = GalleryType.Friend;
|
|
|
|
- // _galleryIds = PoemGalleryDataManager.Instance.FrinedInfos;
|
|
|
|
|
|
+ _infoType = (int)GallerySortType.Friend;
|
|
|
|
+ _galleryDatas = PoemGalleryDataManager.Instance.FrinedDatas;
|
|
|
|
+ _list = _ui.m_comNormal.m_listFriend;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -148,7 +162,16 @@ namespace GFGGame
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- // private void UpdateGallery
|
|
|
|
|
|
+ private void UpdateGalleryList()
|
|
|
|
+ {
|
|
|
|
+ _list.numItems = _galleryDatas.Count;
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ private void UpdateGalleryRankList()
|
|
|
|
+ {
|
|
|
|
+ _ui.m_comNormal.m_listRank.numItems = _galleryDatas.Count;
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|