Exemple #1
0
        public static ConfirmCostTipsView Open(GameResData costGameResData, string content, System.Action clickCancelButtonDelegate, System.Action clickOKButtonDelegate, ConsumeTipType type = ConsumeTipType.None)
        {
            ConfirmCostTipsView confirmCostTipsView = UIMgr.instance.Open <ConfirmCostTipsView>(PREFAB_PATH, EUISortingLayer.Tips);

            confirmCostTipsView.SetInfo(costGameResData, content, clickCancelButtonDelegate, clickOKButtonDelegate, type);
            return(confirmCostTipsView);
        }
 public void SetInfo(int roleInstanceID, int equipmentID, GameResData costGameResData)
 {
     _roleInstanceID      = roleInstanceID;
     _equipmentInstanceID = equipmentID;
     costResourceImage.SetSprite(ResMgr.instance.Load <Sprite>(UIUtil.GetBaseResIconPath(costGameResData.type)));
     costResourceCountText.text = costGameResData.count.ToString();
 }
 public void ClickBuyChanllengeBtnHandler()
 {
     if (GameProxy.instance.PveAction < CurrentSelectDungeonData.actionNeed)
     {
         CommonErrorTipsView.Open(Localization.Get("ui.common_tips.not_enough_pveAction"));
         return;
     }
     if (_activityInfo.remainBuyActivityTimes > 0)
     {
         int index = _activityInfo.buyActivityChanllengeTimes;
         if (_activityInfo.buyActivityChanllengeTimes >= GlobalData.GetGlobalData().daily_dungeon_buy_List.Count)
         {
             index = GlobalData.GetGlobalData().daily_dungeon_buy_List.Count - 1;
         }
         GameResData data = GlobalData.GetGlobalData().daily_dungeon_buy_List[index];
         ConfirmCostTipsView.Open(data, Localization.Get("ui.daily_dungeon_info_view.buy_challenge_times_tips_title"), Localization.Get("ui.daily_dungeon_info_view.buy_challenge_times_tips_content"), null, ExpendCostToBuyChallengeHandler);
         return;
     }
     if (_activityInfo.hasBuyActivityTimesByMaxVip)
     {
         ConfirmTipsView.Open(Localization.Get("ui.daily_dungeon_info_view.upgrade_vip_tips"), OpenRechargeHandler);
         return;
     }
     CommonErrorTipsView.Open(Localization.Get("ui.daily_dungeon_info_view.out_of_challenge_time"));
 }
        public void ExpendCostToBuyChallengeHandler()
        {
            int index = _activityInfo.buyActivityChanllengeTimes;

            if (_activityInfo.buyActivityChanllengeTimes >= GlobalData.GetGlobalData().daily_dungeon_buy_List.Count)
            {
                index = GlobalData.GetGlobalData().daily_dungeon_buy_List.Count - 1;
            }
            GameResData data = GlobalData.GetGlobalData().daily_dungeon_buy_List[index];
            int         own  = GameProxy.instance.BaseResourceDictionary.GetValue(data.type);

            if (own < data.count)
            {
                bool isEnough = GameProxy.instance.GameModelLuaTable.GetLuaFunction("CheckBaseResEnoughByType").Call((int)data.type, data.count)[0].ToString().ToBoolean();
                if (!isEnough)
                {
                    return;
                }
            }
            if (_currentSelectLevel > _activityInfo.ChallengedHighestLevel)
            {
                _activityInfo.ChallengedHighestLevel = _currentSelectLevel;
            }
            _activityInfo.LastChallengedLevel = _currentSelectLevel;
            ActivityController.instance.CLIENT2LOBBY_ACTIVITY_PVE_CHALLENGE_REQ(CurrentSelectDungeonData.dungeonID, true);
        }
Exemple #5
0
        private IEnumerator DoShowBtnRoot(float t, GameResData heroResData)
        {
            yield return(new WaitForSeconds(t));

            btn_root.SetActive(true);
            CommonFadeInAnimation fadeIn = btn_root.AddComponent <CommonFadeInAnimation>();

            fadeIn.set(0.25f, 0);
//			if (heroResData != null)
//			{
//				bool hasShowHeroDisplayView = ShowHeroDisplayView(heroResData);
//				if (!hasShowHeroDisplayView)
//				{
//					Observers.Facade.Instance.SendNotification(string.Format("{0}::{1}", PREFAB_PATH, "OnViewStay"));
//				}
//			}
//			else
//			{
//				Observers.Facade.Instance.SendNotification(string.Format("{0}::{1}", PREFAB_PATH, "OnViewStay"));
//			}

            if (heroResData != null && ShowHeroDisplayView(heroResData))
            {
            }
            else
            {
                Observers.Facade.Instance.SendNotification(string.Format("{0}::{1}", PREFAB_PATH, "OnViewStay"));
            }
        }
