示例#1
0
 public void OnClickResetMapBtnHandler()
 {
     if (ExpeditionProxy.instance.resetCount == 0)
     {
         if (ExpeditionProxy.instance.expeditionRemaindBuyTimes > 0)
         {
             if (ConsumeTipProxy.instance.GetConsumeTipEnable(ConsumeTipType.DiamondResetExpeditionCount))
             {
                 ConfirmCostTipsView.Open(GlobalData.GetGlobalData().faraway_buy_ResData, Localization.Get("ui.expedition_view.resetNotEnough"), Localization.Get("ui.expedition_view.canResetOnce"), null, ExpendCostToResetMapHandler, ConsumeTipType.DiamondResetExpeditionCount);
             }
             else
             {
                 ExpendCostToResetMapHandler();
             }
             return;
         }
         int nextVip = ExpeditionProxy.instance.nextVipExtraBuyTimes;
         if (nextVip != 0)
         {
             ConfirmTipsView.Open(string.Format(Localization.Get("ui.expedition_view.improveVip"), nextVip), OpenRechargeHandler);
             return;
         }
         CommonErrorTipsView.Open(Localization.Get("ui.expedition_view.resetCountDown"));
         return;
     }
     else
     {
         ConfirmTipsView.Open(Localization.Get("ui.expedition_view.confirmResetTip"), ClickConfirmResetMapHandler);
     }
 }
        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);
        }
 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 ClickStartStrengthen()
        {
            EquipmentInfo equipInfo = EquipmentStrengthenProxy.instance.StrengthenEquipInfo;

            EquipmentInfo[] materials = EquipmentStrengthenProxy.instance.materialsEquipInfo;
            List <int>      selectedMaterialIDList = new List <int>();
            int             count                  = materials.Length;
            int             selectCount            = 0;
            bool            hasHighStrengthenLevel = false;
            bool            hasHighStar            = false;

            for (int i = 0; i < count; i++)
            {
                if (materials[i] != null)
                {
                    selectedMaterialIDList.Add(materials[i].instanceID);
                    selectCount++;
                    if (materials[i].strengthenLevel >= GlobalData.GetGlobalData().equipStrengthenLevelNotice)
                    {
                        hasHighStrengthenLevel = true;
                    }
                    if (materials[i].equipmentData.star >= 4)
                    {
                        hasHighStar = true;
                    }
                }
            }
            int money     = GameProxy.instance.BaseResourceDictionary.GetValue(BaseResType.Gold);
            int needMoney = coinText.text.ToInt32();

            if (EquipmentStrengthenNeedData.IsMaxLevel(equipInfo.strengthenLevel))
            {
                CommonErrorTipsView.Open(Localization.Get("ui.hero_strengthen_view.arrival_max_level"));
                return;
            }
            if (selectCount == 0)
            {
                CommonErrorTipsView.Open(Localization.Get("ui.hero_strengthen_view.material_not_enough"));
                return;
            }
            if (money < needMoney)
            {
                CommonErrorTipsView.Open(Localization.Get("ui.hero_strengthen_view.gold_not enough"));
                return;
            }
            if (hasHighStar)
            {
                string confirmTipsStr = Localization.Get("ui.equipment_strengthen_view.strengthen_materials_contains_high_star_equipment");
                Logic.UI.Tips.View.ConfirmTipsView.Open(confirmTipsStr, ConfirmStrengthen);
                return;
            }
            if (hasHighStrengthenLevel)
            {
                string confirmTipsStr = string.Format(Localization.Get("ui.equipment_strengthen_view.strengthen_materials_contains_high_strengthen_level_equipment"), GlobalData.GetGlobalData().equipStrengthenLevelNotice);
                Logic.UI.Tips.View.ConfirmTipsView.Open(confirmTipsStr, ConfirmStrengthen);
                return;
            }
            ConfirmStrengthen();
        }
示例#5
0
 public void UpdateHeroAdvanceByProtocol(bool isSuccess)
 {
     if (!isSuccess)
     {
         CommonErrorTipsView.Open(Localization.Get("ui.hero_advance_view.advance_fail"));
     }
     HeroAdvanceProxy.instance.advanceHeroInfo = HeroProxy.instance.GetHeroInfo(HeroAdvanceProxy.instance.advanceHeroInfo.instanceID);
     Refresh();
 }
