/// <summary> /// 设置已购买物品列表 /// </summary> /// <param name="_purchasedGoods"></param> public void SetPurchasedGoods(List <cmd_war_persongoodsinfo> _purchasedGoods) { //UWarGoodsStoreItem item = LogicDataCenter.warMobaGoodsDataManager.GetWarGoodsStoreItem(_purchasedGoods.nGoodID); if (PurchasedGoodsView != null) { PurchasedGoodsView.SetPurchasedGoods(_purchasedGoods); } if (RecommendGoodsView != null) { RecommendGoodsView.SetPurchasedGoods(_purchasedGoods); } }
public void InitMobaGoodsScheme(ASpeedGame.Data.GameMobaSchemes.GameMobaSchemesManager.MobaGoodsSchemesEventArgs arg) { if (AllGoodsView != null) { AllGoodsView.BoxAllGoods(LogicDataCenter.warMobaGoodsDataManager.WarGoodsStoreMobaGoodsDataSource, arg.RecommendGoods.RecommendGoods_DefaultGoodsTypeList); AllGoodsView.BoxGoodsLabelDescriptrion(arg.LabelDescirptionTable); } int PlayerSummerID = GameLogicAPI.getWarSummerID(); if (RecommendGoodsView != null) { for (int i = 0; i < arg.RecommendGoods.RecommendGoods_UsedStageList.Count; ++i) { //2017.9.18新增需求,带惩戒自动切换到打野推荐装 if (arg.RecommendGoods.RecommendGoods_UsedStageList[i] == (int)EMobaRecommendGoods.EMRG_EerlyStage) { List <SSchemeMobaGoods> _typeList = PlayerSummerID == arg.RecommendGoods.RecommendGoods_SummerID ? arg.RecommendGoods.RecommendGoods_SummerEerlyList : arg.RecommendGoods.RecommendGoods_EerlyList; RecommendGoodsView.BoxRecommendedGoodsByGoodsType(_typeList, arg.RecommendGoods.RecommendGoods_DispositionStageList, EMobaRecommendGoods.EMRG_EerlyStage); } if (arg.RecommendGoods.RecommendGoods_UsedStageList[i] == (int)EMobaRecommendGoods.EMRG_MiddleStage) { List <SSchemeMobaGoods> _typeList = PlayerSummerID == arg.RecommendGoods.RecommendGoods_SummerID ? arg.RecommendGoods.RecommendGoods_SummerMiddleList : arg.RecommendGoods.RecommendGoods_MiddleList; RecommendGoodsView.BoxRecommendedGoodsByGoodsType(_typeList, arg.RecommendGoods.RecommendGoods_DispositionStageList, EMobaRecommendGoods.EMRG_MiddleStage); } if (arg.RecommendGoods.RecommendGoods_UsedStageList[i] == (int)EMobaRecommendGoods.EMRG_DownWindStage) { List <SSchemeMobaGoods> _typeList = PlayerSummerID == arg.RecommendGoods.RecommendGoods_SummerID ? arg.RecommendGoods.RecommendGoods_SummerDownWindList : arg.RecommendGoods.RecommendGoods_DownWindList; RecommendGoodsView.BoxRecommendedGoodsByGoodsType(_typeList, arg.RecommendGoods.RecommendGoods_DispositionStageList, EMobaRecommendGoods.EMRG_DownWindStage); } if (arg.RecommendGoods.RecommendGoods_UsedStageList[i] == (int)EMobaRecommendGoods.EMRG_UpWindStage) { RecommendGoodsView.BoxRecommendedGoodsByGoodsType(arg.RecommendGoods.RecommendGoods_UpWindList, arg.RecommendGoods.RecommendGoods_DispositionStageList, EMobaRecommendGoods.EMRG_UpWindStage); } if (arg.RecommendGoods.RecommendGoods_UsedStageList[i] == (int)EMobaRecommendGoods.EMRG_ConsumeGoods) { RecommendGoodsView.BoxRecommendedGoodsByGoodsType(arg.RecommendGoods.RecommendGoods_ConsumeGoodsList, arg.RecommendGoods.RecommendGoods_DispositionStageList, EMobaRecommendGoods.EMRG_ConsumeGoods); } } //读取配置完后删除重复种类4与2、3重复部分(我也不想,策划为了不让自己配错) SetCurrentGoodsDisposition(WarMobaGoodsDataManager.Instance.HeroDefaultGoodsDisposition); } }
/// <summary> /// /// </summary> /// <param name="_nGoodsID">当前推荐配置物品ID列表(目前默认替换2、3种类)</param> public void SetCurrentGoodsDisposition(int[] _nGoodsID) { if (RecommendGoodsView != null && _nGoodsID.Length > 0) { //推荐页推荐物品序号,每一种类有6个物品 int recommendIndex = -1; if ((int)WarMobaGoodsDataManager.Instance.GoodsDispositionRecmomendType.Length != 2) { Trace.LogWarning("策划看看 MobaRecommendGoods.csv该英雄的 替换的物品种类列表 是不是配置有问题。只需要两个可替换的种类列表序号。"); } //取默认配置中种类4所有物品ID List <int> UpWindgoodsIDList = GameMobaSchemesManager.Instance.CurrentHeroRecommendGoods.RecommendGoods_UpWindList.Select(d => d.GoodsID).ToList(); //默认配置中类1出门装物品ID List <int> EerlygoodsIDList = GameMobaSchemesManager.Instance.CurrentHeroRecommendGoods.RecommendGoods_EerlyList.Select(d => d.GoodsID).ToList(); //去除记录的常用装备中与推荐出门装中重复的 if (EerlygoodsIDList != null && EerlygoodsIDList.Count > 0) { for (int i = 0; i < EerlygoodsIDList.Count; i++) { if (EerlygoodsIDList[i] == 0) { continue; } for (int j = 0; j < _nGoodsID.Length; j++) { if (_nGoodsID[j] == EerlygoodsIDList[i]) { _nGoodsID[j] = 0; break; } } } } for (int i = 0; i < _nGoodsID.Length; ++i) { //目前固定都是6个,只替换两个种类 recommendIndex = i < 6 ? (int)WarMobaGoodsDataManager.Instance.GoodsDispositionRecmomendType[0] : (int)WarMobaGoodsDataManager.Instance.GoodsDispositionRecmomendType[1]; //推荐类型不是从0起的,偏移一下 recommendIndex = (recommendIndex) * 6 + (i < 6 ? i : i - 6); RecommendGoodsView.SetRecommendedGoods(_nGoodsID[i], recommendIndex); //推荐四与替换部分 物品重复则移除 if (UpWindgoodsIDList != null && UpWindgoodsIDList.Count > 0) { int UpWindIndex = UpWindgoodsIDList.IndexOf(_nGoodsID[i]); if (UpWindIndex != -1) { //goodsIDList[UpWindIndex] = 0; UpWindgoodsIDList.RemoveAt(UpWindIndex); } } } List <int> usedStageList = GameMobaSchemesManager.Instance.CurrentHeroRecommendGoods.RecommendGoods_UsedStageList; int recommendIndexBase = usedStageList.IndexOf((int)EMobaRecommendGoods.EMRG_UpWindStage); //重设推荐四物品列表 if (recommendIndexBase >= 0) { int count = UpWindgoodsIDList.Count >= 6 ? 6 : UpWindgoodsIDList.Count; int goodsID = 0; for (int i = 0; i < 6; ++i) { recommendIndex = (recommendIndexBase) * 6 + i; goodsID = i < count ? UpWindgoodsIDList[i] : 0;//少于6个时,隐藏多余的。 RecommendGoodsView.SetRecommendedGoods(goodsID, recommendIndex); } } RecommendGoodsView.UpdateVisible(); } }