Exemple #6
0
        public static ConfirmCostTipsView Open(GameResData costGameResData, string title, string content, System.Action clickCancelButtonDelegate, System.Action clickOKButtonDelegate, ConsumeTipType type = ConsumeTipType.None)
        {
            ConfirmCostTipsView view = Open(costGameResData, content, clickCancelButtonDelegate, clickOKButtonDelegate, type);

            view.titleText.text = title;
            return(view);
        }
Exemple #7
0
        private void DoShowDropItem()
        {
            if (!treasureBox.gameObject.activeSelf)
            {
                return;
            }

            panelDrop.SetActive(true);
            treasureBox.gameObject.SetActive(false);

            TransformUtil.ClearChildren(tranDropRoot, true);
            int count = _dropHeroAndEquipList.Count;


            int   half                = count / 2;
            float scaleShakeTime      = 0.2f;
            float scaleShakeDelayTime = 0.1f;
            float allDelay            = 0.5f;
            float btnDelayShowTime    = count * scaleShakeTime + 0.5f + allDelay;


            //drop
            GameResData heroGRD = null;

            for (int i = 0; i < count; i++)
            {
                DropItem         dropItem = _dropHeroAndEquipList[i];
                CommonRewardIcon rewardIcon;
                rewardIcon = CommonRewardIcon.Create(tranDropRoot);
                GameResData resData = new GameResData((BaseResType)dropItem.itemType, dropItem.itemNo, dropItem.itemNum, dropItem.heroStar);

                rewardIcon.SetGameResData(resData);
                rewardIcon.SetDesButtonType(ShowDescriptionType.click);
                rewardIcon.ShowRewardCount(true);
                Transform  tran = rewardIcon.transform;
                GameObject go   = rewardIcon.gameObject;
                if (count % 2 == 0)
                {
                    tran.localPosition = new Vector3((i - half) * 120 + 60, 0, 0);
                }
                else
                {
                    tran.localPosition = new Vector3((i - half) * 120, 0, 0);
                }
                go.AddComponent <ScaleShake>().init(0, 1, scaleShakeTime, i * scaleShakeDelayTime + allDelay, ScaleShake.ScaleShakeType.ScleShake_After);
                if (resData.type == BaseResType.Hero)
                {
                    heroGRD = resData;
                }
            }

            ShowBtnRoot(btnDelayShowTime, heroGRD);

            //bg light

            Vector3 to = image_light.localScale;

            image_light.localScale = Vector3.zero;
            LeanTween.scale(image_light, to, scaleShakeTime).setDelay(allDelay);
        }
        public void SetAsRequireResource(GameResData gameResData)
        {
            SetSelect(false);
            textName.gameObject.SetActive(false);
            int requiredCount = 0;
            int ownCount      = 0;

            BaseResType type = gameResData.type;
            int         id   = gameResData.id;

            if (type != BaseResType.Hero && type != BaseResType.Equipment && type != BaseResType.Item)
            {
                ownCount = GameProxy.instance.BaseResourceDictionary[gameResData.type];
                ItemData data = ItemData.GetBasicResItemByType(type);
                if (data != null)
                {
                    id = data.id;
                }
            }
            else
            {
                ItemInfo itemInfo = ItemProxy.instance.GetItemInfoByItemID(gameResData.id);
                if (itemInfo != null)
                {
                    ownCount = itemInfo.count;
                }
            }
            requiredCount = gameResData.count;
            SetItemInfo(new ItemInfo(0, id, gameResData.count));
            string countString = string.Format("{0}/{1}", ownCount, requiredCount);

            textCount.text = ownCount >= requiredCount?UIUtil.FormatToGreenText(countString) : UIUtil.FormatToRedText(countString);
        }
 //有新阵型and培养点满
 public int GetNewFormationAndPointFullTipByRedPoint()
 {
     if (!FunctionOpen.Model.FunctionOpenProxy.instance.IsFunctionOpen(FunctionOpenType.FormationTraining))
     {
         return(0);
     }
     if (_newFormationListByRedPoint.Count > 0 || _isFormationPointRecoverFullTip)
     {
         int needTip = 0;
         Dictionary <int, FormationInfo> dic = FormationProxy.instance.FormationInfoDictionary;
         foreach (var data in dic)
         {
             if (data.Value.formationState != FormationState.Locked)
             {
                 GameResData resData  = data.Value.UpgradeResCost;
                 int         ownCount = 0;
                 if (resData.type == BaseResType.Item)
                 {
                     ownCount = ItemProxy.instance.GetItemCountByItemID(resData.id);
                 }
                 else
                 {
                     ownCount = GameProxy.instance.BaseResourceDictionary.GetValue(resData.type);
                 }
                 if (ownCount >= resData.count && trainPoint >= data.Value.UpgradeTrainPointCost)
                 {
                     needTip = 1;
                     break;
                 }
             }
         }
         return(needTip);
     }
     return(0);
 }
        public void ClickTransferHandler()
        {
            int transferTaskConditioCount = _playerData.transferTaskConditionIDList.Count;

            for (int i = 0; i < transferTaskConditioCount; i++)
            {
                TaskConditionData taskConditionData = TaskConditionData.GetTaskConditionData(_playerData.transferTaskConditionIDList[i]);
                if (!TaskUtil.IsTaskConditionFinished(taskConditionData))
                {
                    CommonErrorTipsView.Open(Localization.Get("ui.common_tips.activate_profession_task_unfinished"));
                    return;
                }
            }
            //通用材料检测
            Dictionary <uint, List <Toggle> > groupDic = generalMeterialGroup.toggleGroup;
            List <int> generalMList = new List <int>();

            foreach (var value in groupDic)
            {
                if (!value.Value[0].isOn)
                {
                    generalMList.Add((int)value.Key);
                }
            }
            //资源是否够
            List <GameResData> transferCostResourcesList = _playerData.transferCostList;
            int transferCostResourceCount = transferCostResourcesList.Count;

            for (int i = 0; i < transferCostResourceCount; i++)
            {
                GameResData gameResData = transferCostResourcesList[i];
                if (GameResUtil.IsBaseRes(gameResData.type))
                {
                    if (GameProxy.instance.BaseResourceDictionary[gameResData.type] < gameResData.count)
                    {
                        CommonErrorTipsView.Open(string.Format(Localization.Get("ui.common_tips.not_enough_resource"), GameResUtil.GetBaseResName(gameResData.type)));
                        return;
                    }
                }
                else if (gameResData.type == BaseResType.Item)
                {
                    ItemData itemData = ItemData.GetItemDataByID(gameResData.id);
                    if (generalMList.Contains(gameResData.id))                   //选择了通用材料
                    {
                        itemData = ItemData.GetItemDataByID(itemData.universal_id);
                    }

                    ItemInfo itemInfo = ItemProxy.instance.GetItemInfoByItemID(itemData.id);
                    if (itemInfo == null || itemInfo.count < gameResData.count)
                    {
//						CommonErrorTipsView.Open(string.Format(Localization.Get("ui.common_tips.not_enough_resource"), Localization.Get(itemData.name)));
                        CommonAutoDestroyTipsView.Open(Localization.Get("ui.activate_profession_view.item_not_enough"));
                        return;
                    }
                }
            }

            PlayerController.instance.CLIENT2LOBBY_PLAYER_TRANSFER_REQ((int)_playerData.Id, generalMList);
            UIMgr.instance.Close(PREFAB_PATH);
        }