示例#6
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);
                }
            }
        }
        public void ConfirmDrawTripleReward()
        {
            if (GameProxy.instance.BaseResourceDictionary[BaseResType.Diamond] < GlobalData.GetGlobalData().dailyDungeonAwardCostList[1].count)
            {
                CommonErrorTipsView.Open(Localization.Get("ui.daily_dungeon_win_view.diamond_not_enough_tips"));
                return;
            }

            ActivityController.instance.CLIENT2LOBBY_ACTIVITY_PVE_AWARD_REQ(2);
            drawMultipleRewardRootGameObject.SetActive(false);
        }
示例#8
0
        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);
        }
示例#9
0
 public void ClickReadyFightBtnHandler()
 {
     if (_isReadyFight)
     {
         if (PvpProxy.instance.PvpInfo.remainChallengeTimes == 0)
         {
             CommonErrorTipsView.Open(Localization.Get("ui.pvp_formation_view.notEnoughChallengeTimes"));
             return;
         }
         PvpFighterInfo challengeFighter = PvpProxy.instance.ChallengeFighter;
         PvpController.instance.CLIENT2LOBBY_RANK_ARENA_CHANLLENGE_REQ(challengeFighter);
     }
 }
示例#10
0
        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);
            }
        }
示例#11
0
 public bool canStartFight()
 {
     if (GameProxy.instance.PveAction - DungeonDetailProxy.instance.DungeonInfo.dungeonData.actionNeed < 0)
     {
         string tipString = Localization.Get("ui.common_tips.not_enough_pve_action_and_go_to_buy");
         ConfirmTipsView.Open(tipString, GoToBuyAction);
         return(false);
     }
     if (!DungeonDetailProxy.instance.DungeonInfo.hasChallengeTimes())
     {
         CommonErrorTipsView.Open(Localization.Get("ui.common_tips.not_enough_fight_times"));
         return(false);
     }
     return(true);
 }
        public void ClickExpandBagHandler()
        {
            if (GameProxy.instance.EquipCellNum >= GlobalData.GetGlobalData().equipPackageMaxNum)
            {
                CommonErrorTipsView.Open(Localization.Get("ui.common_tips.equipment_bag_reach_max"));
                return;
            }

            int cost = (GameProxy.instance.EquipCellBuyNum + 1) * GlobalData.GetGlobalData().equipPackageBuyA + GlobalData.GetGlobalData().equipPackageBuyB;

            //if(ConsumeTipProxy.instance.GetConsumeTipEnable(ConsumeTipType.DiamondBuyEquipGrid))
            Logic.UI.Tips.View.CommonExpandBagTipsView.Open(BagType.EquipmentBag, cost, ClickConfirmExpandBagHandler, ConsumeTipType.None);
            //else
            //	ClickConfirmExpandBagHandler();
        }
示例#13
0
        public void OnClickChangeFighterBtnHandler()
        {
            if (PvpProxy.instance.PvpInfo.remainRefreshTimes == 0)
            {
                CommonErrorTipsView.Open(Localization.Get("ui.pvp_view_refreshNotEnough"));
                return;
            }
            if (!PvpProxy.instance.IsChangeFighterRecoverOver)
            {
                CommonErrorTipsView.Open(Localization.Get("ui.pvp_view.refreshCD"));
                return;
            }

            PvpController.instance.CLIENT2LOBBY_REFRESH_OPPONENTS_REQ();
        }
示例#14
0
        public void ClickDrawTripleRewardButtonHandler()
        {
            multiple = Multiple.Triple;

            if (VIPProxy.instance.VIPLevel < GlobalData.GetGlobalData().dailyDungeonAwardVIPLevelList[1])
            {
                CommonErrorTipsView.Open(Localization.Get("ui.daily_dungeon_win_view.vip_level_not_enough_tips"));
                return;
            }

            if (ConsumeTipProxy.instance.GetConsumeTipEnable(ConsumeTipType.DiamondDrawMutipleReward))
            {
                ConsumeTipData consumeTipData = ConsumeTipData.GetConsumeTipDataByType(ConsumeTipType.DiamondDrawMutipleReward);
                ConfirmCostTipsView.Open(GlobalData.GetGlobalData().dailyDungeonAwardCostList[1], Localization.Get(consumeTipData.des), null, ConfirmDrawTripleReward, ConsumeTipType.DiamondDrawMutipleReward);
            }
            else
            {
                ConfirmDrawTripleReward();
            }
        }
