|
@@ -47,6 +47,9 @@ namespace GFGGame
|
|
_ui.m_list.itemRenderer = RenderListItem;
|
|
_ui.m_list.itemRenderer = RenderListItem;
|
|
_ui.m_listTravel.SetVirtual();
|
|
_ui.m_listTravel.SetVirtual();
|
|
_ui.m_listTravel.itemRenderer = RenderListTravelItem;
|
|
_ui.m_listTravel.itemRenderer = RenderListTravelItem;
|
|
|
|
+
|
|
|
|
+ _ui.m_listCompetion.itemRenderer = RenderMatchingListItem;
|
|
|
|
+
|
|
_ui.m_btnRule.onClick.Add(RuleController.ShowRuleView);
|
|
_ui.m_btnRule.onClick.Add(RuleController.ShowRuleView);
|
|
_ui.m_btnRule.data = 300018;
|
|
_ui.m_btnRule.data = 300018;
|
|
|
|
|
|
@@ -120,6 +123,11 @@ namespace GFGGame
|
|
PromptController.Instance.ShowFloatTextPrompt("暂无明信片可删除");
|
|
PromptController.Instance.ShowFloatTextPrompt("暂无明信片可删除");
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
+ if (_ui.m_c1.selectedIndex == 2 && GetEnablePhotoNum(true) == 0)
|
|
|
|
+ {
|
|
|
|
+ PromptController.Instance.ShowFloatTextPrompt("暂无图片可删除");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
_ui.m_c2.selectedIndex = 1;
|
|
_ui.m_c2.selectedIndex = 1;
|
|
_ui.m_btnChooseAll.selected = false;
|
|
_ui.m_btnChooseAll.selected = false;
|
|
}
|
|
}
|
|
@@ -136,6 +144,11 @@ namespace GFGGame
|
|
PromptController.Instance.ShowFloatTextPrompt("暂无明信片可保存");
|
|
PromptController.Instance.ShowFloatTextPrompt("暂无明信片可保存");
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
+ if (_ui.m_c1.selectedIndex == 2 && _photoInfos.Count == 0)
|
|
|
|
+ {
|
|
|
|
+ PromptController.Instance.ShowFloatTextPrompt("暂无图片可保存");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
_ui.m_c2.selectedIndex = 2;
|
|
_ui.m_c2.selectedIndex = 2;
|
|
_ui.m_btnChooseAll.selected = false;
|
|
_ui.m_btnChooseAll.selected = false;
|
|
}
|
|
}
|
|
@@ -158,7 +171,7 @@ namespace GFGGame
|
|
_ui.m_list.numItems = _photoInfos.Count;
|
|
_ui.m_list.numItems = _photoInfos.Count;
|
|
_ui.m_txtCount.text = string.Format("{0}/{1}", _photoInfos.Count, GlobalCfgArray.globalCfg.maxPhotoCount);
|
|
_ui.m_txtCount.text = string.Format("{0}/{1}", _photoInfos.Count, GlobalCfgArray.globalCfg.maxPhotoCount);
|
|
}
|
|
}
|
|
- else
|
|
|
|
|
|
+ else if(_ui.m_c1.selectedIndex == 1)
|
|
{
|
|
{
|
|
_ui.m_list.numItems = 0;
|
|
_ui.m_list.numItems = 0;
|
|
|
|
|
|
@@ -167,6 +180,18 @@ namespace GFGGame
|
|
_ui.m_listTravel.numItems = _photoInfos.Count;
|
|
_ui.m_listTravel.numItems = _photoInfos.Count;
|
|
_ui.m_txtCount.text = string.Format("{0}/{1}", _photoInfos.Count, RoleDataManager.WanShuiQianShanMaxStorageCount);
|
|
_ui.m_txtCount.text = string.Format("{0}/{1}", _photoInfos.Count, RoleDataManager.WanShuiQianShanMaxStorageCount);
|
|
}
|
|
}
|
|
|
|
+ else if(_ui.m_c1.selectedIndex == 2)
|
|
|
|
+ {
|
|
|
|
+ _ui.m_list.numItems = 0;
|
|
|
|
+ _ui.m_listTravel.numItems = 0;
|
|
|
|
+
|
|
|
|
+ _photoInfos = MatchingCompetitionDataManager.Instance.MatchingPhotoInfos;
|
|
|
|
+ _sourceType = 2;
|
|
|
|
+ _ui.m_listCompetion.numItems = _photoInfos.Count;
|
|
|
|
+ _ui.m_txtCount.text = "";
|
|
|
|
+
|
|
|
|
+ _ui.m_btnDelete.visible = false;
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
_ui.m_btnConfirmDelete.title = string.Format("删除 {0}/{1}", _listChoose.Count, _photoInfos.Count);
|
|
_ui.m_btnConfirmDelete.title = string.Format("删除 {0}/{1}", _listChoose.Count, _photoInfos.Count);
|
|
@@ -257,7 +282,50 @@ namespace GFGGame
|
|
item.m_comTravel.target.data = index;
|
|
item.m_comTravel.target.data = index;
|
|
UI_ComPhotoPostcard.ProxyEnd();
|
|
UI_ComPhotoPostcard.ProxyEnd();
|
|
}
|
|
}
|
|
|
|
+ private void RenderMatchingListItem(int index, GObject obj)
|
|
|
|
+ {
|
|
|
|
+ UI_ListPhotoItem item = UI_ListPhotoItem.Proxy(obj);
|
|
|
|
+ if (_ui.m_c2.selectedIndex != 0 && _listChoose.IndexOf(_photoInfos[index].PictureId) >= 0)
|
|
|
|
+ {
|
|
|
|
+ item.m_c1.SetSelectedIndex(1);
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ item.m_c1.SetSelectedIndex(0);
|
|
|
|
+ }
|
|
|
|
+ GLoader loaIcon = item.m_comIcon.m_loaIcon;
|
|
|
|
+ loaIcon.visible = true;
|
|
|
|
+ if (_photoInfos[index].Ntexture == null)
|
|
|
|
+ {
|
|
|
|
+ loaIcon.visible = false;
|
|
|
|
+ }
|
|
|
|
+ loaIcon.texture = _photoInfos[index].Ntexture;
|
|
|
|
+
|
|
|
|
+ string[] timeStr = TimeUtil.FormattingTime1(_photoInfos[index].CreationTime, '/').Split(' ');
|
|
|
|
+ item.m_txtTime.text = timeStr[0];
|
|
|
|
+
|
|
|
|
+ //item.m_txtTime.visible = false;
|
|
|
|
+ item.m_btnLock.m_c1.selectedIndex = _photoInfos[index].LockingStatus ? 1 : 0;
|
|
|
|
+ item.m_btnUp.m_c1.selectedIndex = _photoInfos[index].ToppingStatus ? 1 : 0;
|
|
|
|
+ if (item.m_btnLock.target.data == null)
|
|
|
|
+ {
|
|
|
|
+ item.m_btnLock.target.onClick.Add(OnBtnMatchingLockClick);
|
|
|
|
+ }
|
|
|
|
+ item.m_btnLock.target.data = index;
|
|
|
|
|
|
|
|
+ if (item.m_btnUp.target.data == null)
|
|
|
|
+ {
|
|
|
|
+ item.m_btnUp.target.onClick.Add(OnBtnMatchingUpClick);
|
|
|
|
+ }
|
|
|
|
+ item.m_btnUp.target.data = index;
|
|
|
|
+
|
|
|
|
+ if (item.m_comIcon.target.data == null)
|
|
|
|
+ {
|
|
|
|
+ item.m_comIcon.target.onClick.Add(OnMatchingLoaIconClick);
|
|
|
|
+ }
|
|
|
|
+ item.m_comIcon.target.data = index;
|
|
|
|
+ UI_ListPhotoItem.ProxyEnd();
|
|
|
|
+ }
|
|
private void OnLoaIconClick(EventContext context)
|
|
private void OnLoaIconClick(EventContext context)
|
|
{
|
|
{
|
|
GObject obj = context.sender as GObject;
|
|
GObject obj = context.sender as GObject;
|
|
@@ -309,6 +377,57 @@ namespace GFGGame
|
|
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ private void OnMatchingLoaIconClick(EventContext context)
|
|
|
|
+ {
|
|
|
|
+ GObject obj = context.sender as GObject;
|
|
|
|
+ int index = (int)obj.data;
|
|
|
|
+ PoemPhotoData photoData = _photoInfos[index];
|
|
|
|
+ if (_ui.m_c2.selectedIndex == 0)
|
|
|
|
+ {
|
|
|
|
+ ViewManager.Show<PoemPhotoPreView>(new object[] { index, _photoInfos, _sourceType });
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ if (_ui.m_c2.selectedIndex == 1)
|
|
|
|
+ {
|
|
|
|
+ if (photoData.LockingStatus)
|
|
|
|
+ {
|
|
|
|
+ PromptController.Instance.ShowFloatTextPrompt("锁定的照片无法删除");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ if (photoData.ToppingStatus)
|
|
|
|
+ {
|
|
|
|
+ PromptController.Instance.ShowFloatTextPrompt("置顶的照片无法删除");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ UI_ListPhotoItem item = UI_ListPhotoItem.Proxy(obj.parent);
|
|
|
|
+
|
|
|
|
+ item.m_c1.selectedIndex ^= 1;
|
|
|
|
+ if (item.m_c1.selectedIndex == 1)
|
|
|
|
+ {
|
|
|
|
+ _listChoose.Add(photoData.PictureId);
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ _listChoose.Remove(photoData.PictureId);
|
|
|
|
+ }
|
|
|
|
+ UI_ListPhotoItem.ProxyEnd();
|
|
|
|
+
|
|
|
|
+ if (_ui.m_c2.selectedIndex == 1)
|
|
|
|
+ {
|
|
|
|
+ _ui.m_btnConfirmDelete.title = string.Format("删除({0}/{1})", _listChoose.Count, _photoInfos.Count);
|
|
|
|
+ _ui.m_btnChooseAll.selected = (GetEnablePhotoNum(true) == _listChoose.Count);
|
|
|
|
+ }
|
|
|
|
+ else if (_ui.m_c2.selectedIndex == 2)
|
|
|
|
+ {
|
|
|
|
+ _ui.m_btnConfirmSave.title = string.Format("保存({0}/{1})", _listChoose.Count, _photoInfos.Count);
|
|
|
|
+ _ui.m_btnChooseAll.selected = (GetEnablePhotoNum(false) == _listChoose.Count);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ }
|
|
private void OnBtnConfirmDeleteClick()
|
|
private void OnBtnConfirmDeleteClick()
|
|
{
|
|
{
|
|
if (_listChoose.Count == 0)
|
|
if (_listChoose.Count == 0)
|
|
@@ -319,11 +438,24 @@ namespace GFGGame
|
|
AlertUI.Show("删除后的照片无法恢复,是否确认删除?")
|
|
AlertUI.Show("删除后的照片无法恢复,是否确认删除?")
|
|
.SetLeftButton(true, "否").SetRightButton(true, "是", async (object data) =>
|
|
.SetLeftButton(true, "否").SetRightButton(true, "是", async (object data) =>
|
|
{
|
|
{
|
|
- bool result = await PoemPhotoSProxy.ReqRemovedPhoto(_listChoose, _sourceType);
|
|
|
|
- if (result)
|
|
|
|
|
|
+
|
|
|
|
+ if (_ui.m_c2.selectedIndex != 2)
|
|
|
|
+ {
|
|
|
|
+ bool result = await PoemPhotoSProxy.ReqRemovedPhoto(_listChoose, _sourceType);
|
|
|
|
+ if (result)
|
|
|
|
+ {
|
|
|
|
+ _listChoose.Clear();
|
|
|
|
+ OnBtnTabChange();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ else
|
|
{
|
|
{
|
|
- _listChoose.Clear();
|
|
|
|
- OnBtnTabChange();
|
|
|
|
|
|
+ bool result = await MatchingCompetitionSproxy.ReqRemovedPhoto(_listChoose, _sourceType);
|
|
|
|
+ if (result)
|
|
|
|
+ {
|
|
|
|
+ _listChoose.Clear();
|
|
|
|
+ OnBtnTabChange();
|
|
|
|
+ }
|
|
}
|
|
}
|
|
});
|
|
});
|
|
}
|
|
}
|
|
@@ -358,7 +490,36 @@ namespace GFGGame
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
|
|
+ private void OnBtnMatchingLockClick(EventContext context)
|
|
|
|
+ {
|
|
|
|
+ if (_ui.m_c2.selectedIndex != 0)
|
|
|
|
+ {
|
|
|
|
+ //PromptController.Instance.ShowFloatTextPrompt("删除状态无法操作");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ GObject item = context.sender as GObject;
|
|
|
|
+ int index = (int)item.data;
|
|
|
|
+ PoemPhotoData photoData = _photoInfos[index];
|
|
|
|
+ if (photoData.LockingStatus == false)
|
|
|
|
+ {
|
|
|
|
+ AlertUI.Show("是否确认锁定此照片?", "(锁定的照片无法被删除)")
|
|
|
|
+ .SetLeftButton(true, "否").SetRightButton(true, "是", (object data) =>
|
|
|
|
+ {
|
|
|
|
+ MatchingCompetitionSproxy.ReqChangeLockingState(photoData.PictureId, true, _sourceType).Coroutine();
|
|
|
|
+
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ AlertUI.Show("是否确认解锁此照片?", "(解锁后的照片可随意删除)")
|
|
|
|
+ .SetLeftButton(true, "否").SetRightButton(true, "是", (object data) =>
|
|
|
|
+ {
|
|
|
|
+ MatchingCompetitionSproxy.ReqChangeLockingState(photoData.PictureId, false, _sourceType).Coroutine();
|
|
|
|
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
private void OnBtnUpClick(EventContext context)
|
|
private void OnBtnUpClick(EventContext context)
|
|
{
|
|
{
|
|
if (_ui.m_c2.selectedIndex != 0)
|
|
if (_ui.m_c2.selectedIndex != 0)
|
|
@@ -388,6 +549,35 @@ namespace GFGGame
|
|
});
|
|
});
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ private void OnBtnMatchingUpClick(EventContext context)
|
|
|
|
+ {
|
|
|
|
+ if (_ui.m_c2.selectedIndex != 0)
|
|
|
|
+ {
|
|
|
|
+ //PromptController.Instance.ShowFloatTextPrompt("删除状态无法操作");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ GObject item = context.sender as GObject;
|
|
|
|
+ int index = (int)item.data;
|
|
|
|
+ PoemPhotoData photoData = _photoInfos[index];
|
|
|
|
+ if (photoData.ToppingStatus == false)
|
|
|
|
+ {
|
|
|
|
+ AlertUI.Show("是否确认置顶此照片?")
|
|
|
|
+ .SetLeftButton(true, "否").SetRightButton(true, "是", (object data) =>
|
|
|
|
+ {
|
|
|
|
+ MatchingCompetitionSproxy.ReqChangeToppingState(photoData.PictureId, true, _sourceType).Coroutine();
|
|
|
|
+
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ AlertUI.Show("是否确认取消置顶此照片?")
|
|
|
|
+ .SetLeftButton(true, "否").SetRightButton(true, "是", (object data) =>
|
|
|
|
+ {
|
|
|
|
+ MatchingCompetitionSproxy.ReqChangeToppingState(photoData.PictureId, false, _sourceType).Coroutine();
|
|
|
|
+
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ }
|
|
private void CheckGuide(object param)
|
|
private void CheckGuide(object param)
|
|
{
|
|
{
|
|
if (GuideDataManager.IsGuideFinish(ConstGuideId.POEM) <= 0)
|
|
if (GuideDataManager.IsGuideFinish(ConstGuideId.POEM) <= 0)
|