Exemple #11
0
        public static GoodsJumpPathView Open(GameResData data)
        {
            GoodsJumpPathView view = UIMgr.instance.Open <GoodsJumpPathView>(PREFAB_PATH, EUISortingLayer.MainUI, UIOpenMode.Overlay);

            view.SetData(data);
            return(view);
        }
Exemple #12
0
        public void SetShopGoodItemInfo(ShopGoodsItemInfo shopGoodsItemInfo)
        {
            _shopGoodsItemInfo = shopGoodsItemInfo;

            GameResData goodsGameResData = _shopGoodsItemInfo.ShopGoodsData.goodsGameResData;

            nameText.text        = Localization.Get(_shopGoodsItemInfo.ShopGoodsData.name);
            descriptionText.text = Localization.Get(_shopGoodsItemInfo.ShopGoodsData.description);

            string itemIconSpritePath = string.Empty;

            if (!string.IsNullOrEmpty(_shopGoodsItemInfo.ShopGoodsData.pic))
            {
                itemIconSpritePath = ResPath.GetShopItemIconPath(_shopGoodsItemInfo.ShopGoodsData.pic);
            }
            else
            {
                if (goodsGameResData.type == Logic.Enums.BaseResType.Item)
                {
                    ItemData itemData = ItemData.GetItemDataByID(goodsGameResData.id);
                    itemIconSpritePath = ResPath.GetItemIconPath(itemData.icon);
                }
                else if (goodsGameResData.type == Logic.Enums.BaseResType.Hero)
                {
                    HeroData heroData = HeroData.GetHeroDataByID(goodsGameResData.id);
                    itemIconSpritePath = ResPath.GetCharacterHeadIconPath(heroData.headIcons[heroData.starMin - 1]);
                }
            }
            itemIconImage.SetSprite(ResMgr.instance.Load <Sprite>(itemIconSpritePath));
            itemIconImage.SetNativeSize();

            costResourceIcon.SetSprite(ResMgr.instance.Load <Sprite>(UIUtil.GetBaseResIconPath(_shopGoodsItemInfo.ShopGoodsData.costGameResData.type)));
            costResourceIcon.SetNativeSize();
            costResourceCountText.text = _shopGoodsItemInfo.ShopGoodsData.costGameResData.count.ToString();

            freeTimesRoot.SetActive(false);
            freeCountDownSlider.gameObject.SetActive(false);

            if (_shopGoodsItemInfo.ShopGoodsData.itemNum > 0)
            {
                if (_shopGoodsItemInfo.RemainPurchaseTimes > 0)
                {
                    buyButton.gameObject.SetActive(true);
                    soldOutButton.gameObject.SetActive(false);
                }
                else
                {
                    buyButton.gameObject.SetActive(false);
                    soldOutButton.gameObject.SetActive(true);
                }
                limitTimesText.text = string.Format(Localization.Get("common.value/max"), _shopGoodsItemInfo.RemainPurchaseTimes, _shopGoodsItemInfo.ShopGoodsData.itemNum);
                limitTimesRoot.SetActive(true);
            }
            else
            {
                limitTimesRoot.SetActive(false);
                buyButton.gameObject.SetActive(true);
                soldOutButton.gameObject.SetActive(false);
            }
        }
        public static ConfirmBuyShopItemTipsView Open(string itemName, GameResData costGameResData, System.Action onClickBuyButtonHandler, ConsumeTipType type = ConsumeTipType.None)
        {
            ConfirmBuyShopItemTipsView confirmBuyShopItemTipsView = UIMgr.instance.Open <ConfirmBuyShopItemTipsView>(PREFAB_PATH, EUISortingLayer.Tips);

            confirmBuyShopItemTipsView.SetInfo(itemName, costGameResData, onClickBuyButtonHandler, type);
            return(confirmBuyShopItemTipsView);
        }
        public static ConfirmPutOffEquipmentTipsView Open(int equipID, int roleID, BaseResType costBaseResType, int costResID, int costResCount)
        {
            ConfirmPutOffEquipmentTipsView confirmPutOffEquipmentTipsView = UIMgr.instance.Open <ConfirmPutOffEquipmentTipsView>(PREFAB_PATH, EUISortingLayer.Tips, UIOpenMode.Overlay);
            GameResData costGameResData = new GameResData(costBaseResType, costResID, costResCount, 0);

            confirmPutOffEquipmentTipsView.SetInfo(EquipmentProxy.instance.GetEquipmentInfoByInstanceID(equipID), roleID, costGameResData);
            return(confirmPutOffEquipmentTipsView);
        }
        public static List <PathData> GetPathDatas(GameResData gameResData, int limitCount)
        {
            List <PathData> pathDataList = new List <PathData>();
            DropMessageData data         = DropMessageData.GetDropMsgDataByResData(gameResData, true);

            if (data == null)
            {
                return(null);
            }
            else
            {
                Dictionary <GoodsJumpType, List <int> > jumpDic = data.JumpDic;
                int index = 0;
                foreach (var value in jumpDic)
                {
                    if (value.Key == GoodsJumpType.Jump_Dungeon)
                    {
                        List <int> idList = value.Value;
                        int        id;
                        for (int i = 0; i < idList.Count; i++)
                        {
                            id = idList[i];
                            int         remaindCount = limitCount - index;
                            DungeonInfo dInfo        = DungeonProxy.instance.GetDungeonInfo(id);
                            if (dInfo == null)
                            {
                                Debugger.LogError("dungeon can not find in jump path, id:" + id);
                            }
                            else if (!dInfo.isLock || i < remaindCount)
                            {
                                pathDataList.Add(new PathData(value.Key, id));
                                index++;
                                if (index == limitCount)
                                {
                                    break;
                                }
                            }
                        }
                    }
                    else
                    {
                        List <int> idList = value.Value;
                        int        id;
                        for (int i = 0; i < idList.Count; i++)
                        {
                            id = idList[i];
                            pathDataList.Add(new PathData(value.Key, id));
                            index++;
                            if (index == limitCount)
                            {
                                break;
                            }
                        }
                    }
                }
            }
            return(pathDataList);
        }
        public static ConfirmBuyShopItemTipsView Open(string title, string tips, GameResData costGameResData, System.Action onClickBuyButtonHandler, ConsumeTipType consumeTipType = ConsumeTipType.None)
        {
            ConfirmBuyShopItemTipsView confirmBuyShopItemTipsView = UIMgr.instance.Open <ConfirmBuyShopItemTipsView>(PREFAB_PATH, EUISortingLayer.Tips);

            confirmBuyShopItemTipsView.SetInfo("", costGameResData, onClickBuyButtonHandler, consumeTipType);
            confirmBuyShopItemTipsView.titleText.text = title;
            confirmBuyShopItemTipsView.tipsText.text  = tips;
            return(confirmBuyShopItemTipsView);
        }
