|
@@ -9,6 +9,7 @@ namespace GFGGame
|
|
|
public class PoemPhotoPreView : BaseWindow
|
|
|
{
|
|
|
private UI_PoemPhotoPreviewUI _ui;
|
|
|
+ private GList _list;
|
|
|
private List<PoemPhotoData> _photoInfos;
|
|
|
private int _curIndex = 0;
|
|
|
private int _sourceType = 0;
|
|
@@ -37,6 +38,11 @@ namespace GFGGame
|
|
|
_ui.m_list.SetVirtual();
|
|
|
_ui.m_list.itemRenderer = RenderListItem;
|
|
|
_ui.m_list.scrollPane.onScrollEnd.Add(OnListScrollEnd);
|
|
|
+
|
|
|
+ _ui.m_listTravel.SetVirtual();
|
|
|
+ _ui.m_listTravel.itemRenderer = RenderListTravelItem;
|
|
|
+ _ui.m_listTravel.scrollPane.onScrollEnd.Add(OnListScrollEnd);
|
|
|
+
|
|
|
_ui.m_btnLeft.onClick.Add(OnBtnLeftClick);
|
|
|
_ui.m_btnRight.onClick.Add(OnBtnRightClick);
|
|
|
_ui.m_btnLock.target.onClick.Add(OnBtnLockClick);
|
|
@@ -55,8 +61,20 @@ namespace GFGGame
|
|
|
_curIndex = (int)(this.viewData as object[])[0];
|
|
|
List<PoemPhotoData> photoInfos = (this.viewData as object[])[1] as List<PoemPhotoData>;
|
|
|
_photoInfos = new List<PoemPhotoData>(photoInfos.ToArray());
|
|
|
- _ui.m_list.numItems = _photoInfos.Count;
|
|
|
- _ui.m_list.height = _ui.m_list.GetChildAt(0).height;
|
|
|
+
|
|
|
+ _sourceType = (int)(this.viewData as object[])[2];
|
|
|
+ _ui.m_c1.selectedIndex = _sourceType;
|
|
|
+ if (_sourceType == (int)PictureSourceType.PersonalAlbum)
|
|
|
+ {
|
|
|
+ _list = _ui.m_list;
|
|
|
+ _list.numItems = _photoInfos.Count;
|
|
|
+ _list.height = _list.GetChildAt(0).height;
|
|
|
+ }
|
|
|
+ else if (_sourceType == (int)PictureSourceType.WanShuiQianShan)
|
|
|
+ {
|
|
|
+ _list = _ui.m_listTravel;
|
|
|
+ _list.numItems = _photoInfos.Count;
|
|
|
+ }
|
|
|
UpdateView();
|
|
|
}
|
|
|
|
|
@@ -80,12 +98,12 @@ namespace GFGGame
|
|
|
private void UpdateView(bool ani = false)
|
|
|
{
|
|
|
_ui.m_btnLeft.enabled = _curIndex > 0;
|
|
|
- _ui.m_btnRight.enabled = _curIndex < _ui.m_list.numItems - 1;
|
|
|
+ _ui.m_btnRight.enabled = _curIndex < _list.numItems - 1;
|
|
|
_ui.m_txtTime.text = TimeUtil.FormattingTime1(_photoInfos[_curIndex].CreationTime);
|
|
|
_ui.m_btnLock.m_c1.selectedIndex = _photoInfos[_curIndex].LockingStatus ? 1 : 0;
|
|
|
_ui.m_btnUp.m_c1.selectedIndex = _photoInfos[_curIndex].ToppingStatus ? 1 : 0;
|
|
|
|
|
|
- if (_ui.m_list.numItems > 0) _ui.m_list.ScrollToView(_curIndex, ani);
|
|
|
+ if (_list.numItems > 0) _list.ScrollToView(_curIndex, ani);
|
|
|
|
|
|
if (_ui.m_btnLock.target.data == null)
|
|
|
{
|
|
@@ -109,6 +127,27 @@ namespace GFGGame
|
|
|
|
|
|
UI_ListPhotoPreviewItem.ProxyEnd();
|
|
|
}
|
|
|
+ private void RenderListTravelItem(int index, GObject obj)
|
|
|
+ {
|
|
|
+ UI_ComPostcard item = UI_ComPostcard.Proxy(obj);
|
|
|
+
|
|
|
+ PoemPhotoData photoData = _photoInfos[_curIndex];
|
|
|
+ TravelLoactionCfg loactionCfg = TravelLoactionCfgArray.Instance.GetCfg(photoData.TravelLocationId);
|
|
|
+
|
|
|
+ item.m_comTravel.m_loaBg.url = ResPathUtil.GetTravelBgPath(loactionCfg.res);
|
|
|
+ item.m_txtLocationName.text = loactionCfg.name;
|
|
|
+ item.m_txtTime.text = TimeUtil.FormattingTime2(photoData.CreationTime);
|
|
|
+
|
|
|
+ if (photoData.TravelSuitId > 0)
|
|
|
+ {
|
|
|
+ TravelSuitCfg travelSuitCfg = TravelSuitCfgArray.Instance.GetCfg(photoData.TravelSuitId);
|
|
|
+ item.m_comTravel.m_loaRole.url = ResPathUtil.GetTravelRolePath(travelSuitCfg.reourcesArr[photoData.SuitResIndex]);
|
|
|
+ item.m_comTravel.m_loaRole.SetXY(loactionCfg.positionsArr[photoData.PositionIndex][0], loactionCfg.positionsArr[photoData.PositionIndex][1]);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ UI_ComPostcard.ProxyEnd();
|
|
|
+ }
|
|
|
|
|
|
private void OnBtnLeftClick()
|
|
|
{
|
|
@@ -121,13 +160,13 @@ namespace GFGGame
|
|
|
private void OnBtnRightClick()
|
|
|
{
|
|
|
_curIndex++;
|
|
|
- _curIndex = Mathf.Min(_ui.m_list.numItems - 1, _curIndex);
|
|
|
+ _curIndex = Mathf.Min(_list.numItems - 1, _curIndex);
|
|
|
|
|
|
UpdateView(true);
|
|
|
}
|
|
|
private void OnListScrollEnd()
|
|
|
{
|
|
|
- _curIndex = _ui.m_list.ChildIndexToItemIndex(0);
|
|
|
+ _curIndex = _list.ChildIndexToItemIndex(0);
|
|
|
UpdateView();
|
|
|
}
|
|
|
private void OnBtnLockClick()
|
|
@@ -196,7 +235,12 @@ namespace GFGGame
|
|
|
|
|
|
private void OnBtnShareClick()
|
|
|
{
|
|
|
- ViewManager.Show<PoemPhotoShareView>(_curPhotoData, new object[] { typeof(PoemPhotoPreView).FullName, new object[] { _curIndex, _photoInfos } });
|
|
|
+ if (_sourceType == (int)PictureSourceType.WanShuiQianShan)
|
|
|
+ {
|
|
|
+ PromptController.Instance.ShowFloatTextPrompt("暂时没有可以分享的对象");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ ViewManager.Show<PoemPhotoShareView>(_curPhotoData, new object[] { typeof(PoemPhotoPreView).FullName, new object[] { _curIndex, _photoInfos, _sourceType } });
|
|
|
}
|
|
|
}
|
|
|
}
|