示例#15
0
        public void ClickPutOnEquipmentHandler(EquipmentItem equipmentItem)
        {
            EquipmentProxy.instance.SetEquipmentAsChecked(equipmentItem.EquipmentInfo.instanceID);

            int oldWeaponID    = _roleInfo.weaponID;
            int oldArmorID     = _roleInfo.armorID;
            int oldAccessoryID = _roleInfo.accessoryID;
            //bool hasOldEquipment = false;
            EquipmentInfo oldEquip = null;
            EquipmentType type     = equipmentItem.EquipmentInfo.equipmentData.equipmentType;

            if (type == EquipmentType.PhysicalWeapon && oldWeaponID > 0)
            {
                oldEquip = EquipmentProxy.instance.GetEquipmentInfoByInstanceID(oldWeaponID);
            }
            else if (type == EquipmentType.Armor && oldArmorID > 0)
            {
                oldEquip = EquipmentProxy.instance.GetEquipmentInfoByInstanceID(oldArmorID);
            }
            else if (type == EquipmentType.Accessory && oldAccessoryID > 0)
            {
                oldEquip = EquipmentProxy.instance.GetEquipmentInfoByInstanceID(oldAccessoryID);
            }
            if (_roleInfo.level < equipmentItem.EquipmentInfo.equipmentData.useLv)
            {
                CommonErrorTipsView.Open(string.Format(Localization.Get("ui.role_equipments.notEnoughLv"), equipmentItem.EquipmentInfo.equipmentData.useLv));
                return;
            }
            if (oldEquip != null)
            {
//				ConfirmSubstituteEquipmentTipsView.Open(_roleInfo,equipmentItem.EquipmentInfo);
            }
            else
            {
                EquipmentController.instance.CLIENT2LOBBY_EQUIP_WEAR_OFF_REQ(equipmentItem.EquipmentInfo.instanceID, EquipmentWearOffType.Wear, false, (int)_roleInfo.instanceID);
            }
        }
示例#16
0
        public void ClickTeamToggleHandler(Toggle clickedTeamToggle)
        {
            if (clickedTeamToggle.isOn)
            {
                if (_currentSelectedTeamToggle == clickedTeamToggle)
                {
                    return;
                }

                int teamIndex = teamToggles.IndexOf(clickedTeamToggle) + 1;
                if (ManageHeroesProxy.instance.IsTeamUnlocked(teamIndex))
                {
                    ManageHeroesProxy.instance.CurrentSelectedFormationNo = teamIndex;
                    _currentSelectedTeamToggle = clickedTeamToggle;
                    Refresh();
                    ManageHeroesController.instance.CLIENT2LOBBY_PVE_TEAM_CHANGE_REQ();
                }
                else
                {
                    CommonErrorTipsView.Open(string.Format(Localization.Get("ui.manage_heroes_view.team_locked_tips"), teamIndex.ToString()));
                    _currentSelectedTeamToggle.isOn = true;
                }
            }
        }
示例#17
0
        public void ClickStartAdvanceHandler()
        {
            HeroInfo heroInfo = HeroAdvanceProxy.instance.advanceHeroInfo;

            HeroAdvanceData    advanceData  = HeroAdvanceData.GetHeroAdvanceDataByStar(heroInfo.advanceLevel);
            List <GameResData> itemDataList = advanceData.GetItemIdByHeroType(heroInfo.heroData.roleType);


            if (heroInfo.level < advanceData.lv_limit)
            {
                CommonErrorTipsView.Open(string.Format(Localization.Get("ui.hero_advance_view.level_not_enough"), advanceData.lv_limit));
                return;
            }
            GameResData resData;

            for (int i = 0, count = itemDataList.Count; i < count; i++)
            {
                resData = itemDataList[i];
                ItemInfo itemInfo = ItemProxy.instance.GetItemInfoByItemID(resData.id);
                if (itemInfo == null || itemInfo.count < resData.count)
                {
                    CommonErrorTipsView.Open(Localization.Get("ui.hero_advance_view.material_not_enough"));
                    return;
                }
            }

            int money = GameProxy.instance.BaseResourceDictionary.GetValue(BaseResType.Gold);

            if (money < advanceData.gold)
            {
                CommonErrorTipsView.Open(Localization.Get("ui.hero_advance_view.gold_not enough"));
                return;
            }

            HeroController.instance.CLIENT2LOBBY_HERO_ADVANCE_REQ((int)heroInfo.instanceID, 0);
        }