Exemple #17
0
        public void ClickAgainHandler()
        {
            int         shopID          = 0;
            int         shopItemID      = 0;
            string      shopItemName    = string.Empty;
            GameResData costGameResData = null;
            int         costType        = 1;

            if (_shopHeroRandomCardInfo != null)
            {
                shopID          = _shopHeroRandomCardInfo.ShopCardRandomData.shopID;
                shopItemID      = _shopHeroRandomCardInfo.ShopCardRandomData.id;
                shopItemName    = Localization.Get(_shopHeroRandomCardInfo.ShopCardRandomData.name);
                costGameResData = _shopHeroRandomCardInfo.ShopCardRandomData.costGameResData;
                if (_shopHeroRandomCardInfo.RemainFreeTimes > 0 && _shopHeroRandomCardInfo.NextFreeBuyCountDownTime <= 0)
                {
                    costType = 0;
                }
            }

            if (costType == 0)   //免费
            {
                ShopController.instance.CLIENT2LOBBY_PURCHASE_GOODS_REQ(shopID, shopItemID, costType);
            }
            else if (costType == 1)   //非免费
            {
                if (GameResUtil.IsBaseRes(costGameResData.type))
                {
                    if (GameProxy.instance.BaseResourceDictionary[costGameResData.type] < costGameResData.count)
                    {
                        CommonErrorTipsView.Open(string.Format(Localization.Get("ui.common_tips.not_enough_resource"), GameResUtil.GetBaseResName(costGameResData.type)));
                        return;
                    }

                    if (costGameResData.type == Logic.Enums.BaseResType.Diamond)
                    {
                        if (ConsumeTipProxy.instance.GetConsumeTipEnable(ConsumeTipType.DiamondDrawSingleHero))
                        {
                            ConfirmBuyShopItemTipsView.Open(shopItemName, costGameResData, ClickConfirmBuyHandler, ConsumeTipType.DiamondDrawSingleHero);
                        }
                        else
                        {
                            ClickConfirmBuyHandler();
                        }
                    }
                    else
                    {
                        ShopController.instance.CLIENT2LOBBY_PURCHASE_GOODS_REQ(shopID, shopItemID, costType);
                    }
                }
                else
                {
                    ShopController.instance.CLIENT2LOBBY_PURCHASE_GOODS_REQ(shopID, shopItemID, costType);
                }
            }
        }
