| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: 第二世界 |
| | | // [ Date ]: Wednesday, November 22, 2017 |
| | | //-------------------------------------------------------- |
| | | |
| | | using Snxxz.UI; |
| | | using System; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using TableConfig; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | namespace Snxxz.UI { |
| | | |
| | | |
| | | public class ActivitySettleWin : Window |
| | | { |
| | | [SerializeField] List<ItemCell> activityItemCells=new List<ItemCell>(); |
| | | [SerializeField] RectTransform container_ActivityReward; |
| | | [SerializeField] GameObject activityNullReawrd; |
| | | [SerializeField] List<ItemCell> achieveItemCells=new List<ItemCell>(); |
| | | [SerializeField] RectTransform container_AchieveReward; |
| | | [SerializeField] GameObject achieveNullReawrd; |
| | | [SerializeField] Button rewardGetBtn; |
| | | |
| | | DungeonModel m_DungeonModel; |
| | | DungeonModel dungeonModel { |
| | | get { |
| | | return m_DungeonModel ?? (m_DungeonModel = ModelCenter.Instance.GetModel<DungeonModel>()); |
| | | } |
| | | } |
| | | |
| | | ItemTipsModel _itemTipsModel; |
| | | ItemTipsModel itemTipsModel |
| | | { |
| | | get |
| | | { |
| | | return _itemTipsModel ?? (_itemTipsModel = ModelCenter.Instance.GetModel<ItemTipsModel>()); |
| | | } |
| | | } |
| | | |
| | | #region Built-in |
| | | protected override void BindController() |
| | | { |
| | | } |
| | | |
| | | protected override void AddListeners() |
| | | { |
| | | rewardGetBtn.onClick.AddListener(CloseClick); |
| | | } |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | ShowActivityReward(); |
| | | } |
| | | |
| | | protected override void OnAfterOpen() |
| | | { |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | dungeonModel.dungeonResult = default(DungeonResult); |
| | | } |
| | | |
| | | protected override void OnAfterClose() |
| | | { |
| | | } |
| | | #endregion |
| | | |
| | | void ShowActivityReward() |
| | | { |
| | | foreach (var item in achieveItemCells) { |
| | | item.gameObject.SetActive(false); |
| | | } |
| | | foreach (var item in activityItemCells) { |
| | | item.gameObject.SetActive(false); |
| | | } |
| | | var actiivityItems = dungeonModel.dungeonResult.itemInfo; |
| | | bool hasReward = actiivityItems != null && actiivityItems.Length > 0; |
| | | container_ActivityReward.gameObject.SetActive(hasReward); |
| | | activityNullReawrd.SetActive(!hasReward); |
| | | if (hasReward) { |
| | | for (int i = 0; i < actiivityItems.Length; i++) { |
| | | activityItemCells[i].gameObject.SetActive(true); |
| | | ItemCell itemCell = activityItemCells[i]; |
| | | ServerItem serverItem = actiivityItems[i]; |
| | | ItemCellModel cellModel = new ItemCellModel(serverItem.ItemID,false,(ulong)serverItem.Count,serverItem.IsBind |
| | | ,"",PackType.rptDeleted,false,ConfigParse.Analysis(serverItem.UserData)); |
| | | itemCell.Init(cellModel); |
| | | itemCell.cellBtn.RemoveAllListeners(); |
| | | itemCell.cellBtn.AddListener(() => { |
| | | ShowItemDetails(serverItem); |
| | | }); |
| | | } |
| | | } |
| | | |
| | | var achieveItems = dungeonModel.dungeonResult.succItemInfo; |
| | | hasReward = achieveItems != null && achieveItems.Length > 0; |
| | | container_AchieveReward.gameObject.SetActive(hasReward); |
| | | achieveNullReawrd.SetActive(!hasReward); |
| | | if (hasReward) { |
| | | for (int i = 0; i < achieveItems.Length; i++) { |
| | | achieveItemCells[i].gameObject.SetActive(true); |
| | | ItemCell itemCell = achieveItemCells[i]; |
| | | ServerItem serverItem = achieveItems[i]; |
| | | ItemCellModel cellModel = new ItemCellModel(serverItem.ItemID,false,(ulong)serverItem.Count, serverItem.IsBind |
| | | ,"" ,PackType.rptDeleted,false,ConfigParse.Analysis(serverItem.UserData)); |
| | | itemCell.Init(cellModel); |
| | | itemCell.cellBtn.RemoveAllListeners(); |
| | | itemCell.cellBtn.AddListener(() => { |
| | | ShowItemDetails(serverItem); |
| | | }); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | private void ShowItemDetails(ServerItem serverItem) |
| | | { |
| | | //ItemWinModel itemWinModel = ItemCommonCtrl.Instance.OnSingleClickItemCell(serverItem.ItemID); |
| | | //itemWinModel.itemCount = serverItem.ItemCount; |
| | | //itemWinModel.isSuite = serverItem.IsSuite; |
| | | //itemWinModel.isBind = serverItem.IsBind; |
| | | //itemWinModel.userDataDict = serverItem.UserData == null ? null : ConfigParse.Analysis(serverItem.UserData); |
| | | //ItemPopModel.Instance.SetDefaultShowUIDict(itemWinModel, false); |
| | | //itemWinModel.SetShowWin(itemWinModel); |
| | | ItemAttrData attrData = new ItemAttrData(serverItem.ItemID,false, (ulong)serverItem.Count,-1,serverItem.IsBind |
| | | ,false,PackType.rptDeleted,"", ConfigParse.Analysis(serverItem.UserData)); |
| | | itemTipsModel.SetItemTipsModel(attrData); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | //--------------------------------------------------------
|
| | | // [Author]: 第二世界
|
| | | // [ Date ]: Wednesday, November 22, 2017
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using Snxxz.UI;
|
| | | using System;
|
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using TableConfig;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | |
|
| | |
|
| | | public class ActivitySettleWin : Window
|
| | | {
|
| | | [SerializeField] List<ItemCell> activityItemCells = new List<ItemCell>();
|
| | | [SerializeField] RectTransform container_ActivityReward;
|
| | | [SerializeField] GameObject activityNullReawrd;
|
| | | [SerializeField] List<ItemCell> achieveItemCells = new List<ItemCell>();
|
| | | [SerializeField] RectTransform container_AchieveReward;
|
| | | [SerializeField] GameObject achieveNullReawrd;
|
| | | [SerializeField] Button rewardGetBtn;
|
| | |
|
| | | DungeonModel m_DungeonModel;
|
| | | DungeonModel dungeonModel
|
| | | {
|
| | | get
|
| | | {
|
| | | return m_DungeonModel ?? (m_DungeonModel = ModelCenter.Instance.GetModel<DungeonModel>());
|
| | | }
|
| | | }
|
| | |
|
| | | ItemTipsModel _itemTipsModel;
|
| | | ItemTipsModel itemTipsModel
|
| | | {
|
| | | get
|
| | | {
|
| | | return _itemTipsModel ?? (_itemTipsModel = ModelCenter.Instance.GetModel<ItemTipsModel>());
|
| | | }
|
| | | }
|
| | |
|
| | | #region Built-in
|
| | | protected override void BindController()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void AddListeners()
|
| | | {
|
| | | rewardGetBtn.onClick.AddListener(CloseClick);
|
| | | }
|
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | ShowActivityReward();
|
| | | }
|
| | |
|
| | | protected override void OnAfterOpen()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void OnPreClose()
|
| | | {
|
| | | dungeonModel.dungeonResult = default(DungeonResult);
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | | {
|
| | | }
|
| | | #endregion
|
| | |
|
| | | void ShowActivityReward()
|
| | | {
|
| | | foreach (var item in achieveItemCells)
|
| | | {
|
| | | item.gameObject.SetActive(false);
|
| | | }
|
| | | foreach (var item in activityItemCells)
|
| | | {
|
| | | item.gameObject.SetActive(false);
|
| | | }
|
| | | var actiivityItems = dungeonModel.dungeonResult.itemInfo;
|
| | | bool hasReward = actiivityItems != null && actiivityItems.Length > 0;
|
| | | container_ActivityReward.gameObject.SetActive(hasReward);
|
| | | activityNullReawrd.SetActive(!hasReward);
|
| | | if (hasReward)
|
| | | {
|
| | | for (int i = 0; i < actiivityItems.Length; i++)
|
| | | {
|
| | | if (i < activityItemCells.Count)
|
| | | {
|
| | | activityItemCells[i].gameObject.SetActive(true);
|
| | | ItemCell itemCell = activityItemCells[i];
|
| | | ServerItem serverItem = actiivityItems[i];
|
| | | ItemCellModel cellModel = new ItemCellModel(serverItem.ItemID, false, (ulong)serverItem.Count, serverItem.IsBind
|
| | | , "", PackType.rptDeleted, false, ConfigParse.Analysis(serverItem.UserData));
|
| | | itemCell.Init(cellModel);
|
| | | itemCell.cellBtn.RemoveAllListeners();
|
| | | itemCell.cellBtn.AddListener(() =>
|
| | | {
|
| | | ShowItemDetails(serverItem);
|
| | | });
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | var achieveItems = dungeonModel.dungeonResult.succItemInfo;
|
| | | hasReward = achieveItems != null && achieveItems.Length > 0;
|
| | | container_AchieveReward.gameObject.SetActive(hasReward);
|
| | | achieveNullReawrd.SetActive(!hasReward);
|
| | | if (hasReward)
|
| | | {
|
| | | for (int i = 0; i < achieveItems.Length; i++)
|
| | | {
|
| | | if (i < achieveItemCells.Count)
|
| | | {
|
| | | achieveItemCells[i].gameObject.SetActive(true);
|
| | | ItemCell itemCell = achieveItemCells[i];
|
| | | ServerItem serverItem = achieveItems[i];
|
| | | ItemCellModel cellModel = new ItemCellModel(serverItem.ItemID, false, (ulong)serverItem.Count, serverItem.IsBind
|
| | | , "", PackType.rptDeleted, false, ConfigParse.Analysis(serverItem.UserData));
|
| | | itemCell.Init(cellModel);
|
| | | itemCell.cellBtn.RemoveAllListeners();
|
| | | itemCell.cellBtn.AddListener(() =>
|
| | | {
|
| | | ShowItemDetails(serverItem);
|
| | | });
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | private void ShowItemDetails(ServerItem serverItem)
|
| | | {
|
| | | ItemAttrData attrData = new ItemAttrData(serverItem.ItemID, false, (ulong)serverItem.Count, -1, serverItem.IsBind
|
| | | , false, PackType.rptDeleted, "", ConfigParse.Analysis(serverItem.UserData));
|
| | | itemTipsModel.SetItemTipsModel(attrData);
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|