示例#18
0
        public void OnClickExchangeBtnHandler()
        {
            BlackMarketInfo info = BlackMarketProxy.instance.selectBlackMarketInfo;

            if (info == null)
            {
                CommonErrorTipsView.Open(Localization.Get("ui.black_market_view.choiceGoods"));
                return;
            }
            if (info.limitLv > GameProxy.instance.AccountLevel)
            {
                CommonErrorTipsView.Open(Localization.Get("ui.black_market_view.levelNotEnough"));
                return;
            }
            if (info.remaindCount == 0)
            {
                CommonErrorTipsView.Open(Localization.Get("ui.black_market_view.exchangeEmpty"));
                return;
            }
            List <GameResData> materials = info.materials;
            GameResData        resData;

            bool        hasDiamond     = false;
            GameResData diamondResData = null;

            for (int i = 0, count = materials.Count; i < count; i++)
            {
                resData = materials[i];
                int ownCount = 0;
                if (resData.type == BaseResType.Item)
                {
                    ownCount = ItemProxy.instance.GetItemCountByItemID(resData.id);
                }
                else
                {
                    ownCount = GameProxy.instance.BaseResourceDictionary.GetValue(resData.type);
                    if (resData.type == BaseResType.Diamond)
                    {
                        hasDiamond     = true;
                        diamondResData = resData;
                    }
                }
                if (ownCount < resData.count)
                {
                    CommonErrorTipsView.Open(Localization.Get("ui.black_market_view.notEnoughMaterial"));
                    return;
                }
            }
            if (hasDiamond)
            {
                if (ConsumeTipProxy.instance.GetConsumeTipEnable(ConsumeTipType.DiamondBuyBlackmarket))
                {
                    ConfirmBuyShopItemTipsView.Open("", diamondResData, ExchangeSureHandler, ConsumeTipType.DiamondBuyBlackmarket);
                }
                else
                {
                    ExchangeSureHandler();
                }
            }
            else
            {
                ExchangeSureHandler();
            }
        }
