Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | | using Snxxz.UI;
|
| | | // AA 19 许愿池活动信息 #tagMCActWishingWellInfo
|
| | |
|
| | | public class DTCAA19_tagMCActWishingWellInfo : DtcBasic {
|
| | | public override void Done(GameNetPackBasic vNetPack) {
|
| | | base.Done(vNetPack);
|
| | | HAA19_tagMCActWishingWellInfo vNetData = vNetPack as HAA19_tagMCActWishingWellInfo;
OperationTimeHepler.Instance.UpdateWishingWellInfo(vNetData);
|
| | | }
|
| | | }
|
| | | // AA 19 许愿池活动信息 #tagMCActWishingWellInfo
|
| | |
|
| | |
|
| | |
|
| | | public class DTCAA19_tagMCActWishingWellInfo : DtcBasic {
|
| | |
|
| | | public override void Done(GameNetPackBasic vNetPack) {
|
| | |
|
| | | base.Done(vNetPack);
|
| | |
|
| | | HAA19_tagMCActWishingWellInfo vNetData = vNetPack as HAA19_tagMCActWishingWellInfo;
|
| | | OperationTimeHepler.Instance.UpdateWishingWellInfo(vNetData);
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
| | | TransBytes (out WellItemInfo[i].ItemCnt, vBytes, NetDataType.WORD);
|
| | | TransBytes (out WellItemInfo[i].IsBind, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out WellItemInfo[i].Mark, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out WellItemInfo[i].Rare, vBytes, NetDataType.BYTE);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | public ushort ItemCnt; // 物品数量
|
| | | public byte IsBind; // 是否绑定
|
| | | public uint Mark; // 排序标识
|
| | | public byte Rare; // 珍稀值
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | {
|
| | | if(item.chinItemModel.EquipPlace == equipPlace)
|
| | | {
|
| | | if (!IsOverdue(item.itemInfo.ItemGUID, item.itemId)
|
| | | if (!IsOverdue(item.itemInfo.ItemGUID, item.itemId,item.useDataDict)
|
| | | && (item.chinItemModel.JobLimit == 0 || (item.chinItemModel.JobLimit / 100) == job) && item.equipScore > score)
|
| | | {
|
| | | guid = item.itemInfo.ItemGUID;
|
| | |
| | | for (int i = 0; i < package.Count; i++)
|
| | | {
|
| | | var itemInfo = package.WellItemInfo[i];
|
| | | var wellItem = new WishingWellItem((int)itemInfo.ItemID,itemInfo.ItemCnt,itemInfo.IsBind,(int)itemInfo.Mark);
|
| | | var wellItem = new WishingWellItem((int)itemInfo.ItemID,itemInfo.ItemCnt,itemInfo.IsBind,(int)itemInfo.Mark,itemInfo.Rare);
|
| | | int group = GetGroupTypeByMark(wellItem.mark);
|
| | | if(!wellItemDict.ContainsKey(group))
|
| | | {
|
| | |
| | | public int itemCount;
|
| | | public int isBind;
|
| | | public int mark;// 排序标识
|
| | | public WishingWellItem(int id, int count, int isBind,int mark)
|
| | | public int rare; //// 珍稀值
|
| | |
|
| | | public WishingWellItem(int id, int count, int isBind,int mark,int rare)
|
| | | {
|
| | | this.itemId = id;
|
| | | this.itemCount = count;
|
| | | this.isBind = isBind;
|
| | | this.mark = mark;
|
| | | this.rare = rare;
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | public class PoolItemCell : MonoBehaviour,IDragHandler
|
| | | {
|
| | | [SerializeField] CommonItemBaisc itemBaisc;
|
| | | [SerializeField] GameObject bestIconObj;
|
| | | [SerializeField] Image bestIcon;
|
| | | [SerializeField] Text nameText;
|
| | | ItemTipsModel tipsModel { get { return ModelCenter.Instance.GetModel<ItemTipsModel>(); } }
|
| | | WishingPoolModel wishingModel { get { return ModelCenter.Instance.GetModel<WishingPoolModel>(); } }
|
| | |
| | | ItemConfig itemConfig = Config.Instance.Get<ItemConfig>(wellItem.itemId);
|
| | | nameText.text = itemConfig.ItemName;
|
| | | nameText.color = UIHelper.GetUIColor(itemConfig.ItemColor);
|
| | | bestIconObj.SetActive(wellItem.isBest == 0 ? false : true);
|
| | | string rareIconKey = string.Empty;
|
| | | bool isRare = wishingModel.TryGetItemRareIcon(wellItem.rare,out rareIconKey);
|
| | | bestIcon.gameObject.SetActive(isRare);
|
| | | if(isRare)
|
| | | {
|
| | | bestIcon.SetSprite(rareIconKey);
|
| | | }
|
| | | ItemCellModel cellModel = new ItemCellModel(wellItem.itemId,false,(ulong)wellItem.itemCount,wellItem.isBind);
|
| | | itemBaisc.Init(cellModel);
|
| | | itemBaisc.cellBtn.RemoveAllListeners();
|
| | |
| | | poolItem.nameText.color = UIHelper.GetUIColor(itemConfig.ItemColor,true);
|
| | | ItemCellModel cellModel = new ItemCellModel(info.itemId,true,(ulong)info.itemCount,info.isBind);
|
| | | poolItem.itemBaisc.Init(cellModel);
|
| | | if(i == 0)
|
| | | string rareIconKey = string.Empty;
|
| | | bool isRare = wishModel.TryGetItemRareIcon(info.rare, out rareIconKey);
|
| | | poolItem.bestImg.gameObject.SetActive(isRare);
|
| | | if (isRare)
|
| | | {
|
| | | poolItem.bestImg.SetActive(true);
|
| | | poolItem.bestImg.SetSprite(rareIconKey);
|
| | | }
|
| | | else
|
| | | {
|
| | | poolItem.bestImg.SetActive(false);
|
| | | }
|
| | |
|
| | | poolItem.itemBaisc.cellBtn.RemoveAllListeners();
|
| | | poolItem.itemBaisc.cellBtn.AddListener(()=>
|
| | | {
|
| | |
| | | {
|
| | | public GameObject Object;
|
| | | public CommonItemBaisc itemBaisc;
|
| | | public GameObject bestImg;
|
| | | public Image bestImg;
|
| | | public Text nameText;
|
| | | }
|
| | | }
|
| | |
| | | [SerializeField] GameObject noneItemObj;
|
| | | [SerializeField] Button noneItemBtn;
|
| | | [SerializeField] Text nameText;
|
| | | [SerializeField] GameObject bestIconObj;
|
| | | [SerializeField] Image bestIcon;
|
| | | [SerializeField] GameObject contain_Name;
|
| | |
|
| | | ItemTipsModel tipsModel { get { return ModelCenter.Instance.GetModel<ItemTipsModel>(); } }
|
| | |
| | | contain_Name.SetActive(true);
|
| | | itemBaisc.gameObject.SetActive(true);
|
| | | noneItemObj.gameObject.SetActive(false);
|
| | | bestIconObj.SetActive(wellItem.isBest == 0 ? false : true);
|
| | | string rareIconKey = string.Empty;
|
| | | bool isRare = wishingModel.TryGetItemRareIcon(wellItem.rare, out rareIconKey);
|
| | | bestIcon.gameObject.SetActive(isRare);
|
| | | if (isRare)
|
| | | {
|
| | | bestIcon.SetSprite(rareIconKey);
|
| | | }
|
| | | ItemConfig itemConfig = Config.Instance.Get<ItemConfig>(wellItem.itemId);
|
| | | nameText.text = itemConfig.ItemName;
|
| | | nameText.color = UIHelper.GetUIColor(itemConfig.ItemColor);
|
| | |
| | | contain_Name.SetActive(false);
|
| | | itemBaisc.gameObject.SetActive(false);
|
| | | noneItemObj.gameObject.SetActive(true);
|
| | | bestIconObj.SetActive(false);
|
| | | bestIcon.gameObject.SetActive(false);
|
| | | noneItemBtn.AddListener(()=>
|
| | | {
|
| | | wishingModel.SetHandMovePos(index);
|
| | |
| | | ItemCellModel cellModel = new ItemCellModel((int)wellItem.itemId, true
|
| | | , (ulong)wellItem.itemCount, wellItem.isBind);
|
| | | awardItem.itemBaisc.Init(cellModel);
|
| | | awardItem.bestIconObj.SetActive(wellItem.isBest == 0 ? false : true);
|
| | | string rareIconKey = string.Empty;
|
| | | bool isRare = wishModel.TryGetItemRareIcon(wellItem.rare, out rareIconKey);
|
| | | awardItem.bestIcon.gameObject.SetActive(isRare);
|
| | | if (isRare)
|
| | | {
|
| | | awardItem.bestIcon.SetSprite(rareIconKey);
|
| | | }
|
| | | awardItem.itemBaisc.cellBtn.RemoveAllListeners();
|
| | | awardItem.itemBaisc.cellBtn.AddListener(() =>
|
| | | {
|
| | |
| | | {
|
| | | public GameObject parentObj;
|
| | | public CommonItemBaisc itemBaisc;
|
| | | public GameObject bestIconObj;
|
| | | public Image bestIcon;
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | {
|
| | | foreach(var key in poolDataDict.Keys)
|
| | | {
|
| | | if(poolDataDict[key].isBest == 1)
|
| | | if(poolDataDict[key].rare == 1)
|
| | | {
|
| | | return true;
|
| | | }
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | public bool TryGetItemRareIcon(int rare,out string iconKey)
|
| | | {
|
| | | iconKey = string.Empty;
|
| | | return wishItemRareDict.TryGetValue(rare,out iconKey);
|
| | | }
|
| | |
|
| | | public int handStartIndex { get; private set; }
|
| | |
| | | }
|
| | | public int freeRefreshCoolTime { get; private set;}
|
| | | public string wishingPriceFormula { get; private set;}
|
| | | public Dictionary<int, string> wishItemRareDict { get; private set; }
|
| | |
|
| | | public void ParseConfig()
|
| | | {
|
| | | FuncConfigConfig funcConfig = Config.Instance.Get<FuncConfigConfig>("WishingWellCfg");
|
| | | freeRefreshCoolTime = int.Parse(funcConfig.Numerical1);
|
| | | wishingPriceFormula = funcConfig.Numerical2;
|
| | | FuncConfigConfig WishingIcon = Config.Instance.Get<FuncConfigConfig>("WishingIcon");
|
| | | wishItemRareDict = ConfigParse.GetDic<int, string>(WishingIcon.Numerical1);
|
| | | }
|
| | | #endregion
|
| | |
|
| | |
| | | public int itemId;
|
| | | public int itemCount;
|
| | | public int isBind;
|
| | | public int isBest;
|
| | | public WishingWellItem(int id,int count,int isBind,int isBest)
|
| | | public int rare;
|
| | | public WishingWellItem(int id,int count,int isBind,int rare)
|
| | | {
|
| | | this.itemId = id;
|
| | | this.itemCount = count;
|
| | | this.isBind = isBind;
|
| | | this.isBest = isBest;
|
| | | this.rare = rare;
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | if (isPoolData)
|
| | | {
|
| | | dragItem.dragItemRect.gameObject.SetActive(true);
|
| | | dragItem.dragBestIcon.SetActive(wellItem.isBest == 0 ? false : true);
|
| | | string rareIconKey = string.Empty;
|
| | | bool isRare = wishingModel.TryGetItemRareIcon(wellItem.rare, out rareIconKey);
|
| | | dragItem.dragBestIcon.gameObject.SetActive(isRare);
|
| | | if (isRare)
|
| | | {
|
| | | dragItem.dragBestIcon.SetSprite(rareIconKey);
|
| | | }
|
| | | ItemCellModel cellModel = new ItemCellModel(wellItem.itemId,false,(ulong)wellItem.itemCount,wellItem.isBind);
|
| | | dragItem.dragItemBasic.Init(cellModel);
|
| | | poolItemCells[wishingModel.dragIndex].gameObject.SetActive(false);
|
| | |
| | | {
|
| | | public RectTransform dragItemRect;
|
| | | public CommonItemBaisc dragItemBasic;
|
| | | public GameObject dragBestIcon;
|
| | | public Image dragBestIcon;
|
| | | }
|
| | | #endregion
|
| | |
|
| | |
| | | {
|
| | | try
|
| | | {
|
| | | if (currentTask != null)
|
| | | if (_resource != null && currentTask != null && currentTask.windowName == _resource.name)
|
| | | {
|
| | | currentTask.Report(ok, _resource);
|
| | | currentTask = null;
|