Exemple #18
0
        public static GameResData CalculatePutOffCost(EquipmentInfo equipmentInfo)
        {
            GameResData res = equipmentInfo.equipmentData.unloadCost;

            if (res == null)
            {
                res = new GameResData(BaseResType.Diamond, 0, 0, 0);
            }
            return(res);
        }
        public static DropMessageData GetDropMsgDataByResData(GameResData resData, bool includeDefault = false)
        {
            DropMessageData data = GetDropMsgDataByResData((int)resData.type, resData.id, resData.count, resData.star);

            if (data == null && includeDefault)
            {
                data = GetDropMsgDataByResData((int)resData.type, resData.id, 0, 0);
            }
            return(data);
        }
        public void SetAsCostResources(GameResData gameResData)
        {
            SetSelect(false);
            textName.gameObject.SetActive(false);
            //Sprite iconSprite = null;
            int requiredCount = 0;
            int ownCount      = 0;

            BaseResType type = gameResData.type;
            int         id   = gameResData.id;

            if (type != BaseResType.Hero && type != BaseResType.Equipment && type != BaseResType.Item)
            {
                ownCount = GameProxy.instance.BaseResourceDictionary[gameResData.type];
                ItemData data = ItemData.GetBasicResItemByType(type);
                if (data != null)
                {
                    id = data.id;
                }
            }
            else
            {
                ItemInfo itemInfo = ItemProxy.instance.GetItemInfoByItemID(gameResData.id);
                if (itemInfo != null)
                {
                    ownCount = itemInfo.count;
                }
            }
            requiredCount = gameResData.count;
            //			if (gameResData.type == BaseResType.Gold
            //			    || gameResData.type == BaseResType.Diamond
            //			    || gameResData.type == BaseResType.Crystal
            //			    || gameResData.type == BaseResType.Honor)
            //			{
            //				iconSprite = ResMgr.instance.Load<Sprite>(ResPath.GetItemIconPath(((int)gameResData.type).ToString()));
            //				requiredCount = gameResData.count;
            //				ownCount = GameProxy.instance.BaseResourceDictionary[gameResData.type];
            //			}
            //			else if (gameResData.type == BaseResType.Item)
            //			{
            //				ItemData itemData = ItemData.GetItemDataByID(gameResData.id);
            //				iconSprite = ResMgr.instance.Load<Sprite>(ResPath.GetItemIconPath(itemData.icon));
            //				requiredCount = gameResData.count;
            //
            //				ItemInfo itemInfo = ItemProxy.instance.GetItemInfoByItemID(gameResData.id);
            //				if (itemInfo != null)
            //				{
            //					ownCount = itemInfo.count;
            //				}
            //			}
            //			itemIconImage.sprite = iconSprite;
            //			itemIconImage.SetNativeSize();
            SetItemInfo(new ItemInfo(0, id, gameResData.count));
            textCount.text = ownCount >= requiredCount?UIUtil.FormatToGreenText(requiredCount.ToString()) : UIUtil.FormatToRedText(requiredCount.ToString());
        }