示例#19
0
        public void ClickBuyHandler()
        {
            int            shopID          = 0;
            int            shopItemID      = 0;
            string         shopItemName    = string.Empty;
            GameResData    costGameResData = null;
            int            costType        = 1;
            ConsumeTipType consumTipType   = ConsumeTipType.None;          //提示

            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;
                }
                consumTipType = _shopHeroRandomCardInfo.ShopCardRandomData.buyType == 1 ? ConsumeTipType.DiamondDrawSingleHero : ConsumeTipType.DiamondDrawTenHeroes;
            }
            else if (_shopEquipmentRandomCardInfo != null)
            {
                shopID          = _shopEquipmentRandomCardInfo.ShopCardRandomData.shopID;
                shopItemID      = _shopEquipmentRandomCardInfo.ShopCardRandomData.id;
                shopItemName    = Localization.Get(_shopEquipmentRandomCardInfo.ShopCardRandomData.name);
                costGameResData = _shopEquipmentRandomCardInfo.ShopCardRandomData.costGameResData;
                if (_shopEquipmentRandomCardInfo.RemainFreeTimes > 0 && _shopEquipmentRandomCardInfo.NextFreeBuyCountDownTime <= 0)
                {
                    costType = 0;
                }
//				consumTipType = _shopEquipmentRandomCardInfo.ShopCardRandomData.buyType == 1 ? ConsumeTipType.DiamondSingleLotteryEquip : ConsumeTipType.None;
            }
            else if (_shopDiamondItemInfo != null)
            {
                shopID          = _shopDiamondItemInfo.ShopDiamondData.shopID;
                shopItemID      = _shopDiamondItemInfo.ShopDiamondData.id;
                shopItemName    = Localization.Get(_shopDiamondItemInfo.ShopDiamondData.name);
                costGameResData = _shopDiamondItemInfo.ShopDiamondData.costGameResData;
            }
            else if (_shopActionItemInfo != null)
            {
                shopID          = _shopActionItemInfo.ShopLimitItemData.shopID;
                shopItemID      = _shopActionItemInfo.ShopLimitItemData.id;
                shopItemName    = Localization.Get(_shopActionItemInfo.ShopLimitItemData.name);
                costGameResData = _shopActionItemInfo.ShopLimitItemData.costGameResData;
                BaseResType resourseResType = _shopActionItemInfo.ShopLimitItemData.resourseGameResData.type;
                if (resourseResType == BaseResType.TowerAction)
                {
                    consumTipType = ConsumeTipType.DiamondBuyWorldTreeCount;
                }
                else if (resourseResType == BaseResType.PvpAction)
                {
                    consumTipType = ConsumeTipType.DiamondBuyPvpCount;
                }
                else if (resourseResType == BaseResType.PveAction)
                {
                    consumTipType = ConsumeTipType.DiamondBuyPveAction;
                }
            }
            else if (_shopGoldItemInfo != null)
            {
                shopID          = _shopGoldItemInfo.ShopLimitItemData.shopID;
                shopItemID      = _shopGoldItemInfo.ShopLimitItemData.id;
                shopItemName    = Localization.Get(_shopGoldItemInfo.ShopLimitItemData.name);
                costGameResData = _shopGoldItemInfo.ShopLimitItemData.costGameResData;
                consumTipType   = ConsumeTipType.DiamondBuyCoin;
            }
            else if (_shopGoodsItemInfo != null)
            {
                shopID          = _shopGoodsItemInfo.ShopGoodsData.shopID;
                shopItemID      = _shopGoodsItemInfo.ShopGoodsData.id;
                shopItemName    = Localization.Get(_shopGoodsItemInfo.ShopGoodsData.name);
                costGameResData = _shopGoodsItemInfo.ShopGoodsData.costGameResData;
            }

            // 对于限制购买次数的物品,先判断是否还有购买次数
            if (_shopActionItemInfo != null || _shopGoldItemInfo != null)
            {
                ShopLimitItemData shopLimitItemData = null;
                if (_shopActionItemInfo != null)
                {
                    shopLimitItemData = _shopActionItemInfo.ShopLimitItemData;
                    if (shopLimitItemData.baseResType == BaseResType.PveAction)
                    {
                        if (shopLimitItemData.id > VIPProxy.instance.VIPData.pveActionBuyTimes)
                        {
                            ConfirmTipsView.Open(Localization.Get("ui.shop_view.not_enough_remain_times_tips"), ClickGoToBuyDiamond);
                            return;
                        }
                    }
                    else if (shopLimitItemData.baseResType == BaseResType.TowerAction)
                    {
                        if (shopLimitItemData.id > VIPProxy.instance.VIPData.worldTreeActionBuyTimes)
                        {
                            ConfirmTipsView.Open(Localization.Get("ui.shop_view.not_enough_remain_times_tips"), ClickGoToBuyDiamond);
                            return;
                        }
                    }
                }
                else if (_shopGoldItemInfo != null)
                {
                    shopLimitItemData = _shopGoldItemInfo.ShopLimitItemData;
                    if (shopLimitItemData.id > VIPProxy.instance.VIPData.goldBuyTimes)
                    {
                        ConfirmTipsView.Open(Localization.Get("ui.shop_view.not_enough_remain_times_tips"), ClickGoToBuyDiamond);
                        return;
                    }
                }
            }
            // 对于限制购买次数的物品,先判断是否还有购买次数

            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)
                    {
                        if (costGameResData.type == BaseResType.Diamond)
                        {
                            string diamondNotEnoughTipsString = Localization.Get("ui.common_tips.not_enough_diamond_and_go_to_buy");
                            ConfirmTipsView.Open(diamondNotEnoughTipsString, ClickGoToBuyDiamond, ConsumeTipType.None);
                        }
                        else
                        {
                            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(consumTipType))
                        {
                            ConfirmBuyShopItemTipsView.Open(shopItemName, costGameResData, ClickConfirmBuyHandler, consumTipType);
                        }
                        else
                        {
                            ClickConfirmBuyHandler();
                        }
                    }
                    else
                    {
                        ShopController.instance.CLIENT2LOBBY_PURCHASE_GOODS_REQ(shopID, shopItemID, costType);
                    }
                }
                else
                {
                    ShopController.instance.CLIENT2LOBBY_PURCHASE_GOODS_REQ(shopID, shopItemID, costType);
                }
                Debugger.Log(string.Format("[ShopItemView]shopid:{0},shopitemid:{1},costtype:{2}", shopID, shopItemID, costType));
            }
        }
示例#20
0
 private void ShowSingleTips(string message)
 {
     CommonErrorTipsView.Open(message);
 }