Exemple #21
0
        public static GameObject OpenConfirmBuyShopItemTipsView(string itemName, int costResTypeValue, int costResID, int costResCount, System.Action onClickBuyButtonHandler, int consumeTipTypeValue)
        {
            GameResData costGameResData = new GameResData();

            costGameResData.type  = (BaseResType)costResTypeValue;
            costGameResData.id    = costResID;
            costGameResData.count = costResCount;
            ConsumeTipType consumeTipType = (ConsumeTipType)consumeTipTypeValue;

            return(Logic.UI.Tips.View.ConfirmBuyShopItemTipsView.Open(itemName, costGameResData, onClickBuyButtonHandler, consumeTipType).gameObject);
        }
        private void ExpendCostToResetMapHandler()
        {
            GameResData data = GlobalData.GetGlobalData().faraway_buy_ResData;
            int         own  = GameProxy.instance.BaseResourceDictionary.GetValue(data.type);

            if (own < data.count)
            {
                CommonErrorTipsView.Open(Localization.Get("ui.expedition_view.notEnoughDiamond"));
                return;
            }
            ExpeditionController.instance.CLIENT2LOBBY_Expedition_Reset_REQ(true);
        }
Exemple #23
0
        public void ClickConfirmBuyHandler()
        {
            int         shopID          = 0;
            int         shopItemID      = 0;
            GameResData costGameResData = null;
            int         costType        = 1;

            if (_shopHeroRandomCardInfo != null)
            {
                shopID          = _shopHeroRandomCardInfo.ShopCardRandomData.shopID;
                shopItemID      = _shopHeroRandomCardInfo.ShopCardRandomData.id;
                costGameResData = _shopHeroRandomCardInfo.ShopCardRandomData.costGameResData;
                if (_shopHeroRandomCardInfo.RemainFreeTimes > 0 && _shopHeroRandomCardInfo.NextFreeBuyCountDownTime <= 0)
                {
                    costType = 0;
                }
            }
            else if (_shopEquipmentRandomCardInfo != null)
            {
                shopID          = _shopEquipmentRandomCardInfo.ShopCardRandomData.shopID;
                shopItemID      = _shopEquipmentRandomCardInfo.ShopCardRandomData.id;
                costGameResData = _shopEquipmentRandomCardInfo.ShopCardRandomData.costGameResData;
                if (_shopEquipmentRandomCardInfo.RemainFreeTimes > 0 && _shopEquipmentRandomCardInfo.NextFreeBuyCountDownTime <= 0)
                {
                    costType = 0;
                }
            }
            else if (_shopDiamondItemInfo != null)
            {
                shopID          = _shopDiamondItemInfo.ShopDiamondData.shopID;
                shopItemID      = _shopDiamondItemInfo.ShopDiamondData.id;
                costGameResData = _shopDiamondItemInfo.ShopDiamondData.costGameResData;
            }
            else if (_shopActionItemInfo != null)
            {
                shopID          = _shopActionItemInfo.ShopLimitItemData.shopID;
                shopItemID      = _shopActionItemInfo.ShopLimitItemData.id;
                costGameResData = _shopActionItemInfo.ShopLimitItemData.costGameResData;
            }
            else if (_shopGoldItemInfo != null)
            {
                shopID          = _shopGoldItemInfo.ShopLimitItemData.shopID;
                shopItemID      = _shopGoldItemInfo.ShopLimitItemData.id;
                costGameResData = _shopGoldItemInfo.ShopLimitItemData.costGameResData;
            }
            else if (_shopGoodsItemInfo != null)
            {
                shopID          = _shopGoodsItemInfo.ShopGoodsData.shopID;
                shopItemID      = _shopGoodsItemInfo.ShopGoodsData.id;
                costGameResData = _shopGoodsItemInfo.ShopGoodsData.costGameResData;
            }
            ShopController.instance.CLIENT2LOBBY_PURCHASE_GOODS_REQ(shopID, shopItemID, costType);
        }
        public void SetPlayerData(PlayerData playerData)
        {
            _playerData                 = playerData;
            transferTitleText.text      = Localization.Get("ui.activate_profession_view.activate_profession_title");
            costResourcesTitleText.text = Localization.Get("ui.activate_profession_view.cost_resources_title");
            transferText.text           = Localization.Get("ui.activate_profession_view.transfer");
            cancelText.text             = Localization.Get("ui.activate_profession_view.cancel");

            int transferTaskContidionCount = _playerData.transferTaskConditionIDList.Count;

            for (int i = 0; i < transferTaskContidionCount; i++)
            {
                TaskConditionData taskConditionData = TaskConditionData.GetTaskConditionData(_playerData.transferTaskConditionIDList[i]);
                Text transferConditionText          = GameObject.Instantiate <Text>(transferConditionTextPrefab);
                transferConditionText.text = TaskUtil.GetTaskConditionDescriptionWithColor(taskConditionData);
                transferConditionText.transform.SetParent(transferConditionsRoot, false);
                transferConditionText.gameObject.SetActive(true);
            }
            transferConditionTextPrefab.gameObject.SetActive(false);

            List <GameResData> transferCostResourcesList = _playerData.transferCostList;
            int transferCostResourceCount = transferCostResourcesList.Count;

            commonItemIconPrefab.gameObject.SetActive(true);
            for (int i = 0; i < transferCostResourceCount; i++)
            {
                GameResData gameResData = transferCostResourcesList[i];

                if (gameResData.type == BaseResType.Item)
                {
                    int universalId = ItemData.GetItemDataByID(gameResData.id).universal_id;
                    if (universalId != 0)
                    {
                        CommonItemIcon itemOrigin   = CreateItemIcon(gameResData, true);
                        CommonItemIcon itemGeneral  = CreateItemIcon(new GameResData(BaseResType.Item, universalId, gameResData.count, gameResData.star), true);
                        Toggle         originToggle = itemOrigin.GetComponentInChildren <Toggle>();
                        generalMeterialGroup.AddToggle((uint)gameResData.id, originToggle);
                        generalMeterialGroup.AddToggle((uint)gameResData.id, itemGeneral.GetComponentInChildren <Toggle>());
                        generalMeterialGroup.OnClickToggle(originToggle);
                    }
                    else
                    {
                        CreateItemIcon(gameResData, false);
                    }
                }
                else
                {
                    CreateItemIcon(gameResData, false);
                }
            }
            commonItemIconPrefab.gameObject.SetActive(false);
        }
Exemple #25
0
        public List <GameResData> GetBasicItemId()
        {
            List <GameResData> itemList = new List <GameResData>();

            string[] itemString = hero_type_all.Split(CSVUtil.SYMBOL_SEMICOLON);
            for (int i = 0, count = itemString.Length; i < count; i++)
            {
                int[]       values = itemString[i].ToArray <int>(CSVUtil.SYMBOL_COLON);
                GameResData data   = new GameResData(BaseResType.Item, values[0], values[1], 0);
                itemList.Add(data);
            }

            return(itemList);
        }
        public void ClickOKHandler()
        {
            GameResData costGameResData = EquipmentUtil.CalculatePutOffCost(_equipmentInfo);

            if (GameProxy.instance.BaseResourceDictionary[costGameResData.type] >= costGameResData.count)
            {
                EquipmentController.instance.CLIENT2LOBBY_EQUIP_WEAR_OFF_REQ(_equipmentInfo.instanceID, EquipmentWearOffType.Off, false, _roleInstanceID);
                UIMgr.instance.Close(PREFAB_PATH);
            }
            else
            {
                CommonErrorTipsView.Open("Not enough diamond.");
            }
        }
        public void ClickActiveButtonHander()
        {
            if (_currentClickSkillInfo == null)
            {
                return;
            }
            if (_currentClickSkillInfo.level == 0 && !_currentClickSkillInfo.isMaxExp)
            {
                CommonErrorTipsView.Open(Localization.Get("ui.player_cultivate_view.expNotMax"));
                return;
            }
            List <GameResData> costList = _currentClickSkillInfo.UpgradeCost;

            for (int i = 0, count = costList.Count; i < count; i++)
            {
                GameResData res = costList[i];
                int         own = 0;
                if (res.type == BaseResType.Item)
                {
                    own = ItemProxy.instance.GetItemCountByItemID(res.id);
                }
                else
                {
                    own = GameProxy.instance.BaseResourceDictionary.GetValue(res.type);
                }
                if (res.count > own)
                {
                    ItemData tempItemData = ItemData.GetBasicResItemByType(res.type);
                    Logic.UI.Tips.View.CommonErrorTipsView.Open(string.Format(Localization.Get("ui.player_cultivate_view.materialNotEnough"), Localization.Get(tempItemData.name)));
                    return;
                }
            }

            if (_currentClickSkillInfo.level == 0)
            {
                PlayerController.instance.CLIENT2LOBBY_TALENT_ACTIVATE_REQ(_currentClickSkillInfo.id);
                GameObject effect = ParticleUtil.CreateParticle("effects/prefabs/ui_shimo", _canvas);
                if (effect != null)
                {
                    effect.transform.SetParent(selectTransform.parent, false);
                    effect.transform.localPosition = selectTransform.localPosition;
                    GameObject.Destroy(effect, 1);
                }
            }
            else
            {
                PlayerController.instance.CLIENT2LOBBY_TALENT_UPGRADE_REQ(_currentClickSkillInfo.id);
            }
        }
        private CommonItemIcon CreateItemIcon(GameResData data, bool showToggle)
        {
            _costItemGameResData = data;
            CommonItemIcon commonItemIcon = GameObject.Instantiate <CommonItemIcon>(commonItemIconPrefab);

            commonItemIcon.SetAsRequireResource(data);
            commonItemIcon.transform.SetParent(transferCostResourcesRoot, false);
            commonItemIcon.gameObject.SetActive(true);
            commonItemIcon.SetEnableItemDesButton(false);
            commonItemIcon.onClickHandler = ClickCostItemHandler;

//			Toggle toggle = commonItemIcon.GetComponentInChildren<Toggle>();
//			toggle.gameObject.SetActive(showToggle);
            return(commonItemIcon);
        }
        public void SetGameResData(GameResData gameResData)
        {
            ItemData itemData = null;

            if (gameResData.type == Logic.Enums.BaseResType.Item)
            {
                itemData = ItemData.GetItemDataByID(gameResData.id);
            }
            else
            {
                itemData = ItemData.GetBasicResItemByType(gameResData.type);
            }
            commonRewardIcon.SetGameResData(gameResData);
            nameText.text = UI.UIUtil.FormatStringWithinQualityColor((Enums.RoleQuality)(itemData.itemQuality), Localization.Get(itemData.name));
        }
        public void RefreshRewardIcons()
        {
            TransformUtil.ClearChildren(rewardRoot, true);
            List <GameResData> rewards = _selectedWorldTreeDungeonInfo.dungeonData.eachLootPresent;
            GameResData        resData = null;
            int exp = 0;

            for (int i = 0, count = rewards.Count; i < count; i++)
            {
                resData = rewards[i];
                CommonRewardIcon icon = CommonRewardIcon.Create(rewardRoot);
                icon.SetGameResData(resData);
                icon.SetDesButtonType(ShowDescriptionType.click);
            }
        }